packages feed

pandoc 2.2.1 → 2.2.2

raw patch · 93 files changed

+1369/−624 lines, 93 filesdep +HsYAMLdep +basementdep +foundationdep −scientificdep −yamldep ~JuicyPixelsdep ~aesondep ~base

Dependencies added: HsYAML, basement, foundation

Dependencies removed: scientific, yaml

Dependency ranges changed: JuicyPixels, aeson, base, base-compat, criterion, haddock-library, network, pandoc-types, skylighting, tasty, texmath

Files

CONTRIBUTING.md view
@@ -144,13 +144,10 @@ 9.  It is better not to introduce new dependencies.  Dependencies on     external C libraries should especially be avoided. -10. We aim for compatibility with ghc versions from 7.8.3 to the+10. We aim for compatibility with ghc versions from 7.10.3 to the     latest release.  All pull requests and commits are tested     automatically on <travis-ci.org>, using GHC versions in the-    `Tested-With` stanza of `pandoc.cabal`.  We currently relax-    the "`-Wall` clean" requirement for GHC 7.10.x, because-    there are so many warnings relating to the addition of type-    classes to the Prelude.+    `Tested-With` stanza of `pandoc.cabal`.  Tests -----@@ -267,7 +264,7 @@   - `Text.Pandoc.Definition` (in `pandoc-types`) defines the types     used for representing a pandoc document.   - `Text.Pandoc.Builder` (in `pandoc-types`) provides functions for-    building pandoc documents programatically.+    building pandoc documents programmatically.   - `Text.Pandoc.Generics` (in `pandoc-types`) provides functions allowing     you to promote functions that operate on parts of pandoc documents     to functions that operate on whole pandoc documents, walking the
INSTALL.md view
@@ -17,9 +17,6 @@  ## macOS -  - You can install pandoc using-    [homebrew](http://brew.sh): `brew install pandoc`.-   - There is a package installer at pandoc's [download page].     If you later want to uninstall the package, you can do so     by downloading [this script][uninstaller]@@ -29,6 +26,12 @@     pages, for those who prefer not to use the installer.  Simply     unzip the file and move the binaries and man pages to     whatever directory you like.++  - Alternatively, you can install pandoc using+    [homebrew](http://brew.sh): `brew install pandoc`.+    Note: If you are using macOS < 10.10, this method installs +    pandoc from source, so it will take a long time and a lot of +    disk space for the ghc compiler and dependent Haskell libraries.    - For PDF output, you'll also need LaTeX.  Because a full [MacTeX]     installation takes more than a gigabyte of disk space, we recommend
MANUAL.txt view
@@ -1,6 +1,6 @@ % Pandoc User's Guide % John MacFarlane-% May 10, 2018+% July 15, 2018  Synopsis ========@@ -493,7 +493,7 @@     footnotes and links will not work across files. Reading binary     files (docx, odt, epub) implies `--file-scope`. -`--filter=`*PROGRAM*+`-F` *PROGRAM*, `--filter=`*PROGRAM*  :   Specify an executable to be used as a filter transforming the     pandoc AST after the input is parsed and before the output is@@ -645,10 +645,10 @@     output.  For `native` output, this option causes metadata to     be included; otherwise, metadata is suppressed. -`--template=`*FILE*+`--template=`*FILE*|*URL* -:   Use *FILE* as a custom template for the generated document. Implies-    `--standalone`. See [Templates], below, for a description+:   Use the specified file as a custom template for the generated document.+    Implies `--standalone`. See [Templates], below, for a description     of template syntax. If no extension is specified, an extension     corresponding to the writer will be added, so that `--template=special`     looks for `special.html` for HTML output.  If the template is not@@ -713,8 +713,9 @@ :   Include an automatically generated table of contents (or, in     the case of `latex`, `context`, `docx`, `odt`,     `opendocument`, `rst`, or `ms`, an instruction to create-    one) in the output document. This option has no effect on-    `man`, `docbook4`, `docbook5`, or `jats` output.+    one) in the output document. This option has no effect+    unless `-s/--standalone` is used, and it has no effect+    on `man`, `docbook4`, `docbook5`, or `jats` output.  `--toc-depth=`*NUMBER* @@ -808,7 +809,8 @@ :   Set the request header *NAME* to the value *VAL* when making     HTTP requests (for example, when a URL is given on the     command line, or when resources used in a document must be-    downloaded).+    downloaded). If you're behind a proxy, you also need to set+    the environment variable `http_proxy` to `http://...`.  Options affecting specific writers ----------------------------------@@ -1723,8 +1725,7 @@ - any object, - the boolean `true` (to specify the boolean `true`   value using YAML metadata or the `--metadata` flag,-  use `y`, `Y`, `yes`, `Yes`, `YES`, `true`, `True`,-  `TRUE`, `on`, `On`, or `ON`; with the `--variable`+  use `true`, `True`, or `TRUE`; with the `--variable`   flag, simply omit a value for the variable, e.g.   `--variable draft`). @@ -3057,7 +3058,9 @@ existing document metadata.  Metadata can contain lists and objects (nested arbitrarily), but all string scalars will be interpreted as Markdown.  Fields with names ending in an underscore will be ignored by pandoc.  (They may be-given a role by external processors.)+given a role by external processors.)  Field names must not be+interpretable as YAML numbers or boolean values (so, for+example, `yes`, `True`, and `15` cannot be used as field names).  A document may contain multiple metadata blocks.  The metadata fields will be combined through a *left-biased union*:  if two metadata blocks attempt@@ -3290,9 +3293,14 @@ TeX math will be printed in all output formats. How it is rendered depends on the output format: -Markdown, LaTeX, Emacs Org mode, ConTeXt, ZimWiki-  ~ It will appear verbatim between `$` characters.+LaTeX+  ~ It will appear verbatim surrounded by `\(...\)` (for inline+    math) or `\[...\]` (for display math). +Markdown, Emacs Org mode, ConTeXt, ZimWiki+  ~ It will appear verbatim surrounded by `$...$` (for inline+    math) or `$$...$$` (for display math).+ reStructuredText   ~ It will be rendered using an [interpreted text role `:math:`]. @@ -3976,7 +3984,7 @@ [Chicago Manual of Style]: http://chicagomanualofstyle.org [Citation Style Language]: http://citationstyles.org [Zotero Style Repository]: https://www.zotero.org/styles-[finding and editing styles]: http://citationstyles.org/styles/+[finding and editing styles]: https://citationstyles.org/authors/ [CSL locale files]: https://github.com/citation-style-language/locales [pandoc-citeproc man page]: https://github.com/jgm/pandoc-citeproc/blob/master/man/pandoc-citeproc.1.md @@ -4438,7 +4446,7 @@ All of the other frame attributes described in Section 8.1 of the [Beamer User's Guide] may also be used: `allowdisplaybreaks`, `allowframebreaks`, `b`, `c`, `t`, `environment`, `label`, `plain`,-`shrink`.+`shrink`, `standout`, `noframenumbering`.  Background in reveal.js -----------------------@@ -4593,8 +4601,9 @@ Linked media ------------ -By default, pandoc will download linked media (including audio and-video) and include it in the EPUB container, yielding a completely+By default, pandoc will download media referenced from any `<img>`, `<audio>`,+`<video>` or `<source>` element present in the generated EPUB,+and include it in the EPUB container, yielding a completely self-contained EPUB.  If you want to link to external media resources instead, use raw HTML in your source and add `data-external="1"` to the tag with the `src` attribute.  For example:
changelog view
@@ -1,3 +1,175 @@+pandoc (2.2.2)++  * Use HsYAML instead of yaml for translations and YAML metadata (#4747).+    yaml wraps a C library; HsYAML is pure Haskell.  Advances #4535.++    Note: HsYAML implements YAML 1.2, in which the valid true+    values are `true`, `True`, `TRUE`.  This means a change in+    the semantics of YAML metadata that could affect users:+    `y`, `yes`, and `on` no longer count as true values.++  * Fix regression: make `--pdf-engine` work with full paths (#4681, Mauro+    Bieg).++  * CommonMark reader: Handle `ascii_identifiers` extension (#4742,+    Anders Waldenborg).  Non-ascii characters were not stripped from+    identifiers even if the `ascii_identifiers` extension was+    enabled (which is is by default for gfm).++  * TikiWiki reader: Improve list parsing (#4722, Mauro Bieg).+    Remove trailing Space from list items.  Parse lists that have no space+    after marker.++  * LaTeX reader:++    + Treat `lilypond` as a verbatim environment (#4725).+    + Parse figure label into Image id (#4700, Mauro Bieg).+    + Beamer: Allow "noframenumbering" option (#4696, Raymond Ehlers).+    + Allow spaces around `\graphicspath` arguments (#4698).+    + Handle includes without surrounding blanklines (#4553).+      In addition, `\input` can now be used in an inline context,+      e.g. to provide part of a paragraph, as it can in LaTeX.+    + In `rawLaTeXBlock`, handle macros that resolve to a+      `\begin` or `\end` (#4667).+    + In `rawLaTeXBlock`, don't expand macros in macro definitions (#4653).+      Note that this only affected LaTeX in markdown.+    + Tighten up reading of beamer overlay specifications (#4669).+      Ideally we'd turn these on only when reading beamer, but currently+      beamer is not distinguished from latex as an input format.+      This commit also activates parsing of overlay specifications+      after commands in general (e.g. `\item`), since they can occur+      in many contexts in beamer.+    + Parse more siunitx unit commands (#4296, #4773).+    + Be more forgiving in key/value option parsing (#4761).++  * Markdown reader:++    + Allow empty code spans, e.g. `` ` ` ``.+    + Emojis are now wrapped in Spans with class `emoji` and+      attribute `data-emoji` (Anders Waldenborg, #4743).+      This allows the writer to handle them in a special way+      (e.g. using a special font, or just rendering the+      emoji name).++  * Muse reader (Alexander Krotov, except where indicated):++    + Get rid of non-exhaustive pattern match warning (Mauro Bieg).+    + Add support for floating images.+    + Add support for images with specified width.+    + Parse image URLs without "guard" and "takeExtension".+    + Split link and image parsing into separate functions.+    + Parse links starting with "URL:" explicitly instead of trying to strip+      "URL:" prefix after parsing.++  * Texinfo writer: Use `@sup` and `@sub` instead of custom macros (#4728,+    Alexander Krotov).++  * Markdown writer: Preserve `implicit_figures` with attributes, even if+    `implicit_attributes` is not set, by rendering in raw HTML (#4677).++  * Markdown and commonmark/github writers now respect the `emoji`+    extension.  So, `-f markdown+emoji -t markdown+emoji` now leaves+    `:smile:` as `:smile:` rather than converting it to a smile+    character.++  * Docx writer: Be sensitive to `toc` in YAML metadata (#4645).++  * ODT/OpenDocument writer: Make internal links work (#4358).+    This adds proper bookmarks to the headers with non-null IDs.++  * EPUB writer: Properly escape pagetitle.  Previously we weren't+    escaping `&` and other XML characters in the pagetitle, so a title+    containing a `&` would be invalid.++  * AsciiDoc Writer: Eescape square brackets at start of line (#4545,+    Mauro Bieg).++  * RST writer:++    + Don't treat 'example' as a syntax name (#4748).+      This fixes conversions from org with example blocks.+    + Support `--number-sections` via the `section-numbering`+      directive in standalone output.++  * reveal.js writer and template: reuse mathjax URL+    provided by the argument to `--mathjax` or the normal pandoc default,+    rather than a hard-coded one in the template (#4701).++  * LaTeX writer:++    + Properly handle footnotes in table captions (#4683).+      Refactored code from figure captions to use in both places.+    + In beamer output, fix single digit column percentage (#4690, Mauro+      Bieg).++  * FB2 writer (Alexander Krotov):++    + Convert Plain to Para in annotation (#2424).+    + Fix order of items in title-info (#2424).++  * Custom writer: fix error message on script failure (Albert Krewinkel).+    Error messages produced by Lua were not displayed by Pandoc.++  * Text.Pandoc.Emoji now exports `emojiToInline`, which returns a Span+    inline containing the emoji character and some attributes with metadata+    (class `emoji`, attribute `data-emoji` with emoji name).  (API change,+    Anders Waldenborg, #4743).++  * Text.Pandoc.PDF:++    + Revert fix for #4484 (only compress images on last run, #4755).+      This will mean some increase in the time it takes to+      produce an image-heavy PDF with xelatex, but it will+      make tables of contents correct, which is more important.+    + Fix logic error in `runTeXProgram`.  We were running the tex program+      one more time than requested.  This should speed up PDF production.++  * Allow `--template` to take a URL as argument.++  * Text.Pandoc.Highlighting: Add missing re-export of `breezeDark`+    highlighting style (#4687, Adrian Sieber, API change).++  * Clarify macOS install in INSTALL.md (#4661).  Make the binary package+    installer the recommended method, and note that on some older versions of+    macOS, homebrew installs from source and takes a lot of disk space+    (#4664, Ian).++  * MANUAL:++    + Clarify EPUB linked media (#4756, Mauro Bieg)+    + Update manual for "true" YAML values.  Now that we're using HsYAML and+      YAML 1.2, the valid true values are `true`, `True`, `TRUE`.  NOTE!+      `y`, `yes`, `on` no longer count as true values.+    + Document `-F` as alias for `--filter` (thanks to Gandalf Saxe).+    + Update manual on how math is rendered in LaTeX.+    + Add proxy description (#4131, Mauro Bieg).+    + Clarify that `--toc` requires `--standalone` (#4703).+    + Update citation styles link (#4699, wiefling).++  * In API docs, clarify how `Ext_east_asian_line_breaks` extension works+    (kaizshang91).  Note that it will not take effect when readers/writers+    are called as libraries (#4674).++  * Improved translations/fr (#4766, lux-lth).++  * Removed inadvertently added `.orig` files from repository (#4648).++  * Remove `network-uri` flag and use 'Network.Socket'.+    This removes a compiler warning.  There is no need for the old+    `network-uri` flag, since network 2.6 was released in 2014.++  * Add stack.lts10.yaml, stack.lts11.yaml.  use lts-12 in stack.yaml.++  * Bump upper bounds for dependent packages.++  * Exclude foundation 0.0.21 for ghc 7.10.  Otherwise cabal gets+    confused because of the way ghc 7.10 is excluded in foundation's+    cabal file.  This can be removed when haskell-foundation/foundation#500+    is fixed.++  * Require cabal-version >= 2.0.  This is needed for haddock-library.++ pandoc (2.2.1)    * Restored and undeprecated gladtex for HTML math (#4607).@@ -432,7 +604,7 @@   * JATS writer: Remove extraneous, significant whitespace (#4335,     Nokome Bentley). -  * html2pdf: inject base tag wih current working directory (#4413, Mauro+  * html2pdf: inject base tag with current working directory (#4413, Mauro     Bieg).  This helps ensure that linked resources are included.    * Add Semigroup instances for everything for which we defined a@@ -580,7 +752,7 @@   * Docx reader (Jesse Rosenthal, except where noted):      + Handle nested sdt tags (#4415).-    + Don't look up dependant run styles if `+styles` is enabled.+    + Don't look up dependent run styles if `+styles` is enabled.     + Move pandoc inline styling inside custom-style span.     + Read custom styles (#1843).  This will read all paragraph and       character classes as divs and spans, respectively. Dependent styles@@ -2283,7 +2455,7 @@    * Removed `hard_line_breaks` extension from `markdown_github` (#3594).     GitHub has two Markdown modes, one for long-form documents like READMEs-    and one for short things like issue coments. In issue comments, a line+    and one for short things like issue comments. In issue comments, a line     break is treated as a hard line break. In README, wikis, etc., it is     treated as a space as in regular Markdown.  Since pandoc is more likely to     be used to convert long-form documents from GitHub Markdown,@@ -2636,7 +2808,7 @@     top-level `Text.Pandoc` module.      + Changed `StringWriter` -> `TextWriter`.-    + `getWriter` now retuns a pair of a reader and+    + `getWriter` now returns a pair of a reader and       `Extensions`, instead of building the extensions into the       reader (#3659).  The calling code must explicitly set       `readerExtensions` using the `Extensions` returned.  The@@ -3049,7 +3221,7 @@       of item disappear or are misplaced.  Use `\texttt` instead.     + Fix problem with escaping in `lstinline` (#1629).  Previously the       LaTeX writer created invalid LaTeX when `--listings` was specified and-      a code span occured inside emphasis or another construction.+      a code span occurred inside emphasis or another construction.     + Fix error with line breaks after empty content (#2874).  LaTeX       requires something before a line break, so we insert a `~` if no       printable content has yet been emitted.@@ -3156,7 +3328,7 @@      + Don't drop smartTag contents (#2242).     + Handle local namespace declarations (#3365).  Previously we didn't-      recognize math, for example, when the xmlns declaration occured on+      recognize math, for example, when the xmlns declaration occurred on       the element and not the root.     + More efficient trimSps (#1530).  Replacing `trimLineBreaks`.  This       does the work of `normalizeSpaces` as well, so we avoid the need for@@ -3390,7 +3562,7 @@     + Allow `]` inside group in option brackets (#3857).     + lstinline with braces can be used (verb cannot be used with braces)       (Marc Schreiber, #3535).-    + Fix keyval funtion: pandoc did not parse options in braces correctly+    + Fix keyval function: pandoc did not parse options in braces correctly       (Marc Schreiber, #3642).     + When parsing raw LaTeX commands, include trailing space (#1773).       Otherwise things like `\noindent foo` break and turn into@@ -3482,7 +3654,7 @@       parse, the parser was applied too often, consuming too much of the       input. This only affects `many1Till p end` where `p` matches on a       prefix of `end`.-    + Provide `parseFromString` (#3690).  This is a verison of+    + Provide `parseFromString` (#3690).  This is a version of       `parseFromString` specialied to ParserState, which resets       `stateLastStrPos` at the end.  This is almost always what we want.       This fixes a bug where `_hi_` wasn't treated as emphasis in the@@ -3588,7 +3760,7 @@     + Use `unicode-math` (Vaclav Haisman).  Use `mathspec` with only       XeLaTeX on request.     + Don't load `fontspec` before `unicode-math` (over there).-      The `unicode-math` package loads `fontspec` so explict loading of+      The `unicode-math` package loads `fontspec` so explicit loading of       `fontspec` before `unicode-math` is not necessary.     + Use `unicode-math` by default in default.latex template.  mathspec will       be used in xelatex if the `mathspec` variable is set; otherwise@@ -4241,7 +4413,7 @@     is now used in parsing RST and Markdown line blocks, DocBook     `linegroup`/`line` combinations, and Org-mode `VERSE` blocks.     Previously `Para` blocks with hard linebreaks were used.  `LineBlock`s-    are handled specially in the following ouput formats: AsciiDoc+    are handled specially in the following output formats: AsciiDoc     (as `[verse]` blocks), ConTeXt (`\startlines`/`\endlines`),     HTML (`div` with a style), Markdown (line blocks if `line_blocks`     is enabled), Org-mode (`VERSE` blocks), RST (line blocks). In@@ -4388,7 +4560,7 @@       comma-separated list.     + Give precedence to later meta lines.  The last meta-line of any given       type is the significant line.  Previously the value of the first line-      was kept, even if more lines of the same type were encounterd.+      was kept, even if more lines of the same type were encountered.     + Read LaTeX_header as header-includes.  LaTeX-specific header commands       can be defined in `#+LaTeX_header` lines.  They are parsed as       format-specific inlines to ensure that they will only show up in LaTeX@@ -4436,7 +4608,7 @@       be able to figure out internal links to a header in a docx if the       anchor span was empty. We change that to read the inlines out of the       first anchor span in a header.-    + Let headers use exisiting id.  Previously we always generated an id for+    + Let headers use existing id.  Previously we always generated an id for       headers (since they wouldn't bring one from Docx). Now we let it use an       existing one if possible. This should allow us to recurs through anchor       spans.@@ -4543,7 +4715,7 @@     + Don't emit HTML for tables unless `raw_html` extension is set (#3154).       Emit `[TABLE]` if no suitable table formats are enabled and raw HTML       is disabled.-    + Check for the `raw_html` extension before emiting a raw HTML block.+    + Check for the `raw_html` extension before emitting a raw HTML block.     + Abstract out note/ref function (Jesse Rosenthal).     + Add ReaderT monad for environment variables (Jesse Rosenthal). @@ -5023,7 +5195,7 @@       character.  Empty rows where parsed as alignment rows and dropped from       the output.     + Fix spacing after LaTeX-style symbols.-      The org-reader was droping space after unescaped LaTeX-style symbol+      The org-reader was dropping space after unescaped LaTeX-style symbol       commands: `\ForAll \Auml` resulted in `∀Ä` but should give `∀ Ä`       instead.  This seems to be because the LaTeX-reader treats the       command-terminating space as part of the command.  Dropping the trailing@@ -5117,7 +5289,7 @@     + Clarified documentation of `implicit_header_references` (#2904).     + Improved documentation of `--columns` option. -  * Added appveyor setup, with artefacts (Jan Schulz).+  * Added appveyor setup, with artifacts (Jan Schulz).    * stack.yaml versions: Use proper flags used for texmath, pandoc-citeproc. @@ -5356,7 +5528,7 @@    * Entity handling fixes: improved handling of entities like     `&lang;` that require a trailing semicolon.  Allow uppercase-    `x` in numerical hexidecimal character references, working+    `x` in numerical hexadecimal character references, working     around a tagsoup bug.    * `stack.yaml` - use lts-4.0, but with older aeson to avoid excessive@@ -6852,7 +7024,7 @@   * `Text.Pandoc.Shared`:      + Make safeRead safe (#1801, Matthew Pickering).-    + Addded `mapLeft`, `hush` (Matthew Pickering).+    + Added `mapLeft`, `hush` (Matthew Pickering).    * `Text.Pandoc.Pretty`: @@ -6920,7 +7092,7 @@      + Use `text:p` instead of `text:h` for title.       Using `text:h` causes problems with numbering.  Closes #2059.-      Thansk to @nkalvi for diagnosing this.+      Thanks to @nkalvi for diagnosing this.    * reveal.js template: @@ -7026,7 +7198,7 @@     + Parse RST class directives. The class directive accepts one or more       class names, and creates a Div value with those classes.  If the       directive has an indented body, the body is parsed as the children of-      the Div.  If not, the first block folowing the directive is made a+      the Div.  If not, the first block following the directive is made a       child of the Div. This differs from the behavior of rst2xml, which       does not create a Div element.  Instead, the specified classes are       applied to each child of the directive.  However, most Pandoc Block@@ -7971,7 +8143,7 @@     different versions of the `directory` library.    + Added `Text.Pandoc.Compat.Except` to allow building against-    different verions of `mtl`.+    different versions of `mtl`.    * Code cleanup in some writers, using Reader monad to avoid     passing options parameter around (Matej Kollar).@@ -8631,7 +8803,7 @@     + Parse contents of curly quotes or matched `"` as quotes.     + Support `\textnormal` as span with class `nodecor`.       This is needed for pandoc-citeproc.-    + Improved citation parsing.  This fixes a run-time error that occured+    + Improved citation parsing.  This fixes a run-time error that occurred       with `\citet{}` (empty list of keys).  It also ensures that empty keys       don't get produced. @@ -8914,7 +9086,7 @@     to make that the current directory before running pandoc. (#942)    * Better error reporting in some readers, due to changes in `readWith`:-    the line in which the error occured is printed, with a caret pointing+    the line in which the error occurred is printed, with a caret pointing     to the column.    * All slide formats now support incremental slide view for definition lists.@@ -9608,7 +9780,7 @@     + Include HTML TOC, even in epub2.  The TOC is included in `<spine>`,       but `linear` is set to `no` unless the `--toc` option is specified.       Include `<guide>` element in OPF.  This should allow the TOC to-      be useable in Kindles when converted with kindlegen. Closes #773.+      be usable in Kindles when converted with kindlegen. Closes #773.    * `Text.Pandoc.Parsing`: Optimized `oneOfStringsCI`.     This dramatically reduces the speed penalty that comes from enabling the@@ -9973,7 +10145,7 @@   [API changes]    * `Text.Pandoc.Definition`: Added `Attr` field to `Header`.-    Previously header identifers were autogenerated by the writers.+    Previously header identifiers were autogenerated by the writers.     Now they are added in the readers (either automatically or explicitly).    * `Text.Pandoc.Builder`:@@ -10210,7 +10382,7 @@       incorrectly implented RST-style autolinks for URLs and email       addresses.  This has been fixed.  Now an autolink is done this way:       `"$":http://myurl.com`.-    + Fixed footnotes bug in textile.  This affected notes occuring+    + Fixed footnotes bug in textile.  This affected notes occurring       before punctuation, e.g. `foo[1].`.  Closes #518.    * LaTeX reader:@@ -11243,7 +11415,7 @@     Items are no longer installed as root.     Man pages are zipped and given proper permissions. -  * Modified windows installer generater to use cabal-dev.+  * Modified windows installer generator to use cabal-dev.    * Setup: Making man pages now works with cabal-dev (at least on OSX). In     Setup.hs we now invoke 'runghc' in a way that points it to the correct@@ -12286,7 +12458,7 @@       better browsers) as text/html.     + Removed Text.Pandoc.LaTeXMathML.  The module was no longer       necessary; it was replaced by two lines in pandoc.hs.-    + Replaced LaTeXMathML.js.commend and LaTeXMathML.js.packed with a+    + Replaced LaTeXMathML.js.comment and LaTeXMathML.js.packed with a       single combined file, LaTeXMathML.js.    * Added --data-dir option.@@ -12520,7 +12692,7 @@   * Replaced old headers with templates.  Now users have much more     control over the way documents appear in --standalone mode,     and writer code is simplified.  Resolves Issues #59, 147.-    Every effort has been made to retain backwards compatibilty.+    Every effort has been made to retain backwards compatibility.     So, the --custom-header option should still work as before.      + Added Text.Pandoc.Templates.  This provides functions for@@ -13488,7 +13660,7 @@      + Don't interpret contents of style tags as markdown.       (Resolves Issue #40.)-      - Added htmlStyle, analagous to htmlScript.+      - Added htmlStyle, analogous to htmlScript.       - Use htmlStyle in htmlBlockElement and rawHtmlInline.       - Moved "script" from the list of tags that can be either block or         inline to the list of block tags.@@ -14267,7 +14439,7 @@       notes and add information to state. (Reference keys may be needed       at this stage.) Finally, parse everything else.     + Replaced named constants like 'emphStart' with literals.-    + Removed an extra occurance of escapedChar in definition of inline.+    + Removed an extra occurrence of escapedChar in definition of inline.    * RST reader: @@ -14307,7 +14479,7 @@     + The Html header is now written programmatically, so it has been       removed from the 'headers' directory. The S5 header is still       needed, but the doctype and some of the meta declarations have-      been removed, since they are written programatically. This change+      been removed, since they are written programmatically. This change       introduces a new dependency on the xhtml package.     + Fixed two bugs in email obfuscation involving improper escaping       of '&' in the `<noscript>` section and in `--strict` mode. Resolves@@ -14616,7 +14788,7 @@     + win-pkg target creates Windows binary package.     + tarball target creates distribution source tarball.     + website target generates pandoc's website automatically, including-      demos.  New 'web' directory containts files needed for construction+      demos.  New 'web' directory contains files needed for construction       of the website (which will be created as the 'pandoc' subdirectory       of 'web').     + Makefile checks to see if we're running Windows/Cygwin; if so,
data/pandoc.lua view
@@ -124,7 +124,7 @@ Type.behavior.__index = Type.behavior  --- Set a new behavior for the type, inheriting that of the parent type if none---- is specified explicitely+--- is specified explicitly -- @param behavior the behavior object for this type. -- @local function Type:set_behavior (behavior)
data/templates/default.revealjs view
@@ -237,7 +237,7 @@ $endif$ $if(mathjax)$         math: {-          mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',+          mathjax: '$mathjaxurl$',           config: 'TeX-AMS_HTML-full',           tex2jax: {             inlineMath: [['\\(','\\)']],
data/templates/default.rst view
@@ -31,6 +31,10 @@ ..  $endif$+$if(number-sections)$+.. section-numbering::++$endif$ $for(header-includes)$ $header-includes$ 
data/templates/default.texinfo view
@@ -10,28 +10,6 @@ @end macro  $endif$-$if(subscript)$-@macro textsubscript{text}-@iftex-@textsubscript{\text\}-@end iftex-@ifnottex-_@{\text\@}-@end ifnottex-@end macro--$endif$-$if(superscript)$-@macro textsuperscript{text}-@iftex-@textsuperscript{\text\}-@end iftex-@ifnottex-^@{\text\@}-@end ifnottex-@end macro--$endif$ @ifnottex @paragraphindent 0 @end ifnottex
data/translations/fr.yaml view
@@ -1,20 +1,20 @@ Abstract: Résumé Appendix: Annexe Bibliography: Bibliographie-Cc: Copie à-Chapter: Chaptire+Cc: Cc+Chapter: Chapitre Contents: Table des matières-Figure: Fig.-Glossary:+Figure: Figure+Glossary: Glossaire Index: Index ListOfFigures: Table des figures ListOfTables: Liste des tableaux-Page: page-Part: partie+Page: Page+Part: Partie Preface: Préface Proof: Démonstration References: Références-See: voir-SeeAlso: voir aussi-Table: Tab.-To:+See: Voir+SeeAlso: Voir aussi+Table: Tableau+To: À
man/pandoc.1 view
@@ -1,5 +1,5 @@ .\"t-.TH PANDOC 1 "May 10, 2018" "pandoc 2.2.1"+.TH PANDOC 1 "July 15, 2018" "pandoc 2.2.2" .SH NAME pandoc - general markup converter .SH SYNOPSIS@@ -556,7 +556,7 @@ .RS .RE .TP-.B \f[C]\-\-filter=\f[]\f[I]PROGRAM\f[]+.B \f[C]\-F\f[] \f[I]PROGRAM\f[], \f[C]\-\-filter=\f[]\f[I]PROGRAM\f[] Specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written. The executable should read JSON from stdin and write JSON to stdout.@@ -731,8 +731,8 @@ .RS .RE .TP-.B \f[C]\-\-template=\f[]\f[I]FILE\f[]-Use \f[I]FILE\f[] as a custom template for the generated document.+.B \f[C]\-\-template=\f[]\f[I]FILE\f[]|\f[I]URL\f[]+Use the specified file as a custom template for the generated document. Implies \f[C]\-\-standalone\f[]. See Templates, below, for a description of template syntax. If no extension is specified, an extension corresponding to the writer@@ -815,7 +815,8 @@ \f[C]latex\f[], \f[C]context\f[], \f[C]docx\f[], \f[C]odt\f[], \f[C]opendocument\f[], \f[C]rst\f[], or \f[C]ms\f[], an instruction to create one) in the output document.-This option has no effect on \f[C]man\f[], \f[C]docbook4\f[],+This option has no effect unless \f[C]\-s/\-\-standalone\f[] is used,+and it has no effect on \f[C]man\f[], \f[C]docbook4\f[], \f[C]docbook5\f[], or \f[C]jats\f[] output. .RS .RE@@ -927,6 +928,8 @@ Set the request header \f[I]NAME\f[] to the value \f[I]VAL\f[] when making HTTP requests (for example, when a URL is given on the command line, or when resources used in a document must be downloaded).+If you\[aq]re behind a proxy, you also need to set the environment+variable \f[C]http_proxy\f[] to \f[C]http://...\f[]. .RS .RE .SS Options affecting specific writers@@ -2109,11 +2112,9 @@ any object, .IP \[bu] 2 the boolean \f[C]true\f[] (to specify the boolean \f[C]true\f[] value-using YAML metadata or the \f[C]\-\-metadata\f[] flag, use \f[C]y\f[],-\f[C]Y\f[], \f[C]yes\f[], \f[C]Yes\f[], \f[C]YES\f[], \f[C]true\f[],-\f[C]True\f[], \f[C]TRUE\f[], \f[C]on\f[], \f[C]On\f[], or \f[C]ON\f[];-with the \f[C]\-\-variable\f[] flag, simply omit a value for the-variable, e.g.+using YAML metadata or the \f[C]\-\-metadata\f[] flag, use+\f[C]true\f[], \f[C]True\f[], or \f[C]TRUE\f[]; with the+\f[C]\-\-variable\f[] flag, simply omit a value for the variable, e.g. \f[C]\-\-variable\ draft\f[]). .PP \f[C]X\f[] and \f[C]Y\f[] are placeholders for any valid template text,@@ -3779,7 +3780,10 @@ Metadata can contain lists and objects (nested arbitrarily), but all string scalars will be interpreted as Markdown. Fields with names ending in an underscore will be ignored by pandoc.-(They may be given a role by external processors.)+(They may be given a role by external processors.) Field names must not+be interpretable as YAML numbers or boolean values (so, for example,+\f[C]yes\f[], \f[C]True\f[], and \f[C]15\f[] cannot be used as field+names). .PP A document may contain multiple metadata blocks. The metadata fields will be combined through a \f[I]left\-biased@@ -4094,11 +4098,18 @@ TeX math will be printed in all output formats. How it is rendered depends on the output format: .TP-.B Markdown, LaTeX, Emacs Org mode, ConTeXt, ZimWiki-It will appear verbatim between \f[C]$\f[] characters.+.B LaTeX+It will appear verbatim surrounded by \f[C]\\(...\\)\f[] (for inline+math) or \f[C]\\[...\\]\f[] (for display math). .RS .RE .TP+.B Markdown, Emacs Org mode, ConTeXt, ZimWiki+It will appear verbatim surrounded by \f[C]$...$\f[] (for inline math)+or \f[C]$$...$$\f[] (for display math).+.RS+.RE+.TP .B reStructuredText It will be rendered using an interpreted text role \f[C]:math:\f[]. .RS@@ -5551,7 +5562,8 @@ All of the other frame attributes described in Section 8.1 of the Beamer User\[aq]s Guide may also be used: \f[C]allowdisplaybreaks\f[], \f[C]allowframebreaks\f[], \f[C]b\f[], \f[C]c\f[], \f[C]t\f[],-\f[C]environment\f[], \f[C]label\f[], \f[C]plain\f[], \f[C]shrink\f[].+\f[C]environment\f[], \f[C]label\f[], \f[C]plain\f[], \f[C]shrink\f[],+\f[C]standout\f[], \f[C]noframenumbering\f[]. .SS Background in reveal.js .PP Background images can be added to self\-contained reveal.js slideshows.@@ -5750,9 +5762,10 @@ .RE .SS Linked media .PP-By default, pandoc will download linked media (including audio and-video) and include it in the EPUB container, yielding a completely-self\-contained EPUB.+By default, pandoc will download media referenced from any+\f[C]<img>\f[], \f[C]<audio>\f[], \f[C]<video>\f[] or \f[C]<source>\f[]+element present in the generated EPUB, and include it in the EPUB+container, yielding a completely self\-contained EPUB. If you want to link to external media resources instead, use raw HTML in your source and add \f[C]data\-external="1"\f[] to the tag with the \f[C]src\f[] attribute.
pandoc.cabal view
@@ -1,6 +1,6 @@ name:            pandoc-version:         2.2.1-cabal-version:   >= 1.10+version:         2.2.2+cabal-version:   2.0 build-type:      Custom license:         GPL-2 license-file:    COPYING.md@@ -11,7 +11,7 @@ stability:       alpha homepage:        https://pandoc.org category:        Text-tested-with:     GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1+tested-with:     GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3 synopsis:        Conversion between markup formats description:     Pandoc is a Haskell library for converting from one markup                  format to another, and a command-line tool that uses@@ -192,6 +192,7 @@                  test/command/inkscape-cube.svg                  test/command/sub-file-chapter-1.tex                  test/command/sub-file-chapter-2.tex+                 test/command/bar.tex                  test/command/3510-subdoc.org                  test/command/3510-export.latex                  test/command/3510-src.hs@@ -334,12 +335,8 @@   Description:   Build trypandoc cgi executable.   Default:       False -flag network-uri-  Description:   Get Network.URI from the network-uri package-  Default:       True- custom-setup-  setup-depends: base, Cabal+  setup-depends: base, Cabal >= 2.0  library   build-depends: base >= 4.7 && < 5,@@ -358,40 +355,45 @@                  safe >= 0.3 && < 0.4,                  zip-archive >= 0.2.3.4 && < 0.4,                  HTTP >= 4000.0.5 && < 4000.4,-                 texmath >= 0.10 && < 0.12,+                 texmath >= 0.11 && < 0.12,                  xml >= 1.3.12 && < 1.4,                  split >= 0.2 && < 0.3,                  random >= 1 && < 1.2,-                 pandoc-types >= 1.17.4.2 && < 1.18,-                 aeson >= 0.7 && < 1.4,+                 pandoc-types >= 1.17.5 && < 1.18,+                 aeson >= 0.7 && < 1.5,                  aeson-pretty >= 0.8.5 && < 0.9,                  tagsoup >= 0.14.6 && < 0.15,                  base64-bytestring >= 0.1 && < 1.1,                  zlib >= 0.5 && < 0.7,-                 skylighting >= 0.5.1 && < 0.8,+                 skylighting >= 0.7.2 && < 0.8,                  data-default >= 0.4 && < 0.8,                  temporary >= 1.1 && < 1.4,                  blaze-html >= 0.9 && < 0.10,                  blaze-markup >= 0.8 && < 0.9,-                 yaml >= 0.8.8.2 && < 0.9,-                 scientific >= 0.2 && < 0.4,                  vector >= 0.10 && < 0.13,                  hslua >= 0.9.5 && < 0.9.6,                  hslua-module-text >= 0.1.2 && < 0.2,                  binary >= 0.5 && < 0.10,                  SHA >= 1.6 && < 1.7,-                 haddock-library >= 1.1 && < 1.6,+                 haddock-library >= 1.6 && < 1.7,                  deepseq >= 1.3 && < 1.5,-                 JuicyPixels >= 3.1.6.1 && < 3.3,+                 JuicyPixels >= 3.1.6.1 && < 3.4,                  Glob >= 0.7 && < 0.10,                  cmark-gfm >= 0.1.1 && < 0.2,                  doctemplates >= 0.2.1 && < 0.3,+                 network-uri >= 2.6 && < 2.7,+                 network >= 2.6,                  http-client >= 0.4.30 && < 0.6,                  http-client-tls >= 0.2.4 && < 0.4,                  http-types >= 0.8 && < 0.13,-                 case-insensitive >= 1.2 && < 1.3+                 case-insensitive >= 1.2 && < 1.3,+                 HsYAML >= 0.1.1.1 && < 0.2   if impl(ghc < 8.0)-    build-depends: semigroups == 0.18.*+    build-depends: semigroups == 0.18.*,+                   -- basement 0.0.8 and foundation 0.0.21, transitive+                   -- dependencies, drop support for ghc 7.10:+                   basement < 0.0.8,+                   foundation < 0.0.21   if impl(ghc < 8.4)      hs-source-dirs: prelude      other-modules:  Prelude@@ -400,10 +402,6 @@     cpp-options:      -D_WINDOWS   else     build-depends:  unix >= 2.4 && < 2.8-  if flag(network-uri)-     build-depends: network-uri >= 2.6 && < 2.7, network >= 2.6-  else-     build-depends: network >= 2 && < 2.6   if flag(embed_data_files)      cpp-options:   -DEMBED_DATA_FILES      build-depends: file-embed >= 0.0 && < 0.1@@ -545,7 +543,7 @@                    Text.Pandoc.Translations,                    Text.Pandoc.Slides,                    Paths_pandoc-+  autogen-modules: Paths_pandoc   buildable:       True  executable pandoc@@ -609,7 +607,7 @@   hs-source-dirs: test   build-depends:  base >= 4.2 && < 5,                   pandoc,-                  pandoc-types >= 1.17.4.2 && < 1.18,+                  pandoc-types >= 1.17.5 && < 1.18,                   bytestring >= 0.9 && < 0.11,                   base64-bytestring >= 0.1 && < 1.1,                   text >= 0.11 && < 1.3,@@ -620,7 +618,7 @@                   process >= 1.2.3 && < 1.7,                   temporary >= 1.1 && < 1.4,                   Diff >= 0.2 && < 0.4,-                  tasty >= 0.11 && < 1.1,+                  tasty >= 0.11 && < 1.2,                   tasty-hunit >= 0.9 && < 0.11,                   tasty-quickcheck >= 0.8 && < 0.11,                   tasty-golden >= 2.3 && < 2.4,@@ -696,7 +694,7 @@                    time, bytestring, containers,                    base >= 4.2 && < 5,                    text >= 0.11 && < 1.3,-                   criterion >= 1.0 && < 1.5+                   criterion >= 1.0 && < 1.6   if impl(ghc < 8.0)     build-depends: semigroups == 0.18.*   if impl(ghc < 8.4)
src/Text/Pandoc/App.hs view
@@ -62,8 +62,7 @@ import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.Encoding as TE import qualified Data.Text.Encoding.Error as TE-import Data.Yaml (decode)-import qualified Data.Yaml as Yaml+import qualified Data.YAML as YAML import GHC.Generics import Network.URI (URI (..), parseURI) #ifdef EMBED_DATA_FILES@@ -155,9 +154,9 @@     where       go Nothing Nothing       = Right ("latex", "pdflatex")       go (Just writer) Nothing = (writer,) <$> engineForWriter writer-      go Nothing (Just engine) = (,engine) <$> writerForEngine engine+      go Nothing (Just engine) = (,engine) <$> writerForEngine (takeBaseName engine)       go (Just writer) (Just engine) =-           case find (== (baseWriterName writer, engine)) engines of+           case find (== (baseWriterName writer, takeBaseName engine)) engines of                 Just _  -> Right (writer, engine)                 Nothing -> Left $ "pdf-engine " ++ engine ++                            " is not compatible with output format " ++ writer@@ -381,7 +380,7 @@                                      "" -> tp <.> format                                      _  -> tp                       Just . UTF8.toString <$>-                            (readFileStrict tp' `catchError`+                            ((fst <$> fetchItem tp') `catchError`                              (\e ->                                  case e of                                       PandocIOError _ e' |@@ -702,10 +701,12 @@ removeMetaKeys kvs pdc = foldr (deleteMeta . fst) pdc kvs  readMetaValue :: String -> MetaValue-readMetaValue s = case decode (UTF8.fromString s) of-                       Just (Yaml.String t) -> MetaString $ T.unpack t-                       Just (Yaml.Bool b)   -> MetaBool b-                       _                    -> MetaString s+readMetaValue s = case YAML.decodeStrict (UTF8.fromString s) of+                       Right [YAML.Scalar (YAML.SStr t)]+                                             -> MetaString $ T.unpack t+                       Right [YAML.Scalar (YAML.SBool b)]+                                             -> MetaBool b+                       _                     -> MetaString s  -- Determine default reader based on source file extensions defaultReaderName :: String -> [FilePath] -> String
src/Text/Pandoc/Class.hs view
@@ -132,7 +132,7 @@ import Network.HTTP.Client.TLS (tlsManagerSettings) import System.Environment (getEnv) import Network.HTTP.Types.Header ( hContentType )-import Network (withSocketsDo)+import Network.Socket (withSocketsDo) import Data.ByteString.Lazy (toChunks) import qualified Control.Exception as E import qualified Data.Time.LocalTime as IO (getCurrentTimeZone)@@ -882,10 +882,10 @@ -- of things that would normally be obtained through IO. data PureState = PureState { stStdGen     :: StdGen                            , stWord8Store :: [Word8] -- should be-                                                     -- inifinite,+                                                     -- infinite,                                                      -- i.e. [1..]                            , stUniqStore  :: [Int] -- should be-                                                   -- inifinite and+                                                   -- infinite and                                                    -- contain every                                                    -- element at most                                                    -- once, e.g. [1..]
src/Text/Pandoc/Emoji.hs view
@@ -28,9 +28,10 @@  Emoji symbol lookup from canonical string identifier. -}-module Text.Pandoc.Emoji ( emojis ) where+module Text.Pandoc.Emoji ( emojis, emojiToInline ) where import Prelude import qualified Data.Map as M+import Text.Pandoc.Definition (Inline (Span, Str))  emojis :: M.Map String String emojis = M.fromList@@ -905,3 +906,7 @@   ,("zero","0\65039\8419")   ,("zzz","\128164")   ]++emojiToInline :: String -> Maybe Inline+emojiToInline emojikey = makeSpan <$> M.lookup emojikey emojis+  where makeSpan = Span ("", ["emoji"], [("data-emoji", emojikey)]) . (:[]) . Str
src/Text/Pandoc/Extensions.hs view
@@ -101,7 +101,10 @@                                     --   and disallow laziness     | Ext_definition_lists    -- ^ Definition lists as in pandoc, mmd, php     | Ext_east_asian_line_breaks  -- ^ Newlines in paragraphs are ignored between-                                  --   East Asian wide characters+                                  --   East Asian wide characters. Note: this extension+                                  --   does not affect readers/writers directly; it causes+                                  --   the eastAsianLineBreakFilter to be applied after+                                  --   parsing, in Text.Pandoc.App.convertWithOpts.     | Ext_emoji               -- ^ Support emoji like :smile:     | Ext_empty_paragraphs -- ^ Allow empty paragraphs     | Ext_epub_html_exts      -- ^ Recognise the EPUB extended version of HTML
src/Text/Pandoc/Highlighting.hs view
@@ -45,6 +45,7 @@                                 , tango                                 , kate                                 , monochrome+                                , breezeDark                                 , haddock                                 , Style                                 , fromListingsLanguage
src/Text/Pandoc/Lua/Init.hs view
@@ -55,7 +55,7 @@ import qualified Text.Pandoc.Definition as Pandoc  -- | Run the lua interpreter, using pandoc's default way of environment--- initalization.+-- initialization. runPandocLua :: Lua a -> PandocIO (Either LuaException a) runPandocLua luaOp = do   luaPkgParams <- luaPackageParams
src/Text/Pandoc/PDF.hs view
@@ -79,13 +79,52 @@ #endif  makePDF :: String              -- ^ pdf creator (pdflatex, lualatex, xelatex,-                               -- wkhtmltopdf, weasyprint, prince, context, pdfroff)+                               -- wkhtmltopdf, weasyprint, prince, context, pdfroff,+                               -- or path to executable)         -> [String]            -- ^ arguments to pass to pdf creator         -> (WriterOptions -> Pandoc -> PandocIO Text)  -- ^ writer         -> WriterOptions       -- ^ options         -> Pandoc              -- ^ document         -> PandocIO (Either ByteString ByteString)-makePDF "wkhtmltopdf" pdfargs writer opts doc@(Pandoc meta _) = do+makePDF program pdfargs writer opts doc = do+  case takeBaseName program of+    "wkhtmltopdf" -> makeWithWkhtmltopdf program pdfargs writer opts doc+    prog | prog `elem` ["weasyprint", "prince"] -> do+      source <- writer opts doc+      verbosity <- getVerbosity+      liftIO $ html2pdf verbosity program pdfargs source+    "pdfroff" -> do+      source <- writer opts doc+      let args   = ["-ms", "-mpdfmark", "-e", "-t", "-k", "-KUTF-8", "-i",+                    "--no-toc-relocation"] ++ pdfargs+      verbosity <- getVerbosity+      liftIO $ ms2pdf verbosity program args source+    baseProg -> do+      -- With context and latex, we create a temp directory within+      -- the working directory, since pdflatex sometimes tries to+      -- use tools like epstopdf.pl, which are restricted if run+      -- on files outside the working directory.+      let withTemp = withTempDirectory "."+      commonState <- getCommonState+      verbosity <- getVerbosity+      liftIO $ withTemp "tex2pdf." $ \tmpdir -> do+        source <- runIOorExplode $ do+                    putCommonState commonState+                    doc' <- handleImages tmpdir doc+                    writer opts doc'+        case baseProg of+           "context" -> context2pdf verbosity program tmpdir source+           prog | prog `elem` ["pdflatex", "lualatex", "xelatex"]+               -> tex2pdf verbosity program pdfargs tmpdir source+           _ -> return $ Left $ UTF8.fromStringLazy $ "Unknown program " ++ program++makeWithWkhtmltopdf :: String              -- ^ wkhtmltopdf or path+                    -> [String]            -- ^ arguments+                    -> (WriterOptions -> Pandoc -> PandocIO Text)  -- ^ writer+                    -> WriterOptions       -- ^ options+                    -> Pandoc              -- ^ document+                    -> PandocIO (Either ByteString ByteString)+makeWithWkhtmltopdf program pdfargs writer opts doc@(Pandoc meta _) = do   let mathArgs = case writerHTMLMathMethod opts of                  -- with MathJax, wait til all math is rendered:                       MathJax _ -> ["--run-script", "MathJax.Hub.Register.StartupHook('End Typeset', function() { window.status = 'mathjax_loaded' });",@@ -111,39 +150,7 @@                  ]   source <- writer opts doc   verbosity <- getVerbosity-  liftIO $ html2pdf verbosity "wkhtmltopdf" args source-makePDF "weasyprint" pdfargs writer opts doc = do-  source <- writer opts doc-  verbosity <- getVerbosity-  liftIO $ html2pdf verbosity "weasyprint" pdfargs source-makePDF "prince" pdfargs writer opts doc = do-  source <- writer opts doc-  verbosity <- getVerbosity-  liftIO $ html2pdf verbosity "prince" pdfargs source-makePDF "pdfroff" pdfargs writer opts doc = do-  source <- writer opts doc-  let args   = ["-ms", "-mpdfmark", "-e", "-t", "-k", "-KUTF-8", "-i",-                "--no-toc-relocation"] ++ pdfargs-  verbosity <- getVerbosity-  liftIO $ ms2pdf verbosity args source-makePDF program pdfargs writer opts doc = do-  -- With context and latex, we create a temp directory within-  -- the working directory, since pdflatex sometimes tries to-  -- use tools like epstopdf.pl, which are restricted if run-  -- on files outside the working directory.-  let withTemp = withTempDirectory "."-  commonState <- getCommonState-  verbosity <- getVerbosity-  liftIO $ withTemp "tex2pdf." $ \tmpdir -> do-    source <- runIOorExplode $ do-                putCommonState commonState-                doc' <- handleImages tmpdir doc-                writer opts doc'-    case takeBaseName program of-       "context" -> context2pdf verbosity tmpdir source-       prog | prog `elem` ["pdflatex", "lualatex", "xelatex"]-           -> tex2pdf' verbosity pdfargs tmpdir program source-       _ -> return $ Left $ UTF8.fromStringLazy $ "Unknown program " ++ program+  liftIO $ html2pdf verbosity program args source  handleImages :: FilePath      -- ^ temp dir to store images              -> Pandoc        -- ^ document@@ -195,13 +202,13 @@     mime = getMimeType fname     doNothing = return (Right fname) -tex2pdf' :: Verbosity                       -- ^ Verbosity level-         -> [String]                        -- ^ Arguments to the latex-engine-         -> FilePath                        -- ^ temp directory for output-         -> String                          -- ^ tex program-         -> Text                            -- ^ tex source-         -> IO (Either ByteString ByteString)-tex2pdf' verbosity args tmpDir program source = do+tex2pdf :: Verbosity                       -- ^ Verbosity level+        -> String                          -- ^ tex program+        -> [String]                        -- ^ Arguments to the latex-engine+        -> FilePath                        -- ^ temp directory for output+        -> Text                            -- ^ tex source+        -> IO (Either ByteString ByteString)+tex2pdf verbosity program args tmpDir source = do   let numruns = if "\\tableofcontents" `T.isInfixOf` source                    then 3  -- to get page numbers                    else 2  -- 1 run won't give you PDF bookmarks@@ -278,12 +285,7 @@     let file' = file #endif     let programArgs = ["-halt-on-error", "-interaction", "nonstopmode",-         "-output-directory", tmpDir'] ++-         -- see #4484, only compress images on last run:-         if program == "xelatex" && runNumber < numRuns-            then ["-output-driver", "xdvipdfmx -z0"]-            else []-         ++ args ++ [file']+         "-output-directory", tmpDir'] ++ args ++ [file']     env' <- getEnvironment     let sep = [searchPathSeparator]     let texinputs = maybe (tmpDir' ++ sep) ((tmpDir' ++ sep) ++)@@ -307,7 +309,7 @@       putStrLn $ "[makePDF] Run #" ++ show runNumber       BL.hPutStr stdout out       putStr "\n"-    if runNumber <= numRuns+    if runNumber < numRuns        then runTeXProgram verbosity program args (runNumber + 1) numRuns tmpDir source        else do          let pdfFile = replaceDirectory (replaceExtension file ".pdf") tmpDir@@ -328,14 +330,15 @@          return (exit, log', pdf)  ms2pdf :: Verbosity+       -> String        -> [String]        -> Text        -> IO (Either ByteString ByteString)-ms2pdf verbosity args source = do+ms2pdf verbosity program args source = do   env' <- getEnvironment   when (verbosity >= INFO) $ do     putStrLn "[makePDF] Command line:"-    putStrLn $ "pdfroff " ++ " " ++ unwords (map show args)+    putStrLn $ program ++ " " ++ unwords (map show args)     putStr "\n"     putStrLn "[makePDF] Environment:"     mapM_ print env'@@ -344,11 +347,11 @@     putStr $ T.unpack source     putStr "\n"   (exit, out) <- E.catch-    (pipeProcess (Just env') "pdfroff" args+    (pipeProcess (Just env') program args                      (BL.fromStrict $ UTF8.fromText source))     (\(e :: IOError) -> if isDoesNotExistError e                            then E.throwIO $-                                  PandocPDFProgramNotFoundError "pdfroff"+                                  PandocPDFProgramNotFoundError program                            else E.throwIO e)   when (verbosity >= INFO) $ do     BL.hPutStr stdout out@@ -358,7 +361,7 @@              ExitSuccess   -> Right out  html2pdf  :: Verbosity    -- ^ Verbosity level-          -> String       -- ^ Program (wkhtmltopdf, weasyprint or prince)+          -> String       -- ^ Program (wkhtmltopdf, weasyprint, prince, or path)           -> [String]     -- ^ Args to program           -> Text         -- ^ HTML5 source           -> IO (Either ByteString ByteString)@@ -369,7 +372,7 @@   file    <- withTempFile "." "html2pdf.html" $ \fp _ -> return fp   pdfFile <- withTempFile "." "html2pdf.pdf" $ \fp _ -> return fp   BS.writeFile file $ UTF8.fromText source-  let pdfFileArgName = ["-o" | program == "prince"]+  let pdfFileArgName = ["-o" | takeBaseName program == "prince"]   let programArgs = args ++ [file] ++ pdfFileArgName ++ [pdfFile]   env' <- getEnvironment   when (verbosity >= INFO) $ do@@ -408,10 +411,11 @@              (ExitSuccess, Just pdf) -> Right pdf  context2pdf :: Verbosity    -- ^ Verbosity level+            -> String       -- ^ "context" or path to it             -> FilePath     -- ^ temp directory for output             -> Text         -- ^ ConTeXt source             -> IO (Either ByteString ByteString)-context2pdf verbosity tmpDir source = inDirectory tmpDir $ do+context2pdf verbosity program tmpDir source = inDirectory tmpDir $ do   let file = "input.tex"   BS.writeFile file $ UTF8.fromText source #ifdef _WINDOWS@@ -426,7 +430,7 @@     putStrLn "[makePDF] temp dir:"     putStrLn tmpDir'     putStrLn "[makePDF] Command line:"-    putStrLn $ "context" ++ " " ++ unwords (map show programArgs)+    putStrLn $ program ++ " " ++ unwords (map show programArgs)     putStr "\n"     putStrLn "[makePDF] Environment:"     mapM_ print env'@@ -435,7 +439,7 @@     BL.readFile file >>= BL.putStr     putStr "\n"   (exit, out) <- E.catch-    (pipeProcess (Just env') "context" programArgs BL.empty)+    (pipeProcess (Just env') program programArgs BL.empty)     (\(e :: IOError) -> if isDoesNotExistError e                            then E.throwIO $                                   PandocPDFProgramNotFoundError "context"
src/Text/Pandoc/Parsing.hs view
@@ -1289,7 +1289,7 @@ --  unique identifier, and update the list of identifiers --  in state.  Issue a warning if an explicit identifier --  is encountered that duplicates an earlier identifier---  (explict or automatically generated).+--  (explicit or automatically generated). registerHeader :: (Stream s m a, HasReaderOptions st,                     HasHeaderMap st, HasLogMessages st, HasIdentifierList st)                => Attr -> Inlines -> ParserT s st m Attr
src/Text/Pandoc/Readers/CommonMark.hs view
@@ -39,10 +39,12 @@ import Data.Char (isAlphaNum, isLetter, isSpace, toLower) import Data.List (groupBy) import qualified Data.Map as Map+import Data.Maybe (mapMaybe) import Data.Text (Text, unpack)+import Text.Pandoc.Asciify (toAsciiChar) import Text.Pandoc.Class (PandocMonad) import Text.Pandoc.Definition-import Text.Pandoc.Emoji (emojis)+import Text.Pandoc.Emoji (emojiToInline) import Text.Pandoc.Options import Text.Pandoc.Shared (stringify) import Text.Pandoc.Walk (walkM)@@ -51,7 +53,7 @@ readCommonMark :: PandocMonad m => ReaderOptions -> Text -> m Pandoc readCommonMark opts s = return $   (if isEnabled Ext_gfm_auto_identifiers opts-      then addHeaderIdentifiers+      then addHeaderIdentifiers opts       else id) $   nodeToPandoc opts $ commonmarkToNode opts' exts s   where opts' = [ optSmart | isEnabled Ext_smart opts ]@@ -59,24 +61,27 @@                [ extTable | isEnabled Ext_pipe_tables opts ] ++                [ extAutolink | isEnabled Ext_autolink_bare_uris opts ] -convertEmojis :: String -> String-convertEmojis (':':xs) =+convertEmojis :: String -> [Inline]+convertEmojis s@(':':xs) =    case break (==':') xs of         (ys,':':zs) ->-           case Map.lookup ys emojis of-                Just s  -> s ++ convertEmojis zs-                Nothing -> ':' : ys ++ convertEmojis (':':zs)-        _ -> ':':xs-convertEmojis (x:xs) = x : convertEmojis xs-convertEmojis [] = []+           case emojiToInline ys of+                Just em -> em : convertEmojis zs+                Nothing -> Str (':' : ys) : convertEmojis (':':zs)+        _ -> [Str s]+convertEmojis s =+  case break (==':') s of+    ("","") -> []+    (_,"") -> [Str s]+    (xs,ys) -> Str xs:convertEmojis ys -addHeaderIdentifiers :: Pandoc -> Pandoc-addHeaderIdentifiers doc = evalState (walkM addHeaderId doc) mempty+addHeaderIdentifiers :: ReaderOptions -> Pandoc -> Pandoc+addHeaderIdentifiers opts doc = evalState (walkM (addHeaderId opts) doc) mempty -addHeaderId :: Block -> State (Map.Map String Int) Block-addHeaderId (Header lev (_,classes,kvs) ils) = do+addHeaderId :: ReaderOptions -> Block -> State (Map.Map String Int) Block+addHeaderId opts (Header lev (_,classes,kvs) ils) = do   idmap <- get-  let ident = toIdent ils+  let ident = toIdent opts ils   ident' <- case Map.lookup ident idmap of                  Nothing -> do                    put (Map.insert ident 1 idmap)@@ -85,13 +90,16 @@                    put (Map.adjust (+ 1) ident idmap)                    return (ident ++ "-" ++ show i)   return $ Header lev (ident',classes,kvs) ils-addHeaderId x = return x+addHeaderId _ x = return x -toIdent :: [Inline] -> String-toIdent =   map (\c -> if isSpace c then '-' else c)-          . filter (\c -> isLetter c || isAlphaNum c || isSpace c ||-                           c == '_' || c == '-')-          . map toLower . stringify+toIdent :: ReaderOptions -> [Inline] -> String+toIdent opts = map (\c -> if isSpace c then '-' else c)+               . filterer+               . map toLower . stringify+  where filterer = if isEnabled Ext_ascii_identifiers opts+                   then mapMaybe toAsciiChar+                   else filter (\c -> isLetter c || isAlphaNum c || isSpace c ||+                                      c == '_' || c == '-')  nodeToPandoc :: ReaderOptions -> Node -> Pandoc nodeToPandoc opts (Node _ DOCUMENT nodes) =@@ -200,17 +208,17 @@ addInlines opts = foldr (addInline opts) []  addInline :: ReaderOptions -> Node -> [Inline] -> [Inline]-addInline opts (Node _ (TEXT t) _) = (map toinl clumps ++)+addInline opts (Node _ (TEXT t) _) = (foldr ((++) . toinl) [] clumps ++)   where raw = unpack t         clumps = groupBy samekind raw         samekind ' ' ' ' = True         samekind ' ' _   = False         samekind _   ' ' = False         samekind _  _    = True-        toinl (' ':_) = Space-        toinl xs      = Str $ if isEnabled Ext_emoji opts-                                 then convertEmojis xs-                                 else xs+        toinl (' ':_) = [Space]+        toinl xs      = if isEnabled Ext_emoji opts+                        then convertEmojis xs+                        else [Str xs] addInline _ (Node _ LINEBREAK _) = (LineBreak :) addInline opts (Node _ SOFTBREAK _)   | isEnabled Ext_hard_line_breaks opts = (LineBreak :)
src/Text/Pandoc/Readers/Creole.hs view
@@ -2,7 +2,7 @@ {-   Copyright (C) 2017 Sascha Wilde <wilde@sha-bang.de> -  partly based on all the other readers, especialy the work by+  partly based on all the other readers, especially the work by   John MacFarlane <jgm@berkeley.edu> and   Alexander Sulfrian <alexander.sulfrian@fu-berlin.de>   all bugs are solely created by me.
src/Text/Pandoc/Readers/Docx/Parse.hs view
@@ -785,7 +785,7 @@ tag, we start open a fldchar state variable (see state above). We add the instrtext to it as FieldInfo. Then we close that and start adding the runs when we get to separate. Then when we get to end, we produce-the Field type with approriate FieldInfo and Runs.+the Field type with appropriate FieldInfo and Runs. -} elemToParPart ns element   | isElem ns "w" "r" element
src/Text/Pandoc/Readers/EPUB.hs view
@@ -73,7 +73,7 @@ -- runEPUB :: Except PandocError a -> Either PandocError a -- runEPUB = runExcept --- Note that internal reference are aggresively normalised so that all ids+-- Note that internal reference are aggressively normalised so that all ids -- are of the form "filename#id" -- archiveToEPUB :: (PandocMonad m) => ReaderOptions -> Archive -> m Pandoc
src/Text/Pandoc/Readers/HTML.hs view
@@ -852,7 +852,7 @@   pSatisfy (\t -> t ~== TagOpen tagtype [] && tagtest t)   mconcat <$> manyTill parser (pCloses tagtype <|> eof) --- parses p, preceeded by an optional opening tag+-- parses p, preceded by an optional opening tag -- and followed by an optional closing tags pOptInTag :: PandocMonad m => Text -> TagParser m a -> TagParser m a pOptInTag tagtype p = try $ do@@ -1281,7 +1281,7 @@   setLastStrPos s st = st {parserState = setLastStrPos s (parserState st)}   getLastStrPos = getLastStrPos . parserState --- For now we need a special verison here; the one in Shared has String type+-- For now we need a special version here; the one in Shared has String type renderTags' :: [Tag Text] -> Text renderTags' = renderTagsOptions                renderOptions{ optMinimize = matchTags ["hr", "br", "img",
src/Text/Pandoc/Readers/Haddock.hs view
@@ -44,11 +44,7 @@                   -> String        -- ^ String to parse                   -> Either PandocError Pandoc readHaddockEither _opts =-#if MIN_VERSION_haddock_library(1,2,0)-  Right . B.doc . docHToBlocks . _doc . parseParas-#else-  Right .  B.doc . docHToBlocks . parseParas-#endif+  Right . B.doc . docHToBlocks . _doc . parseParas Nothing  docHToBlocks :: DocH String Identifier -> Blocks docHToBlocks d' =@@ -68,10 +64,8 @@     DocEmphasis _ -> inlineFallback     DocMonospaced _ -> inlineFallback     DocBold _ -> inlineFallback-#if MIN_VERSION_haddock_library(1,4,0)     DocMathInline _ -> inlineFallback     DocMathDisplay _ -> inlineFallback-#endif     DocHeader h -> B.header (headerLevel h)                            (docHToInlines False $ headerTitle h)     DocUnorderedList items -> B.bulletList (map docHToBlocks items)@@ -87,7 +81,6 @@     DocProperty s -> B.codeBlockWith ("",["property","haskell"],[]) (trim s)     DocExamples es -> mconcat $ map (\e ->        makeExample ">>>" (exampleExpression e) (exampleResult e)) es-#if MIN_VERSION_haddock_library(1,5,0)     DocTable H.Table{ tableHeaderRows = headerRows                     , tableBodyRows = bodyRows                     }@@ -100,7 +93,6 @@              colspecs = replicate (maximum (map length body))                              (AlignDefault, 0.0)          in  B.table mempty colspecs header body-#endif    where inlineFallback = B.plain $ docHToInlines False d'         consolidatePlains = B.fromList . consolidatePlains' . B.toList@@ -133,10 +125,8 @@     DocMonospaced (DocString s) -> B.code s     DocMonospaced d -> docHToInlines True d     DocBold d -> B.strong (docHToInlines isCode d)-#if MIN_VERSION_haddock_library(1,4,0)     DocMathInline s -> B.math s     DocMathDisplay s -> B.displayMath s-#endif     DocHeader _ -> mempty     DocUnorderedList _ -> mempty     DocOrderedList _ -> mempty@@ -149,9 +139,7 @@     DocAName s -> B.spanWith (s,["anchor"],[]) mempty     DocProperty _ -> mempty     DocExamples _ -> mempty-#if MIN_VERSION_haddock_library(1,5,0)     DocTable _ -> mempty-#endif  -- | Create an 'Example', stripping superfluous characters as appropriate makeExample :: String -> String -> [String] -> Blocks
src/Text/Pandoc/Readers/JATS.hs view
@@ -191,7 +191,7 @@                     listType -> do                       let start = fromMaybe 1 $                                   (strContent <$> (filterElement (named "list-item") e-                                               >>= filterElement (named "lable")))+                                               >>= filterElement (named "label")))                                    >>= safeRead                       orderedListWith (start, parseListStyleType listType, DefaultDelim)                         <$> listitems
src/Text/Pandoc/Readers/LaTeX.hs view
@@ -159,7 +159,7 @@                             , sLogMessages   :: [LogMessage]                             , sIdentifiers   :: Set.Set String                             , sVerbatimMode  :: Bool-                            , sCaption       :: Maybe Inlines+                            , sCaption       :: (Maybe Inlines, Maybe String)                             , sInListItem    :: Bool                             , sInTableCell   :: Bool                             , sLastHeaderNum :: HeaderNum@@ -179,7 +179,7 @@                               , sLogMessages   = []                               , sIdentifiers   = Set.empty                               , sVerbatimMode  = False-                              , sCaption       = Nothing+                              , sCaption       = (Nothing, Nothing)                               , sInListItem    = False                               , sInTableCell   = False                               , sLastHeaderNum = HeaderNum []@@ -242,8 +242,8 @@   return result  rawLaTeXParser :: (PandocMonad m, HasMacros s, HasReaderOptions s)-               => LP m a -> LP m a -> ParserT String s m (a, String)-rawLaTeXParser parser valParser = do+               => Bool -> LP m a -> LP m a -> ParserT String s m (a, String)+rawLaTeXParser retokenize parser valParser = do   inp <- getInput   let toks = tokenize "source" $ T.pack inp   pstate <- getState@@ -254,10 +254,11 @@   case res' of        Left _    -> mzero        Right toks' -> do-         res <- lift $ runParserT (do doMacros 0-                                      -- retokenize, applying macros-                                      ts <- many (satisfyTok (const True))-                                      setInput ts+         res <- lift $ runParserT (do when retokenize $ do+                                        -- retokenize, applying macros+                                        doMacros 0+                                        ts <- many (satisfyTok (const True))+                                        setInput ts                                       rawparser)                         lstate' "chunk" toks'          case res of@@ -284,20 +285,35 @@               => ParserT String s m String rawLaTeXBlock = do   lookAhead (try (char '\\' >> letter))-  -- we don't want to apply newly defined latex macros to their own-  -- definitions:-  snd <$> rawLaTeXParser (environment <|> macroDef <|> blockCommand) blocks+  snd <$> (rawLaTeXParser False macroDef blocks+      <|> rawLaTeXParser True+           (environment <|> macroDef <|> blockCommand)+           (mconcat <$> (many (block <|> beginOrEndCommand)))) +-- See #4667 for motivation; sometimes people write macros+-- that just evaluate to a begin or end command, which blockCommand+-- won't accept.+beginOrEndCommand :: PandocMonad m => LP m Blocks+beginOrEndCommand = try $ do+  Tok _ (CtrlSeq name) txt <- anyControlSeq+  guard $ name == "begin" || name == "end"+  (envname, rawargs) <- withRaw braced+  if M.member (untokenize envname)+      (inlineEnvironments :: M.Map Text (LP PandocPure Inlines))+     then mzero+     else return $ rawBlock "latex"+                    (T.unpack (txt <> untokenize rawargs))+ rawLaTeXInline :: (PandocMonad m, HasMacros s, HasReaderOptions s)                => ParserT String s m String rawLaTeXInline = do   lookAhead (try (char '\\' >> letter))-  snd <$> rawLaTeXParser (inlineEnvironment <|> inlineCommand') inlines+  snd <$> rawLaTeXParser True (inlineEnvironment <|> inlineCommand') inlines  inlineCommand :: PandocMonad m => ParserT String ParserState m Inlines inlineCommand = do   lookAhead (try (char '\\' >> letter))-  fst <$> rawLaTeXParser (inlineEnvironment <|> inlineCommand') inlines+  fst <$> rawLaTeXParser True (inlineEnvironment <|> inlineCommand') inlines  tokenize :: SourceName -> Text -> [Tok] tokenize sourcename = totoks (initialPos sourcename)@@ -485,14 +501,18 @@  anyControlSeq :: PandocMonad m => LP m Tok anyControlSeq = satisfyTok isCtrlSeq-  where isCtrlSeq (Tok _ (CtrlSeq _) _) = True-        isCtrlSeq _                     = False +isCtrlSeq :: Tok -> Bool+isCtrlSeq (Tok _ (CtrlSeq _) _) = True+isCtrlSeq _                     = False+ anySymbol :: PandocMonad m => LP m Tok-anySymbol = satisfyTok isSym-  where isSym (Tok _ Symbol _) = True-        isSym _                = False+anySymbol = satisfyTok isSymbolTok +isSymbolTok :: Tok -> Bool+isSymbolTok (Tok _ Symbol _) = True+isSymbolTok _                = False+ spaces :: PandocMonad m => LP m () spaces = skipMany (satisfyTok (tokTypeIn [Comment, Spaces, Newline])) @@ -526,9 +546,11 @@  whitespace :: PandocMonad m => LP m () whitespace = () <$ satisfyTok isSpaceTok-  where isSpaceTok (Tok _ Spaces _) = True-        isSpaceTok _                = False +isSpaceTok :: Tok -> Bool+isSpaceTok (Tok _ Spaces _) = True+isSpaceTok _                = False+ newlineTok :: PandocMonad m => LP m () newlineTok = () <$ satisfyTok isNewlineTok @@ -538,9 +560,11 @@  comment :: PandocMonad m => LP m () comment = () <$ satisfyTok isCommentTok-  where isCommentTok (Tok _ Comment _) = True-        isCommentTok _                 = False +isCommentTok :: Tok -> Bool+isCommentTok (Tok _ Comment _) = True+isCommentTok _                 = False+ anyTok :: PandocMonad m => LP m Tok anyTok = satisfyTok (const True) @@ -803,18 +827,25 @@ keyval :: PandocMonad m => LP m (String, String) keyval = try $ do   Tok _ Word key <- satisfyTok isWordTok-  let isSpecSym (Tok _ Symbol t) = t /= "]" && t /= ","-      isSpecSym _                = False   optional sp-  val <- option [] $ do+  val <- option mempty $ do            symbol '='            optional sp-           braced <|> many1 (satisfyTok isWordTok <|> satisfyTok isSpecSym-                               <|> anyControlSeq)-  optional sp+           (untokenize <$> braced) <|>+             (mconcat <$> many1 (+                 (untokenize . snd <$> withRaw braced)+                 <|>+                 (untokenize <$> (many1+                      (satisfyTok+                         (\t -> case t of+                                Tok _ Symbol "]" -> False+                                Tok _ Symbol "," -> False+                                Tok _ Symbol "{" -> False+                                Tok _ Symbol "}" -> False+                                _                -> True))))))   optional (symbol ',')   optional sp-  return (T.unpack key, T.unpack . untokenize $ val)+  return (T.unpack key, T.unpack $ T.strip val)  keyvals :: PandocMonad m => LP m [(String, String)] keyvals = try $ symbol '[' >> manyTill keyval (symbol ']')@@ -1204,16 +1235,28 @@   return $ "[" <> inner <> "]"  skipopts :: PandocMonad m => LP m ()-skipopts = skipMany rawopt+skipopts = skipMany (overlaySpecification <|> void rawopt)  -- opts in angle brackets are used in beamer-rawangle :: PandocMonad m => LP m ()-rawangle = try $ do+overlaySpecification :: PandocMonad m => LP m ()+overlaySpecification = try $ do   symbol '<'-  () <$ manyTill anyTok (symbol '>')+  ts <- manyTill overlayTok (symbol '>')+  guard $ case ts of+               -- see issue #3368+               [Tok _ Word s] | T.all isLetter s -> s `elem`+                                ["beamer","presentation", "trans",+                                 "handout","article", "second"]+               _ -> True -skipangles :: PandocMonad m => LP m ()-skipangles = skipMany rawangle+overlayTok :: PandocMonad m => LP m Tok+overlayTok =+  satisfyTok (\t ->+                  case t of+                    Tok _ Word _       -> True+                    Tok _ Spaces _     -> True+                    Tok _ Symbol c     -> c `elem` ["-","+","@","|",":",","]+                    _                  -> False)  ignore :: (Monoid a, PandocMonad m) => String -> ParserT s u m a ignore raw = do@@ -1289,7 +1332,7 @@   , ("textup", extractSpaces (spanWith ("",["upright"],[])) <$> tok)   , ("texttt", ttfamily)   , ("sout", extractSpaces strikeout <$> tok)-  , ("alert", skipangles >> spanWith ("",["alert"],[]) <$> tok) -- beamer+  , ("alert", skipopts >> spanWith ("",["alert"],[]) <$> tok) -- beamer   , ("lq", return (str "‘"))   , ("rq", return (str "’"))   , ("textquoteleft", return (str "‘"))@@ -1508,12 +1551,173 @@   -- siuntix   , ("SI", dosiunitx)   -- units of siuntix+  , ("fg", lit "fg")+  , ("pg", lit "pg")+  , ("ng", lit "ng")+  , ("ug", lit "μg")+  , ("mg", lit "mg")+  , ("g", lit "g")+  , ("kg", lit "kg")+  , ("amu", lit "u")+  , ("pm", lit "pm")+  , ("nm", lit "nm")+  , ("um", lit "μm")+  , ("mm", lit "mm")+  , ("cm", lit "cm")+  , ("dm", lit "dm")+  , ("m", lit "m")+  , ("km", lit "km")+  , ("as", lit "as")+  , ("fs", lit "fs")+  , ("ps", lit "ps")+  , ("ns", lit "ns")+  , ("us", lit "μs")+  , ("ms", lit "ms")+  , ("s", lit "s")+  , ("fmol", lit "fmol")+  , ("pmol", lit "pmol")+  , ("nmol", lit "nmol")+  , ("umol", lit "μmol")+  , ("mmol", lit "mmol")+  , ("mol", lit "mol")+  , ("kmol", lit "kmol")+  , ("pA", lit "pA")+  , ("nA", lit "nA")+  , ("uA", lit "μA")+  , ("mA", lit "mA")+  , ("A", lit "A")+  , ("kA", lit "kA")+  , ("ul", lit "μl")+  , ("ml", lit "ml")+  , ("l", lit "l")+  , ("hl", lit "hl")+  , ("uL", lit "μL")+  , ("mL", lit "mL")+  , ("L", lit "L")+  , ("hL", lit "hL")+  , ("mHz", lit "mHz")+  , ("Hz", lit "Hz")+  , ("kHz", lit "kHz")+  , ("MHz", lit "MHz")+  , ("GHz", lit "GHz")+  , ("THz", lit "THz")+  , ("mN", lit "mN")+  , ("N", lit "N")+  , ("kN", lit "kN")+  , ("MN", lit "MN")+  , ("Pa", lit "Pa")+  , ("kPa", lit "kPa")+  , ("MPa", lit "MPa")+  , ("GPa", lit "GPa")+  , ("mohm", lit "mΩ")+  , ("kohm", lit "kΩ")+  , ("Mohm", lit "MΩ")+  , ("pV", lit "pV")+  , ("nV", lit "nV")+  , ("uV", lit "μV")+  , ("mV", lit "mV")+  , ("V", lit "V")+  , ("kV", lit "kV")+  , ("W", lit "W")+  , ("uW", lit "μW")+  , ("mW", lit "mW")+  , ("kW", lit "kW")+  , ("MW", lit "MW")+  , ("GW", lit "GW")+  , ("J", lit "J")+  , ("uJ", lit "μJ")+  , ("mJ", lit "mJ")+  , ("kJ", lit "kJ")+  , ("eV", lit "eV")+  , ("meV", lit "meV")+  , ("keV", lit "keV")+  , ("MeV", lit "MeV")+  , ("GeV", lit "GeV")+  , ("TeV", lit "TeV")+  , ("kWh", lit "kWh")+  , ("F", lit "F")+  , ("fF", lit "fF")+  , ("pF", lit "pF")+  , ("K", lit "K")+  , ("dB", lit "dB")+  , ("angstrom", lit "Å")+  , ("arcmin", lit "′")+  , ("arcminute", lit "′")+  , ("arcsecond", lit "″")+  , ("astronomicalunit", lit "ua")+  , ("atomicmassunit", lit "u")+  , ("atto", lit "a")+  , ("bar", lit "bar")+  , ("barn", lit "b")+  , ("becquerel", lit "Bq")+  , ("bel", lit "B")+  , ("candela", lit "cd")   , ("celsius", lit "°C")-  , ("degreeCelsius", lit "°C")+  , ("centi", lit "c")+  , ("coulomb", lit "C")+  , ("dalton", lit "Da")+  , ("day", lit "d")+  , ("deca", lit "d")+  , ("deci", lit "d")+  , ("decibel", lit "db")+  , ("degreeCelsius",lit "°C")+  , ("degree", lit "°")+  , ("deka", lit "d")+  , ("electronvolt", lit "eV")+  , ("exa", lit "E")+  , ("farad", lit "F")+  , ("femto", lit "f")+  , ("giga", lit "G")   , ("gram", lit "g")+  , ("hectare", lit "ha")+  , ("hecto", lit "h")+  , ("henry", lit "H")+  , ("hertz", lit "Hz")+  , ("hour", lit "h")+  , ("joule", lit "J")+  , ("katal", lit "kat")+  , ("kelvin", lit "K")+  , ("kilo", lit "k")+  , ("kilogram", lit "kg")+  , ("knot", lit "kn")+  , ("liter", lit "L")+  , ("litre", lit "l")+  , ("lumen", lit "lm")+  , ("lux", lit "lx")+  , ("mega", lit "M")   , ("meter", lit "m")+  , ("metre", lit "m")   , ("milli", lit "m")+  , ("minute", lit "min")+  , ("mmHg", lit "mmHg")+  , ("mole", lit "mol")+  , ("nano", lit "n")+  , ("nauticalmile", lit "M")+  , ("neper", lit "Np")+  , ("newton", lit "N")+  , ("ohm", lit "Ω")+  , ("Pa", lit "Pa")+  , ("pascal", lit "Pa")+  , ("percent", lit "%")+  , ("per", lit "/")+  , ("peta", lit "P")+  , ("pico", lit "p")+  , ("radian", lit "rad")+  , ("second", lit "s")+  , ("siemens", lit "S")+  , ("sievert", lit "Sv")   , ("square", dosquare)+  , ("steradian", lit "sr")+  , ("tera", lit "T")+  , ("tesla", lit "T")+  , ("tonne", lit "t")+  , ("volt", lit "V")+  , ("watt", lit "W")+  , ("weber", lit "Wb")+  , ("yocto", lit "y")+  , ("yotta", lit "Y")+  , ("zepto", lit "z")+  , ("zetta", lit "Z")   -- hyphenat   , ("bshyp", lit "\\\173")   , ("fshyp", lit "/\173")@@ -1542,8 +1746,18 @@   , ("Rn", romanNumeralLower)   -- babel   , ("foreignlanguage", foreignlanguage)+  -- include+  , ("input", include "input")+  -- plain tex stuff that should just be passed through as raw tex+  , ("ifdim", ifdim)   ] +ifdim :: PandocMonad m => LP m Inlines+ifdim = do+  contents <- manyTill anyTok (controlSeq "fi")+  return $ rawInline "latex" $ T.unpack $+           "\\ifdim" <> untokenize contents <> "\\fi"+ makeUppercase :: Inlines -> Inlines makeUppercase = fromList . walk (alterStr (map toUpper)) . toList @@ -1693,7 +1907,6 @@            "def" ->              void $ manyTill anyTok braced            _ -> do-             skipangles              skipopts              option "" (try (optional sp *> dimenarg))              void $ many braced@@ -1818,7 +2031,6 @@ preamble :: PandocMonad m => LP m Blocks preamble = mempty <$ many preambleBlock   where preambleBlock =  spaces1-                     <|> void include                      <|> void macroDef                      <|> void blockCommand                      <|> void braced@@ -1831,11 +2043,8 @@      then return mempty      else return $ para x -include :: PandocMonad m => LP m Blocks-include = do-  (Tok _ (CtrlSeq name) _) <--                    controlSeq "include" <|> controlSeq "input" <|>-                    controlSeq "subfile" <|> controlSeq "usepackage"+include :: (PandocMonad m, Monoid a) => Text -> LP m a+include name = do   skipMany opt   fs <- (map (T.unpack . removeDoubleQuotes . T.strip) . T.splitOn "," .          untokenize) <$> braced@@ -2003,11 +2212,13 @@   ils <- tok   mblabel <- option Nothing $                try $ spaces >> controlSeq "label" >> (Just <$> tok)-  let ils' = case mblabel of-                  Just lab -> ils <> spanWith-                                ("",[],[("label", stringify lab)]) mempty-                  Nothing  -> ils-  updateState $ \st -> st{ sCaption = Just ils' }+  let capt = case mblabel of+                  Just lab -> let slab = stringify lab+                                  ils' = ils <> spanWith+                                    ("",[],[("label", slab)]) mempty+                              in  (Just ils', Just slab)+                  Nothing  -> (Just ils, Nothing)+  updateState $ \st -> st{ sCaption = capt }   return mempty  looseItem :: PandocMonad m => LP m Blocks@@ -2018,7 +2229,7 @@   return mempty  resetCaption :: PandocMonad m => LP m ()-resetCaption = updateState $ \st -> st{ sCaption = Nothing }+resetCaption = updateState $ \st -> st{ sCaption = (Nothing, Nothing) }  section :: PandocMonad m => Bool -> Attr -> Int -> LP m Blocks section starred (ident, classes, kvs) lvl = do@@ -2152,6 +2363,11 @@    -- LaTeX colors    , ("textcolor", coloredBlock "color")    , ("colorbox", coloredBlock "background-color")+   -- include+   , ("include", include "include")+   , ("input", include "input")+   , ("subfile", include "subfile")+   , ("usepackage", include "usepackage")    ]  @@ -2192,6 +2408,7 @@    , ("minted", minted)    , ("obeylines", obeylines)    , ("tikzpicture", rawVerbEnv "tikzpicture")+   , ("lilypond", rawVerbEnv "lilypond")    -- etoolbox    , ("ifstrequal", ifstrequal)    , ("newtoggle", braced >>= newToggle)@@ -2234,7 +2451,7 @@ rawVerbEnv name = do   pos <- getPosition   (_, raw) <- withRaw $ verbEnv name-  let raw' = "\\begin{tikzpicture}" ++ toksToString raw+  let raw' = "\\begin{" ++ T.unpack name ++ "}" ++ toksToString raw   exts <- getOption readerExtensions   let parseRaw = extensionEnabled Ext_raw_tex exts   if parseRaw@@ -2303,12 +2520,16 @@  addImageCaption :: PandocMonad m => Blocks -> LP m Blocks addImageCaption = walkM go-  where go (Image attr alt (src,tit))+  where go (Image attr@(_, cls, kvs) alt (src,tit))             | not ("fig:" `isPrefixOf` tit) = do-          mbcapt <- sCaption <$> getState-          return $ case mbcapt of-               Just ils -> Image attr (toList ils) (src, "fig:" ++ tit)-               Nothing  -> Image attr alt (src,tit)+          (mbcapt, mblab) <- sCaption <$> getState+          let (alt', tit') = case mbcapt of+                               Just ils -> (toList ils, "fig:" ++ tit)+                               Nothing  -> (alt, tit)+              attr' = case mblab of+                        Just lab -> (lab, cls, kvs)+                        Nothing  -> attr+          return $ Image attr' alt' (src, tit')         go x = return x  coloredBlock :: PandocMonad m => String -> LP m Blocks@@ -2321,7 +2542,8 @@  graphicsPath :: PandocMonad m => LP m Blocks graphicsPath = do-  ps <- map toksToString <$> (bgroup *> manyTill braced egroup)+  ps <- map toksToString <$>+          (bgroup *> spaces *> manyTill (braced <* spaces) egroup)   getResourcePath >>= setResourcePath . (++ ps)   return mempty @@ -2579,7 +2801,7 @@ addTableCaption :: PandocMonad m => Blocks -> LP m Blocks addTableCaption = walkM go   where go (Table c als ws hs rs) = do-          mbcapt <- sCaption <$> getState+          (mbcapt, _) <- sCaption <$> getState           return $ case mbcapt of                Just ils -> Table (toList ils) als ws hs rs                Nothing  -> Table c als ws hs rs@@ -2590,7 +2812,6 @@ block = do   res <- (mempty <$ spaces1)     <|> environment-    <|> include     <|> macroDef     <|> blockCommand     <|> paragraph
src/Text/Pandoc/Readers/Markdown.hs view
@@ -37,25 +37,21 @@ import Control.Monad import Control.Monad.Except (throwError) import Data.Char (isAlphaNum, isPunctuation, isSpace, toLower)-import qualified Data.HashMap.Strict as H import Data.List (intercalate, sortBy, transpose, elemIndex) import qualified Data.Map as M import Data.Maybe import Data.Ord (comparing)-import Data.Scientific (base10Exponent, coefficient) import qualified Data.Set as Set import Data.Text (Text) import qualified Data.Text as T-import qualified Data.Vector as V-import Data.Yaml (ParseException (..), YamlException (..), YamlMark (..))-import qualified Data.Yaml as Yaml+import qualified Data.YAML as YAML import System.FilePath (addExtension, takeExtension) import Text.HTML.TagSoup import Text.Pandoc.Builder (Blocks, Inlines) import qualified Text.Pandoc.Builder as B import Text.Pandoc.Class (PandocMonad (..), report) import Text.Pandoc.Definition-import Text.Pandoc.Emoji (emojis)+import Text.Pandoc.Emoji (emojiToInline) import Text.Pandoc.Error import Text.Pandoc.Logging import Text.Pandoc.Options@@ -246,47 +242,38 @@   -- by including --- and ..., we allow yaml blocks with just comments:   let rawYaml = unlines ("---" : (rawYamlLines ++ ["..."]))   optional blanklines-  case Yaml.decodeEither' $ UTF8.fromString rawYaml of-       Right (Yaml.Object hashmap) -> do-         let alist = H.toList hashmap-         mapM_ (\(k, v) ->-             if ignorable k-                then return ()-                else do-                  v' <- yamlToMeta v-                  let k' = T.unpack k-                  updateState $ \st -> st{ stateMeta' =-                     do m <- stateMeta' st-                        -- if there's already a value, leave it unchanged-                        case lookupMeta k' m of-                             Just _ -> return m-                             Nothing -> do-                               v'' <- v'-                               return $ B.setMeta (T.unpack k) v'' m}+  case YAML.decodeStrict (UTF8.fromString rawYaml) of+       Right (YAML.Mapping _ hashmap : _) -> do+         let alist = M.toList hashmap+         mapM_ (\(key, v) ->+           case YAML.parseEither (YAML.parseYAML key) of+                Left e  -> fail e+                Right k -> do+                  if ignorable k+                     then return ()+                     else do+                       v' <- yamlToMeta v+                       let k' = T.unpack k+                       updateState $ \st -> st{ stateMeta' =+                          do m <- stateMeta' st+                             -- if there's already a value, leave it unchanged+                             case lookupMeta k' m of+                                  Just _ -> return m+                                  Nothing -> do+                                    v'' <- v'+                                    return $ B.setMeta (T.unpack k) v'' m}            ) alist-       Right Yaml.Null -> return ()+       Right [] -> return ()+       Right (YAML.Scalar YAML.SNull:_) -> return ()        Right _ -> do-                   logMessage $-                      CouldNotParseYamlMetadata "not an object"-                      pos-                   return ()+                  logMessage $+                     CouldNotParseYamlMetadata "not an object"+                     pos+                  return ()        Left err' -> do-                case err' of-                   InvalidYaml (Just YamlParseException{-                               yamlProblem = problem-                             , yamlContext = _ctxt-                             , yamlProblemMark = Yaml.YamlMark {-                                   yamlLine = yline-                                 , yamlColumn = ycol-                             }}) ->-                        logMessage $ CouldNotParseYamlMetadata-                           problem (setSourceLine-                           (setSourceColumn pos-                              (sourceColumn pos + ycol))-                           (sourceLine pos + 1 + yline))-                   _ -> logMessage $ CouldNotParseYamlMetadata-                           (show err') pos-                return ()+                    logMessage $ CouldNotParseYamlMetadata+                                 err' pos+                    return ()   return mempty  -- ignore fields ending with _@@ -313,22 +300,25 @@         -- `|` or `>` will.  yamlToMeta :: PandocMonad m-           => Yaml.Value -> MarkdownParser m (F MetaValue)-yamlToMeta (Yaml.String t) = toMetaValue t-yamlToMeta (Yaml.Number n)-  -- avoid decimal points for numbers that don't need them:-  | base10Exponent n >= 0     = return $ return $ MetaString $ show-                                $ coefficient n * (10 ^ base10Exponent n)-  | otherwise                 = return $ return $ MetaString $ show n-yamlToMeta (Yaml.Bool b) = return $ return $ MetaBool b-yamlToMeta (Yaml.Array xs) = do-  xs' <- mapM yamlToMeta (V.toList xs)+           => YAML.Node -> MarkdownParser m (F MetaValue)+yamlToMeta (YAML.Scalar x) =+  case x of+       YAML.SStr t   -> toMetaValue t+       YAML.SBool b  -> return $ return $ MetaBool b+       YAML.SFloat d -> return $ return $ MetaString (show d)+       YAML.SInt i   -> return $ return $ MetaString (show i)+       _             -> return $ return $ MetaString ""+yamlToMeta (YAML.Sequence _ xs) = do+  xs' <- mapM yamlToMeta xs   return $ do     xs'' <- sequence xs'     return $ B.toMetaValue xs''-yamlToMeta (Yaml.Object o) = do-  let alist = H.toList o-  foldM (\m (k,v) ->+yamlToMeta (YAML.Mapping _ o) = do+  let alist = M.toList o+  foldM (\m (key, v) ->+     case YAML.parseEither (YAML.parseYAML key) of+          Left e  -> fail e+          Right k -> do            if ignorable k               then return m               else do@@ -1591,7 +1581,7 @@   starts <- many1 (char '`')   skipSpaces   result <- (trim . concat) <$>-            many1Till (many1 (noneOf "`\n") <|> many1 (char '`') <|>+            manyTill (many1 (noneOf "`\n") <|> many1 (char '`') <|>                        (char '\n' >> notFollowedBy' blankline >> return " "))                       (try (skipSpaces >> count (length starts) (char '`') >>                       notFollowedBy (char '`')))@@ -2037,9 +2027,9 @@   char ':'   emojikey <- many1 (oneOf emojiChars)   char ':'-  case M.lookup emojikey emojis of-       Just s  -> return (return (B.str s))-       Nothing -> mzero+  case emojiToInline emojikey of+    Just i -> return (return $ B.singleton i)+    Nothing -> mzero  -- Citations 
src/Text/Pandoc/Readers/Muse.hs view
@@ -35,7 +35,6 @@ - Page breaks (five "*") - Org tables - table.el tables-- Images with attributes (floating and width) - <cite> tag -} module Text.Pandoc.Readers.Muse (readMuse) where@@ -46,13 +45,12 @@ import Data.Bifunctor import Data.Char (isLetter) import Data.Default-import Data.List (stripPrefix, intercalate)+import Data.List (intercalate) import Data.List.Split (splitOn) import qualified Data.Map as M import qualified Data.Set as Set-import Data.Maybe (fromMaybe, isNothing)+import Data.Maybe (fromMaybe, isNothing, maybeToList) import Data.Text (Text, unpack)-import System.FilePath (takeExtension) import Text.HTML.TagSoup import Text.Pandoc.Builder (Blocks, Inlines) import qualified Text.Pandoc.Builder as B@@ -778,7 +776,7 @@              , verbatimTag              , classTag              , nbsp-             , link+             , linkOrImage              , code              , codeTag              , mathTag@@ -942,29 +940,60 @@ symbol = return . B.str <$> count 1 nonspaceChar  -- | Parse a link or image.-link :: PandocMonad m => MuseParser m (F Inlines)-link = try $ do+linkOrImage :: PandocMonad m => MuseParser m (F Inlines)+linkOrImage = try $ do   st <- getState   guard $ not $ museInLink st   setState $ st{ museInLink = True }-  (url, content) <- linkText+  res <- explicitLink <|> image <|> link   updateState (\state -> state { museInLink = False })-  return $ case stripPrefix "URL:" url of-             Nothing -> if isImageUrl url-                          then B.image url "" <$> fromMaybe (return mempty) content-                          else B.link url "" <$> fromMaybe (return $ B.str url) content-             Just url' -> B.link url' "" <$> fromMaybe (return $ B.str url') content-    where -- Taken from muse-image-regexp defined in Emacs Muse file lisp/muse-regexps.el-          imageExtensions = [".eps", ".gif", ".jpg", ".jpeg", ".pbm", ".png", ".tiff", ".xbm", ".xpm"]-          isImageUrl = (`elem` imageExtensions) . takeExtension+  return res  linkContent :: PandocMonad m => MuseParser m (F Inlines)-linkContent = char '[' >> trimInlinesF . mconcat <$> manyTill inline (string "]")+linkContent = char '[' >> trimInlinesF . mconcat <$> manyTill inline (char ']') -linkText :: PandocMonad m => MuseParser m (String, Maybe (F Inlines))-linkText = do+-- | Parse a link starting with @URL:@+explicitLink :: PandocMonad m => MuseParser m (F Inlines)+explicitLink = try $ do+  string "[[URL:"+  url <- manyTill anyChar $ char ']'+  content <- option (pure $ B.str url) linkContent+  char ']'+  return $ B.link url "" <$> content++image :: PandocMonad m => MuseParser m (F Inlines)+image = try $ do   string "[["+  (url, (ext, width, align)) <- manyUntil (noneOf "]") $ (imageExtensionAndOptions <* char ']')+  content <- optionMaybe linkContent+  char ']'+  let widthAttr = case align of+                    Just 'f' -> [("width", (fromMaybe "100" width) ++ "%"), ("height", "75%")]+                    _ -> maybeToList (("width",) . (++ "%") <$> width)+  let alignClass = case align of+                     Just 'r' -> ["align-right"]+                     Just 'l' -> ["align-left"]+                     Just 'f' -> []+                     _        -> []+  return $ B.imageWith ("", alignClass, widthAttr) (url ++ ext) mempty <$> fromMaybe (return mempty) content+  where -- Taken from muse-image-regexp defined in Emacs Muse file lisp/muse-regexps.el+        imageExtensions = [".eps", ".gif", ".jpg", ".jpeg", ".pbm", ".png", ".tiff", ".xbm", ".xpm"]+        imageExtension = choice (try . string <$> imageExtensions)+        imageExtensionAndOptions = do+          ext <- imageExtension+          (width, align) <- option (Nothing, Nothing) imageAttrs+          return (ext, width, align)+        imageAttrs = do+          many1 spaceChar+          width <- optionMaybe (many1 digit)+          many spaceChar+          align <- optionMaybe (oneOf "rlf")+          return (width, align)++link :: PandocMonad m => MuseParser m (F Inlines)+link = try $ do+  string "[["   url <- manyTill anyChar $ char ']'   content <- optionMaybe linkContent   char ']'-  return (url, content)+  return $ B.link url "" <$> fromMaybe (return $ B.str url) content
src/Text/Pandoc/Readers/Odt/Arrows/Utils.hs view
@@ -100,7 +100,7 @@ -- | Duplicate a value to subsequently feed it into different arrows. -- Can almost always be replaced with '(&&&)', 'keepingTheValue', -- or even '(|||)'.--- Aequivalent to+-- Equivalent to -- > returnA &&& returnA duplicate :: (Arrow a) => a b (b,b) duplicate = arr $ join (,)@@ -114,7 +114,7 @@   -- | Duplicate a value and apply an arrow to the second instance.--- Aequivalent to+-- Equivalent to -- > \a -> duplicate >>> second a -- or -- > \a -> returnA &&& a
src/Text/Pandoc/Readers/Odt/Generic/Namespaces.hs view
@@ -50,7 +50,7 @@   getNamespaceID   :: NameSpaceIRI                       -> NameSpaceIRIs nsID                       -> Maybe (NameSpaceIRIs nsID, nsID)-  -- | Given a namespace id, lookup its IRI. May be overriden for performance.+  -- | Given a namespace id, lookup its IRI. May be overridden for performance.   getIRI           :: nsID                       -> NameSpaceIRIs nsID                       -> Maybe NameSpaceIRI
src/Text/Pandoc/Readers/Odt/Generic/Utils.hs view
@@ -61,7 +61,7 @@ import Data.Maybe  --- | Aequivalent to+-- | Equivalent to -- > foldr (.) id -- where '(.)' are 'id' are the ones from "Control.Category" -- and 'foldr' is the one from "Data.Foldable".@@ -72,7 +72,7 @@ composition        :: (Category cat, F.Foldable f) => f (cat a a) -> cat a a composition        = F.foldr (<<<) Cat.id --- | Aequivalent to+-- | Equivalent to -- > foldr (flip (.)) id -- where '(.)' are 'id' are the ones from "Control.Category" -- and 'foldr' is the one from "Data.Foldable".
src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs view
@@ -261,7 +261,7 @@ -- The resulting converter even behaves like an identity converter on the -- value level. ----- Aequivalent to+-- Equivalent to -- -- > \v x a -> convertingExtraState v (returnV x >>> a) --
src/Text/Pandoc/Readers/Odt/StyleReader.hs view
@@ -342,7 +342,7 @@   readsPrec _  _   = []  -- | Rough conversion of measures into millimetres.--- Pixels and em's are actually implementation dependant/relative measures,+-- Pixels and em's are actually implementation dependent/relative measures, -- so I could not really easily calculate anything exact here even if I wanted. -- But I do not care about exactness right now, as I only use measures -- to determine if a paragraph is "indented" or not.
src/Text/Pandoc/Readers/Org/Blocks.hs view
@@ -743,7 +743,7 @@   ----- Footnote defintions+-- Footnote definitions -- noteBlock :: PandocMonad m => OrgParser m (F Blocks) noteBlock = try $ do
src/Text/Pandoc/Readers/Org/Inlines.hs view
@@ -510,7 +510,7 @@                      <* string ">>"                      <* skipSpaces --- | Replace every char but [a-zA-Z0-9_.-:] with a hypen '-'.  This mirrors+-- | Replace every char but [a-zA-Z0-9_.-:] with a hyphen '-'.  This mirrors -- the org function @org-export-solidify-link-text@.  solidify :: String -> String
src/Text/Pandoc/Readers/Textile.hs view
@@ -540,7 +540,7 @@ str :: PandocMonad m => ParserT [Char] ParserState m Inlines str = do   baseStr <- hyphenedWords-  -- RedCloth compliance : if parsed word is uppercase and immediatly+  -- RedCloth compliance : if parsed word is uppercase and immediately   -- followed by parens, parens content is unconditionally word acronym   fullStr <- option baseStr $ try $ do     guard $ all isUpper baseStr
src/Text/Pandoc/Readers/TikiWiki.hs view
@@ -22,6 +22,7 @@ import Control.Monad import Control.Monad.Except (throwError) import qualified Data.Foldable as F+import Data.List (dropWhileEnd) import Data.Maybe (fromMaybe) import Data.Text (Text) import qualified Data.Text as T@@ -166,7 +167,7 @@   -- return $ B.simpleTable (headers rows) $ trace ("rows: " ++ (show rows)) rows   return $B.simpleTable (headers rows) rows   where-    -- The headers are as many empty srings as the number of columns+    -- The headers are as many empty strings as the number of columns     -- in the first row     headers rows = map (B.plain . B.str) $replicate (length $ head rows) "" @@ -319,7 +320,7 @@ bulletItem :: PandocMonad m => TikiWikiParser m (ListNesting, B.Blocks) bulletItem = try $ do   prefix <- many1 $ char '*'-  many1 $ char ' '+  many $ char ' '   content <- listItemLine (length prefix)   return (LN Bullet (length prefix), B.plain content) @@ -331,7 +332,7 @@ numberedItem :: PandocMonad m => TikiWikiParser m (ListNesting, B.Blocks) numberedItem = try $ do   prefix <- many1 $ char '#'-  many1 $ char ' '+  many $ char ' '   content <- listItemLine (length prefix)   return (LN Numbered (length prefix), B.plain content) @@ -346,7 +347,7 @@     listContinuation = string (replicate nest '+') >> lineContent     parseContent x = do       parsed <- parseFromString (many1 inline) x-      return $ mconcat parsed+      return $ mconcat $ dropWhileEnd (== B.space) parsed  -- Turn the CODE macro attributes into Pandoc code block attributes. mungeAttrs :: [(String, String)] -> (String, [String], [(String, String)])
src/Text/Pandoc/Readers/Txt2Tags.hs view
@@ -198,7 +198,7 @@ commentBlock :: T2T Blocks commentBlock = try (blockMarkupArea anyLine (const mempty) "%%%") <|> comment --- Seperator and Strong line treated the same+-- Separator and Strong line treated the same hrule :: T2T Blocks hrule = try $ do   spaces
src/Text/Pandoc/Shared.hs view
@@ -712,7 +712,7 @@   , "ws", "wss", "wtai", "wyciwyg", "xcon", "xcon-userid", "xfire"   , "xmlrpc.beep", "xmlrpc.beeps", "xmpp", "xri", "ymsgr", "z39.50", "z39.50r"   , "z39.50s"-  -- Inofficial schemes+  -- Unofficial schemes   , "doi", "isbn", "javascript", "pmid"   ] 
src/Text/Pandoc/Translations.hs view
@@ -48,11 +48,12 @@                          ) where import Prelude-import Data.Aeson.Types (typeMismatch)+import Data.Aeson.Types (Value(..), FromJSON(..))+import qualified Data.Aeson.Types as Aeson import qualified Data.HashMap.Strict as HM import qualified Data.Map as M import Data.Text as T-import Data.Yaml as Yaml+import qualified Data.YAML as YAML import GHC.Generics (Generic) import Text.Pandoc.Shared (safeRead) import qualified Text.Pandoc.UTF8 as UTF8@@ -90,8 +91,16 @@                                Just t' -> pure t'                                Nothing -> fail $ "Invalid Term name " ++                                                  show t-  parseJSON invalid = typeMismatch "Term" invalid+  parseJSON invalid = Aeson.typeMismatch "Term" invalid +instance YAML.FromYAML Term where+  parseYAML (YAML.Scalar (YAML.SStr t)) =+                         case safeRead (T.unpack t) of+                               Just t' -> pure t'+                               Nothing -> fail $ "Invalid Term name " +++                                                 show t+  parseYAML invalid = YAML.typeMismatch "Term" invalid+ instance FromJSON Translations where   parseJSON (Object hm) = do     xs <- mapM addItem (HM.toList hm)@@ -102,14 +111,28 @@                  Just t  ->                    case v of                         (String s) -> return (t, T.unpack $ T.strip s)-                        inv        -> typeMismatch "String" inv-  parseJSON invalid = typeMismatch "Translations" invalid+                        inv        -> Aeson.typeMismatch "String" inv+  parseJSON invalid = Aeson.typeMismatch "Translations" invalid +instance YAML.FromYAML Translations where+  parseYAML = YAML.withMap "Translations" $+    \tr -> Translations .M.fromList <$> mapM addItem (M.toList tr)+   where addItem (n@(YAML.Scalar (YAML.SStr k)), v) =+            case safeRead (T.unpack k) of+                 Nothing -> YAML.typeMismatch "Term" n+                 Just t  ->+                   case v of+                        (YAML.Scalar (YAML.SStr s)) ->+                          return (t, T.unpack (T.strip s))+                        n' -> YAML.typeMismatch "String" n'+         addItem (n, _) = YAML.typeMismatch "String" n+ lookupTerm :: Term -> Translations -> Maybe String lookupTerm t (Translations tm) = M.lookup t tm  readTranslations :: String -> Either String Translations readTranslations s =-  case Yaml.decodeEither' $ UTF8.fromString s of-       Left err' -> Left $ prettyPrintParseException err'-       Right t   -> Right t+  case YAML.decodeStrict $ UTF8.fromString s of+       Left err'   -> Left err'+       Right (t:_) -> Right t+       Right []    -> Left "empty YAML document"
src/Text/Pandoc/Writers/AsciiDoc.hs view
@@ -44,7 +44,7 @@ import Data.Char (isPunctuation, isSpace) import Data.List (intercalate, intersperse, stripPrefix) import qualified Data.Map as M-import Data.Maybe (fromMaybe, isJust)+import Data.Maybe (fromMaybe, isJust, listToMaybe) import qualified Data.Set as Set import Data.Text (Text) import qualified Data.Text as T@@ -126,11 +126,16 @@                           else spaceChar  -- | True if string begins with an ordered list marker-beginsWithOrderedListMarker :: String -> Bool-beginsWithOrderedListMarker str =-  case runParser olMarker defaultParserState "para start" (take 10 str) of-         Left  _ -> False-         Right _ -> True+-- or would be interpreted as an AsciiDoc option command+needsEscaping :: String -> Bool+needsEscaping s = beginsWithOrderedListMarker s || isBracketed s+  where+    beginsWithOrderedListMarker str =+      case runParser olMarker defaultParserState "para start" (take 10 str) of+             Left  _ -> False+             Right _ -> True+    isBracketed ('[':cs) = listToMaybe (reverse cs) == Just ']'+    isBracketed _ = False  -- | Convert Pandoc block element to asciidoc. blockToAsciiDoc :: PandocMonad m@@ -146,8 +151,8 @@ blockToAsciiDoc opts (Para inlines) = do   contents <- inlineListToAsciiDoc opts inlines   -- escape if para starts with ordered list marker-  let esc = if beginsWithOrderedListMarker (render Nothing contents)-               then text "\\"+  let esc = if needsEscaping (render Nothing contents)+               then text "{empty}"                else empty   return $ esc <> contents <> blankline blockToAsciiDoc opts (LineBlock lns) = do
src/Text/Pandoc/Writers/CommonMark.hs view
@@ -304,6 +304,11 @@               (node (HTML_INLINE (T.pack ("\\(" ++ str ++ "\\)"))) [] :)             DisplayMath ->               (node (HTML_INLINE (T.pack ("\\[" ++ str ++ "\\]"))) [] :)+inlineToNodes opts (Span ("",["emoji"],kvs) [Str s]) = do+  case lookup "data-emoji" kvs of+       Just emojiname | isEnabled Ext_emoji opts ->+            (node (TEXT (":" <> T.pack emojiname <> ":")) [] :)+       _ -> (node (TEXT (T.pack s)) [] :) inlineToNodes opts (Span attr ils) =   let nodes = inlinesToNodes opts ils       op = tagWithAttributes opts True False "span" attr
src/Text/Pandoc/Writers/Custom.hs view
@@ -113,7 +113,7 @@     -- check for error in lua script (later we'll change the return type     -- to handle this more gracefully):     when (stat /= OK) $-      tostring 1 >>= throw . PandocLuaException . UTF8.toString+      tostring (-1) >>= throw . PandocLuaException . UTF8.toString     -- TODO - call hierarchicalize, so we have that info     rendered <- docToCustom opts doc     context <- metaToJSON opts
src/Text/Pandoc/Writers/Docx.hs view
@@ -230,7 +230,7 @@   let mbAttrMarLeft = (elAttribs <$> mbpgmar) >>= lookupAttrBy ((=="left") . qName)   let mbAttrMarRight = (elAttribs <$> mbpgmar) >>= lookupAttrBy ((=="right") . qName) -  -- Get the avaible area (converting the size and the margins to int and+  -- Get the available area (converting the size and the margins to int and   -- doing the difference   let pgContentWidth = (-) <$> (read <$> mbAttrSzWidth ::Maybe Integer)                        <*> (@@ -727,7 +727,7 @@   makeTOC :: (PandocMonad m) => WriterOptions -> WS m [Element]-makeTOC opts | writerTableOfContents opts = do+makeTOC opts = do   let depth = "1-"++show (writerTOCDepth opts)   let tocCmd = "TOC \\o \""++depth++"\" \\h \\z \\u"   tocTitle <- gets stTocTitle@@ -751,9 +751,7 @@         ) -- w:p       ])     ])] -- w:sdt-makeTOC _ = return [] - -- | Convert Pandoc document to two lists of -- OpenXML elements (the main document and footnotes). writeOpenXML :: (PandocMonad m) => WriterOptions -> Pandoc -> WS m ([Element], [Element],[Element])@@ -770,6 +768,13 @@                        Just (MetaBlocks [Para  xs]) -> xs                        Just (MetaInlines xs)        -> xs                        _                            -> []+  let includeTOC = writerTableOfContents opts ||+                   case lookupMeta "toc" meta of+                       Just (MetaBlocks _)     -> True+                       Just (MetaInlines _)    -> True+                       Just (MetaString (_:_)) -> True+                       Just (MetaBool True)    -> True+                       _                       -> False   title <- withParaPropM (pStyleM "Title") $ blocksToOpenXML opts [Para tit | not (null tit)]   subtitle <- withParaPropM (pStyleM "Subtitle") $ blocksToOpenXML opts [Para subtitle' | not (null subtitle')]   authors <- withParaProp (pCustomStyle "Author") $ blocksToOpenXML opts $@@ -801,7 +806,9 @@               ] ++ annotation             ]   comments' <- mapM toComment comments-  toc <- makeTOC opts+  toc <- if includeTOC+            then makeTOC opts+            else return []   let meta' = title ++ subtitle ++ authors ++ date ++ abstract ++ toc   return (meta' ++ doc', notes', comments') 
src/Text/Pandoc/Writers/EPUB.hs view
@@ -74,6 +74,7 @@ import Text.XML.Light (Attr (..), Element (..), Node (..), QName (..),                        add_attrs, lookupAttr, node, onlyElems, parseXML,                        ppElement, showElement, strContent, unode, unqual)+import Text.Pandoc.XML (escapeStringForXML)  -- A Chapter includes a list of blocks and maybe a section -- number offset.  Note, some chapters are unnumbered. The section@@ -446,7 +447,8 @@                        cpContent <- lift $ writeHtml                             opts'{ writerVariables =                                     ("coverpage","true"):-                                    ("pagetitle",plainTitle):+                                    ("pagetitle",+                                       escapeStringForXML plainTitle):                                      cssvars True ++ vars }                             (Pandoc meta [RawBlock (Format "html") $ "<div id=\"cover-image\">\n<img src=\"../media/" ++ coverImage ++ "\" alt=\"cover image\" />\n</div>"])                        imgContent <- lift $ P.readFileLazy img@@ -459,7 +461,7 @@   -- title page   tpContent <- lift $ writeHtml opts'{                                   writerVariables = ("titlepage","true"):-                                  ("pagetitle",plainTitle):+                                  ("pagetitle", escapeStringForXML plainTitle):                                   cssvars True ++ vars }                                (Pandoc meta [])   tpEntry <- mkEntry "text/title_page.xhtml" tpContent@@ -754,7 +756,8 @@                                (writeHtmlStringForEPUB version                                  opts{ writerTemplate = Nothing                                      , writerVariables =-                                       ("pagetitle",plainTitle):+                                       ("pagetitle",+                                         escapeStringForXML plainTitle):                                        writerVariables opts}                                  (Pandoc nullMeta                                    [Plain $ walk clean tit])) of
src/Text/Pandoc/Writers/FB2.hs view
@@ -119,7 +119,7 @@   let as = authors meta'   dd <- docdate meta'   annotation <- case lookupMeta "abstract" meta' of-                  Just (MetaBlocks bs) -> (list . el "annotation") <$> cMapM blockToXml bs+                  Just (MetaBlocks bs) -> (list . el "annotation") <$> (cMapM blockToXml $ map unPlain bs)                   _ -> pure mempty   let lang = case lookupMeta "lang" meta' of                Just (MetaInlines [Str s]) -> [el "lang" $ iso639 s]@@ -135,7 +135,7 @@                     Just (MetaString s) -> coverimage s                     _       -> return []   return $ el "description"-    [ el "title-info" (genre : (bt ++ annotation ++ as ++ dd ++ lang))+    [ el "title-info" (genre : (as ++ bt ++ annotation ++ dd ++ lang))     , el "document-info" (el "program-used" "pandoc" : coverpage)     ] @@ -397,6 +397,11 @@ plainToPara (Para inlines : rest) =     Para inlines : HorizontalRule : plainToPara rest -- HorizontalRule will be converted to <empty-line /> plainToPara (p:rest) = p : plainToPara rest++-- Replace plain text with paragraphs+unPlain :: Block -> Block+unPlain (Plain inlines) = Para inlines+unPlain x = x  -- Simulate increased indentation level. Will not really work -- for multi-line paragraphs.
src/Text/Pandoc/Writers/HTML.hs view
@@ -259,7 +259,7 @@   st <- get   notes <- footnoteSection opts (reverse (stNotes st))   let thebody = blocks' >> notes-  let  math = case writerHTMLMathMethod opts of+  let math = case writerHTMLMathMethod opts of                       MathJax url                         | slideVariant /= RevealJsSlides ->                         -- mathjax is handled via a special plugin in revealjs@@ -296,10 +296,11 @@                   (if stMath st                       then defField "math" (renderHtml' math)                       else id) $-                  defField "mathjax"-                      (case writerHTMLMathMethod opts of-                            MathJax _ -> True-                            _         -> False) $+                  (case writerHTMLMathMethod opts of+                        MathJax u -> defField "mathjax" True .+                                     defField "mathjaxurl"+                                       (takeWhile (/='?') u)+                        _         -> defField "mathjax" False) $                   defField "quotes" (stQuotes st) $                   -- for backwards compatibility we populate toc                   -- with the contents of the toc, rather than a
src/Text/Pandoc/Writers/ICML.hs view
@@ -153,7 +153,7 @@        Nothing  -> return main        Just tpl -> renderTemplate' tpl context --- | Auxilary functions for parStylesToDoc and charStylesToDoc.+-- | Auxiliary functions for parStylesToDoc and charStylesToDoc. contains :: String -> (String, (String, String)) -> [(String, String)] contains s rule =   [snd rule | (fst rule) `isInfixOf` s]
src/Text/Pandoc/Writers/LaTeX.hs view
@@ -402,7 +402,8 @@                     not (null $ query hasCodeBlock elts ++ query hasCode elts)       let frameoptions = ["allowdisplaybreaks", "allowframebreaks", "fragile",                           "b", "c", "t", "environment",-                          "label", "plain", "shrink", "standout"]+                          "label", "plain", "shrink", "standout",+                          "noframenumbering"]       let optionslist = ["fragile" | fragile && isNothing (lookup "fragile" kvs)] ++                         [k | k <- classes, k `elem` frameoptions] ++                         [k ++ "=" ++ v | (k,v) <- kvs, k `elem` frameoptions]@@ -487,7 +488,7 @@                         then \contents ->                                let fromPct xs =                                      case reverse xs of-                                       '%':ds -> '0':'.': reverse ds+                                       '%':ds -> showFl (read (reverse ds) / 100 :: Double)                                        _      -> xs                                    w = maybe "0.48" fromPct (lookup "width" kvs)                                in  inCmd "begin" "column" <>@@ -517,25 +518,15 @@   inlineListToLaTeX $ dropWhile isLineBreakOrSpace lst -- title beginning with fig: indicates that the image is a figure blockToLaTeX (Para [Image attr@(ident, _, _) txt (src,'f':'i':'g':':':tit)]) = do-  inNote <- gets stInNote-  inMinipage <- gets stInMinipage-  modify $ \st -> st{ stInMinipage = True, stNotes = [] }-  capt <- inlineListToLaTeX txt-  notes <- gets stNotes-  modify $ \st -> st{ stInMinipage = False, stNotes = [] }--  -- We can't have footnotes in the list of figures, so remove them:-  captForLof <- if null notes-                   then return empty-                   else brackets <$> inlineListToLaTeX (walk deNote txt)-  img <- inlineToLaTeX (Image attr txt (src,tit))-  let footnotes = notesToLaTeX notes+  (capt, captForLof, footnotes) <- getCaption txt   lab <- labelFor ident   let caption = "\\caption" <> captForLof <> braces capt <> lab+  img <- inlineToLaTeX (Image attr txt (src,tit))   innards <- hypertarget True ident $                  "\\centering" $$ img $$ caption <> cr   let figure = cr <> "\\begin{figure}" $$ innards $$ "\\end{figure}"-  return $ if inNote || inMinipage+  st <- get+  return $ if stInNote st || stInMinipage st               -- can't have figures in notes or minipage (here, table cell)               -- http://www.tex.ac.uk/FAQ-ouparmd.html               then "\\begin{center}" $$ img $+$ capt $$ "\\end{center}"@@ -714,11 +705,11 @@   modify $ \s -> s{stInHeading = False}   return hdr blockToLaTeX (Table caption aligns widths heads rows) = do+  (captionText, captForLof, footnotes) <- getCaption caption   let toHeaders hs = do contents <- tableRowToLaTeX True aligns widths hs                         return ("\\toprule" $$ contents $$ "\\midrule")   let removeNote (Note _) = Span ("", [], []) []       removeNote x        = x-  captionText <- inlineListToLaTeX caption   firsthead <- if isEmpty captionText || all null heads                   then return empty                   else ($$ text "\\endfirsthead") <$> toHeaders heads@@ -730,8 +721,8 @@                                  else walk removeNote heads)   let capt = if isEmpty captionText                 then empty-                else text "\\caption" <>-                      braces captionText <> "\\tabularnewline"+                else "\\caption" <> captForLof <> braces captionText+                         <> "\\tabularnewline"   rows' <- mapM (tableRowToLaTeX False aligns widths) rows   let colDescriptors = text $ concatMap toColDescriptor aligns   modify $ \s -> s{ stTable = True }@@ -745,6 +736,21 @@          $$ vcat rows'          $$ "\\bottomrule"          $$ "\\end{longtable}"+         $$ footnotes++getCaption :: PandocMonad m => [Inline] -> LW m (Doc, Doc, Doc)+getCaption txt = do+  inMinipage <- gets stInMinipage+  modify $ \st -> st{ stInMinipage = True, stNotes = [] }+  capt <- inlineListToLaTeX txt+  notes <- gets stNotes+  modify $ \st -> st{ stInMinipage = inMinipage, stNotes = [] }+  -- We can't have footnotes in the list of figures/tables, so remove them:+  captForLof <- if null notes+                   then return empty+                   else brackets <$> inlineListToLaTeX (walk deNote txt)+  let footnotes = notesToLaTeX notes+  return (capt, captForLof, footnotes)  toColDescriptor :: Alignment -> String toColDescriptor align =
src/Text/Pandoc/Writers/Markdown.hs view
@@ -50,7 +50,7 @@ import Data.Text (Text) import qualified Data.Text as T import qualified Data.Vector as V-import Data.Yaml (Value (Array, Bool, Number, Object, String))+import Data.Aeson (Value (Array, Bool, Number, Object, String)) import Network.HTTP (urlEncode) import Text.HTML.TagSoup (Tag (..), isTagText, parseTags) import Text.Pandoc.Class (PandocMonad, report)@@ -452,8 +452,14 @@               | otherwise -> contents   return $ contents' <> cr -- title beginning with fig: indicates figure-blockToMarkdown' opts (Para [Image attr alt (src,'f':'i':'g':':':tit)]) =-  blockToMarkdown opts (Para [Image attr alt (src,tit)])+blockToMarkdown' opts (Para [Image attr alt (src,'f':'i':'g':':':tit)])+  | isEnabled Ext_raw_html opts &&+    not (isEnabled Ext_link_attributes opts) &&+    attr /= nullAttr = -- use raw HTML+    (text . T.unpack . T.strip) <$>+      writeHtml5String opts{ writerTemplate = Nothing }+        (Pandoc nullMeta [Para [Image attr alt (src,"fig:" ++ tit)]])+  | otherwise = blockToMarkdown opts (Para [Image attr alt (src,tit)]) blockToMarkdown' opts (Para inlines) =   (<> blankline) `fmap` blockToMarkdown opts (Plain inlines) blockToMarkdown' opts (LineBlock lns) =@@ -619,7 +625,7 @@                   (all null headers) aligns' widths' headers rows             | isEnabled Ext_raw_html opts -> fmap (id,) $                    (text . T.unpack) <$>-                   (writeHtml5String def $ Pandoc nullMeta [t])+                   (writeHtml5String opts{ writerTemplate = Nothing } $ Pandoc nullMeta [t])             | hasSimpleCells &&               isEnabled Ext_pipe_tables opts -> do                 rawHeaders <- padRow <$> mapM (blockListToMarkdown opts) headers@@ -976,6 +982,11 @@  -- | Convert Pandoc inline element to markdown. inlineToMarkdown :: PandocMonad m => WriterOptions -> Inline -> MD m Doc+inlineToMarkdown opts (Span ("",["emoji"],kvs) [Str s]) = do+  case lookup "data-emoji" kvs of+       Just emojiname | isEnabled Ext_emoji opts ->+            return $ ":" <> text emojiname <> ":"+       _ -> inlineToMarkdown opts (Str s) inlineToMarkdown opts (Span attrs ils) = do   plain <- asks envPlain   contents <- inlineListToMarkdown opts ils@@ -1172,7 +1183,7 @@     not (isEnabled Ext_link_attributes opts) &&     attr /= nullAttr = -- use raw HTML     (text . T.unpack . T.strip) <$>-      writeHtml5String def (Pandoc nullMeta [Plain [lnk]])+      writeHtml5String opts{ writerTemplate = Nothing } (Pandoc nullMeta [Plain [lnk]])   | otherwise = do   plain <- asks envPlain   linktext <- inlineListToMarkdown opts txt@@ -1212,7 +1223,7 @@     not (isEnabled Ext_link_attributes opts) &&     attr /= nullAttr = -- use raw HTML     (text . T.unpack . T.strip) <$>-      writeHtml5String def (Pandoc nullMeta [Plain [img]])+      writeHtml5String opts{ writerTemplate = Nothing } (Pandoc nullMeta [Plain [img]])   | otherwise = do   plain <- asks envPlain   let txt = if null alternate || alternate == [Str source]
src/Text/Pandoc/Writers/OpenDocument.hs view
@@ -193,10 +193,15 @@                                                   ,("style:horizontal-rel", "paragraph-content")                                                   ,("style:wrap",           "none")] -inHeaderTags :: PandocMonad m => Int -> Doc -> OD m Doc-inHeaderTags i d =+inHeaderTags :: PandocMonad m => Int -> String -> Doc -> OD m Doc+inHeaderTags i ident d =   return $ inTags False "text:h" [ ("text:style-name", "Heading_20_" ++ show i)-                                 , ("text:outline-level", show i)] d+                                 , ("text:outline-level", show i)]+         $ if null ident+              then d+              else selfClosingTag "text:bookmark-start" [ ("text:name", ident) ]+                   <> d <>+                   selfClosingTag "text:bookmark-end" [ ("text:name", ident) ]  inQuotes :: QuoteType -> Doc -> Doc inQuotes SingleQuote s = char '\8216' <> s <> char '\8217'@@ -349,8 +354,9 @@     | LineBlock      b <- bs = blockToOpenDocument o $ linesToPara b     | Div attr xs      <- bs = withLangFromAttr attr                                   (blocksToOpenDocument o xs)-    | Header     i _ b <- bs = setFirstPara >>-                               (inHeaderTags  i =<< inlinesToOpenDocument o b)+    | Header     i (ident,_,_) b+                       <- bs = setFirstPara >> (inHeaderTags i ident+                                  =<< inlinesToOpenDocument o b)     | BlockQuote     b <- bs = setFirstPara >> mkBlockQuote b     | DefinitionList b <- bs = setFirstPara >> defList b     | BulletList     b <- bs = setFirstPara >> bulletListToOpenDocument o b
src/Text/Pandoc/Writers/Org.hs view
@@ -266,7 +266,7 @@   contents <- blockListToOrg items   return $ hang (length marker + 1) (text marker <> space) (contents <> cr) --- | Convert defintion list item (label, list of blocks) to Org.+-- | Convert definition list item (label, list of blocks) to Org. definitionListItemToOrg :: PandocMonad m                         => ([Inline], [[Block]]) -> Org m Doc definitionListItemToOrg (label, defs) = do
src/Text/Pandoc/Writers/RST.hs view
@@ -103,6 +103,7 @@   let context = defField "body" main               $ defField "toc" (writerTableOfContents opts)               $ defField "toc-depth" (show $ writerTOCDepth opts)+              $ defField "number-sections" (writerNumberSections opts)               $ defField "math" hasMath               $ defField "title" (render Nothing title :: String)               $ defField "math" hasMath@@ -272,7 +273,8 @@      then return $ prefixed "> " (text str) $$ blankline      else return $           (case [c | c <- classes,-                     c `notElem` ["sourceCode","literate","numberLines"]] of+                     c `notElem` ["sourceCode","literate","numberLines",+                                  "number-lines","example"]] of              []       -> "::"              (lang:_) -> (".. code:: " <> text lang) $$ numberlines)           $+$ nest 3 (text str) $$ blankline@@ -331,7 +333,7 @@   let marker' = marker ++ " "   return $ hang (length marker') (text marker') $ contents <> cr --- | Convert defintion list item (label, list of blocks) to RST.+-- | Convert definition list item (label, list of blocks) to RST. definitionListItemToRST :: PandocMonad m => ([Inline], [[Block]]) -> RST m Doc definitionListItemToRST (label, defs) = do   label' <- inlineListToRST label
src/Text/Pandoc/Writers/Texinfo.hs view
@@ -56,8 +56,6 @@  data WriterState =   WriterState { stStrikeout   :: Bool  -- document contains strikeout-              , stSuperscript :: Bool -- document contains superscript-              , stSubscript   :: Bool -- document contains subscript               , stEscapeComma :: Bool -- in a context where we need @comma               , stIdentifiers :: Set.Set String -- header ids used already               , stOptions     :: WriterOptions -- writer options@@ -74,8 +72,7 @@ writeTexinfo :: PandocMonad m => WriterOptions -> Pandoc -> m Text writeTexinfo options document =   evalStateT (pandocToTexinfo options $ wrapTop document)-  WriterState { stStrikeout = False, stSuperscript = False,-                stEscapeComma = False, stSubscript = False,+  WriterState { stStrikeout = False, stEscapeComma = False,                 stIdentifiers = Set.empty, stOptions = options}  -- | Add a "Top" node around the document, needed by Texinfo.@@ -102,8 +99,6 @@   let context = defField "body" body               $ defField "toc" (writerTableOfContents options)               $ defField "titlepage" titlePage-              $ defField "subscript" (stSubscript st)-              $ defField "superscript" (stSuperscript st)               $         defField "strikeout" (stStrikeout st) metadata   case writerTemplate options of@@ -427,14 +422,12 @@   return $ text "@textstrikeout{" <> contents <> text "}"  inlineToTexinfo (Superscript lst) = do-  modify $ \st -> st{ stSuperscript = True }   contents <- inlineListToTexinfo lst-  return $ text "@textsuperscript{" <> contents <> char '}'+  return $ text "@sup{" <> contents <> char '}'  inlineToTexinfo (Subscript lst) = do-  modify $ \st -> st{ stSubscript = True }   contents <- inlineListToTexinfo lst-  return $ text "@textsubscript{" <> contents <> char '}'+  return $ text "@sub{" <> contents <> char '}'  inlineToTexinfo (SmallCaps lst) =   inlineListToTexinfo lst >>= return . inCmd "sc"
stack.yaml view
@@ -2,7 +2,6 @@   pandoc:     trypandoc: false     embed_data_files: true-    network-uri: true   pandoc-citeproc:     bibutils: true     embed_data_files: true@@ -13,15 +12,9 @@ - '.' extra-deps: - pandoc-citeproc-0.14.3.1-- skylighting-0.7.0.2-- skylighting-core-0.7.0.2-- ansi-terminal-0.8.0.2-- tasty-1.0.1.1-- test-framework-0.8.2.0-- pandoc-types-1.17.4.2-- cmark-gfm-0.1.3-- hslua-module-text-0.1.2.1-- texmath-0.11+- haddock-library-1.6.0+- HsYAML-0.1.1.1+- network-2.7.0.2 ghc-options:    "$locals": -fhide-source-paths -XNoImplicitPrelude-resolver: lts-10.10+resolver: lts-12.0
test/Tests/Lua.hs view
@@ -129,7 +129,7 @@   , testCase "Pandoc version is set" . runPandocLua' $ do       Lua.getglobal' "table.concat"       Lua.getglobal "PANDOC_VERSION"-      Lua.push ("." :: String) -- seperator+      Lua.push ("." :: String) -- separator       Lua.call 2 1       Lua.liftIO . assertEqual "pandoc version is wrong" pandocVersion         =<< Lua.peek Lua.stackTop
test/Tests/Readers/Markdown.hs view
@@ -199,7 +199,9 @@           ]         , testGroup "emoji"           [ test markdownGH "emoji symbols" $-            ":smile: and :+1:" =?> para (text "😄 and 👍")+            ":smile: and :+1:" =?> para (spanWith ("", ["emoji"], [("data-emoji", "smile")]) "😄" <>+                                         space <> str "and" <> space <>+                                         spanWith ("", ["emoji"], [("data-emoji", "+1")]) "👍")           ]         , "unbalanced brackets" =:             "[[[[[[[[[[[[hi" =?> para (text "[[[[[[[[[[[[hi")
test/Tests/Readers/Muse.hs view
@@ -194,9 +194,27 @@         , "Image" =:           "[[image.jpg]]" =?>           para (image "image.jpg" "" mempty)+        , "Closing bracket is not allowed in image filename" =:+          "[[foo]bar.jpg]]" =?>+          para (text "[[foo]bar.jpg]]")         , "Image with description" =:           "[[image.jpg][Image]]" =?>           para (image "image.jpg" "" (text "Image"))+        , "Image with space in filename" =:+          "[[image name.jpg]]" =?>+          para (image "image name.jpg" "" mempty)+        , "Image with width" =:+          "[[image.jpg 60]]" =?>+          para (imageWith ("", [], [("width", "60%")]) "image.jpg" mempty mempty)+        , "At least one space is required between image filename and width" =:+          "[[image.jpg60]]" =?>+          para (link "image.jpg60" mempty (str "image.jpg60"))+        , "Left-aligned image with width" =:+          "[[image.png 60 l][Image]]" =?>+          para (imageWith ("", ["align-left"], [("width", "60%")]) "image.png" "" (str "Image"))+        , "Right-aligned image with width" =:+          "[[image.png 60 r][Image]]" =?>+          para (imageWith ("", ["align-right"], [("width", "60%")]) "image.png" "" (str "Image"))         , "Image link" =:           "[[URL:image.jpg]]" =?>           para (link "image.jpg" "" (str "image.jpg"))
test/Tests/Readers/Org/Inline.hs view
@@ -96,7 +96,7 @@       "[fn::Schreib mir eine E-Mail]" =?>       para (note $ para "Schreib mir eine E-Mail") -  , "Markup-chars not occuring on word break are symbols" =:+  , "Markup-chars not occurring on word break are symbols" =:       T.unlines [ "this+that+ +so+on"                 , "seven*eight* nine*"                 , "+not+funny+"
test/command/1710.md view
@@ -58,7 +58,7 @@ \protect\hypertarget{slide-one}{}  \begin{columns}[T]-\begin{column}{0.40\textwidth}+\begin{column}{0.4\textwidth} \begin{itemize} \tightlist \item@@ -68,7 +68,7 @@ \end{itemize} \end{column} -\begin{column}{0.40\textwidth}+\begin{column}{0.4\textwidth} \begin{itemize} \tightlist \item@@ -78,11 +78,10 @@ \end{itemize} \end{column} -\begin{column}{0.10\textwidth}+\begin{column}{0.1\textwidth} ok \end{column} \end{columns}  \end{frame} ```-
test/command/2118.md view
@@ -7,5 +7,5 @@   \label{fig:setminus} \end{figure} ^D-[Para [Image ("",[],[("width","80%")]) [Str "Set",Space,Str "subtraction",Span ("",[],[("label","fig:setminus")]) []] ("setminus.png","fig:")]]+[Para [Image ("fig:setminus",[],[("width","80%")]) [Str "Set",Space,Str "subtraction",Span ("",[],[("label","fig:setminus")]) []] ("setminus.png","fig:")]] ```
test/command/3432.md view
@@ -195,7 +195,7 @@ </table> ``` -List-table with empty cells. You need a space after '-', otherwise the row will disapear. Parser for Bulletlists causes this ristriction. +List-table with empty cells. You need a space after '-', otherwise the row will disappear. Parser for Bulletlists causes this restriction.   ``` % pandoc -f rst
test/command/4016.md view
@@ -17,7 +17,7 @@ \protect\hypertarget{level-2-blocks}{}  \begin{columns}[T]-\begin{column}{0.40\textwidth}+\begin{column}{0.4\textwidth} \begin{block}{Block one}  \begin{itemize}@@ -29,7 +29,7 @@ \end{block} \end{column} -\begin{column}{0.60\textwidth}+\begin{column}{0.6\textwidth} \begin{block}{Block two}  \begin{itemize}
+ test/command/4545.md view
@@ -0,0 +1,20 @@+```+% pandoc -t asciidoc+Test 1++[my text]++Test 2+^D+Test 1++{empty}[my text]++Test 2+```+```+% pandoc -t asciidoc+4\. foo+^D+{empty}4. foo+```
+ test/command/4553.md view
@@ -0,0 +1,15 @@+```+pandoc -f latex -t native+foo \include{command/bar}+^D+[Para [Str "foo"]+,Para [Emph [Str "hi",Space,Str "there"]]]+```++```+pandoc -f latex -t native+foo \input{command/bar}+^D+[Para [Str "foo",Space,Emph [Str "hi",Space,Str "there"]]]+```+
+ test/command/4653.md view
@@ -0,0 +1,8 @@+```+% pandoc -t latex+\let\tex\TeX+\renewcommand{\TeX}{\tex\xspace}+^D+\let\tex\TeX+\renewcommand{\TeX}{\tex\xspace}+```
+ test/command/4667.md view
@@ -0,0 +1,20 @@+```+pandoc -t latex+---+header-includes:+- \newcommand{\blandscape}{\begin{landscape}}+- \newcommand{\elandscape}{\end{landscape}}+...++\blandscape++testing++\elandscape+^D+\begin{landscape}++testing++\end{landscape}+```
+ test/command/4669.md view
@@ -0,0 +1,29 @@+```+% pandoc -f latex -t native+{\tt <-}++\begin{verbatim}+  while (n > 0) {+\end{verbatim}+^D+[Para [Span ("",[],[]) [Str "<-"]]+,CodeBlock ("",[],[]) "  while (n > 0) {"]+```++```+% pandoc -f latex -t native+\begin{itemize}+\item<1> one+\item<2-3,5> two+\item<2| @alert> three+\item<handout> four+\item<beamer:2> five+\end{itemize}+^D+[BulletList+ [[Para [Str "one"]]+ ,[Para [Str "two"]]+ ,[Para [Str "three"]]+ ,[Para [Str "four"]]+ ,[Para [Str "five"]]]]+```
+ test/command/4677.md view
@@ -0,0 +1,8 @@+```+% 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"+![Caption](img.png){#img:1}+^D+<figure>+<img src="img.png" alt="Caption" id="img:1" /><figcaption>Caption</figcaption>+</figure>+```
+ test/command/4690.md view
@@ -0,0 +1,28 @@+```+% pandoc -t beamer+# title++:::: {.columns}+::: {.column width="8%"}+content+:::+::: {.column width="84%"}+content2+:::+::::+^D+\begin{frame}{title}+\protect\hypertarget{title}{}++\begin{columns}[T]+\begin{column}{0.08\textwidth}+content+\end{column}++\begin{column}{0.84\textwidth}+content2+\end{column}+\end{columns}++\end{frame}+```
+ test/command/4722.md view
@@ -0,0 +1,34 @@+```+% pandoc -f tikiwiki -t native+*Level 1+*Level 1+**Level 2+***Level 3+*Level 1+^D+[BulletList+ [[Plain [Str "Level",Space,Str "1"]]+ ,[Plain [Str "Level",Space,Str "1"]+  ,BulletList+   [[Plain [Str "Level",Space,Str "2"]+    ,BulletList+     [[Plain [Str "Level",Space,Str "3"]]]]]]+ ,[Plain [Str "Level",Space,Str "1"]]]]+```+```+% pandoc -f tikiwiki -t native+#Level 1+#Level 1+##Level 2+###Level 3+#Level 1+^D+[OrderedList (1,DefaultStyle,DefaultDelim)+ [[Plain [Str "Level",Space,Str "1"]]+ ,[Plain [Str "Level",Space,Str "1"]+  ,OrderedList (1,DefaultStyle,DefaultDelim)+   [[Plain [Str "Level",Space,Str "2"]+    ,OrderedList (1,DefaultStyle,DefaultDelim)+     [[Plain [Str "Level",Space,Str "3"]]]]]]+ ,[Plain [Str "Level",Space,Str "1"]]]]+```
+ test/command/4742.md view
@@ -0,0 +1,25 @@+Check that the commonmark reader handles the `ascii_identifiers`+extension properly.++```+% pandoc -f commonmark+gfm_auto_identifiers+ascii_identifiers -t native+# non ascii ⚠️ räksmörgås+^D+[Header 1 ("non-ascii--raksmorgas",[],[]) [Str "non",Space,Str "ascii",Space,Str "\9888\65039",Space,Str "r\228ksm\246rg\229s"]]+```++```+% pandoc -f commonmark+gfm_auto_identifiers-ascii_identifiers -t native+# non ascii ⚠️ räksmörgås+^D+[Header 1 ("non-ascii-\65039-r\228ksm\246rg\229s",[],[]) [Str "non",Space,Str "ascii",Space,Str "\9888\65039",Space,Str "r\228ksm\246rg\229s"]]+```++`gfm` should have `ascii_identifiers` enabled by default.++```+% pandoc -f gfm -t native+# non ascii ⚠️ räksmörgås+^D+[Header 1 ("non-ascii--raksmorgas",[],[]) [Str "non",Space,Str "ascii",Space,Str "\9888\65039",Space,Str "r\228ksm\246rg\229s"]]+```
+ test/command/4743.md view
@@ -0,0 +1,25 @@+Test that emojis are wrapped in Span++```+% pandoc -f commonmark+emoji -t native+My:thumbsup:emoji:heart:+^D+[Para [Str "My",Span ("",["emoji"],[("data-emoji","thumbsup")]) [Str "\128077"],Str "emoji",Span ("",["emoji"],[("data-emoji","heart")]) [Str "\10084\65039"]]]+```++```+% pandoc -f markdown+emoji -t native+My:thumbsup:emoji:heart:+^D+[Para [Str "My",Span ("",["emoji"],[("data-emoji","thumbsup")]) [Str "\128077"],Str "emoji",Span ("",["emoji"],[("data-emoji","heart")]) [Str "\10084\65039"]]]+```++```+% pandoc -f commonmark+emoji -t html+:zero: header+=============+My:thumbsup:emoji:heart:x :hearts: xyz+^D+<h1><span class="emoji" data-emoji="zero">0️⃣</span> header</h1>+<p>My<span class="emoji" data-emoji="thumbsup">👍</span>emoji<span class="emoji" data-emoji="heart">❤️</span>x <span class="emoji" data-emoji="hearts">♥️</span> xyz</p>+```
+ test/command/4748.md view
@@ -0,0 +1,16 @@+```+% pandoc -f org -t rst+Before example block.+#+begin_example+This is in an example block.+#+end_example+After example block.+^D+Before example block.++::++   This is in an example block.++After example block.+```
+ test/command/bar.tex view
@@ -0,0 +1,1 @@+\emph{hi there}
+ test/command/emoji.md view
@@ -0,0 +1,27 @@+```+% pandoc -t markdown+emoji -f markdown+emoji+:smile:+^D+:smile:+```++```+% pandoc -t markdown-emoji -f markdown+emoji+:smile:+^D+😄+```++```+% pandoc -t gfm -f markdown+emoji+:smile:+^D+:smile:+```++```+% pandoc -t gfm-emoji -f markdown+emoji+:smile:+^D+😄+```
test/command/gfm.md view
@@ -38,7 +38,7 @@ % pandoc -f gfm -t native My:thumbsup:emoji:heart: ^D-[Para [Str "My\128077emoji\10084\65039"]]+[Para [Str "My",Span ("",["emoji"],[("data-emoji","thumbsup")]) [Str "\128077"],Str "emoji",Span ("",["emoji"],[("data-emoji","heart")]) [Str "\10084\65039"]]] ```  ```
test/command/refs.md view
@@ -42,7 +42,7 @@  Figure \ref{fig:Logo} illustrated the SVG logo ^D-[Para [Image ("",[],[]) [Str "Logo",Span ("",[],[("label","fig:Logo")]) []] ("command/SVG_logo.svg","fig:")]+[Para [Image ("fig:Logo",[],[]) [Str "Logo",Span ("",[],[("label","fig:Logo")]) []] ("command/SVG_logo.svg","fig:")] ,Para [Str "Figure",Space,Link ("",[],[("reference-type","ref"),("reference","fig:Logo")]) [Str "[fig:Logo]"] ("#fig:Logo",""),Space,Str "illustrated",Space,Str "the",Space,Str "SVG",Space,Str "logo"]] ``` 
test/fb2/meta.fb2 view
@@ -1,3 +1,3 @@ <?xml version="1.0" encoding="UTF-8"?>-<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>It consists of two paragraphs.</annotation></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p>Book title</p></title></body></FictionBook>+<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> 
test/lhs-test.html view
@@ -14,7 +14,7 @@   <style type="text/css"> a.sourceLine { display: inline-block; line-height: 1.25; } a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }-a.sourceLine:empty { height: 1.2em; position: absolute; }+a.sourceLine:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode { white-space: pre; position: relative; } div.sourceCode { margin: 1em 0; }@@ -27,13 +27,11 @@ a.sourceLine { text-indent: -1em; padding-left: 1em; } } pre.numberSource a.sourceLine-  { position: relative; }-pre.numberSource a.sourceLine:empty-  { position: absolute; }+  { position: relative; left: -4em; } pre.numberSource a.sourceLine::before   { content: attr(data-line-number);-    position: absolute; left: -5em; text-align: right; vertical-align: baseline;-    border: none; pointer-events: all;+    position: relative; left: -1em; text-align: right; vertical-align: baseline;+    border: none; pointer-events: all; display: inline-block;     -webkit-touch-callout: none; -webkit-user-select: none;     -khtml-user-select: none; -moz-user-select: none;     -ms-user-select: none; user-select: none;
test/lhs-test.html+lhs view
@@ -14,7 +14,7 @@   <style type="text/css"> a.sourceLine { display: inline-block; line-height: 1.25; } a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }-a.sourceLine:empty { height: 1.2em; position: absolute; }+a.sourceLine:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode { white-space: pre; position: relative; } div.sourceCode { margin: 1em 0; }@@ -27,13 +27,11 @@ a.sourceLine { text-indent: -1em; padding-left: 1em; } } pre.numberSource a.sourceLine-  { position: relative; }-pre.numberSource a.sourceLine:empty-  { position: absolute; }+  { position: relative; left: -4em; } pre.numberSource a.sourceLine::before   { content: attr(data-line-number);-    position: absolute; left: -5em; text-align: right; vertical-align: baseline;-    border: none; pointer-events: all;+    position: relative; left: -1em; text-align: right; vertical-align: baseline;+    border: none; pointer-events: all; display: inline-block;     -webkit-touch-callout: none; -webkit-user-select: none;     -khtml-user-select: none; -moz-user-select: none;     -ms-user-select: none; user-select: none;
test/pptx/lists.native view
@@ -1,7 +1,7 @@ [Header 1 ("lists",[],[]) [Str "Lists"] ,BulletList  [[Para [Str "Bulleted",Space,Str "bulleted",Space,Str "lists."]]- ,[Para [Str "And",Space,Str "go",Space,Str "to",Space,Str "aribtrary",Space,Str "depth."]+ ,[Para [Str "And",Space,Str "go",Space,Str "to",Space,Str "arbitrary",Space,Str "depth."]   ,BulletList    [[Para [Str "Like",Space,Str "this"]     ,BulletList
test/pptx/lists.pptx view

binary file changed (26765 → 26765 bytes)

test/pptx/lists_templated.pptx view

binary file changed (394091 → 394091 bytes)

test/textile-reader.native view
@@ -2,7 +2,7 @@ [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc",Space,Str "Textile",Space,Str "Reader.",Space,Str "Part",Space,Str "of",Space,Str "it",Space,Str "comes",LineBreak,Str "from",Space,Str "John",Space,Str "Gruber\8217s",Space,Str "markdown",Space,Str "test",Space,Str "suite."] ,HorizontalRule ,Header 1 ("headers",[],[]) [Str "Headers"]-,Header 2 ("level-2-with-an-embeded-link",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link ("",[],[]) [Str "embeded",Space,Str "link"] ("http://www.example.com","")]+,Header 2 ("level-2-with-an-embedded-link",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link ("",[],[]) [Str "embedded",Space,Str "link"] ("http://www.example.com","")] ,Header 3 ("level-3-with-emphasis",[],[]) [Str "Level",Space,Str "3",Space,Str "with",Space,Strong [Str "emphasis"]] ,Header 4 ("level-4",[],[]) [Str "Level",Space,Str "4"] ,Header 5 ("level-5",[],[]) [Str "Level",Space,Str "5"]
test/textile-reader.textile view
@@ -5,7 +5,7 @@  h1. Headers -h2. Level 2 with an "embeded link":http://www.example.com+h2. Level 2 with an "embedded link":http://www.example.com  h3. Level 3 with *emphasis* 
test/tikiwiki-reader.native view
@@ -43,52 +43,52 @@ ,Para [Str "info@example.org"] ,Header 1 ("lists",[],[]) [Str "lists"] ,BulletList- [[Plain [Str "Start",Space,Str "each",Space,Str "line",Space]]- ,[Plain [Str "with",Space,Str "an",Space,Str "asterisk",Space,Str "(*).",Space]+ [[Plain [Str "Start",Space,Str "each",Space,Str "line"]]+ ,[Plain [Str "with",Space,Str "an",Space,Str "asterisk",Space,Str "(*)."]   ,BulletList-   [[Plain [Str "More",Space,Str "asterisks",Space,Str "gives",Space,Str "deeper",Space]+   [[Plain [Str "More",Space,Str "asterisks",Space,Str "gives",Space,Str "deeper"]     ,BulletList-     [[Plain [Str "and",Space,Str "deeper",Space,Str "levels.",Space]]]]]]- ,[Plain [Str "Line",Space,Str "breaks",LineBreak,Str "don't",Space,Str "break",Space,Str "levels.",Space]]- ,[Plain [Str "Continuations",Space,Str "are",Space,Str "also",Space,Str "possible",Space]+     [[Plain [Str "and",Space,Str "deeper",Space,Str "levels."]]]]]]+ ,[Plain [Str "Line",Space,Str "breaks",LineBreak,Str "don't",Space,Str "break",Space,Str "levels."]]+ ,[Plain [Str "Continuations",Space,Str "are",Space,Str "also",Space,Str "possible"]   ,BulletList-   [[Plain [Str "and",Space,Str "do",Space,Str "not",Space,Str "break",Space,Str "the",Space,Str "list",Space,Str "flow",Space]]]]- ,[Plain [Str "Level",Space,Str "one",Space]]]+   [[Plain [Str "and",Space,Str "do",Space,Str "not",Space,Str "break",Space,Str "the",Space,Str "list",Space,Str "flow"]]]]+ ,[Plain [Str "Level",Space,Str "one"]]] ,Para [Str "Any",Space,Str "other",Space,Str "start",Space,Str "ends",Space,Str "the",Space,Str "list."] ,OrderedList (1,DefaultStyle,DefaultDelim)- [[Plain [Str "Start",Space,Str "each",Space,Str "line",Space]]- ,[Plain [Str "with",Space,Str "a",Space,Str "number",Space,Str "(1.).",Space]+ [[Plain [Str "Start",Space,Str "each",Space,Str "line"]]+ ,[Plain [Str "with",Space,Str "a",Space,Str "number",Space,Str "(1.)."]   ,OrderedList (1,DefaultStyle,DefaultDelim)-   [[Plain [Str "More",Space,Str "number",Space,Str "signs",Space,Str "gives",Space,Str "deeper",Space]+   [[Plain [Str "More",Space,Str "number",Space,Str "signs",Space,Str "gives",Space,Str "deeper"]     ,OrderedList (1,DefaultStyle,DefaultDelim)-     [[Plain [Str "and",Space,Str "deeper",Space]]-     ,[Plain [Str "levels.",Space]]]]]]- ,[Plain [Str "Line",Space,Str "breaks",LineBreak,Str "don't",Space,Str "break",Space,Str "levels.",Space]]- ,[Plain [Str "Blank",Space,Str "lines",Space]]]+     [[Plain [Str "and",Space,Str "deeper"]]+     ,[Plain [Str "levels."]]]]]]+ ,[Plain [Str "Line",Space,Str "breaks",LineBreak,Str "don't",Space,Str "break",Space,Str "levels."]]+ ,[Plain [Str "Blank",Space,Str "lines"]]] ,OrderedList (1,DefaultStyle,DefaultDelim)- [[Plain [Str "end",Space,Str "the",Space,Str "list",Space,Str "and",Space,Str "start",Space,Str "another.",Space]]]+ [[Plain [Str "end",Space,Str "the",Space,Str "list",Space,Str "and",Space,Str "start",Space,Str "another."]]] ,Para [Str "Any",Space,Str "other",Space,Str "start",Space,Str "also",Space,Str "ends",Space,Str "the",Space,Str "list."] ,DefinitionList  [([Str "item",Space,Str "1"],-   [[Plain [Str "definition",Space,Str "1",Space]]])+   [[Plain [Str "definition",Space,Str "1"]]])  ,([Str "item",Space,Str "2"],-   [[Plain [Str "definition",Space,Str "2-1",Space,Str "definition",Space,Str "2-2",Space]]])+   [[Plain [Str "definition",Space,Str "2-1",Space,Str "definition",Space,Str "2-2"]]])  ,([Str "item",Space,Emph [Str "3"]],-   [[Plain [Str "definition",Space,Emph [Str "3"],Space]]])]+   [[Plain [Str "definition",Space,Emph [Str "3"]]]])] ,OrderedList (1,DefaultStyle,DefaultDelim)- [[Plain [Str "one",Space]]- ,[Plain [Str "two",Space]+ [[Plain [Str "one"]]+ ,[Plain [Str "two"]   ,BulletList-   [[Plain [Str "two",Space,Str "point",Space,Str "one",Space]]-   ,[Plain [Str "two",Space,Str "point",Space,Str "two",Space]]]]- ,[Plain [Str "three",Space]]- ,[Plain [Str "four",Space]]- ,[Plain [Str "five",Space]+   [[Plain [Str "two",Space,Str "point",Space,Str "one"]]+   ,[Plain [Str "two",Space,Str "point",Space,Str "two"]]]]+ ,[Plain [Str "three"]]+ ,[Plain [Str "four"]]+ ,[Plain [Str "five"]   ,OrderedList (1,DefaultStyle,DefaultDelim)-   [[Plain [Str "five",Space,Str "sub",Space,Str "1",Space]+   [[Plain [Str "five",Space,Str "sub",Space,Str "1"]     ,OrderedList (1,DefaultStyle,DefaultDelim)-     [[Plain [Str "five",Space,Str "sub",Space,Str "1",Space,Str "sub",Space,Str "1",Space]]]]-   ,[Plain [Str "five",Space,Str "sub",Space,Str "2",Space]]]]]+     [[Plain [Str "five",Space,Str "sub",Space,Str "1",Space,Str "sub",Space,Str "1"]]]]+   ,[Plain [Str "five",Space,Str "sub",Space,Str "2"]]]]] ,Header 1 ("tables",[],[]) [Str "tables"] ,Table [] [AlignDefault,AlignDefault] [0.0,0.0]  [[Plain [Str ""]]
test/txt2tags.t2t view
@@ -136,7 +136,7 @@ %%% Syntax: Repetition is greedy %% When the mark character is repeated many times, %% the contents are expanded to the largest possible.-%% Thats why they are greedy, the outer marks are+%% That's why they are greedy, the outer marks are %% the ones used.  i)  *****         /////         _____         -----         `````        """""        '''''
test/writer.fb2 view
@@ -3,7 +3,6 @@ <description> <title-info> <genre>unrecognised</genre>-<book-title>Pandoc Test Suite</book-title> <author> <first-name>John</first-name> <last-name>MacFarlane</last-name>@@ -11,6 +10,7 @@ <author> <nickname>Anonymous</nickname> </author>+<book-title>Pandoc Test Suite</book-title> <date>July 17, 2006</date> </title-info> <document-info>
test/writer.opendocument view
@@ -803,23 +803,31 @@ <text:p text:style-name="Text_20_body">This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Headers</text:h>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Level 2 with an+<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>+<text:h text:style-name="Heading_20_2" text:outline-level="2"><text:bookmark-start text:name="level-2-with-an-embedded-link" />Level+2 with an <text:a xlink:type="simple" xlink:href="/url" office:name=""><text:span text:style-name="Definition">embedded-link</text:span></text:a></text:h>-<text:h text:style-name="Heading_20_3" text:outline-level="3">Level 3 with-<text:span text:style-name="T1">emphasis</text:span></text:h>-<text:h text:style-name="Heading_20_4" text:outline-level="4">Level 4</text:h>-<text:h text:style-name="Heading_20_5" text:outline-level="5">Level 5</text:h>-<text:h text:style-name="Heading_20_1" text:outline-level="1">Level 1</text:h>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Level 2 with-<text:span text:style-name="T1">emphasis</text:span></text:h>-<text:h text:style-name="Heading_20_3" text:outline-level="3">Level 3</text:h>+link</text:span></text:a><text:bookmark-end text:name="level-2-with-an-embedded-link" /></text:h>+<text:h text:style-name="Heading_20_3" text:outline-level="3"><text:bookmark-start text:name="level-3-with-emphasis" />Level+3 with+<text:span text:style-name="T1">emphasis</text:span><text:bookmark-end text:name="level-3-with-emphasis" /></text:h>+<text:h text:style-name="Heading_20_4" text:outline-level="4"><text:bookmark-start text:name="level-4" />Level+4<text:bookmark-end text:name="level-4" /></text:h>+<text:h text:style-name="Heading_20_5" text:outline-level="5"><text:bookmark-start text:name="level-5" />Level+5<text:bookmark-end text:name="level-5" /></text:h>+<text:h text:style-name="Heading_20_1" text:outline-level="1"><text:bookmark-start text:name="level-1" />Level+1<text:bookmark-end text:name="level-1" /></text:h>+<text:h text:style-name="Heading_20_2" text:outline-level="2"><text:bookmark-start text:name="level-2-with-emphasis" />Level+2 with+<text:span text:style-name="T1">emphasis</text:span><text:bookmark-end text:name="level-2-with-emphasis" /></text:h>+<text:h text:style-name="Heading_20_3" text:outline-level="3"><text:bookmark-start text:name="level-3" />Level+3<text:bookmark-end text:name="level-3" /></text:h> <text:p text:style-name="First_20_paragraph">with no blank line</text:p>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Level 2</text:h>+<text:h text:style-name="Heading_20_2" text:outline-level="2"><text:bookmark-start text:name="level-2" />Level+2<text:bookmark-end text:name="level-2" /></text:h> <text:p text:style-name="First_20_paragraph">with no blank line</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Paragraphs</text:h>+<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> <text:p text:style-name="First_20_paragraph">Here’s a regular paragraph.</text:p> <text:p text:style-name="Text_20_body">In Markdown 1.0.0 and earlier. Version@@ -830,8 +838,8 @@ <text:p text:style-name="Text_20_body">There should be a hard line break<text:line-break />here.</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Block-Quotes</text:h>+<text:h text:style-name="Heading_20_1" text:outline-level="1"><text:bookmark-start text:name="block-quotes" />Block+Quotes<text:bookmark-end text:name="block-quotes" /></text:h> <text:p text:style-name="First_20_paragraph">E-mail style:</text:p> <text:p text:style-name="P1">This is a block quote. It is pretty short.</text:p>@@ -855,8 +863,8 @@ 2 &gt; 1.</text:p> <text:p text:style-name="Text_20_body">And a following paragraph.</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Code-Blocks</text:h>+<text:h text:style-name="Heading_20_1" text:outline-level="1"><text:bookmark-start text:name="code-blocks" />Code+Blocks<text:bookmark-end text:name="code-blocks" /></text:h> <text:p text:style-name="First_20_paragraph">Code:</text:p> <text:p text:style-name="P9">---- (should be four hyphens)</text:p> <text:p text:style-name="P10"></text:p>@@ -870,8 +878,8 @@ <text:p text:style-name="P17"></text:p> <text:p text:style-name="P18">These should not be escaped: <text:s text:c="1" />\$ \\ \&gt; \[ \{</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Lists</text:h>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Unordered</text:h>+<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>+<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> <text:p text:style-name="First_20_paragraph">Asterisks tight:</text:p> <text:list text:style-name="L2">   <text:list-item>@@ -944,7 +952,7 @@     <text:p text:style-name="P24">Minus 3</text:p>   </text:list-item> </text:list>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Ordered</text:h>+<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> <text:p text:style-name="First_20_paragraph">Tight:</text:p> <text:list text:style-name="L8">   <text:list-item>@@ -1007,7 +1015,7 @@     <text:p text:style-name="P29">Item 3.</text:p>   </text:list-item> </text:list>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Nested</text:h>+<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> <text:list text:style-name="L13">   <text:list-item>     <text:p text:style-name="P30">Tab</text:p><text:list text:style-name="L14">@@ -1068,8 +1076,8 @@     <text:p text:style-name="P35">Third</text:p>   </text:list-item> </text:list>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Tabs and-spaces</text:h>+<text:h text:style-name="Heading_20_2" text:outline-level="2"><text:bookmark-start text:name="tabs-and-spaces" />Tabs+and spaces<text:bookmark-end text:name="tabs-and-spaces" /></text:h> <text:list text:style-name="L20">   <text:list-item>     <text:p text:style-name="P37">this is a list item indented with@@ -1089,8 +1097,8 @@     </text:list>   </text:list-item> </text:list>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Fancy list-markers</text:h>+<text:h text:style-name="Heading_20_2" text:outline-level="2"><text:bookmark-start text:name="fancy-list-markers" />Fancy+list markers<text:bookmark-end text:name="fancy-list-markers" /></text:h> <text:list text:style-name="L22">   <text:list-item>     <text:p text:style-name="P39">begins with 2</text:p>@@ -1157,8 +1165,8 @@ <text:p text:style-name="Text_20_body">M.A. 2007</text:p> <text:p text:style-name="Text_20_body">B. Williams</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Definition-Lists</text:h>+<text:h text:style-name="Heading_20_1" text:outline-level="1"><text:bookmark-start text:name="definition-lists" />Definition+Lists<text:bookmark-end text:name="definition-lists" /></text:h> <text:p text:style-name="First_20_paragraph">Tight using spaces:</text:p> <text:p text:style-name="Definition_20_Term_20_Tight">apple</text:p> <text:p text:style-name="Definition_20_Definition_20_Tight">red fruit</text:p>@@ -1225,8 +1233,8 @@     <text:p text:style-name="P44">sublist</text:p>   </text:list-item> </text:list>-<text:h text:style-name="Heading_20_1" text:outline-level="1">HTML-Blocks</text:h>+<text:h text:style-name="Heading_20_1" text:outline-level="1"><text:bookmark-start text:name="html-blocks" />HTML+Blocks<text:bookmark-end text:name="html-blocks" /></text:h> <text:p text:style-name="First_20_paragraph">Simple block on one line:</text:p> <text:p text:style-name="Text_20_body">foo</text:p>@@ -1262,8 +1270,8 @@ <text:p text:style-name="P50">&lt;hr /&gt;</text:p> <text:p text:style-name="First_20_paragraph">Hr’s:</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Inline-Markup</text:h>+<text:h text:style-name="Heading_20_1" text:outline-level="1"><text:bookmark-start text:name="inline-markup" />Inline+Markup<text:bookmark-end text:name="inline-markup" /></text:h> <text:p text:style-name="First_20_paragraph">This is <text:span text:style-name="T1">emphasized</text:span>, and so <text:span text:style-name="T1">is this</text:span>.</text:p>@@ -1300,8 +1308,9 @@ <text:p text:style-name="Text_20_body">These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Smart quotes,-ellipses, dashes</text:h>+<text:h text:style-name="Heading_20_1" text:outline-level="1"><text:bookmark-start text:name="smart-quotes-ellipses-dashes" />Smart+quotes, ellipses,+dashes<text:bookmark-end text:name="smart-quotes-ellipses-dashes" /></text:h> <text:p text:style-name="First_20_paragraph">“Hello,” said the spider. “‘Shelob’ is my name.”</text:p> <text:p text:style-name="Text_20_body">‘A’, ‘B’, and ‘C’ are letters.</text:p>@@ -1319,7 +1328,7 @@ 1987–1999.</text:p> <text:p text:style-name="Text_20_body">Ellipses…and…and….</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">LaTeX</text:h>+<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> <text:list text:style-name="L26">   <text:list-item>     <text:p text:style-name="P51"></text:p>@@ -1371,8 +1380,8 @@ </text:list> <text:p text:style-name="First_20_paragraph">Here’s a LaTeX table:</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Special-Characters</text:h>+<text:h text:style-name="Heading_20_1" text:outline-level="1"><text:bookmark-start text:name="special-characters" />Special+Characters<text:bookmark-end text:name="special-characters" /></text:h> <text:p text:style-name="First_20_paragraph">Here is some unicode:</text:p> <text:list text:style-name="L28">   <text:list-item>@@ -1415,8 +1424,8 @@ <text:p text:style-name="Text_20_body">Plus: +</text:p> <text:p text:style-name="Text_20_body">Minus: -</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Links</text:h>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Explicit</text:h>+<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>+<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> <text:p text:style-name="First_20_paragraph">Just a <text:a xlink:type="simple" xlink:href="/url/" office:name=""><text:span text:style-name="Definition">URL</text:span></text:a>.</text:p> <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@@ -1433,7 +1442,7 @@ <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 link</text:span></text:a></text:p> <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>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Reference</text:h>+<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> <text:p text:style-name="First_20_paragraph">Foo <text:a xlink:type="simple" xlink:href="/url/" office:name=""><text:span text:style-name="Definition">bar</text:span></text:a>.</text:p> <text:p text:style-name="Text_20_body">With@@ -1453,8 +1462,8 @@ <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> <text:p text:style-name="Text_20_body">Foo <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>-<text:h text:style-name="Heading_20_2" text:outline-level="2">With-ampersands</text:h>+<text:h text:style-name="Heading_20_2" text:outline-level="2"><text:bookmark-start text:name="with-ampersands" />With+ampersands<text:bookmark-end text:name="with-ampersands" /></text:h> <text:p text:style-name="First_20_paragraph">Here’s a <text:a xlink:type="simple" xlink:href="http://example.com/?foo=1&amp;bar=2" office:name=""><text:span text:style-name="Definition">link with an ampersand in the URL</text:span></text:a>.</text:p>@@ -1467,7 +1476,7 @@ <text:p text:style-name="Text_20_body">Here’s an <text:a xlink:type="simple" xlink:href="/script?foo=1&amp;bar=2" office:name=""><text:span text:style-name="Definition">inline link in pointy braces</text:span></text:a>.</text:p>-<text:h text:style-name="Heading_20_2" text:outline-level="2">Autolinks</text:h>+<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> <text:p text:style-name="First_20_paragraph">With an ampersand: <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> <text:list text:style-name="L29">@@ -1489,7 +1498,7 @@ <text:span text:style-name="Source_Text">&lt;http://example.com/&gt;</text:span></text:p> <text:p text:style-name="P57">or here: &lt;http://example.com/&gt;</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Images</text:h>+<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> <text:p text:style-name="First_20_paragraph">From “Voyage dans la Lune” by Georges Melies (1902):</text:p> <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>@@ -1498,7 +1507,7 @@ <draw:frame draw:name="img2"><draw:image xlink:href="movie.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame> icon.</text:p> <text:p text:style-name="Horizontal_20_Line" />-<text:h text:style-name="Heading_20_1" text:outline-level="1">Footnotes</text:h>+<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> <text:p text:style-name="First_20_paragraph">Here is a footnote reference,<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 is the footnote. It can go anywhere after the footnote reference. It need not
test/writer.texinfo view
@@ -5,25 +5,7 @@ ~~\text\~~ @end macro -@macro textsubscript{text}-@iftex-@textsubscript{\text\}-@end iftex @ifnottex-_@{\text\@}-@end ifnottex-@end macro--@macro textsuperscript{text}-@iftex-@textsuperscript{\text\}-@end iftex-@ifnottex-^@{\text\@}-@end ifnottex-@end macro--@ifnottex @paragraphindent 0 @end ifnottex @titlepage@@ -738,11 +720,9 @@  @textstrikeout{This is @emph{strikeout}.} -Superscripts: a@textsuperscript{bc}d a@textsuperscript{@emph{hello}}-a@textsuperscript{hello@ there}.+Superscripts: a@sup{bc}d a@sup{@emph{hello}} a@sup{hello@ there}. -Subscripts: H@textsubscript{2}O, H@textsubscript{23}O,-H@textsubscript{many@ of@ them}O.+Subscripts: H@sub{2}O, H@sub{23}O, H@sub{many@ of@ them}O.  These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.
trypandoc/trypandoc.hs view
@@ -25,7 +25,7 @@ app :: Application app req respond = do   let query = queryToQueryText $ queryString req-  let getParam x = maybe (error $ T.unpack x ++ " paramater not set")+  let getParam x = maybe (error $ T.unpack x ++ " parameter not set")                        return $ lookup x query   text <- getParam "text" >>= checkLength . fromMaybe T.empty   fromFormat <- fromMaybe "" <$> getParam "from"