From 31a5bccd57750f962d35235060b1f000afe957d4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 17 Jul 2021 23:06:49 -0700 Subject: LaTeX reader: avoid trailing hyphen in translating languages. Previously `\foreignlanguage{english}` turned into ``. The same issue affected Arabic. Closes #7447. --- src/Text/Pandoc/Readers/LaTeX/Lang.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX/Lang.hs b/src/Text/Pandoc/Readers/LaTeX/Lang.hs index 6a8327904..3151fc688 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Lang.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Lang.hs @@ -105,7 +105,7 @@ polyglossiaLangToBCP47 = M.fromList "locale=morocco" -> Lang "ar" Nothing (Just "MA") [] [] [] "locale=mauritania" -> Lang "ar" Nothing (Just "MR") [] [] [] "locale=tunisia" -> Lang "ar" Nothing (Just "TN") [] [] [] - _ -> Lang "ar" Nothing (Just "") [] [] []) + _ -> Lang "ar" Nothing Nothing [] [] []) , ("german", \o -> case T.filter (/=' ') o of "spelling=old" -> Lang "de" Nothing (Just "DE") ["1901"] [] [] "variant=austrian,spelling=old" @@ -126,7 +126,7 @@ polyglossiaLangToBCP47 = M.fromList "variant=british" -> Lang "en" Nothing (Just "GB") [] [] [] "variant=newzealand" -> Lang "en" Nothing (Just "NZ") [] [] [] "variant=american" -> Lang "en" Nothing (Just "US") [] [] [] - _ -> Lang "en" Nothing (Just "") [] [] []) + _ -> Lang "en" Nothing Nothing [] [] []) , ("usorbian", \_ -> Lang "hsb" Nothing Nothing [] [] []) , ("latin", \o -> case T.filter (/=' ') o of "variant=classic" -> Lang "la" Nothing Nothing ["x-classic"] [] [] -- cgit v1.2.3 From cfa52e582470f852ce0ab5a03463b0a43d15ff79 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 17 Jul 2021 23:29:15 -0700 Subject: Use skylighting 0.11. --- pandoc.cabal | 4 ++-- stack.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index e3cd7e54f..0abfddde8 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -485,8 +485,8 @@ library random >= 1 && < 1.3, safe >= 0.3.18 && < 0.4, scientific >= 0.3 && < 0.4, - skylighting >= 0.10.5.2 && < 0.10.6, - skylighting-core >= 0.10.5.2 && < 0.10.6, + skylighting >= 0.11 && < 0.12, + skylighting-core >= 0.11 && < 0.12, split >= 0.2 && < 0.3, syb >= 0.1 && < 0.8, tagsoup >= 0.14.6 && < 0.15, diff --git a/stack.yaml b/stack.yaml index 48a608db3..b948f9990 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,8 +9,8 @@ packages: extra-deps: - commonmark-0.2.1 - commonmark-pandoc-0.2.1.1 -- skylighting-core-0.10.5.2 -- skylighting-0.10.5.2 +- skylighting-core-0.11 +- skylighting-0.11 - git: https://github.com/jgm/doctemplates commit: 428c26d5303cf7a2b1051fe1ffd9aafe9ba71c81 - git: https://github.com/jgm/citeproc -- cgit v1.2.3 From 168b559c96f409234efe811cf556c931feb7b847 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 18 Jul 2021 10:55:27 -0700 Subject: Use doctemplates 0.4.1 and citeproc 0.10. --- cabal.project | 13 ++++--------- pandoc.cabal | 4 ++-- stack.yaml | 6 ++---- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/cabal.project b/cabal.project index e18577471..00e3adcc2 100644 --- a/cabal.project +++ b/cabal.project @@ -2,12 +2,7 @@ packages: pandoc.cabal tests: True flags: +embed_data_files -source-repository-package - type: git - location: https://github.com/jgm/doctemplates - tag: 428c26d5303cf7a2b1051fe1ffd9aafe9ba71c81 - -source-repository-package - type: git - location: https://github.com/jgm/citeproc - tag: 4ce0501cd6f9c86eee087afcf878c256e49b9615 +#source-repository-package +# type: git +# location: https://github.com/jgm/citeproc +# tag: 4ce0501cd6f9c86eee087afcf878c256e49b9615 diff --git a/pandoc.cabal b/pandoc.cabal index 0abfddde8..999f00f11 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -451,7 +451,7 @@ library blaze-markup >= 0.8 && < 0.9, bytestring >= 0.9 && < 0.12, case-insensitive >= 1.2 && < 1.3, - citeproc >= 0.4.0.1 && < 0.4.1, + citeproc >= 0.4.1 && < 0.4.2, commonmark >= 0.2.1 && < 0.3, commonmark-extensions >= 0.2.1.2 && < 0.3, commonmark-pandoc >= 0.2.1.1 && < 0.3, @@ -461,7 +461,7 @@ library deepseq >= 1.3 && < 1.5, directory >= 1.2.3 && < 1.4, doclayout >= 0.3.0.1 && < 0.4, - doctemplates >= 0.9 && < 0.10, + doctemplates >= 0.10 && < 0.11, emojis >= 0.1 && < 0.2, exceptions >= 0.8 && < 0.11, file-embed >= 0.0 && < 0.1, diff --git a/stack.yaml b/stack.yaml index b948f9990..8e52a819f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -11,10 +11,8 @@ extra-deps: - commonmark-pandoc-0.2.1.1 - skylighting-core-0.11 - skylighting-0.11 -- git: https://github.com/jgm/doctemplates - commit: 428c26d5303cf7a2b1051fe1ffd9aafe9ba71c81 -- git: https://github.com/jgm/citeproc - commit: 4ce0501cd6f9c86eee087afcf878c256e49b9615 +- doctemplates-0.10 +- citeproc-0.4.1 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.0 -- cgit v1.2.3 From 92efc605716521035f61ebc87c9f6131c5cf8155 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 18 Jul 2021 11:10:45 -0700 Subject: Fix comment syntax in cabal.project --- cabal.project | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cabal.project b/cabal.project index 00e3adcc2..505636326 100644 --- a/cabal.project +++ b/cabal.project @@ -2,7 +2,7 @@ packages: pandoc.cabal tests: True flags: +embed_data_files -#source-repository-package -# type: git -# location: https://github.com/jgm/citeproc -# tag: 4ce0501cd6f9c86eee087afcf878c256e49b9615 +-- source-repository-package +-- type: git +-- location: https://github.com/jgm/citeproc +-- tag: 4ce0501cd6f9c86eee087afcf878c256e49b9615 -- cgit v1.2.3 From c909d16cccbae92add6b1e2430ce9e6d51e0c7e5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 18 Jul 2021 11:39:04 -0700 Subject: Bump to 2.14.1, update changelog and man page. --- MANUAL.txt | 2 +- changelog.md | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ man/pandoc.1 | 13 +++++- pandoc.cabal | 4 +- 4 files changed, 150 insertions(+), 5 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index c9dc9e62b..c2d3dba14 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1,7 +1,7 @@ --- title: Pandoc User's Guide author: John MacFarlane -date: June 20, 2021 +date: July 18, 2021 --- # Synopsis diff --git a/changelog.md b/changelog.md index 2f188a3b8..2dfaa9618 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,141 @@ # Revision history for pandoc +## pandoc 2.14.1 (2021-07-18) + + * Text.Pandoc.ImageSize: Add Tiff constructor for ImageType (#7405) + [Minor API change]. This allows pandoc to get size information from + tiff images. + + * Markdown reader: don't try to read contents in self-closing HTML tag. + Previously we had problems parsing raw HTML with self-closing + tags like ``. The problem was that pandoc would look + for a closing tag to close the markdown contents, but the + closing tag had, in effect, already been parsed by `htmlTag`. + + * LaTeX reader: + + + Avoid trailing hyphen in translating languages (#7447). + Previously `\foreignlanguage{english}` turned into ``. + The same issue affected Arabic. + + Support `\cline` in LaTeX tables (#7442). + + Improved parsing of raw LaTeX from Text streams (`rawLaTeXParser`, + used to read LaTeX in Markdown files, #7434). We now use source + positions from the token stream to tell us how much of the text stream + to consume. Getting this to work required a few other changes to + make token source positions accurate. + + * DocBook reader: + + + Handle images with imageobjectco elements (#7440). + + Add support for citerefentry (#7437, Jan Tojnar). + + * RST reader: fix regression with code includes (#7436). + With the recent changes to include infrastructure, + included code blocks were getting an extra newline. + + * HTML reader: + + + Recognize data-external when reading HTML img tags (#7429, + Michael Hoffmann). Preserve all attributes in img tags. If attributes + have a `data-` prefix, it will be stripped. In particular, this + preserves a `data-external` attribute as an `external` attribute in + the pandoc AST. + + Add col, colgroup to 'closes' definitions + + * HTML writer: + + + Remove duplicated alt text in HTML output (Aner Lucero). + + Remove `aria-hidden` when explicit alt text is provided (Aner Lucero). + + Set boolean values for reveal.js variables. + + * Docx writer: + + + Add table numbering for captioned tables. + The numbers are added using fields, so that Word can + create a list of tables that will update automatically. + + Support figure numbers. These are set up in such a way that they + will work with Word's automatic table of figures (#7392). + + * Markdown writer: put space between Plain and following fenced Div + (#4465). + + * EPUB writer: Don't incorporate externally linked images in EPUB documents + (#7430, Michael Hoffmann). Just as it is possible to avoid incorporating + an image in EPUB by passing `data-external="1"` to a raw HTML snippet, + this makes the same possible for native Images, by looking for an + associated `external` attribute. + + * Text.Pandoc.PDF: + + + Fix `svgIn` path error (#7431). We were duplicating + the temp directory; this didn't cause problems on macOS or linux + because there we use absolute paths for the temp directory. + But on Windows it caused errors converting SVG files. + + `convertImage`: normalize paths (#7431). This will avoid paths + on Windows with mixed path separators. + + * Text.Pandoc.Class: Always use / when adding directory to image destination + with `extractMedia`, even on Windows. + + * Text.Pandoc.Citeproc: + + + Allow `$` characters in bibtex keys (#7409). + + Set proper initial source name in parsing BibTeX (for better error + messages.) + + Revamp note citation handling (#7394). Use latest + citeproc, which uses a Span with a class rather than a Note for notes. + This helps us distinguish between user notes and citation notes. Don't + put citations at the beginning of a note in parentheses. Fix small bug + in handling of citations in notes, which led to commas at the end of + sentences in some cases. + + Cleanup and efficiency improvement in `deNote`. + + Improve punctuation moving with `--citeproc`. Previously, using + `--citeproc` could cause punctuation to move in quotes even when + there aer no citations. This has been changed; punctuation moving + is now limited to citations. In addition, we only move footnotes + around punctuation if the style is a note style, even if + `notes-after-punctuation` is `true`. + + * Use citeproc 0.10. This helps improve note citations (see above) + and eliminates double hyperlinks in author-in-text citations. + Author-only citations are no longer hyperlinked. See jgm/citeproc#77. + It also fixes moving of punctuation inside quotes to conform to + the CSL spec: only comma and period are moved, not question + mark or exclamation point. + + * Text.Pandoc.Error: fix line calculations in reporting parsec errors. + Also remove a spurious initial newline in the error report. + + * Use doctemplates 0.4.1, which gives us better support for boolean + variable values. Previously `$if(foo)$` would evaluate to true + for variables with boolean `false` values, because it cared only + about the string rendering (#7402). + + * Require commonmark-pandoc >= 0.2.2.1. + This fixes task lists with multiple paragraphs. + + * Use skylighting 0.11. + + * CSS in HTML template: reset overflow-wrap on code blocks + (Mauro Bieg, #7423). + + * LaTeX template: Revert change in PR #7295: "move title, author, date up + to top of preamble." The change caused problem for people who used + LaTeX commands defined defined later in the preamble in the title + or author fields (#7422). + + * Add `doc/faqs.md`. This is imported from the website; in the future the + website version will be drawn from here. + Added a FAQ on the use of `\AtEndPreamble` for cases when the contents of + `header-includes` need to refer to definitions that come later in the + preamble. See #7422. + + * Upgrade Debian 10 AMI for build-arm.sh. + + * CircleCI: change to using xcode 11.1.0 (macOS 10.14.4). + We previously built on 10.13, but 10.13 no longer gets + security updates and CirclCI is deprecating. + ## pandoc 2.14.0.3 (2021-06-22) * Text.Pandoc.MediaBag `insertMediaBag`: ensure we get a sane mediaPath diff --git a/man/pandoc.1 b/man/pandoc.1 index c77ab93bd..59888e26a 100644 --- a/man/pandoc.1 +++ b/man/pandoc.1 @@ -1,7 +1,7 @@ '\" t -.\" Automatically generated by Pandoc 2.14.0.1 +.\" Automatically generated by Pandoc 2.14.1 .\" -.TH "Pandoc User\[cq]s Guide" "" "June 20, 2021" "pandoc 2.14.0.3" "" +.TH "Pandoc User\[cq]s Guide" "" "July 18, 2021" "pandoc 2.14.1" "" .hy .SH NAME pandoc - general markup converter @@ -7343,6 +7343,15 @@ For example: \f[R] .fi +.PP +If the input format already is HTML then +\f[C]data-external=\[dq]1\[dq]\f[R] will work as expected for +\f[C]\f[R] elements. +Similarly, for Markdown, external images can be declared with +\f[C]![img](url){external=1}\f[R]. +Note that this only works for images; the other media elements have no +native representation in pandoc\[cq]s AST and requires the use of raw +HTML. .SH JUPYTER NOTEBOOKS .PP When creating a Jupyter notebook, pandoc will try to infer the notebook diff --git a/pandoc.cabal b/pandoc.cabal index 999f00f11..eee862909 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: pandoc -version: 2.14.0.3 +version: 2.14.1 build-type: Simple license: GPL-2.0-or-later license-file: COPYING.md @@ -756,7 +756,7 @@ test-suite test-pandoc bytestring >= 0.9 && < 0.12, containers >= 0.4.2.1 && < 0.7, directory >= 1.2.3 && < 1.4, - doctemplates >= 0.9 && < 0.10, + doctemplates >= 0.10 && < 0.11, exceptions >= 0.8 && < 0.11, filepath >= 1.1 && < 1.5, hslua >= 1.1 && < 1.4, -- cgit v1.2.3 From 26d883faa8d639df38dc765896be684238e3a135 Mon Sep 17 00:00:00 2001 From: Veratyr Date: Mon, 19 Jul 2021 19:19:41 +0300 Subject: INSTALL.md: Add GitLab CI/CD example (#7448) --- INSTALL.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index f226f4aed..35151eb02 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -163,6 +163,11 @@ Pandoc can be run through [GitHub Actions](https://github.com/features/actions). For some examples, see . +## GitLab CI/CD + +Pandoc can be run through [GitLab CI/CD]. For some +examples, see . + ## Compiling from source If for some reason a binary package is not available for your @@ -392,6 +397,7 @@ To run just the markdown benchmarks: [Fedora]: https://apps.fedoraproject.org/packages/pandoc [FreeBSD ports]: https://www.freshports.org/textproc/hs-pandoc/ [GHC]: https://www.haskell.org/ghc/ +[GitLab CI/CD]: https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/ [Haskell platform]: https://hackage.haskell.org/platform/ [MacPorts]: https://trac.macports.org/browser/trunk/dports/textproc/pandoc/Portfile [MacTeX]: https://tug.org/mactex/ -- cgit v1.2.3 From 832196fb17d7df037b1d1747d2c2d173ff7b3a95 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 22 Jul 2021 13:08:30 -0700 Subject: MIME: use image/x-xcf instead of application/x-xcf. Closes #7454. --- src/Text/Pandoc/MIME.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/MIME.hs b/src/Text/Pandoc/MIME.hs index 77c7069e9..dff8f7822 100644 --- a/src/Text/Pandoc/MIME.hs +++ b/src/Text/Pandoc/MIME.hs @@ -528,7 +528,7 @@ mimeTypesList = ,("wvx","video/x-ms-wvx") ,("wz","application/x-wingz") ,("xbm","image/x-xbitmap") - ,("xcf","application/x-xcf") + ,("xcf","image/x-xcf") ,("xht","application/xhtml+xml") ,("xhtml","application/xhtml+xml") ,("xlb","application/vnd.ms-excel") -- cgit v1.2.3 From 1f1a30bbf6aa6d1c1dc60ac9d97560346066d02f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 22 Jul 2021 23:05:43 -0700 Subject: LaTeX writer: Use ulem for underline. ulem is conditionally included already when the `strikeout` variable is set, so we set this when there is underlined text, and use `\uline` instead of `\underline`. This fixes wrapping for underlined text. Closes #7351. --- data/templates/default.latex | 1 + src/Text/Pandoc/Writers/LaTeX.hs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/data/templates/default.latex b/data/templates/default.latex index d06701675..d6a6208a9 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -315,6 +315,7 @@ $if(links-as-notes)$ \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} $endif$ $if(strikeout)$ +$-- also used for underline \usepackage[normalem]{ulem} % Avoid problems with \sout in headers with hyperref \pdfstringdefDisableCommands{\renewcommand{\sout}{}} diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 063e347fb..dd837bdf0 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -786,7 +786,9 @@ inlineToLaTeX (Span (id',classes,kvs) ils) = do then braces contents else foldr inCmd contents cmds) inlineToLaTeX (Emph lst) = inCmd "emph" <$> inlineListToLaTeX lst -inlineToLaTeX (Underline lst) = inCmd "underline" <$> inlineListToLaTeX lst +inlineToLaTeX (Underline lst) = do + modify $ \st -> st{ stStrikeout = True } -- this gives us the ulem package + inCmd "uline" <$> inlineListToLaTeX lst inlineToLaTeX (Strong lst) = inCmd "textbf" <$> inlineListToLaTeX lst inlineToLaTeX (Strikeout lst) = do -- we need to protect VERB in an mbox or we get an error -- cgit v1.2.3 From f145aea0f9037f9d957d59ed8608401e7219fbf3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 29 Jul 2021 14:54:25 -0600 Subject: parseFromString: preserve at least the source directory. Previously we just set the source name to "chunk" when parsing from strings, to avoid misleading source positions. This had the side effect that `rebase_relative_paths` would break inside sections that were parsed as strings. So, now we use "ORIGINAL_SOURCE_PATH_chunk" instead of just "chunk". Closes #7464. --- src/Text/Pandoc/Parsing.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index 09445622d..cfda4bad2 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -599,9 +599,9 @@ parseFromString :: Monad m -> ParserT Sources st m r parseFromString parser str = do oldPos <- getPosition - setPosition $ initialPos "chunk" oldInput <- getInput setInput $ toSources str + setPosition $ initialPos $ sourceName oldPos <> "_chunk" result <- parser spaces setInput oldInput -- cgit v1.2.3 From ca12e198ba4b1addf2f0e3f9990491175998a199 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 1 Aug 2021 09:45:09 -0600 Subject: RTF template: specify font family for fixed-width font f1. According to the spec, this is mandatory. --- data/templates/default.rtf | 2 +- test/writer.rtf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/templates/default.rtf b/data/templates/default.rtf index a7f79376d..10f596518 100644 --- a/data/templates/default.rtf +++ b/data/templates/default.rtf @@ -1,4 +1,4 @@ -{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 Courier;}} +{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 \fmodern Courier;}} {\colortbl;\red255\green0\blue0;\red0\green0\blue255;} \widowctrl\hyphauto $for(header-includes)$ diff --git a/test/writer.rtf b/test/writer.rtf index 4f3751b36..46529bfc3 100644 --- a/test/writer.rtf +++ b/test/writer.rtf @@ -1,4 +1,4 @@ -{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 Courier;}} +{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 \fmodern Courier;}} {\colortbl;\red255\green0\blue0;\red0\green0\blue255;} \widowctrl\hyphauto -- cgit v1.2.3 From c1ab55793b85c76b7b8099886df530f79fe2f407 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 1 Aug 2021 10:29:47 -0600 Subject: Add a faq about the "Cannot allocate memory" error on M1 macs. --- doc/faqs.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/faqs.md b/doc/faqs.md index 2f3368837..317153d5f 100644 --- a/doc/faqs.md +++ b/doc/faqs.md @@ -124,5 +124,13 @@ topography as TeX, particularly when it comes to math, but they may be fine for many purposes.) +## Converting to PDF on an M1 Mac, I get a "Cannot allocate memory" error. + +We are not sure why this happens, but we have found that +fully specifying the `pdflatex` path avoids the error. For +example, + + pandoc -o my.pdf --pdf-engine=/Library/TeX/texbin/pdflatex + ::: -- cgit v1.2.3 From f938378d001cb892ccccbf6808010dd69becc26f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 1 Aug 2021 22:45:41 -0600 Subject: RTF writer: omit `\bin` in `\pict`. According to the spec, this is not needed or wanted when the data is in hexadecimal format, as it is here. --- src/Text/Pandoc/Writers/RTF.hs | 2 +- test/writer.rtf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index 3527949b4..24a90a0a6 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -64,7 +64,7 @@ rtfEmbedImage opts x@(Image attr _ (src,_)) = catchError -- twip = 1/1440in = 1/20pt where (xpx, ypx) = sizeInPixels sz (xpt, ypt) = desiredSizeInPoints opts attr sz - let raw = "{\\pict" <> filetype <> sizeSpec <> "\\bin " <> + let raw = "{\\pict" <> filetype <> sizeSpec <> " " <> T.concat bytes <> "}" if B.null imgdata then do diff --git a/test/writer.rtf b/test/writer.rtf index 46529bfc3..68f52a5b3 100644 --- a/test/writer.rtf +++ b/test/writer.rtf @@ -421,8 +421,8 @@ http://example.com/ {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Images\par} {\pard \ql \f0 \sa180 \li0 \fi0 From \u8220"Voyage dans la Lune\u8221" by Georges Melies (1902):\par} -{\pard \ql \f0 \sa180 \li0 \fi0 {\pict\jpegblip\picw250\pich250\picwgoal3000\pichgoal3000\bin ffd8ffe000104a46494600010101007800780000ffdb00430006040506050406060506070706080a100a0a09090a140e0f0c1017141818171416161a1d251f1a1b231c1616202c20232627292a29191f2d302d283025282928ffdb0043010707070a080a130a0a13281a161a2828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828ffc000110800fa00fa03011100021101031101ffc4001c0000000701010000000000000000000000010203040506070008ffc4003e100002010303020404040502050500030001020300041105122106311322415107617181143291a1234252b1c115f016336272d1082443e1f1265382ffc40017010101010100000000000000000000000000010204ffc4001b11010101010003010000000000000000000001110212213141ffda000c03010002110311003f00dadd18a10a704f6a95ccc57e37750782b0d8d9ea0cd32e7c5446e07e9f4ad723119a7b89e61e348f260719278aad613cbb640002938c76a182b264fc87bd13009c0c019c76e3d68a072e1cf6f4cd502d330c28269a61bb39c923923d4fad44c08dccb95cfd28b8280769ee08a263891e1808739e4f1d8d149392172cc714050dbb9fde8960ed8c60b79b1ed44103b05c331dbdb1dc5026ac1946d20ff8140aa631c773ec738a0346a003bf93e9cf02801895e7b9a01886796c923bd0090a06393c76a0142003ce3d86680d8dd9392303f5341ccc1b3cf7a2c812c37e4923d381429757013209fa511c18146c9247a0f6a007900c0c671c6280854e086c673eb45c27c038fd68aedff2fda836ef881f136f25d5e6b7d1262964aa02b03f98fbf153131935edcc97576f35c33349212cc4f39f7ab26186dfce5b200f73451f7600dcb8cf27e7400c0b291914046c9e0718fde81371b8e7273f4ef4007691919240e714097f31f376e7b5008caee27807b0f5a02c8e1b3c6d27d33cd0201d839523144d1a149ae084b78da47638211771fd050d582c3a0faab5119b6d12f8ab1c06788a0fd4e2ac356fd1fe08754ddccaba849696309e598c9e2103fed1dcfdeadc44fea5ff00a7f956366d375e492403ca935bedcf1eea4ff6ac68a55efc1beb3b552574f8e7009ff933a927ec715bc82b3a8f4d6bba5ca1352d22fe061cf9a0383f71dea5119cc6c0baed3eaac0f1fad40897dcc3d81f7a052366c1007df3400f21edefc5008c28f30c9c5170ee4fc37830086395250a7c66770c18e78da31c0c63de8609b41f7c515c5172a30c3b76344a3e377cb2339cf7a242aea89808cce368272b8c1a2e107c672a49f5c1a181c9c7ae7da8a2119e7b1f5068099ffa68258a132062d8f9e0f34059502b61bf2824e681bb297ced2a71efda80f19c47b9c77fdbe74057c13e539cf3c1a0eeeb9c73f33405ddb4f18249c1e28062b79ae242902024465b9214614649e7bd0362a7249eddc513456e5720f38f5a1a98e96e95d6baa6ebc2d1ad1e65521649bb469f563534d6d7d31f04347d2a2fc5f535db6a0e83718906c887cbbe5a9a8bef44dce9f731ca9a2e89169d6d6f2184b1455dc07b11dcfeb4d16f119c649a681285b03d3e5500f87820ff006a0e098191de80ac9b8904647b55d11da9681a56a31f87a869f6970b8ffe4883629a289aefc16e92d441682da5b098f21ed9f033f353914d19b751fc08d66cc16d12fe2bf45ec92ff0df1fdbfb559ec667aff4eeb1a04db359d3ae6d40eccebe53f46ec7f5ab82263da7dcf3eb5174e5181076918c7de869503232491ee4515c1803824f03b51287f30e0e7d803449494832c157278a2e8c71fcb9f9d144639236824d01e142efb1768cfb9c7ef40512a818de78ff00a682518e7cc30ab9e00a02cce9953247bd41e467191ed9a04205ee99da4e4e3d283a524b0427b5026c18a8e082067db8341ce0e39ed409b6502907391edda80f2dfdc496f0c124ac6184b144cf0a4e338fd2894f7a7342d4ba9b568f4fd261f12571966270a8bfd47d8511bae85f02b47b7fc34bac5d5c5dc88a0c90ab6c8d9bedce3ef4d1ad691a6dae976a96d616d15b409f9638d70054a1dbc68ea51d4329f4619a8022b78e04548515117b05000a035c5c4702a995c26e3819f534047bcb68a458cce866719540724d02e41c0f7a012a40f6141cbc8e7bd01719e38e6838af1c0a04ca8206d3cd037bdb082fad9e0bd8a39e0718649141047d0d5d18f759fc0cd3af164b8e9999acae4e4f81236e898f7c0f55fed574615aee83a96817ef67abda3db4ebdb7f66f983d88a061bb8db9e3d45165076db83c1f950a53780d8247c80a2398f182724f1c7ad080c608cfa7a51a0062adc7afbd0130173bb9c5070f071cb37e82826106e8f615e01c9e680d6b35bc534be3c1e3831b2aa962bb188f2b71df1de819ae4b1048c7f57bd01a58268e332642ae0704f7cf6207af6a01b99e17b7b6416e227407c494139909ed9f4c0a04a4e501e0f1eb40d263e53dce7fa682c9d0bd13abf58dd6db18bc2b157c4975270ab8ef8f563f21447a73a03a1f4de8eb031582b497328066b97fcd21ff038edfde88b7e32703bd64188e7e6283864b73400cd804b67ca3268317eacea6d56ff005233592f8b6303f953fa4af7c2fa93417fe98b763e0ea171297bab98558068f695ce0e08fdbd281e5c6a57ba5e9d14d716ef7774f2ec112601da4f27ec2827ada74bab559a20e148fcae36b0f91140283729c77a0e0a7777a01dac68395719e39a029607cb901b19c501480ab9279f4a086ea8d0b48d76c0586b7143224a76c61ce1831fe93e86b43cd1f12fe19ea7d2533dcdbeebcd20b612651e68f9ece3fcf6fa5067cbcf20ff009a051724905411e94032799060723da8406d6c67e7ea68d0e1770fe5cfb5026c37039ef9a02eca098c91e6e01e71c500b1d8a49c12786cf6a06a4e256008e3d050119958007920e2801154e32fb4120927b014017eb1c523ac5209a356215c291b87be28957ef853f0d66eaa99352d515e1d190f947669ce7b0ffa7e74a8f4be996569a5d9c56b6704705b46bb5238d42851f2ac875712bc70b3c30f892019540704d01ad2669a0491936330c95ce7140b2e4939a03638c7e8680ae485e33bbe540d60d3ada162c90a02c7270a39340a4f28b68da4645007a8f6a069a746f73235ddcefc391e12b2e1916824948742c99382473c73404791c617695279dc0640f9502c578c9efeb4095cb4cb0830ba21cf999c6401f4f5a05061d430c8079a02e03b3004311c7d281b5e3cd676c65489ee594e4aafe6c7ae07a9a0a075bbea3a8ea96f047d3935ebc404f04ad29411e08e011d98fed416fd212ee5b05b4d5ad6300c615807f1171eaa49eff5ad418c7c55f8466dd66d57a521f20cbcd66a7247a9283dbe5418a63862479877cf1f6c5008e400bdf1ce684016fe53dfbd1a73794600e08ce3d6800377c8c7d6800a9cf75fd4503d91492460f7ee3d28247a7b459f5fd592d22711c206f9e563858a31f99cfd050583518ba75247b1d134f9aed21396d4669769931dc01c003f7a329c4d17458ac5b55d36c12e040a3f1da75c1cb04ede2447f7f6a94567ad7a66db4fbbb29ba7d65b8b4bd8ccd09c8231eaa07b8ab04a7c2cf87b3f53ea8d77abc72c1a5dabe2452bb5a561fc83e5ee7e541e988218ed2dd22b7855228d76a46a00000ec00a510bd4dd511f4fe84da95cc31f880022da4902b1e7d3e99ac86fd03d631f565b4ee6d4dbbc649009cab2e48c83f514165b8b94b6895c44f279c280839e78ce28178ae6de46748a789e453865570483ec6812d42e85a421fc37918b00a883924d024c6e99b7a2a966c0009e17dc9f9fed40f81c77e28139218e4ff9815b9cf23340a01c907b9140201038ed402fcafd28386464e4fd33c50272bc60032609cf00fbd024f722dc66f24822ddf972f8feff00e280f69b24844919cac9ce7de83a447f30ded823007b50459d6ecacb528349b979127651b1dc795f1f3f7a0990148054823dc5015d491c0a0c3be337c2ff00c489b5ee9c87172016b9b541c49ff5a8f7f71eb560c1fc43e0a47e1aa94277310431f91fa551c1727f29ed409b641c86e31839a3454805739c1f6a026f1fd740f64665fc8c31cfde82db79bb40e9e8f49b62eb7d7e8b717ec832c91ff247fa1dc7df2281bcc9369d671493c422b7911654c1215f92bb8827bf068624ba635392df5eb4b9924558ee5bc19b71cee43c6dc7cf34c657be8db0b0b9d0f51d2afe668934dbf9628ddb8c2b8c0073f3a80da37546a7d25174fd95dc125c69f7313ee5655dfc313bd483cf07b1f6a68d5b48d5ec758b612e9d7293211c8fe653f35ee2a084eb9e8bb1eafb3582fe496278f3e1c919fcb9f97ad03ee8dd017a6741b6d3229dae161057c5750a48249ec3eb4139238568f6a9e7b103b5037934cb3793c610a2cd9277a8da73f5140ee38f6280c4b11c65b934023006d50050030e4647de80c846de3b500fcf9fbd0197273ed4007b91400e580c8e45074a82400e72682b36fd2162b7f25ddc09af2766ceeb872db79cf00f6a0b3229550140e07007a50092db860673de818df473c862686dad6470d9cce3b7b63e740fa1de6252ebb5bd81cd00bee2d800d003a6464004763ce683ce9f1cbe1f1d3a67ea1d1a30b68edffba814708c7f9c63d0fafceaca31e6dc71e1f07daa82608c83819f7a1a11ce149238fd68d0a579ec682cfd27a7c3a86bd10bc38b3b756b8b93c1fe1a8c91f7381f7a034f752ea5aa5c5eb292f732128037619c018f6ec282e5a2cb047abda74d5ce9b6da80f136de4a496219b3e48c92000323ea73467519d3da5bb757dbda410ac90c77c23058f99007ee7ec31416882ee47d23acb5185caf8bab4691b1efe57fff0038a9457ee75a82f6e7429350466b482f2742c0f74241c80c38c64541a9cfa1e89ac0177d33ab3d8de28f2b5bca429f91140e2c7a9b5ae9fb85b6ea9b46b9b3c796fe040768f76ec0fafb1f9505df4ebdb3d4edd6e74db98ee216fe68ce47d280648f75e2485a44da385ddc13f4a025ddbdbea16a633286566ce55f9c8f6c502ad750db2c514f30dec428247e6340bbf04100b73402afb943ed2b9e30683836defe9403bc1e06734020e06280cafe8683a375941d841c77c1a0151b467b50159f00e4127e5402872371040c5046eb5aadbe9b1c02e2f6dad25b89047099c677b7b0140fe3f1010afc803f3018e68160c3041ee2823f5dba92d34db89a1d9e2843b03b6d05bd013560c1748d57aa2797c6b35bab78e6959dc47231580ff336dcfb03c1a58364b5bbb7d7fa7b7427f1f673830c8664285bd1815238fad20f2c7c41e979ba43aa2e2c1cb1b663bede438f3a13c7dc76fb5515e9065b851f7a02950002a09c51a1b83cf14176e90d3645e9ad7752752aac23b3439c066665c827e944d29a6410aea725c4567135bd840d3c88a723728c29c9efe6c50d3ee9545b0bf8ef2e6e3c2fc2c6f72f2920e5f19039ee4938a9a875d03278377acf52ddf867f036ef71923932bfe51fbd3475cdc369df0db4fb389d4ea37970fa9cc0b00511795ce7d4f181eb4cd2451755fc45ac16d637381b14ca36b641dfce723e4053170d6cb52bbb362f6d3cb19241f2b9029862f09f143549ba7e7d2eef6caf2797c66ee17fdfd69862d1a069da7dfdac579d17adcda5ea9e1a992376c4723e39e3b024fd7e94c458ac3e25dee8d31d3bae74e7b79002bf8b8549471db38f5f4ed4c165e943a06a328d4ba605b4b22a1523c420c64fbaf38a82d36f0ce7cf7463790729b53017e940e0b0ceceed8ce0500e1b70daa08f5c9ed41d271cd0132476e7d7ff00aa069797d2411168ed9a41fcc858211f73c5075acb25ca6fb82aa31e58a36c81f561dcd033d42169e158ac64b98151b3981c2966cf639f4a064c7a8ac55e4865b7d493701e1c8e52403ea3cbfda827e390ca3f2c914aa81991bd281cdacc2747215c60e0ee5c67e940cb51b0b2bcbd824bfb08ee1a252d1caea1821cfa67b1fa504982b2283ce08f518a08abb82f6dd0369a5662081e14ce40c7ae1b04fda82275cb0bfd4f4536f7114589a5412461f3e4ce4e0e060f63f6ab2893d3b4b5b5b78e22ed22aae3cc3cc7e64fad3449a22a461500007602a0cd7e3b74c26b5d2ad79147baf34eccca40e4a7f30ff3f6aba3cd0543267eb5427b86f1f4c76ef45d0eca1ad5ef224d13e1cf4fd9b22192fa67bc955f8c8c617fba9fb510d7a6ed3fd43a735e5b54964be658c048fb6cdd9e7eb8a186bac97d174e6d22e23437b7ac26b95e77c68bf950fa7279e2b22dba45b59e97a669fa4ea36aeff89cea9a90451fc355ff0096ad9f4ce3f41570675d4fa8c77da8de5cde5be26bc653171ca47dc1f6c9fed5562b97f70276808da7c24f0c1c63804e33fa8a2928c0e0383c8f7ed41d92a41393f4a2548595c2c37493db4cd04e8a08f139566edfef3445b6e7aeaf65d2df48ea2b11776ae02a93e564c772adef409f4ee8ba9a21d73a36fa579ad9f325afe599171ed9c30a960d5ba0fe2843abb47a6f510fc26a4c36890f9558fcc6783506a1147b510024e30339ce680d2c6ae9861eb9a009178a0205443b989e39cd01d8075e3047ce80563057ca381ed4011c4531e503d85013c91b804a21279c903341131cda8c3abdc8650f6d20c4321232adec3dc504bab2c113c9293bb1963df3408dd4b75e1efb2856463dbc43b4631fad047e9177ad4fe32ea16b1db4b8fe1aa92571f5f5a0916bc8e0895af5c46c17cd8c9ff7da80f6d736f7f6915c59cab35bc837238ed8a072a31c1ef4062870718a06f7702dc5b3c522ee4752ae0fa8230683c75d6ba3b74ef535fe984929149e4278ca9e47edfdab42058003763ed409f88ffd6dfad06b1f12ae612fa0c76e0b471e9916d23f973eb4158d3efeff004a984da5debc1295d8e4018dbf3145d583a2ad96f356bbd7f5d90dc59587f1e79a6392f28fcaa3ee47159444ea3aa5ddfc7acf50dcdc344d7a4dbc317f52641200f6000fdeb41b5ef51d8eab672ffa9e971c97c11638268e431a46000012a3b9a351567db823b11f3ef40948e428048207a8340ab48ae83cb83ee0f3428a982719edf3e68c9cc97d3fe15ad8c9be138f2bf38e7b8f6ef40f7a5f55bdd3f56b46d3649127f1405f08e7249c76f5fa50689d48ba5f545cdcbdb462cba9206411b2b055bb07d4fb1c73528d4fa8f52d62cf47b6b8d2e65fc458c49f8a818795c151939f977a823ba0fe253750eb7fe937b04293f9f6c90be41dbdc7ff006283473c1efc1a06f69776d73bbf0f2aca32572bc80470450284a46dfca19f819f5a04e799614def26c0bdce09cfd85045dc75769d12dc3c3e2491db0dd3c85195235f7c91cfd066ae0cdba9be31f4ec61a386c1ef9d4ee473e45cfb1cf34c101d3ff1ac9d481d46c628ed24751881880833f988e7b0fa5328dfed2f2def2ce2b9b79925b791772ca87208f7a60182ee2b95cc0c48f53823fbd40ac658b30f4f4a086d4ee1d75bb6b78f4e965596366fc5211b23238008fde81f43692da5bc30d97831a0397dc09e3d714087506bf61a2c4cd77324726d2caaec141f9fd2ae0c435bf8c57173ad7876f7a2daca10489121244cdf319ce3dbf5a834fe81f881a6f57bcb6ba7c53c72c11873e28cee1db391dbef4199ff00ea4348116a5a66a8a8a04aad04847a90723f6ad7d18c312ddc02a3815423ba0f63fa541687bd9efe1b533b3c9e0a78473e899e318a09bd0ba6eef543e3b2bd8e9b10064bd9e4da001dc81401aeeb29a984d0ba7d5e1d06d4e6594f06523bc8e7f5c0ac8af752dfc17d7090d9218ec6d9447129ee71fcc4fb9cd6842ab10dc0014f3e5a2c1704b671dfdc734525226dc939e283a362c7f940344a380393df144733e2276e38f5efcd01b4bbbfc3dda4a9298a44395902e4a9c70682660d4265d62de40b1bdc1545054f95c8fe627df141af7c3af8808f3dd68dd5d2a45765884b8908d8c3b6c27b7a77a945d7a5fa474bd2ba8e4d5748b28624955d5d8b13b79ee9e983d8d40a753758c7a46b96f6114725dc92279a2810b3a64f94900763cfafa503fd3b59b79ed84da34713c0cd890f0a158fa1f981de826e1b548959fc4dc5cee24b6467e59ed4101ff19e9f676baa5d6a72c50adb4ad1ac790ccc076200f7ad41e7df881d79a87576a5f87b0f161d381db1c2a36e7e6d8ff3416bf87ff082c6f208ef7a82f22b9761bd6d619785f6dc477fa53705ab57f83bd297ceb1e9caf67708db9c4526723e849e3e94f212dd25d117fd29a8c09a76b534fa39cf8b6b71ced38e36fb73417f52e64548e34007e673e9f21ef590a1c918c90718dc281a69b68f67118d9da5058b798f6fa7fe280daadd1b2d36eae70710c4d263df0a4d583cc7a668fd4bf11b5837d7c93dcd9a3146959822a0e781f4cfa55161e9dd7fa67a4f55b9e9aea3e9f81fc09ca0ba118998fcdb2338c7b528d39f4cd2ba76e2d357d292df4eb391809963420ce1b1b576fa1e7359119f1eb4e17dd033ca172d6b2a4df303383fdeb5c8f2eef3bce4e0e335684cb0c9f354160d36f64b0baf16072b91b5f03391f43c51aab23a5debe91c4fad4d73689e6fc3a290573ff4f03e59f4a3280d67581ce916567f84b58ce0a1fccec3d58fa9a084de08c90464e4d1a8e419059b201f4a05630a176918efc50176293872c17bf14042aa0125b03db14046c60b60123fde6827fa0c68edd5365ff11346ba6292ee64194240c807e59a32b7fc51bfe8bd5ed5db424860beb62b89218422ce09c11c01dbbd0660ae110bf1bf2154838dbebfefeb41a8f4cdac7f117458f4d9ecd2df53b4cf81a822808c47255c0f7c8e7fb54a2ec2cfabba3b4b4b8d3af12eedad40926b0f070a13f9b633649f7a82eba6ea4357d321d4ecad512daf20df26e016507fa4fbfaf3e98f9d067dd2bd2faac9aa4d72d72d1e9510ca46a7631c7a320e18f1dfd7bd059afb7da816d23de4ba5de211346a1e4785f190548e4648c63b64e6b43ce9d5baafe3b539c5b452dbda46c638a167cb281c73ee4ff9340e3a3fa5f5aea4ba58f4bb57dbfcf2b02a8bf7f7a0de3a5fa0b50d2a2d92eb3e048c0a97c867dbedcf6a944e5cf4f6b76d1b3d8ea42795066266c87c81c65b9cfaf15048e83af3cd64abac08edaf01546c38dae4e0657ee6826e5b892de3702292e2545ddb55700fd0fbfca81c4b3bc718716eef9eeaa402280d14ab3c0b2c65c06fe571823ed40df56b217fa6dd5ab9216689a33f2c8c558307e83b8d77a37aaa7d22f2512c28768800c9954671b3d33ebef568d0ef7a7749eb0b5bbbb162d657b32b46d2e1564c8ed9c5644d1b0b9bbd261d2a440af6cb0e2e5b1e7dbc1238e0f7a0375b696daa7496a3a4dac8a92cf078685b271db04d391e40d5ec4586a1716de2a49e0c8c85d3b120f715ba1899173ff305413070abd89cfe9f5a2d3ee9c8639fa874eb6b804c52dc46b20c9f302c3bd11e84d47e1af4d5dc6521d3e3b662c19a58721ff5a9a321f89bd27a374b456d158dccd34d333332c9b4b2afbe47a7cb1f7aa33d2bc0d8c0f1c8f6a2c14b6d501b39cf63450897380c319e3de8065031c038f7ed40d8faf1ce41e4d004876a8dc3cc7e743025c956c818028c904579e7f0e15695c9c0541924f6c00283d0bf07f42d6b48820b8d62d20b2b58d656404959e52f83c8ff00fcfafbd4a35bb06f12391a48dd55cee2b2f3818ed8f6a8158a159890f02242079147623e631c502b0db436d1ecb7458d4738038fb0a087d6eeb508f48bb7d32d95750752b6c26c905b3ddb6f61eb574794f5cb6b9d0fa9678b512b25d24bbe52b8c1638278fbd582c57ff12afaed45b5bc0d0d8a8c08a2731ee3eec5793f40450466a1d59af446293c186cd53ca0c36eab93dc649e49fbd048e89f1675ed35e301e293919dcbf9867b37cbe94a35fe94ea4d33aba6824306dc48015750d86c6e247b0cf63591a40b8dc23fc30f14138dcac3000f9d03687547f12e8dd5af816b13148dddbcd29039c0f6f6f7a0eb5d62caf5636825db70c9bc4328f0dc0271c8a090627d3073ce681acf6505ccf14d35bc2f2c2731bb28254fb8a075144a83ca806792400334049ee6281e2496408656d880ff0031f61fa50446bd76058ea1b9e21025a3bb48afe71df9c7b71de9c8f196a0de23ca7b827d4f7add117e0cbfd4b5059392369663ff004e71c51aa97e8f555eadd258f2bf8a889cff00dc28cbd0bf123a926e96d163bdb74490bca2321c678209ff001591e71eafd7a7d7ef45cde2c20aae144638033fb9ad2e1b5e69d058da431ccf21d4a5c3b4631b62523807feaf5c7a50222f2d648c25f5aeec8c2cd19dae3d3e87e944d3eb7e90d425b49ef2292de38224f1505c3f8724a9eeaa7bd0d57a60406059436306868a7803839c7ad1a158039c13f4a33a716767f8cb9b6b55e1ae2458813e9938cd07a9f42d0b4de99b4b7d1f41b58ff19b03c93ba06607fa8b1f5f619a5b8266d74a65d42da6ba90cce996dcdc8c9fff006a5a2c2635083b05ef83eb5028076341db4b1ed9f7a04651fc41db18ed419d75b744dbea335fcb0db0335f2057901c05da73c8f9d5d18a75174a3f4c47335e35da4ce418a489374254f707d463d33565d1529b569a489a17944b06ec8057d71dcd037b4b6b8bfba31584124b27e62a8a4f1ea68357f83da7ea5a76bfe0912453ccabb49194653cb60f6ce3dfda983d196cd108c2401711f9768e306b2297d73fc6d02773a8b591922693c5004bb9d72542fa2f6efde8314ff867aeeec27500b77bb5670e36ca19b1dff2e7f2fd2837ce8bd5dd348b78b552219022870d9c46e792a4f6c608a0b846c8e03232b29ec41cd0199f1410fd4b24b1e8f712c0a5e4452d851e6c639dbf3238a0afa42ba77475e4ba8470896681da45180b18da76af3c9029c8f26dc1df2b9c606e273e86b743331924f27f4a82c12280e59b008e79f6a2d4d74188ff00e30d203a82ad7519c1ff00b860d11ba7c5e86c9fa3afae6f4091e043e021270b21e01c7dcd6479ab4dd3aeb56be4b7b184cf2b301b57d07bfd2b4bad0fe25e9f6960ba7c7a55ac50cd750335ccaade7723b83b8f6e38a2207a5ba4e7ea3d93780cb616ca53781f99fbff009a0b675a5be9765d43a75a6ad3b25adb4185429b831c70303dfdfd2831eb8954ca48f3827819c71ed406b2b1b9bf9a5fc1c4ce2253238047957dc9345d122b792eee522811a495ce1157b93ed444ff0049f476b1aaf51c761345269d25be269259570c833c6077249e062a68f53e8ef0da69509d4ae225b92a04af232ab16f98cf1f4a5a266d4dbca8af13a329ecca723f51502d14f0cb9f05d1c8ee01c91f6a0393b4edfe63c8a031608859b38f97340d84d04e5846eae50f9829ce3eb400fb24466041f5e3d2823f56d22db57b192d6e61468a41c823ff0035651916bbf04ada7badda5cad6d1b72c09dc33f2a6875d25f0865d06fe2bc6d4c4d3282026cca8cfafcfd29a34cd234a10c768f711a78f1bb392a3001208e3ec69a26a58d640c832091c90706a084ea1d3eeafdadf4f86da3166c0b4b397c18f046140f5ce4d04f4702436e91c28a9122e028ed8a0a9f5a5b6a09a1bc5a135bc72cce048b3c5bc15c638f9d59043fc2db997481aa69dae49e1cb6bb643239211939e467818f97bd305965ebce9a10bc8da9dbaa2679dd9ce3d8530572cfac87566ab05ae9f1490692b9696e1f833738555f96793504df5f25945d2576b7ec16dc46792381c7b7ad5e60f234980e42f6c9c56a82ec3eff00bd4124e49700f1c646e3cd169ce9575f83d52cee324347323f6e3861ff008a23d47d4ba6a75074fdcd8ef317e2e2ff0098bdd4706a60c3f4ae8cd5f44eb8fc3e97248a638cbc73bf90483d463b373e9574685abf42a6b5649fea72bbdeac4a8d3b018cfae31f7a6895b6b29b41d30d8e9f6bbed9213e1b7a994e724fcbb5064bd7835a9752d3af75d8116354778f660788cbd9483dbb0a0cd20b2b8d43528ad2088bdcccf854039cff00e2827a0d34e9da1de896f2182492efc0976f998aa827d3d334113a74aa9a9298628e74570478bc0c7cf1da83724bb8246d3e6416b0384da61b5501c9f5c3704f152c037561a95f5fce61d3ad6db4ab950f34b331dd9f4191db8fdcd406d67a675ab4b6d325d1af248272a43430315ddec7038f6ad4b3f448bf47eb71cb69abddebf21d5e26896203846c30c8603b9c6452d9835901405660376319ac84bf13180779d8bb82827d4fb0a06f777367a75acd7170f1430a9f331200cfceae061a0cf6dac692d7365266191db0578f5edf3a6075a6c9278b3433188a467860d96fbd40fe540471409aa0c1140750001ed8ed4058e15133c983960077edf6a06faade5c5b7822d2d926766cb967da2341dd8f0727d85033d27597d62e2ee3163756915bbf8799d71e2f19dcbf2a092b88dd9a311950a0e5b70ce47fe6ac18af53f5b69da9752dd69da9ca906876e24465d9e69881c6ff005c679c0aa2bfd267a347512c93dbb5d42d90d3c800b68c9ce0ec3cfa528db74ad034db5905ee8be1ac728dc153984f3f980f4fb56453be2de8f647a6aff53796596f0aed46798ec033ce149c0fb0ad71479c9bb9dc3bf3c55a0b95f65a825150b481a407b93c0fda8a29c06671dc93803bd131eafd0af6dffe18d2ee25982a4b04603b7a9c631fad03bbe586381bc5945b96385718c827db3eb5288eb8ba934eb15fc3c535f05427796dcccdec7150637d5bd55d5362b7975aa4d0d919018adec8637807bb60723000e4f7cd58203538aefa8aeb478a7b9beba924547b8774cf8608036a80704639cf1f9855d1a7f4c68b67a03de5e5d59dad8d988c62e1c0f107a1e7fdf7a082ea6d07a6e3e99375a7cb6b3db093c727701e2360f7f53dfb50653d4130d42ee18f48b3f0232a15218936963ebf5fbd06dbf0cfa74855b9d46e04b730c6144691e12307d33ea7de8348ba6b5478a279a004f98c479247b81f5a9438805ac0be2e02e73c9ef8fbd40c2346d43578eefc40da7da1dc8b8eefea4fcb9fef419beabf12a4bcebcb2d2fa7ee0dc58492084b30236bb6467dce383f6a0b87556a67a7f4d95a0bbb5468816f0a69c78b2e072572719ce78357079dfab3af2e7a92c963b88d94abbbf91cedc93edf418aa2c5f0dbe2a6a9a0c90d8de34773a6a8da1186d6403fa48fec682d9adeb7a9b4c9d572dacc9a6c9700456e5ca910e000ecbd8e580352fb1ae7476bd6dd49a325e5a9f3025245fe961dea097523cc0919a032af039a006936c81423104649c703ef40dcce64bc3035a87b6f0c378f9fe7cf2b8fdf340a4b6e25962915d94a67807839f7a043586922b5636ec44c061063f31f6ab079d7fe19b7eb2d4efeef55d5d74f992e9a0fc3a441dcb13927b838c9aa2d4bf042c618e178efee6e18104870172318edf5c1e6945bbe1a748ea7d2315edbea3a99bcb190030c401010e4e783ee0fa56455be3d6b90c1a6268d69e17f1486900ee98ec29ccc183119419e7e55ba11f089f523ef5058363a8059fb8e31e9421b491056c01819e28d3d0ff07eea3d53a1e3b6b8db235aca63c139c0eea68ca47a9fa6ef757b83ff00bf68ad428c2f248c7a8f9fcea518df516adac74e7544f63a2ea172f1800291e6cee19ec78cd5826344e85b6bad25ba8fade5b99dae0ee11efc71e858f7e7d054a2d7d39a75ae8f7b6b00b8917f1516624b78429da327cec493db1db1d8540cf4aea28f58d6aeae2f6dd64b498082d880488d149fcea7d4939ab04175e6850a8d32de3b78e380c8de32c4db4e18e430fef543cf86fd0d691b4fabdf6648b3b2db69ce7dd87be68342d2f4fb9b5b891af1a28a2dc05bc5036d001e0eef7352884b961a2ea9aa7555c885e08d45b5bc52b61b686c120fb939fb541276bd4b61d53624d942e2f6200bc32290633e99f4233416dd3ad3f0d611c0c77b632e71dc9ef41156dd27a45addcb3dbd9c513b1dd941821bdc7b558333b9f873757fd69a85e3f813e9c7723b5d93265d872473c11544a68ff08fa75e290b42ec4e4124e70738fa5048e89f0f745d2aeadd2decedda6525c975121183c77f7a945c754d0e0d563682ed43425369403bff00bcd58308ba7d5fe13f5a05889974a9d8b46aede4914f707d88ff001528ddf4fd7edb54d1a1d56c312dab2e64dbc9418e78f5c541296d70b716d1cd6f8789977230ecc280cb7519b816f212b205de4e0843ce300f6cfcb39a0545c42cee88e0b458ddec33ee680eac92266360debc7b5056fad2d354b9b189745744be121daf27e550548ce3d4d58324d07a725e98ea2b7ff5381f5169a7579d021fe13904ee43ddfbe49038ab46e76cf05cc714f6d309232a4a98ce54fd6b2196bb7f2e9b631b2c427b891b6851db3eff002007341e5bf887aa2ea3d4f77378be381e42fdb711ed5a1554395caf1cd07617dcd04fc85402101da791421b49920331381c60d1a69bf02f56f03a925b12c162b98c955f775e47df19a32d99b518268e4491668704a79d4aeec7b7bd4a30feb7e9144d76e265697c3e2693631674273803e556087d76f35fd49859e9925ccf611141106f2e182e3241f727f5a94681a268f79ad1b1b8b9dd66b1c2b1ce9bb06361c1e7bf3fe6a096b0d3ba57488e485b52b40909c386901607d47bf7a0ae758eb69ac4d15be81a748f0a9c35cc90b2eff4c03c1c638a0b77405c5d5d45f87be5fe359a88b81b401dc1c7d38fb50586fed18ea3015790091591e447c1518c8c7a0a0a5754d8c9d49a8d9f4ee9dba0b3b5224b9692327728f627e7c6682f9a7e996b6b3a8b6b748a348820c7720761412c064e3041ce282b5d4bd73d3bd3f33daea97ac2e540dd0a292dc8cd043c1f15ba2a7923b65bb910371b9a12141f9d02edf13ba2ade56857551e5e77244c54fd0e280746ebfe99bbbd655d56dcdc9ce08465565f4ee3bfca82d53eb3a6dac3e25c5f5ba646402e33fa77a0aff5b74ad8757e9ca972844aa37c520fcca7d3f5ab067bd369a8f467544d626c98e9f7118f0200e4465c903049c8c9e6ad1b24334b6fa6249716cab20037c309dd83db03b5640dddac3764a4f02cb1103863919fa7a1a06d6f600c37162911b7b252b87dc773f1927393f4a079f868edae1ae6328a8b1ed38e30050226e85d5dc1f879011b3c47c2f604719f9d01eff4f4b83e3c6b18bb452b1cac9b8a83de80b16e8208a3b7b58e1407cc061427cc0ff1560ce7a8f592d69a97504cad2dac01a2b53900c3e9e51ea58f727d0551e73bfb86b99a49a46dcf21c96340dc13804f20f6f9501c0e3b8a0963316fcc4607007f57bd084d64dec01200ce483468ff0040d525d1755b4d4206ff0095207c11dc67ff0019a18f56584f6daad9dade4211e39104a8ded9152b235cd8c530613229c8c1c8ef50472e81690ee00322b0c100f0debdbb7ca8111ace856371358cba85aa5cc407891ccf83f2ef4048b4ad2e59bf116769672c72f99dd1437239078e2824a4d3e1b94559234110e781839fa0a0561b38ad532a12319c86c6307e740a9732a3a00cac870cd8e0faf0681be8b6db965bb909df3c85806eeabced5a09523647e6e0fef419a6adf116daf7ac34be9dd1da686e7f1ca2e243b76320ce57df9ff1560cc3e3f470ff00c78255b842b35bc6c4af9b6e323d3e95467b6365f8dbcf062beb68c119595d8aaff6e282422e9899b4f6bb5d46cda2562a76316c1078f4a0859e1b9b762c0bf94f0e84feb4125a57505c58ea70dd5d0174a986d92b1c13f6f5a0de7a5be366877260b5d42dee2d2423124a487507ebdf15289dd3fac7a7bab6feded74d61733473acdb5a162142ff00313d81ed505fa58fc6d809380c1b9f5c502e0e05040ea367a85dea454de2ff00a610375b04c16c7a16ef8340b5f6930dce9375636acf6a278f04c5dd4f1dbf4a084e91d06f3a52dee62bbd4a2b882494ced3c8a448063b63b638fde803ab7ae749b2b3096d792c93c8c109b55dcd18ce3710473ffdd043dc758dc5869044565aa5dda4c3c2b7bc78c1f14e3963db03e7c0ab066bf1327d41ba76ca6bc48ecad24c456f6b0c87cf8e4bbfa138c0fa9aa3297c83dd4e28395811cf2680a5b93c7ed413cd1ff0f3c797b8031406645236b0508406f30e68ba49c051b97d0e0e7d28ad57e19f575c5be8f269515dac772877c11bc464dea7ba8c739ce78f9d3193bb8ebfea2bcbd6b5b6b8b58bb7f13c2f0ce31cf0deb4c0f2dbad6d743d2ee99efae752d6c02a86e0054524f6383c7ff94c0b6af274c75149a46a5a82c46f1e1479fc3190bd8156fbe7f4a960bf74e9d253f1167a3ac09e0856610e3041ec7f6c540f67b892cee7f8d18368232ef2af2508c7047cf340ead5bf130accc9b1186541e723d09ffc5033bbb1b82d74d6b37f1244daa1b38073df3f4a08eeb1d3b50d4fa6a5b4d32f12cef1902ee73e523d476fde8306eb0d3fabfa4ba92c278af67bb7281606472f90bdd58558253a6afb40ea1d62283a8b461a66a6f931cf6a7c2466f7cfb939e7b5515fbed3747b5eb8f06eb78d35080a2ec9719c76f98049a0b4ebdd37d1bad869acbf0b03c5c16b29444adf50ded41995f68564a263a66b31cd02be152505493f51c1a088bab69ad1bc179e320f07c37c8a0692b46c4995f0381db39a0b2fc34e971d57d4705bc8db6c50ef9dd97b81fcbf7381528f5ae97a1d8e996d1db69b0c7648855b10a81b80f43c739c54134147b9a036063279fb5046e957726a0f2cfe04915b06db1788305ffeac7a0a00d72f8d9c491c06337533050ac7185cf2df6a06da2da4293488f34973328c34aea428c9ec3eded40ee7d2ad249448f6b133820ee2833df3fde819ea96897461b05b87815f2ee919e5d47704fa039ab079b3e326b70eafd4ef6d6650d8e9ebf868b69c8247723efebf2aa280eb9193ebedc5002a124e015340018fb8fde82cf32b1603d0678cd02406dce3008e47ce81b499c331383c9c9f5a2e9c69377369f7d6f796a4acf148acb83fb511e91b3b3d0bab745b7d45acedd8e3732b71b1fd73f7a5a19eafd09a56a0a96b1c705b49c48510761ce4fcfbd4d0d752826b2b583476fc3daacb295b79d768de8a32b1e71f989e49f6a7d14dd1af5ba275a45b8b093c054492ea769092373765c1da4679fbd306e36ba9595fe9f0dcdbcc92c33e1579cf27d0d409ea178f68521b6b76926ee8a7853f7ff140bc768d78f6f73748d1cd103b543f0091cf6efc502f7319dac194371d8b6326829f0c501d7ae6fa568d5d4942c806d4db81839f53c8cd59456fae6e628749b5bab8b1865b08e4726588ec11e7f2e49071c93da9a31dd4341d675e9a5bad374f9858162d0b4ac70e18f0573df35a0c759f87bd53a404f174f965dfff00f479b1ef570576e34bd4b4cc0bdb3b9b7258a00e846e3f2a94376475cee4914af7ca9150685f09ba61efb52fc7dd69bf8eb7c158d1d0b47bb38f37efde968d6eeb4eb5e91d6ad25b660aee59974db6881690918e31ce39279e062a5a34bb57b88adedd1e379679065d80036679e6a07e8391bce7e940c659ef5afe1286de3b16f2b8903094b7b2fa7ce81eb380c4260ed193f2a0cd6fa5d4a4ea0fc7bdadcce923158a3039db83c038e3ef41a0e96b2ad8a35e009291b8a939d9f227e43bd590436bbd6fa269202c974b7123602c76e779624e00e29833bf897d493e896525dbcb2a6b5a9c3e1456b91b6d60cf989c7f31f7a60c02490961ebcf3eb541308e39e067b507007b96007a67fb50178f97eb4165ce18165c2927b773fad023202d9c8dbb7818ff003408300b87f2f1c107d0d0c15a4f2e339c90467f6a18bdfc2cea8ff4bd561b4b9ba686d6e64552c4f954e7d7e46a60f4688d240af1b2bc6cbf5047ca960617ba658de1b792f2d94a5ab33461b18524633fa1a81b5c8b5168967369d23c0e0a24622dc981d81c76aba29df0bb48d660d52fceb88d069f04aeb69130037127f37b9c0ed9a8350781240bbc06da72323b1f7a0eb8816e633192ebc8c9472a78fa50349b4c83c068e24f0ddbcc1c13b837be4d055b57e98b996d4db5b4a893dc1e6620b6ccf2c467efc504ce97a38d3f4d874bf09af6d46e2f25cb82724e791db15650a43f878b51fc34f3da8f132b6d6a98c80a39ff007e99aba249631b58b9047239ec3e55368aeeb7d2da6f52c0eb7f16e87f2c6e836ba90724ab7a67b55d115ac7c3e8aed2182def4c56a14096368959a423d77e3229a27b41e9d8343b01069c8a8dc9660aa3713df3c64d4a1c695d3d6b67a8cba94b9b8d4e61869e4e4a8c636a7f4afcaa09a485519caae19b966f7a0435196582c656b74df3e308beec7b50629375775b691ac5bdb6b16d6378779f019b00a31cf391c9c2f1daae0b35ef52f5374de88d77aa45a6cd25ddc0108694ee2188c28007603d6a0d16c92430a4b2ed3230dc401855cfa0a0a07c45d7b5db9d462e9ee960b14b2ee134ef8c850012147ec78ab0670b643a2efae753d72686e6e2da211db42176079c8e768f65e39f7aa332d6f58bbd635096f6fe6692695b24f603d801e82823cb900ee00e68006460051dfd680ed9f0c905b713d8d006d5f5419fa505a18f94e40501b1b81a04186d62402c87be3d6810b81290aea8467201231cd1749dbc437f9f1e201db3de8ba07dc0175c027f28a335b17c26f888d6b6d0e8fabf892a29c453b1e547f49f7a946d6424f08236491c833ee0835073294888894120700f0280813c40a6711bc8843e00fca7d3ef40e41dc081f9a811681c6f7565329185623b7e9de812b3bcf11ff0b74563bd50494cf120071b97e5fda80d7577046c9019d5669dbc340324eec67fb734103d5da96bf67a7cf0e916f6e2765f25ddc4c11107ab1c8c647cce2816d3ec7f0f6564cae6e67da375e6d52cc4af2e4fb13ed4145f899d47b3499f4bb6d46cda49b69b92921565c3648e3dd40c81cd5c0ae89f13ec246d3e379ed2d6da180b5d34849da1780b128e49271c9f4a60ba685d5fa36bc42d95c324ec7090cc9b1d87b81ed50588958977cacaaa3b9341c655f12348d1dcb8dc1946540f99a019e2134454eeda7bed3839cd052fe2136b536b5d3563a1ca53c49da4b9507198940ce7e5c9fbe281c6b7a974cf4ee4ea7242d76dc784a3c595b3e9b464e3f6ad0ac745ccbd4fadcbabea42da56959a382ce7460d6b1a93c01f97272093ebf6a82f1ad6af0e9da5cb3cecf6902216919f82aa3818c7a9f4c530649a9f5269ba7429d472239bc991a1b0d3c3152880f0f23039e7bf3de90635ab6a377aa5ebdcdecef2c9239e59f3827e5ed54302195fcc38cd01245395c1f5f4a05b606538e483c501b6939e3b5077860f3914165754c33e549000dbe87de813b820c27fa7baafb8a04a69c98e281e42618c795338033df1f3a06c03e4e029247007ad010093c35674da71f977640340081a190658e41c820f141b0fc33f8926c218b4ed609366a02249bb2d19ce3ea4528dbece68eead926b7916689c643a9e0d643387521fea2f693c2d6efc786ee46d9bfed3eff2a04669edf5295ff057a60bd865309246d3bbbedc1efef41d63a8dec9ab4fa7dd4510fc3c69234ca186e2d9c003b7a67bd034bad0a5bb96e25d575267889cc1b54446d9bd0a37bfbfbd02925945a72cba8dddc48b3f87b1e58f23c623f292bdb7fa7cf38a0a5750f54ebba56a9a67fc516b6d6fd3970ea9234677c8dc7f38f6e4640ce282d1ac4b16bfa72c1d2bad430cd1ba822061865f5007d3daac19cf547c189357d561bbd3eee683c62cd786e9b73337b8c7bd512bd39f06adedec2de0d5ae639da372e6485363107f97767b505cee755d03a5e58ac228659af123184b7b733322e38c91dbf5a943ab3d52e64b49ee755d2e64950e238e35f10c884e17cbe87dc540e6d7509a4f110e9f7566a471712850abf6ce463e6280bacea36fd33a4497f773cf32c698dcc4beee33938edc7ad05534aea683ae61d64c4d2a69b6b88d16d5ca5c303f3e386cf61db140e27b5e99e96b64bdd562b6b30aa36c6c37cac7dc9eec6b42c1a66a962fa70beb6b516d0cbe76322f86c78f6c66831bf8b5d5d2dfa35a5dce60b1933b6ce3c788769f2b331ec1b8fd2831b79649984b239773c1dc68129725c1c640e73400ec781d8fb1a03c4a85d0c8582640257bd01e51fc42236263c9c67be280429c6037eb405dbf5fd682c2a0bb976cf07d3fc5009279ef8ec4e68193a9902b28e7dc71fb501d95b098e0f6dd9e0d0049131019b047b8390281bb292484e47c8500c4f242c3076bf704704739a0be7c3febfbae9a5daf23cd017c7e19fb107bb67d0f6fd6837cd2757d1fab34f4f05e37dde630b1c3a91edf4f7159103d6eb7da65fdbdf59dadb5e2460ac876ed9e1c8c060f9efe9c8a0a75cfc42d5742d2ee5a7e9dbb494b6d6b9bc930cce4f940e3cd81ed4160e98f88315e689fff0022b57664199cc5196f0c7a164ef8f98cd0589baffa68590985eb15c0db1985839f6c2919340b69d03f5285bdd6f4bf021424db4329cb153fccc3d09c76a090d3340d2f479a7bab3b38e2924e5e451cfd280d7dafe936f6c5e4bd89813b02a36589ce318a0358dc35cc4e17f9bf234cdbb78fa0c607a7340e6cec20b1596610c6934b8323226379edda81da8dcb9ec40a042f50b5bb21645473b58b11dbd7bfca8304f8add5d67a9ea8ba5d8ea72c1a4d8a952f10f2c920e368cf71e99fad5833dd0754d6ed66bdb2e9a91a5babb2a310465a57c1ddc1038e7bd5171d3748b8d46ee1ff005298dc6a764c27d4eeaee7fe1c01795881c9e7804fe940dbe287c4b6d75a1b1d1c986d62277c91bf131f4c0f6fad0663737135d3b497124924871f98e7803007d2811dc5b83903dc0a0333f03be7de8122df2c9a05a11e5f51f7a05ce7071804fca8033e5da0734020b0183bb23e5416269577ed0e5323078ceeefdff6a03dbcd62914c2f629a47c622689800879e4fbd046f9d8a2a03e31385c0e73da8b83ca590947dcaead8208e73da8849b3e19ce704f7c5015586d006431f5cf61f3a04ee586ff002481c8fe6191408f0011eb8e30682774dea9bbb5784492ca6385832e1ca95e3d2834be9df8c312e2db5eb4375080337000f1303d18763591a469baef4d755989ec6f6dae5a23e20b599406dd8e080ddbed41272f4dd8caf1c86d163910f9595882a3d718a035edd695d3b6a926b57d0ac65b10b4e06eedd863bf141077fd7af2782bd3fa26a1a8891d57c630948c0279393dcd04cf5875258f4de9f0cb7b7b6d66d2b81ba752d85f5214724fed41036bd79d2fe319d7a8f4b9c81e58de2f04827b9ce09a07a3acecf54b790685ace8697606009e52c377b7f2e682b097d7d36acf0f55df5edbdc0977412468cb6ce3be10af3c63b9c8a0b0751f505be9690dd5d752436f62a3fe4c6448f3b7b0c64e38f615734651f107e3045ac42b67a7693018633b965bc1bc838ee173807bf7cd33065baaeb1a95f2c11dfcd2bc51fe48880aa3e8a062a8b059f595df4ae9a74de9e9ec499d43c97b1427c6e47e525bb63e4282ad3ea3712893c599dbc4259c1627713c927de81043950df97db1406da8411c92063be280230839627078e79a0390a71b5bb5003a8c1232338e4507025573e9fbd02a0e41dc0e680c3691cf714053bb34160895dc16f291d98d02322aa39f3e14707ffaa06f202a5bb0c7201f4a343aca51090497efdfbfce89840c8db8e46573923ff14410b00490d9f5c1a0425dd8ce4673e873cd0265e4dbe7041ed814009b8cbb8e5863bd07163b7716e0607b6698060b96b7b9478dc8643918247ee39a60b7e97f133a8b4e0c63d4ee597380923970a3ef4c0e13e25dfcfab457ba95bdbddb212016501867b9cfbfda982f907c74b282da34874a9048aa479c83838edc62982b7ac7c42d235cd67f15ac5b40c366418a2cb0c1c81e6f5e31db14c160d035de8cd4a3f18ea96562cc37359dfe9cac887fef039fd6b39446f56ea5d13a9dca4579a922496b1975b8d22dfc3566cf9557230703be715ac1431d4d2275325d7fae6b4f6f182a93ef1e32a9f41938f6a60afeb1a95c5fea53dccf772cf2c8c489240031f627e7565c0d67bbf160487c1801073bc0c31f91f953420f2bc8c7c52cc540032738a809905c0f4fa501940208e73df34028e703938a0577ae013f4a001300db4f03b71407461ce0502dca8c9c7dcf6a003fafcbdcd0070bc1e0fd734070db467b8a04cb9c9e68274b93bcb1daa40200ed4099765249ec476cf340849b8b264823bf34689ee009cb671df1409bc8e8b8e770e3ec68984d9c953cf97be2860b248caaebc107dc67f7a184c31232db88fd451031ce50e76039f5c8045026efb8f93279e0fd680b239504f0483d88ef409ee25bb90c79c0e050151c6e21b39ce783eb40adbcc2cefa17bdb61322387781c950e3dbdf9c8a066f28790b22e013db3dbef54726081e63c6460d34191b1bb0720f634060e7600412c781502409c8e3d7b500ed71dbef8ed40243f181c0a02e5d4e0fad006f644e4819e3b501f7e3049e7b501bc43b4e391da80558003392d40a23305e320d02e64cf998e1bf5a032b0c927b8e68049c8c8e71c6280377043118f4e680bbff00de0504ddbb3128371c1c64668024e59f3cd02521254e4fad1a2107e48fe6a6809ddb9e78a029e1463d05027ffc744a6c3857c7b1a205ff00e637fbf4a02b12b1794e39f4a02024e7249ed409924720906800005173fd7404989698ee39e4f7a04cf723d07a501fff0097ed406ffe36a018ff00281e99a037f4d0731f3bfd28007e53400ff99a810248c0cf140bc60123233cff008a0557f9beb4056eff007a07109243e79a03778b27bfbd02b128c27039a054001b818a06609de793da815006070283ffd9}\par} -{\pard \ql \f0 \sa180 \li0 \fi0 Here is a movie {\pict\jpegblip\picw20\pich22\picwgoal400\pichgoal440\bin ffd8ffe000104a46494600010101004800480000fffe0050546869732061727420697320696e20746865207075626c696320646f6d61696e2e204b6576696e204875676865732c206b6576696e68406569742e636f6d2c2053657074656d6265722031393935ffdb00430001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffdb00430101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffc00011080016001403012200021101031101ffc4001a000100020301000000000000000000000000080905060a07ffc400231000010501000300010500000000000000060304050708020001090a11153976b7ffc400160101010100000000000000000000000000060800ffc400261101000102050109000000000000000000010200030405061121b33134365154717475b4ffda000c03010002110311003f00a90cf388f366a62aa720ed6ae07f96901f3831d973452b8cf36fe3570fc908e46d466433e5dd954f2e96992d9e498c7753faa44916e016ca91cc7d88b38fe60a5b97737defcbcc539c98d336a57f4fc2ca9a486bf07ab575ad9a3af4df221d8215e36df86c4504ff0024574551b3d687ee0575757b3ad64e311ee62bd94158d37e24198c43973099f1fc0c41614d950246513a081abf76cfe7061f6863281e6352fd1670949c148dd6dfb0d25f5b3689b1d5c965b0eacbf4e0932ad28e22ab9ae945633f4744bd3c8cee0a7fdf085b9000f449c5f7afa30b83e0b6fd7b0c8429c9467ff9715347c891e25fa24a205861aa715e6a09bd0488237dc2723414d9891381524e8ca7c0894664f835653631ab55ee7e3de433e4ff001b30949124e4c10c8b6ad0a479b3f9c937b2cf5bc0095ad600a0a41a0e9faee174a1c605e161c6c7a313539650b0113190f1a8368e60d5b24f30ff008ea7f0bf867fa6595feeb6978f1fe0f9c26177f4d63a51a9235184750e7d18811339cd000000c75f000e00380380ae390c350def826ed42ad051fa6f501c50f9b699c3b69cbeb76476d202bf3ac985b6e0e968be66572893e6a744540bd9722e5c87956848629bc2559306bd113e8653d3b6aff651dfad7a3ac8b02958cba02a93ccf525757039bae6cff090e1d90688e8aa233ee86a4c4a3e0586d6b2340522e47dcb7d0046d8a5acb05a123ee25d2b230b2ada6e2e2f9ede3c05202520ec2487b0d56562529d8b3393bca76adca4ec1bca508abb001babc007915d84fe3dd14e207e3c62f8379da2a3b861fb6629d28dba53b6ea388ebfed866bf6dfb553455e91ed547ae92e9445253a4fdf3efb4f8ebdfbe7d3c78f1ee0bb9e13e358e942a4ed49e22cff00eeb35fdd7ebfffd9} icon.\par} +{\pard \ql \f0 \sa180 \li0 \fi0 {\pict\jpegblip\picw250\pich250\picwgoal3000\pichgoal3000 ffd8ffe000104a46494600010101007800780000ffdb00430006040506050406060506070706080a100a0a09090a140e0f0c1017141818171416161a1d251f1a1b231c1616202c20232627292a29191f2d302d283025282928ffdb0043010707070a080a130a0a13281a161a2828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828ffc000110800fa00fa03011100021101031101ffc4001c0000000701010000000000000000000000010203040506070008ffc4003e100002010303020404040502050500030001020300041105122106311322415107617181143291a1234252b1c115f016336272d1082443e1f1265382ffc40017010101010100000000000000000000000000010204ffc4001b11010101010003010000000000000000000001110212213141ffda000c03010002110311003f00dadd18a10a704f6a95ccc57e37750782b0d8d9ea0cd32e7c5446e07e9f4ad723119a7b89e61e348f260719278aad613cbb640002938c76a182b264fc87bd13009c0c019c76e3d68a072e1cf6f4cd502d330c28269a61bb39c923923d4fad44c08dccb95cfd28b8280769ee08a263891e1808739e4f1d8d149392172cc714050dbb9fde8960ed8c60b79b1ed44103b05c331dbdb1dc5026ac1946d20ff8140aa631c773ec738a0346a003bf93e9cf02801895e7b9a01886796c923bd0090a06393c76a0142003ce3d86680d8dd9392303f5341ccc1b3cf7a2c812c37e4923d381429757013209fa511c18146c9247a0f6a007900c0c671c6280854e086c673eb45c27c038fd68aedff2fda836ef881f136f25d5e6b7d1262964aa02b03f98fbf153131935edcc97576f35c33349212cc4f39f7ab26186dfce5b200f73451f7600dcb8cf27e7400c0b291914046c9e0718fde81371b8e7273f4ef4007691919240e714097f31f376e7b5008caee27807b0f5a02c8e1b3c6d27d33cd0201d839523144d1a149ae084b78da47638211771fd050d582c3a0faab5119b6d12f8ab1c06788a0fd4e2ac356fd1fe08754ddccaba849696309e598c9e2103fed1dcfdeadc44fea5ff00a7f956366d375e492403ca935bedcf1eea4ff6ac68a55efc1beb3b552574f8e7009ff933a927ec715bc82b3a8f4d6bba5ca1352d22fe061cf9a0383f71dea5119cc6c0baed3eaac0f1fad40897dcc3d81f7a052366c1007df3400f21edefc5008c28f30c9c5170ee4fc37830086395250a7c66770c18e78da31c0c63de8609b41f7c515c5172a30c3b76344a3e377cb2339cf7a242aea89808cce368272b8c1a2e107c672a49f5c1a181c9c7ae7da8a2119e7b1f5068099ffa68258a132062d8f9e0f34059502b61bf2824e681bb297ced2a71efda80f19c47b9c77fdbe74057c13e539cf3c1a0eeeb9c73f33405ddb4f18249c1e28062b79ae242902024465b9214614649e7bd0362a7249eddc513456e5720f38f5a1a98e96e95d6baa6ebc2d1ad1e65521649bb469f563534d6d7d31f04347d2a2fc5f535db6a0e83718906c887cbbe5a9a8bef44dce9f731ca9a2e89169d6d6f2184b1455dc07b11dcfeb4d16f119c649a681285b03d3e5500f87820ff006a0e098191de80ac9b8904647b55d11da9681a56a31f87a869f6970b8ffe4883629a289aefc16e92d441682da5b098f21ed9f033f353914d19b751fc08d66cc16d12fe2bf45ec92ff0df1fdbfb559ec667aff4eeb1a04db359d3ae6d40eccebe53f46ec7f5ab82263da7dcf3eb5174e5181076918c7de869503232491ee4515c1803824f03b51287f30e0e7d803449494832c157278a2e8c71fcb9f9d144639236824d01e142efb1768cfb9c7ef40512a818de78ff00a682518e7cc30ab9e00a02cce9953247bd41e467191ed9a04205ee99da4e4e3d283a524b0427b5026c18a8e082067db8341ce0e39ed409b6502907391edda80f2dfdc496f0c124ac6184b144cf0a4e338fd2894f7a7342d4ba9b568f4fd261f12571966270a8bfd47d8511bae85f02b47b7fc34bac5d5c5dc88a0c90ab6c8d9bedce3ef4d1ad691a6dae976a96d616d15b409f9638d70054a1dbc68ea51d4329f4619a8022b78e04548515117b05000a035c5c4702a995c26e3819f534047bcb68a458cce866719540724d02e41c0f7a012a40f6141cbc8e7bd01719e38e6838af1c0a04ca8206d3cd037bdb082fad9e0bd8a39e0718649141047d0d5d18f759fc0cd3af164b8e9999acae4e4f81236e898f7c0f55fed574615aee83a96817ef67abda3db4ebdb7f66f983d88a061bb8db9e3d45165076db83c1f950a53780d8247c80a2398f182724f1c7ad080c608cfa7a51a0062adc7afbd0130173bb9c5070f071cb37e82826106e8f615e01c9e680d6b35bc534be3c1e3831b2aa962bb188f2b71df1de819ae4b1048c7f57bd01a58268e332642ae0704f7cf6207af6a01b99e17b7b6416e227407c494139909ed9f4c0a04a4e501e0f1eb40d263e53dce7fa682c9d0bd13abf58dd6db18bc2b157c4975270ab8ef8f563f21447a73a03a1f4de8eb031582b497328066b97fcd21ff038edfde88b7e32703bd64188e7e6283864b73400cd804b67ca3268317eacea6d56ff005233592f8b6303f953fa4af7c2fa93417fe98b763e0ea171297bab98558068f695ce0e08fdbd281e5c6a57ba5e9d14d716ef7774f2ec112601da4f27ec2827ada74bab559a20e148fcae36b0f91140283729c77a0e0a7777a01dac68395719e39a029607cb901b19c501480ab9279f4a086ea8d0b48d76c0586b7143224a76c61ce1831fe93e86b43cd1f12fe19ea7d2533dcdbeebcd20b612651e68f9ece3fcf6fa5067cbcf20ff009a051724905411e94032799060723da8406d6c67e7ea68d0e1770fe5cfb5026c37039ef9a02eca098c91e6e01e71c500b1d8a49c12786cf6a06a4e256008e3d050119958007920e2801154e32fb4120927b014017eb1c523ac5209a356215c291b87be28957ef853f0d66eaa99352d515e1d190f947669ce7b0ffa7e74a8f4be996569a5d9c56b6704705b46bb5238d42851f2ac875712bc70b3c30f892019540704d01ad2669a0491936330c95ce7140b2e4939a03638c7e8680ae485e33bbe540d60d3ada162c90a02c7270a39340a4f28b68da4645007a8f6a069a746f73235ddcefc391e12b2e1916824948742c99382473c73404791c617695279dc0640f9502c578c9efeb4095cb4cb0830ba21cf999c6401f4f5a05061d430c8079a02e03b3004311c7d281b5e3cd676c65489ee594e4aafe6c7ae07a9a0a075bbea3a8ea96f047d3935ebc404f04ad29411e08e011d98fed416fd212ee5b05b4d5ad6300c615807f1171eaa49eff5ad418c7c55f8466dd66d57a521f20cbcd66a7247a9283dbe5418a63862479877cf1f6c5008e400bdf1ce684016fe53dfbd1a73794600e08ce3d6800377c8c7d6800a9cf75fd4503d91492460f7ee3d28247a7b459f5fd592d22711c206f9e563858a31f99cfd050583518ba75247b1d134f9aed21396d4669769931dc01c003f7a329c4d17458ac5b55d36c12e040a3f1da75c1cb04ede2447f7f6a94567ad7a66db4fbbb29ba7d65b8b4bd8ccd09c8231eaa07b8ab04a7c2cf87b3f53ea8d77abc72c1a5dabe2452bb5a561fc83e5ee7e541e988218ed2dd22b7855228d76a46a00000ec00a510bd4dd511f4fe84da95cc31f880022da4902b1e7d3e99ac86fd03d631f565b4ee6d4dbbc649009cab2e48c83f514165b8b94b6895c44f279c280839e78ce28178ae6de46748a789e453865570483ec6812d42e85a421fc37918b00a883924d024c6e99b7a2a966c0009e17dc9f9fed40f81c77e28139218e4ff9815b9cf23340a01c907b9140201038ed402fcafd28386464e4fd33c50272bc60032609cf00fbd024f722dc66f24822ddf972f8feff00e280f69b24844919cac9ce7de83a447f30ded823007b50459d6ecacb528349b979127651b1dc795f1f3f7a0990148054823dc5015d491c0a0c3be337c2ff00c489b5ee9c87172016b9b541c49ff5a8f7f71eb560c1fc43e0a47e1aa94277310431f91fa551c1727f29ed409b641c86e31839a3454805739c1f6a026f1fd740f64665fc8c31cfde82db79bb40e9e8f49b62eb7d7e8b717ec832c91ff247fa1dc7df2281bcc9369d671493c422b7911654c1215f92bb8827bf068624ba635392df5eb4b9924558ee5bc19b71cee43c6dc7cf34c657be8db0b0b9d0f51d2afe668934dbf9628ddb8c2b8c0073f3a80da37546a7d25174fd95dc125c69f7313ee5655dfc313bd483cf07b1f6a68d5b48d5ec758b612e9d7293211c8fe653f35ee2a084eb9e8bb1eafb3582fe496278f3e1c919fcb9f97ad03ee8dd017a6741b6d3229dae161057c5750a48249ec3eb4139238568f6a9e7b103b5037934cb3793c610a2cd9277a8da73f5140ee38f6280c4b11c65b934023006d50050030e4647de80c846de3b500fcf9fbd0197273ed4007b91400e580c8e45074a82400e72682b36fd2162b7f25ddc09af2766ceeb872db79cf00f6a0b3229550140e07007a50092db860673de818df473c862686dad6470d9cce3b7b63e740fa1de6252ebb5bd81cd00bee2d800d003a6464004763ce683ce9f1cbe1f1d3a67ea1d1a30b68edffba814708c7f9c63d0fafceaca31e6dc71e1f07daa82608c83819f7a1a11ce149238fd68d0a579ec682cfd27a7c3a86bd10bc38b3b756b8b93c1fe1a8c91f7381f7a034f752ea5aa5c5eb292f732128037619c018f6ec282e5a2cb047abda74d5ce9b6da80f136de4a496219b3e48c92000323ea73467519d3da5bb757dbda410ac90c77c23058f99007ee7ec31416882ee47d23acb5185caf8bab4691b1efe57fff0038a9457ee75a82f6e7429350466b482f2742c0f74241c80c38c64541a9cfa1e89ac0177d33ab3d8de28f2b5bca429f91140e2c7a9b5ae9fb85b6ea9b46b9b3c796fe040768f76ec0fafb1f9505df4ebdb3d4edd6e74db98ee216fe68ce47d280648f75e2485a44da385ddc13f4a025ddbdbea16a633286566ce55f9c8f6c502ad750db2c514f30dec428247e6340bbf04100b73402afb943ed2b9e30683836defe9403bc1e06734020e06280cafe8683a375941d841c77c1a0151b467b50159f00e4127e5402872371040c5046eb5aadbe9b1c02e2f6dad25b89047099c677b7b0140fe3f1010afc803f3018e68160c3041ee2823f5dba92d34db89a1d9e2843b03b6d05bd013560c1748d57aa2797c6b35bab78e6959dc47231580ff336dcfb03c1a58364b5bbb7d7fa7b7427f1f673830c8664285bd1815238fad20f2c7c41e979ba43aa2e2c1cb1b663bede438f3a13c7dc76fb5515e9065b851f7a02950002a09c51a1b83cf14176e90d3645e9ad7752752aac23b3439c066665c827e944d29a6410aea725c4567135bd840d3c88a723728c29c9efe6c50d3ee9545b0bf8ef2e6e3c2fc2c6f72f2920e5f19039ee4938a9a875d03278377acf52ddf867f036ef71923932bfe51fbd3475cdc369df0db4fb389d4ea37970fa9cc0b00511795ce7d4f181eb4cd2451755fc45ac16d637381b14ca36b641dfce723e4053170d6cb52bbb362f6d3cb19241f2b9029862f09f143549ba7e7d2eef6caf2797c66ee17fdfd69862d1a069da7dfdac579d17adcda5ea9e1a992376c4723e39e3b024fd7e94c458ac3e25dee8d31d3bae74e7b79002bf8b8549471db38f5f4ed4c165e943a06a328d4ba605b4b22a1523c420c64fbaf38a82d36f0ce7cf7463790729b53017e940e0b0ceceed8ce0500e1b70daa08f5c9ed41d271cd0132476e7d7ff00aa069797d2411168ed9a41fcc858211f73c5075acb25ca6fb82aa31e58a36c81f561dcd033d42169e158ac64b98151b3981c2966cf639f4a064c7a8ac55e4865b7d493701e1c8e52403ea3cbfda827e390ca3f2c914aa81991bd281cdacc2747215c60e0ee5c67e940cb51b0b2bcbd824bfb08ee1a252d1caea1821cfa67b1fa504982b2283ce08f518a08abb82f6dd0369a5662081e14ce40c7ae1b04fda82275cb0bfd4f4536f7114589a5412461f3e4ce4e0e060f63f6ab2893d3b4b5b5b78e22ed22aae3cc3cc7e64fad3449a22a461500007602a0cd7e3b74c26b5d2ad79147baf34eccca40e4a7f30ff3f6aba3cd0543267eb5427b86f1f4c76ef45d0eca1ad5ef224d13e1cf4fd9b22192fa67bc955f8c8c617fba9fb510d7a6ed3fd43a735e5b54964be658c048fb6cdd9e7eb8a186bac97d174e6d22e23437b7ac26b95e77c68bf950fa7279e2b22dba45b59e97a669fa4ea36aeff89cea9a90451fc355ff0096ad9f4ce3f41570675d4fa8c77da8de5cde5be26bc653171ca47dc1f6c9fed5562b97f70276808da7c24f0c1c63804e33fa8a2928c0e0383c8f7ed41d92a41393f4a2548595c2c37493db4cd04e8a08f139566edfef3445b6e7aeaf65d2df48ea2b11776ae02a93e564c772adef409f4ee8ba9a21d73a36fa579ad9f325afe599171ed9c30a960d5ba0fe2843abb47a6f510fc26a4c36890f9558fcc6783506a1147b510024e30339ce680d2c6ae9861eb9a009178a0205443b989e39cd01d8075e3047ce80563057ca381ed4011c4531e503d85013c91b804a21279c903341131cda8c3abdc8650f6d20c4321232adec3dc504bab2c113c9293bb1963df3408dd4b75e1efb2856463dbc43b4631fad047e9177ad4fe32ea16b1db4b8fe1aa92571f5f5a0916bc8e0895af5c46c17cd8c9ff7da80f6d736f7f6915c59cab35bc837238ed8a072a31c1ef4062870718a06f7702dc5b3c522ee4752ae0fa8230683c75d6ba3b74ef535fe984929149e4278ca9e47edfdab42058003763ed409f88ffd6dfad06b1f12ae612fa0c76e0b471e9916d23f973eb4158d3efeff004a984da5debc1295d8e4018dbf3145d583a2ad96f356bbd7f5d90dc59587f1e79a6392f28fcaa3ee47159444ea3aa5ddfc7acf50dcdc344d7a4dbc317f52641200f6000fdeb41b5ef51d8eab672ffa9e971c97c11638268e431a46000012a3b9a351567db823b11f3ef40948e428048207a8340ab48ae83cb83ee0f3428a982719edf3e68c9cc97d3fe15ad8c9be138f2bf38e7b8f6ef40f7a5f55bdd3f56b46d3649127f1405f08e7249c76f5fa50689d48ba5f545cdcbdb462cba9206411b2b055bb07d4fb1c73528d4fa8f52d62cf47b6b8d2e65fc458c49f8a818795c151939f977a823ba0fe253750eb7fe937b04293f9f6c90be41dbdc7ff006283473c1efc1a06f69776d73bbf0f2aca32572bc80470450284a46dfca19f819f5a04e799614def26c0bdce09cfd85045dc75769d12dc3c3e2491db0dd3c85195235f7c91cfd066ae0cdba9be31f4ec61a386c1ef9d4ee473e45cfb1cf34c101d3ff1ac9d481d46c628ed24751881880833f988e7b0fa5328dfed2f2def2ce2b9b79925b791772ca87208f7a60182ee2b95cc0c48f53823fbd40ac658b30f4f4a086d4ee1d75bb6b78f4e965596366fc5211b23238008fde81f43692da5bc30d97831a0397dc09e3d714087506bf61a2c4cd77324726d2caaec141f9fd2ae0c435bf8c57173ad7876f7a2daca10489121244cdf319ce3dbf5a834fe81f881a6f57bcb6ba7c53c72c11873e28cee1db391dbef4199ff00ea4348116a5a66a8a8a04aad04847a90723f6ad7d18c312ddc02a3815423ba0f63fa541687bd9efe1b533b3c9e0a78473e899e318a09bd0ba6eef543e3b2bd8e9b10064bd9e4da001dc81401aeeb29a984d0ba7d5e1d06d4e6594f06523bc8e7f5c0ac8af752dfc17d7090d9218ec6d9447129ee71fcc4fb9cd6842ab10dc0014f3e5a2c1704b671dfdc734525226dc939e283a362c7f940344a380393df144733e2276e38f5efcd01b4bbbfc3dda4a9298a44395902e4a9c70682660d4265d62de40b1bdc1545054f95c8fe627df141af7c3af8808f3dd68dd5d2a45765884b8908d8c3b6c27b7a77a945d7a5fa474bd2ba8e4d5748b28624955d5d8b13b79ee9e983d8d40a753758c7a46b96f6114725dc92279a2810b3a64f94900763cfafa503fd3b59b79ed84da34713c0cd890f0a158fa1f981de826e1b548959fc4dc5cee24b6467e59ed4101ff19e9f676baa5d6a72c50adb4ad1ac790ccc076200f7ad41e7df881d79a87576a5f87b0f161d381db1c2a36e7e6d8ff3416bf87ff082c6f208ef7a82f22b9761bd6d619785f6dc477fa53705ab57f83bd297ceb1e9caf67708db9c4526723e849e3e94f212dd25d117fd29a8c09a76b534fa39cf8b6b71ced38e36fb73417f52e64548e34007e673e9f21ef590a1c918c90718dc281a69b68f67118d9da5058b798f6fa7fe280daadd1b2d36eae70710c4d263df0a4d583cc7a668fd4bf11b5837d7c93dcd9a3146959822a0e781f4cfa55161e9dd7fa67a4f55b9e9aea3e9f81fc09ca0ba118998fcdb2338c7b528d39f4cd2ba76e2d357d292df4eb391809963420ce1b1b576fa1e7359119f1eb4e17dd033ca172d6b2a4df303383fdeb5c8f2eef3bce4e0e335684cb0c9f354160d36f64b0baf16072b91b5f03391f43c51aab23a5debe91c4fad4d73689e6fc3a290573ff4f03e59f4a3280d67581ce916567f84b58ce0a1fccec3d58fa9a084de08c90464e4d1a8e419059b201f4a05630a176918efc50176293872c17bf14042aa0125b03db14046c60b60123fde6827fa0c68edd5365ff11346ba6292ee64194240c807e59a32b7fc51bfe8bd5ed5db424860beb62b89218422ce09c11c01dbbd0660ae110bf1bf2154838dbebfefeb41a8f4cdac7f117458f4d9ecd2df53b4cf81a822808c47255c0f7c8e7fb54a2ec2cfabba3b4b4b8d3af12eedad40926b0f070a13f9b633649f7a82eba6ea4357d321d4ecad512daf20df26e016507fa4fbfaf3e98f9d067dd2bd2faac9aa4d72d72d1e9510ca46a7631c7a320e18f1dfd7bd059afb7da816d23de4ba5de211346a1e4785f190548e4648c63b64e6b43ce9d5baafe3b539c5b452dbda46c638a167cb281c73ee4ff9340e3a3fa5f5aea4ba58f4bb57dbfcf2b02a8bf7f7a0de3a5fa0b50d2a2d92eb3e048c0a97c867dbedcf6a944e5cf4f6b76d1b3d8ea42795066266c87c81c65b9cfaf15048e83af3cd64abac08edaf01546c38dae4e0657ee6826e5b892de3702292e2545ddb55700fd0fbfca81c4b3bc718716eef9eeaa402280d14ab3c0b2c65c06fe571823ed40df56b217fa6dd5ab9216689a33f2c8c558307e83b8d77a37aaa7d22f2512c28768800c9954671b3d33ebef568d0ef7a7749eb0b5bbbb162d657b32b46d2e1564c8ed9c5644d1b0b9bbd261d2a440af6cb0e2e5b1e7dbc1238e0f7a0375b696daa7496a3a4dac8a92cf078685b271db04d391e40d5ec4586a1716de2a49e0c8c85d3b120f715ba1899173ff305413070abd89cfe9f5a2d3ee9c8639fa874eb6b804c52dc46b20c9f302c3bd11e84d47e1af4d5dc6521d3e3b662c19a58721ff5a9a321f89bd27a374b456d158dccd34d333332c9b4b2afbe47a7cb1f7aa33d2bc0d8c0f1c8f6a2c14b6d501b39cf63450897380c319e3de8065031c038f7ed40d8faf1ce41e4d004876a8dc3cc7e743025c956c818028c904579e7f0e15695c9c0541924f6c00283d0bf07f42d6b48820b8d62d20b2b58d656404959e52f83c8ff00fcfafbd4a35bb06f12391a48dd55cee2b2f3818ed8f6a8158a159890f02242079147623e631c502b0db436d1ecb7458d4738038fb0a087d6eeb508f48bb7d32d95750752b6c26c905b3ddb6f61eb574794f5cb6b9d0fa9678b512b25d24bbe52b8c1638278fbd582c57ff12afaed45b5bc0d0d8a8c08a2731ee3eec5793f40450466a1d59af446293c186cd53ca0c36eab93dc649e49fbd048e89f1675ed35e301e293919dcbf9867b37cbe94a35fe94ea4d33aba6824306dc48015750d86c6e247b0cf63591a40b8dc23fc30f14138dcac3000f9d03687547f12e8dd5af816b13148dddbcd29039c0f6f6f7a0eb5d62caf5636825db70c9bc4328f0dc0271c8a090627d3073ce681acf6505ccf14d35bc2f2c2731bb28254fb8a075144a83ca806792400334049ee6281e2496408656d880ff0031f61fa50446bd76058ea1b9e21025a3bb48afe71df9c7b71de9c8f196a0de23ca7b827d4f7add117e0cbfd4b5059392369663ff004e71c51aa97e8f555eadd258f2bf8a889cff00dc28cbd0bf123a926e96d163bdb74490bca2321c678209ff001591e71eafd7a7d7ef45cde2c20aae144638033fb9ad2e1b5e69d058da431ccf21d4a5c3b4631b62523807feaf5c7a50222f2d648c25f5aeec8c2cd19dae3d3e87e944d3eb7e90d425b49ef2292de38224f1505c3f8724a9eeaa7bd0d57a60406059436306868a7803839c7ad1a158039c13f4a33a716767f8cb9b6b55e1ae2458813e9938cd07a9f42d0b4de99b4b7d1f41b58ff19b03c93ba06607fa8b1f5f619a5b8266d74a65d42da6ba90cce996dcdc8c9fff006a5a2c2635083b05ef83eb5028076341db4b1ed9f7a04651fc41db18ed419d75b744dbea335fcb0db0335f2057901c05da73c8f9d5d18a75174a3f4c47335e35da4ce418a489374254f707d463d33565d1529b569a489a17944b06ec8057d71dcd037b4b6b8bfba31584124b27e62a8a4f1ea68357f83da7ea5a76bfe0912453ccabb49194653cb60f6ce3dfda983d196cd108c2401711f9768e306b2297d73fc6d02773a8b591922693c5004bb9d72542fa2f6efde8314ff867aeeec27500b77bb5670e36ca19b1dff2e7f2fd2837ce8bd5dd348b78b552219022870d9c46e792a4f6c608a0b846c8e03232b29ec41cd0199f1410fd4b24b1e8f712c0a5e4452d851e6c639dbf3238a0afa42ba77475e4ba8470896681da45180b18da76af3c9029c8f26dc1df2b9c606e273e86b743331924f27f4a82c12280e59b008e79f6a2d4d74188ff00e30d203a82ad7519c1ff00b860d11ba7c5e86c9fa3afae6f4091e043e021270b21e01c7dcd6479ab4dd3aeb56be4b7b184cf2b301b57d07bfd2b4bad0fe25e9f6960ba7c7a55ac50cd750335ccaade7723b83b8f6e38a2207a5ba4e7ea3d93780cb616ca53781f99fbff009a0b675a5be9765d43a75a6ad3b25adb4185429b831c70303dfdfd2831eb8954ca48f3827819c71ed406b2b1b9bf9a5fc1c4ce2253238047957dc9345d122b792eee522811a495ce1157b93ed444ff0049f476b1aaf51c761345269d25be269259570c833c6077249e062a68f53e8ef0da69509d4ae225b92a04af232ab16f98cf1f4a5a266d4dbca8af13a329ecca723f51502d14f0cb9f05d1c8ee01c91f6a0393b4edfe63c8a031608859b38f97340d84d04e5846eae50f9829ce3eb400fb24466041f5e3d2823f56d22db57b192d6e61468a41c823ff0035651916bbf04ada7badda5cad6d1b72c09dc33f2a6875d25f0865d06fe2bc6d4c4d3282026cca8cfafcfd29a34cd234a10c768f711a78f1bb392a3001208e3ec69a26a58d640c832091c90706a084ea1d3eeafdadf4f86da3166c0b4b397c18f046140f5ce4d04f4702436e91c28a9122e028ed8a0a9f5a5b6a09a1bc5a135bc72cce048b3c5bc15c638f9d59043fc2db997481aa69dae49e1cb6bb643239211939e467818f97bd305965ebce9a10bc8da9dbaa2679dd9ce3d8530572cfac87566ab05ae9f1490692b9696e1f833738555f96793504df5f25945d2576b7ec16dc46792381c7b7ad5e60f234980e42f6c9c56a82ec3eff00bd4124e49700f1c646e3cd169ce9575f83d52cee324347323f6e3861ff008a23d47d4ba6a75074fdcd8ef317e2e2ff0098bdd4706a60c3f4ae8cd5f44eb8fc3e97248a638cbc73bf90483d463b373e9574685abf42a6b5649fea72bbdeac4a8d3b018cfae31f7a6895b6b29b41d30d8e9f6bbed9213e1b7a994e724fcbb5064bd7835a9752d3af75d8116354778f660788cbd9483dbb0a0cd20b2b8d43528ad2088bdcccf854039cff00e2827a0d34e9da1de896f2182492efc0976f998aa827d3d334113a74aa9a9298628e74570478bc0c7cf1da83724bb8246d3e6416b0384da61b5501c9f5c3704f152c037561a95f5fce61d3ad6db4ab950f34b331dd9f4191db8fdcd406d67a675ab4b6d325d1af248272a43430315ddec7038f6ad4b3f448bf47eb71cb69abddebf21d5e26896203846c30c8603b9c6452d9835901405660376319ac84bf13180779d8bb82827d4fb0a06f777367a75acd7170f1430a9f331200cfceae061a0cf6dac692d7365266191db0578f5edf3a6075a6c9278b3433188a467860d96fbd40fe540471409aa0c1140750001ed8ed4058e15133c983960077edf6a06faade5c5b7822d2d926766cb967da2341dd8f0727d85033d27597d62e2ee3163756915bbf8799d71e2f19dcbf2a092b88dd9a311950a0e5b70ce47fe6ac18af53f5b69da9752dd69da9ca906876e24465d9e69881c6ff005c679c0aa2bfd267a347512c93dbb5d42d90d3c800b68c9ce0ec3cfa528db74ad034db5905ee8be1ac728dc153984f3f980f4fb56453be2de8f647a6aff53796596f0aed46798ec033ce149c0fb0ad71479c9bb9dc3bf3c55a0b95f65a825150b481a407b93c0fda8a29c06671dc93803bd131eafd0af6dffe18d2ee25982a4b04603b7a9c631fad03bbe586381bc5945b96385718c827db3eb5288eb8ba934eb15fc3c535f05427796dcccdec7150637d5bd55d5362b7975aa4d0d919018adec8637807bb60723000e4f7cd58203538aefa8aeb478a7b9beba924547b8774cf8608036a80704639cf1f9855d1a7f4c68b67a03de5e5d59dad8d988c62e1c0f107a1e7fdf7a082ea6d07a6e3e99375a7cb6b3db093c727701e2360f7f53dfb50653d4130d42ee18f48b3f0232a15218936963ebf5fbd06dbf0cfa74855b9d46e04b730c6144691e12307d33ea7de8348ba6b5478a279a004f98c479247b81f5a9438805ac0be2e02e73c9ef8fbd40c2346d43578eefc40da7da1dc8b8eefea4fcb9fef419beabf12a4bcebcb2d2fa7ee0dc58492084b30236bb6467dce383f6a0b87556a67a7f4d95a0bbb5468816f0a69c78b2e072572719ce78357079dfab3af2e7a92c963b88d94abbbf91cedc93edf418aa2c5f0dbe2a6a9a0c90d8de34773a6a8da1186d6403fa48fec682d9adeb7a9b4c9d572dacc9a6c9700456e5ca910e000ecbd8e580352fb1ae7476bd6dd49a325e5a9f3025245fe961dea097523cc0919a032af039a006936c81423104649c703ef40dcce64bc3035a87b6f0c378f9fe7cf2b8fdf340a4b6e25962915d94a67807839f7a043586922b5636ec44c061063f31f6ab079d7fe19b7eb2d4efeef55d5d74f992e9a0fc3a441dcb13927b838c9aa2d4bf042c618e178efee6e18104870172318edf5c1e6945bbe1a748ea7d2315edbea3a99bcb190030c401010e4e783ee0fa56455be3d6b90c1a6268d69e17f1486900ee98ec29ccc183119419e7e55ba11f089f523ef5058363a8059fb8e31e9421b491056c01819e28d3d0ff07eea3d53a1e3b6b8db235aca63c139c0eea68ca47a9fa6ef757b83ff00bf68ad428c2f248c7a8f9fcea518df516adac74e7544f63a2ea172f1800291e6cee19ec78cd5826344e85b6bad25ba8fade5b99dae0ee11efc71e858f7e7d054a2d7d39a75ae8f7b6b00b8917f1516624b78429da327cec493db1db1d8540cf4aea28f58d6aeae2f6dd64b498082d880488d149fcea7d4939ab04175e6850a8d32de3b78e380c8de32c4db4e18e430fef543cf86fd0d691b4fabdf6648b3b2db69ce7dd87be68342d2f4fb9b5b891af1a28a2dc05bc5036d001e0eef7352884b961a2ea9aa7555c885e08d45b5bc52b61b686c120fb939fb541276bd4b61d53624d942e2f6200bc32290633e99f4233416dd3ad3f0d611c0c77b632e71dc9ef41156dd27a45addcb3dbd9c513b1dd941821bdc7b558333b9f873757fd69a85e3f813e9c7723b5d93265d872473c11544a68ff08fa75e290b42ec4e4124e70738fa5048e89f0f745d2aeadd2decedda6525c975121183c77f7a945c754d0e0d563682ed43425369403bff00bcd58308ba7d5fe13f5a05889974a9d8b46aede4914f707d88ff001528ddf4fd7edb54d1a1d56c312dab2e64dbc9418e78f5c541296d70b716d1cd6f8789977230ecc280cb7519b816f212b205de4e0843ce300f6cfcb39a0545c42cee88e0b458ddec33ee680eac92266360debc7b5056fad2d354b9b189745744be121daf27e550548ce3d4d58324d07a725e98ea2b7ff5381f5169a7579d021fe13904ee43ddfbe49038ab46e76cf05cc714f6d309232a4a98ce54fd6b2196bb7f2e9b631b2c427b891b6851db3eff002007341e5bf887aa2ea3d4f77378be381e42fdb711ed5a1554395caf1cd07617dcd04fc85402101da791421b49920331381c60d1a69bf02f56f03a925b12c162b98c955f775e47df19a32d99b518268e4491668704a79d4aeec7b7bd4a30feb7e9144d76e265697c3e2693631674273803e556087d76f35fd49859e9925ccf611141106f2e182e3241f727f5a94681a268f79ad1b1b8b9dd66b1c2b1ce9bb06361c1e7bf3fe6a096b0d3ba57488e485b52b40909c386901607d47bf7a0ae758eb69ac4d15be81a748f0a9c35cc90b2eff4c03c1c638a0b77405c5d5d45f87be5fe359a88b81b401dc1c7d38fb50586fed18ea3015790091591e447c1518c8c7a0a0a5754d8c9d49a8d9f4ee9dba0b3b5224b9692327728f627e7c6682f9a7e996b6b3a8b6b748a348820c7720761412c064e3041ce282b5d4bd73d3bd3f33daea97ac2e540dd0a292dc8cd043c1f15ba2a7923b65bb910371b9a12141f9d02edf13ba2ade56857551e5e77244c54fd0e280746ebfe99bbbd655d56dcdc9ce08465565f4ee3bfca82d53eb3a6dac3e25c5f5ba646402e33fa77a0aff5b74ad8757e9ca972844aa37c520fcca7d3f5ab067bd369a8f467544d626c98e9f7118f0200e4465c903049c8c9e6ad1b24334b6fa6249716cab20037c309dd83db03b5640dddac3764a4f02cb1103863919fa7a1a06d6f600c37162911b7b252b87dc773f1927393f4a079f868edae1ae6328a8b1ed38e30050226e85d5dc1f879011b3c47c2f604719f9d01eff4f4b83e3c6b18bb452b1cac9b8a83de80b16e8208a3b7b58e1407cc061427cc0ff1560ce7a8f592d69a97504cad2dac01a2b53900c3e9e51ea58f727d0551e73bfb86b99a49a46dcf21c96340dc13804f20f6f9501c0e3b8a0963316fcc4607007f57bd084d64dec01200ce483468ff0040d525d1755b4d4206ff0095207c11dc67ff0019a18f56584f6daad9dade4211e39104a8ded9152b235cd8c530613229c8c1c8ef50472e81690ee00322b0c100f0debdbb7ca8111ace856371358cba85aa5cc407891ccf83f2ef4048b4ad2e59bf116769672c72f99dd1437239078e2824a4d3e1b94559234110e781839fa0a0561b38ad532a12319c86c6307e740a9732a3a00cac870cd8e0faf0681be8b6db965bb909df3c85806eeabced5a09523647e6e0fef419a6adf116daf7ac34be9dd1da686e7f1ca2e243b76320ce57df9ff1560cc3e3f470ff00c78255b842b35bc6c4af9b6e323d3e95467b6365f8dbcf062beb68c119595d8aaff6e282422e9899b4f6bb5d46cda2562a76316c1078f4a0859e1b9b762c0bf94f0e84feb4125a57505c58ea70dd5d0174a986d92b1c13f6f5a0de7a5be366877260b5d42dee2d2423124a487507ebdf15289dd3fac7a7bab6feded74d61733473acdb5a162142ff00313d81ed505fa58fc6d809380c1b9f5c502e0e05040ea367a85dea454de2ff00a610375b04c16c7a16ef8340b5f6930dce9375636acf6a278f04c5dd4f1dbf4a084e91d06f3a52dee62bbd4a2b882494ced3c8a448063b63b638fde803ab7ae749b2b3096d792c93c8c109b55dcd18ce3710473ffdd043dc758dc5869044565aa5dda4c3c2b7bc78c1f14e3963db03e7c0ab066bf1327d41ba76ca6bc48ecad24c456f6b0c87cf8e4bbfa138c0fa9aa3297c83dd4e28395811cf2680a5b93c7ed413cd1ff0f3c797b8031406645236b0508406f30e68ba49c051b97d0e0e7d28ad57e19f575c5be8f269515dac772877c11bc464dea7ba8c739ce78f9d3193bb8ebfea2bcbd6b5b6b8b58bb7f13c2f0ce31cf0deb4c0f2dbad6d743d2ee99efae752d6c02a86e0054524f6383c7ff94c0b6af274c75149a46a5a82c46f1e1479fc3190bd8156fbe7f4a960bf74e9d253f1167a3ac09e0856610e3041ec7f6c540f67b892cee7f8d18368232ef2af2508c7047cf340ead5bf130accc9b1186541e723d09ffc5033bbb1b82d74d6b37f1244daa1b38073df3f4a08eeb1d3b50d4fa6a5b4d32f12cef1902ee73e523d476fde8306eb0d3fabfa4ba92c278af67bb7281606472f90bdd58558253a6afb40ea1d62283a8b461a66a6f931cf6a7c2466f7cfb939e7b5515fbed3747b5eb8f06eb78d35080a2ec9719c76f98049a0b4ebdd37d1bad869acbf0b03c5c16b29444adf50ded41995f68564a263a66b31cd02be152505493f51c1a088bab69ad1bc179e320f07c37c8a0692b46c4995f0381db39a0b2fc34e971d57d4705bc8db6c50ef9dd97b81fcbf7381528f5ae97a1d8e996d1db69b0c7648855b10a81b80f43c739c54134147b9a036063279fb5046e957726a0f2cfe04915b06db1788305ffeac7a0a00d72f8d9c491c06337533050ac7185cf2df6a06da2da4293488f34973328c34aea428c9ec3eded40ee7d2ad249448f6b133820ee2833df3fde819ea96897461b05b87815f2ee919e5d47704fa039ab079b3e326b70eafd4ef6d6650d8e9ebf868b69c8247723efebf2aa280eb9193ebedc5002a124e015340018fb8fde82cf32b1603d0678cd02406dce3008e47ce81b499c331383c9c9f5a2e9c69377369f7d6f796a4acf148acb83fb511e91b3b3d0bab745b7d45acedd8e3732b71b1fd73f7a5a19eafd09a56a0a96b1c705b49c48510761ce4fcfbd4d0d752826b2b583476fc3daacb295b79d768de8a32b1e71f989e49f6a7d14dd1af5ba275a45b8b093c054492ea769092373765c1da4679fbd306e36ba9595fe9f0dcdbcc92c33e1579cf27d0d409ea178f68521b6b76926ee8a7853f7ff140bc768d78f6f73748d1cd103b543f0091cf6efc502f7319dac194371d8b6326829f0c501d7ae6fa568d5d4942c806d4db81839f53c8cd59456fae6e628749b5bab8b1865b08e4726588ec11e7f2e49071c93da9a31dd4341d675e9a5bad374f9858162d0b4ac70e18f0573df35a0c759f87bd53a404f174f965dfff00f479b1ef570576e34bd4b4cc0bdb3b9b7258a00e846e3f2a94376475cee4914af7ca9150685f09ba61efb52fc7dd69bf8eb7c158d1d0b47bb38f37efde968d6eeb4eb5e91d6ad25b660aee59974db6881690918e31ce39279e062a5a34bb57b88adedd1e379679065d80036679e6a07e8391bce7e940c659ef5afe1286de3b16f2b8903094b7b2fa7ce81eb380c4260ed193f2a0cd6fa5d4a4ea0fc7bdadcce923158a3039db83c038e3ef41a0e96b2ad8a35e009291b8a939d9f227e43bd590436bbd6fa269202c974b7123602c76e779624e00e29833bf897d493e896525dbcb2a6b5a9c3e1456b91b6d60cf989c7f31f7a60c02490961ebcf3eb541308e39e067b507007b96007a67fb50178f97eb4165ce18165c2927b773fad023202d9c8dbb7818ff003408300b87f2f1c107d0d0c15a4f2e339c90467f6a18bdfc2cea8ff4bd561b4b9ba686d6e64552c4f954e7d7e46a60f4688d240af1b2bc6cbf5047ca960617ba658de1b792f2d94a5ab33461b18524633fa1a81b5c8b5168967369d23c0e0a24622dc981d81c76aba29df0bb48d660d52fceb88d069f04aeb69130037127f37b9c0ed9a8350781240bbc06da72323b1f7a0eb8816e633192ebc8c9472a78fa50349b4c83c068e24f0ddbcc1c13b837be4d055b57e98b996d4db5b4a893dc1e6620b6ccf2c467efc504ce97a38d3f4d874bf09af6d46e2f25cb82724e791db15650a43f878b51fc34f3da8f132b6d6a98c80a39ff007e99aba249631b58b9047239ec3e55368aeeb7d2da6f52c0eb7f16e87f2c6e836ba90724ab7a67b55d115ac7c3e8aed2182def4c56a14096368959a423d77e3229a27b41e9d8343b01069c8a8dc9660aa3713df3c64d4a1c695d3d6b67a8cba94b9b8d4e61869e4e4a8c636a7f4afcaa09a485519caae19b966f7a0435196582c656b74df3e308beec7b50629375775b691ac5bdb6b16d6378779f019b00a31cf391c9c2f1daae0b35ef52f5374de88d77aa45a6cd25ddc0108694ee2188c28007603d6a0d16c92430a4b2ed3230dc401855cfa0a0a07c45d7b5db9d462e9ee960b14b2ee134ef8c850012147ec78ab0670b643a2efae753d72686e6e2da211db42176079c8e768f65e39f7aa332d6f58bbd635096f6fe6692695b24f603d801e82823cb900ee00e68006460051dfd680ed9f0c905b713d8d006d5f5419fa505a18f94e40501b1b81a04186d62402c87be3d6810b81290aea8467201231cd1749dbc437f9f1e201db3de8ba07dc0175c027f28a335b17c26f888d6b6d0e8fabf892a29c453b1e547f49f7a946d6424f08236491c833ee0835073294888894120700f0280813c40a6711bc8843e00fca7d3ef40e41dc081f9a811681c6f7565329185623b7e9de812b3bcf11ff0b74563bd50494cf120071b97e5fda80d7577046c9019d5669dbc340324eec67fb734103d5da96bf67a7cf0e916f6e2765f25ddc4c11107ab1c8c647cce2816d3ec7f0f6564cae6e67da375e6d52cc4af2e4fb13ed4145f899d47b3499f4bb6d46cda49b69b92921565c3648e3dd40c81cd5c0ae89f13ec246d3e379ed2d6da180b5d34849da1780b128e49271c9f4a60ba685d5fa36bc42d95c324ec7090cc9b1d87b81ed50588958977cacaaa3b9341c655f12348d1dcb8dc1946540f99a019e2134454eeda7bed3839cd052fe2136b536b5d3563a1ca53c49da4b9507198940ce7e5c9fbe281c6b7a974cf4ee4ea7242d76dc784a3c595b3e9b464e3f6ad0ac745ccbd4fadcbabea42da56959a382ce7460d6b1a93c01f97272093ebf6a82f1ad6af0e9da5cb3cecf6902216919f82aa3818c7a9f4c530649a9f5269ba7429d472239bc991a1b0d3c3152880f0f23039e7bf3de90635ab6a377aa5ebdcdecef2c9239e59f3827e5ed54302195fcc38cd01245395c1f5f4a05b606538e483c501b6939e3b5077860f3914165754c33e549000dbe87de813b820c27fa7baafb8a04a69c98e281e42618c795338033df1f3a06c03e4e029247007ad010093c35674da71f977640340081a190658e41c820f141b0fc33f8926c218b4ed609366a02249bb2d19ce3ea4528dbece68eead926b7916689c643a9e0d643387521fea2f693c2d6efc786ee46d9bfed3eff2a04669edf5295ff057a60bd865309246d3bbbedc1efef41d63a8dec9ab4fa7dd4510fc3c69234ca186e2d9c003b7a67bd034bad0a5bb96e25d575267889cc1b54446d9bd0a37bfbfbd02925945a72cba8dddc48b3f87b1e58f23c623f292bdb7fa7cf38a0a5750f54ebba56a9a67fc516b6d6fd3970ea9234677c8dc7f38f6e4640ce282d1ac4b16bfa72c1d2bad430cd1ba822061865f5007d3daac19cf547c189357d561bbd3eee683c62cd786e9b73337b8c7bd512bd39f06adedec2de0d5ae639da372e6485363107f97767b505cee755d03a5e58ac228659af123184b7b733322e38c91dbf5a943ab3d52e64b49ee755d2e64950e238e35f10c884e17cbe87dc540e6d7509a4f110e9f7566a471712850abf6ce463e6280bacea36fd33a4497f773cf32c698dcc4beee33938edc7ad05534aea683ae61d64c4d2a69b6b88d16d5ca5c303f3e386cf61db140e27b5e99e96b64bdd562b6b30aa36c6c37cac7dc9eec6b42c1a66a962fa70beb6b516d0cbe76322f86c78f6c66831bf8b5d5d2dfa35a5dce60b1933b6ce3c788769f2b331ec1b8fd2831b79649984b239773c1dc68129725c1c640e73400ec781d8fb1a03c4a85d0c8582640257bd01e51fc42236263c9c67be280429c6037eb405dbf5fd682c2a0bb976cf07d3fc5009279ef8ec4e68193a9902b28e7dc71fb501d95b098e0f6dd9e0d0049131019b047b8390281bb292484e47c8500c4f242c3076bf704704739a0be7c3febfbae9a5daf23cd017c7e19fb107bb67d0f6fd6837cd2757d1fab34f4f05e37dde630b1c3a91edf4f7159103d6eb7da65fdbdf59dadb5e2460ac876ed9e1c8c060f9efe9c8a0a75cfc42d5742d2ee5a7e9dbb494b6d6b9bc930cce4f940e3cd81ed4160e98f88315e689fff0022b57664199cc5196f0c7a164ef8f98cd0589baffa68590985eb15c0db1985839f6c2919340b69d03f5285bdd6f4bf021424db4329cb153fccc3d09c76a090d3340d2f479a7bab3b38e2924e5e451cfd280d7dafe936f6c5e4bd89813b02a36589ce318a0358dc35cc4e17f9bf234cdbb78fa0c607a7340e6cec20b1596610c6934b8323226379edda81da8dcb9ec40a042f50b5bb21645473b58b11dbd7bfca8304f8add5d67a9ea8ba5d8ea72c1a4d8a952f10f2c920e368cf71e99fad5833dd0754d6ed66bdb2e9a91a5babb2a310465a57c1ddc1038e7bd5171d3748b8d46ee1ff005298dc6a764c27d4eeaee7fe1c01795881c9e7804fe940dbe287c4b6d75a1b1d1c986d62277c91bf131f4c0f6fad0663737135d3b497124924871f98e7803007d2811dc5b83903dc0a0333f03be7de8122df2c9a05a11e5f51f7a05ce7071804fca8033e5da0734020b0183bb23e5416269577ed0e5323078ceeefdff6a03dbcd62914c2f629a47c622689800879e4fbd046f9d8a2a03e31385c0e73da8b83ca590947dcaead8208e73da8849b3e19ce704f7c5015586d006431f5cf61f3a04ee586ff002481c8fe6191408f0011eb8e30682774dea9bbb5784492ca6385832e1ca95e3d2834be9df8c312e2db5eb4375080337000f1303d18763591a469baef4d755989ec6f6dae5a23e20b599406dd8e080ddbed41272f4dd8caf1c86d163910f9595882a3d718a035edd695d3b6a926b57d0ac65b10b4e06eedd863bf141077fd7af2782bd3fa26a1a8891d57c630948c0279393dcd04cf5875258f4de9f0cb7b7b6d66d2b81ba752d85f5214724fed41036bd79d2fe319d7a8f4b9c81e58de2f04827b9ce09a07a3acecf54b790685ace8697606009e52c377b7f2e682b097d7d36acf0f55df5edbdc0977412468cb6ce3be10af3c63b9c8a0b0751f505be9690dd5d752436f62a3fe4c6448f3b7b0c64e38f615734651f107e3045ac42b67a7693018633b965bc1bc838ee173807bf7cd33065baaeb1a95f2c11dfcd2bc51fe48880aa3e8a062a8b059f595df4ae9a74de9e9ec499d43c97b1427c6e47e525bb63e4282ad3ea3712893c599dbc4259c1627713c927de81043950df97db1406da8411c92063be280230839627078e79a0390a71b5bb5003a8c1232338e4507025573e9fbd02a0e41dc0e680c3691cf714053bb34160895dc16f291d98d02322aa39f3e14707ffaa06f202a5bb0c7201f4a343aca51090497efdfbfce89840c8db8e46573923ff14410b00490d9f5c1a0425dd8ce4673e873cd0265e4dbe7041ed814009b8cbb8e5863bd07163b7716e0607b6698060b96b7b9478dc8643918247ee39a60b7e97f133a8b4e0c63d4ee597380923970a3ef4c0e13e25dfcfab457ba95bdbddb212016501867b9cfbfda982f907c74b282da34874a9048aa479c83838edc62982b7ac7c42d235cd67f15ac5b40c366418a2cb0c1c81e6f5e31db14c160d035de8cd4a3f18ea96562cc37359dfe9cac887fef039fd6b39446f56ea5d13a9dca4579a922496b1975b8d22dfc3566cf9557230703be715ac1431d4d2275325d7fae6b4f6f182a93ef1e32a9f41938f6a60afeb1a95c5fea53dccf772cf2c8c489240031f627e7565c0d67bbf160487c1801073bc0c31f91f953420f2bc8c7c52cc540032738a809905c0f4fa501940208e73df34028e703938a0577ae013f4a001300db4f03b71407461ce0502dca8c9c7dcf6a003fafcbdcd0070bc1e0fd734070db467b8a04cb9c9e68274b93bcb1daa40200ed4099765249ec476cf340849b8b264823bf34689ee009cb671df1409bc8e8b8e770e3ec68984d9c953cf97be2860b248caaebc107dc67f7a184c31232db88fd451031ce50e76039f5c8045026efb8f93279e0fd680b239504f0483d88ef409ee25bb90c79c0e050151c6e21b39ce783eb40adbcc2cefa17bdb61322387781c950e3dbdf9c8a066f28790b22e013db3dbef54726081e63c6460d34191b1bb0720f634060e7600412c781502409c8e3d7b500ed71dbef8ed40243f181c0a02e5d4e0fad006f644e4819e3b501f7e3049e7b501bc43b4e391da80558003392d40a23305e320d02e64cf998e1bf5a032b0c927b8e68049c8c8e71c6280377043118f4e680bbff00de0504ddbb3128371c1c64668024e59f3cd02521254e4fad1a2107e48fe6a6809ddb9e78a029e1463d05027ffc744a6c3857c7b1a205ff00e637fbf4a02b12b1794e39f4a02024e7249ed409924720906800005173fd7404989698ee39e4f7a04cf723d07a501fff0097ed406ffe36a018ff00281e99a037f4d0731f3bfd28007e53400ff99a810248c0cf140bc60123233cff008a0557f9beb4056eff007a07109243e79a03778b27bfbd02b128c27039a054001b818a06609de793da815006070283ffd9}\par} +{\pard \ql \f0 \sa180 \li0 \fi0 Here is a movie {\pict\jpegblip\picw20\pich22\picwgoal400\pichgoal440 ffd8ffe000104a46494600010101004800480000fffe0050546869732061727420697320696e20746865207075626c696320646f6d61696e2e204b6576696e204875676865732c206b6576696e68406569742e636f6d2c2053657074656d6265722031393935ffdb00430001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffdb00430101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffc00011080016001403012200021101031101ffc4001a000100020301000000000000000000000000080905060a07ffc400231000010501000300010500000000000000060304050708020001090a11153976b7ffc400160101010100000000000000000000000000060800ffc400261101000102050109000000000000000000010200030405061121b33134365154717475b4ffda000c03010002110311003f00a90cf388f366a62aa720ed6ae07f96901f3831d973452b8cf36fe3570fc908e46d466433e5dd954f2e96992d9e498c7753faa44916e016ca91cc7d88b38fe60a5b97737defcbcc539c98d336a57f4fc2ca9a486bf07ab575ad9a3af4df221d8215e36df86c4504ff0024574551b3d687ee0575757b3ad64e311ee62bd94158d37e24198c43973099f1fc0c41614d950246513a081abf76cfe7061f6863281e6352fd1670949c148dd6dfb0d25f5b3689b1d5c965b0eacbf4e0932ad28e22ab9ae945633f4744bd3c8cee0a7fdf085b9000f449c5f7afa30b83e0b6fd7b0c8429c9467ff9715347c891e25fa24a205861aa715e6a09bd0488237dc2723414d9891381524e8ca7c0894664f835653631ab55ee7e3de433e4ff001b30949124e4c10c8b6ad0a479b3f9c937b2cf5bc0095ad600a0a41a0e9faee174a1c605e161c6c7a313539650b0113190f1a8368e60d5b24f30ff008ea7f0bf867fa6595feeb6978f1fe0f9c26177f4d63a51a9235184750e7d18811339cd000000c75f000e00380380ae390c350def826ed42ad051fa6f501c50f9b699c3b69cbeb76476d202bf3ac985b6e0e968be66572893e6a744540bd9722e5c87956848629bc2559306bd113e8653d3b6aff651dfad7a3ac8b02958cba02a93ccf525757039bae6cff090e1d90688e8aa233ee86a4c4a3e0586d6b2340522e47dcb7d0046d8a5acb05a123ee25d2b230b2ada6e2e2f9ede3c05202520ec2487b0d56562529d8b3393bca76adca4ec1bca508abb001babc007915d84fe3dd14e207e3c62f8379da2a3b861fb6629d28dba53b6ea388ebfed866bf6dfb553455e91ed547ae92e9445253a4fdf3efb4f8ebdfbe7d3c78f1ee0bb9e13e358e942a4ed49e22cff00eeb35fdd7ebfffd9} icon.\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Footnotes\par} {\pard \ql \f0 \sa180 \li0 \fi0 Here is a footnote reference,{\super\chftn}{\*\footnote\chftn\~\plain\pard {\pard \ql \f0 \sa180 \li0 \fi0 Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.\par} -- cgit v1.2.3 From 8667ba2bcc8a7da6ba50369161c0bcb9020780e8 Mon Sep 17 00:00:00 2001 From: Peter Fabinski Date: Tue, 3 Aug 2021 17:34:39 -0400 Subject: LaTeX table writer: Increase column width precision (#7466) In some cases, the rounding performed by the LaTeX table writer would introduce visible overrun outside the text area. This adds two more decimal places to the width values. --- src/Text/Pandoc/Writers/LaTeX/Table.hs | 2 +- test/command/5367.md | 2 +- test/command/7272.md | 2 +- test/tables.latex | 24 ++++++++++++------------ test/tables/nordics.latex | 8 ++++---- test/tables/students.latex | 4 ++-- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Text/Pandoc/Writers/LaTeX/Table.hs b/src/Text/Pandoc/Writers/LaTeX/Table.hs index 27a8a0257..9471c171c 100644 --- a/src/Text/Pandoc/Writers/LaTeX/Table.hs +++ b/src/Text/Pandoc/Writers/LaTeX/Table.hs @@ -102,7 +102,7 @@ colDescriptors (Ann.Table _attr _caption specs thead tbodies tfoot) = toColDescriptor :: Int -> Alignment -> Double -> Text toColDescriptor numcols align width = T.pack $ printf - ">{%s\\arraybackslash}p{(\\columnwidth - %d\\tabcolsep) * \\real{%0.2f}}" + ">{%s\\arraybackslash}p{(\\columnwidth - %d\\tabcolsep) * \\real{%0.4f}}" (T.unpack (alignCommand align)) ((numcols - 1) * 2) width diff --git a/test/command/5367.md b/test/command/5367.md index a67011c2f..427aab913 100644 --- a/test/command/5367.md +++ b/test/command/5367.md @@ -21,7 +21,7 @@ dolly[^5] hello\footnote{doc footnote} \begin{longtable}[]{@{} - >{\centering\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{0.17}}@{}} + >{\centering\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{0.1667}}@{}} \caption[Sample table.]{Sample table.\footnote{caption footnote}}\tabularnewline \toprule \begin{minipage}[b]{\linewidth}\centering diff --git a/test/command/7272.md b/test/command/7272.md index d27b25143..cea282a10 100644 --- a/test/command/7272.md +++ b/test/command/7272.md @@ -15,7 +15,7 @@ ^D \begin{longtable}[]{@{} - >{\raggedright\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{1.00}}@{}} + >{\raggedright\arraybackslash}p{(\columnwidth - 0\tabcolsep) * \real{1.0000}}@{}} \toprule \endhead \begin{minipage}[t]{\linewidth}\raggedright diff --git a/test/tables.latex b/test/tables.latex index 9d111fa7a..eba77c7b9 100644 --- a/test/tables.latex +++ b/test/tables.latex @@ -50,10 +50,10 @@ Right & Left & Center & Default \\ Multiline table with caption: \begin{longtable}[]{@{} - >{\centering\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.15}} - >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.14}} - >{\raggedleft\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.16}} - >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.35}}@{}} + >{\centering\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.1500}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.1375}} + >{\raggedleft\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.1625}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.3500}}@{}} \caption{Here's the caption. It may span multiple lines.}\tabularnewline \toprule \begin{minipage}[b]{\linewidth}\centering @@ -87,10 +87,10 @@ Second & row & 5.0 & Here's another one. Note the blank line between rows. \\ Multiline table without caption: \begin{longtable}[]{@{} - >{\centering\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.15}} - >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.14}} - >{\raggedleft\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.16}} - >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.35}}@{}} + >{\centering\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.1500}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.1375}} + >{\raggedleft\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.1625}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.3500}}@{}} \toprule \begin{minipage}[b]{\linewidth}\centering Centered Header @@ -122,10 +122,10 @@ Table without column headers: Multiline table without column headers: \begin{longtable}[]{@{} - >{\centering\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.15}} - >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.14}} - >{\raggedleft\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.16}} - >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.35}}@{}} + >{\centering\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.1500}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.1375}} + >{\raggedleft\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.1625}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.3500}}@{}} \toprule \endhead First & row & 12.0 & Example of a row that spans multiple lines. \\ diff --git a/test/tables/nordics.latex b/test/tables/nordics.latex index 6f17a163e..4c10865dc 100644 --- a/test/tables/nordics.latex +++ b/test/tables/nordics.latex @@ -1,8 +1,8 @@ \begin{longtable}[]{@{} - >{\centering\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.30}} - >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.30}} - >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.20}} - >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.20}}@{}} + >{\centering\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.3000}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.3000}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.2000}} + >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.2000}}@{}} \caption{States belonging to the \emph{Nordics.}}\tabularnewline \toprule \begin{minipage}[b]{\linewidth}\centering diff --git a/test/tables/students.latex b/test/tables/students.latex index 3d4d287d9..b1ea45ac8 100644 --- a/test/tables/students.latex +++ b/test/tables/students.latex @@ -1,6 +1,6 @@ \begin{longtable}[]{@{} - >{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{0.50}} - >{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{0.50}}@{}} + >{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{0.5000}} + >{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{0.5000}}@{}} \caption{List of Students}\tabularnewline \toprule \begin{minipage}[b]{\linewidth}\centering -- cgit v1.2.3 From 407de98b5e3971c84c7e89de5f2a9d317b4d4557 Mon Sep 17 00:00:00 2001 From: mt_caret Date: Wed, 4 Aug 2021 05:53:05 +0800 Subject: Stop using the HTTP package. (#7456) We only depend on the urlEncode function in the package, which is also provided by http-types. The HTTP package also depends on the network package, which has difficulty building on ghcjs. Add internal module Text.Pandoc.Network.HTTP, exporting `urlEncode`. --- pandoc.cabal | 2 +- src/Text/Pandoc/Network/HTTP.hs | 18 ++++++++++++++++++ src/Text/Pandoc/Readers/Org/Meta.hs | 4 ++-- src/Text/Pandoc/Writers/EPUB.hs | 4 ++-- src/Text/Pandoc/Writers/FB2.hs | 4 ++-- src/Text/Pandoc/Writers/HTML.hs | 4 ++-- src/Text/Pandoc/Writers/Markdown/Inline.hs | 6 +++--- 7 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 src/Text/Pandoc/Network/HTTP.hs diff --git a/pandoc.cabal b/pandoc.cabal index eee862909..ef4691e3c 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -437,7 +437,6 @@ common common-executable library import: common-options build-depends: Glob >= 0.7 && < 0.11, - HTTP >= 4000.0.5 && < 4000.4, HsYAML >= 0.2 && < 0.3, JuicyPixels >= 3.1.6.1 && < 3.4, SHA >= 1.6 && < 1.7, @@ -710,6 +709,7 @@ library Text.Pandoc.XML.Light.Types, Text.Pandoc.XML.Light.Proc, Text.Pandoc.XML.Light.Output, + Text.Pandoc.Network.HTTP, Text.Pandoc.CSS, Text.Pandoc.CSV, Text.Pandoc.RoffChar, diff --git a/src/Text/Pandoc/Network/HTTP.hs b/src/Text/Pandoc/Network/HTTP.hs new file mode 100644 index 000000000..89f7f5544 --- /dev/null +++ b/src/Text/Pandoc/Network/HTTP.hs @@ -0,0 +1,18 @@ +{- | + Module : Text.Pandoc.Writers.Markdown.Inline + Copyright : Copyright (C) 2006-2021 John MacFarlane + License : GNU GPL, version 2 or above + + Maintainer : John MacFarlane + Stability : alpha + Portability : portable +-} +module Text.Pandoc.Network.HTTP ( + urlEncode + ) where +import qualified Network.HTTP.Types as HTTP +import qualified Text.Pandoc.UTF8 as UTF8 +import qualified Data.Text as T + +urlEncode :: T.Text -> T.Text +urlEncode = UTF8.toText . HTTP.urlEncode True . UTF8.fromText diff --git a/src/Text/Pandoc/Readers/Org/Meta.hs b/src/Text/Pandoc/Readers/Org/Meta.hs index a1b21046a..ccb6744e7 100644 --- a/src/Text/Pandoc/Readers/Org/Meta.hs +++ b/src/Text/Pandoc/Readers/Org/Meta.hs @@ -27,13 +27,13 @@ import qualified Text.Pandoc.Builder as B import Text.Pandoc.Class.PandocMonad (PandocMonad) import Text.Pandoc.Definition import Text.Pandoc.Shared (blocksToInlines, safeRead) +import Text.Pandoc.Network.HTTP (urlEncode) import Control.Monad (mzero, void) import Data.List (intercalate, intersperse) import Data.Map (Map) import Data.Maybe (fromMaybe) import Data.Text (Text) -import Network.HTTP (urlEncode) import qualified Data.Map as Map import qualified Data.Set as Set import qualified Data.Text as T @@ -188,7 +188,7 @@ parseFormat = try $ replacePlain <|> replaceUrl <|> justAppend -- inefficient replacePlain = try $ (\x -> T.concat . flip intersperse x) <$> sequence [tillSpecifier 's', rest] - replaceUrl = try $ (\x -> T.concat . flip intersperse x . T.pack . urlEncode . T.unpack) + replaceUrl = try $ (\x -> T.concat . flip intersperse x . urlEncode) <$> sequence [tillSpecifier 'h', rest] justAppend = try $ (<>) <$> rest diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 508fb6a98..d77a038ba 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -32,7 +32,6 @@ import qualified Data.Set as Set import qualified Data.Text as T import Data.Text (Text) import qualified Data.Text.Lazy as TL -import Network.HTTP (urlEncode) import System.FilePath (takeExtension, takeFileName, makeRelative) import Text.HTML.TagSoup (Tag (TagOpen), fromAttrib, parseTags) import Text.Pandoc.Builder (fromList, setMeta) @@ -45,6 +44,7 @@ import Text.Pandoc.Error import Text.Pandoc.ImageSize import Text.Pandoc.Logging import Text.Pandoc.MIME (MimeType, extensionFromMimeType, getMimeType) +import Text.Pandoc.Network.HTTP (urlEncode) import Text.Pandoc.Options (EPUBVersion (..), HTMLMathMethod (..), ObfuscationMethod (NoObfuscation), WrapOption (..), WriterOptions (..)) @@ -1137,7 +1137,7 @@ transformInline _opts (Image attr@(_,_,kvs) lab (src,tit)) return $ Image attr lab ("../" <> newsrc, tit) transformInline opts x@(Math t m) | WebTeX url <- writerHTMLMathMethod opts = do - newsrc <- modifyMediaRef (T.unpack url <> urlEncode (T.unpack m)) + newsrc <- modifyMediaRef (T.unpack (url <> urlEncode m)) let mathclass = if t == DisplayMath then "display" else "inline" return $ Span ("",["math",mathclass],[]) [Image nullAttr [x] ("../" <> newsrc, "")] diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs index 3b5d04427..6bad37404 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -29,7 +29,7 @@ import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Lazy as TL import qualified Data.Text.Encoding as TE -import Network.HTTP (urlEncode) +import Text.Pandoc.Network.HTTP (urlEncode) import Text.Pandoc.XML.Light as X import Text.Pandoc.Class.PandocMonad (PandocMonad, report) @@ -451,7 +451,7 @@ insertMath immode formula = do case htmlMath of WebTeX url -> do let alt = [Code nullAttr formula] - let imgurl = url <> T.pack (urlEncode $ T.unpack formula) + let imgurl = url <> urlEncode formula let img = Image nullAttr alt (imgurl, "") insertImage immode img _ -> return [el "code" formula] diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 7eb8dfe12..89fc110ef 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -37,7 +37,6 @@ import qualified Data.Set as Set import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Lazy as TL -import Network.HTTP (urlEncode) import Network.URI (URI (..), parseURIReference) import Numeric (showHex) import Text.DocLayout (render, literal) @@ -56,6 +55,7 @@ import Text.Pandoc.Walk import Text.Pandoc.Writers.Math import Text.Pandoc.Writers.Shared import qualified Text.Pandoc.Writers.AnnotatedTable as Ann +import Text.Pandoc.Network.HTTP (urlEncode) import Text.Pandoc.XML (escapeStringForXML, fromEntities, toEntities, html5Attributes, html4Attributes, rdfaAttributes) import qualified Text.Blaze.XHtml5 as H5 @@ -1377,7 +1377,7 @@ inlineToHtml opts inline = do InlineMath -> "\\textstyle " DisplayMath -> "\\displaystyle " return $ imtag ! A.style "vertical-align:middle" - ! A.src (toValue $ url <> T.pack (urlEncode (T.unpack $ s <> str))) + ! A.src (toValue . (url <>) . urlEncode $ s <> str) ! A.alt (toValue str) ! A.title (toValue str) ! A.class_ mathClass diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs index cd5f5b896..f7a320db3 100644 --- a/src/Text/Pandoc/Writers/Markdown/Inline.hs +++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs @@ -24,7 +24,6 @@ import qualified Data.Map as M import Data.Maybe (fromMaybe) import Data.Text (Text) import qualified Data.Text as T -import Network.HTTP (urlEncode) import Text.Pandoc.Class.PandocMonad (PandocMonad, report) import Text.Pandoc.Definition import Text.Pandoc.Logging @@ -32,6 +31,7 @@ import Text.Pandoc.Options import Text.Pandoc.Parsing hiding (blankline, blanklines, char, space) import Text.DocLayout import Text.Pandoc.Shared +import Text.Pandoc.Network.HTTP (urlEncode) import Text.Pandoc.Writers.Shared import Text.Pandoc.Walk import Text.Pandoc.Writers.HTML (writeHtml5String) @@ -423,7 +423,7 @@ inlineToMarkdown opts (Str str) = do inlineToMarkdown opts (Math InlineMath str) = case writerHTMLMathMethod opts of WebTeX url -> inlineToMarkdown opts - (Image nullAttr [Str str] (url <> T.pack (urlEncode $ T.unpack str), str)) + (Image nullAttr [Str str] (url <> urlEncode str, str)) _ | isEnabled Ext_tex_math_dollars opts -> return $ "$" <> literal str <> "$" | isEnabled Ext_tex_math_single_backslash opts -> @@ -439,7 +439,7 @@ inlineToMarkdown opts (Math DisplayMath str) = case writerHTMLMathMethod opts of WebTeX url -> (\x -> blankline <> x <> blankline) `fmap` inlineToMarkdown opts (Image nullAttr [Str str] - (url <> T.pack (urlEncode $ T.unpack str), str)) + (url <> urlEncode str, str)) _ | isEnabled Ext_tex_math_dollars opts -> return $ "$$" <> literal str <> "$$" | isEnabled Ext_tex_math_single_backslash opts -> -- cgit v1.2.3 From dea1f0f080ada91e9840f90d15ca2b12ab29d9da Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 4 Aug 2021 16:37:20 -0600 Subject: RTF writer: emit \outlinelevel for section headings. --- src/Text/Pandoc/Writers/RTF.hs | 3 +- test/writer.rtf | 62 +++++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index 24a90a0a6..063371ebc 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -259,7 +259,8 @@ blockToRTF indent _ HorizontalRule = return $ blockToRTF indent alignment (Header level _ lst) = do contents <- inlinesToRTF lst return $ rtfPar indent 0 alignment $ - "\\b \\fs" <> tshow (40 - (level * 4)) <> " " <> contents + "\\outlinelevel" <> tshow (level - 1) <> + " \\b \\fs" <> tshow (40 - (level * 4)) <> " " <> contents blockToRTF indent alignment (Table _ blkCapt specs thead tbody tfoot) = do let (caption, aligns, sizes, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot caption' <- inlinesToRTF caption diff --git a/test/writer.rtf b/test/writer.rtf index 68f52a5b3..6b8c5a0c3 100644 --- a/test/writer.rtf +++ b/test/writer.rtf @@ -9,28 +9,28 @@ {\pard \ql \f0 \sa180 \li0 \fi0 \par} {\pard \ql \f0 \sa180 \li0 \fi0 This is a set of tests for pandoc. Most of them are adapted from John Gruber\u8217's markdown test suite.\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Headers\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Level 2 with an {\field{\*\fldinst{HYPERLINK "/url"}}{\fldrslt{\ul +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Headers\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Level 2 with an {\field{\*\fldinst{HYPERLINK "/url"}}{\fldrslt{\ul embedded link }}} \par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs28 Level 3 with {\i emphasis}\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 Level 4\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs20 Level 5\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Level 1\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Level 2 with {\i emphasis}\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs28 Level 3\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel2 \b \fs28 Level 3 with {\i emphasis}\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel3 \b \fs24 Level 4\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel4 \b \fs20 Level 5\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Level 1\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Level 2 with {\i emphasis}\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel2 \b \fs28 Level 3\par} {\pard \ql \f0 \sa180 \li0 \fi0 with no blank line\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Level 2\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Level 2\par} {\pard \ql \f0 \sa180 \li0 \fi0 with no blank line\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Paragraphs\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Paragraphs\par} {\pard \ql \f0 \sa180 \li0 \fi0 Here\u8217's a regular paragraph.\par} {\pard \ql \f0 \sa180 \li0 \fi0 In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.\par} {\pard \ql \f0 \sa180 \li0 \fi0 Here\u8217's one with a bullet. * criminey.\par} {\pard \ql \f0 \sa180 \li0 \fi0 There should be a hard line break\line here.\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Block Quotes\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Block Quotes\par} {\pard \ql \f0 \sa180 \li0 \fi0 E-mail style:\par} {\pard \ql \f0 \sa180 \li720 \fi0 This is a block quote. It is pretty short.\par} {\pard \ql \f0 \sa180 \li720 \fi0 Code in a block quote:\par} @@ -46,7 +46,7 @@ embedded link {\pard \ql \f0 \sa180 \li0 \fi0 This should not be a block quote: 2 > 1.\par} {\pard \ql \f0 \sa180 \li0 \fi0 And a following paragraph.\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Code Blocks\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Code Blocks\par} {\pard \ql \f0 \sa180 \li0 \fi0 Code:\par} {\pard \ql \f0 \sa180 \li0 \fi0 \f1 ---- (should be four hyphens)\line \line @@ -60,8 +60,8 @@ this code block is indented by one tab\par} \line These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Lists\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Unordered\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Lists\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Unordered\par} {\pard \ql \f0 \sa180 \li0 \fi0 Asterisks tight:\par} {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab asterisk 1\par} {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab asterisk 2\par} @@ -86,7 +86,7 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par} {\pard \ql \f0 \sa180 \li360 \fi-360 \bullet \tx360\tab Minus 1\par} {\pard \ql \f0 \sa180 \li360 \fi-360 \bullet \tx360\tab Minus 2\par} {\pard \ql \f0 \sa180 \li360 \fi-360 \bullet \tx360\tab Minus 3\sa180\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Ordered\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Ordered\par} {\pard \ql \f0 \sa180 \li0 \fi0 Tight:\par} {\pard \ql \f0 \sa0 \li360 \fi-360 1.\tx360\tab First\par} {\pard \ql \f0 \sa0 \li360 \fi-360 2.\tx360\tab Second\par} @@ -108,7 +108,7 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par} {\pard \ql \f0 \sa180 \li360 \fi0 Item 1. graf two. The quick brown fox jumped over the lazy dog\u8217's back.\par} {\pard \ql \f0 \sa180 \li360 \fi-360 2.\tx360\tab Item 2.\par} {\pard \ql \f0 \sa180 \li360 \fi-360 3.\tx360\tab Item 3.\sa180\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Nested\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Nested\par} {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Tab\par} {\pard \ql \f0 \sa0 \li720 \fi-360 \endash \tx360\tab Tab\par} {\pard \ql \f0 \sa0 \li1080 \fi-360 \bullet \tx360\tab Tab\sa180\sa180\sa180\par} @@ -126,12 +126,12 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par} {\pard \ql \f0 \sa0 \li720 \fi-360 \endash \tx360\tab Fie\par} {\pard \ql \f0 \sa0 \li720 \fi-360 \endash \tx360\tab Foe\sa180\par} {\pard \ql \f0 \sa180 \li360 \fi-360 3.\tx360\tab Third\sa180\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Tabs and spaces\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Tabs and spaces\par} {\pard \ql \f0 \sa180 \li360 \fi-360 \bullet \tx360\tab this is a list item indented with tabs\par} {\pard \ql \f0 \sa180 \li360 \fi-360 \bullet \tx360\tab this is a list item indented with spaces\par} {\pard \ql \f0 \sa180 \li720 \fi-360 \endash \tx360\tab this is an example list item indented with tabs\par} {\pard \ql \f0 \sa180 \li720 \fi-360 \endash \tx360\tab this is an example list item indented with spaces\sa180\sa180\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Fancy list markers\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Fancy list markers\par} {\pard \ql \f0 \sa180 \li360 \fi-360 (2)\tx360\tab begins with 2\par} {\pard \ql \f0 \sa180 \li360 \fi-360 (3)\tx360\tab and now 3\par} {\pard \ql \f0 \sa180 \li360 \fi0 with a continuation\par} @@ -152,7 +152,7 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par} {\pard \ql \f0 \sa180 \li0 \fi0 M.A.\u160?2007\par} {\pard \ql \f0 \sa180 \li0 \fi0 B. Williams\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Definition Lists\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Definition Lists\par} {\pard \ql \f0 \sa180 \li0 \fi0 Tight using spaces:\par} {\pard \ql \f0 \sa0 \li0 \fi0 apple\par} {\pard \ql \f0 \sa0 \li360 \fi0 red fruit\par} @@ -204,7 +204,7 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par} {\pard \ql \f0 \sa180 \li360 \fi0 orange fruit\par} {\pard \ql \f0 \sa0 \li720 \fi-360 1.\tx360\tab sublist\par} {\pard \ql \f0 \sa0 \li720 \fi-360 2.\tx360\tab sublist\sa180\sa180\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 HTML Blocks\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 HTML Blocks\par} {\pard \ql \f0 \sa180 \li0 \fi0 Simple block on one line:\par} {\pard \ql \f0 \sa0 \li0 \fi0 foo\par} {\pard \ql \f0 \sa180 \li0 \fi0 And nested without indentation:\par} @@ -232,7 +232,7 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par} {\pard \ql \f0 \sa180 \li0 \fi0 \f1
\par} {\pard \ql \f0 \sa180 \li0 \fi0 Hr\u8217's:\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Inline Markup\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Inline Markup\par} {\pard \ql \f0 \sa180 \li0 \fi0 This is {\i emphasized}, and so {\i is this}.\par} {\pard \ql \f0 \sa180 \li0 \fi0 This is {\b strong}, and so {\b is this}.\par} {\pard \ql \f0 \sa180 \li0 \fi0 An {\i {\field{\*\fldinst{HYPERLINK "/url"}}{\fldrslt{\ul @@ -249,7 +249,7 @@ emphasized link {\pard \ql \f0 \sa180 \li0 \fi0 Subscripts: H{\sub 2}O, H{\sub 23}O, H{\sub many\u160?of\u160?them}O.\par} {\pard \ql \f0 \sa180 \li0 \fi0 These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Smart quotes, ellipses, dashes\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Smart quotes, ellipses, dashes\par} {\pard \ql \f0 \sa180 \li0 \fi0 \u8220"Hello,\u8221" said the spider. \u8220"\u8216'Shelob\u8217' is my name.\u8221"\par} {\pard \ql \f0 \sa180 \li0 \fi0 \u8216'A\u8217', \u8216'B\u8217', and \u8216'C\u8217' are letters.\par} {\pard \ql \f0 \sa180 \li0 \fi0 \u8216'Oak,\u8217' \u8216'elm,\u8217' and \u8216'beech\u8217' are names of trees. So is \u8216'pine.\u8217'\par} @@ -262,7 +262,7 @@ quoted link {\pard \ql \f0 \sa180 \li0 \fi0 Dashes between numbers: 5\u8211-7, 255\u8211-66, 1987\u8211-1999.\par} {\pard \ql \f0 \sa180 \li0 \fi0 Ellipses\u8230?and\u8230?and\u8230?.\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 LaTeX\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 LaTeX\par} {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab \par} {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab 2\u8197?+\u8197?2\u8196?=\u8196?4\par} {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\i x}\u8196?\u8712?\u8196?{\i y}\par} @@ -278,7 +278,7 @@ quoted link {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Escaped {\f1 $}: $73 {\i this should be emphasized} 23$.\sa180\par} {\pard \ql \f0 \sa180 \li0 \fi0 Here\u8217's a LaTeX table:\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Special Characters\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Special Characters\par} {\pard \ql \f0 \sa180 \li0 \fi0 Here is some unicode:\par} {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab I hat: \u206?\par} {\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab o umlaut: \u246?\par} @@ -307,8 +307,8 @@ quoted link {\pard \ql \f0 \sa180 \li0 \fi0 Plus: +\par} {\pard \ql \f0 \sa180 \li0 \fi0 Minus: -\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Links\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Explicit\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Links\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Explicit\par} {\pard \ql \f0 \sa180 \li0 \fi0 Just a {\field{\*\fldinst{HYPERLINK "/url/"}}{\fldrslt{\ul URL }}} @@ -345,7 +345,7 @@ Email link Empty }}} .\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Reference\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Reference\par} {\pard \ql \f0 \sa180 \li0 \fi0 Foo {\field{\*\fldinst{HYPERLINK "/url/"}}{\fldrslt{\ul bar }}} @@ -380,7 +380,7 @@ bar biz }}} .\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 With ampersands\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 With ampersands\par} {\pard \ql \f0 \sa180 \li0 \fi0 Here\u8217's a {\field{\*\fldinst{HYPERLINK "http://example.com/?foo=1&bar=2"}}{\fldrslt{\ul link with an ampersand in the URL }}} @@ -397,7 +397,7 @@ inline link inline link in pointy braces }}} .\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs32 Autolinks\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel1 \b \fs32 Autolinks\par} {\pard \ql \f0 \sa180 \li0 \fi0 With an ampersand: {\field{\*\fldinst{HYPERLINK "http://example.com/?foo=1&bar=2"}}{\fldrslt{\ul http://example.com/?foo=1&bar=2 }}} @@ -419,12 +419,12 @@ http://example.com/ {\pard \ql \f0 \sa180 \li0 \fi0 Auto-links should not occur here: {\f1 }\par} {\pard \ql \f0 \sa180 \li0 \fi0 \f1 or here: \par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Images\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Images\par} {\pard \ql \f0 \sa180 \li0 \fi0 From \u8220"Voyage dans la Lune\u8221" by Georges Melies (1902):\par} {\pard \ql \f0 \sa180 \li0 \fi0 {\pict\jpegblip\picw250\pich250\picwgoal3000\pichgoal3000 ffd8ffe000104a46494600010101007800780000ffdb00430006040506050406060506070706080a100a0a09090a140e0f0c1017141818171416161a1d251f1a1b231c1616202c20232627292a29191f2d302d283025282928ffdb0043010707070a080a130a0a13281a161a2828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828ffc000110800fa00fa03011100021101031101ffc4001c0000000701010000000000000000000000010203040506070008ffc4003e100002010303020404040502050500030001020300041105122106311322415107617181143291a1234252b1c115f016336272d1082443e1f1265382ffc40017010101010100000000000000000000000000010204ffc4001b11010101010003010000000000000000000001110212213141ffda000c03010002110311003f00dadd18a10a704f6a95ccc57e37750782b0d8d9ea0cd32e7c5446e07e9f4ad723119a7b89e61e348f260719278aad613cbb640002938c76a182b264fc87bd13009c0c019c76e3d68a072e1cf6f4cd502d330c28269a61bb39c923923d4fad44c08dccb95cfd28b8280769ee08a263891e1808739e4f1d8d149392172cc714050dbb9fde8960ed8c60b79b1ed44103b05c331dbdb1dc5026ac1946d20ff8140aa631c773ec738a0346a003bf93e9cf02801895e7b9a01886796c923bd0090a06393c76a0142003ce3d86680d8dd9392303f5341ccc1b3cf7a2c812c37e4923d381429757013209fa511c18146c9247a0f6a007900c0c671c6280854e086c673eb45c27c038fd68aedff2fda836ef881f136f25d5e6b7d1262964aa02b03f98fbf153131935edcc97576f35c33349212cc4f39f7ab26186dfce5b200f73451f7600dcb8cf27e7400c0b291914046c9e0718fde81371b8e7273f4ef4007691919240e714097f31f376e7b5008caee27807b0f5a02c8e1b3c6d27d33cd0201d839523144d1a149ae084b78da47638211771fd050d582c3a0faab5119b6d12f8ab1c06788a0fd4e2ac356fd1fe08754ddccaba849696309e598c9e2103fed1dcfdeadc44fea5ff00a7f956366d375e492403ca935bedcf1eea4ff6ac68a55efc1beb3b552574f8e7009ff933a927ec715bc82b3a8f4d6bba5ca1352d22fe061cf9a0383f71dea5119cc6c0baed3eaac0f1fad40897dcc3d81f7a052366c1007df3400f21edefc5008c28f30c9c5170ee4fc37830086395250a7c66770c18e78da31c0c63de8609b41f7c515c5172a30c3b76344a3e377cb2339cf7a242aea89808cce368272b8c1a2e107c672a49f5c1a181c9c7ae7da8a2119e7b1f5068099ffa68258a132062d8f9e0f34059502b61bf2824e681bb297ced2a71efda80f19c47b9c77fdbe74057c13e539cf3c1a0eeeb9c73f33405ddb4f18249c1e28062b79ae242902024465b9214614649e7bd0362a7249eddc513456e5720f38f5a1a98e96e95d6baa6ebc2d1ad1e65521649bb469f563534d6d7d31f04347d2a2fc5f535db6a0e83718906c887cbbe5a9a8bef44dce9f731ca9a2e89169d6d6f2184b1455dc07b11dcfeb4d16f119c649a681285b03d3e5500f87820ff006a0e098191de80ac9b8904647b55d11da9681a56a31f87a869f6970b8ffe4883629a289aefc16e92d441682da5b098f21ed9f033f353914d19b751fc08d66cc16d12fe2bf45ec92ff0df1fdbfb559ec667aff4eeb1a04db359d3ae6d40eccebe53f46ec7f5ab82263da7dcf3eb5174e5181076918c7de869503232491ee4515c1803824f03b51287f30e0e7d803449494832c157278a2e8c71fcb9f9d144639236824d01e142efb1768cfb9c7ef40512a818de78ff00a682518e7cc30ab9e00a02cce9953247bd41e467191ed9a04205ee99da4e4e3d283a524b0427b5026c18a8e082067db8341ce0e39ed409b6502907391edda80f2dfdc496f0c124ac6184b144cf0a4e338fd2894f7a7342d4ba9b568f4fd261f12571966270a8bfd47d8511bae85f02b47b7fc34bac5d5c5dc88a0c90ab6c8d9bedce3ef4d1ad691a6dae976a96d616d15b409f9638d70054a1dbc68ea51d4329f4619a8022b78e04548515117b05000a035c5c4702a995c26e3819f534047bcb68a458cce866719540724d02e41c0f7a012a40f6141cbc8e7bd01719e38e6838af1c0a04ca8206d3cd037bdb082fad9e0bd8a39e0718649141047d0d5d18f759fc0cd3af164b8e9999acae4e4f81236e898f7c0f55fed574615aee83a96817ef67abda3db4ebdb7f66f983d88a061bb8db9e3d45165076db83c1f950a53780d8247c80a2398f182724f1c7ad080c608cfa7a51a0062adc7afbd0130173bb9c5070f071cb37e82826106e8f615e01c9e680d6b35bc534be3c1e3831b2aa962bb188f2b71df1de819ae4b1048c7f57bd01a58268e332642ae0704f7cf6207af6a01b99e17b7b6416e227407c494139909ed9f4c0a04a4e501e0f1eb40d263e53dce7fa682c9d0bd13abf58dd6db18bc2b157c4975270ab8ef8f563f21447a73a03a1f4de8eb031582b497328066b97fcd21ff038edfde88b7e32703bd64188e7e6283864b73400cd804b67ca3268317eacea6d56ff005233592f8b6303f953fa4af7c2fa93417fe98b763e0ea171297bab98558068f695ce0e08fdbd281e5c6a57ba5e9d14d716ef7774f2ec112601da4f27ec2827ada74bab559a20e148fcae36b0f91140283729c77a0e0a7777a01dac68395719e39a029607cb901b19c501480ab9279f4a086ea8d0b48d76c0586b7143224a76c61ce1831fe93e86b43cd1f12fe19ea7d2533dcdbeebcd20b612651e68f9ece3fcf6fa5067cbcf20ff009a051724905411e94032799060723da8406d6c67e7ea68d0e1770fe5cfb5026c37039ef9a02eca098c91e6e01e71c500b1d8a49c12786cf6a06a4e256008e3d050119958007920e2801154e32fb4120927b014017eb1c523ac5209a356215c291b87be28957ef853f0d66eaa99352d515e1d190f947669ce7b0ffa7e74a8f4be996569a5d9c56b6704705b46bb5238d42851f2ac875712bc70b3c30f892019540704d01ad2669a0491936330c95ce7140b2e4939a03638c7e8680ae485e33bbe540d60d3ada162c90a02c7270a39340a4f28b68da4645007a8f6a069a746f73235ddcefc391e12b2e1916824948742c99382473c73404791c617695279dc0640f9502c578c9efeb4095cb4cb0830ba21cf999c6401f4f5a05061d430c8079a02e03b3004311c7d281b5e3cd676c65489ee594e4aafe6c7ae07a9a0a075bbea3a8ea96f047d3935ebc404f04ad29411e08e011d98fed416fd212ee5b05b4d5ad6300c615807f1171eaa49eff5ad418c7c55f8466dd66d57a521f20cbcd66a7247a9283dbe5418a63862479877cf1f6c5008e400bdf1ce684016fe53dfbd1a73794600e08ce3d6800377c8c7d6800a9cf75fd4503d91492460f7ee3d28247a7b459f5fd592d22711c206f9e563858a31f99cfd050583518ba75247b1d134f9aed21396d4669769931dc01c003f7a329c4d17458ac5b55d36c12e040a3f1da75c1cb04ede2447f7f6a94567ad7a66db4fbbb29ba7d65b8b4bd8ccd09c8231eaa07b8ab04a7c2cf87b3f53ea8d77abc72c1a5dabe2452bb5a561fc83e5ee7e541e988218ed2dd22b7855228d76a46a00000ec00a510bd4dd511f4fe84da95cc31f880022da4902b1e7d3e99ac86fd03d631f565b4ee6d4dbbc649009cab2e48c83f514165b8b94b6895c44f279c280839e78ce28178ae6de46748a789e453865570483ec6812d42e85a421fc37918b00a883924d024c6e99b7a2a966c0009e17dc9f9fed40f81c77e28139218e4ff9815b9cf23340a01c907b9140201038ed402fcafd28386464e4fd33c50272bc60032609cf00fbd024f722dc66f24822ddf972f8feff00e280f69b24844919cac9ce7de83a447f30ded823007b50459d6ecacb528349b979127651b1dc795f1f3f7a0990148054823dc5015d491c0a0c3be337c2ff00c489b5ee9c87172016b9b541c49ff5a8f7f71eb560c1fc43e0a47e1aa94277310431f91fa551c1727f29ed409b641c86e31839a3454805739c1f6a026f1fd740f64665fc8c31cfde82db79bb40e9e8f49b62eb7d7e8b717ec832c91ff247fa1dc7df2281bcc9369d671493c422b7911654c1215f92bb8827bf068624ba635392df5eb4b9924558ee5bc19b71cee43c6dc7cf34c657be8db0b0b9d0f51d2afe668934dbf9628ddb8c2b8c0073f3a80da37546a7d25174fd95dc125c69f7313ee5655dfc313bd483cf07b1f6a68d5b48d5ec758b612e9d7293211c8fe653f35ee2a084eb9e8bb1eafb3582fe496278f3e1c919fcb9f97ad03ee8dd017a6741b6d3229dae161057c5750a48249ec3eb4139238568f6a9e7b103b5037934cb3793c610a2cd9277a8da73f5140ee38f6280c4b11c65b934023006d50050030e4647de80c846de3b500fcf9fbd0197273ed4007b91400e580c8e45074a82400e72682b36fd2162b7f25ddc09af2766ceeb872db79cf00f6a0b3229550140e07007a50092db860673de818df473c862686dad6470d9cce3b7b63e740fa1de6252ebb5bd81cd00bee2d800d003a6464004763ce683ce9f1cbe1f1d3a67ea1d1a30b68edffba814708c7f9c63d0fafceaca31e6dc71e1f07daa82608c83819f7a1a11ce149238fd68d0a579ec682cfd27a7c3a86bd10bc38b3b756b8b93c1fe1a8c91f7381f7a034f752ea5aa5c5eb292f732128037619c018f6ec282e5a2cb047abda74d5ce9b6da80f136de4a496219b3e48c92000323ea73467519d3da5bb757dbda410ac90c77c23058f99007ee7ec31416882ee47d23acb5185caf8bab4691b1efe57fff0038a9457ee75a82f6e7429350466b482f2742c0f74241c80c38c64541a9cfa1e89ac0177d33ab3d8de28f2b5bca429f91140e2c7a9b5ae9fb85b6ea9b46b9b3c796fe040768f76ec0fafb1f9505df4ebdb3d4edd6e74db98ee216fe68ce47d280648f75e2485a44da385ddc13f4a025ddbdbea16a633286566ce55f9c8f6c502ad750db2c514f30dec428247e6340bbf04100b73402afb943ed2b9e30683836defe9403bc1e06734020e06280cafe8683a375941d841c77c1a0151b467b50159f00e4127e5402872371040c5046eb5aadbe9b1c02e2f6dad25b89047099c677b7b0140fe3f1010afc803f3018e68160c3041ee2823f5dba92d34db89a1d9e2843b03b6d05bd013560c1748d57aa2797c6b35bab78e6959dc47231580ff336dcfb03c1a58364b5bbb7d7fa7b7427f1f673830c8664285bd1815238fad20f2c7c41e979ba43aa2e2c1cb1b663bede438f3a13c7dc76fb5515e9065b851f7a02950002a09c51a1b83cf14176e90d3645e9ad7752752aac23b3439c066665c827e944d29a6410aea725c4567135bd840d3c88a723728c29c9efe6c50d3ee9545b0bf8ef2e6e3c2fc2c6f72f2920e5f19039ee4938a9a875d03278377acf52ddf867f036ef71923932bfe51fbd3475cdc369df0db4fb389d4ea37970fa9cc0b00511795ce7d4f181eb4cd2451755fc45ac16d637381b14ca36b641dfce723e4053170d6cb52bbb362f6d3cb19241f2b9029862f09f143549ba7e7d2eef6caf2797c66ee17fdfd69862d1a069da7dfdac579d17adcda5ea9e1a992376c4723e39e3b024fd7e94c458ac3e25dee8d31d3bae74e7b79002bf8b8549471db38f5f4ed4c165e943a06a328d4ba605b4b22a1523c420c64fbaf38a82d36f0ce7cf7463790729b53017e940e0b0ceceed8ce0500e1b70daa08f5c9ed41d271cd0132476e7d7ff00aa069797d2411168ed9a41fcc858211f73c5075acb25ca6fb82aa31e58a36c81f561dcd033d42169e158ac64b98151b3981c2966cf639f4a064c7a8ac55e4865b7d493701e1c8e52403ea3cbfda827e390ca3f2c914aa81991bd281cdacc2747215c60e0ee5c67e940cb51b0b2bcbd824bfb08ee1a252d1caea1821cfa67b1fa504982b2283ce08f518a08abb82f6dd0369a5662081e14ce40c7ae1b04fda82275cb0bfd4f4536f7114589a5412461f3e4ce4e0e060f63f6ab2893d3b4b5b5b78e22ed22aae3cc3cc7e64fad3449a22a461500007602a0cd7e3b74c26b5d2ad79147baf34eccca40e4a7f30ff3f6aba3cd0543267eb5427b86f1f4c76ef45d0eca1ad5ef224d13e1cf4fd9b22192fa67bc955f8c8c617fba9fb510d7a6ed3fd43a735e5b54964be658c048fb6cdd9e7eb8a186bac97d174e6d22e23437b7ac26b95e77c68bf950fa7279e2b22dba45b59e97a669fa4ea36aeff89cea9a90451fc355ff0096ad9f4ce3f41570675d4fa8c77da8de5cde5be26bc653171ca47dc1f6c9fed5562b97f70276808da7c24f0c1c63804e33fa8a2928c0e0383c8f7ed41d92a41393f4a2548595c2c37493db4cd04e8a08f139566edfef3445b6e7aeaf65d2df48ea2b11776ae02a93e564c772adef409f4ee8ba9a21d73a36fa579ad9f325afe599171ed9c30a960d5ba0fe2843abb47a6f510fc26a4c36890f9558fcc6783506a1147b510024e30339ce680d2c6ae9861eb9a009178a0205443b989e39cd01d8075e3047ce80563057ca381ed4011c4531e503d85013c91b804a21279c903341131cda8c3abdc8650f6d20c4321232adec3dc504bab2c113c9293bb1963df3408dd4b75e1efb2856463dbc43b4631fad047e9177ad4fe32ea16b1db4b8fe1aa92571f5f5a0916bc8e0895af5c46c17cd8c9ff7da80f6d736f7f6915c59cab35bc837238ed8a072a31c1ef4062870718a06f7702dc5b3c522ee4752ae0fa8230683c75d6ba3b74ef535fe984929149e4278ca9e47edfdab42058003763ed409f88ffd6dfad06b1f12ae612fa0c76e0b471e9916d23f973eb4158d3efeff004a984da5debc1295d8e4018dbf3145d583a2ad96f356bbd7f5d90dc59587f1e79a6392f28fcaa3ee47159444ea3aa5ddfc7acf50dcdc344d7a4dbc317f52641200f6000fdeb41b5ef51d8eab672ffa9e971c97c11638268e431a46000012a3b9a351567db823b11f3ef40948e428048207a8340ab48ae83cb83ee0f3428a982719edf3e68c9cc97d3fe15ad8c9be138f2bf38e7b8f6ef40f7a5f55bdd3f56b46d3649127f1405f08e7249c76f5fa50689d48ba5f545cdcbdb462cba9206411b2b055bb07d4fb1c73528d4fa8f52d62cf47b6b8d2e65fc458c49f8a818795c151939f977a823ba0fe253750eb7fe937b04293f9f6c90be41dbdc7ff006283473c1efc1a06f69776d73bbf0f2aca32572bc80470450284a46dfca19f819f5a04e799614def26c0bdce09cfd85045dc75769d12dc3c3e2491db0dd3c85195235f7c91cfd066ae0cdba9be31f4ec61a386c1ef9d4ee473e45cfb1cf34c101d3ff1ac9d481d46c628ed24751881880833f988e7b0fa5328dfed2f2def2ce2b9b79925b791772ca87208f7a60182ee2b95cc0c48f53823fbd40ac658b30f4f4a086d4ee1d75bb6b78f4e965596366fc5211b23238008fde81f43692da5bc30d97831a0397dc09e3d714087506bf61a2c4cd77324726d2caaec141f9fd2ae0c435bf8c57173ad7876f7a2daca10489121244cdf319ce3dbf5a834fe81f881a6f57bcb6ba7c53c72c11873e28cee1db391dbef4199ff00ea4348116a5a66a8a8a04aad04847a90723f6ad7d18c312ddc02a3815423ba0f63fa541687bd9efe1b533b3c9e0a78473e899e318a09bd0ba6eef543e3b2bd8e9b10064bd9e4da001dc81401aeeb29a984d0ba7d5e1d06d4e6594f06523bc8e7f5c0ac8af752dfc17d7090d9218ec6d9447129ee71fcc4fb9cd6842ab10dc0014f3e5a2c1704b671dfdc734525226dc939e283a362c7f940344a380393df144733e2276e38f5efcd01b4bbbfc3dda4a9298a44395902e4a9c70682660d4265d62de40b1bdc1545054f95c8fe627df141af7c3af8808f3dd68dd5d2a45765884b8908d8c3b6c27b7a77a945d7a5fa474bd2ba8e4d5748b28624955d5d8b13b79ee9e983d8d40a753758c7a46b96f6114725dc92279a2810b3a64f94900763cfafa503fd3b59b79ed84da34713c0cd890f0a158fa1f981de826e1b548959fc4dc5cee24b6467e59ed4101ff19e9f676baa5d6a72c50adb4ad1ac790ccc076200f7ad41e7df881d79a87576a5f87b0f161d381db1c2a36e7e6d8ff3416bf87ff082c6f208ef7a82f22b9761bd6d619785f6dc477fa53705ab57f83bd297ceb1e9caf67708db9c4526723e849e3e94f212dd25d117fd29a8c09a76b534fa39cf8b6b71ced38e36fb73417f52e64548e34007e673e9f21ef590a1c918c90718dc281a69b68f67118d9da5058b798f6fa7fe280daadd1b2d36eae70710c4d263df0a4d583cc7a668fd4bf11b5837d7c93dcd9a3146959822a0e781f4cfa55161e9dd7fa67a4f55b9e9aea3e9f81fc09ca0ba118998fcdb2338c7b528d39f4cd2ba76e2d357d292df4eb391809963420ce1b1b576fa1e7359119f1eb4e17dd033ca172d6b2a4df303383fdeb5c8f2eef3bce4e0e335684cb0c9f354160d36f64b0baf16072b91b5f03391f43c51aab23a5debe91c4fad4d73689e6fc3a290573ff4f03e59f4a3280d67581ce916567f84b58ce0a1fccec3d58fa9a084de08c90464e4d1a8e419059b201f4a05630a176918efc50176293872c17bf14042aa0125b03db14046c60b60123fde6827fa0c68edd5365ff11346ba6292ee64194240c807e59a32b7fc51bfe8bd5ed5db424860beb62b89218422ce09c11c01dbbd0660ae110bf1bf2154838dbebfefeb41a8f4cdac7f117458f4d9ecd2df53b4cf81a822808c47255c0f7c8e7fb54a2ec2cfabba3b4b4b8d3af12eedad40926b0f070a13f9b633649f7a82eba6ea4357d321d4ecad512daf20df26e016507fa4fbfaf3e98f9d067dd2bd2faac9aa4d72d72d1e9510ca46a7631c7a320e18f1dfd7bd059afb7da816d23de4ba5de211346a1e4785f190548e4648c63b64e6b43ce9d5baafe3b539c5b452dbda46c638a167cb281c73ee4ff9340e3a3fa5f5aea4ba58f4bb57dbfcf2b02a8bf7f7a0de3a5fa0b50d2a2d92eb3e048c0a97c867dbedcf6a944e5cf4f6b76d1b3d8ea42795066266c87c81c65b9cfaf15048e83af3cd64abac08edaf01546c38dae4e0657ee6826e5b892de3702292e2545ddb55700fd0fbfca81c4b3bc718716eef9eeaa402280d14ab3c0b2c65c06fe571823ed40df56b217fa6dd5ab9216689a33f2c8c558307e83b8d77a37aaa7d22f2512c28768800c9954671b3d33ebef568d0ef7a7749eb0b5bbbb162d657b32b46d2e1564c8ed9c5644d1b0b9bbd261d2a440af6cb0e2e5b1e7dbc1238e0f7a0375b696daa7496a3a4dac8a92cf078685b271db04d391e40d5ec4586a1716de2a49e0c8c85d3b120f715ba1899173ff305413070abd89cfe9f5a2d3ee9c8639fa874eb6b804c52dc46b20c9f302c3bd11e84d47e1af4d5dc6521d3e3b662c19a58721ff5a9a321f89bd27a374b456d158dccd34d333332c9b4b2afbe47a7cb1f7aa33d2bc0d8c0f1c8f6a2c14b6d501b39cf63450897380c319e3de8065031c038f7ed40d8faf1ce41e4d004876a8dc3cc7e743025c956c818028c904579e7f0e15695c9c0541924f6c00283d0bf07f42d6b48820b8d62d20b2b58d656404959e52f83c8ff00fcfafbd4a35bb06f12391a48dd55cee2b2f3818ed8f6a8158a159890f02242079147623e631c502b0db436d1ecb7458d4738038fb0a087d6eeb508f48bb7d32d95750752b6c26c905b3ddb6f61eb574794f5cb6b9d0fa9678b512b25d24bbe52b8c1638278fbd582c57ff12afaed45b5bc0d0d8a8c08a2731ee3eec5793f40450466a1d59af446293c186cd53ca0c36eab93dc649e49fbd048e89f1675ed35e301e293919dcbf9867b37cbe94a35fe94ea4d33aba6824306dc48015750d86c6e247b0cf63591a40b8dc23fc30f14138dcac3000f9d03687547f12e8dd5af816b13148dddbcd29039c0f6f6f7a0eb5d62caf5636825db70c9bc4328f0dc0271c8a090627d3073ce681acf6505ccf14d35bc2f2c2731bb28254fb8a075144a83ca806792400334049ee6281e2496408656d880ff0031f61fa50446bd76058ea1b9e21025a3bb48afe71df9c7b71de9c8f196a0de23ca7b827d4f7add117e0cbfd4b5059392369663ff004e71c51aa97e8f555eadd258f2bf8a889cff00dc28cbd0bf123a926e96d163bdb74490bca2321c678209ff001591e71eafd7a7d7ef45cde2c20aae144638033fb9ad2e1b5e69d058da431ccf21d4a5c3b4631b62523807feaf5c7a50222f2d648c25f5aeec8c2cd19dae3d3e87e944d3eb7e90d425b49ef2292de38224f1505c3f8724a9eeaa7bd0d57a60406059436306868a7803839c7ad1a158039c13f4a33a716767f8cb9b6b55e1ae2458813e9938cd07a9f42d0b4de99b4b7d1f41b58ff19b03c93ba06607fa8b1f5f619a5b8266d74a65d42da6ba90cce996dcdc8c9fff006a5a2c2635083b05ef83eb5028076341db4b1ed9f7a04651fc41db18ed419d75b744dbea335fcb0db0335f2057901c05da73c8f9d5d18a75174a3f4c47335e35da4ce418a489374254f707d463d33565d1529b569a489a17944b06ec8057d71dcd037b4b6b8bfba31584124b27e62a8a4f1ea68357f83da7ea5a76bfe0912453ccabb49194653cb60f6ce3dfda983d196cd108c2401711f9768e306b2297d73fc6d02773a8b591922693c5004bb9d72542fa2f6efde8314ff867aeeec27500b77bb5670e36ca19b1dff2e7f2fd2837ce8bd5dd348b78b552219022870d9c46e792a4f6c608a0b846c8e03232b29ec41cd0199f1410fd4b24b1e8f712c0a5e4452d851e6c639dbf3238a0afa42ba77475e4ba8470896681da45180b18da76af3c9029c8f26dc1df2b9c606e273e86b743331924f27f4a82c12280e59b008e79f6a2d4d74188ff00e30d203a82ad7519c1ff00b860d11ba7c5e86c9fa3afae6f4091e043e021270b21e01c7dcd6479ab4dd3aeb56be4b7b184cf2b301b57d07bfd2b4bad0fe25e9f6960ba7c7a55ac50cd750335ccaade7723b83b8f6e38a2207a5ba4e7ea3d93780cb616ca53781f99fbff009a0b675a5be9765d43a75a6ad3b25adb4185429b831c70303dfdfd2831eb8954ca48f3827819c71ed406b2b1b9bf9a5fc1c4ce2253238047957dc9345d122b792eee522811a495ce1157b93ed444ff0049f476b1aaf51c761345269d25be269259570c833c6077249e062a68f53e8ef0da69509d4ae225b92a04af232ab16f98cf1f4a5a266d4dbca8af13a329ecca723f51502d14f0cb9f05d1c8ee01c91f6a0393b4edfe63c8a031608859b38f97340d84d04e5846eae50f9829ce3eb400fb24466041f5e3d2823f56d22db57b192d6e61468a41c823ff0035651916bbf04ada7badda5cad6d1b72c09dc33f2a6875d25f0865d06fe2bc6d4c4d3282026cca8cfafcfd29a34cd234a10c768f711a78f1bb392a3001208e3ec69a26a58d640c832091c90706a084ea1d3eeafdadf4f86da3166c0b4b397c18f046140f5ce4d04f4702436e91c28a9122e028ed8a0a9f5a5b6a09a1bc5a135bc72cce048b3c5bc15c638f9d59043fc2db997481aa69dae49e1cb6bb643239211939e467818f97bd305965ebce9a10bc8da9dbaa2679dd9ce3d8530572cfac87566ab05ae9f1490692b9696e1f833738555f96793504df5f25945d2576b7ec16dc46792381c7b7ad5e60f234980e42f6c9c56a82ec3eff00bd4124e49700f1c646e3cd169ce9575f83d52cee324347323f6e3861ff008a23d47d4ba6a75074fdcd8ef317e2e2ff0098bdd4706a60c3f4ae8cd5f44eb8fc3e97248a638cbc73bf90483d463b373e9574685abf42a6b5649fea72bbdeac4a8d3b018cfae31f7a6895b6b29b41d30d8e9f6bbed9213e1b7a994e724fcbb5064bd7835a9752d3af75d8116354778f660788cbd9483dbb0a0cd20b2b8d43528ad2088bdcccf854039cff00e2827a0d34e9da1de896f2182492efc0976f998aa827d3d334113a74aa9a9298628e74570478bc0c7cf1da83724bb8246d3e6416b0384da61b5501c9f5c3704f152c037561a95f5fce61d3ad6db4ab950f34b331dd9f4191db8fdcd406d67a675ab4b6d325d1af248272a43430315ddec7038f6ad4b3f448bf47eb71cb69abddebf21d5e26896203846c30c8603b9c6452d9835901405660376319ac84bf13180779d8bb82827d4fb0a06f777367a75acd7170f1430a9f331200cfceae061a0cf6dac692d7365266191db0578f5edf3a6075a6c9278b3433188a467860d96fbd40fe540471409aa0c1140750001ed8ed4058e15133c983960077edf6a06faade5c5b7822d2d926766cb967da2341dd8f0727d85033d27597d62e2ee3163756915bbf8799d71e2f19dcbf2a092b88dd9a311950a0e5b70ce47fe6ac18af53f5b69da9752dd69da9ca906876e24465d9e69881c6ff005c679c0aa2bfd267a347512c93dbb5d42d90d3c800b68c9ce0ec3cfa528db74ad034db5905ee8be1ac728dc153984f3f980f4fb56453be2de8f647a6aff53796596f0aed46798ec033ce149c0fb0ad71479c9bb9dc3bf3c55a0b95f65a825150b481a407b93c0fda8a29c06671dc93803bd131eafd0af6dffe18d2ee25982a4b04603b7a9c631fad03bbe586381bc5945b96385718c827db3eb5288eb8ba934eb15fc3c535f05427796dcccdec7150637d5bd55d5362b7975aa4d0d919018adec8637807bb60723000e4f7cd58203538aefa8aeb478a7b9beba924547b8774cf8608036a80704639cf1f9855d1a7f4c68b67a03de5e5d59dad8d988c62e1c0f107a1e7fdf7a082ea6d07a6e3e99375a7cb6b3db093c727701e2360f7f53dfb50653d4130d42ee18f48b3f0232a15218936963ebf5fbd06dbf0cfa74855b9d46e04b730c6144691e12307d33ea7de8348ba6b5478a279a004f98c479247b81f5a9438805ac0be2e02e73c9ef8fbd40c2346d43578eefc40da7da1dc8b8eefea4fcb9fef419beabf12a4bcebcb2d2fa7ee0dc58492084b30236bb6467dce383f6a0b87556a67a7f4d95a0bbb5468816f0a69c78b2e072572719ce78357079dfab3af2e7a92c963b88d94abbbf91cedc93edf418aa2c5f0dbe2a6a9a0c90d8de34773a6a8da1186d6403fa48fec682d9adeb7a9b4c9d572dacc9a6c9700456e5ca910e000ecbd8e580352fb1ae7476bd6dd49a325e5a9f3025245fe961dea097523cc0919a032af039a006936c81423104649c703ef40dcce64bc3035a87b6f0c378f9fe7cf2b8fdf340a4b6e25962915d94a67807839f7a043586922b5636ec44c061063f31f6ab079d7fe19b7eb2d4efeef55d5d74f992e9a0fc3a441dcb13927b838c9aa2d4bf042c618e178efee6e18104870172318edf5c1e6945bbe1a748ea7d2315edbea3a99bcb190030c401010e4e783ee0fa56455be3d6b90c1a6268d69e17f1486900ee98ec29ccc183119419e7e55ba11f089f523ef5058363a8059fb8e31e9421b491056c01819e28d3d0ff07eea3d53a1e3b6b8db235aca63c139c0eea68ca47a9fa6ef757b83ff00bf68ad428c2f248c7a8f9fcea518df516adac74e7544f63a2ea172f1800291e6cee19ec78cd5826344e85b6bad25ba8fade5b99dae0ee11efc71e858f7e7d054a2d7d39a75ae8f7b6b00b8917f1516624b78429da327cec493db1db1d8540cf4aea28f58d6aeae2f6dd64b498082d880488d149fcea7d4939ab04175e6850a8d32de3b78e380c8de32c4db4e18e430fef543cf86fd0d691b4fabdf6648b3b2db69ce7dd87be68342d2f4fb9b5b891af1a28a2dc05bc5036d001e0eef7352884b961a2ea9aa7555c885e08d45b5bc52b61b686c120fb939fb541276bd4b61d53624d942e2f6200bc32290633e99f4233416dd3ad3f0d611c0c77b632e71dc9ef41156dd27a45addcb3dbd9c513b1dd941821bdc7b558333b9f873757fd69a85e3f813e9c7723b5d93265d872473c11544a68ff08fa75e290b42ec4e4124e70738fa5048e89f0f745d2aeadd2decedda6525c975121183c77f7a945c754d0e0d563682ed43425369403bff00bcd58308ba7d5fe13f5a05889974a9d8b46aede4914f707d88ff001528ddf4fd7edb54d1a1d56c312dab2e64dbc9418e78f5c541296d70b716d1cd6f8789977230ecc280cb7519b816f212b205de4e0843ce300f6cfcb39a0545c42cee88e0b458ddec33ee680eac92266360debc7b5056fad2d354b9b189745744be121daf27e550548ce3d4d58324d07a725e98ea2b7ff5381f5169a7579d021fe13904ee43ddfbe49038ab46e76cf05cc714f6d309232a4a98ce54fd6b2196bb7f2e9b631b2c427b891b6851db3eff002007341e5bf887aa2ea3d4f77378be381e42fdb711ed5a1554395caf1cd07617dcd04fc85402101da791421b49920331381c60d1a69bf02f56f03a925b12c162b98c955f775e47df19a32d99b518268e4491668704a79d4aeec7b7bd4a30feb7e9144d76e265697c3e2693631674273803e556087d76f35fd49859e9925ccf611141106f2e182e3241f727f5a94681a268f79ad1b1b8b9dd66b1c2b1ce9bb06361c1e7bf3fe6a096b0d3ba57488e485b52b40909c386901607d47bf7a0ae758eb69ac4d15be81a748f0a9c35cc90b2eff4c03c1c638a0b77405c5d5d45f87be5fe359a88b81b401dc1c7d38fb50586fed18ea3015790091591e447c1518c8c7a0a0a5754d8c9d49a8d9f4ee9dba0b3b5224b9692327728f627e7c6682f9a7e996b6b3a8b6b748a348820c7720761412c064e3041ce282b5d4bd73d3bd3f33daea97ac2e540dd0a292dc8cd043c1f15ba2a7923b65bb910371b9a12141f9d02edf13ba2ade56857551e5e77244c54fd0e280746ebfe99bbbd655d56dcdc9ce08465565f4ee3bfca82d53eb3a6dac3e25c5f5ba646402e33fa77a0aff5b74ad8757e9ca972844aa37c520fcca7d3f5ab067bd369a8f467544d626c98e9f7118f0200e4465c903049c8c9e6ad1b24334b6fa6249716cab20037c309dd83db03b5640dddac3764a4f02cb1103863919fa7a1a06d6f600c37162911b7b252b87dc773f1927393f4a079f868edae1ae6328a8b1ed38e30050226e85d5dc1f879011b3c47c2f604719f9d01eff4f4b83e3c6b18bb452b1cac9b8a83de80b16e8208a3b7b58e1407cc061427cc0ff1560ce7a8f592d69a97504cad2dac01a2b53900c3e9e51ea58f727d0551e73bfb86b99a49a46dcf21c96340dc13804f20f6f9501c0e3b8a0963316fcc4607007f57bd084d64dec01200ce483468ff0040d525d1755b4d4206ff0095207c11dc67ff0019a18f56584f6daad9dade4211e39104a8ded9152b235cd8c530613229c8c1c8ef50472e81690ee00322b0c100f0debdbb7ca8111ace856371358cba85aa5cc407891ccf83f2ef4048b4ad2e59bf116769672c72f99dd1437239078e2824a4d3e1b94559234110e781839fa0a0561b38ad532a12319c86c6307e740a9732a3a00cac870cd8e0faf0681be8b6db965bb909df3c85806eeabced5a09523647e6e0fef419a6adf116daf7ac34be9dd1da686e7f1ca2e243b76320ce57df9ff1560cc3e3f470ff00c78255b842b35bc6c4af9b6e323d3e95467b6365f8dbcf062beb68c119595d8aaff6e282422e9899b4f6bb5d46cda2562a76316c1078f4a0859e1b9b762c0bf94f0e84feb4125a57505c58ea70dd5d0174a986d92b1c13f6f5a0de7a5be366877260b5d42dee2d2423124a487507ebdf15289dd3fac7a7bab6feded74d61733473acdb5a162142ff00313d81ed505fa58fc6d809380c1b9f5c502e0e05040ea367a85dea454de2ff00a610375b04c16c7a16ef8340b5f6930dce9375636acf6a278f04c5dd4f1dbf4a084e91d06f3a52dee62bbd4a2b882494ced3c8a448063b63b638fde803ab7ae749b2b3096d792c93c8c109b55dcd18ce3710473ffdd043dc758dc5869044565aa5dda4c3c2b7bc78c1f14e3963db03e7c0ab066bf1327d41ba76ca6bc48ecad24c456f6b0c87cf8e4bbfa138c0fa9aa3297c83dd4e28395811cf2680a5b93c7ed413cd1ff0f3c797b8031406645236b0508406f30e68ba49c051b97d0e0e7d28ad57e19f575c5be8f269515dac772877c11bc464dea7ba8c739ce78f9d3193bb8ebfea2bcbd6b5b6b8b58bb7f13c2f0ce31cf0deb4c0f2dbad6d743d2ee99efae752d6c02a86e0054524f6383c7ff94c0b6af274c75149a46a5a82c46f1e1479fc3190bd8156fbe7f4a960bf74e9d253f1167a3ac09e0856610e3041ec7f6c540f67b892cee7f8d18368232ef2af2508c7047cf340ead5bf130accc9b1186541e723d09ffc5033bbb1b82d74d6b37f1244daa1b38073df3f4a08eeb1d3b50d4fa6a5b4d32f12cef1902ee73e523d476fde8306eb0d3fabfa4ba92c278af67bb7281606472f90bdd58558253a6afb40ea1d62283a8b461a66a6f931cf6a7c2466f7cfb939e7b5515fbed3747b5eb8f06eb78d35080a2ec9719c76f98049a0b4ebdd37d1bad869acbf0b03c5c16b29444adf50ded41995f68564a263a66b31cd02be152505493f51c1a088bab69ad1bc179e320f07c37c8a0692b46c4995f0381db39a0b2fc34e971d57d4705bc8db6c50ef9dd97b81fcbf7381528f5ae97a1d8e996d1db69b0c7648855b10a81b80f43c739c54134147b9a036063279fb5046e957726a0f2cfe04915b06db1788305ffeac7a0a00d72f8d9c491c06337533050ac7185cf2df6a06da2da4293488f34973328c34aea428c9ec3eded40ee7d2ad249448f6b133820ee2833df3fde819ea96897461b05b87815f2ee919e5d47704fa039ab079b3e326b70eafd4ef6d6650d8e9ebf868b69c8247723efebf2aa280eb9193ebedc5002a124e015340018fb8fde82cf32b1603d0678cd02406dce3008e47ce81b499c331383c9c9f5a2e9c69377369f7d6f796a4acf148acb83fb511e91b3b3d0bab745b7d45acedd8e3732b71b1fd73f7a5a19eafd09a56a0a96b1c705b49c48510761ce4fcfbd4d0d752826b2b583476fc3daacb295b79d768de8a32b1e71f989e49f6a7d14dd1af5ba275a45b8b093c054492ea769092373765c1da4679fbd306e36ba9595fe9f0dcdbcc92c33e1579cf27d0d409ea178f68521b6b76926ee8a7853f7ff140bc768d78f6f73748d1cd103b543f0091cf6efc502f7319dac194371d8b6326829f0c501d7ae6fa568d5d4942c806d4db81839f53c8cd59456fae6e628749b5bab8b1865b08e4726588ec11e7f2e49071c93da9a31dd4341d675e9a5bad374f9858162d0b4ac70e18f0573df35a0c759f87bd53a404f174f965dfff00f479b1ef570576e34bd4b4cc0bdb3b9b7258a00e846e3f2a94376475cee4914af7ca9150685f09ba61efb52fc7dd69bf8eb7c158d1d0b47bb38f37efde968d6eeb4eb5e91d6ad25b660aee59974db6881690918e31ce39279e062a5a34bb57b88adedd1e379679065d80036679e6a07e8391bce7e940c659ef5afe1286de3b16f2b8903094b7b2fa7ce81eb380c4260ed193f2a0cd6fa5d4a4ea0fc7bdadcce923158a3039db83c038e3ef41a0e96b2ad8a35e009291b8a939d9f227e43bd590436bbd6fa269202c974b7123602c76e779624e00e29833bf897d493e896525dbcb2a6b5a9c3e1456b91b6d60cf989c7f31f7a60c02490961ebcf3eb541308e39e067b507007b96007a67fb50178f97eb4165ce18165c2927b773fad023202d9c8dbb7818ff003408300b87f2f1c107d0d0c15a4f2e339c90467f6a18bdfc2cea8ff4bd561b4b9ba686d6e64552c4f954e7d7e46a60f4688d240af1b2bc6cbf5047ca960617ba658de1b792f2d94a5ab33461b18524633fa1a81b5c8b5168967369d23c0e0a24622dc981d81c76aba29df0bb48d660d52fceb88d069f04aeb69130037127f37b9c0ed9a8350781240bbc06da72323b1f7a0eb8816e633192ebc8c9472a78fa50349b4c83c068e24f0ddbcc1c13b837be4d055b57e98b996d4db5b4a893dc1e6620b6ccf2c467efc504ce97a38d3f4d874bf09af6d46e2f25cb82724e791db15650a43f878b51fc34f3da8f132b6d6a98c80a39ff007e99aba249631b58b9047239ec3e55368aeeb7d2da6f52c0eb7f16e87f2c6e836ba90724ab7a67b55d115ac7c3e8aed2182def4c56a14096368959a423d77e3229a27b41e9d8343b01069c8a8dc9660aa3713df3c64d4a1c695d3d6b67a8cba94b9b8d4e61869e4e4a8c636a7f4afcaa09a485519caae19b966f7a0435196582c656b74df3e308beec7b50629375775b691ac5bdb6b16d6378779f019b00a31cf391c9c2f1daae0b35ef52f5374de88d77aa45a6cd25ddc0108694ee2188c28007603d6a0d16c92430a4b2ed3230dc401855cfa0a0a07c45d7b5db9d462e9ee960b14b2ee134ef8c850012147ec78ab0670b643a2efae753d72686e6e2da211db42176079c8e768f65e39f7aa332d6f58bbd635096f6fe6692695b24f603d801e82823cb900ee00e68006460051dfd680ed9f0c905b713d8d006d5f5419fa505a18f94e40501b1b81a04186d62402c87be3d6810b81290aea8467201231cd1749dbc437f9f1e201db3de8ba07dc0175c027f28a335b17c26f888d6b6d0e8fabf892a29c453b1e547f49f7a946d6424f08236491c833ee0835073294888894120700f0280813c40a6711bc8843e00fca7d3ef40e41dc081f9a811681c6f7565329185623b7e9de812b3bcf11ff0b74563bd50494cf120071b97e5fda80d7577046c9019d5669dbc340324eec67fb734103d5da96bf67a7cf0e916f6e2765f25ddc4c11107ab1c8c647cce2816d3ec7f0f6564cae6e67da375e6d52cc4af2e4fb13ed4145f899d47b3499f4bb6d46cda49b69b92921565c3648e3dd40c81cd5c0ae89f13ec246d3e379ed2d6da180b5d34849da1780b128e49271c9f4a60ba685d5fa36bc42d95c324ec7090cc9b1d87b81ed50588958977cacaaa3b9341c655f12348d1dcb8dc1946540f99a019e2134454eeda7bed3839cd052fe2136b536b5d3563a1ca53c49da4b9507198940ce7e5c9fbe281c6b7a974cf4ee4ea7242d76dc784a3c595b3e9b464e3f6ad0ac745ccbd4fadcbabea42da56959a382ce7460d6b1a93c01f97272093ebf6a82f1ad6af0e9da5cb3cecf6902216919f82aa3818c7a9f4c530649a9f5269ba7429d472239bc991a1b0d3c3152880f0f23039e7bf3de90635ab6a377aa5ebdcdecef2c9239e59f3827e5ed54302195fcc38cd01245395c1f5f4a05b606538e483c501b6939e3b5077860f3914165754c33e549000dbe87de813b820c27fa7baafb8a04a69c98e281e42618c795338033df1f3a06c03e4e029247007ad010093c35674da71f977640340081a190658e41c820f141b0fc33f8926c218b4ed609366a02249bb2d19ce3ea4528dbece68eead926b7916689c643a9e0d643387521fea2f693c2d6efc786ee46d9bfed3eff2a04669edf5295ff057a60bd865309246d3bbbedc1efef41d63a8dec9ab4fa7dd4510fc3c69234ca186e2d9c003b7a67bd034bad0a5bb96e25d575267889cc1b54446d9bd0a37bfbfbd02925945a72cba8dddc48b3f87b1e58f23c623f292bdb7fa7cf38a0a5750f54ebba56a9a67fc516b6d6fd3970ea9234677c8dc7f38f6e4640ce282d1ac4b16bfa72c1d2bad430cd1ba822061865f5007d3daac19cf547c189357d561bbd3eee683c62cd786e9b73337b8c7bd512bd39f06adedec2de0d5ae639da372e6485363107f97767b505cee755d03a5e58ac228659af123184b7b733322e38c91dbf5a943ab3d52e64b49ee755d2e64950e238e35f10c884e17cbe87dc540e6d7509a4f110e9f7566a471712850abf6ce463e6280bacea36fd33a4497f773cf32c698dcc4beee33938edc7ad05534aea683ae61d64c4d2a69b6b88d16d5ca5c303f3e386cf61db140e27b5e99e96b64bdd562b6b30aa36c6c37cac7dc9eec6b42c1a66a962fa70beb6b516d0cbe76322f86c78f6c66831bf8b5d5d2dfa35a5dce60b1933b6ce3c788769f2b331ec1b8fd2831b79649984b239773c1dc68129725c1c640e73400ec781d8fb1a03c4a85d0c8582640257bd01e51fc42236263c9c67be280429c6037eb405dbf5fd682c2a0bb976cf07d3fc5009279ef8ec4e68193a9902b28e7dc71fb501d95b098e0f6dd9e0d0049131019b047b8390281bb292484e47c8500c4f242c3076bf704704739a0be7c3febfbae9a5daf23cd017c7e19fb107bb67d0f6fd6837cd2757d1fab34f4f05e37dde630b1c3a91edf4f7159103d6eb7da65fdbdf59dadb5e2460ac876ed9e1c8c060f9efe9c8a0a75cfc42d5742d2ee5a7e9dbb494b6d6b9bc930cce4f940e3cd81ed4160e98f88315e689fff0022b57664199cc5196f0c7a164ef8f98cd0589baffa68590985eb15c0db1985839f6c2919340b69d03f5285bdd6f4bf021424db4329cb153fccc3d09c76a090d3340d2f479a7bab3b38e2924e5e451cfd280d7dafe936f6c5e4bd89813b02a36589ce318a0358dc35cc4e17f9bf234cdbb78fa0c607a7340e6cec20b1596610c6934b8323226379edda81da8dcb9ec40a042f50b5bb21645473b58b11dbd7bfca8304f8add5d67a9ea8ba5d8ea72c1a4d8a952f10f2c920e368cf71e99fad5833dd0754d6ed66bdb2e9a91a5babb2a310465a57c1ddc1038e7bd5171d3748b8d46ee1ff005298dc6a764c27d4eeaee7fe1c01795881c9e7804fe940dbe287c4b6d75a1b1d1c986d62277c91bf131f4c0f6fad0663737135d3b497124924871f98e7803007d2811dc5b83903dc0a0333f03be7de8122df2c9a05a11e5f51f7a05ce7071804fca8033e5da0734020b0183bb23e5416269577ed0e5323078ceeefdff6a03dbcd62914c2f629a47c622689800879e4fbd046f9d8a2a03e31385c0e73da8b83ca590947dcaead8208e73da8849b3e19ce704f7c5015586d006431f5cf61f3a04ee586ff002481c8fe6191408f0011eb8e30682774dea9bbb5784492ca6385832e1ca95e3d2834be9df8c312e2db5eb4375080337000f1303d18763591a469baef4d755989ec6f6dae5a23e20b599406dd8e080ddbed41272f4dd8caf1c86d163910f9595882a3d718a035edd695d3b6a926b57d0ac65b10b4e06eedd863bf141077fd7af2782bd3fa26a1a8891d57c630948c0279393dcd04cf5875258f4de9f0cb7b7b6d66d2b81ba752d85f5214724fed41036bd79d2fe319d7a8f4b9c81e58de2f04827b9ce09a07a3acecf54b790685ace8697606009e52c377b7f2e682b097d7d36acf0f55df5edbdc0977412468cb6ce3be10af3c63b9c8a0b0751f505be9690dd5d752436f62a3fe4c6448f3b7b0c64e38f615734651f107e3045ac42b67a7693018633b965bc1bc838ee173807bf7cd33065baaeb1a95f2c11dfcd2bc51fe48880aa3e8a062a8b059f595df4ae9a74de9e9ec499d43c97b1427c6e47e525bb63e4282ad3ea3712893c599dbc4259c1627713c927de81043950df97db1406da8411c92063be280230839627078e79a0390a71b5bb5003a8c1232338e4507025573e9fbd02a0e41dc0e680c3691cf714053bb34160895dc16f291d98d02322aa39f3e14707ffaa06f202a5bb0c7201f4a343aca51090497efdfbfce89840c8db8e46573923ff14410b00490d9f5c1a0425dd8ce4673e873cd0265e4dbe7041ed814009b8cbb8e5863bd07163b7716e0607b6698060b96b7b9478dc8643918247ee39a60b7e97f133a8b4e0c63d4ee597380923970a3ef4c0e13e25dfcfab457ba95bdbddb212016501867b9cfbfda982f907c74b282da34874a9048aa479c83838edc62982b7ac7c42d235cd67f15ac5b40c366418a2cb0c1c81e6f5e31db14c160d035de8cd4a3f18ea96562cc37359dfe9cac887fef039fd6b39446f56ea5d13a9dca4579a922496b1975b8d22dfc3566cf9557230703be715ac1431d4d2275325d7fae6b4f6f182a93ef1e32a9f41938f6a60afeb1a95c5fea53dccf772cf2c8c489240031f627e7565c0d67bbf160487c1801073bc0c31f91f953420f2bc8c7c52cc540032738a809905c0f4fa501940208e73df34028e703938a0577ae013f4a001300db4f03b71407461ce0502dca8c9c7dcf6a003fafcbdcd0070bc1e0fd734070db467b8a04cb9c9e68274b93bcb1daa40200ed4099765249ec476cf340849b8b264823bf34689ee009cb671df1409bc8e8b8e770e3ec68984d9c953cf97be2860b248caaebc107dc67f7a184c31232db88fd451031ce50e76039f5c8045026efb8f93279e0fd680b239504f0483d88ef409ee25bb90c79c0e050151c6e21b39ce783eb40adbcc2cefa17bdb61322387781c950e3dbdf9c8a066f28790b22e013db3dbef54726081e63c6460d34191b1bb0720f634060e7600412c781502409c8e3d7b500ed71dbef8ed40243f181c0a02e5d4e0fad006f644e4819e3b501f7e3049e7b501bc43b4e391da80558003392d40a23305e320d02e64cf998e1bf5a032b0c927b8e68049c8c8e71c6280377043118f4e680bbff00de0504ddbb3128371c1c64668024e59f3cd02521254e4fad1a2107e48fe6a6809ddb9e78a029e1463d05027ffc744a6c3857c7b1a205ff00e637fbf4a02b12b1794e39f4a02024e7249ed409924720906800005173fd7404989698ee39e4f7a04cf723d07a501fff0097ed406ffe36a018ff00281e99a037f4d0731f3bfd28007e53400ff99a810248c0cf140bc60123233cff008a0557f9beb4056eff007a07109243e79a03778b27bfbd02b128c27039a054001b818a06609de793da815006070283ffd9}\par} {\pard \ql \f0 \sa180 \li0 \fi0 Here is a movie {\pict\jpegblip\picw20\pich22\picwgoal400\pichgoal440 ffd8ffe000104a46494600010101004800480000fffe0050546869732061727420697320696e20746865207075626c696320646f6d61696e2e204b6576696e204875676865732c206b6576696e68406569742e636f6d2c2053657074656d6265722031393935ffdb00430001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffdb00430101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101ffc00011080016001403012200021101031101ffc4001a000100020301000000000000000000000000080905060a07ffc400231000010501000300010500000000000000060304050708020001090a11153976b7ffc400160101010100000000000000000000000000060800ffc400261101000102050109000000000000000000010200030405061121b33134365154717475b4ffda000c03010002110311003f00a90cf388f366a62aa720ed6ae07f96901f3831d973452b8cf36fe3570fc908e46d466433e5dd954f2e96992d9e498c7753faa44916e016ca91cc7d88b38fe60a5b97737defcbcc539c98d336a57f4fc2ca9a486bf07ab575ad9a3af4df221d8215e36df86c4504ff0024574551b3d687ee0575757b3ad64e311ee62bd94158d37e24198c43973099f1fc0c41614d950246513a081abf76cfe7061f6863281e6352fd1670949c148dd6dfb0d25f5b3689b1d5c965b0eacbf4e0932ad28e22ab9ae945633f4744bd3c8cee0a7fdf085b9000f449c5f7afa30b83e0b6fd7b0c8429c9467ff9715347c891e25fa24a205861aa715e6a09bd0488237dc2723414d9891381524e8ca7c0894664f835653631ab55ee7e3de433e4ff001b30949124e4c10c8b6ad0a479b3f9c937b2cf5bc0095ad600a0a41a0e9faee174a1c605e161c6c7a313539650b0113190f1a8368e60d5b24f30ff008ea7f0bf867fa6595feeb6978f1fe0f9c26177f4d63a51a9235184750e7d18811339cd000000c75f000e00380380ae390c350def826ed42ad051fa6f501c50f9b699c3b69cbeb76476d202bf3ac985b6e0e968be66572893e6a744540bd9722e5c87956848629bc2559306bd113e8653d3b6aff651dfad7a3ac8b02958cba02a93ccf525757039bae6cff090e1d90688e8aa233ee86a4c4a3e0586d6b2340522e47dcb7d0046d8a5acb05a123ee25d2b230b2ada6e2e2f9ede3c05202520ec2487b0d56562529d8b3393bca76adca4ec1bca508abb001babc007915d84fe3dd14e207e3c62f8379da2a3b861fb6629d28dba53b6ea388ebfed866bf6dfb553455e91ed547ae92e9445253a4fdf3efb4f8ebdfbe7d3c78f1ee0bb9e13e358e942a4ed49e22cff00eeb35fdd7ebfffd9} icon.\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} -{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Footnotes\par} +{\pard \ql \f0 \sa180 \li0 \fi0 \outlinelevel0 \b \fs36 Footnotes\par} {\pard \ql \f0 \sa180 \li0 \fi0 Here is a footnote reference,{\super\chftn}{\*\footnote\chftn\~\plain\pard {\pard \ql \f0 \sa180 \li0 \fi0 Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.\par} } and another.{\super\chftn}{\*\footnote\chftn\~\plain\pard {\pard \ql \f0 \sa180 \li0 \fi0 Here\u8217's the long note. This one contains multiple blocks.\par} {\pard \ql \f0 \sa180 \li0 \fi0 Subsequent blocks are indented to show that they belong to the footnote (as with list items).\par} -- cgit v1.2.3 From 6acb674e899e37bbc352a493f956858f7102bc7d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 8 Aug 2021 11:17:28 -0700 Subject: Remove obsolete and incorrect sentence in `--slide-level` docs. --- MANUAL.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index c2d3dba14..8f57a36a4 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1027,9 +1027,7 @@ header when requesting a document from a URL: slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headings above this level in the hierarchy are used to divide the slide show into sections; headings below this level create - subheads within a slide. Note that content that is - not contained under slide-level headings will not appear in - the slide show. The default is to set the slide level based + subheads within a slide. The default is to set the slide level based on the contents of the document; see [Structuring the slide show]. -- cgit v1.2.3 From c0b68b2030ecdb4ad006443a56ce99aebc92fbc5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 8 Aug 2021 11:20:26 -0700 Subject: Allow `--slide-level=0`. When the slide level is set to 0, headings won't be used at all in splitting the document into slides. Horizontal rules must be used to separate slides. Closes #7476. --- MANUAL.txt | 12 +++++++----- src/Text/Pandoc/App/CommandLineOptions.hs | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 8f57a36a4..d4f922529 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1025,11 +1025,13 @@ header when requesting a document from a URL: : Specifies that headings with the specified level create slides (for `beamer`, `s5`, `slidy`, `slideous`, `dzslides`). Headings - above this level in the hierarchy are used to divide the - slide show into sections; headings below this level create - subheads within a slide. The default is to set the slide level based - on the contents of the document; see [Structuring the slide - show]. + above this level in the hierarchy are used to divide the slide show + into sections; headings below this level create subheads within a slide. + Valid values are 0-6. If a slide level of 0 is specified, slides will + not be split automatically on headings, and horizontal rules must be used + to indicate slide boundaries. If a slide level is not specified + explicitly, the slide level will be set automatically based on + the contents of the document; see [Structuring the slide show]. `--section-divs` diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index a6df12715..d2c12573c 100644 --- a/src/Text/Pandoc/App/CommandLineOptions.hs +++ b/src/Text/Pandoc/App/CommandLineOptions.hs @@ -576,10 +576,10 @@ options = (ReqArg (\arg opt -> case safeStrRead arg of - Just t | t >= 1 && t <= 6 -> + Just t | t >= 0 && t <= 6 -> return opt { optSlideLevel = Just t } _ -> E.throwIO $ PandocOptionError - "slide level must be a number between 1 and 6") + "slide level must be a number between 0 and 6") "NUMBER") "" -- "Force header level for slides" -- cgit v1.2.3 From 6543b05116ee58ef4de62f93dcafeb27617d83e6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 30 Jul 2021 17:23:46 -0600 Subject: Add RTF reader. - `rtf` is now supported as an input format as well as output. - New module Text.Pandoc.Readers.RTF (exporting `readRTF`). [API change] Closes #3982. --- MANUAL.txt | 1 + pandoc.cabal | 4 + src/Text/Pandoc/Readers.hs | 3 + src/Text/Pandoc/Readers/RTF.hs | 1333 ++++++++++++++++++++++++++++++++++++++++ test/Tests/Command.hs | 4 +- test/Tests/Old.hs | 5 +- test/Tests/Readers/FB2.hs | 2 +- test/Tests/Readers/RTF.hs | 48 ++ test/rtf/accent.native | 2 + test/rtf/accent.rtf | 3 + test/rtf/bookmark.native | 3 + test/rtf/bookmark.rtf | 8 + test/rtf/footnote.native | 2 + test/rtf/footnote.rtf | 11 + test/rtf/formatting.native | 10 + test/rtf/formatting.rtf | 201 ++++++ test/rtf/heading.native | 5 + test/rtf/heading.rtf | 223 +++++++ test/rtf/image.native | 2 + test/rtf/image.rtf | 6 + test/rtf/link.native | 2 + test/rtf/link.rtf | 7 + test/rtf/list_complex.native | 24 + test/rtf/list_complex.rtf | 299 +++++++++ test/rtf/list_simple.native | 8 + test/rtf/list_simple.rtf | 17 + test/rtf/table_simple.native | 31 + test/rtf/table_simple.rtf | 19 + test/rtf/unicode.native | 2 + test/rtf/unicode.rtf | 9 + test/test-pandoc.hs | 2 + 31 files changed, 2292 insertions(+), 4 deletions(-) create mode 100644 src/Text/Pandoc/Readers/RTF.hs create mode 100644 test/Tests/Readers/RTF.hs create mode 100644 test/rtf/accent.native create mode 100644 test/rtf/accent.rtf create mode 100644 test/rtf/bookmark.native create mode 100644 test/rtf/bookmark.rtf create mode 100644 test/rtf/footnote.native create mode 100644 test/rtf/footnote.rtf create mode 100644 test/rtf/formatting.native create mode 100644 test/rtf/formatting.rtf create mode 100644 test/rtf/heading.native create mode 100644 test/rtf/heading.rtf create mode 100644 test/rtf/image.native create mode 100644 test/rtf/image.rtf create mode 100644 test/rtf/link.native create mode 100644 test/rtf/link.rtf create mode 100644 test/rtf/list_complex.native create mode 100644 test/rtf/list_complex.rtf create mode 100644 test/rtf/list_simple.native create mode 100644 test/rtf/list_simple.rtf create mode 100644 test/rtf/table_simple.native create mode 100644 test/rtf/table_simple.rtf create mode 100644 test/rtf/unicode.native create mode 100644 test/rtf/unicode.rtf diff --git a/MANUAL.txt b/MANUAL.txt index d4f922529..3e8e6b0fd 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -259,6 +259,7 @@ header when requesting a document from a URL: - `odt` ([ODT]) - `opml` ([OPML]) - `org` ([Emacs Org mode]) + - `rtf` ([Rich Text Format]) - `rst` ([reStructuredText]) - `t2t` ([txt2tags]) - `textile` ([Textile]) diff --git a/pandoc.cabal b/pandoc.cabal index ef4691e3c..81c3546e7 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -376,6 +376,8 @@ extra-source-files: test/docx/*.native test/epub/*.epub test/epub/*.native + test/rtf/*.native + test/rtf/*.rtf test/pptx/*.pptx test/pptx/*.native test/ipynb/*.in.native @@ -552,6 +554,7 @@ library Text.Pandoc.Readers.DokuWiki, Text.Pandoc.Readers.Ipynb, Text.Pandoc.Readers.CSV, + Text.Pandoc.Readers.RTF, Text.Pandoc.Writers, Text.Pandoc.Writers.Native, Text.Pandoc.Writers.Docbook, @@ -798,6 +801,7 @@ test-suite test-pandoc Tests.Readers.Org.Meta Tests.Readers.Org.Shared Tests.Readers.RST + Tests.Readers.RTF Tests.Readers.Docx Tests.Readers.Odt Tests.Readers.Txt2Tags diff --git a/src/Text/Pandoc/Readers.hs b/src/Text/Pandoc/Readers.hs index 5106f8058..dd3aecdc5 100644 --- a/src/Text/Pandoc/Readers.hs +++ b/src/Text/Pandoc/Readers.hs @@ -55,6 +55,7 @@ module Text.Pandoc.Readers , readCslJson , readBibTeX , readBibLaTeX + , readRTF -- * Miscellaneous , getReader , getDefaultExtensions @@ -102,6 +103,7 @@ import Text.Pandoc.Readers.Man import Text.Pandoc.Readers.CSV import Text.Pandoc.Readers.CslJson import Text.Pandoc.Readers.BibTeX +import Text.Pandoc.Readers.RTF import qualified Text.Pandoc.UTF8 as UTF8 import Text.Pandoc.Sources (ToSources(..), sourcesToText) @@ -149,6 +151,7 @@ readers = [("native" , TextReader readNative) ,("csljson" , TextReader readCslJson) ,("bibtex" , TextReader readBibTeX) ,("biblatex" , TextReader readBibLaTeX) + ,("rtf" , TextReader readRTF) ] -- | Retrieve reader, extensions based on formatSpec (format+extensions). diff --git a/src/Text/Pandoc/Readers/RTF.hs b/src/Text/Pandoc/Readers/RTF.hs new file mode 100644 index 000000000..749a38dd3 --- /dev/null +++ b/src/Text/Pandoc/Readers/RTF.hs @@ -0,0 +1,1333 @@ +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE OverloadedStrings #-} +{- | + Module : Text.Pandoc.Readers.RTF + Copyright : Copyright (C) 2021 John MacFarlane + License : GNU GPL, version 2 or above + + Maintainer : John MacFarlane () + Stability : alpha + Portability : portable + +Conversion of RTF documents 'Pandoc' document. +We target version 1.5 of the RTF spec. +-} +module Text.Pandoc.Readers.RTF (readRTF) where + +import qualified Data.IntMap as IntMap +import qualified Data.Sequence as Seq +import Control.Monad +import Control.Monad.Except (throwError) +import Data.List (find, foldl') +import Data.Word (Word8, Word16) +import Data.Default +import Data.Text (Text) +import qualified Data.Text as T +import qualified Data.Text.Read as TR +import Text.Pandoc.Builder (Blocks, Inlines) +import qualified Text.Pandoc.Builder as B +import Text.Pandoc.Class.PandocMonad (PandocMonad (..), insertMedia) +import Text.Pandoc.Definition +import Text.Pandoc.Options +import Text.Pandoc.Parsing +import Text.Pandoc.Shared (safeRead, tshow) +import Data.Char (isAlphaNum, chr, digitToInt, isAscii, isLetter, isSpace) +import qualified Data.ByteString.Lazy as BL +import Data.Digest.Pure.SHA (sha1, showDigest) +import Data.Maybe (mapMaybe, fromMaybe) +import Safe (lastMay, initSafe, headDef) +-- import Debug.Trace + +-- TODO: +-- [ ] more complex table features +-- + +-- | Read RTF from an input string and return a Pandoc document. +readRTF :: (PandocMonad m, ToSources a) + => ReaderOptions + -> a + -> m Pandoc +readRTF opts s = do + let sources = toSources s + parsed <- readWithM parseRTF def{ sOptions = opts } sources + case parsed of + Left e -> throwError e + Right d -> return d + +data CharSet = ANSI | Mac | Pc | Pca + deriving (Show, Eq) + +-- first index is the list (or override) id, second is the list level +type ListTable = IntMap.IntMap ListLevelTable +type ListLevelTable = IntMap.IntMap ListType + +data RTFState = RTFState { sOptions :: ReaderOptions + , sCharSet :: CharSet + , sGroupStack :: [Properties] + , sListStack :: [List] + , sCurrentCell :: Blocks + , sTableRows :: [TableRow] -- reverse order + , sTextContent :: [(Properties, Text)] + , sMetadata :: [(Text, Inlines)] + , sFontTable :: FontTable + , sStylesheet :: Stylesheet + , sListTable :: ListTable + , sListOverrideTable :: ListTable + , sEatChars :: Int + } deriving (Show) + +instance Default RTFState where + def = RTFState { sOptions = def + , sCharSet = ANSI + , sGroupStack = [] + , sListStack = [] + , sCurrentCell = mempty + , sTableRows = [] + , sTextContent = [] + , sMetadata = [] + , sFontTable = mempty + , sStylesheet = mempty + , sListTable = mempty + , sListOverrideTable = mempty + , sEatChars = 0 + } + +type FontTable = IntMap.IntMap FontFamily + +data FontFamily = + Roman | Swiss | Modern | Script | Decor | Tech | Bidi + deriving (Show, Eq) + +data StyleType = ParagraphStyle | SectionStyle | CharStyle | TableStyle + deriving (Show, Eq) + +data Style = + Style { styleNum :: Int + , styleType :: StyleType + , styleBasedOn :: Maybe Int + , styleName :: Text + , styleFormatting :: [Tok] + } deriving (Show, Eq) + +type Stylesheet = IntMap.IntMap Style + +data PictType = + Emfblip | Pngblip | Jpegblip + deriving (Show, Eq) + +data Pict = + Pict { picType :: Maybe PictType + , picWidth :: Maybe Int + , picHeight :: Maybe Int + , picWidthGoal :: Maybe Int + , picHeightGoal :: Maybe Int + , picBinary :: Bool + , picData :: Text + , picName :: Text + , picBytes :: BL.ByteString + } deriving (Show, Eq) + +instance Default Pict where + def = Pict { picType = Nothing + , picWidth = Nothing + , picHeight = Nothing + , picWidthGoal = Nothing + , picHeightGoal = Nothing + , picBinary = False + , picData = mempty + , picName = mempty + , picBytes = mempty } + +data Properties = + Properties + { gBold :: Bool + , gItalic :: Bool + , gCaps :: Bool + , gDeleted :: Bool + , gSub :: Bool + , gSuper :: Bool + , gSmallCaps :: Bool + , gUnderline :: Bool + , gHyperlink :: Maybe Text + , gAnchor :: Maybe Text + , gImage :: Maybe Pict + , gFontFamily :: Maybe FontFamily + , gHidden :: Bool + , gUC :: Int -- number of ansi chars to skip after unicode char + , gFootnote :: Maybe Blocks + , gOutlineLevel :: Maybe ListLevel + , gListOverride :: Maybe Override + , gListLevel :: Maybe Int + , gInTable :: Bool + } deriving (Show, Eq) + +instance Default Properties where + def = Properties { gBold = False + , gItalic = False + , gCaps = False + , gDeleted = False + , gSub = False + , gSuper = False + , gSmallCaps = False + , gUnderline = False + , gHyperlink = Nothing + , gAnchor = Nothing + , gImage = Nothing + , gFontFamily = Nothing + , gHidden = False + , gUC = 1 + , gFootnote = Nothing + , gOutlineLevel = Nothing + , gListOverride = Nothing + , gListLevel = Nothing + , gInTable = False + } + +type RTFParser m = ParserT Sources RTFState m + +data ListType = Bullet | Ordered ListAttributes + deriving (Show, Eq) + +type Override = Int + +type ListLevel = Int + +data List = + List Override ListLevel ListType [Blocks] -- items in reverse order + deriving (Show, Eq) + +newtype TableRow = TableRow [Blocks] -- cells in reverse order + deriving (Show, Eq) + +parseRTF :: PandocMonad m => RTFParser m Pandoc +parseRTF = do + skipMany nl + toks <- many tok + -- return $! traceShowId toks + bs <- (foldM processTok mempty toks >>= emitBlocks) + unclosed <- closeContainers + let doc = B.doc $ bs <> unclosed + kvs <- sMetadata <$> getState + pure $ foldr (uncurry B.setMeta) doc kvs + +data Tok = Tok SourcePos TokContents + deriving (Show, Eq) + +data TokContents = + ControlWord Text (Maybe Int) + | ControlSymbol Char + | UnformattedText Text + | HexVal Word8 + | Grouped [Tok] + deriving (Show, Eq) + +tok :: PandocMonad m => RTFParser m Tok +tok = do + pos <- getPosition + Tok pos <$> ((controlThing <|> unformattedText <|> grouped) <* skipMany nl) + where + controlThing = do + char '\\' *> + ( (ControlWord <$> letterSequence <*> (parameter <* optional delimChar)) + <|> (HexVal <$> hexVal) + <|> (ControlSymbol <$> anyChar) ) + parameter = do + hyph <- string "-" <|> pure "" + rest <- many digit + let pstr = T.pack $ hyph <> rest + return $ safeRead pstr + hexVal = do + char '\'' + x <- hexDigit + y <- hexDigit + return $ hexToWord (T.pack [x,y]) + letterSequence = T.pack <$> many1 (satisfy (\c -> isAscii c && isLetter c)) + unformattedText = + UnformattedText . T.pack . mconcat <$> + many1 ( many1 (satisfy (not . isSpecial)) + <|> ("" <$ nl)) + grouped = Grouped <$> (char '{' *> skipMany nl *> manyTill tok (char '}')) + +nl :: PandocMonad m => RTFParser m () +nl = void (char '\n' <|> char '\r') + +isSpecial :: Char -> Bool +isSpecial '{' = True +isSpecial '}' = True +isSpecial '\\' = True +isSpecial '\n' = True +isSpecial _ = False + +delimChar :: PandocMonad m => RTFParser m Char +delimChar = satisfy (\c -> not (isAlphaNum c || isSpecial c)) + +modifyGroup :: PandocMonad m + => (Properties -> Properties) + -> RTFParser m () +modifyGroup f = + updateState $ \st -> + st{ sGroupStack = + case sGroupStack st of + [] -> [] + (x:xs) -> f x : xs } + +addFormatting :: (Properties, Text) -> Inlines +addFormatting (_, "\n") = B.linebreak +addFormatting (props, _) | gHidden props = mempty +addFormatting (props, _) | Just bs <- gFootnote props = B.note bs +addFormatting (props, txt) = + (if gBold props then B.strong else id) . + (if gItalic props then B.emph else id) . + (if gDeleted props then B.strikeout else id) . + (if gSub props then B.subscript else id) . + (if gSuper props then B.superscript else id) . + (if gSmallCaps props then B.smallcaps else id) . + (if gUnderline props then B.underline else id) . + (case gHyperlink props of + Nothing -> id + Just linkdest -> B.link linkdest mempty) . + (case gAnchor props of + Nothing -> id + Just ident -> B.spanWith (ident,[],[])) . + (case gFontFamily props of + Just Modern -> B.code + _ -> case gImage props of + Just pict -> + let attr = ("",[], + (case picWidthGoal pict of + Nothing -> [] + Just w -> [("width", tshow (fromIntegral w / 1440 + :: Double) + <> "in")]) ++ + (case picHeightGoal pict of + Nothing -> [] + Just h -> [("height", tshow (fromIntegral h / 1440 + :: Double) + <> "in")])) + in B.imageWith attr (picName pict) "" . B.text + Nothing -> B.text) . + (if gCaps props then T.toUpper else id) + $ txt + +addText :: PandocMonad m => Text -> RTFParser m () +addText t = do + gs <- sGroupStack <$> getState + let props = case gs of + (x:_) -> x + _ -> def + updateState (\s -> s{ sTextContent = (props, t) : sTextContent s }) + +inGroup :: PandocMonad m => RTFParser m a -> RTFParser m a +inGroup p = do + updateState $ \st -> + st{ sGroupStack = + case sGroupStack st of + [] -> [def] + (x:xs) -> (x:x:xs) } -- inherit current group's properties + result <- p + updateState $ \st -> + st{ sGroupStack = + case sGroupStack st of + [] -> [] -- should not happen + (_:xs) -> xs } + return result + +getStyleFormatting :: PandocMonad m => Int -> RTFParser m [Tok] +getStyleFormatting stynum = do + stylesheet <- sStylesheet <$> getState + case IntMap.lookup stynum stylesheet of + Nothing -> return [] + Just sty -> + case styleBasedOn sty of + Just i -> (<> styleFormatting sty) <$> getStyleFormatting i + Nothing -> return $ styleFormatting sty + +isMetadataField :: Text -> Bool +isMetadataField "title" = True +isMetadataField "subject" = True +isMetadataField "author" = True +isMetadataField "manager" = True +isMetadataField "company" = True +isMetadataField "operator" = True +isMetadataField "category" = True +isMetadataField "keywords" = True +isMetadataField "comment" = True +isMetadataField "doccomm" = True +isMetadataField "hlinkbase" = True +isMetadataField "generator" = True +isMetadataField _ = False + +isHeaderFooter :: Text -> Bool +isHeaderFooter "header" = True +isHeaderFooter "headerl" = True +isHeaderFooter "headerr" = True +isHeaderFooter "headerf" = True +isHeaderFooter "footer" = True +isHeaderFooter "footerl" = True +isHeaderFooter "footerr" = True +isHeaderFooter "footerf" = True +isHeaderFooter _ = False + +boolParam :: Maybe Int -> Bool +boolParam (Just 0) = False +boolParam _ = True + +isUnderline :: Text -> Bool +isUnderline "ul" = True +isUnderline "uld" = True +isUnderline "uldash" = True +isUnderline "uldashd" = True +isUnderline "uldashdd" = True +isUnderline "uldb" = True +isUnderline "ulth" = True +isUnderline "ulthd" = True +isUnderline "ulthdash" = True +isUnderline "ulw" = True +isUnderline "ulwave" = True +isUnderline _ = False + +processTok :: PandocMonad m => Blocks -> Tok -> RTFParser m Blocks +processTok bs (Tok pos tok') = do + setPosition pos + -- ignore \* at beginning of group: + let tok'' = case tok' of + Grouped (Tok _ (ControlSymbol '*') : toks) -> Grouped toks + _ -> tok' + case tok'' of + HexVal{} -> return () + UnformattedText{} -> return () + _ -> updateState $ \s -> s{ sEatChars = 0 } + case tok'' of + Grouped (Tok _ (ControlWord "fonttbl" _) : toks) -> inGroup $ do + updateState $ \s -> s{ sFontTable = processFontTable toks } + pure bs + Grouped (Tok _ (ControlWord "field" _) : toks) -> + inGroup $ handleField bs toks + Grouped (Tok _ (ControlWord "pict" _) : toks) -> + bs <$ inGroup (handlePict toks) + Grouped (Tok _ (ControlWord "stylesheet" _) : toks) -> + bs <$ inGroup (handleStylesheet toks) + Grouped (Tok _ (ControlWord "listtext" _) : _) -> do + -- eject any previous list items...sometimes TextEdit + -- doesn't put in a \par + emitBlocks bs + Grouped (Tok _ (ControlWord "colortbl" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "listtable" _) : toks) -> + bs <$ inGroup (handleListTable toks) + Grouped (Tok _ (ControlWord "listoverridetable" _) : toks) -> + bs <$ inGroup (handleListOverrideTable toks) + Grouped (Tok _ (ControlWord "wgrffmtfilter" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "themedata" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "colorschememapping" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "datastore" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "latentstyles" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "pntxta" _) : _) -> pure bs -- TODO + Grouped (Tok _ (ControlWord "pntxtb" _) : _) -> pure bs -- TODO + Grouped (Tok _ (ControlWord "xmlnstbl" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "filetbl" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "expandedcolortbl" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "listtables" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "revtbl" _) : _) -> pure bs + Grouped (Tok _ (ControlWord "bkmkstart" _) + : Tok _ (UnformattedText t) : _) -> do + -- TODO ideally we'd put the span around bkmkstart/end, but this + -- is good for now: + modifyGroup (\g -> g{ gAnchor = Just $ T.strip t }) + addText "" + modifyGroup (\g -> g{ gAnchor = Nothing }) + pure bs + Grouped (Tok _ (ControlWord "bkmkend" _) : _) -> pure bs -- TODO + Grouped (Tok _ (ControlWord f _) : _) | isHeaderFooter f -> pure bs + Grouped (Tok _ (ControlWord "footnote" _) : toks) -> do + noteBs <- inGroup $ processDestinationToks toks + modifyGroup (\g -> g{ gFootnote = Just noteBs }) + addText "*" + modifyGroup (\g -> g{ gFootnote = Nothing }) + return bs + Grouped (Tok _ (ControlWord "info" _) : toks) -> + bs <$ inGroup (processDestinationToks toks) + Grouped (Tok _ (ControlWord f _) : toks) | isMetadataField f -> inGroup $ do + foldM_ processTok mempty toks + annotatedToks <- reverse . sTextContent <$> getState + updateState $ \s -> s{ sTextContent = [] } + let ils = B.trimInlines . mconcat $ map addFormatting annotatedToks + updateState $ \s -> s{ sMetadata = (f, ils) : sMetadata s } + pure bs + Grouped toks -> inGroup (foldM processTok bs toks) + UnformattedText t -> bs <$ do + -- return $! traceShowId $! (pos, t) + eatChars <- sEatChars <$> getState + case eatChars of + 0 -> addText t + n | n < T.length t -> do + updateState $ \s -> s{ sEatChars = 0 } + addText (T.drop n t) + | otherwise -> do + updateState $ \s -> s{ sEatChars = n - T.length t } + HexVal n -> bs <$ do + eatChars <- sEatChars <$> getState + if eatChars == 0 + then do + charset <- sCharSet <$> getState + case charset of + ANSI -> addText (T.singleton $ ansiToChar n) + Mac -> addText (T.singleton $ macToChar n) + Pc -> addText (T.singleton $ pcToChar n) + Pca -> addText (T.singleton $ pcaToChar n) + else updateState $ \s -> s{ sEatChars = eatChars - 1 } + ControlWord "ansi" _ -> bs <$ + updateState (\s -> s{ sCharSet = ANSI }) + ControlWord "mac" _ -> bs <$ + updateState (\s -> s{ sCharSet = Mac }) + ControlWord "pc" _ -> bs <$ + updateState (\s -> s{ sCharSet = Pc }) + ControlWord "pca" _ -> bs <$ + updateState (\s -> s{ sCharSet = Pca }) + ControlWord "outlinelevel" mbp -> bs <$ + modifyGroup (\g -> g{ gOutlineLevel = mbp }) + ControlWord "ls" mbp -> bs <$ + modifyGroup (\g -> g{ gListOverride = mbp }) + ControlWord "ilvl" mbp -> bs <$ + modifyGroup (\g -> g{ gListLevel = mbp }) + ControlSymbol '\\' -> bs <$ addText "\\" + ControlSymbol '{' -> bs <$ addText "{" + ControlSymbol '}' -> bs <$ addText "}" + ControlSymbol '~' -> bs <$ addText "\x00a0" + ControlSymbol '-' -> bs <$ addText "\x00ad" + ControlSymbol '_' -> bs <$ addText "\x2011" + ControlWord "trowd" _ -> bs <$ do -- add new row + updateState $ \s -> s{ sTableRows = TableRow [] : sTableRows s + , sCurrentCell = mempty } + ControlWord "cell" _ -> bs <$ do + new <- emitBlocks mempty + curCell <- (<> new) . sCurrentCell <$> getState + updateState $ \s -> s{ sTableRows = + case sTableRows s of + TableRow cs : rs -> + TableRow (curCell : cs) : rs + [] -> [TableRow [curCell]] -- shouldn't happen + , sCurrentCell = mempty } + ControlWord "intbl" _ -> bs <$ modifyGroup (\g -> g{ gInTable = True }) + ControlWord "plain" _ -> bs <$ modifyGroup (const def) + ControlWord "lquote" _ -> bs <$ addText "\x2018" + ControlWord "rquote" _ -> bs <$ addText "\x2019" + ControlWord "ldblquote" _ -> bs <$ addText "\x201C" + ControlWord "rdblquote" _ -> bs <$ addText "\x201D" + ControlWord "emdash" _ -> bs <$ addText "\x2014" + ControlWord "emspace" _ -> bs <$ addText "\x2003" + ControlWord "enspace" _ -> bs <$ addText "\x2002" + ControlWord "endash" _ -> bs <$ addText "\x2013" + ControlWord "bullet" _ -> bs <$ addText "\x2022" + ControlWord "tab" _ -> bs <$ addText "\t" + ControlWord "line" _ -> bs <$ addText "\n" + ControlSymbol '\n' -> bs <$ addText "\n" + ControlSymbol '\r' -> bs <$ addText "\n" + ControlWord "uc" (Just i) -> bs <$ modifyGroup (\g -> g{ gUC = i }) + ControlWord "cs" (Just n) -> do + getStyleFormatting n >>= foldM processTok bs + ControlWord "s" (Just n) -> do + getStyleFormatting n >>= foldM processTok bs + ControlWord "ds" (Just n) -> do + getStyleFormatting n >>= foldM processTok bs + ControlWord "f" (Just i) -> bs <$ do + fontTable <- sFontTable <$> getState + modifyGroup (\g -> g{ gFontFamily = IntMap.lookup i fontTable }) + ControlWord "u" (Just i) -> bs <$ do + st <- getState + let curgroup = case sGroupStack st of + [] -> def + (x:_) -> x + updateState $ \s -> s{ sEatChars = gUC curgroup } + -- "RTF control words generally accept signed 16-bit numbers as + -- arguments. For this reason, Unicode values greater than 32767 + -- must be expressed as negative numbers." + let codepoint :: Word16 + codepoint = fromIntegral i + addText (T.singleton (chr $ fromIntegral codepoint)) + ControlWord "caps" mbp -> bs <$ + modifyGroup (\g -> g{ gCaps = boolParam mbp }) + ControlWord "deleted" mbp -> bs <$ + modifyGroup (\g -> g{ gDeleted = boolParam mbp }) + ControlWord "b" mbp -> bs <$ + modifyGroup (\g -> g{ gBold = boolParam mbp }) + ControlWord "i" mbp -> bs <$ + modifyGroup (\g -> g{ gItalic = boolParam mbp }) + ControlWord "sub" mbp -> bs <$ + modifyGroup (\g -> g{ gSub = boolParam mbp }) + ControlWord "super" mbp -> bs <$ + modifyGroup (\g -> g{ gSuper = boolParam mbp }) + ControlWord "up" mbp -> bs <$ + modifyGroup (\g -> g{ gSuper = boolParam mbp }) + ControlWord "strike" mbp -> bs <$ + modifyGroup (\g -> g{ gDeleted = boolParam mbp }) + ControlWord "strikedl" mbp -> bs <$ + modifyGroup (\g -> g{ gDeleted = boolParam mbp }) + ControlWord "striked" mbp -> bs <$ + modifyGroup (\g -> g{ gDeleted = boolParam mbp }) + ControlWord "scaps" mbp -> bs <$ + modifyGroup (\g -> g{ gSmallCaps = boolParam mbp }) + ControlWord "v" mbp -> bs <$ + modifyGroup (\g -> g{ gHidden = boolParam mbp }) + ControlWord x mbp | isUnderline x -> bs <$ + modifyGroup (\g -> g{ gUnderline = boolParam mbp }) + ControlWord "ulnone" _ -> bs <$ + modifyGroup (\g -> g{ gUnderline = False }) + ControlWord "pard" _ -> bs <$ do + modifyGroup (const def) + getStyleFormatting 0 >>= foldM processTok bs + ControlWord "par" _ -> emitBlocks bs + _ -> pure bs + +processDestinationToks :: PandocMonad m => [Tok] -> RTFParser m Blocks +processDestinationToks toks = do + textContent <- sTextContent <$> getState + liststack <- sListStack <$> getState + updateState $ \s -> s{ sTextContent = mempty + , sListStack = [] } + result <- inGroup $ + foldM processTok mempty toks >>= emitBlocks + unclosed <- closeContainers + updateState $ \s -> s{ sTextContent = textContent + , sListStack = liststack } + return $ result <> unclosed + +-- close lists >= level +closeLists :: PandocMonad m => Int -> RTFParser m Blocks +closeLists lvl = do + lists <- sListStack <$> getState + case lists of + (List _ lvl' lt items : rest) | lvl' >= lvl -> do + let newlist = (case lt of + Bullet -> B.bulletList + Ordered listAttr -> B.orderedListWith listAttr) + (reverse items) + updateState $ \s -> s{ sListStack = rest } + case rest of + [] -> do + updateState $ \s -> s{ sListStack = rest } + pure newlist + (List lo lvl'' lt' [] : rest') -> do -- should not happen + updateState $ \s -> s{ sListStack = + List lo lvl'' lt' [newlist] : rest' } + closeLists lvl + (List lo lvl'' lt' (i:is) : rest') -> do + updateState $ \s -> s{ sListStack = + List lo lvl'' lt' (i <> newlist : is) : rest' } + closeLists lvl + _ -> pure mempty + +closeTable :: PandocMonad m => RTFParser m Blocks +closeTable = do + rawrows <- sTableRows <$> getState + if null rawrows + then return mempty + else do + let getCells (TableRow cs) = reverse cs + let rows = map getCells . reverse $ rawrows + updateState $ \s -> s{ sCurrentCell = mempty + , sTableRows = [] } + return $ B.simpleTable [] rows + +closeContainers :: PandocMonad m => RTFParser m Blocks +closeContainers = do + tbl <- closeTable + lists <- closeLists 0 + return $ tbl <> lists + +trimFinalLineBreak :: Inlines -> Inlines +trimFinalLineBreak ils = + case Seq.viewr (B.unMany ils) of + rest Seq.:> LineBreak -> B.Many rest + _ -> ils + +emitBlocks :: PandocMonad m => Blocks -> RTFParser m Blocks +emitBlocks bs = do + annotatedToks <- reverse . sTextContent <$> getState + updateState $ \s -> s{ sTextContent = [] } + let justCode = def{ gFontFamily = Just Modern } + let prop = case annotatedToks of + [] -> def + ((p,_):_) -> p + tbl <- if gInTable prop + then pure mempty + else closeTable + new <- + case annotatedToks of + [] -> pure mempty + _ | Just lst <- gListOverride prop + -> do + let level = fromMaybe 0 $ gListLevel prop + listOverrideTable <- sListOverrideTable <$> getState + let listType = fromMaybe Bullet $ + IntMap.lookup lst listOverrideTable >>= IntMap.lookup level + lists <- sListStack <$> getState + -- get para contents of list item + let newbs = B.para . B.trimInlines . trimFinalLineBreak . mconcat $ + map addFormatting annotatedToks + case lists of + (List lo parentlevel _lt items : cs) + | lo == lst + , parentlevel == level + -- add another item to existing list + -> do updateState $ \s -> + s{ sListStack = + List lo level listType (newbs:items) : cs } + pure mempty + | lo /= lst || level < parentlevel + -- close parent list and add new list + -> do new <- closeLists level -- close open lists > level + updateState $ \s -> + s{ sListStack = List lst level listType [newbs] : + sListStack s } + pure new + _ -> do -- add new list (level > parentlevel) + updateState $ \s -> + s{ sListStack = List lst level listType [newbs] : + sListStack s } + pure mempty + | Just lvl <- gOutlineLevel prop + -> do + lists <- closeLists 0 + pure $ lists <> + B.header (lvl + 1) + (B.trimInlines . mconcat $ map addFormatting + $ removeCommonFormatting + annotatedToks) + | all ((== justCode) . fst) annotatedToks + -> do + lists <- closeLists 0 + pure $ lists <> + B.codeBlock (mconcat $ map snd annotatedToks) + | all (T.all isSpace . snd) annotatedToks + -> closeLists 0 + | otherwise -> do + lists <- closeLists 0 + pure $ lists <> + B.para (B.trimInlines . trimFinalLineBreak . mconcat + $ map addFormatting annotatedToks) + if gInTable prop + then do + updateState $ \s -> s{ sCurrentCell = sCurrentCell s <> new } + pure bs + else do + pure $ bs <> tbl <> new + +-- Headers often have a style applied. We usually want to remove +-- this, because headers will have their own styling in the target +-- format. +removeCommonFormatting :: [(Properties, Text)] -> [(Properties, Text)] +removeCommonFormatting = + (\ts -> + if all (gBold . fst) ts + then map (\(p,t) -> (p{ gBold = False }, t)) ts + else ts) . + (\ts -> + if all (gItalic . fst) ts + then map (\(p,t) -> (p{ gItalic = False }, t)) ts + else ts) + + +-- {\field{\*\fldinst{HYPERLINK "http://pandoc.org"}}{\fldrslt foo}} +handleField :: PandocMonad m => Blocks -> [Tok] -> RTFParser m Blocks +handleField bs + (Tok _ + (Grouped + (Tok _ (ControlSymbol '*') + :Tok _ (ControlWord "fldinst" Nothing) + :Tok _ (Grouped (Tok _ (UnformattedText insttext):rest)) + :_)) + :linktoks) + | Just linkdest <- getHyperlink insttext + = do let linkdest' = case rest of + (Tok _ (ControlSymbol '\\') + : Tok _ (UnformattedText t) + : _) | Just bkmrk <- T.stripPrefix "l" t + -> "#" <> unquote bkmrk + _ -> linkdest + modifyGroup $ \g -> g{ gHyperlink = Just linkdest' } + result <- foldM processTok bs linktoks + modifyGroup $ \g -> g{ gHyperlink = Nothing } + return result +handleField bs _ = pure bs + +unquote :: Text -> Text +unquote = T.dropWhile (=='"') . T.dropWhileEnd (=='"') . T.strip + +handleListTable :: PandocMonad m => [Tok] -> RTFParser m () +handleListTable toks = do + mapM_ handleList toks + +handleList :: PandocMonad m => Tok -> RTFParser m () +handleList (Tok _ (Grouped (Tok _ (ControlWord "list" _) : toks))) = do + let listid = headDef 0 [n | Tok _ (ControlWord "listid" (Just n)) <- toks] + let levels = [ts | Tok _ (Grouped (Tok _ (ControlWord "listlevel" _) : ts)) + <- toks] + tbl <- foldM handleListLevel mempty (zip [0..] levels) + updateState $ \s -> s{ sListTable = IntMap.insert listid tbl $ sListTable s } +handleList _ = return () + +handleListLevel :: PandocMonad m + => ListLevelTable + -> (Int, [Tok]) + -> RTFParser m ListLevelTable +handleListLevel levelTable (lvl, toks) = do + let start = headDef 1 + [n | Tok _ (ControlWord "levelstartat" (Just n)) <- toks] + let mbNumberStyle = + case [n | Tok _ (ControlWord "levelnfc" (Just n)) <- toks] of + [] -> Nothing + (0:_) -> Just Decimal + (1:_) -> Just UpperRoman + (2:_) -> Just LowerRoman + (3:_) -> Just UpperAlpha + (4:_) -> Just LowerAlpha + (23:_) -> Nothing + (255:_) -> Nothing + _ -> Just DefaultStyle + let listType = case mbNumberStyle of + Nothing -> Bullet + Just numStyle -> Ordered (start,numStyle,Period) + return $ IntMap.insert lvl listType levelTable + +handleListOverrideTable :: PandocMonad m => [Tok] -> RTFParser m () +handleListOverrideTable toks = mapM_ handleListOverride toks + +handleListOverride :: PandocMonad m => Tok -> RTFParser m () +handleListOverride + (Tok _ (Grouped (Tok _ (ControlWord "listoverride" _) : toks))) = do + let listid = headDef 0 [n | Tok _ (ControlWord "listid" (Just n)) <- toks] + let lsn = headDef 0 [n | Tok _ (ControlWord "ls" (Just n)) <- toks] + -- TODO override stuff, esp. start num -- for now we just handle indirection + listTable <- sListTable <$> getState + case IntMap.lookup listid listTable of + Nothing -> return () + Just tbl -> updateState $ \s -> + s{ sListOverrideTable = IntMap.insert lsn tbl $ + sListOverrideTable s } +handleListOverride _ = return () + +handleStylesheet :: PandocMonad m => [Tok] -> RTFParser m () +handleStylesheet toks = do + let styles = mapMaybe parseStyle toks + updateState $ \s -> s{ sStylesheet = IntMap.fromList + $ zip (map styleNum styles) styles } + +parseStyle :: Tok -> Maybe Style +parseStyle (Tok _ (Grouped toks)) = do + let (styType, styNum, rest) = + case toks of + Tok _ (ControlWord "s" (Just n)) : ts -> (ParagraphStyle, n, ts) + Tok _ (ControlWord "ds" (Just n)) : ts -> (SectionStyle, n, ts) + Tok _ (ControlWord "cs" (Just n)) : ts -> (CharStyle, n, ts) + Tok _ (ControlWord "ts" (Just n)) : ts -> (TableStyle, n, ts) + _ -> (ParagraphStyle, 0, toks) + let styName = case lastMay rest of + Just (Tok _ (UnformattedText t)) -> T.dropWhileEnd (==';') t + _ -> mempty + let isBasedOn (Tok _ (ControlWord "sbasedon" (Just _))) = True + isBasedOn _ = False + let styBasedOn = case find isBasedOn toks of + Just (Tok _ (ControlWord "sbasedon" (Just i))) -> Just i + _ -> Nothing + let isStyleControl (Tok _ (ControlWord x _)) = + x `elem` ["cs", "s", "ds", "additive", "sbasedon", "snext", + "sautoupd", "shidden", "keycode", "alt", "shift", + "ctrl", "fn"] + isStyleControl _ = False + let styFormatting = filter (not . isStyleControl) (initSafe rest) + return $ Style{ styleNum = styNum + , styleType = styType + , styleBasedOn = styBasedOn + , styleName = styName + , styleFormatting = styFormatting + } +parseStyle _ = Nothing + +hexToWord :: Text -> Word8 +hexToWord t = case TR.hexadecimal t of + Left _ -> 0 + Right (x,_) -> x + + +handlePict :: PandocMonad m => [Tok] -> RTFParser m () +handlePict toks = do + let pict = foldl' getPictData def toks + let altText = "image" + let binToWord = T.foldl' (\acc x -> acc * 2 + fromIntegral (digitToInt x)) 0 + let isBinaryDigit '0' = True + isBinaryDigit '1' = True + isBinaryDigit _ = False + let bytes = BL.pack $ + if picBinary pict && T.all isBinaryDigit (picData pict) + then map binToWord $ T.chunksOf 8 $ picData pict + else map hexToWord $ T.chunksOf 2 $ picData pict + let (mimetype, ext) = + case picType pict of + Just Emfblip -> (Just "image/x-emf", ".emf") + Just Pngblip -> (Just "image/png", ".png") + Just Jpegblip -> (Just "image/jpeg", ".jpg") + Nothing -> (Nothing, "") + case mimetype of + Just mt -> do + let pictname = showDigest (sha1 bytes) <> ext + insertMedia pictname (Just mt) bytes + modifyGroup $ \g -> g{ gImage = Just pict{ picName = T.pack pictname, + picBytes = bytes } } + addText altText + modifyGroup $ \g -> g{ gImage = Nothing } + _ -> return () + where + getPictData :: Pict -> Tok -> Pict + getPictData pict (Tok _ tok') = + case tok' of + ControlWord "emfblip" _-> pict{ picType = Just Emfblip } + ControlWord "pngblip" _-> pict{ picType = Just Pngblip } + ControlWord "jpegblip" _-> pict{ picType = Just Jpegblip } + ControlWord "picw" (Just w) -> pict{ picWidth = Just w } + ControlWord "pich" (Just h) -> pict{ picHeight = Just h } + ControlWord "picwgoal" (Just w) -> pict{ picWidthGoal = Just w } + ControlWord "pichgoal" (Just h) -> pict{ picHeightGoal = Just h } + ControlWord "bin" _ -> pict{ picBinary = True } + UnformattedText t -> pict{ picData = t } + _ -> pict + + +getHyperlink :: Text -> Maybe Text +getHyperlink t = + case T.stripPrefix "HYPERLINK" (T.strip t) of + Nothing -> Nothing + Just rest -> Just $ unquote rest + +processFontTable :: [Tok] -> FontTable +processFontTable = snd . foldl' go (0, mempty) + where + go (fontnum, tbl) (Tok _ tok') = + case tok' of + (ControlWord "f" (Just i)) -> (i, tbl) + (ControlWord "fnil" _) -> (fontnum, tbl) + (ControlWord "froman" _) -> (fontnum, IntMap.insert fontnum Roman tbl) + (ControlWord "fswiss" _) -> (fontnum, IntMap.insert fontnum Swiss tbl) + (ControlWord "fmodern" _) -> (fontnum, IntMap.insert fontnum Modern tbl) + (ControlWord "fscript" _) -> (fontnum, IntMap.insert fontnum Script tbl) + (ControlWord "fdecor" _) -> (fontnum, IntMap.insert fontnum Decor tbl) + (ControlWord "ftech" _) -> (fontnum, IntMap.insert fontnum Tech tbl) + (ControlWord "fbidi" _) -> (fontnum, IntMap.insert fontnum Bidi tbl) + (Grouped ts) -> foldl' go (fontnum, tbl) ts + _ -> (fontnum, tbl) + + +ansiToChar :: Word8 -> Char +ansiToChar i = chr $ + case i of + 128 -> 8364 + 130 -> 8218 + 131 -> 402 + 132 -> 8222 + 133 -> 8230 + 134 -> 8224 + 135 -> 8225 + 136 -> 710 + 137 -> 8240 + 138 -> 352 + 139 -> 8249 + 140 -> 338 + 142 -> 381 + 145 -> 8216 + 146 -> 8217 + 147 -> 8220 + 148 -> 8221 + 149 -> 8226 + 150 -> 8211 + 151 -> 8212 + 152 -> 732 + 153 -> 8482 + 154 -> 353 + 155 -> 8250 + 156 -> 339 + 158 -> 382 + 159 -> 376 + 173 -> 0xAD + _ -> fromIntegral i + +macToChar :: Word8 -> Char +macToChar i = chr $ + case i of + 0x80 -> 0xC4 + 0x81 -> 0xC5 + 0x82 -> 0xC7 + 0x83 -> 0xC9 + 0x84 -> 0xD1 + 0x85 -> 0xD6 + 0x86 -> 0xDC + 0x87 -> 0xE1 + 0x88 -> 0xE0 + 0x89 -> 0xE2 + 0x8A -> 0xE4 + 0x8B -> 0xE3 + 0x8C -> 0xE5 + 0x8D -> 0xE7 + 0x8E -> 0xE9 + 0x8F -> 0xE8 + 0x90 -> 0xEA + 0x91 -> 0xEB + 0x92 -> 0xED + 0x93 -> 0xEC + 0x94 -> 0xEE + 0x95 -> 0xEF + 0x96 -> 0xF1 + 0x97 -> 0xF3 + 0x98 -> 0xF2 + 0x99 -> 0xF4 + 0x9A -> 0xF6 + 0x9B -> 0xF5 + 0x9C -> 0xFA + 0x9D -> 0xF9 + 0x9E -> 0xFB + 0x9F -> 0xFC + 0xA0 -> 0xDD + 0xA1 -> 0xB0 + 0xA2 -> 0xA2 + 0xA3 -> 0xA3 + 0xA4 -> 0xA7 + 0xA5 -> 0xD7 + 0xA6 -> 0xB6 + 0xA7 -> 0xDF + 0xA8 -> 0xAE + 0xA9 -> 0xA9 + 0xAA -> 0xB2 + 0xAB -> 0xB4 + 0xAC -> 0xA8 + 0xAD -> 0xB3 + 0xAE -> 0xC6 + 0xAF -> 0xD8 + 0xB0 -> 0xB9 + 0xB1 -> 0xB1 + 0xB2 -> 0xBC + 0xB3 -> 0xBD + 0xB4 -> 0xA5 + 0xB5 -> 0xB5 + 0xBA -> 0xBE + 0xBB -> 0xAA + 0xBC -> 0xBA + 0xBE -> 0xE6 + 0xBF -> 0xF8 + 0xC0 -> 0xBF + 0xC1 -> 0xA1 + 0xC2 -> 0xAC + 0xC3 -> 0x0141 + 0xC4 -> 0x0192 + 0xC5 -> 0x02CB + 0xC7 -> 0xAB + 0xC8 -> 0xBB + 0xC9 -> 0xA6 + 0xCA -> 0xA0 + 0xCB -> 0xC0 + 0xCC -> 0xC3 + 0xCD -> 0xD5 + 0xCE -> 0x0152 + 0xCF -> 0x0153 + 0xD0 -> 0xAD + 0xD4 -> 0x0142 + 0xD6 -> 0xF7 + 0xD8 -> 0xFF + 0xD9 -> 0x0178 + 0xDB -> 0xA4 + 0xDC -> 0xD0 + 0xDD -> 0xF0 + 0xDE -> 0xDE + 0xDF -> 0xFE + 0xE0 -> 0xFD + 0xE1 -> 0xB7 + 0xE5 -> 0xC2 + 0xE6 -> 0xCA + 0xE7 -> 0xC1 + 0xE8 -> 0xCB + 0xE9 -> 0xC8 + 0xEA -> 0xCD + 0xEB -> 0xCE + 0xEC -> 0xCF + 0xED -> 0xCC + 0xEE -> 0xD3 + 0xEF -> 0xD4 + 0xF1 -> 0xD2 + 0xF2 -> 0xDA + 0xF3 -> 0xDB + 0xF4 -> 0xD9 + 0xF5 -> 0x0131 + 0xF6 -> 0x02C6 + 0xF7 -> 0x02DC + 0xF8 -> 0xAF + 0xF9 -> 0x02D8 + 0xFA -> 0x02D9 + 0xFB -> 0x02DA + 0xFC -> 0xB8 + 0xFD -> 0x02DD + 0xFE -> 0x02DB + 0xFF -> 0x02C7 + _ -> fromIntegral i + +pcToChar :: Word8 -> Char +pcToChar i = chr $ + case i of + 0x80 -> 0xc7 + 0x81 -> 0xfc + 0x82 -> 0xe9 + 0x83 -> 0xe2 + 0x84 -> 0xe4 + 0x85 -> 0xe0 + 0x86 -> 0xe5 + 0x87 -> 0xe7 + 0x88 -> 0xea + 0x89 -> 0xeb + 0x8a -> 0xe8 + 0x8b -> 0xef + 0x8c -> 0xee + 0x8d -> 0xec + 0x8e -> 0xc4 + 0x8f -> 0xc5 + 0x90 -> 0xc9 + 0x91 -> 0xe6 + 0x92 -> 0xc6 + 0x93 -> 0xf4 + 0x94 -> 0xf6 + 0x95 -> 0xf2 + 0x96 -> 0xfb + 0x97 -> 0xf9 + 0x98 -> 0xff + 0x99 -> 0xd6 + 0x9a -> 0xdc + 0x9b -> 0xa2 + 0x9c -> 0xa3 + 0x9d -> 0xa5 + 0x9e -> 0x20a7 + 0x9f -> 0x0192 + 0xa0 -> 0xe1 + 0xa1 -> 0xed + 0xa2 -> 0xf3 + 0xa3 -> 0xfa + 0xa4 -> 0xf1 + 0xa5 -> 0xd1 + 0xa6 -> 0xaa + 0xa7 -> 0xba + 0xa8 -> 0xbf + 0xa9 -> 0x2310 + 0xaa -> 0xac + 0xab -> 0xbd + 0xac -> 0xbc + 0xad -> 0xa1 + 0xae -> 0xab + 0xaf -> 0xbb + 0xb0 -> 0x2591 + 0xb1 -> 0x2592 + 0xb2 -> 0x2593 + 0xb3 -> 0x2502 + 0xb4 -> 0x2524 + 0xb5 -> 0x2561 + 0xb6 -> 0x2562 + 0xb7 -> 0x2556 + 0xb8 -> 0x2555 + 0xb9 -> 0x2563 + 0xba -> 0x2551 + 0xbb -> 0x2557 + 0xbc -> 0x255d + 0xbd -> 0x255c + 0xbe -> 0x255b + 0xbf -> 0x2510 + 0xc0 -> 0x2514 + 0xc1 -> 0x2534 + 0xc2 -> 0x252c + 0xc3 -> 0x251c + 0xc4 -> 0x2500 + 0xc5 -> 0x253c + 0xc6 -> 0x255e + 0xc7 -> 0x255f + 0xc8 -> 0x255a + 0xc9 -> 0x2554 + 0xca -> 0x2569 + 0xcb -> 0x2566 + 0xcc -> 0x2560 + 0xcd -> 0x2550 + 0xce -> 0x256c + 0xcf -> 0x2567 + 0xd0 -> 0x2568 + 0xd1 -> 0x2564 + 0xd2 -> 0x2565 + 0xd3 -> 0x2559 + 0xd4 -> 0x2558 + 0xd5 -> 0x2552 + 0xd6 -> 0x2553 + 0xd7 -> 0x256b + 0xd8 -> 0x256a + 0xd9 -> 0x2518 + 0xda -> 0x250c + 0xdb -> 0x2588 + 0xdc -> 0x2584 + 0xdd -> 0x258c + 0xde -> 0x2590 + 0xdf -> 0x2580 + 0xe0 -> 0x03b1 + 0xe1 -> 0xdf + 0xe2 -> 0x0393 + 0xe3 -> 0x03c0 + 0xe4 -> 0x03a3 + 0xe5 -> 0x03c3 + 0xe6 -> 0xb5 + 0xe7 -> 0x03c4 + 0xe8 -> 0x03a6 + 0xe9 -> 0x0398 + 0xea -> 0x03a9 + 0xeb -> 0x03b4 + 0xec -> 0x221e + 0xed -> 0x03c6 + 0xee -> 0x03b5 + 0xef -> 0x2229 + 0xf0 -> 0x2261 + 0xf1 -> 0xb1 + 0xf2 -> 0x2265 + 0xf3 -> 0x2264 + 0xf4 -> 0x2320 + 0xf5 -> 0x2321 + 0xf6 -> 0xf7 + 0xf7 -> 0x2248 + 0xf8 -> 0xb0 + 0xf9 -> 0x2219 + 0xfa -> 0xb7 + 0xfb -> 0x221a + 0xfc -> 0x207f + 0xfd -> 0xb2 + 0xfe -> 0x25a0 + 0xff -> 0xa0 + _ -> fromIntegral i + +pcaToChar :: Word8 -> Char +pcaToChar i = chr $ + case i of + 0x80 -> 0x00c7 + 0x81 -> 0x00fc + 0x82 -> 0x00e9 + 0x83 -> 0x00e2 + 0x84 -> 0x00e4 + 0x85 -> 0x00e0 + 0x86 -> 0x00e5 + 0x87 -> 0x00e7 + 0x88 -> 0x00ea + 0x89 -> 0x00eb + 0x8a -> 0x00e8 + 0x8b -> 0x00ef + 0x8c -> 0x00ee + 0x8d -> 0x00ec + 0x8e -> 0x00c4 + 0x8f -> 0x00c5 + 0x90 -> 0x00c9 + 0x91 -> 0x00e6 + 0x92 -> 0x00c6 + 0x93 -> 0x00f4 + 0x94 -> 0x00f6 + 0x95 -> 0x00f2 + 0x96 -> 0x00fb + 0x97 -> 0x00f9 + 0x98 -> 0x00ff + 0x99 -> 0x00d6 + 0x9a -> 0x00dc + 0x9b -> 0x00f8 + 0x9c -> 0x00a3 + 0x9d -> 0x00d8 + 0x9e -> 0x00d7 + 0x9f -> 0x0192 + 0xa0 -> 0x00e1 + 0xa1 -> 0x00ed + 0xa2 -> 0x00f3 + 0xa3 -> 0x00fa + 0xa4 -> 0x00f1 + 0xa5 -> 0x00d1 + 0xa6 -> 0x00aa + 0xa7 -> 0x00ba + 0xa8 -> 0x00bf + 0xa9 -> 0x00ae + 0xaa -> 0x00ac + 0xab -> 0x00bd + 0xac -> 0x00bc + 0xad -> 0x00a1 + 0xae -> 0x00ab + 0xaf -> 0x00bb + 0xb0 -> 0x2591 + 0xb1 -> 0x2592 + 0xb2 -> 0x2593 + 0xb3 -> 0x2502 + 0xb4 -> 0x2524 + 0xb5 -> 0x00c1 + 0xb6 -> 0x00c2 + 0xb7 -> 0x00c0 + 0xb8 -> 0x00a9 + 0xb9 -> 0x2563 + 0xba -> 0x2551 + 0xbb -> 0x2557 + 0xbc -> 0x255d + 0xbd -> 0x00a2 + 0xbe -> 0x00a5 + 0xbf -> 0x2510 + 0xc0 -> 0x2514 + 0xc1 -> 0x2534 + 0xc2 -> 0x252c + 0xc3 -> 0x251c + 0xc4 -> 0x2500 + 0xc5 -> 0x253c + 0xc6 -> 0x00e3 + 0xc7 -> 0x00c3 + 0xc8 -> 0x255a + 0xc9 -> 0x2554 + 0xca -> 0x2569 + 0xcb -> 0x2566 + 0xcc -> 0x2560 + 0xcd -> 0x2550 + 0xce -> 0x256c + 0xcf -> 0x00a4 + 0xd0 -> 0x00f0 + 0xd1 -> 0x00d0 + 0xd2 -> 0x00ca + 0xd3 -> 0x00cb + 0xd4 -> 0x00c8 + 0xd5 -> 0x0131 + 0xd6 -> 0x00cd + 0xd7 -> 0x00ce + 0xd8 -> 0x00cf + 0xd9 -> 0x2518 + 0xda -> 0x250c + 0xdb -> 0x2588 + 0xdc -> 0x2584 + 0xdd -> 0x00a6 + 0xde -> 0x00cc + 0xdf -> 0x2580 + 0xe0 -> 0x00d3 + 0xe1 -> 0x00df + 0xe2 -> 0x00d4 + 0xe3 -> 0x00d2 + 0xe4 -> 0x00f5 + 0xe5 -> 0x00d5 + 0xe6 -> 0x00b5 + 0xe7 -> 0x00fe + 0xe8 -> 0x00de + 0xe9 -> 0x00da + 0xea -> 0x00db + 0xeb -> 0x00d9 + 0xec -> 0x00fd + 0xed -> 0x00dd + 0xee -> 0x00af + 0xef -> 0x00b4 + 0xf0 -> 0x00ad + 0xf1 -> 0x00b1 + 0xf2 -> 0x2017 + 0xf3 -> 0x00be + 0xf4 -> 0x00b6 + 0xf5 -> 0x00a7 + 0xf6 -> 0x00f7 + 0xf7 -> 0x00b8 + 0xf8 -> 0x00b0 + 0xf9 -> 0x00a8 + 0xfa -> 0x00b7 + 0xfb -> 0x00b9 + 0xfc -> 0x00b3 + 0xfd -> 0x00b2 + 0xfe -> 0x25a0 + 0xff -> 0x00a0 + _ -> fromIntegral i diff --git a/test/Tests/Command.hs b/test/Tests/Command.hs index 539be1a1a..c197fd11f 100644 --- a/test/Tests/Command.hs +++ b/test/Tests/Command.hs @@ -96,7 +96,7 @@ dropPercent xs = xs runCommandTest :: FilePath -> FilePath -> Int -> String -> TestTree runCommandTest testExePath fp num code = - goldenTest testname getExpected getActual compareValues updateGolden + goldenTest testname getExpected getActual compareValues' updateGolden where testname = "#" <> show num codelines = lines code @@ -109,7 +109,7 @@ runCommandTest testExePath fp num code = norm = unlines normlines getExpected = return norm getActual = snd <$> execTest testExePath cmd input - compareValues expected actual + compareValues' expected actual | actual == expected = return Nothing | otherwise = return $ Just $ "--- test/command/" ++ fp ++ "\n+++ " ++ cmd ++ "\n" ++ showDiff (1,1) diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs index ad9f249c4..4baa16d45 100644 --- a/test/Tests/Old.hs +++ b/test/Tests/Old.hs @@ -175,7 +175,7 @@ tests pandocPath = "tikiwiki-reader.tikiwiki" "tikiwiki-reader.native" ] , testGroup "other writers" $ map (\f -> testGroup f $ writerTests' f) [ "opendocument" , "context" , "texinfo", "icml", "tei" - , "man" , "plain" , "rtf", "org", "asciidoc", "asciidoctor" + , "man" , "plain" , "asciidoc", "asciidoctor" , "xwiki", "zimwiki" ] , testGroup "writers-lang-and-dir" @@ -207,7 +207,10 @@ tests pandocPath = , testGroup "org" [ test' "reader" ["-r", "org", "-w", "native", "-s"] "org-select-tags.org" "org-select-tags.native" + , testGroup "writer" $ writerTests' "org" ] + , testGroup "rtf" + [ testGroup "writer" $ writerTests' "rtf" ] , testGroup "ipynb" [ test' "reader" ["-f", "ipynb-raw_html-raw_tex+raw_attribute", "-t", "native", "-s"] diff --git a/test/Tests/Readers/FB2.hs b/test/Tests/Readers/FB2.hs index 42054a235..d540f8b6a 100644 --- a/test/Tests/Readers/FB2.hs +++ b/test/Tests/Readers/FB2.hs @@ -7,7 +7,7 @@ Stability : alpha Portability : portable -Tests for the EPUB mediabag. +Tests for the FB2 reader. -} module Tests.Readers.FB2 (tests) where diff --git a/test/Tests/Readers/RTF.hs b/test/Tests/Readers/RTF.hs new file mode 100644 index 000000000..2a741bba8 --- /dev/null +++ b/test/Tests/Readers/RTF.hs @@ -0,0 +1,48 @@ +{- | + Module : Tests.Readers.RTF + Copyright : © 2021 John MacFarlane + License : GNU GPL, version 2 or above + + Maintainer : jgm@berkeley.edu + Stability : alpha + Portability : portable + +Tests for the RTF reader. +-} +module Tests.Readers.RTF (tests) where + +import Test.Tasty +import Tests.Helpers +import Test.Tasty.Golden (goldenVsString) +import qualified Data.ByteString as BS +import Text.Pandoc +import Text.Pandoc.UTF8 (toText, fromStringLazy) +import Data.Text (Text, unpack) +import System.FilePath (replaceExtension, (), (<.>)) + +rtfToNative :: Text -> Text +rtfToNative = + purely (writeNative def{ writerTemplate = Just mempty }) . + purely (readRTF def) + +rtfTest :: TestName -> TestTree +rtfTest name = goldenVsString name native + (fromStringLazy . filter (/='\r') . unpack . rtfToNative . toText + <$> BS.readFile path) + where native = replaceExtension path ".native" + path = "rtf" name <.> "rtf" + +tests :: [TestTree] +tests = map rtfTest [ "footnote" + , "accent" + , "unicode" + , "image" + , "link" + , "heading" + , "formatting" + , "list_simple" + , "list_complex" + , "bookmark" + , "table_simple" + ] + diff --git a/test/rtf/accent.native b/test/rtf/accent.native new file mode 100644 index 000000000..bea6364de --- /dev/null +++ b/test/rtf/accent.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Str "le",Space,Str "caf\233",Space,Str "o\249",Space,Str "on",Space,Str "ne",Space,Str "fume",Space,Str "pas"]] diff --git a/test/rtf/accent.rtf b/test/rtf/accent.rtf new file mode 100644 index 000000000..8438d46eb --- /dev/null +++ b/test/rtf/accent.rtf @@ -0,0 +1,3 @@ +{\rtf1\ansi +{ le caf\'e9 o\'f9 on ne fume pas } +} diff --git a/test/rtf/bookmark.native b/test/rtf/bookmark.native new file mode 100644 index 000000000..bc5b67afc --- /dev/null +++ b/test/rtf/bookmark.native @@ -0,0 +1,3 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Span ("bookmark_1",[],[]) [],Str "Bookmark_1"] +,Para [Link ("",[],[]) [Str "click",Space,Str "me"] ("#bookmark_1","")]] diff --git a/test/rtf/bookmark.rtf b/test/rtf/bookmark.rtf new file mode 100644 index 000000000..6e37ee71a --- /dev/null +++ b/test/rtf/bookmark.rtf @@ -0,0 +1,8 @@ +{\rtf1\ansi +\pard +{\*\bkmkstart bookmark_1}Bookmark_1{\*\bkmkend bookmark_1} +\par +\pard +{\field{\*\fldinst { HYPERLINK \\l "bookmark_1" }}{\fldrslt{click me}}} +\par +} diff --git a/test/rtf/footnote.native b/test/rtf/footnote.native new file mode 100644 index 000000000..f2893be7e --- /dev/null +++ b/test/rtf/footnote.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Str "Mead's",Space,Str "landmark",Space,Str "study",Space,Str "has",Space,Str "been",Space,Str "amply",Space,Str "annotated.",Note [Para [Str "See",Space,Str "Sahlins,",Space,Str "Bateson,",Space,Str "and",Space,Str "Geertz",Space,Str "for",Space,Str "a",Space,Str "complete",Space,Str "bibliography."]],Space,Str "It",Space,Str "was",Space,Str "her",Space,Str "work",Space,Str "in",Space,Str "America",Space,Str "during",Space,Str "the",Space,Str "Second",Space,Str "World",Space,Str "War,",Space,Str "however,",Space,Str "that",Space,Str "forms",Space,Str "the",Space,Str "basis",Space,Str "for",Space,Str "the",Space,Str "paper.",Space,Str "As",Space,Str "others",Space,Str "have",Space,Str "noted,",Note [Para [Str "A",Space,Str "complete",Space,Str "bibliography",Space,Str "will",Space,Str "be",Space,Str "found",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "this",Space,Str "chapter."]],Space,Str "this",Space,Str "period",Space,Str "was",Space,Str "a",Space,Str "turning",Space,Str "point",Space,Str "for",Space,Str "Margaret",Space,Str "Mead."]] diff --git a/test/rtf/footnote.rtf b/test/rtf/footnote.rtf new file mode 100644 index 000000000..afc119eff --- /dev/null +++ b/test/rtf/footnote.rtf @@ -0,0 +1,11 @@ +{\rtf1\ansi +\ftnbj\ftnrestart \sectd \linemod0\linex0\endnhere \pard\plain +\ri1170 \fs20 {\pu6 Mead's landmark study has been amply annotated.\chftn +{\footnote \pard\plain \s246 \fs20 {\up6\chftn } +See Sahlins, Bateson, and Geertz for a complete bibliography.} It was +her work in America during the Second World War, however, that forms +the basis for the paper. As others have noted,\chftn +{\footnote \pard\plain \s246 \fs20 {\up6\chftn} +A complete bibliography will be found at the end of this chapter.} +this period was a turning point for Margaret Mead.} +\par} diff --git a/test/rtf/formatting.native b/test/rtf/formatting.native new file mode 100644 index 000000000..54e61bf97 --- /dev/null +++ b/test/rtf/formatting.native @@ -0,0 +1,10 @@ +Pandoc (Meta {unMeta = fromList [("operator",MetaInlines [Str "John",Space,Str "MacFarlane"])]}) +[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "test",Space,Str "of",Space,Str "FORMATTING.",Space,Str "This",Space,Str "is",Space,Str "hidden:",Space,Str "."] +,Para [SmallCaps [Str "Small",Space,Str "Caps"]] +,Para [Strong [Str "bold"]] +,Para [Emph [Str "italics"]] +,Para [Strong [Str "bold",Space,Emph [Str "and",Space,Str "italics"]]] +,Para [Underline [Str "underlined"]] +,Para [Strikeout [Str "strikeout"]] +,Para [Str "x",Superscript [Str "superscript"]] +,Para [Str "x",Subscript [Str "subscript"]]] diff --git a/test/rtf/formatting.rtf b/test/rtf/formatting.rtf new file mode 100644 index 000000000..8e7b597eb --- /dev/null +++ b/test/rtf/formatting.rtf @@ -0,0 +1,201 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f4\fbidi \fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Helvetica;} +{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;} +{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1068\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f1069\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f1071\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f1072\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f1073\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\f1074\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f1075\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f1076\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f1108\fbidi \fnil\fcharset238\fprq2 Helvetica CE;} +{\f1109\fbidi \fnil\fcharset204\fprq2 Helvetica Cyr;}{\f1111\fbidi \fnil\fcharset161\fprq2 Helvetica Greek;}{\f1112\fbidi \fnil\fcharset162\fprq2 Helvetica Tur;}{\f1115\fbidi \fnil\fcharset186\fprq2 Helvetica Baltic;} +{\f1116\fbidi \fnil\fcharset163\fprq2 Helvetica (Vietnamese);}{\f1408\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f1409\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f1411\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;} +{\f1412\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f1415\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f1416\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);} +{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\fhimajor\f31529\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;} +{\fhimajor\f31531\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;}{\fhimajor\f31532\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;}{\fhimajor\f31533\fbidi \fswiss\fcharset177\fprq2 Calibri Light (Hebrew);} +{\fhimajor\f31534\fbidi \fswiss\fcharset178\fprq2 Calibri Light (Arabic);}{\fhimajor\f31535\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;}{\fhimajor\f31536\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);} +{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; +\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green0\blue0;\red0\green0\blue0;}{\*\defchp \fs24\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap +\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 +\fs24\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv +\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 +\snext11 \ssemihidden \sunhideused Normal Table;}}{\*\rsidtbl \rsid2168431\rsid14113975}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator John MacFarlane} +{\creatim\yr2021\mo8\dy4\hr17\min1}{\revtim\yr2021\mo8\dy4\hr17\min2}{\version2}{\edmins1}{\nofpages1}{\nofwords21}{\nofchars120}{\nofcharsws140}{\vern6543}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}} +\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120\dghorigin1701 +\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot2168431 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2 +\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs24\alang1025 \ltrch\fcs0 +\fs24\lang1033\langfe1033\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid14113975 \hich\af4\dbch\af31505\loch\f4 This is a test of }{\rtlch\fcs1 \af4 \ltrch\fcs0 +\caps\f4\insrsid14113975\charrsid2168431 \hich\af4\dbch\af31505\loch\f4 formatting}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid14113975 .}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid2168431 \hich\af4\dbch\af31505\loch\f4 This is hidden: }{\rtlch\fcs1 \af4 +\ltrch\fcs0 \v\f4\insrsid2168431\charrsid2168431 \hich\af4\dbch\af31505\loch\f4 secret}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid2168431 .}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid14113975 +\par }{\rtlch\fcs1 \af4 \ltrch\fcs0 \scaps\f4\insrsid14113975\charrsid2168431 \hich\af4\dbch\af31505\loch\f4 Small Caps +\par }{\rtlch\fcs1 \ab\af4 \ltrch\fcs0 \b\f4\insrsid14113975 \hich\af4\dbch\af31505\loch\f4 bold}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid14113975 +\par }{\rtlch\fcs1 \ai\af4 \ltrch\fcs0 \i\f4\insrsid14113975 \hich\af4\dbch\af31505\loch\f4 italics}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid14113975 +\par }{\rtlch\fcs1 \ab\af4 \ltrch\fcs0 \b\f4\insrsid14113975 \hich\af4\dbch\af31505\loch\f4 bold }{\rtlch\fcs1 \ab\ai\af4 \ltrch\fcs0 \b\i\f4\insrsid14113975 \hich\af4\dbch\af31505\loch\f4 and italics}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid14113975 +\par }{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\ul\insrsid14113975 \hich\af4\dbch\af31505\loch\f4 underlined}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid14113975 +\par }{\rtlch\fcs1 \af4 \ltrch\fcs0 \strike\f4\insrsid14113975 \hich\af4\dbch\af31505\loch\f4 strikeout +\par }{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid14113975 \hich\af4\dbch\af31505\loch\f4 x}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\super\insrsid14113975 \hich\af4\dbch\af31505\loch\f4 superscript}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid14113975 +\par \hich\af4\dbch\af31505\loch\f4 x}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\sub\insrsid14113975 \hich\af4\dbch\af31505\loch\f4 subscript}{\rtlch\fcs1 \af4 \ltrch\fcs0 \f4\insrsid14113975 +\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a +9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad +5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 +b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 +0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 +a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f +c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 +0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 +a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 +6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b +4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b +4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100b6f4679893070000c9200000160000007468656d652f7468656d652f +7468656d65312e786d6cec59cd8b1bc915bf07f23f347d97f5d5ad8fc1f2a24fcfda33b6b164873dd648a5eef2547789aad28cc56208de532e81c026e49085bd +ed21842cecc22eb9e48f31d8249b3f22afaa5bdd5552c99e191c3061463074977eefd5afde7bf5de53d5ddcf5e26d4bbc05c1096f6fcfa9d9aefe174ce16248d +7afeb3d9a4d2f13d2151ba4094a5b8e76fb0f03fbbf7eb5fdd454732c609f6403e1547a8e7c752ae8eaa5531876124eeb0154ee1bb25e30992f0caa3ea82a34b +d09bd06aa3566b55134452df4b51026a1f2f97648ebd9952e9dfdb2a1f53784da5500373caa74a35b6243476715e5708b11143cabd0b447b3eccb3609733fc52 +fa1e4542c2173dbfa6fffceabdbb5574940b517940d6909be8bf5c2e17589c37f49c3c3a2b260d823068f50bfd1a40e53e6edc1eb7c6ad429f06a0f91c569a71 +b175b61bc320c71aa0ecd1a17bd41e35eb16ded0dfdce3dc0fd5c7c26b50a63fd8c34f2643b0a285d7a00c1feee1c3417730b2f56b50866fede1dbb5fe28685b +fa3528a6243ddf43d7c25673b85d6d0159327aec8477c360d26ee4ca4b144443115d6a8a254be5a1584bd00bc6270050408a24493db959e1259a43140f112567 +9c7827248a21f056286502866b8ddaa4d684ffea13e827ed5174849121ad780113b137a4f87862cec94af6fc07a0d537206f7ffef9cdeb1fdfbcfee9cd575fbd +79fdf77c6eadca923b466964cafdf2dd1ffef3cd6fbd7ffff0ed2f5fff319b7a172f4cfcbbbffdeedd3ffef93ef5b0e2d2146ffff4fdbb1fbf7ffbe7dfffebaf +5f3bb4f7393a33e1339260e13dc297de5396c0021dfcf119bf9ec42c46c494e8a791402952b338f48f656ca11f6d10450edc00db767cce21d5b880f7d72f2cc2 +d398af2571687c182716f094313a60dc6985876a2ec3ccb3751ab927e76b13f714a10bd7dc43945a5e1eaf579063894be530c616cd2714a5124538c5d253dfb1 +738c1dabfb8210cbaea764ce99604be97d41bc01224e93ccc899154da5d03149c02f1b1741f0b7659bd3e7de8051d7aa47f8c246c2de40d4417e86a965c6fb68 +2d51e252394309350d7e8264ec2239ddf0b9891b0b099e8e3065de78818570c93ce6b05ec3e90f21cdb8dd7e4a37898de4929cbb749e20c64ce4889d0f6394ac +5cd829496313fbb938871045de13265df05366ef10f50e7e40e941773f27d872f787b3c133c8b026a53240d4376beef0e57dccacf89d6ee8126157aae9f3c44a +b17d4e9cd131584756689f604cd1255a60ec3dfbdcc160c05696cd4bd20f62c82ac7d815580f901dabea3dc5027a25d5dcece7c91322ac909de2881de073bad9 +493c1b9426881fd2fc08bc6eda7c0ca52e7105c0633a3f37818f08f480102f4ea33c16a0c308ee835a9fc4c82a60ea5db8e375c32dff5d658fc1be7c61d1b8c2 +be04197c6d1948eca6cc7b6d3343d49aa00c9819822ec3956e41c4727f29a28aab165b3be596f6a62ddd00dd91d5f42424fd6007b4d3fb84ffbbde073a8cb77f +f9c6b10f3e4ebfe3566c25ab6b763a8792c9f14e7f7308b7dbd50c195f904fbfa919a175fa04431dd9cf58b73dcd6d4fe3ffdff73487f6f36d2773a8dfb8ed64 +7ce8306e3b99fc70e5e3743265f3027d8d3af0c80e7af4b14f72f0d46749289dca0dc527421ffc08f83db398c0a092d3279eb838055cc5f0a8ca1c4c60e1228e +b48cc799fc0d91f134462b381daafb4a492472d591f0564cc0a1911e76ea5678ba4e4ed9223becacd7d5c16656590592e5782d2cc6e1a04a66e856bb3cc02bd4 +6bb6913e68dd1250b2d721614c6693683a48b4b783ca48fa58178ce620a157f65158741d2c3a4afdd6557b2c805ae115f8c1edc1cff49e1f06200242701e07cd +f942f92973f5d6bbda991fd3d3878c69450034d8db08283ddd555c0f2e4fad2e0bb52b78da2261849b4d425b46377822869fc17974aad1abd0b8aeafbba54b2d +7aca147a3e08ad9246bbf33e1637f535c8ede6069a9a9982a6de65cf6f35430899395af5fc251c1ac363b282d811ea3717a211dcbccc25cf36fc4d32cb8a0b39 +4222ce0cae934e960d122231f728497abe5a7ee1069aea1ca2b9d51b90103e59725d482b9f1a3970baed64bc5ce2b934dd6e8c284b67af90e1b35ce1fc568bdf +1cac24d91adc3d8d1797de195df3a708422c6cd795011744c0dd413db3e682c0655891c8caf8db294c79da356fa3740c65e388ae62945714339967709dca0b3a +faadb081f196af190c6a98242f8467912ab0a651ad6a5a548d8cc3c1aafb6121653923699635d3ca2aaa6abab39835c3b60cecd8f26645de60b53531e434b3c2 +67a97b37e576b7b96ea74f28aa0418bcb09fa3ea5ea12018d4cac92c6a8af17e1a56393b1fb56bc776811fa07695226164fdd656ed8edd8a1ae19c0e066f54f9 +416e376a6168b9ed2bb5a5f5adb979b1cdce5e40f2184197bba6526857c2c92e47d0104d754f92a50dd8222f65be35e0c95b73d2f3bfac85fd60d80887955a27 +1c57826650ab74c27eb3d20fc3667d1cd66ba341e31514161927f530bbb19fc00506dde4f7f67a7cefee3ed9ded1dc99b3a4caf4dd7c5513d777f7f5c6e1bb7b +8f40d2f9b2d598749bdd41abd26df627956034e854bac3d6a0326a0ddba3c9681876ba9357be77a1c141bf390c5ae34ea5551f0e2b41aba6e877ba9576d068f4 +8376bf330efaaff23606569ea58fdc16605ecdebde7f010000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d65 +2f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d36 +3f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e +3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d985 +0528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000000000 +0000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000 +000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019020000 +7468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d0014000600080000002100b6f4679893070000c92000001600000000000000 +000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027000000 +000000000000000000009d0a00007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000980b00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax376\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 5; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 9; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 1;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 2;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 3; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 4;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 5;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 6; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 7;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 8;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 header;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footer; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index heading;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of figures; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope return;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation reference; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 line number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 page number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote text; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of authorities;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 macro;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 toa heading;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 5;\lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Closing; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Signature;\lsdsemihidden1 \lsdunhideused1 \lsdpriority1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 4; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Message Header;\lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Salutation; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Date;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Note Heading; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Block Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 FollowedHyperlink;\lsdqformat1 \lsdpriority22 \lsdlocked0 Strong; +\lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Document Map;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Plain Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 E-mail Signature; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Top of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Bottom of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal (Web);\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Acronym; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Cite;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Code;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Definition; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Keyboard;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Preformatted;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Sample;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Typewriter; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Variable;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Table;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation subject;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 No List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 6; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 6; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Contemporary;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Elegant;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Professional; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Subtle 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Subtle 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Balloon Text;\lsdpriority39 \lsdlocked0 Table Grid;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Theme;\lsdsemihidden1 \lsdlocked0 Placeholder Text; +\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdpriority60 \lsdlocked0 Light Shading;\lsdpriority61 \lsdlocked0 Light List;\lsdpriority62 \lsdlocked0 Light Grid;\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2; +\lsdpriority65 \lsdlocked0 Medium List 1;\lsdpriority66 \lsdlocked0 Medium List 2;\lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List; +\lsdpriority71 \lsdlocked0 Colorful Shading;\lsdpriority72 \lsdlocked0 Colorful List;\lsdpriority73 \lsdlocked0 Colorful Grid;\lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdpriority61 \lsdlocked0 Light List Accent 1; +\lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdsemihidden1 \lsdlocked0 Revision; +\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1; +\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdpriority72 \lsdlocked0 Colorful List Accent 1; +\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2; +\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2; +\lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3; +\lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4; +\lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdpriority62 \lsdlocked0 Light Grid Accent 4;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4; +\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5; +\lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5; +\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6; +\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6; +\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4; +\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2; +\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4; +\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4; +\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6; +\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3; +\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4; +\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4; +\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Unresolved Mention;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Link;}}{\*\datastore }} \ No newline at end of file diff --git a/test/rtf/heading.native b/test/rtf/heading.native new file mode 100644 index 000000000..fbda9ef51 --- /dev/null +++ b/test/rtf/heading.native @@ -0,0 +1,5 @@ +Pandoc (Meta {unMeta = fromList []}) +[Header 1 ("",[],[]) [Str "Heading",Space,Str "1"] +,Header 2 ("",[],[]) [Str "Heading",Space,Str "2"] +,Header 3 ("",[],[]) [Str "Heading",Space,Str "3"] +,Para [Str "Paragraph"]] diff --git a/test/rtf/heading.rtf b/test/rtf/heading.rtf new file mode 100644 index 000000000..5ed4fc229 --- /dev/null +++ b/test/rtf/heading.rtf @@ -0,0 +1,223 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;} +{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;} +{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f44\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f45\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f47\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f48\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f49\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f50\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f51\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f52\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f384\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f385\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;} +{\f387\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f388\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f391\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f392\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);} +{\f414\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f415\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\f417\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f418\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\f419\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}{\f420\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);}{\f421\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f422\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);} +{\f424\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\f425\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;}{\f427\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;}{\f428\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;} +{\f429\fbidi \fswiss\fcharset177\fprq2 Calibri Light (Hebrew);}{\f430\fbidi \fswiss\fcharset178\fprq2 Calibri Light (Arabic);}{\f431\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;}{\f432\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);} +{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\fhimajor\f31529\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;} +{\fhimajor\f31531\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;}{\fhimajor\f31532\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;}{\fhimajor\f31533\fbidi \fswiss\fcharset177\fprq2 Calibri Light (Hebrew);} +{\fhimajor\f31534\fbidi \fswiss\fcharset178\fprq2 Calibri Light (Arabic);}{\fhimajor\f31535\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;}{\fhimajor\f31536\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);} +{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31573\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}{\fhiminor\f31574\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;} +{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; +\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green0\blue0;\red0\green0\blue0;\caccentone\ctint255\cshade191\red47\green84\blue150; +\caccentone\ctint255\cshade127\red31\green55\blue99;}{\*\defchp \f31506\fs22 }{\*\defpap \ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa160\sl259\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{ +\s1\ql \li0\ri0\sb240\sl259\slmult1\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31503\afs32\alang1025 \ltrch\fcs0 +\fs32\cf19\lang1033\langfe1033\loch\f31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink15 \sqformat \spriority9 \styrsid2496039 heading 1;}{\s2\ql \li0\ri0\sb40\sl259\slmult1 +\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31503\afs26\alang1025 \ltrch\fcs0\b\fs26\cf19\lang1033\langfe1033\loch\f31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext0 \slink16 \sunhideused \sqformat \spriority9 \styrsid2496039 heading 2;}{\s3\ql \li0\ri0\sb40\sl259\slmult1\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0 \rtlch\fcs1 +\af31503\afs24\alang1025 \ltrch\fcs0 \fs24\cf20\lang1033\langfe1033\loch\f31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \slink17 \sunhideused \sqformat \spriority9 \styrsid2496039 heading 3;}{\*\cs10 \additive +\ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv +\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused +Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \af31503\afs32 \ltrch\fcs0 \fs32\cf19\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink1 \slocked \spriority9 \styrsid2496039 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \af31503\afs26 \ltrch\fcs0 +\fs26\cf19\loch\f31502\hich\af31502\dbch\af31501 \sbasedon10 \slink2 \slocked \spriority9 \styrsid2496039 Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af31503\afs24 \ltrch\fcs0 \fs24\cf20\loch\f31502\hich\af31502\dbch\af31501 +\sbasedon10 \slink3 \slocked \spriority9 \styrsid2496039 Heading 3 Char;}}{\*\rsidtbl \rsid1718450\rsid2496039\rsid2631807\rsid4616182\rsid10489260}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1 +\mwrapIndent1440\mintLim0\mnaryLim1} +{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen +\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1 +\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot2496039\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 +{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang +{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}} +\pard\plain \ltrpar\s1\ql \li0\ri0\sb240\sl259\slmult1\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid2496039 \rtlch\fcs1 \af31503\afs32\alang1025 \ltrch\fcs0 +\fs32\cf19\lang1033\langfe1033\loch\af31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af31503 \ltrch\fcs0 \insrsid2496039 \hich\af31502\dbch\af31501\loch\f31502 H\hich\af31502\dbch\af31501\loch\f31502 eading 1}{\rtlch\fcs1 +\af31503 \ltrch\fcs0 \insrsid2631807 +\par }\pard\plain \ltrpar\s2\ql \li0\ri0\sb40\sl259\slmult1\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid2496039 \rtlch\fcs1 \af31503\afs26\alang1025 \ltrch\fcs0 +\fs26\cf19\lang1033\langfe1033\loch\af31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af31503 \ltrch\fcs0 \insrsid2496039 \hich\af31502\dbch\af31501\loch\f31502 H\hich\af31502\dbch\af31501\loch\f31502 eading }{\rtlch\fcs1 +\af31503 \ltrch\fcs0 \insrsid2496039 \hich\af31502\dbch\af31501\loch\f31502 2}{\rtlch\fcs1 \af31503 \ltrch\fcs0 \insrsid2496039 +\par }\pard\plain \ltrpar\s3\ql \li0\ri0\sb40\sl259\slmult1\keep\keepn\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid2496039 \rtlch\fcs1 \af31503\afs24\alang1025 \ltrch\fcs0 +\fs24\cf20\lang1033\langfe1033\loch\af31502\hich\af31502\dbch\af31501\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af31503 \ltrch\fcs0 \insrsid2496039 \hich\af31502\dbch\af31501\loch\f31502 H\hich\af31502\dbch\af31501\loch\f31502 eading }{\rtlch\fcs1 +\af31503 \ltrch\fcs0 \insrsid2496039 \hich\af31502\dbch\af31501\loch\f31502 3}{\rtlch\fcs1 \af31503 \ltrch\fcs0 \insrsid2496039 +\par }\pard\plain \ltrpar\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 +\af31507 \ltrch\fcs0 \insrsid2496039 Paragraph +\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a +9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad +5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 +b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 +0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 +a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f +c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 +0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 +a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 +6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b +4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b +4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100d3130843c40600008b1a0000160000007468656d652f7468656d652f +7468656d65312e786d6cec595d8bdb46147d2ff43f08bd3bfe92fcb1c41b6cd9ceb6d94d42eca4e4716c8fadc98e344633de8d0981923c160aa569e943037deb +43691b48a02fe9afd936a54d217fa17746b63c638fbb9b2585a5640d8b343af7ce997bafce1d4997afdc8fa87384134e58dc708b970aae83e3211b9178d2706f +f7bbb99aeb7081e211a22cc60d778eb97b65f7c30f2ea31d11e2083b601ff31dd4704321a63bf93c1fc230e297d814c7706dcc920809384d26f951828ec16f44 +f3a542a1928f10895d274611b8bd311e932176fad2a5bbbb74dea1701a0b2e078634e949d7d8b050d8d1615122f89c0734718e106db830cf881df7f17de13a14 +7101171a6e41fdb9f9ddcb79b4b330a2628bad66d7557f0bbb85c1e8b0a4e64c26836c52cff3bd4a33f3af00546ce23ad54ea553c9fc29001a0e61a52917d367 +b514780bac064a0f2dbedbd576b968e035ffe50dce4d5ffe0cbc02a5febd0d7cb71b40140dbc02a5787f03efb7eaadb6e95f81527c65035f2d34db5ed5f0af40 +2125f1e106bae057cac172b51964cce89e155ef7bd6eb5b470be42413564d525a718b3586cabb508dd6349170012489120b123e6533c4643a8e20051324888b3 +4f262114de14c58cc370a154e816caf05ffe3c75a4328a7630d2ac252f60c23786241f870f1332150df763f0ea6a90372f7f7cf3f2b973f2e8c5c9a35f4e1e3f +3e79f473eac8b0da43f144b77afdfd177f3ffdd4f9ebf977af9f7c65c7731dfffb4f9ffdf6eb977620ac741582575f3ffbe3c5b357df7cfee70f4f2cf0668206 +3abc4f22cc9debf8d8b9c52258980a81c91c0f92b7b3e88788e816cd78c2518ce42c16ff1d111ae8eb73449105d7c26604ef24203136e0d5d93d83702f4c6682 +583c5e0b230378c0186db1c41a856b722e2dccfd593cb14f9ecc74dc2d848e6c73072836f2db994d415b89cd65106283e64d8a62812638c6c291d7d821c696d5 +dd25c488eb0119268cb3b170ee12a7858835247d3230aa6965b44722c8cbdc4610f26dc4e6e08ed362d4b6ea363e32917057206a21dfc7d408e355341328b2b9 +eca388ea01df4722b491eccd93a18eeb7001999e60ca9cce08736eb3b991c07ab5a45f0379b1a7fd80ce231399087268f3b98f18d3916d761884289adab03d12 +873af6237e08258a9c9b4cd8e007ccbc43e439e401c55bd37d876023dda7abc16d50569dd2aa40e4955962c9e555cc8cfaedcde91861253520fc869e47243e55 +dcd764ddff6f651d84f4d5b74f2dabbaa882de4c88f58eda5b93f16db875f10e583222175fbbdb6816dfc470bb6c36b0f7d2fd5ebaddffbd746fbb9fdfbd60af +341ae45b6e15d3adbadab8475bf7ed6342694fcc29dee76aebcea1338dba3028edd4332bce9ee3a6211cca3b192630709304291b2761e21322c25e88a6b0bf2f +bad2c9842f5c4fb833651cb6fd6ad8ea5be2e92c3a60a3f471b558948fa6a978702456e3053f1b87470d91a22bd5d52358e65eb19da847e5250169fb3624b4c9 +4c12650b89ea725006493d9843d02c24d4cade098bba85454dba5fa66a830550cbb2025b2707365c0dd7f7c0048ce0890a513c92794a53bdccae4ae6bbccf4b6 +601a1500fb886505ac325d975cb72e4fae2e2db53364da20a1959b49424546f5301ea2115e54a71c3d0b8db7cd757d9552839e0c859a0f4a6b45a35afb3716e7 +cd35d8ad6b038d75a5a0b173dc702b651f4a6688a60d770c8ffd70184da176b8dcf2223a8177674391a437fc7994659a70d1463c4c03ae4427558388089c3894 +440d572e3f4b038d9586286ec51208c28525570759b968e420e96692f1788c87424fbb3622239d9e82c2a75a61bdaacccf0f96966c06e9ee85a363674067c92d +0425e6578b328023c2e1ed4f318de688c0ebcc4cc856f5b7d69816b2abbf4f5435948e233a0dd1a2a3e8629ec295946774d4591603ed6cb16608a8169245231c +4c6483d5836a74d3ac6ba41cb676ddd38d64e434d15cf54c435564d7b4ab9831c3b20dacc5f27c4d5e63b50c31689adee153e95e97dcfa52ebd6f60959978080 +67f1b374dd3334048dda6a32839a64bc29c352b317a366ef582ef0146a6769129aea57966ed7e296f508eb743078aece0f76eb550b43e3e5be52455a7df7d03f +4db0c13d108f36bc049e51c1552ae1c343826043d4537b925436e016b92f16b7061c39b38434dc0705bfe905253fc8156a7e27e795bd42aee637cbb9a6ef978b +1dbf5868b74a0fa1b188302afae937972ebc8aa2f3c5971735bef1f5255abe6dbb3464519ea9af2b79455c7d7d2996b67f7d710888ce834aa95b2fd75b955cbd +dcece6bc76ab96ab079556ae5d09aaed6e3bf06bf5ee43d7395260af590ebc4aa796ab148320e7550a927ead9eab7aa552d3ab366b1daff970b18d8195a7f2b1 +88058457f1dafd070000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468 +656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969 +bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38 +a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbaba +c4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f +54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72 +656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000190200007468656d652f7468656d652f746865 +6d654d616e616765722e786d6c504b01022d0014000600080000002100d3130843c40600008b1a00001600000000000000000000000000d60200007468656d65 +2f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b0100002700000000000000000000000000ce0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000c90a00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax375\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 5; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 9; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 1;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 2;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 3; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 4;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 5;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 6; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 7;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 8;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 header;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footer; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index heading;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of figures; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope return;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation reference; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 line number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 page number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote text; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of authorities;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 macro;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 toa heading;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 5;\lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Closing; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Signature;\lsdsemihidden1 \lsdunhideused1 \lsdpriority1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 4; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Message Header;\lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Salutation; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Date;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Note Heading; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Block Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 FollowedHyperlink;\lsdqformat1 \lsdpriority22 \lsdlocked0 Strong; +\lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Document Map;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Plain Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 E-mail Signature; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Top of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Bottom of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal (Web);\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Acronym; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Cite;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Code;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Definition; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Keyboard;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Preformatted;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Sample;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Typewriter; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Variable;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Table;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation subject;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 No List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Simple 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Classic 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Colorful 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Columns 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 6; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Grid 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 6; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table List 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table 3D effects 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Contemporary;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Elegant;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Professional; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Subtle 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Subtle 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 2; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Web 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Balloon Text;\lsdpriority39 \lsdlocked0 Table Grid;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Table Theme;\lsdsemihidden1 \lsdlocked0 Placeholder Text; +\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdpriority60 \lsdlocked0 Light Shading;\lsdpriority61 \lsdlocked0 Light List;\lsdpriority62 \lsdlocked0 Light Grid;\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2; +\lsdpriority65 \lsdlocked0 Medium List 1;\lsdpriority66 \lsdlocked0 Medium List 2;\lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List; +\lsdpriority71 \lsdlocked0 Colorful Shading;\lsdpriority72 \lsdlocked0 Colorful List;\lsdpriority73 \lsdlocked0 Colorful Grid;\lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdpriority61 \lsdlocked0 Light List Accent 1; +\lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdsemihidden1 \lsdlocked0 Revision; +\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1; +\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdpriority72 \lsdlocked0 Colorful List Accent 1; +\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2; +\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2; +\lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3; +\lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4; +\lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdpriority62 \lsdlocked0 Light Grid Accent 4;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4; +\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5; +\lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5; +\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6; +\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6; +\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4; +\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2; +\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4; +\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4; +\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6; +\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3; +\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4; +\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4; +\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Unresolved Mention;}}{\*\datastore 010500000200000018000000 +4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e5000000000000000000000000b002 +c4a57123d401feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000105000000000000}} diff --git a/test/rtf/image.native b/test/rtf/image.native new file mode 100644 index 000000000..e730859af --- /dev/null +++ b/test/rtf/image.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Image ("",[],[("width","2.0in"),("height","2.0in")]) [Str "image"] ("f9d88c3dbe18f6a7f5670e994a947d51216cdf0e.jpg","")]] diff --git a/test/rtf/image.rtf b/test/rtf/image.rtf new file mode 100644 index 000000000..4c6237478 --- /dev/null +++ b/test/rtf/image.rtf @@ -0,0 +1,6 @@ +{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 \fmodern Courier;}} +{\colortbl;\red255\green0\blue0;\red0\green0\blue255;} +\widowctrl\hyphauto + +{\pard \ql \f0 \sa180 \li0 \fi0 {\pict\jpegblip\picw250\pich250\picwgoal2880\pichgoal2880 \bin ffd8ffe000104a46494600010101007800780000ffdb00430006040506050406060506070706080a100a0a09090a140e0f0c1017141818171416161a1d251f1a1b231c1616202c20232627292a29191f2d302d283025282928ffdb0043010707070a080a130a0a13281a161a2828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828ffc000110800fa00fa03011100021101031101ffc4001c0000000701010000000000000000000000010203040506070008ffc4003e100002010303020404040502050500030001020300041105122106311322415107617181143291a1234252b1c115f016336272d1082443e1f1265382ffc40017010101010100000000000000000000000000010204ffc4001b11010101010003010000000000000000000001110212213141ffda000c03010002110311003f00dadd18a10a704f6a95ccc57e37750782b0d8d9ea0cd32e7c5446e07e9f4ad723119a7b89e61e348f260719278aad613cbb640002938c76a182b264fc87bd13009c0c019c76e3d68a072e1cf6f4cd502d330c28269a61bb39c923923d4fad44c08dccb95cfd28b8280769ee08a263891e1808739e4f1d8d149392172cc714050dbb9fde8960ed8c60b79b1ed44103b05c331dbdb1dc5026ac1946d20ff8140aa631c773ec738a0346a003bf93e9cf02801895e7b9a01886796c923bd0090a06393c76a0142003ce3d86680d8dd9392303f5341ccc1b3cf7a2c812c37e4923d381429757013209fa511c18146c9247a0f6a007900c0c671c6280854e086c673eb45c27c038fd68aedff2fda836ef881f136f25d5e6b7d1262964aa02b03f98fbf153131935edcc97576f35c33349212cc4f39f7ab26186dfce5b200f73451f7600dcb8cf27e7400c0b291914046c9e0718fde81371b8e7273f4ef4007691919240e714097f31f376e7b5008caee27807b0f5a02c8e1b3c6d27d33cd0201d839523144d1a149ae084b78da47638211771fd050d582c3a0faab5119b6d12f8ab1c06788a0fd4e2ac356fd1fe08754ddccaba849696309e598c9e2103fed1dcfdeadc44fea5ff00a7f956366d375e492403ca935bedcf1eea4ff6ac68a55efc1beb3b552574f8e7009ff933a927ec715bc82b3a8f4d6bba5ca1352d22fe061cf9a0383f71dea5119cc6c0baed3eaac0f1fad40897dcc3d81f7a052366c1007df3400f21edefc5008c28f30c9c5170ee4fc37830086395250a7c66770c18e78da31c0c63de8609b41f7c515c5172a30c3b76344a3e377cb2339cf7a242aea89808cce368272b8c1a2e107c672a49f5c1a181c9c7ae7da8a2119e7b1f5068099ffa68258a132062d8f9e0f34059502b61bf2824e681bb297ced2a71efda80f19c47b9c77fdbe74057c13e539cf3c1a0eeeb9c73f33405ddb4f18249c1e28062b79ae242902024465b9214614649e7bd0362a7249eddc513456e5720f38f5a1a98e96e95d6baa6ebc2d1ad1e65521649bb469f563534d6d7d31f04347d2a2fc5f535db6a0e83718906c887cbbe5a9a8bef44dce9f731ca9a2e89169d6d6f2184b1455dc07b11dcfeb4d16f119c649a681285b03d3e5500f87820ff006a0e098191de80ac9b8904647b55d11da9681a56a31f87a869f6970b8ffe4883629a289aefc16e92d441682da5b098f21ed9f033f353914d19b751fc08d66cc16d12fe2bf45ec92ff0df1fdbfb559ec667aff4eeb1a04db359d3ae6d40eccebe53f46ec7f5ab82263da7dcf3eb5174e5181076918c7de869503232491ee4515c1803824f03b51287f30e0e7d803449494832c157278a2e8c71fcb9f9d144639236824d01e142efb1768cfb9c7ef40512a818de78ff00a682518e7cc30ab9e00a02cce9953247bd41e467191ed9a04205ee99da4e4e3d283a524b0427b5026c18a8e082067db8341ce0e39ed409b6502907391edda80f2dfdc496f0c124ac6184b144cf0a4e338fd2894f7a7342d4ba9b568f4fd261f12571966270a8bfd47d8511bae85f02b47b7fc34bac5d5c5dc88a0c90ab6c8d9bedce3ef4d1ad691a6dae976a96d616d15b409f9638d70054a1dbc68ea51d4329f4619a8022b78e04548515117b05000a035c5c4702a995c26e3819f534047bcb68a458cce866719540724d02e41c0f7a012a40f6141cbc8e7bd01719e38e6838af1c0a04ca8206d3cd037bdb082fad9e0bd8a39e0718649141047d0d5d18f759fc0cd3af164b8e9999acae4e4f81236e898f7c0f55fed574615aee83a96817ef67abda3db4ebdb7f66f983d88a061bb8db9e3d45165076db83c1f950a53780d8247c80a2398f182724f1c7ad080c608cfa7a51a0062adc7afbd0130173bb9c5070f071cb37e82826106e8f615e01c9e680d6b35bc534be3c1e3831b2aa962bb188f2b71df1de819ae4b1048c7f57bd01a58268e332642ae0704f7cf6207af6a01b99e17b7b6416e227407c494139909ed9f4c0a04a4e501e0f1eb40d263e53dce7fa682c9d0bd13abf58dd6db18bc2b157c4975270ab8ef8f563f21447a73a03a1f4de8eb031582b497328066b97fcd21ff038edfde88b7e32703bd64188e7e6283864b73400cd804b67ca3268317eacea6d56ff005233592f8b6303f953fa4af7c2fa93417fe98b763e0ea171297bab98558068f695ce0e08fdbd281e5c6a57ba5e9d14d716ef7774f2ec112601da4f27ec2827ada74bab559a20e148fcae36b0f91140283729c77a0e0a7777a01dac68395719e39a029607cb901b19c501480ab9279f4a086ea8d0b48d76c0586b7143224a76c61ce1831fe93e86b43cd1f12fe19ea7d2533dcdbeebcd20b612651e68f9ece3fcf6fa5067cbcf20ff009a051724905411e94032799060723da8406d6c67e7ea68d0e1770fe5cfb5026c37039ef9a02eca098c91e6e01e71c500b1d8a49c12786cf6a06a4e256008e3d050119958007920e2801154e32fb4120927b014017eb1c523ac5209a356215c291b87be28957ef853f0d66eaa99352d515e1d190f947669ce7b0ffa7e74a8f4be996569a5d9c56b6704705b46bb5238d42851f2ac875712bc70b3c30f892019540704d01ad2669a0491936330c95ce7140b2e4939a03638c7e8680ae485e33bbe540d60d3ada162c90a02c7270a39340a4f28b68da4645007a8f6a069a746f73235ddcefc391e12b2e1916824948742c99382473c73404791c617695279dc0640f9502c578c9efeb4095cb4cb0830ba21cf999c6401f4f5a05061d430c8079a02e03b3004311c7d281b5e3cd676c65489ee594e4aafe6c7ae07a9a0a075bbea3a8ea96f047d3935ebc404f04ad29411e08e011d98fed416fd212ee5b05b4d5ad6300c615807f1171eaa49eff5ad418c7c55f8466dd66d57a521f20cbcd66a7247a9283dbe5418a63862479877cf1f6c5008e400bdf1ce684016fe53dfbd1a73794600e08ce3d6800377c8c7d6800a9cf75fd4503d91492460f7ee3d28247a7b459f5fd592d22711c206f9e563858a31f99cfd050583518ba75247b1d134f9aed21396d4669769931dc01c003f7a329c4d17458ac5b55d36c12e040a3f1da75c1cb04ede2447f7f6a94567ad7a66db4fbbb29ba7d65b8b4bd8ccd09c8231eaa07b8ab04a7c2cf87b3f53ea8d77abc72c1a5dabe2452bb5a561fc83e5ee7e541e988218ed2dd22b7855228d76a46a00000ec00a510bd4dd511f4fe84da95cc31f880022da4902b1e7d3e99ac86fd03d631f565b4ee6d4dbbc649009cab2e48c83f514165b8b94b6895c44f279c280839e78ce28178ae6de46748a789e453865570483ec6812d42e85a421fc37918b00a883924d024c6e99b7a2a966c0009e17dc9f9fed40f81c77e28139218e4ff9815b9cf23340a01c907b9140201038ed402fcafd28386464e4fd33c50272bc60032609cf00fbd024f722dc66f24822ddf972f8feff00e280f69b24844919cac9ce7de83a447f30ded823007b50459d6ecacb528349b979127651b1dc795f1f3f7a0990148054823dc5015d491c0a0c3be337c2ff00c489b5ee9c87172016b9b541c49ff5a8f7f71eb560c1fc43e0a47e1aa94277310431f91fa551c1727f29ed409b641c86e31839a3454805739c1f6a026f1fd740f64665fc8c31cfde82db79bb40e9e8f49b62eb7d7e8b717ec832c91ff247fa1dc7df2281bcc9369d671493c422b7911654c1215f92bb8827bf068624ba635392df5eb4b9924558ee5bc19b71cee43c6dc7cf34c657be8db0b0b9d0f51d2afe668934dbf9628ddb8c2b8c0073f3a80da37546a7d25174fd95dc125c69f7313ee5655dfc313bd483cf07b1f6a68d5b48d5ec758b612e9d7293211c8fe653f35ee2a084eb9e8bb1eafb3582fe496278f3e1c919fcb9f97ad03ee8dd017a6741b6d3229dae161057c5750a48249ec3eb4139238568f6a9e7b103b5037934cb3793c610a2cd9277a8da73f5140ee38f6280c4b11c65b934023006d50050030e4647de80c846de3b500fcf9fbd0197273ed4007b91400e580c8e45074a82400e72682b36fd2162b7f25ddc09af2766ceeb872db79cf00f6a0b3229550140e07007a50092db860673de818df473c862686dad6470d9cce3b7b63e740fa1de6252ebb5bd81cd00bee2d800d003a6464004763ce683ce9f1cbe1f1d3a67ea1d1a30b68edffba814708c7f9c63d0fafceaca31e6dc71e1f07daa82608c83819f7a1a11ce149238fd68d0a579ec682cfd27a7c3a86bd10bc38b3b756b8b93c1fe1a8c91f7381f7a034f752ea5aa5c5eb292f732128037619c018f6ec282e5a2cb047abda74d5ce9b6da80f136de4a496219b3e48c92000323ea73467519d3da5bb757dbda410ac90c77c23058f99007ee7ec31416882ee47d23acb5185caf8bab4691b1efe57fff0038a9457ee75a82f6e7429350466b482f2742c0f74241c80c38c64541a9cfa1e89ac0177d33ab3d8de28f2b5bca429f91140e2c7a9b5ae9fb85b6ea9b46b9b3c796fe040768f76ec0fafb1f9505df4ebdb3d4edd6e74db98ee216fe68ce47d280648f75e2485a44da385ddc13f4a025ddbdbea16a633286566ce55f9c8f6c502ad750db2c514f30dec428247e6340bbf04100b73402afb943ed2b9e30683836defe9403bc1e06734020e06280cafe8683a375941d841c77c1a0151b467b50159f00e4127e5402872371040c5046eb5aadbe9b1c02e2f6dad25b89047099c677b7b0140fe3f1010afc803f3018e68160c3041ee2823f5dba92d34db89a1d9e2843b03b6d05bd013560c1748d57aa2797c6b35bab78e6959dc47231580ff336dcfb03c1a58364b5bbb7d7fa7b7427f1f673830c8664285bd1815238fad20f2c7c41e979ba43aa2e2c1cb1b663bede438f3a13c7dc76fb5515e9065b851f7a02950002a09c51a1b83cf14176e90d3645e9ad7752752aac23b3439c066665c827e944d29a6410aea725c4567135bd840d3c88a723728c29c9efe6c50d3ee9545b0bf8ef2e6e3c2fc2c6f72f2920e5f19039ee4938a9a875d03278377acf52ddf867f036ef71923932bfe51fbd3475cdc369df0db4fb389d4ea37970fa9cc0b00511795ce7d4f181eb4cd2451755fc45ac16d637381b14ca36b641dfce723e4053170d6cb52bbb362f6d3cb19241f2b9029862f09f143549ba7e7d2eef6caf2797c66ee17fdfd69862d1a069da7dfdac579d17adcda5ea9e1a992376c4723e39e3b024fd7e94c458ac3e25dee8d31d3bae74e7b79002bf8b8549471db38f5f4ed4c165e943a06a328d4ba605b4b22a1523c420c64fbaf38a82d36f0ce7cf7463790729b53017e940e0b0ceceed8ce0500e1b70daa08f5c9ed41d271cd0132476e7d7ff00aa069797d2411168ed9a41fcc858211f73c5075acb25ca6fb82aa31e58a36c81f561dcd033d42169e158ac64b98151b3981c2966cf639f4a064c7a8ac55e4865b7d493701e1c8e52403ea3cbfda827e390ca3f2c914aa81991bd281cdacc2747215c60e0ee5c67e940cb51b0b2bcbd824bfb08ee1a252d1caea1821cfa67b1fa504982b2283ce08f518a08abb82f6dd0369a5662081e14ce40c7ae1b04fda82275cb0bfd4f4536f7114589a5412461f3e4ce4e0e060f63f6ab2893d3b4b5b5b78e22ed22aae3cc3cc7e64fad3449a22a461500007602a0cd7e3b74c26b5d2ad79147baf34eccca40e4a7f30ff3f6aba3cd0543267eb5427b86f1f4c76ef45d0eca1ad5ef224d13e1cf4fd9b22192fa67bc955f8c8c617fba9fb510d7a6ed3fd43a735e5b54964be658c048fb6cdd9e7eb8a186bac97d174e6d22e23437b7ac26b95e77c68bf950fa7279e2b22dba45b59e97a669fa4ea36aeff89cea9a90451fc355ff0096ad9f4ce3f41570675d4fa8c77da8de5cde5be26bc653171ca47dc1f6c9fed5562b97f70276808da7c24f0c1c63804e33fa8a2928c0e0383c8f7ed41d92a41393f4a2548595c2c37493db4cd04e8a08f139566edfef3445b6e7aeaf65d2df48ea2b11776ae02a93e564c772adef409f4ee8ba9a21d73a36fa579ad9f325afe599171ed9c30a960d5ba0fe2843abb47a6f510fc26a4c36890f9558fcc6783506a1147b510024e30339ce680d2c6ae9861eb9a009178a0205443b989e39cd01d8075e3047ce80563057ca381ed4011c4531e503d85013c91b804a21279c903341131cda8c3abdc8650f6d20c4321232adec3dc504bab2c113c9293bb1963df3408dd4b75e1efb2856463dbc43b4631fad047e9177ad4fe32ea16b1db4b8fe1aa92571f5f5a0916bc8e0895af5c46c17cd8c9ff7da80f6d736f7f6915c59cab35bc837238ed8a072a31c1ef4062870718a06f7702dc5b3c522ee4752ae0fa8230683c75d6ba3b74ef535fe984929149e4278ca9e47edfdab42058003763ed409f88ffd6dfad06b1f12ae612fa0c76e0b471e9916d23f973eb4158d3efeff004a984da5debc1295d8e4018dbf3145d583a2ad96f356bbd7f5d90dc59587f1e79a6392f28fcaa3ee47159444ea3aa5ddfc7acf50dcdc344d7a4dbc317f52641200f6000fdeb41b5ef51d8eab672ffa9e971c97c11638268e431a46000012a3b9a351567db823b11f3ef40948e428048207a8340ab48ae83cb83ee0f3428a982719edf3e68c9cc97d3fe15ad8c9be138f2bf38e7b8f6ef40f7a5f55bdd3f56b46d3649127f1405f08e7249c76f5fa50689d48ba5f545cdcbdb462cba9206411b2b055bb07d4fb1c73528d4fa8f52d62cf47b6b8d2e65fc458c49f8a818795c151939f977a823ba0fe253750eb7fe937b04293f9f6c90be41dbdc7ff006283473c1efc1a06f69776d73bbf0f2aca32572bc80470450284a46dfca19f819f5a04e799614def26c0bdce09cfd85045dc75769d12dc3c3e2491db0dd3c85195235f7c91cfd066ae0cdba9be31f4ec61a386c1ef9d4ee473e45cfb1cf34c101d3ff1ac9d481d46c628ed24751881880833f988e7b0fa5328dfed2f2def2ce2b9b79925b791772ca87208f7a60182ee2b95cc0c48f53823fbd40ac658b30f4f4a086d4ee1d75bb6b78f4e965596366fc5211b23238008fde81f43692da5bc30d97831a0397dc09e3d714087506bf61a2c4cd77324726d2caaec141f9fd2ae0c435bf8c57173ad7876f7a2daca10489121244cdf319ce3dbf5a834fe81f881a6f57bcb6ba7c53c72c11873e28cee1db391dbef4199ff00ea4348116a5a66a8a8a04aad04847a90723f6ad7d18c312ddc02a3815423ba0f63fa541687bd9efe1b533b3c9e0a78473e899e318a09bd0ba6eef543e3b2bd8e9b10064bd9e4da001dc81401aeeb29a984d0ba7d5e1d06d4e6594f06523bc8e7f5c0ac8af752dfc17d7090d9218ec6d9447129ee71fcc4fb9cd6842ab10dc0014f3e5a2c1704b671dfdc734525226dc939e283a362c7f940344a380393df144733e2276e38f5efcd01b4bbbfc3dda4a9298a44395902e4a9c70682660d4265d62de40b1bdc1545054f95c8fe627df141af7c3af8808f3dd68dd5d2a45765884b8908d8c3b6c27b7a77a945d7a5fa474bd2ba8e4d5748b28624955d5d8b13b79ee9e983d8d40a753758c7a46b96f6114725dc92279a2810b3a64f94900763cfafa503fd3b59b79ed84da34713c0cd890f0a158fa1f981de826e1b548959fc4dc5cee24b6467e59ed4101ff19e9f676baa5d6a72c50adb4ad1ac790ccc076200f7ad41e7df881d79a87576a5f87b0f161d381db1c2a36e7e6d8ff3416bf87ff082c6f208ef7a82f22b9761bd6d619785f6dc477fa53705ab57f83bd297ceb1e9caf67708db9c4526723e849e3e94f212dd25d117fd29a8c09a76b534fa39cf8b6b71ced38e36fb73417f52e64548e34007e673e9f21ef590a1c918c90718dc281a69b68f67118d9da5058b798f6fa7fe280daadd1b2d36eae70710c4d263df0a4d583cc7a668fd4bf11b5837d7c93dcd9a3146959822a0e781f4cfa55161e9dd7fa67a4f55b9e9aea3e9f81fc09ca0ba118998fcdb2338c7b528d39f4cd2ba76e2d357d292df4eb391809963420ce1b1b576fa1e7359119f1eb4e17dd033ca172d6b2a4df303383fdeb5c8f2eef3bce4e0e335684cb0c9f354160d36f64b0baf16072b91b5f03391f43c51aab23a5debe91c4fad4d73689e6fc3a290573ff4f03e59f4a3280d67581ce916567f84b58ce0a1fccec3d58fa9a084de08c90464e4d1a8e419059b201f4a05630a176918efc50176293872c17bf14042aa0125b03db14046c60b60123fde6827fa0c68edd5365ff11346ba6292ee64194240c807e59a32b7fc51bfe8bd5ed5db424860beb62b89218422ce09c11c01dbbd0660ae110bf1bf2154838dbebfefeb41a8f4cdac7f117458f4d9ecd2df53b4cf81a822808c47255c0f7c8e7fb54a2ec2cfabba3b4b4b8d3af12eedad40926b0f070a13f9b633649f7a82eba6ea4357d321d4ecad512daf20df26e016507fa4fbfaf3e98f9d067dd2bd2faac9aa4d72d72d1e9510ca46a7631c7a320e18f1dfd7bd059afb7da816d23de4ba5de211346a1e4785f190548e4648c63b64e6b43ce9d5baafe3b539c5b452dbda46c638a167cb281c73ee4ff9340e3a3fa5f5aea4ba58f4bb57dbfcf2b02a8bf7f7a0de3a5fa0b50d2a2d92eb3e048c0a97c867dbedcf6a944e5cf4f6b76d1b3d8ea42795066266c87c81c65b9cfaf15048e83af3cd64abac08edaf01546c38dae4e0657ee6826e5b892de3702292e2545ddb55700fd0fbfca81c4b3bc718716eef9eeaa402280d14ab3c0b2c65c06fe571823ed40df56b217fa6dd5ab9216689a33f2c8c558307e83b8d77a37aaa7d22f2512c28768800c9954671b3d33ebef568d0ef7a7749eb0b5bbbb162d657b32b46d2e1564c8ed9c5644d1b0b9bbd261d2a440af6cb0e2e5b1e7dbc1238e0f7a0375b696daa7496a3a4dac8a92cf078685b271db04d391e40d5ec4586a1716de2a49e0c8c85d3b120f715ba1899173ff305413070abd89cfe9f5a2d3ee9c8639fa874eb6b804c52dc46b20c9f302c3bd11e84d47e1af4d5dc6521d3e3b662c19a58721ff5a9a321f89bd27a374b456d158dccd34d333332c9b4b2afbe47a7cb1f7aa33d2bc0d8c0f1c8f6a2c14b6d501b39cf63450897380c319e3de8065031c038f7ed40d8faf1ce41e4d004876a8dc3cc7e743025c956c818028c904579e7f0e15695c9c0541924f6c00283d0bf07f42d6b48820b8d62d20b2b58d656404959e52f83c8ff00fcfafbd4a35bb06f12391a48dd55cee2b2f3818ed8f6a8158a159890f02242079147623e631c502b0db436d1ecb7458d4738038fb0a087d6eeb508f48bb7d32d95750752b6c26c905b3ddb6f61eb574794f5cb6b9d0fa9678b512b25d24bbe52b8c1638278fbd582c57ff12afaed45b5bc0d0d8a8c08a2731ee3eec5793f40450466a1d59af446293c186cd53ca0c36eab93dc649e49fbd048e89f1675ed35e301e293919dcbf9867b37cbe94a35fe94ea4d33aba6824306dc48015750d86c6e247b0cf63591a40b8dc23fc30f14138dcac3000f9d03687547f12e8dd5af816b13148dddbcd29039c0f6f6f7a0eb5d62caf5636825db70c9bc4328f0dc0271c8a090627d3073ce681acf6505ccf14d35bc2f2c2731bb28254fb8a075144a83ca806792400334049ee6281e2496408656d880ff0031f61fa50446bd76058ea1b9e21025a3bb48afe71df9c7b71de9c8f196a0de23ca7b827d4f7add117e0cbfd4b5059392369663ff004e71c51aa97e8f555eadd258f2bf8a889cff00dc28cbd0bf123a926e96d163bdb74490bca2321c678209ff001591e71eafd7a7d7ef45cde2c20aae144638033fb9ad2e1b5e69d058da431ccf21d4a5c3b4631b62523807feaf5c7a50222f2d648c25f5aeec8c2cd19dae3d3e87e944d3eb7e90d425b49ef2292de38224f1505c3f8724a9eeaa7bd0d57a60406059436306868a7803839c7ad1a158039c13f4a33a716767f8cb9b6b55e1ae2458813e9938cd07a9f42d0b4de99b4b7d1f41b58ff19b03c93ba06607fa8b1f5f619a5b8266d74a65d42da6ba90cce996dcdc8c9fff006a5a2c2635083b05ef83eb5028076341db4b1ed9f7a04651fc41db18ed419d75b744dbea335fcb0db0335f2057901c05da73c8f9d5d18a75174a3f4c47335e35da4ce418a489374254f707d463d33565d1529b569a489a17944b06ec8057d71dcd037b4b6b8bfba31584124b27e62a8a4f1ea68357f83da7ea5a76bfe0912453ccabb49194653cb60f6ce3dfda983d196cd108c2401711f9768e306b2297d73fc6d02773a8b591922693c5004bb9d72542fa2f6efde8314ff867aeeec27500b77bb5670e36ca19b1dff2e7f2fd2837ce8bd5dd348b78b552219022870d9c46e792a4f6c608a0b846c8e03232b29ec41cd0199f1410fd4b24b1e8f712c0a5e4452d851e6c639dbf3238a0afa42ba77475e4ba8470896681da45180b18da76af3c9029c8f26dc1df2b9c606e273e86b743331924f27f4a82c12280e59b008e79f6a2d4d74188ff00e30d203a82ad7519c1ff00b860d11ba7c5e86c9fa3afae6f4091e043e021270b21e01c7dcd6479ab4dd3aeb56be4b7b184cf2b301b57d07bfd2b4bad0fe25e9f6960ba7c7a55ac50cd750335ccaade7723b83b8f6e38a2207a5ba4e7ea3d93780cb616ca53781f99fbff009a0b675a5be9765d43a75a6ad3b25adb4185429b831c70303dfdfd2831eb8954ca48f3827819c71ed406b2b1b9bf9a5fc1c4ce2253238047957dc9345d122b792eee522811a495ce1157b93ed444ff0049f476b1aaf51c761345269d25be269259570c833c6077249e062a68f53e8ef0da69509d4ae225b92a04af232ab16f98cf1f4a5a266d4dbca8af13a329ecca723f51502d14f0cb9f05d1c8ee01c91f6a0393b4edfe63c8a031608859b38f97340d84d04e5846eae50f9829ce3eb400fb24466041f5e3d2823f56d22db57b192d6e61468a41c823ff0035651916bbf04ada7badda5cad6d1b72c09dc33f2a6875d25f0865d06fe2bc6d4c4d3282026cca8cfafcfd29a34cd234a10c768f711a78f1bb392a3001208e3ec69a26a58d640c832091c90706a084ea1d3eeafdadf4f86da3166c0b4b397c18f046140f5ce4d04f4702436e91c28a9122e028ed8a0a9f5a5b6a09a1bc5a135bc72cce048b3c5bc15c638f9d59043fc2db997481aa69dae49e1cb6bb643239211939e467818f97bd305965ebce9a10bc8da9dbaa2679dd9ce3d8530572cfac87566ab05ae9f1490692b9696e1f833738555f96793504df5f25945d2576b7ec16dc46792381c7b7ad5e60f234980e42f6c9c56a82ec3eff00bd4124e49700f1c646e3cd169ce9575f83d52cee324347323f6e3861ff008a23d47d4ba6a75074fdcd8ef317e2e2ff0098bdd4706a60c3f4ae8cd5f44eb8fc3e97248a638cbc73bf90483d463b373e9574685abf42a6b5649fea72bbdeac4a8d3b018cfae31f7a6895b6b29b41d30d8e9f6bbed9213e1b7a994e724fcbb5064bd7835a9752d3af75d8116354778f660788cbd9483dbb0a0cd20b2b8d43528ad2088bdcccf854039cff00e2827a0d34e9da1de896f2182492efc0976f998aa827d3d334113a74aa9a9298628e74570478bc0c7cf1da83724bb8246d3e6416b0384da61b5501c9f5c3704f152c037561a95f5fce61d3ad6db4ab950f34b331dd9f4191db8fdcd406d67a675ab4b6d325d1af248272a43430315ddec7038f6ad4b3f448bf47eb71cb69abddebf21d5e26896203846c30c8603b9c6452d9835901405660376319ac84bf13180779d8bb82827d4fb0a06f777367a75acd7170f1430a9f331200cfceae061a0cf6dac692d7365266191db0578f5edf3a6075a6c9278b3433188a467860d96fbd40fe540471409aa0c1140750001ed8ed4058e15133c983960077edf6a06faade5c5b7822d2d926766cb967da2341dd8f0727d85033d27597d62e2ee3163756915bbf8799d71e2f19dcbf2a092b88dd9a311950a0e5b70ce47fe6ac18af53f5b69da9752dd69da9ca906876e24465d9e69881c6ff005c679c0aa2bfd267a347512c93dbb5d42d90d3c800b68c9ce0ec3cfa528db74ad034db5905ee8be1ac728dc153984f3f980f4fb56453be2de8f647a6aff53796596f0aed46798ec033ce149c0fb0ad71479c9bb9dc3bf3c55a0b95f65a825150b481a407b93c0fda8a29c06671dc93803bd131eafd0af6dffe18d2ee25982a4b04603b7a9c631fad03bbe586381bc5945b96385718c827db3eb5288eb8ba934eb15fc3c535f05427796dcccdec7150637d5bd55d5362b7975aa4d0d919018adec8637807bb60723000e4f7cd58203538aefa8aeb478a7b9beba924547b8774cf8608036a80704639cf1f9855d1a7f4c68b67a03de5e5d59dad8d988c62e1c0f107a1e7fdf7a082ea6d07a6e3e99375a7cb6b3db093c727701e2360f7f53dfb50653d4130d42ee18f48b3f0232a15218936963ebf5fbd06dbf0cfa74855b9d46e04b730c6144691e12307d33ea7de8348ba6b5478a279a004f98c479247b81f5a9438805ac0be2e02e73c9ef8fbd40c2346d43578eefc40da7da1dc8b8eefea4fcb9fef419beabf12a4bcebcb2d2fa7ee0dc58492084b30236bb6467dce383f6a0b87556a67a7f4d95a0bbb5468816f0a69c78b2e072572719ce78357079dfab3af2e7a92c963b88d94abbbf91cedc93edf418aa2c5f0dbe2a6a9a0c90d8de34773a6a8da1186d6403fa48fec682d9adeb7a9b4c9d572dacc9a6c9700456e5ca910e000ecbd8e580352fb1ae7476bd6dd49a325e5a9f3025245fe961dea097523cc0919a032af039a006936c81423104649c703ef40dcce64bc3035a87b6f0c378f9fe7cf2b8fdf340a4b6e25962915d94a67807839f7a043586922b5636ec44c061063f31f6ab079d7fe19b7eb2d4efeef55d5d74f992e9a0fc3a441dcb13927b838c9aa2d4bf042c618e178efee6e18104870172318edf5c1e6945bbe1a748ea7d2315edbea3a99bcb190030c401010e4e783ee0fa56455be3d6b90c1a6268d69e17f1486900ee98ec29ccc183119419e7e55ba11f089f523ef5058363a8059fb8e31e9421b491056c01819e28d3d0ff07eea3d53a1e3b6b8db235aca63c139c0eea68ca47a9fa6ef757b83ff00bf68ad428c2f248c7a8f9fcea518df516adac74e7544f63a2ea172f1800291e6cee19ec78cd5826344e85b6bad25ba8fade5b99dae0ee11efc71e858f7e7d054a2d7d39a75ae8f7b6b00b8917f1516624b78429da327cec493db1db1d8540cf4aea28f58d6aeae2f6dd64b498082d880488d149fcea7d4939ab04175e6850a8d32de3b78e380c8de32c4db4e18e430fef543cf86fd0d691b4fabdf6648b3b2db69ce7dd87be68342d2f4fb9b5b891af1a28a2dc05bc5036d001e0eef7352884b961a2ea9aa7555c885e08d45b5bc52b61b686c120fb939fb541276bd4b61d53624d942e2f6200bc32290633e99f4233416dd3ad3f0d611c0c77b632e71dc9ef41156dd27a45addcb3dbd9c513b1dd941821bdc7b558333b9f873757fd69a85e3f813e9c7723b5d93265d872473c11544a68ff08fa75e290b42ec4e4124e70738fa5048e89f0f745d2aeadd2decedda6525c975121183c77f7a945c754d0e0d563682ed43425369403bff00bcd58308ba7d5fe13f5a05889974a9d8b46aede4914f707d88ff001528ddf4fd7edb54d1a1d56c312dab2e64dbc9418e78f5c541296d70b716d1cd6f8789977230ecc280cb7519b816f212b205de4e0843ce300f6cfcb39a0545c42cee88e0b458ddec33ee680eac92266360debc7b5056fad2d354b9b189745744be121daf27e550548ce3d4d58324d07a725e98ea2b7ff5381f5169a7579d021fe13904ee43ddfbe49038ab46e76cf05cc714f6d309232a4a98ce54fd6b2196bb7f2e9b631b2c427b891b6851db3eff002007341e5bf887aa2ea3d4f77378be381e42fdb711ed5a1554395caf1cd07617dcd04fc85402101da791421b49920331381c60d1a69bf02f56f03a925b12c162b98c955f775e47df19a32d99b518268e4491668704a79d4aeec7b7bd4a30feb7e9144d76e265697c3e2693631674273803e556087d76f35fd49859e9925ccf611141106f2e182e3241f727f5a94681a268f79ad1b1b8b9dd66b1c2b1ce9bb06361c1e7bf3fe6a096b0d3ba57488e485b52b40909c386901607d47bf7a0ae758eb69ac4d15be81a748f0a9c35cc90b2eff4c03c1c638a0b77405c5d5d45f87be5fe359a88b81b401dc1c7d38fb50586fed18ea3015790091591e447c1518c8c7a0a0a5754d8c9d49a8d9f4ee9dba0b3b5224b9692327728f627e7c6682f9a7e996b6b3a8b6b748a348820c7720761412c064e3041ce282b5d4bd73d3bd3f33daea97ac2e540dd0a292dc8cd043c1f15ba2a7923b65bb910371b9a12141f9d02edf13ba2ade56857551e5e77244c54fd0e280746ebfe99bbbd655d56dcdc9ce08465565f4ee3bfca82d53eb3a6dac3e25c5f5ba646402e33fa77a0aff5b74ad8757e9ca972844aa37c520fcca7d3f5ab067bd369a8f467544d626c98e9f7118f0200e4465c903049c8c9e6ad1b24334b6fa6249716cab20037c309dd83db03b5640dddac3764a4f02cb1103863919fa7a1a06d6f600c37162911b7b252b87dc773f1927393f4a079f868edae1ae6328a8b1ed38e30050226e85d5dc1f879011b3c47c2f604719f9d01eff4f4b83e3c6b18bb452b1cac9b8a83de80b16e8208a3b7b58e1407cc061427cc0ff1560ce7a8f592d69a97504cad2dac01a2b53900c3e9e51ea58f727d0551e73bfb86b99a49a46dcf21c96340dc13804f20f6f9501c0e3b8a0963316fcc4607007f57bd084d64dec01200ce483468ff0040d525d1755b4d4206ff0095207c11dc67ff0019a18f56584f6daad9dade4211e39104a8ded9152b235cd8c530613229c8c1c8ef50472e81690ee00322b0c100f0debdbb7ca8111ace856371358cba85aa5cc407891ccf83f2ef4048b4ad2e59bf116769672c72f99dd1437239078e2824a4d3e1b94559234110e781839fa0a0561b38ad532a12319c86c6307e740a9732a3a00cac870cd8e0faf0681be8b6db965bb909df3c85806eeabced5a09523647e6e0fef419a6adf116daf7ac34be9dd1da686e7f1ca2e243b76320ce57df9ff1560cc3e3f470ff00c78255b842b35bc6c4af9b6e323d3e95467b6365f8dbcf062beb68c119595d8aaff6e282422e9899b4f6bb5d46cda2562a76316c1078f4a0859e1b9b762c0bf94f0e84feb4125a57505c58ea70dd5d0174a986d92b1c13f6f5a0de7a5be366877260b5d42dee2d2423124a487507ebdf15289dd3fac7a7bab6feded74d61733473acdb5a162142ff00313d81ed505fa58fc6d809380c1b9f5c502e0e05040ea367a85dea454de2ff00a610375b04c16c7a16ef8340b5f6930dce9375636acf6a278f04c5dd4f1dbf4a084e91d06f3a52dee62bbd4a2b882494ced3c8a448063b63b638fde803ab7ae749b2b3096d792c93c8c109b55dcd18ce3710473ffdd043dc758dc5869044565aa5dda4c3c2b7bc78c1f14e3963db03e7c0ab066bf1327d41ba76ca6bc48ecad24c456f6b0c87cf8e4bbfa138c0fa9aa3297c83dd4e28395811cf2680a5b93c7ed413cd1ff0f3c797b8031406645236b0508406f30e68ba49c051b97d0e0e7d28ad57e19f575c5be8f269515dac772877c11bc464dea7ba8c739ce78f9d3193bb8ebfea2bcbd6b5b6b8b58bb7f13c2f0ce31cf0deb4c0f2dbad6d743d2ee99efae752d6c02a86e0054524f6383c7ff94c0b6af274c75149a46a5a82c46f1e1479fc3190bd8156fbe7f4a960bf74e9d253f1167a3ac09e0856610e3041ec7f6c540f67b892cee7f8d18368232ef2af2508c7047cf340ead5bf130accc9b1186541e723d09ffc5033bbb1b82d74d6b37f1244daa1b38073df3f4a08eeb1d3b50d4fa6a5b4d32f12cef1902ee73e523d476fde8306eb0d3fabfa4ba92c278af67bb7281606472f90bdd58558253a6afb40ea1d62283a8b461a66a6f931cf6a7c2466f7cfb939e7b5515fbed3747b5eb8f06eb78d35080a2ec9719c76f98049a0b4ebdd37d1bad869acbf0b03c5c16b29444adf50ded41995f68564a263a66b31cd02be152505493f51c1a088bab69ad1bc179e320f07c37c8a0692b46c4995f0381db39a0b2fc34e971d57d4705bc8db6c50ef9dd97b81fcbf7381528f5ae97a1d8e996d1db69b0c7648855b10a81b80f43c739c54134147b9a036063279fb5046e957726a0f2cfe04915b06db1788305ffeac7a0a00d72f8d9c491c06337533050ac7185cf2df6a06da2da4293488f34973328c34aea428c9ec3eded40ee7d2ad249448f6b133820ee2833df3fde819ea96897461b05b87815f2ee919e5d47704fa039ab079b3e326b70eafd4ef6d6650d8e9ebf868b69c8247723efebf2aa280eb9193ebedc5002a124e015340018fb8fde82cf32b1603d0678cd02406dce3008e47ce81b499c331383c9c9f5a2e9c69377369f7d6f796a4acf148acb83fb511e91b3b3d0bab745b7d45acedd8e3732b71b1fd73f7a5a19eafd09a56a0a96b1c705b49c48510761ce4fcfbd4d0d752826b2b583476fc3daacb295b79d768de8a32b1e71f989e49f6a7d14dd1af5ba275a45b8b093c054492ea769092373765c1da4679fbd306e36ba9595fe9f0dcdbcc92c33e1579cf27d0d409ea178f68521b6b76926ee8a7853f7ff140bc768d78f6f73748d1cd103b543f0091cf6efc502f7319dac194371d8b6326829f0c501d7ae6fa568d5d4942c806d4db81839f53c8cd59456fae6e628749b5bab8b1865b08e4726588ec11e7f2e49071c93da9a31dd4341d675e9a5bad374f9858162d0b4ac70e18f0573df35a0c759f87bd53a404f174f965dfff00f479b1ef570576e34bd4b4cc0bdb3b9b7258a00e846e3f2a94376475cee4914af7ca9150685f09ba61efb52fc7dd69bf8eb7c158d1d0b47bb38f37efde968d6eeb4eb5e91d6ad25b660aee59974db6881690918e31ce39279e062a5a34bb57b88adedd1e379679065d80036679e6a07e8391bce7e940c659ef5afe1286de3b16f2b8903094b7b2fa7ce81eb380c4260ed193f2a0cd6fa5d4a4ea0fc7bdadcce923158a3039db83c038e3ef41a0e96b2ad8a35e009291b8a939d9f227e43bd590436bbd6fa269202c974b7123602c76e779624e00e29833bf897d493e896525dbcb2a6b5a9c3e1456b91b6d60cf989c7f31f7a60c02490961ebcf3eb541308e39e067b507007b96007a67fb50178f97eb4165ce18165c2927b773fad023202d9c8dbb7818ff003408300b87f2f1c107d0d0c15a4f2e339c90467f6a18bdfc2cea8ff4bd561b4b9ba686d6e64552c4f954e7d7e46a60f4688d240af1b2bc6cbf5047ca960617ba658de1b792f2d94a5ab33461b18524633fa1a81b5c8b5168967369d23c0e0a24622dc981d81c76aba29df0bb48d660d52fceb88d069f04aeb69130037127f37b9c0ed9a8350781240bbc06da72323b1f7a0eb8816e633192ebc8c9472a78fa50349b4c83c068e24f0ddbcc1c13b837be4d055b57e98b996d4db5b4a893dc1e6620b6ccf2c467efc504ce97a38d3f4d874bf09af6d46e2f25cb82724e791db15650a43f878b51fc34f3da8f132b6d6a98c80a39ff007e99aba249631b58b9047239ec3e55368aeeb7d2da6f52c0eb7f16e87f2c6e836ba90724ab7a67b55d115ac7c3e8aed2182def4c56a14096368959a423d77e3229a27b41e9d8343b01069c8a8dc9660aa3713df3c64d4a1c695d3d6b67a8cba94b9b8d4e61869e4e4a8c636a7f4afcaa09a485519caae19b966f7a0435196582c656b74df3e308beec7b50629375775b691ac5bdb6b16d6378779f019b00a31cf391c9c2f1daae0b35ef52f5374de88d77aa45a6cd25ddc0108694ee2188c28007603d6a0d16c92430a4b2ed3230dc401855cfa0a0a07c45d7b5db9d462e9ee960b14b2ee134ef8c850012147ec78ab0670b643a2efae753d72686e6e2da211db42176079c8e768f65e39f7aa332d6f58bbd635096f6fe6692695b24f603d801e82823cb900ee00e68006460051dfd680ed9f0c905b713d8d006d5f5419fa505a18f94e40501b1b81a04186d62402c87be3d6810b81290aea8467201231cd1749dbc437f9f1e201db3de8ba07dc0175c027f28a335b17c26f888d6b6d0e8fabf892a29c453b1e547f49f7a946d6424f08236491c833ee0835073294888894120700f0280813c40a6711bc8843e00fca7d3ef40e41dc081f9a811681c6f7565329185623b7e9de812b3bcf11ff0b74563bd50494cf120071b97e5fda80d7577046c9019d5669dbc340324eec67fb734103d5da96bf67a7cf0e916f6e2765f25ddc4c11107ab1c8c647cce2816d3ec7f0f6564cae6e67da375e6d52cc4af2e4fb13ed4145f899d47b3499f4bb6d46cda49b69b92921565c3648e3dd40c81cd5c0ae89f13ec246d3e379ed2d6da180b5d34849da1780b128e49271c9f4a60ba685d5fa36bc42d95c324ec7090cc9b1d87b81ed50588958977cacaaa3b9341c655f12348d1dcb8dc1946540f99a019e2134454eeda7bed3839cd052fe2136b536b5d3563a1ca53c49da4b9507198940ce7e5c9fbe281c6b7a974cf4ee4ea7242d76dc784a3c595b3e9b464e3f6ad0ac745ccbd4fadcbabea42da56959a382ce7460d6b1a93c01f97272093ebf6a82f1ad6af0e9da5cb3cecf6902216919f82aa3818c7a9f4c530649a9f5269ba7429d472239bc991a1b0d3c3152880f0f23039e7bf3de90635ab6a377aa5ebdcdecef2c9239e59f3827e5ed54302195fcc38cd01245395c1f5f4a05b606538e483c501b6939e3b5077860f3914165754c33e549000dbe87de813b820c27fa7baafb8a04a69c98e281e42618c795338033df1f3a06c03e4e029247007ad010093c35674da71f977640340081a190658e41c820f141b0fc33f8926c218b4ed609366a02249bb2d19ce3ea4528dbece68eead926b7916689c643a9e0d643387521fea2f693c2d6efc786ee46d9bfed3eff2a04669edf5295ff057a60bd865309246d3bbbedc1efef41d63a8dec9ab4fa7dd4510fc3c69234ca186e2d9c003b7a67bd034bad0a5bb96e25d575267889cc1b54446d9bd0a37bfbfbd02925945a72cba8dddc48b3f87b1e58f23c623f292bdb7fa7cf38a0a5750f54ebba56a9a67fc516b6d6fd3970ea9234677c8dc7f38f6e4640ce282d1ac4b16bfa72c1d2bad430cd1ba822061865f5007d3daac19cf547c189357d561bbd3eee683c62cd786e9b73337b8c7bd512bd39f06adedec2de0d5ae639da372e6485363107f97767b505cee755d03a5e58ac228659af123184b7b733322e38c91dbf5a943ab3d52e64b49ee755d2e64950e238e35f10c884e17cbe87dc540e6d7509a4f110e9f7566a471712850abf6ce463e6280bacea36fd33a4497f773cf32c698dcc4beee33938edc7ad05534aea683ae61d64c4d2a69b6b88d16d5ca5c303f3e386cf61db140e27b5e99e96b64bdd562b6b30aa36c6c37cac7dc9eec6b42c1a66a962fa70beb6b516d0cbe76322f86c78f6c66831bf8b5d5d2dfa35a5dce60b1933b6ce3c788769f2b331ec1b8fd2831b79649984b239773c1dc68129725c1c640e73400ec781d8fb1a03c4a85d0c8582640257bd01e51fc42236263c9c67be280429c6037eb405dbf5fd682c2a0bb976cf07d3fc5009279ef8ec4e68193a9902b28e7dc71fb501d95b098e0f6dd9e0d0049131019b047b8390281bb292484e47c8500c4f242c3076bf704704739a0be7c3febfbae9a5daf23cd017c7e19fb107bb67d0f6fd6837cd2757d1fab34f4f05e37dde630b1c3a91edf4f7159103d6eb7da65fdbdf59dadb5e2460ac876ed9e1c8c060f9efe9c8a0a75cfc42d5742d2ee5a7e9dbb494b6d6b9bc930cce4f940e3cd81ed4160e98f88315e689fff0022b57664199cc5196f0c7a164ef8f98cd0589baffa68590985eb15c0db1985839f6c2919340b69d03f5285bdd6f4bf021424db4329cb153fccc3d09c76a090d3340d2f479a7bab3b38e2924e5e451cfd280d7dafe936f6c5e4bd89813b02a36589ce318a0358dc35cc4e17f9bf234cdbb78fa0c607a7340e6cec20b1596610c6934b8323226379edda81da8dcb9ec40a042f50b5bb21645473b58b11dbd7bfca8304f8add5d67a9ea8ba5d8ea72c1a4d8a952f10f2c920e368cf71e99fad5833dd0754d6ed66bdb2e9a91a5babb2a310465a57c1ddc1038e7bd5171d3748b8d46ee1ff005298dc6a764c27d4eeaee7fe1c01795881c9e7804fe940dbe287c4b6d75a1b1d1c986d62277c91bf131f4c0f6fad0663737135d3b497124924871f98e7803007d2811dc5b83903dc0a0333f03be7de8122df2c9a05a11e5f51f7a05ce7071804fca8033e5da0734020b0183bb23e5416269577ed0e5323078ceeefdff6a03dbcd62914c2f629a47c622689800879e4fbd046f9d8a2a03e31385c0e73da8b83ca590947dcaead8208e73da8849b3e19ce704f7c5015586d006431f5cf61f3a04ee586ff002481c8fe6191408f0011eb8e30682774dea9bbb5784492ca6385832e1ca95e3d2834be9df8c312e2db5eb4375080337000f1303d18763591a469baef4d755989ec6f6dae5a23e20b599406dd8e080ddbed41272f4dd8caf1c86d163910f9595882a3d718a035edd695d3b6a926b57d0ac65b10b4e06eedd863bf141077fd7af2782bd3fa26a1a8891d57c630948c0279393dcd04cf5875258f4de9f0cb7b7b6d66d2b81ba752d85f5214724fed41036bd79d2fe319d7a8f4b9c81e58de2f04827b9ce09a07a3acecf54b790685ace8697606009e52c377b7f2e682b097d7d36acf0f55df5edbdc0977412468cb6ce3be10af3c63b9c8a0b0751f505be9690dd5d752436f62a3fe4c6448f3b7b0c64e38f615734651f107e3045ac42b67a7693018633b965bc1bc838ee173807bf7cd33065baaeb1a95f2c11dfcd2bc51fe48880aa3e8a062a8b059f595df4ae9a74de9e9ec499d43c97b1427c6e47e525bb63e4282ad3ea3712893c599dbc4259c1627713c927de81043950df97db1406da8411c92063be280230839627078e79a0390a71b5bb5003a8c1232338e4507025573e9fbd02a0e41dc0e680c3691cf714053bb34160895dc16f291d98d02322aa39f3e14707ffaa06f202a5bb0c7201f4a343aca51090497efdfbfce89840c8db8e46573923ff14410b00490d9f5c1a0425dd8ce4673e873cd0265e4dbe7041ed814009b8cbb8e5863bd07163b7716e0607b6698060b96b7b9478dc8643918247ee39a60b7e97f133a8b4e0c63d4ee597380923970a3ef4c0e13e25dfcfab457ba95bdbddb212016501867b9cfbfda982f907c74b282da34874a9048aa479c83838edc62982b7ac7c42d235cd67f15ac5b40c366418a2cb0c1c81e6f5e31db14c160d035de8cd4a3f18ea96562cc37359dfe9cac887fef039fd6b39446f56ea5d13a9dca4579a922496b1975b8d22dfc3566cf9557230703be715ac1431d4d2275325d7fae6b4f6f182a93ef1e32a9f41938f6a60afeb1a95c5fea53dccf772cf2c8c489240031f627e7565c0d67bbf160487c1801073bc0c31f91f953420f2bc8c7c52cc540032738a809905c0f4fa501940208e73df34028e703938a0577ae013f4a001300db4f03b71407461ce0502dca8c9c7dcf6a003fafcbdcd0070bc1e0fd734070db467b8a04cb9c9e68274b93bcb1daa40200ed4099765249ec476cf340849b8b264823bf34689ee009cb671df1409bc8e8b8e770e3ec68984d9c953cf97be2860b248caaebc107dc67f7a184c31232db88fd451031ce50e76039f5c8045026efb8f93279e0fd680b239504f0483d88ef409ee25bb90c79c0e050151c6e21b39ce783eb40adbcc2cefa17bdb61322387781c950e3dbdf9c8a066f28790b22e013db3dbef54726081e63c6460d34191b1bb0720f634060e7600412c781502409c8e3d7b500ed71dbef8ed40243f181c0a02e5d4e0fad006f644e4819e3b501f7e3049e7b501bc43b4e391da80558003392d40a23305e320d02e64cf998e1bf5a032b0c927b8e68049c8c8e71c6280377043118f4e680bbff00de0504ddbb3128371c1c64668024e59f3cd02521254e4fad1a2107e48fe6a6809ddb9e78a029e1463d05027ffc744a6c3857c7b1a205ff00e637fbf4a02b12b1794e39f4a02024e7249ed409924720906800005173fd7404989698ee39e4f7a04cf723d07a501fff0097ed406ffe36a018ff00281e99a037f4d0731f3bfd28007e53400ff99a810248c0cf140bc60123233cff008a0557f9beb4056eff007a07109243e79a03778b27bfbd02b128c27039a054001b818a06609de793da815006070283ffd9}\par} +} diff --git a/test/rtf/link.native b/test/rtf/link.native new file mode 100644 index 000000000..e9e08dc86 --- /dev/null +++ b/test/rtf/link.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Link ("",[],[]) [Str "pandoc"] ("http://pandoc.org","")]] diff --git a/test/rtf/link.rtf b/test/rtf/link.rtf new file mode 100644 index 000000000..7d872abed --- /dev/null +++ b/test/rtf/link.rtf @@ -0,0 +1,7 @@ +{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 \fmodern Courier;}} +{\colortbl;\red255\green0\blue0;\red0\green0\blue255;} +\widowctrl\hyphauto + +{\pard \ql \f0 \sa180 \li0 \fi0 {\field{\*\fldinst{HYPERLINK "http://pandoc.org"}}{\fldrslt{pandoc}}} +\par} +} diff --git a/test/rtf/list_complex.native b/test/rtf/list_complex.native new file mode 100644 index 000000000..53ffdf9bd --- /dev/null +++ b/test/rtf/list_complex.native @@ -0,0 +1,24 @@ +Pandoc (Meta {unMeta = fromList [("author",MetaInlines [Str "Cynthia",Space,Str "Johnson"]),("operator",MetaInlines [Str "John",Space,Str "MacFarlane"]),("title",MetaInlines [Str "Text",Space,Str "before",Space,Str "list"])]}) +[OrderedList (1,Decimal,Period) + [[Para [Str "One"]] + ,[Para [Str "Two"] + ,OrderedList (1,LowerAlpha,Period) + [[Para [Str "Three"]] + ,[Para [Str "Four"] + ,OrderedList (1,LowerRoman,Period) + [[Para [Str "Five"]] + ,[Para [Str "Six"] + ,OrderedList (1,UpperAlpha,Period) + [[Para [Str "Seven"]] + ,[Para [Str "Eight"] + ,OrderedList (1,UpperRoman,Period) + [[Para [Str "Nine"]] + ,[Para [Str "Ten"] + ,BulletList + [[Para [Str "Eleven"]] + ,[Para [Str "Twelve"]]]]]]]]]]]]] +,Para [Str "Out",Space,Str "of",Space,Str "list!"] +,Para [Str "Start",Space,Str "with"] +,OrderedList (7,Decimal,Period) + [[Para [Str "Seven",Space,Str "Start"]] + ,[Para [Str "Eight",Space,Str "Continue"]]]] diff --git a/test/rtf/list_complex.rtf b/test/rtf/list_complex.rtf new file mode 100644 index 000000000..3b21efc74 --- /dev/null +++ b/test/rtf/list_complex.rtf @@ -0,0 +1,299 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff45\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;} +{\f3\fbidi \fdecor\fcharset2\fprq2{\*\panose 00000000000000000000}Symbol;}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f45\fbidi \fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Times;} +{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f52\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\f53\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f55\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f56\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f57\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\f58\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f59\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f60\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f72\fbidi \fmodern\fcharset238\fprq1 Courier New CE;} +{\f73\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f75\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f76\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f77\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);} +{\f78\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f79\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f80\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f392\fbidi \froman\fcharset238\fprq2 Cambria Math CE;} +{\f393\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f395\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f396\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f399\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;} +{\f400\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f502\fbidi \fnil\fcharset238\fprq2 Times CE;}{\f503\fbidi \fnil\fcharset204\fprq2 Times Cyr;}{\f505\fbidi \fnil\fcharset161\fprq2 Times Greek;} +{\f506\fbidi \fnil\fcharset162\fprq2 Times Tur;}{\f509\fbidi \fnil\fcharset186\fprq2 Times Baltic;}{\f510\fbidi \fnil\fcharset163\fprq2 Times (Vietnamese);}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fhimajor\f31528\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\fhimajor\f31529\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;}{\fhimajor\f31531\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;} +{\fhimajor\f31532\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;}{\fhimajor\f31533\fbidi \fswiss\fcharset177\fprq2 Calibri Light (Hebrew);}{\fhimajor\f31534\fbidi \fswiss\fcharset178\fprq2 Calibri Light (Arabic);} +{\fhimajor\f31535\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;}{\fhimajor\f31536\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; +\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green0\blue0;\red0\green0\blue0;}{\*\defchp \fs24\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap +\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af45\afs24\alang1025 \ltrch\fcs0 +\fs24\lang1033\langfe1033\loch\f45\hich\af45\dbch\af31505\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv +\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 +\snext11 \ssemihidden \sunhideused Normal Table;}}{\*\listtable{\list\listtemplateid2032649{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 _;}{\levelnumbers;} +\fs28\cf0\loch\af3\hich\af3\dbch\af0\fbias0\hres0\chhres0 \fi-360\li360\jclisttab\tx360\lin360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'04\'00.\'01.;}{\levelnumbers\'01\'03;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-432\li792\jclisttab\tx792\lin792 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'06\'00.\'01.\'02.;}{\levelnumbers\'01\'03\'05;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-504\li1224\jclisttab\tx1440\lin1224 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'08\'00.\'01.\'02.\'03.;}{\levelnumbers +\'01\'03\'05\'07;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-648\li1728\jclisttab\tx2160\lin1728 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'0a\'00.\'01.\'02.\'03.\'04.;}{\levelnumbers\'01\'03\'05\'07\'09;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-792\li2232\jclisttab\tx2520\lin2232 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'0c\'00.\'01.\'02.\'03.\'04.\'05.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-936\li2736\jclisttab\tx3240\lin2736 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\'0e\'00.\'01.\'02.\'03.\'04.\'05.\'06.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-1080\li3240\jclisttab\tx3600\lin3240 }{\listlevel\levelnfc0\levelnfcn0\leveljc0 +\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'10\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-1224\li3744\jclisttab\tx4320\lin3744 } +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'12\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.\'08.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f\'11;}\rtlch\fcs1 \af0 \ltrch\fcs0 +\hres0\chhres0 \fi-1440\li4320\jclisttab\tx4680\lin4320 }{\listname ;}\listid161162663}{\list\listtemplateid-1055851588{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 +\hres0\chhres0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2880\lin2880 } +{\listlevel\levelnfc1\levelnfcn1\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace540\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li3420\lin3420 }{\listlevel\levelnfc23\levelnfcn23 +\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li4500\lin4500 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 +\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li6480\lin6480 }{\listname ;}\listid180975272}{\list\listtemplateid-1055851588\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698703\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext +\leveltemplateid67698709\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc1\levelnfcn1\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace540\levelindent0{\leveltext +\leveltemplateid67698707\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li3420\lin3420 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext +\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li4500\lin4500 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703 +\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713 +\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715 +\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li6480\lin6480 }{\listname ;}\listid581336416}{\list\listtemplateid-1516889114\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative +\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative +\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative +\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative +\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative +\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative +\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative +\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative +\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li6480\lin6480 }{\listname ;}\listid592708402}{\list\listtemplateid353931476{\listlevel\levelnfc0\levelnfcn0 +\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'02\'03.;}{\levelnumbers +\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc1\levelnfcn1\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace540\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 +\hres0\chhres0 \fi-180\li3420\lin3420 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li4320\lin4320 } +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0 +\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li6480\lin6480 }{\listname ;}\listid621182402}{\list\listtemplateid-37037068{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 +\hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li4320\lin4320 } +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0 +\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li6480\lin6480 }{\listname ;}\listid982349901}{\list\listtemplateid-2094603378{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 +\hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li4320\lin4320 } +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0 +\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li6480\lin6480 }{\listname ;}\listid1082678316}{\list\listtemplateid166376406\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0 +\leveljcn0\levelfollow0\levelstartat7\levelspace0\levelindent0{\leveltext\leveltemplateid-1898031884\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2 +\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2 +\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2 +\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li6480\lin6480 }{\listname ;}\listid1306352145} +{\list\listtemplateid2032649{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li360\jclisttab\tx360\lin360 } +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'04\'00.\'01.;}{\levelnumbers\'01\'03;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-432\li792\jclisttab\tx792\lin792 }{\listlevel +\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'06\'00.\'01.\'02.;}{\levelnumbers\'01\'03\'05;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-504\li1224\jclisttab\tx1440\lin1224 }{\listlevel +\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'08\'00.\'01.\'02.\'03.;}{\levelnumbers\'01\'03\'05\'07;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-648\li1728\jclisttab\tx2160\lin1728 } +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0a\'00.\'01.\'02.\'03.\'04.;}{\levelnumbers\'01\'03\'05\'07\'09;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-792\li2232 +\jclisttab\tx2520\lin2232 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0c\'00.\'01.\'02.\'03.\'04.\'05.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b;}\rtlch\fcs1 \af0 \ltrch\fcs0 +\hres0\chhres0 \fi-936\li2736\jclisttab\tx3240\lin2736 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0e\'00.\'01.\'02.\'03.\'04.\'05.\'06.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-1080\li3240\jclisttab\tx3600\lin3240 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'10\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-1224\li3744\jclisttab\tx4320\lin3744 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\'12\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.\'08.;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f\'11;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-1440\li4320\jclisttab\tx4680\lin4320 }{\listname +;}\listid1517575639}{\list\listtemplateid-2069710980{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0\hres0\chhres0 +\fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel +\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 +\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 +\hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-180\li6480\lin6480 } +{\listname ;}\listid1762801537}}{\*\listoverridetable{\listoverride\listid1517575639\listoverridecount0\ls1}{\listoverride\listid161162663\listoverridecount0\ls2}{\listoverride\listid581336416\listoverridecount0\ls3}{\listoverride\listid1082678316 +\listoverridecount0\ls4}{\listoverride\listid1762801537\listoverridecount0\ls5}{\listoverride\listid621182402\listoverridecount0\ls6}{\listoverride\listid592708402\listoverridecount0\ls7}{\listoverride\listid180975272\listoverridecount0\ls8} +{\listoverride\listid1306352145\listoverridecount0\levelstartat7\ls9}{\listoverride\listid982349901\listoverridecount0\ls10}}{\*\rsidtbl \rsid329053\rsid3617154\rsid3749795\rsid9258424}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0 +\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\title Text before list}{\author Cynthia Johnson}{\operator John MacFarlane}{\creatim\yr2003\mo10\dy13\hr19\min55}{\revtim\yr2021\mo8\dy9\hr10\min28}{\version4}{\edmins6}{\nofpages1}{\nofwords15} +{\nofchars87}{\nofcharsws101}{\vern4617}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\noxlattoyen +\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dghspace180\dgvspace180\dghorigin1701\dgvorigin1984\dghshow0\dgvshow0 +\jexpand\viewkind1\viewscale154\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\rsidroot3749795 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect +\linex0\endnhere\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (} +{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f45\insrsid9258424 +\hich\af45\dbch\af31505\loch\f45 1.\tab}\pard\plain \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls3\adjustright\rin0\lin720\itap0\pararsid9258424 \rtlch\fcs1 \af45\afs24\alang1025 \ltrch\fcs0 +\fs24\lang1033\langfe1033\loch\af45\hich\af45\dbch\af31505\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid9258424 \hich\af45\dbch\af31505\loch\f45 One}{\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid329053 +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f45\insrsid9258424 \hich\af45\dbch\af31505\loch\f45 2.\tab}}{\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid9258424 \hich\af45\dbch\af31505\loch\f45 Two +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f45\insrsid9258424 \hich\af45\dbch\af31505\loch\f45 a.\tab}}\pard \ltrpar +\ql \fi-360\li1440\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl1\adjustright\rin0\lin1440\itap0\pararsid9258424 {\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid9258424 \hich\af45\dbch\af31505\loch\f45 Three +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f45\insrsid9258424 \hich\af45\dbch\af31505\loch\f45 b.\tab}\hich\af45\dbch\af31505\loch\f45 Four +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f45\insrsid9258424 \hich\af45\dbch\af31505\loch\f45 i.\tab}}\pard \ltrpar +\ql \fi-180\li2160\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl2\adjustright\rin0\lin2160\itap0\pararsid9258424 {\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid9258424 \hich\af45\dbch\af31505\loch\f45 Five +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f45\insrsid9258424 \hich\af45\dbch\af31505\loch\f45 ii.\tab}\hich\af45\dbch\af31505\loch\f45 Six +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f45\insrsid9258424 \hich\af45\dbch\af31505\loch\f45 A.\tab}}\pard \ltrpar +\ql \fi-360\li2880\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl3\adjustright\rin0\lin2880\itap0\pararsid9258424 {\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid9258424 \hich\af45\dbch\af31505\loch\f45 Seven +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f45\insrsid9258424 \hich\af45\dbch\af31505\loch\f45 B.\tab}\hich\af45\dbch\af31505\loch\f45 Eight +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f45\insrsid9258424 \hich\af45\dbch\af31505\loch\f45 I.\tab}}\pard \ltrpar +\ql \fi-180\li3420\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl4\adjustright\rin0\lin3420\itap0\pararsid9258424 {\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid9258424 \hich\af45\dbch\af31505\loch\f45 Nine +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \f45\insrsid9258424 \hich\af45\dbch\af31505\loch\f45 II.\tab}\hich\af45\dbch\af31505\loch\f45 Ten +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af45 \ltrch\fcs0 \f2\insrsid9258424 \hich\af2\dbch\af31505\loch\f2 o\tab}}\pard \ltrpar\ql \fi-360\li4500\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl5\adjustright\rin0\lin4500\itap0\pararsid9258424 { +\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid9258424 \hich\af45\dbch\af31505\loch\f45 Eleven +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af45 \ltrch\fcs0 \f2\insrsid9258424 \hich\af2\dbch\af31505\loch\f2 o\tab}\hich\af45\dbch\af31505\loch\f45 Twelve +\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9258424 {\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid9258424 \hich\af45\dbch\af31505\loch\f45 Out of list! +\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3617154 {\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid3617154 \hich\af45\dbch\af31505\loch\f45 Start with +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af45 \ltrch\fcs0 \f45\insrsid3617154 \hich\af45\dbch\af31505\loch\f45 7.\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls9\adjustright\rin0\lin720\itap0\pararsid3617154 { +\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid3617154 \hich\af45\dbch\af31505\loch\f45 Seven Start +\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af45 \ltrch\fcs0 \f45\insrsid3617154 \hich\af45\dbch\af31505\loch\f45 8.\tab}\hich\af45\dbch\af31505\loch\f45 Eight Continue +\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3617154 {\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid3617154 +\par }\pard \ltrpar\ql \li4140\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin4140\itap0\pararsid9258424 {\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid9258424 +\par }{\rtlch\fcs1 \af45 \ltrch\fcs0 \insrsid3617154 +\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a +9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad +5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 +b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 +0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 +a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f +c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 +0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 +a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 +6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b +4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b +4757e8d3f729e245eb2b260a0238fd010000ffff0300504b030414000600080000002100b6f4679893070000c9200000160000007468656d652f7468656d652f +7468656d65312e786d6cec59cd8b1bc915bf07f23f347d97f5d5ad8fc1f2a24fcfda33b6b164873dd648a5eef2547789aad28cc56208de532e81c026e49085bd +ed21842cecc22eb9e48f31d8249b3f22afaa5bdd5552c99e191c3061463074977eefd5afde7bf5de53d5ddcf5e26d4bbc05c1096f6fcfa9d9aefe174ce16248d +7afeb3d9a4d2f13d2151ba4094a5b8e76fb0f03fbbf7eb5fdd454732c609f6403e1547a8e7c752ae8eaa5531876124eeb0154ee1bb25e30992f0caa3ea82a34b +d09bd06aa3566b55134452df4b51026a1f2f97648ebd9952e9dfdb2a1f53784da5500373caa74a35b6243476715e5708b11143cabd0b447b3eccb3609733fc52 +fa1e4542c2173dbfa6fffceabdbb5574940b517940d6909be8bf5c2e17589c37f49c3c3a2b260d823068f50bfd1a40e53e6edc1eb7c6ad429f06a0f91c569a71 +b175b61bc320c71aa0ecd1a17bd41e35eb16ded0dfdce3dc0fd5c7c26b50a63fd8c34f2643b0a285d7a00c1feee1c3417730b2f56b50866fede1dbb5fe28685b +fa3528a6243ddf43d7c25673b85d6d0159327aec8477c360d26ee4ca4b144443115d6a8a254be5a1584bd00bc6270050408a24493db959e1259a43140f112567 +9c7827248a21f056286502866b8ddaa4d684ffea13e827ed5174849121ad780113b137a4f87862cec94af6fc07a0d537206f7ffef9cdeb1fdfbcfee9cd575fbd +79fdf77c6eadca923b466964cafdf2dd1ffef3cd6fbd7ffff0ed2f5fff319b7a172f4cfcbbbffdeedd3ffef93ef5b0e2d2146ffff4fdbb1fbf7ffbe7dfffebaf +5f3bb4f7393a33e1339260e13dc297de5396c0021dfcf119bf9ec42c46c494e8a791402952b338f48f656ca11f6d10450edc00db767cce21d5b880f7d72f2cc2 +d398af2571687c182716f094313a60dc6985876a2ec3ccb3751ab927e76b13f714a10bd7dc43945a5e1eaf579063894be530c616cd2714a5124538c5d253dfb1 +738c1dabfb8210cbaea764ce99604be97d41bc01224e93ccc899154da5d03149c02f1b1741f0b7659bd3e7de8051d7aa47f8c246c2de40d4417e86a965c6fb68 +2d51e252394309350d7e8264ec2239ddf0b9891b0b099e8e3065de78818570c93ce6b05ec3e90f21cdb8dd7e4a37898de4929cbb749e20c64ce4889d0f6394ac +5cd829496313fbb938871045de13265df05366ef10f50e7e40e941773f27d872f787b3c133c8b026a53240d4376beef0e57dccacf89d6ee8126157aae9f3c44a +b17d4e9cd131584756689f604cd1255a60ec3dfbdcc160c05696cd4bd20f62c82ac7d815580f901dabea3dc5027a25d5dcece7c91322ac909de2881de073bad9 +493c1b9426881fd2fc08bc6eda7c0ca52e7105c0633a3f37818f08f480102f4ea33c16a0c308ee835a9fc4c82a60ea5db8e375c32dff5d658fc1be7c61d1b8c2 +be04197c6d1948eca6cc7b6d3343d49aa00c9819822ec3956e41c4727f29a28aab165b3be596f6a62ddd00dd91d5f42424fd6007b4d3fb84ffbbde073a8cb77f +f9c6b10f3e4ebfe3566c25ab6b763a8792c9f14e7f7308b7dbd50c195f904fbfa919a175fa04431dd9cf58b73dcd6d4fe3ffdff73487f6f36d2773a8dfb8ed64 +7ce8306e3b99fc70e5e3743265f3027d8d3af0c80e7af4b14f72f0d46749289dca0dc527421ffc08f83db398c0a092d3279eb838055cc5f0a8ca1c4c60e1228e +b48cc799fc0d91f134462b381daafb4a492472d591f0564cc0a1911e76ea5678ba4e4ed9223becacd7d5c16656590592e5782d2cc6e1a04a66e856bb3cc02bd4 +6bb6913e68dd1250b2d721614c6693683a48b4b783ca48fa58178ce620a157f65158741d2c3a4afdd6557b2c805ae115f8c1edc1cff49e1f06200242701e07cd +f942f92973f5d6bbda991fd3d3878c69450034d8db08283ddd555c0f2e4fad2e0bb52b78da2261849b4d425b46377822869fc17974aad1abd0b8aeafbba54b2d +7aca147a3e08ad9246bbf33e1637f535c8ede6069a9a9982a6de65cf6f35430899395af5fc251c1ac363b282d811ea3717a211dcbccc25cf36fc4d32cb8a0b39 +4222ce0cae934e960d122231f728497abe5a7ee1069aea1ca2b9d51b90103e59725d482b9f1a3970baed64bc5ce2b934dd6e8c284b67af90e1b35ce1fc568bdf +1cac24d91adc3d8d1797de195df3a708422c6cd795011744c0dd413db3e682c0655891c8caf8db294c79da356fa3740c65e388ae62945714339967709dca0b3a +faadb081f196af190c6a98242f8467912ab0a651ad6a5a548d8cc3c1aafb6121653923699635d3ca2aaa6abab39835c3b60cecd8f26645de60b53531e434b3c2 +67a97b37e576b7b96ea74f28aa0418bcb09fa3ea5ea12018d4cac92c6a8af17e1a56393b1fb56bc776811fa07695226164fdd656ed8edd8a1ae19c0e066f54f9 +416e376a6168b9ed2bb5a5f5adb979b1cdce5e40f2184197bba6526857c2c92e47d0104d754f92a50dd8222f65be35e0c95b73d2f3bfac85fd60d80887955a27 +1c57826650ab74c27eb3d20fc3667d1cd66ba341e31514161927f530bbb19fc00506dde4f7f67a7cefee3ed9ded1dc99b3a4caf4dd7c5513d777f7f5c6e1bb7b +8f40d2f9b2d598749bdd41abd26df627956034e854bac3d6a0326a0ddba3c9681876ba9357be77a1c141bf390c5ae34ea5551f0e2b41aba6e877ba9576d068f4 +8376bf330efaaff23606569ea58fdc16605ecdebde7f010000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d65 +2f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d36 +3f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e +3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d985 +0528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000000000 +0000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000 +000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019020000 +7468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d0014000600080000002100b6f4679893070000c92000001600000000000000 +000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027000000 +000000000000000000009d0a00007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000980b00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax376\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 5; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 9; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 1;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 2;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 3; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 4;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 5;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 6; +\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 7;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 8;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 header;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footer; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index heading;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of figures; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope return;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation reference; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 line number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 page number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote text; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of authorities;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 macro;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 toa heading;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 5;\lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Closing; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Signature;\lsdsemihidden1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 4; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Message Header;\lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Salutation; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Date;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Note Heading; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 3; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Block Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 FollowedHyperlink;\lsdqformat1 \lsdpriority22 \lsdlocked0 Strong; +\lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Document Map;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Plain Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 E-mail Signature; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Top of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Bottom of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal (Web);\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Acronym; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Address;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Cite;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Code;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Definition; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Keyboard;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Preformatted;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Sample;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Typewriter; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Variable;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation subject;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 No List;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 1; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Balloon Text;\lsdpriority39 \lsdlocked0 Table Grid; +\lsdsemihidden1 \lsdlocked0 Placeholder Text;\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdpriority60 \lsdlocked0 Light Shading;\lsdpriority61 \lsdlocked0 Light List;\lsdpriority62 \lsdlocked0 Light Grid; +\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdpriority65 \lsdlocked0 Medium List 1;\lsdpriority66 \lsdlocked0 Medium List 2;\lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdpriority68 \lsdlocked0 Medium Grid 2; +\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List;\lsdpriority71 \lsdlocked0 Colorful Shading;\lsdpriority72 \lsdlocked0 Colorful List;\lsdpriority73 \lsdlocked0 Colorful Grid;\lsdpriority60 \lsdlocked0 Light Shading Accent 1; +\lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1; +\lsdsemihidden1 \lsdlocked0 Revision;\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; +\lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdpriority62 \lsdlocked0 Light Grid Accent 2; +\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2; +\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdpriority62 \lsdlocked0 Light Grid Accent 3; +\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3; +\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdpriority62 \lsdlocked0 Light Grid Accent 4; +\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; +\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdpriority62 \lsdlocked0 Light Grid Accent 5; +\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5; +\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6; +\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6; +\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6; +\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography; +\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4; +\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2; +\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3; +\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4; +\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4; +\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5; +\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5; +\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6; +\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6; +\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3; +\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3; +\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4; +\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4; +\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5; +\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5; +\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6; +\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention; +\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Unresolved Mention;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Link;}}{\*\datastore }} diff --git a/test/rtf/list_simple.native b/test/rtf/list_simple.native new file mode 100644 index 000000000..9281b285a --- /dev/null +++ b/test/rtf/list_simple.native @@ -0,0 +1,8 @@ +Pandoc (Meta {unMeta = fromList []}) +[BulletList + [[Para [Str "one"]] + ,[Para [Str "two"] + ,BulletList + [[Para [Str "sub"]]]]] +,BulletList + [[Para [Str "new",Space,Str "list"]]]] diff --git a/test/rtf/list_simple.rtf b/test/rtf/list_simple.rtf new file mode 100644 index 000000000..8ee557df7 --- /dev/null +++ b/test/rtf/list_simple.rtf @@ -0,0 +1,17 @@ +{\rtf1\ansi\ansicpg1252\cocoartf2513 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +{\*\expandedcolortbl;;} +{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid2\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid1} +{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}} +\margl1440\margr1440\vieww11520\viewh8400\viewkind0 +\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0 +\ls1\ilvl0 +\f0\fs24 \cf0 {\listtext \uc0\u8226 }one\ +{\listtext \uc0\u8226 }two\ +\pard\tx940\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li1440\fi-1440\pardirnatural\partightenfactor0 +\ls1\ilvl1\cf0 {\listtext \uc0\u8259 }sub\ +\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0 +\ls2\ilvl0\cf0 {\listtext \uc0\u8226 }new list\ +} \ No newline at end of file diff --git a/test/rtf/table_simple.native b/test/rtf/table_simple.native new file mode 100644 index 000000000..3cff9ac38 --- /dev/null +++ b/test/rtf/table_simple.native @@ -0,0 +1,31 @@ +Pandoc (Meta {unMeta = fromList []}) +[Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidthDefault) + ,(AlignDefault,ColWidthDefault) + ,(AlignDefault,ColWidthDefault) + ,(AlignDefault,ColWidthDefault)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "A"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "B"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "C"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "D"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "E"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "F"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "G"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "H"]]]])] + (TableFoot ("",[],[]) + [])] diff --git a/test/rtf/table_simple.rtf b/test/rtf/table_simple.rtf new file mode 100644 index 000000000..5d4aca686 --- /dev/null +++ b/test/rtf/table_simple.rtf @@ -0,0 +1,19 @@ +{\rtf1\ansi +\par +\trowd +\cellx10836 +\pard \intbl A \cell +\pard \intbl B \cell +\pard \intbl C \cell +\pard \intbl D \cell +\row +\trowd +\cellx10836 +\pard \intbl E \cell +\pard \intbl F \cell +\pard \intbl G \cell +\pard \intbl H \cell +\row +\pard +} + diff --git a/test/rtf/unicode.native b/test/rtf/unicode.native new file mode 100644 index 000000000..fc104491d --- /dev/null +++ b/test/rtf/unicode.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Str "\8220hi\8221\8216hi\8217\61623\945\228"]] diff --git a/test/rtf/unicode.rtf b/test/rtf/unicode.rtf new file mode 100644 index 000000000..0cd9749e0 --- /dev/null +++ b/test/rtf/unicode.rtf @@ -0,0 +1,9 @@ +{\rtf1\ansi +\pard +\'93hi\'94 +\u8216\'93hi\u8217\'94 +\u-3913? +\u945a +{\uc2\u228\'E8a} +\par +} diff --git a/test/test-pandoc.hs b/test/test-pandoc.hs index abb2f105f..476762aac 100644 --- a/test/test-pandoc.hs +++ b/test/test-pandoc.hs @@ -27,6 +27,7 @@ import qualified Tests.Readers.Muse import qualified Tests.Readers.Odt import qualified Tests.Readers.Org import qualified Tests.Readers.RST +import qualified Tests.Readers.RTF import qualified Tests.Readers.Txt2Tags import qualified Tests.Readers.Man import qualified Tests.Shared @@ -85,6 +86,7 @@ tests pandocPath = testGroup "pandoc tests" , testGroup "Jira" Tests.Readers.Jira.tests , testGroup "Org" Tests.Readers.Org.tests , testGroup "RST" Tests.Readers.RST.tests + , testGroup "RTF" Tests.Readers.RTF.tests , testGroup "Docx" Tests.Readers.Docx.tests , testGroup "Odt" Tests.Readers.Odt.tests , testGroup "Txt2Tags" Tests.Readers.Txt2Tags.tests -- cgit v1.2.3 From 3d7120083a8721e3729d44cd8d46275093437ed3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 10 Aug 2021 11:09:12 -0700 Subject: Fix RTF table parsing bug that created undesired nested tables. Closes #7488. --- src/Text/Pandoc/Readers/RTF.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/RTF.hs b/src/Text/Pandoc/Readers/RTF.hs index 749a38dd3..0e7fbac5a 100644 --- a/src/Text/Pandoc/Readers/RTF.hs +++ b/src/Text/Pandoc/Readers/RTF.hs @@ -648,7 +648,7 @@ emitBlocks bs = do let prop = case annotatedToks of [] -> def ((p,_):_) -> p - tbl <- if gInTable prop + tbl <- if gInTable prop || null annotatedToks then pure mempty else closeTable new <- -- cgit v1.2.3 From 7ca4233793f3ba42b2c79c3526a4ab2664fea2e2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 10 Aug 2021 11:11:33 -0700 Subject: Add test for #7488. --- test/Tests/Readers/RTF.hs | 1 + test/rtf/table_error_codes.native | 146 +++++++++++++++++++ test/rtf/table_error_codes.rtf | 300 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 447 insertions(+) create mode 100644 test/rtf/table_error_codes.native create mode 100644 test/rtf/table_error_codes.rtf diff --git a/test/Tests/Readers/RTF.hs b/test/Tests/Readers/RTF.hs index 2a741bba8..da0ddfc93 100644 --- a/test/Tests/Readers/RTF.hs +++ b/test/Tests/Readers/RTF.hs @@ -44,5 +44,6 @@ tests = map rtfTest [ "footnote" , "list_complex" , "bookmark" , "table_simple" + , "table_error_codes" ] diff --git a/test/rtf/table_error_codes.native b/test/rtf/table_error_codes.native new file mode 100644 index 000000000..bc75d4f81 --- /dev/null +++ b/test/rtf/table_error_codes.native @@ -0,0 +1,146 @@ +Pandoc (Meta {unMeta = fromList []}) +[Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidthDefault) + ,(AlignDefault,ColWidthDefault)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "Code"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "Error"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "3"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocFailOnWarningError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "4"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocAppError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "5"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocTemplateError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "6"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocOptionError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "21"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocUnknownReaderError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "22"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocUnknownWriterError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "23"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocUnsupportedExtensionError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "24"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocCiteprocError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "31"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocEpubSubdirectoryError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "43"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocPDFError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "44"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocXMLError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "47"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocPDFProgramNotFoundError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "61"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocHttpError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "62"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocShouldNeverHappenError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "63"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocSomeError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "64"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocParseError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "65"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocParsecError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "66"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocMakePDFError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "67"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocSyntaxMapError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "83"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocFilterError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "91"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocMacroLoop"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "92"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocUTF8DecodingError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "93"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocIpynbDecodingError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "94"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocUnsupportedCharsetError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "97"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocCouldNotFindDataFileError"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "99"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Para [Str "PandocResourceNotFound"]]]])] + (TableFoot ("",[],[]) + [])] diff --git a/test/rtf/table_error_codes.rtf b/test/rtf/table_error_codes.rtf new file mode 100644 index 000000000..79ed61e10 --- /dev/null +++ b/test/rtf/table_error_codes.rtf @@ -0,0 +1,300 @@ +{\rtf1\ansi +{ +\trowd \trgaph120 +\clbrdrb\brdrs\cellx4320\clbrdrb\brdrs\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 Code\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 Error\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 3\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocFailOnWarningError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 4\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocAppError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 5\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocTemplateError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 6\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocOptionError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 21\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocUnknownReaderError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 22\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocUnknownWriterError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 23\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocUnsupportedExtensionError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 24\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocCiteprocError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 31\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocEpubSubdirectoryError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 43\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocPDFError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 44\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocXMLError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 47\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocPDFProgramNotFoundError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 61\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocHttpError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 62\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocShouldNeverHappenError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 63\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocSomeError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 64\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocParseError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 65\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocParsecError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 66\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocMakePDFError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 67\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocSyntaxMapError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 83\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocFilterError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 91\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocMacroLoop\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 92\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocUTF8DecodingError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 93\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocIpynbDecodingError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 94\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocUnsupportedCharsetError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 97\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocCouldNotFindDataFileError\par} +\cell} +} +\intbl\row} +{ +\trowd \trgaph120 +\cellx4320\cellx8640 +\trkeep\intbl +{ +{{\pard\intbl \qr \f0 \sa0 \li0 \fi0 99\par} +\cell} +{{\pard\intbl \ql \f0 \sa0 \li0 \fi0 PandocResourceNotFound\par} +\cell} +} +\intbl\row} +{\pard \ql \f0 \sa180 \li0 \fi0 \par} +} -- cgit v1.2.3 From 3a924d8f96a336f6adcee5dd4c924c14a92a5bf7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 10 Aug 2021 12:50:23 -0700 Subject: HTML reader: treat commments as blank when parsing. This modifies pBlank. Previously comments could sometimes flummox the parser. Cloes #7482. --- src/Text/Pandoc/Readers/HTML/Parsing.hs | 12 +++++---- test/command/7482.md | 47 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 test/command/7482.md diff --git a/src/Text/Pandoc/Readers/HTML/Parsing.hs b/src/Text/Pandoc/Readers/HTML/Parsing.hs index bd8d7c96c..27a23aa69 100644 --- a/src/Text/Pandoc/Readers/HTML/Parsing.hs +++ b/src/Text/Pandoc/Readers/HTML/Parsing.hs @@ -30,11 +30,11 @@ module Text.Pandoc.Readers.HTML.Parsing ) where -import Control.Monad (guard, void, mzero) +import Control.Monad (void, mzero) import Data.Maybe (fromMaybe) import Data.Text (Text) import Text.HTML.TagSoup - ( Attribute, Tag (..), isTagText, isTagPosition, isTagOpen, isTagClose, (~==) ) + ( Attribute, Tag (..), isTagPosition, isTagOpen, isTagClose, (~==) ) import Text.Pandoc.Class.PandocMonad (PandocMonad (..)) import Text.Pandoc.Definition (Attr) import Text.Pandoc.Parsing @@ -118,9 +118,11 @@ pCloses tagtype = try $ do _ -> mzero pBlank :: PandocMonad m => TagParser m () -pBlank = try $ do - (TagText str) <- pSatisfy isTagText - guard $ T.all isSpace str +pBlank = void $ pSatisfy isBlank + where + isBlank (TagText t) = T.all isSpace t + isBlank (TagComment _) = True + isBlank _ = False pLocation :: PandocMonad m => TagParser m () pLocation = do diff --git a/test/command/7482.md b/test/command/7482.md new file mode 100644 index 000000000..b4f750e2f --- /dev/null +++ b/test/command/7482.md @@ -0,0 +1,47 @@ +``` +% pandoc -f html -t org + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Last N + creditsAverage grade
14017.06571429
8417.95595238
6418.9734375
3619.12777778
2919.18275862
1919.00526316
+^D +| Last N credits | Average grade | +| 140 | 17.06571429 | +| 84 | 17.95595238 | +| 64 | 18.9734375 | +| 36 | 19.12777778 | +| 29 | 19.18275862 | +| 19 | 19.00526316 | +``` -- cgit v1.2.3 From 06d97131e530d2ee9b14617290a157dd42c0db30 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 10 Aug 2021 22:07:48 -0700 Subject: Tests.Helpers: export testGolden and use it in RTF reader. This gives a diff output on failure. --- test/Tests/Helpers.hs | 23 ++++++++++++++++++++++- test/Tests/Readers/RTF.hs | 17 +++++------------ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/test/Tests/Helpers.hs b/test/Tests/Helpers.hs index a48a5894e..6c06e3f71 100644 --- a/test/Tests/Helpers.hs +++ b/test/Tests/Helpers.hs @@ -16,6 +16,7 @@ module Tests.Helpers ( test , TestResult(..) , setupEnvironment , showDiff + , testGolden , (=?>) , purely , ToString(..) @@ -23,13 +24,16 @@ module Tests.Helpers ( test ) where +import System.FilePath import Data.Algorithm.Diff import qualified Data.Map as M +import qualified Text.Pandoc.UTF8 as UTF8 import Data.Text (Text, unpack) +import qualified Data.Text as T import System.Exit -import System.FilePath (takeDirectory) import qualified System.Environment as Env import Test.Tasty +import Test.Tasty.Golden.Advanced (goldenTest) import Test.Tasty.HUnit import Text.Pandoc.Builder (Blocks, Inlines, doc, plain) import Text.Pandoc.Class @@ -61,6 +65,23 @@ test fn name (input, expected) = dashes "" = replicate 72 '-' dashes x = replicate (72 - length x - 5) '-' ++ " " ++ x ++ " ---" +testGolden :: TestName -> FilePath -> FilePath -> (Text -> IO Text) -> TestTree +testGolden name expectedPath inputPath fn = + goldenTest + name + (UTF8.readFile expectedPath) + (UTF8.readFile inputPath >>= fn) + compareVals + (UTF8.writeFile expectedPath) + where + compareVals expected actual + | expected == actual = return Nothing + | otherwise = return $ Just $ + "\n--- " ++ expectedPath ++ "\n+++\n" ++ + showDiff (1,1) + (getDiff (lines . filter (/='\r') $ T.unpack actual) + (lines . filter (/='\r') $ T.unpack expected)) + -- | Set up environment for pandoc command tests. setupEnvironment :: FilePath -> IO [(String, String)] setupEnvironment testExePath = do diff --git a/test/Tests/Readers/RTF.hs b/test/Tests/Readers/RTF.hs index da0ddfc93..1b335274b 100644 --- a/test/Tests/Readers/RTF.hs +++ b/test/Tests/Readers/RTF.hs @@ -13,25 +13,18 @@ module Tests.Readers.RTF (tests) where import Test.Tasty import Tests.Helpers -import Test.Tasty.Golden (goldenVsString) -import qualified Data.ByteString as BS import Text.Pandoc -import Text.Pandoc.UTF8 (toText, fromStringLazy) -import Data.Text (Text, unpack) import System.FilePath (replaceExtension, (), (<.>)) -rtfToNative :: Text -> Text -rtfToNative = - purely (writeNative def{ writerTemplate = Just mempty }) . - purely (readRTF def) - rtfTest :: TestName -> TestTree -rtfTest name = goldenVsString name native - (fromStringLazy . filter (/='\r') . unpack . rtfToNative . toText - <$> BS.readFile path) +rtfTest name = testGolden name native path + (\t -> runIOorExplode + (readRTF def t >>= + writeNative def{ writerTemplate = Just mempty })) where native = replaceExtension path ".native" path = "rtf" name <.> "rtf" + tests :: [TestTree] tests = map rtfTest [ "footnote" , "accent" -- cgit v1.2.3 From a0e44b1ff651ba59fe23b9e1b5d534d324dc0808 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 11 Aug 2021 10:32:52 -0700 Subject: LaTeX reader: improve handling of plain TeX macro primitives. - Fixed semantics for `\let`. - Implement `\edef`, `\gdef`, and `\xdef`. - Add comment noting that currently `\def` and `\edef` set global macros (so are equivalent to `\gdef` and `\xdef`). This should be fixed by scoping macro definitions to groups, in a future commit. Closes #7474. --- src/Text/Pandoc/Readers/LaTeX/Macro.hs | 31 ++++++++++++++++++++++---- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 4 ++-- test/command/macros.md | 38 +++++++++++++++++++++++++++++++- 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX/Macro.hs b/src/Text/Pandoc/Readers/LaTeX/Macro.hs index 5495a8e74..6a7b0eed3 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Macro.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Macro.hs @@ -23,7 +23,8 @@ macroDef constructor = do guardDisabled Ext_latex_macros) <|> return mempty where commandDef = do - nameMacroPairs <- newcommand <|> letmacro <|> defmacro <|> newif + nameMacroPairs <- newcommand <|> letmacro <|> + edefmacro <|> defmacro <|> newif guardDisabled Ext_latex_macros <|> mapM_ (\(name, macro') -> updateState (\s -> s{ sMacros = M.insert name macro' @@ -46,23 +47,45 @@ macroDef constructor = do letmacro :: PandocMonad m => LP m [(Text, Macro)] letmacro = do controlSeq "let" - (name, contents) <- withVerbatimMode $ do + withVerbatimMode $ do Tok _ (CtrlSeq name) _ <- anyControlSeq optional $ symbol '=' spaces -- we first parse in verbatim mode, and then expand macros, -- because we don't want \let\foo\bar to turn into -- \let\foo hello if we have previously \def\bar{hello} + macros <- sMacros <$> getState + target <- anyControlSeq <|> singleChar + case target of + (Tok _ (CtrlSeq name') _) -> + case M.lookup name' macros of + Just m -> return [(name, m)] + Nothing -> return [(name, Macro ExpandWhenDefined [] Nothing [target])] + _ -> return [(name, Macro ExpandWhenDefined [] Nothing [target])] + +edefmacro :: PandocMonad m => LP m [(Text, Macro)] +edefmacro = do + controlSeq "edef" <|> controlSeq "xdef" + -- TODO Currently we don't distinguish these. \edef should only + -- affect its own group, while \xdef sets a global macro. + (name, contents) <- withVerbatimMode $ do + Tok _ (CtrlSeq name) _ <- anyControlSeq + -- we first parse in verbatim mode, and then expand macros, + -- because we don't want \let\foo\bar to turn into + -- \let\foo hello if we have previously \def\bar{hello} contents <- bracedOrToken return (name, contents) - contents' <- doMacros' 0 contents + -- expand macros + contents' <- parseFromToks (many anyTok) contents return [(name, Macro ExpandWhenDefined [] Nothing contents')] defmacro :: PandocMonad m => LP m [(Text, Macro)] defmacro = do -- we use withVerbatimMode, because macros are to be expanded -- at point of use, not point of definition - controlSeq "def" + controlSeq "def" <|> controlSeq "gdef" + -- TODO Currently we don't distinguish these. \def should only + -- affect its own group, while \gdef sets a global macro. withVerbatimMode $ do Tok _ (CtrlSeq name) _ <- anyControlSeq argspecs <- many (argspecArg <|> argspecPattern) diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 9dac4d6ef..8d6791abb 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -267,7 +267,7 @@ rawLaTeXParser toks retokenize parser valParser = do Right (endpos, toks') -> do res <- lift $ runParserT (do when retokenize $ do -- retokenize, applying macros - ts <- many (satisfyTok (const True)) + ts <- many anyTok setInput ts rawparser) lstate' "chunk" toks' @@ -296,7 +296,7 @@ rawLaTeXParser toks retokenize parser valParser = do applyMacros :: (PandocMonad m, HasMacros s, HasReaderOptions s) => Text -> ParserT Sources s m Text applyMacros s = (guardDisabled Ext_latex_macros >> return s) <|> - do let retokenize = untokenize <$> many (satisfyTok (const True)) + do let retokenize = untokenize <$> many anyTok pstate <- getState let lstate = def{ sOptions = extractReaderOptions pstate , sMacros = extractMacros pstate } diff --git a/test/command/macros.md b/test/command/macros.md index e3c07e661..9f7a0f9d3 100644 --- a/test/command/macros.md +++ b/test/command/macros.md @@ -25,7 +25,7 @@ expanded at point of use: ``` % pandoc -f latex -t latex \let\a\b -\newcommand{\b}{\emph{ouk}} +\def\b{\emph{ouk}} \a a ^D a̱ @@ -123,3 +123,39 @@ hello+hello hello+goodbye ``` +``` +% pandoc -f latex -t plain +\def\txt{a} +\def\foo{\txt} +\let\bar\foo +\bar % -> a +\def\txt{b} +\bar % -> b +\def\foo{OH} +\bar % -> b +^D +a b b +``` + +``` +% pandoc -f latex -t plain +\def\aaa{aaa} +\def\bbb{x\aaa} +\edef\ccc{y\aaa} +\def\aaa{AAA} +\bbb \ccc +^D +xAAAyaaa +``` + +``` +% pandoc -f latex -t plain +\gdef\aaa{aaa} +\gdef\bbb{x\aaa} +\xdef\ccc{y\aaa} +\gdef\aaa{AAA} +\bbb \ccc +^D +xAAAyaaa +``` + -- cgit v1.2.3 From f00f7ec63c19c55644cbf98133dfca4d8c10b590 Mon Sep 17 00:00:00 2001 From: William Lupton Date: Wed, 11 Aug 2021 19:12:45 +0100 Subject: Clarify internal punctuation in citation keys. (#7491) Addresses a comment in #5458. --- MANUAL.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 3e8e6b0fd..c76505e80 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1932,7 +1932,7 @@ ${ styles.html() } ``` (If a partial is not found in the directory of the -template and the template path is given as a relative +template and the template path is given as a relative path, it will also be sought in the `templates` subdirectory of the user data directory.) @@ -4984,13 +4984,16 @@ See the [CSL user documentation] for more information about CSL styles and how they affect rendering. Unless a citation key start with a letter, digit, or `_`, -and contains only alphanumerics and internal punctuation +and contains only alphanumerics and single internal punctuation characters (`:.#$%&-+?<>~/`), it must be surrounded by curly braces, which are not considered part of the key. -In `@Foo_bar.baz.`, the key is `Foo_bar.baz`. The final +In `@Foo_bar.baz.`, the key is `Foo_bar.baz` because the final period is not *internal* punctuation, so it is not included in the key. In `@{Foo_bar.baz.}`, the key is `Foo_bar.baz.`, including -the final period. The curly braces are recommended if you use URLs as +the final period. +In `@Foo_bar--baz`, the key is `Foo_bar` because the repeated internal +punctuation characters terminate the key. +The curly braces are recommended if you use URLs as keys: `[@{https://example.com/bib?name=foobar&date=2000}, p. 33]`. Citation items may optionally include a prefix, a locator, and @@ -6086,7 +6089,7 @@ The following fields are recognized: `rights` ~ A string value. - + `belongs-to-collection` ~ A string value. identifies the name of a collection to which the EPUB Publication belongs. -- cgit v1.2.3 From e3a263df4669450049c49043412f791261e049a4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 11 Aug 2021 16:14:34 -0700 Subject: Fix scope for LaTeX macros. They should by default scope over the group in which they are defined (except `\gdef` and `\xdef`, which are global). In addition, environments must be treated as groups. We handle this by making sMacros in the LaTeX parser state a STACK of macro tables. Opening a group adds a table to the stack, closing one removes one. Only the top of the stack is queried. This commit adds a parameter for scope to the Macro constructor (not exported). Closes #7494. --- src/Text/Pandoc/Readers/LaTeX/Macro.hs | 100 ++++++++++++++++++------------- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 49 +++++++++++---- src/Text/Pandoc/Readers/LaTeX/Types.hs | 6 +- test/command/7494.md | 50 ++++++++++++++++ 4 files changed, 150 insertions(+), 55 deletions(-) create mode 100644 test/command/7494.md diff --git a/src/Text/Pandoc/Readers/LaTeX/Macro.hs b/src/Text/Pandoc/Readers/LaTeX/Macro.hs index 6a7b0eed3..5709cbb8c 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Macro.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Macro.hs @@ -15,6 +15,8 @@ import Control.Applicative ((<|>), optional) import qualified Data.Map as M import Data.Text (Text) import qualified Data.Text as T +import qualified Data.List.NonEmpty as NonEmpty +import Data.List.NonEmpty (NonEmpty(..)) macroDef :: (PandocMonad m, Monoid a) => (Text -> a) -> LP m a macroDef constructor = do @@ -26,24 +28,36 @@ macroDef constructor = do nameMacroPairs <- newcommand <|> letmacro <|> edefmacro <|> defmacro <|> newif guardDisabled Ext_latex_macros <|> - mapM_ (\(name, macro') -> - updateState (\s -> s{ sMacros = M.insert name macro' - (sMacros s) })) nameMacroPairs + mapM_ insertMacro nameMacroPairs environmentDef = do mbenv <- newenvironment case mbenv of Nothing -> return () Just (name, macro1, macro2) -> guardDisabled Ext_latex_macros <|> - do updateState $ \s -> s{ sMacros = - M.insert name macro1 (sMacros s) } - updateState $ \s -> s{ sMacros = - M.insert ("end" <> name) macro2 (sMacros s) } + do insertMacro (name, macro1) + insertMacro ("end" <> name, macro2) -- @\newenvironment{envname}[n-args][default]{begin}{end}@ -- is equivalent to -- @\newcommand{\envname}[n-args][default]{begin}@ -- @\newcommand{\endenvname}@ +insertMacro :: PandocMonad m => (Text, Macro) -> LP m () +insertMacro (name, macro'@(Macro GlobalScope _ _ _ _)) = + updateState $ \s -> + s{ sMacros = NonEmpty.map (M.insert name macro') (sMacros s) } +insertMacro (name, macro'@(Macro GroupScope _ _ _ _)) = + updateState $ \s -> + s{ sMacros = M.insert name macro' (NonEmpty.head (sMacros s)) :| + NonEmpty.tail (sMacros s) } + +lookupMacro :: PandocMonad m => Text -> LP m Macro +lookupMacro name = do + macros :| _ <- sMacros <$> getState + case M.lookup name macros of + Just m -> return m + Nothing -> fail "Macro not found" + letmacro :: PandocMonad m => LP m [(Text, Macro)] letmacro = do controlSeq "let" @@ -54,20 +68,19 @@ letmacro = do -- we first parse in verbatim mode, and then expand macros, -- because we don't want \let\foo\bar to turn into -- \let\foo hello if we have previously \def\bar{hello} - macros <- sMacros <$> getState target <- anyControlSeq <|> singleChar case target of (Tok _ (CtrlSeq name') _) -> - case M.lookup name' macros of - Just m -> return [(name, m)] - Nothing -> return [(name, Macro ExpandWhenDefined [] Nothing [target])] - _ -> return [(name, Macro ExpandWhenDefined [] Nothing [target])] + (do m <- lookupMacro name' + pure [(name, m)]) + <|> pure [(name, + Macro GroupScope ExpandWhenDefined [] Nothing [target])] + _ -> pure [(name, Macro GroupScope ExpandWhenDefined [] Nothing [target])] edefmacro :: PandocMonad m => LP m [(Text, Macro)] edefmacro = do - controlSeq "edef" <|> controlSeq "xdef" - -- TODO Currently we don't distinguish these. \edef should only - -- affect its own group, while \xdef sets a global macro. + scope <- (GroupScope <$ controlSeq "edef") + <|> (GlobalScope <$ controlSeq "xdef") (name, contents) <- withVerbatimMode $ do Tok _ (CtrlSeq name) _ <- anyControlSeq -- we first parse in verbatim mode, and then expand macros, @@ -77,20 +90,19 @@ edefmacro = do return (name, contents) -- expand macros contents' <- parseFromToks (many anyTok) contents - return [(name, Macro ExpandWhenDefined [] Nothing contents')] + return [(name, Macro scope ExpandWhenDefined [] Nothing contents')] defmacro :: PandocMonad m => LP m [(Text, Macro)] defmacro = do -- we use withVerbatimMode, because macros are to be expanded -- at point of use, not point of definition - controlSeq "def" <|> controlSeq "gdef" - -- TODO Currently we don't distinguish these. \def should only - -- affect its own group, while \gdef sets a global macro. + scope <- (GroupScope <$ controlSeq "def") + <|> (GlobalScope <$ controlSeq "gdef") withVerbatimMode $ do Tok _ (CtrlSeq name) _ <- anyControlSeq argspecs <- many (argspecArg <|> argspecPattern) contents <- bracedOrToken - return [(name, Macro ExpandWhenUsed argspecs Nothing contents)] + return [(name, Macro scope ExpandWhenUsed argspecs Nothing contents)] -- \newif\iffoo' defines: -- \iffoo to be \iffalse @@ -105,16 +117,16 @@ newif = do -- \def\footrue{\def\iffoo\iftrue} -- \def\foofalse{\def\iffoo\iffalse} let base = T.drop 2 name - return [ (name, Macro ExpandWhenUsed [] Nothing + return [ (name, Macro GroupScope ExpandWhenUsed [] Nothing [Tok pos (CtrlSeq "iffalse") "\\iffalse"]) , (base <> "true", - Macro ExpandWhenUsed [] Nothing + Macro GroupScope ExpandWhenUsed [] Nothing [ Tok pos (CtrlSeq "def") "\\def" , Tok pos (CtrlSeq name) ("\\" <> name) , Tok pos (CtrlSeq "iftrue") "\\iftrue" ]) , (base <> "false", - Macro ExpandWhenUsed [] Nothing + Macro GroupScope ExpandWhenUsed [] Nothing [ Tok pos (CtrlSeq "def") "\\def" , Tok pos (CtrlSeq name) ("\\" <> name) , Tok pos (CtrlSeq "iffalse") "\\iffalse" @@ -161,14 +173,13 @@ newcommand = do : (contents' ++ [ Tok pos Symbol "}", Tok pos Symbol "}" ]) _ -> contents' - macros <- sMacros <$> getState - case M.lookup name macros of - Just macro - | mtype == "newcommand" -> do - report $ MacroAlreadyDefined txt pos - return [(name, macro)] - | mtype == "providecommand" -> return [(name, macro)] - _ -> return [(name, Macro ExpandWhenUsed argspecs optarg contents)] + let macro = Macro GroupScope ExpandWhenUsed argspecs optarg contents + (do lookupMacro name + case mtype of + "providecommand" -> return [] + "renewcommand" -> return [(name, macro)] + _ -> [] <$ report (MacroAlreadyDefined txt pos)) + <|> pure [(name, macro)] newenvironment :: PandocMonad m => LP m (Maybe (Text, Macro, Macro)) newenvironment = do @@ -187,17 +198,22 @@ newenvironment = do let argspecs = map (\i -> ArgNum i) [1..numargs] startcontents <- spaces >> bracedOrToken endcontents <- spaces >> bracedOrToken - macros <- sMacros <$> getState - case M.lookup name macros of - Just _ - | mtype == "newenvironment" -> do - report $ MacroAlreadyDefined name pos - return Nothing - | mtype == "provideenvironment" -> - return Nothing - _ -> return $ Just (name, - Macro ExpandWhenUsed argspecs optarg startcontents, - Macro ExpandWhenUsed [] Nothing endcontents) + -- we need the environment to be in a group so macros defined + -- inside behave correctly: + let bg = Tok pos (CtrlSeq "bgroup") "\\bgroup " + let eg = Tok pos (CtrlSeq "egroup") "\\egroup " + let result = (name, + Macro GroupScope ExpandWhenUsed argspecs optarg + (bg:startcontents), + Macro GroupScope ExpandWhenUsed [] Nothing (eg:endcontents)) + (do lookupMacro name + case mtype of + "provideenvironment" -> return Nothing + "renewenvironment" -> return (Just result) + _ -> do + report $ MacroAlreadyDefined name pos + return Nothing) + <|> return (Just result) bracketedNum :: PandocMonad m => LP m Int bracketedNum = do diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 8d6791abb..e1b72926f 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -102,6 +102,9 @@ import qualified Data.IntMap as IntMap import qualified Data.Map as M import qualified Data.Set as Set import Data.Text (Text) +import Data.Maybe (fromMaybe) +import Data.List.NonEmpty (NonEmpty(..)) +import qualified Data.List.NonEmpty as NonEmpty import qualified Data.Text as T import Text.Pandoc.Builder import Text.Pandoc.Class.PandocMonad (PandocMonad, report) @@ -146,7 +149,7 @@ data TheoremSpec = data LaTeXState = LaTeXState{ sOptions :: ReaderOptions , sMeta :: Meta , sQuoteContext :: QuoteContext - , sMacros :: M.Map Text Macro + , sMacros :: NonEmpty (M.Map Text Macro) , sContainers :: [Text] , sLogMessages :: [LogMessage] , sIdentifiers :: Set.Set Text @@ -173,7 +176,7 @@ defaultLaTeXState :: LaTeXState defaultLaTeXState = LaTeXState{ sOptions = def , sMeta = nullMeta , sQuoteContext = NoQuote - , sMacros = M.empty + , sMacros = M.empty :| [] , sContainers = [] , sLogMessages = [] , sIdentifiers = Set.empty @@ -220,8 +223,9 @@ instance HasIncludeFiles LaTeXState where dropLatestIncludeFile s = s { sContainers = drop 1 $ sContainers s } instance HasMacros LaTeXState where - extractMacros st = sMacros st - updateMacros f st = st{ sMacros = f (sMacros st) } + extractMacros st = NonEmpty.head $ sMacros st + updateMacros f st = st{ sMacros = f (NonEmpty.head $ sMacros st) + :| (NonEmpty.tail $ sMacros st) } instance HasReaderOptions LaTeXState where extractReaderOptions = sOptions @@ -254,7 +258,7 @@ rawLaTeXParser :: (PandocMonad m, HasMacros s, HasReaderOptions s, Show a) rawLaTeXParser toks retokenize parser valParser = do pstate <- getState let lstate = def{ sOptions = extractReaderOptions pstate } - let lstate' = lstate { sMacros = extractMacros pstate } + let lstate' = lstate { sMacros = extractMacros pstate :| [] } let setStartPos = case toks of Tok pos _ _ : _ -> setPosition pos _ -> return () @@ -274,7 +278,7 @@ rawLaTeXParser toks retokenize parser valParser = do case res of Left _ -> mzero Right ((val, raw), st) -> do - updateState (updateMacros (sMacros st <>)) + updateState (updateMacros ((NonEmpty.head (sMacros st)) <>)) let skipTilPos stopPos = do anyChar pos <- getPosition @@ -299,7 +303,7 @@ applyMacros s = (guardDisabled Ext_latex_macros >> return s) <|> do let retokenize = untokenize <$> many anyTok pstate <- getState let lstate = def{ sOptions = extractReaderOptions pstate - , sMacros = extractMacros pstate } + , sMacros = extractMacros pstate :| [] } res <- runParserT retokenize lstate "math" (tokenize "math" s) case res of Left e -> Prelude.fail (show e) @@ -552,10 +556,10 @@ doMacros' n inp = handleMacros n' spos name ts = do when (n' > 20) -- detect macro expansion loops $ throwError $ PandocMacroLoop name - macros <- sMacros <$> getState + (macros :| _ ) <- sMacros <$> getState case M.lookup name macros of Nothing -> trySpecialMacro name ts - Just (Macro expansionPoint argspecs optarg newtoks) -> do + Just (Macro _scope expansionPoint argspecs optarg newtoks) -> do let getargs' = do args <- (case expansionPoint of @@ -745,10 +749,22 @@ primEscape = do bgroup :: PandocMonad m => LP m Tok bgroup = try $ do optional sp - symbol '{' <|> controlSeq "bgroup" <|> controlSeq "begingroup" + t <- symbol '{' <|> controlSeq "bgroup" <|> controlSeq "begingroup" + -- Add a copy of the macro table to the top of the macro stack, + -- private for this group. We inherit all the macros defined in + -- the parent group. + updateState $ \s -> s{ sMacros = NonEmpty.cons (NonEmpty.head (sMacros s)) + (sMacros s) } + return t + egroup :: PandocMonad m => LP m Tok -egroup = symbol '}' <|> controlSeq "egroup" <|> controlSeq "endgroup" +egroup = do + t <- symbol '}' <|> controlSeq "egroup" <|> controlSeq "endgroup" + -- remove the group's macro table from the stack + updateState $ \s -> s{ sMacros = fromMaybe (sMacros s) $ + NonEmpty.nonEmpty (NonEmpty.tail (sMacros s)) } + return t grouped :: (PandocMonad m, Monoid a) => LP m a -> LP m a grouped parser = try $ do @@ -1017,7 +1033,16 @@ resetCaption = updateState $ \st -> st{ sCaption = Nothing , sLastLabel = Nothing } env :: PandocMonad m => Text -> LP m a -> LP m a -env name p = p <* end_ name +env name p = do + -- environments are groups as far as macros are concerned, + -- so we need a local copy of the macro table (see above, bgroup, egroup): + updateState $ \s -> s{ sMacros = NonEmpty.cons (NonEmpty.head (sMacros s)) + (sMacros s) } + result <- p + updateState $ \s -> s{ sMacros = fromMaybe (sMacros s) $ + NonEmpty.nonEmpty (NonEmpty.tail (sMacros s)) } + end_ name + return result tokWith :: PandocMonad m => LP m Inlines -> LP m Inlines tokWith inlineParser = try $ spaces >> diff --git a/src/Text/Pandoc/Readers/LaTeX/Types.hs b/src/Text/Pandoc/Readers/LaTeX/Types.hs index c20b72bc5..a4eae56db 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Types.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Types.hs @@ -15,6 +15,7 @@ module Text.Pandoc.Readers.LaTeX.Types ( Tok(..) , Macro(..) , ArgSpec(..) , ExpansionPoint(..) + , MacroScope(..) , SourcePos ) where @@ -43,7 +44,10 @@ tokToText (Tok _ _ t) = t data ExpansionPoint = ExpandWhenDefined | ExpandWhenUsed deriving (Eq, Ord, Show) -data Macro = Macro ExpansionPoint [ArgSpec] (Maybe [Tok]) [Tok] +data MacroScope = GlobalScope | GroupScope + deriving (Eq, Ord, Show) + +data Macro = Macro MacroScope ExpansionPoint [ArgSpec] (Maybe [Tok]) [Tok] deriving Show data ArgSpec = ArgNum Int | Pattern [Tok] diff --git a/test/command/7494.md b/test/command/7494.md new file mode 100644 index 000000000..d8a2ff7a5 --- /dev/null +++ b/test/command/7494.md @@ -0,0 +1,50 @@ +``` +% pandoc -f latex -t plain +\def\foo{BAR} +{\foo +\def\foo{BAZ} +\foo +} +\foo +^D +BAR BAZ BAR +``` + +``` +% pandoc -f latex -t plain +\def\foo{BAR} +{\foo +\gdef\foo{BAZ} +\foo +} +\foo +^D +BAR BAZ BAZ +``` + +``` +% pandoc -f latex -t plain +\newcommand{\aaa}{BBB} +{ +\renewcommand{\aaa}{AAA} +\aaa +} +\aaa +^D +AAA BBB +``` + +``` +% pandoc -f latex -t markdown +\newcommand{\aaa}{BBB} +\begin{quote} +\renewcommand{\aaa}{AAA} +\aaa +\end{quote} +\aaa +^D +> AAA + +BBB +``` + -- cgit v1.2.3 From dd1a956a8aa7d0cadd37db1650698eee9274beee Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 11 Aug 2021 16:28:53 -0700 Subject: LaTeX reader: Support `\global` before `\def`, `\let`, etc. See #7494. --- src/Text/Pandoc/Readers/LaTeX/Macro.hs | 12 ++++++++++-- test/command/7494.md | 12 ++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX/Macro.hs b/src/Text/Pandoc/Readers/LaTeX/Macro.hs index 5709cbb8c..bd7979ef3 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Macro.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Macro.hs @@ -25,8 +25,8 @@ macroDef constructor = do guardDisabled Ext_latex_macros) <|> return mempty where commandDef = do - nameMacroPairs <- newcommand <|> letmacro <|> - edefmacro <|> defmacro <|> newif + nameMacroPairs <- newcommand <|> + checkGlobal (letmacro <|> edefmacro <|> defmacro <|> newif) guardDisabled Ext_latex_macros <|> mapM_ insertMacro nameMacroPairs environmentDef = do @@ -77,6 +77,14 @@ letmacro = do Macro GroupScope ExpandWhenDefined [] Nothing [target])] _ -> pure [(name, Macro GroupScope ExpandWhenDefined [] Nothing [target])] +checkGlobal :: PandocMonad m => LP m [(Text, Macro)] -> LP m [(Text, Macro)] +checkGlobal p = + (do controlSeq "global" + ms <- p + return $ map (\(n, Macro _ expand arg optarg contents) -> + (n, Macro GlobalScope expand arg optarg contents)) ms) + <|> p + edefmacro :: PandocMonad m => LP m [(Text, Macro)] edefmacro = do scope <- (GroupScope <$ controlSeq "edef") diff --git a/test/command/7494.md b/test/command/7494.md index d8a2ff7a5..364bcb7e1 100644 --- a/test/command/7494.md +++ b/test/command/7494.md @@ -22,6 +22,18 @@ BAR BAZ BAR BAR BAZ BAZ ``` +``` +% pandoc -f latex -t plain +\def\foo{BAR} +{\foo +\global\def\foo{BAZ} +\foo +} +\foo +^D +BAR BAZ BAZ +``` + ``` % pandoc -f latex -t plain \newcommand{\aaa}{BBB} -- cgit v1.2.3 From 073895c340b85dc66b45e0c716d8357f8c7c5a13 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 11 Aug 2021 17:53:39 -0700 Subject: Fix some lint issues. --- src/Text/Pandoc/Readers/LaTeX/Macro.hs | 7 +++---- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX/Macro.hs b/src/Text/Pandoc/Readers/LaTeX/Macro.hs index bd7979ef3..c5704c8ad 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Macro.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Macro.hs @@ -79,10 +79,9 @@ letmacro = do checkGlobal :: PandocMonad m => LP m [(Text, Macro)] -> LP m [(Text, Macro)] checkGlobal p = - (do controlSeq "global" - ms <- p - return $ map (\(n, Macro _ expand arg optarg contents) -> - (n, Macro GlobalScope expand arg optarg contents)) ms) + (controlSeq "global" *> + (map (\(n, Macro _ expand arg optarg contents) -> + (n, Macro GlobalScope expand arg optarg contents)) <$> p)) <|> p edefmacro :: PandocMonad m => LP m [(Text, Macro)] diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index e1b72926f..075e1f656 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -224,8 +224,8 @@ instance HasIncludeFiles LaTeXState where instance HasMacros LaTeXState where extractMacros st = NonEmpty.head $ sMacros st - updateMacros f st = st{ sMacros = f (NonEmpty.head $ sMacros st) - :| (NonEmpty.tail $ sMacros st) } + updateMacros f st = st{ sMacros = f (NonEmpty.head (sMacros st)) + :| NonEmpty.tail (sMacros st) } instance HasReaderOptions LaTeXState where extractReaderOptions = sOptions -- cgit v1.2.3 From ec34497bc1b858e5bd56a09c5919238c5ea97de1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 11 Aug 2021 23:14:17 -0700 Subject: Try fixing compile error on older ghcs. See https://github.com/jgm/gitit/runs/3308381697 --- src/Text/Pandoc/Readers/Odt/ContentReader.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/Odt/ContentReader.hs b/src/Text/Pandoc/Readers/Odt/ContentReader.hs index 5520d039f..734a6e116 100644 --- a/src/Text/Pandoc/Readers/Odt/ContentReader.hs +++ b/src/Text/Pandoc/Readers/Odt/ContentReader.hs @@ -7,6 +7,9 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE StandaloneDeriving #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE FlexibleContexts #-} {- | Module : Text.Pandoc.Readers.Odt.ContentReader Copyright : Copyright (C) 2015 Martin Linnemann @@ -507,7 +510,8 @@ type InlineMatcher = ElementMatcher Inlines type BlockMatcher = ElementMatcher Blocks newtype FirstMatch a = FirstMatch (Alt Maybe a) - deriving (Foldable, Monoid, Semigroup) + deriving (Monoid, Semigroup) +deriving instance Foldable FirstMatch firstMatch :: a -> FirstMatch a firstMatch = FirstMatch . Alt . Just -- cgit v1.2.3 From 86cce2b2eb7fed4eeabdcd368c1c26470ba76dcd Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 12 Aug 2021 17:20:03 +0100 Subject: Add haskell-language-server to shell.nix (#7496) I find it useful to have this installed via the nix shell when working on pandoc, so I think others may also find it useful. Co-authored-by: Emily Bourke --- shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/shell.nix b/shell.nix index 1fa25de79..6b211f6e6 100644 --- a/shell.nix +++ b/shell.nix @@ -41,6 +41,7 @@ let file-embed filepath haddock-library + haskell-language-server hsc2hs hslua hslua-module-system -- cgit v1.2.3 From 3cfcfacd728fec948d72e04bfcd64bbf97979280 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 12 Aug 2021 09:22:34 -0700 Subject: Use Prelude from base-compat for ghc 8.4 too. We were having trouble building on ghc 8.4 because of the lack of a Foldable instance for (Alt Maybe) in base < 4.12. Mystery: for some reason our builds were failing for gitit but not in the pandoc CI. --- pandoc.cabal | 2 +- src/Text/Pandoc/Readers/Odt/ContentReader.hs | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 81c3546e7..66ac50ce3 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -410,7 +410,7 @@ common common-options -Wincomplete-record-updates -Wnoncanonical-monad-instances - if impl(ghc < 8.4) + if impl(ghc < 8.6) hs-source-dirs: prelude other-modules: Prelude build-depends: base-compat >= 0.9 diff --git a/src/Text/Pandoc/Readers/Odt/ContentReader.hs b/src/Text/Pandoc/Readers/Odt/ContentReader.hs index 734a6e116..5520d039f 100644 --- a/src/Text/Pandoc/Readers/Odt/ContentReader.hs +++ b/src/Text/Pandoc/Readers/Odt/ContentReader.hs @@ -7,9 +7,6 @@ {-# LANGUAGE TupleSections #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE FlexibleContexts #-} {- | Module : Text.Pandoc.Readers.Odt.ContentReader Copyright : Copyright (C) 2015 Martin Linnemann @@ -510,8 +507,7 @@ type InlineMatcher = ElementMatcher Inlines type BlockMatcher = ElementMatcher Blocks newtype FirstMatch a = FirstMatch (Alt Maybe a) - deriving (Monoid, Semigroup) -deriving instance Foldable FirstMatch + deriving (Foldable, Monoid, Semigroup) firstMatch :: a -> FirstMatch a firstMatch = FirstMatch . Alt . Just -- cgit v1.2.3 From ebef4fb41dd9a18dc45e096f3d760b74d7669d03 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 12 Aug 2021 09:26:39 -0700 Subject: Bump base-compat version so we get compatibility with base 4.12. --- pandoc.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandoc.cabal b/pandoc.cabal index 66ac50ce3..bc8ea2588 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -413,7 +413,7 @@ common common-options if impl(ghc < 8.6) hs-source-dirs: prelude other-modules: Prelude - build-depends: base-compat >= 0.9 + build-depends: base-compat >= 0.10.5 other-extensions: NoImplicitPrelude if os(windows) -- cgit v1.2.3 From fc20672bb9e23b5136f10b3260a655336db28fdf Mon Sep 17 00:00:00 2001 From: William Lupton Date: Thu, 12 Aug 2021 18:16:34 +0100 Subject: Various sample.lua editorial fixes. (#7493) These address most of the items mentioned in #7487. There's also a table caption fix (the caption wasn't escaped). --- data/sample.lua | 20 ++++++++++++-------- test/writer.custom | 15 +++++++-------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/data/sample.lua b/data/sample.lua index b87848378..ea20add2e 100644 --- a/data/sample.lua +++ b/data/sample.lua @@ -143,7 +143,7 @@ end function Link(s, tgt, tit, attr) return "" .. s .. "" + escape(tit,true) .. "'" .. attributes(attr) .. ">" .. s .. "" end function Image(s, src, tit, attr) @@ -284,9 +284,15 @@ local function html_align(align) end function CaptionedImage(src, tit, caption, attr) - return '
\n\n' .. - '

' .. escape(caption) .. '

\n
' + if #caption == 0 then + return '

' + else + local ecaption = escape(caption) + return '
\n' .. ecaption  .. '' .. + '
' .. ecaption .. '
\n
' + end end -- Caption is a string, aligns is an array of strings, @@ -299,7 +305,7 @@ function Table(caption, aligns, widths, headers, rows) end add("") if caption ~= "" then - add("") + add("") end if widths and widths[1] ~= 0 then for _, w in pairs(widths) do @@ -313,9 +319,7 @@ function Table(caption, aligns, widths, headers, rows) table.insert(header_row,'') empty_header = empty_header and h == "" end - if empty_header then - head = "" - else + if not empty_header then add('') for _,h in pairs(header_row) do add(h) diff --git a/test/writer.custom b/test/writer.custom index 2cb398eb1..ce490f426 100644 --- a/test/writer.custom +++ b/test/writer.custom @@ -712,18 +712,18 @@ So is ‘pine.’

-

With an ampersand: http://example.com/?foo=1&bar=2

+

With an ampersand: http://example.com/?foo=1&bar=2

-

An e-mail address: nobody@nowhere.net

+

An e-mail address:

-

Blockquoted: http://example.com/

+

Blockquoted: http://example.com/

Auto-links should not occur here: <http://example.com/>

@@ -736,10 +736,9 @@ So is ‘pine.’

From “Voyage dans la Lune” by Georges Melies (1902):

-
- -

lalune

-
+
+lalune
lalune
+

Here is a movie icon.

-- cgit v1.2.3 From 649133fe5ecf6a2408eeb3c01bc654f71754a590 Mon Sep 17 00:00:00 2001 From: William Lupton Date: Thu, 12 Aug 2021 18:18:22 +0100 Subject: Document use of the 'underline' class. (#7492) Addresses a comment in #7484. --- MANUAL.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MANUAL.txt b/MANUAL.txt index c76505e80..5d3f5b09b 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -4396,6 +4396,18 @@ Attributes can be attached to verbatim text, just as with `<$>`{.haskell} +### Underline ### + +To underline text, use the `underline` (or `ul`) class: + + [Underline]{.underline} + +Or, without the `bracketed_spans` extension (but with `native_spans`): + + Underline + +This will work in all output formats that support underline. + ### Small caps ### To write small caps, use the `smallcaps` class: -- cgit v1.2.3 From e8d7d157fdbddbe2d08688ac43c980e45495574e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 13 Aug 2021 10:41:36 -0700 Subject: LaTeX reader: proper implicit grouping around environment macros. --- src/Text/Pandoc/Readers/LaTeX/Macro.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/LaTeX/Macro.hs b/src/Text/Pandoc/Readers/LaTeX/Macro.hs index c5704c8ad..d40277eb5 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Macro.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Macro.hs @@ -212,7 +212,8 @@ newenvironment = do let result = (name, Macro GroupScope ExpandWhenUsed argspecs optarg (bg:startcontents), - Macro GroupScope ExpandWhenUsed [] Nothing (eg:endcontents)) + Macro GroupScope ExpandWhenUsed [] Nothing + (endcontents ++ [eg])) (do lookupMacro name case mtype of "provideenvironment" -> return Nothing -- cgit v1.2.3 From 418155aa9516170e3fd661aa537e5ee719d73ef7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 13 Aug 2021 11:10:11 -0700 Subject: Fix raw LaTeX injection issue (LaTeX writer). Using a code block containing `\end{verbatim}`, one could inject raw TeX into a LaTeX document even when `raw_tex` is disabled. Thanks to Augustin Laville for noticing the bug. Closes #7497. --- src/Text/Pandoc/Writers/LaTeX.hs | 15 ++++++++++----- test/command/7497.md | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 test/command/7497.md diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index dd837bdf0..c365aebf5 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -429,6 +429,7 @@ blockToLaTeX (BlockQuote lst) = do blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do opts <- gets stOptions lab <- labelFor identifier + inNote <- stInNote <$> get linkAnchor' <- hypertarget True identifier lab let linkAnchor = if isEmpty linkAnchor' then empty @@ -438,8 +439,7 @@ blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do return $ flush (linkAnchor $$ "\\begin{code}" $$ literal str $$ "\\end{code}") $$ cr let rawCodeBlock = do - st <- get - env <- if stInNote st + env <- if inNote then modify (\s -> s{ stVerbInNote = True }) >> return "Verbatim" else return "verbatim" @@ -475,14 +475,13 @@ blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do "\\end{lstlisting}") $$ cr let highlightedCodeBlock = case highlight (writerSyntaxMap opts) - formatLaTeXBlock ("",classes,keyvalAttr) str of + formatLaTeXBlock ("",classes ++ ["default"],keyvalAttr) str of Left msg -> do unless (T.null msg) $ report $ CouldNotHighlight msg rawCodeBlock Right h -> do - st <- get - when (stInNote st) $ modify (\s -> s{ stVerbInNote = True }) + when inNote $ modify (\s -> s{ stVerbInNote = True }) modify (\s -> s{ stHighlighting = True }) return (flush $ linkAnchor $$ text (T.unpack h)) case () of @@ -491,6 +490,12 @@ blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do | writerListings opts -> listingsCodeBlock | not (null classes) && isJust (writerHighlightStyle opts) -> highlightedCodeBlock + -- we don't want to use \begin{verbatim} if our code + -- contains \end{verbatim}: + | inNote + , "\\end{Verbatim}" `T.isInfixOf` str -> highlightedCodeBlock + | not inNote + , "\\end{verbatim}" `T.isInfixOf` str -> highlightedCodeBlock | otherwise -> rawCodeBlock blockToLaTeX b@(RawBlock f x) = do beamer <- gets stBeamer diff --git a/test/command/7497.md b/test/command/7497.md new file mode 100644 index 000000000..4b80bf267 --- /dev/null +++ b/test/command/7497.md @@ -0,0 +1,37 @@ +```` +% pandoc -f markdown-raw_tex -t latex +``` +\end{verbatim} +\LaTeX +\begin{verbatim} +``` +^D +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{\textbackslash{}end\{verbatim\}} +\NormalTok{\textbackslash{}LaTeX} +\NormalTok{\textbackslash{}begin\{verbatim\}} +\end{Highlighting} +\end{Shaded} +```` + +```` +% pandoc -f markdown-raw_tex -t latex +hi[^1] + +[^1]: + ``` + \end{Verbatim} + \LaTeX + \begin{Verbatim} + ``` +^D +hi\footnote{\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{\textbackslash{}end\{Verbatim\}} +\NormalTok{\textbackslash{}LaTeX} +\NormalTok{\textbackslash{}begin\{Verbatim\}} +\end{Highlighting} +\end{Shaded} +} +```` -- cgit v1.2.3 From 05640f9a21e7963de4501b85f47cc1daa203c195 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 13 Aug 2021 17:29:58 -0700 Subject: Removed quote localization from citeproc processing. This is now done in citeproc itself. --- cabal.project | 8 ++++---- src/Text/Pandoc/Citeproc.hs | 21 +-------------------- stack.yaml | 6 +++++- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/cabal.project b/cabal.project index 505636326..c5090838c 100644 --- a/cabal.project +++ b/cabal.project @@ -2,7 +2,7 @@ packages: pandoc.cabal tests: True flags: +embed_data_files --- source-repository-package --- type: git --- location: https://github.com/jgm/citeproc --- tag: 4ce0501cd6f9c86eee087afcf878c256e49b9615 +source-repository-package + type: git + location: https://github.com/jgm/citeproc.git + tag: 8b190eceb0cbbbf2d436bab9a5891a31be0c9865 diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 246f54516..bfd108655 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -88,13 +88,11 @@ processCitations (Pandoc meta bs) = do _ -> id) $ [] let bibs = mconcat $ map (\(ident, out) -> B.divWith ("ref-" <> ident,["csl-entry"],[]) . B.para . - walk (convertQuotes locale) . insertSpace $ out) (resultBibliography result) let moveNotes = styleIsNoteStyle sopts && maybe True truish (lookupMeta "notes-after-punctuation" meta) - let cits = map (walk (convertQuotes locale)) $ - resultCitations result + let cits = resultCitations result let metanocites = lookupMeta "nocite" meta let Pandoc meta'' bs' = @@ -265,23 +263,6 @@ getRefs locale format idpred mbfp raw = do (L.fromStrict raw) return $ mapMaybe metaValueToReference rs --- localized quotes -convertQuotes :: Locale -> Inline -> Inline -convertQuotes locale (Quoted qt ils) = - case (M.lookup openterm terms, M.lookup closeterm terms) of - (Just ((_,oq):_), Just ((_,cq):_)) -> - Span ("",[],[]) (Str oq : ils ++ [Str cq]) - _ -> Quoted qt ils - where - terms = localeTerms locale - openterm = case qt of - DoubleQuote -> "open-quote" - SingleQuote -> "open-inner-quote" - closeterm = case qt of - DoubleQuote -> "close-quote" - SingleQuote -> "close-inner-quote" -convertQuotes _ x = x - -- assumes we walk in same order as query insertResolvedCitations :: Inline -> State [Inlines] Inline insertResolvedCitations (Cite cs ils) = do diff --git a/stack.yaml b/stack.yaml index 8e52a819f..1bad8cc59 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,9 +12,13 @@ extra-deps: - skylighting-core-0.11 - skylighting-0.11 - doctemplates-0.10 -- citeproc-0.4.1 +# - citeproc-0.4.1 +- git: https://github.com/jgm/citeproc.git + commit: 8b190eceb0cbbbf2d436bab9a5891a31be0c9865 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.0 nix: packages: [zlib] + + -- cgit v1.2.3 From 15683bb607eb924816adcb7e7884fe722d3d3129 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 13 Aug 2021 18:13:06 -0700 Subject: Citeproc: avoid odd handling of quotes. citeproc changes allow us to ignore Quoted elements; citeproc now uses its own method for represented quoted things, and only localizes and flipflops quotes it adds itself. See #87. The one thing left to do is to convert Quoted elements in bibliography databases (esp. titles) to `Span ("",["csl-quoted"],[])` before passing them to citeproc, IF the localized quotes for the quote type match the standard inverted commas. --- cabal.project | 2 +- src/Text/Pandoc/Citeproc.hs | 7 ++++++- stack.yaml | 2 +- test/command/citeproc-87.md | 16 ++++++++++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 test/command/citeproc-87.md diff --git a/cabal.project b/cabal.project index c5090838c..401992868 100644 --- a/cabal.project +++ b/cabal.project @@ -5,4 +5,4 @@ flags: +embed_data_files source-repository-package type: git location: https://github.com/jgm/citeproc.git - tag: 8b190eceb0cbbbf2d436bab9a5891a31be0c9865 + tag: 8d03cb722fac3ea8f17f432ac20abe35361df551 diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index bfd108655..0f007f336 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -103,10 +103,15 @@ processCitations (Pandoc meta bs) = do else id) . evalState (walkM insertResolvedCitations $ Pandoc meta' bs) $ cits - return $ Pandoc meta'' + return $ walk removeQuoteSpan + $ Pandoc meta'' $ insertRefs refkvs classes meta'' (walk fixLinks $ B.toList bibs) bs' +removeQuoteSpan :: Inline -> Inline +removeQuoteSpan (Span ("",["csl-quoted"],[]) xs) = Span nullAttr xs +removeQuoteSpan x = x + -- | Retrieve the CSL style specified by the csl or citation-style -- metadata field in a pandoc document, or the default CSL style -- if none is specified. Retrieve the parent style diff --git a/stack.yaml b/stack.yaml index 1bad8cc59..ef92855c1 100644 --- a/stack.yaml +++ b/stack.yaml @@ -14,7 +14,7 @@ extra-deps: - doctemplates-0.10 # - citeproc-0.4.1 - git: https://github.com/jgm/citeproc.git - commit: 8b190eceb0cbbbf2d436bab9a5891a31be0c9865 + commit: 8d03cb722fac3ea8f17f432ac20abe35361df551 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.0 diff --git a/test/command/citeproc-87.md b/test/command/citeproc-87.md new file mode 100644 index 000000000..42cf7a6ee --- /dev/null +++ b/test/command/citeproc-87.md @@ -0,0 +1,16 @@ +``` +% pandoc --citeproc -Mlang=it-IT -t markdown-citations +Foo [@a 50: «Disse: "bar"»]. «Disse: "baz"» + +--- +suppress-bibliography: true +references: +- id: a + author: + - literal: Aristotele + title: Metafisica + type: book +... +^D +Foo (Aristotele, s.d., 50: «Disse: "bar"»). «Disse: "baz"» +``` -- cgit v1.2.3 From 82638ad53bb47acde835083390f8211ac21cda6c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 13 Aug 2021 19:19:43 -0700 Subject: Convert Quoted in bib entries to special Spans... before passing them off to citeproc. This ensures that we get proper localization and flipflopping if, e.g., quotes are used in titles. Closes jgm/citeproc#87. --- pandoc.cabal | 2 +- src/Text/Pandoc/Citeproc.hs | 4 +++- stack.yaml | 1 + test/command/citeproc-87.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index bc8ea2588..f4a173f59 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -492,7 +492,7 @@ library syb >= 0.1 && < 0.8, tagsoup >= 0.14.6 && < 0.15, temporary >= 1.1 && < 1.4, - texmath >= 0.12.3 && < 0.12.4, + texmath >= 0.12.3.1 && < 0.12.4, text >= 1.1.1.0 && < 1.3, text-conversions >= 0.3 && < 0.4, time >= 1.5 && < 1.12, diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 0f007f336..39760776d 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -208,7 +208,9 @@ getReferences mblocale (Pandoc meta bs) = do Just fp -> getRefsFromBib locale idpred fp Nothing -> return [] Nothing -> return [] - return $ map (linkifyVariables . legacyDateRanges) + let addQuoteSpan (Quoted _ xs) = Span ("",["csl-quoted"],[]) xs + addQuoteSpan x = x + return $ map (linkifyVariables . legacyDateRanges . walk addQuoteSpan) (externalRefs ++ inlineRefs) -- note that inlineRefs can override externalRefs diff --git a/stack.yaml b/stack.yaml index ef92855c1..ce58cf732 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,6 +12,7 @@ extra-deps: - skylighting-core-0.11 - skylighting-0.11 - doctemplates-0.10 +- texmath-0.12.3.1 # - citeproc-0.4.1 - git: https://github.com/jgm/citeproc.git commit: 8d03cb722fac3ea8f17f432ac20abe35361df551 diff --git a/test/command/citeproc-87.md b/test/command/citeproc-87.md index 42cf7a6ee..4faa6bfba 100644 --- a/test/command/citeproc-87.md +++ b/test/command/citeproc-87.md @@ -14,3 +14,45 @@ references: ^D Foo (Aristotele, s.d., 50: «Disse: "bar"»). «Disse: "baz"» ``` + +For en, the localized quotes match what Quoted would produce, +so the Quoted is passed to citeproc as a Span ("",["csl-quoted"],[]) +and flipflopping and localization occur. +``` +% pandoc -C -t plain -Mlang=en +--- +references: +- id: a + author: + - literal: Aristotele + title: Metafisica et "Physica" + type: article-journal +... + +Foo [@a 50]. +^D +Foo (Aristotele, n.d., 50). + +Aristotele. n.d. “Metafisica Et ‘Physica’.” +``` + +For cs, there is no such match, so the Quoted is left alone +and has the same effect it would have elsewhere in a pandoc document. +``` +% pandoc -C -t plain -Mlang=it +--- +references: +- id: a + author: + - literal: Aristotele + title: Metafisica et "Physica" + type: article-journal +... + +Foo [@a 50]. +^D +Foo (Aristotele, s.d., 50). + +Aristotele. s.d. «Metafisica et “Physica”». +``` + -- cgit v1.2.3 From 2c466a15afed3edad3159791f38685c6656e8261 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 15 Aug 2021 09:26:30 -0700 Subject: Remove misleading description from command/citeproc-87 test. --- test/command/citeproc-87.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/command/citeproc-87.md b/test/command/citeproc-87.md index 4faa6bfba..dd9287e78 100644 --- a/test/command/citeproc-87.md +++ b/test/command/citeproc-87.md @@ -15,9 +15,8 @@ references: Foo (Aristotele, s.d., 50: «Disse: "bar"»). «Disse: "baz"» ``` -For en, the localized quotes match what Quoted would produce, -so the Quoted is passed to citeproc as a Span ("",["csl-quoted"],[]) -and flipflopping and localization occur. +The Quoted is passed to citeproc as a Span ("",["csl-quoted"],[]) +so that flipflopping and localization occur. ``` % pandoc -C -t plain -Mlang=en --- @@ -36,8 +35,6 @@ Foo (Aristotele, n.d., 50). Aristotele. n.d. “Metafisica Et ‘Physica’.” ``` -For cs, there is no such match, so the Quoted is left alone -and has the same effect it would have elsewhere in a pandoc document. ``` % pandoc -C -t plain -Mlang=it --- -- cgit v1.2.3 From 4340bd52c49b987087e123de2eae4464b300332f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 15 Aug 2021 15:05:54 -0700 Subject: Make docx writer sensitive to `native_numbering` extension. Figure and table numbers are now only included if `native_numbering` is enabled. (By default it is disabled.) This is a behavior change with respect to 2.14.1, but the behavior is that of previous versions. The change was necessary to avoid incompatibilities between pandoc's native numbering and third-party cross reference filters like pandoc-crossref. Closes #7499. --- MANUAL.txt | 2 +- src/Text/Pandoc/Extensions.hs | 1 + src/Text/Pandoc/Writers/Docx.hs | 22 +++++++++++++--------- src/Text/Pandoc/Writers/Docx/Table.hs | 11 ++++++++--- test/Tests/Writers/Docx.hs | 3 ++- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 5d3f5b09b..eef0f245e 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -3068,7 +3068,7 @@ starts at 1. This extension can be enabled/disabled for the following formats: output formats -: `odt`, `opendocument` +: `odt`, `opendocument`, `docx` #### Extension: `xrefs_name` #### diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index 9c55d0a7a..ce04ce641 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -475,6 +475,7 @@ getAllExtensions f = universalExtensions <> getAll f [ Ext_raw_markdown ] getAll "docx" = autoIdExtensions <> extensionsFromList [ Ext_empty_paragraphs + , Ext_native_numbering , Ext_styles ] getAll "opendocument" = extensionsFromList diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index a3c4b6be1..756583d1f 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -869,14 +869,17 @@ blockToOpenXML' opts (Para [Image attr alt (src,T.stripPrefix "fig:" -> Just tit then return [] else withParaPropM (pStyleM "Image Caption") $ blockToOpenXML opts - (Para $ Span (figid,[],[]) - [Str (figname <> "\160"), - RawInline (Format "openxml") - (" " \\* ARABIC \">" - <> tshow fignum - <> ""), - Str ":", Space] : alt) + $ Para + $ if isEnabled Ext_native_numbering opts + then Span (figid,[],[]) + [Str (figname <> "\160"), + RawInline (Format "openxml") + (" " \\* ARABIC \">" + <> tshow fignum + <> ""), + Str ":", Space] : alt + else alt return $ Elem (mknode "w:p" [] (map Elem paraProps ++ contents)) : captionNode @@ -922,7 +925,8 @@ blockToOpenXML' _ HorizontalRule = do ("o:hralign","center"), ("o:hrstd","t"),("o:hr","t")] () ] blockToOpenXML' opts (Table attr caption colspecs thead tbodies tfoot) = - tableToOpenXML (blocksToOpenXML opts) + tableToOpenXML opts + (blocksToOpenXML opts) (Grid.toTable attr caption colspecs thead tbodies tfoot) blockToOpenXML' opts el | BulletList lst <- el = addOpenXMLList BulletMarker lst diff --git a/src/Text/Pandoc/Writers/Docx/Table.hs b/src/Text/Pandoc/Writers/Docx/Table.hs index 7a84c5278..e23856f28 100644 --- a/src/Text/Pandoc/Writers/Docx/Table.hs +++ b/src/Text/Pandoc/Writers/Docx/Table.hs @@ -20,6 +20,8 @@ import Text.Pandoc.Definition import Text.Pandoc.Class.PandocMonad (PandocMonad, translateTerm) import Text.Pandoc.Writers.Docx.Types import Text.Pandoc.Shared +import Text.Pandoc.Options (WriterOptions, isEnabled) +import Text.Pandoc.Extensions (Extension(Ext_native_numbering)) import Text.Printf (printf) import Text.Pandoc.Writers.GridTable hiding (Table) import Text.Pandoc.Writers.OOXML @@ -29,10 +31,11 @@ import qualified Text.Pandoc.Translations as Term import qualified Text.Pandoc.Writers.GridTable as Grid tableToOpenXML :: PandocMonad m - => ([Block] -> WS m [Content]) + => WriterOptions + -> ([Block] -> WS m [Content]) -> Grid.Table -> WS m [Content] -tableToOpenXML blocksToOpenXML gridTable = do +tableToOpenXML opts blocksToOpenXML gridTable = do setFirstPara let (Grid.Table (ident,_,_) caption colspecs _rowheads thead tbodies tfoot) = gridTable @@ -50,7 +53,9 @@ tableToOpenXML blocksToOpenXML gridTable = do then return [] else withParaPropM (pStyleM "Table Caption") $ blocksToOpenXML - $ addLabel tableid tablename tablenum captionBlocks + $ if isEnabled Ext_native_numbering opts + then addLabel tableid tablename tablenum captionBlocks + else captionBlocks -- We set "in table" after processing the caption, because we don't -- want the "Table Caption" style to be overwritten with "Compact". modify $ \s -> s { stInTable = True } diff --git a/test/Tests/Writers/Docx.hs b/test/Tests/Writers/Docx.hs index da25b95e0..93b56e1c2 100644 --- a/test/Tests/Writers/Docx.hs +++ b/test/Tests/Writers/Docx.hs @@ -31,7 +31,8 @@ tests = [ testGroup "inlines" "docx/golden/links.docx" , docxTest "inline image" - def + def{ writerExtensions = + enableExtension Ext_native_numbering (writerExtensions def) } "docx/image_writer_test.native" "docx/golden/image.docx" , docxTest -- cgit v1.2.3 From 72447a563c415a3d8addc7a2b2edd93f9fe56ebe Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 15 Aug 2021 21:44:46 -0700 Subject: Remove documentation for `.ul` shortcut for now. See #7307. Motivation: there is talk of removing this. --- MANUAL.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANUAL.txt b/MANUAL.txt index eef0f245e..a6edd8ccd 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -4398,7 +4398,7 @@ Attributes can be attached to verbatim text, just as with ### Underline ### -To underline text, use the `underline` (or `ul`) class: +To underline text, use the `underline` class: [Underline]{.underline} -- cgit v1.2.3 From e37cf4484d38c171d9f7477a8ae9eca9643cc426 Mon Sep 17 00:00:00 2001 From: OCzarnecki <44535552+OCzarnecki@users.noreply.github.com> Date: Mon, 16 Aug 2021 06:57:57 +0200 Subject: Multimarkdown sub- and superscripts (#5512) (#7188) Added an extension `short_subsuperscripts` which modifies the behavior of `subscript` and `superscript`, allowing subscripts or superscripts containing only alphanumerics to end with a space character (eg. `x^2 = 4` or `H~2 is combustible`). This improves support for multimarkdown. Closes #5512. Add `Ext_short_subsuperscripts` constructor to `Extension` [API change]. This is enabled by default for `markdown_mmd`. --- MANUAL.txt | 12 ++++++++++ src/Text/Pandoc/Extensions.hs | 11 ++++----- src/Text/Pandoc/Readers/Markdown.hs | 24 ++++++++++++------- test/Tests/Readers/Markdown.hs | 48 +++++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 15 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index a6edd8ccd..bed3b2009 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5304,6 +5304,18 @@ For elements that accept attributes, a `data-pos` attribute is added; other elements are placed in a surrounding Div or Span elemnet with a `data-pos` attribute. +#### Extension: `short_subsuperscript` #### + +Parse multimarkdown style subscripts and superscripts, which start with +a '~' or '^' character, respectively, and include the alphanumeric sequence +that follows. For example: + + x^2 = 4 + +or + + Oxygen is O~2. + ## Markdown variants In addition to pandoc's extended Markdown, the following Markdown diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index ce04ce641..2ef8f64e9 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -124,6 +124,7 @@ data Extension = | Ext_mmd_header_identifiers -- ^ Multimarkdown style header identifiers [myid] | Ext_mmd_link_attributes -- ^ MMD style reference link attributes | Ext_mmd_title_block -- ^ Multimarkdown metadata block + | Ext_short_subsuperscripts -- ^ sub-&superscripts w/o closing char (v~i) | Ext_multiline_tables -- ^ Pandoc-style multiline tables | Ext_native_divs -- ^ Use Div blocks for contents of
tags | Ext_native_spans -- ^ Use Span inlines for contents of @@ -286,14 +287,9 @@ multimarkdownExtensions = extensionsFromList , Ext_auto_identifiers , Ext_mmd_header_identifiers , Ext_implicit_figures - -- Note: MMD's syntax for superscripts and subscripts - -- is a bit more permissive than pandoc's, allowing - -- e^2 and a~1 instead of e^2^ and a~1~, so even with - -- these options we don't have full support for MMD - -- superscripts and subscripts, but there's no reason - -- not to include these: - , Ext_superscript + , Ext_short_subsuperscripts , Ext_subscript + , Ext_superscript , Ext_backtick_code_blocks , Ext_spaced_reference_links -- So far only in dev version of mmd: @@ -464,6 +460,7 @@ getAllExtensions f = universalExtensions <> getAll f , Ext_gutenberg , Ext_smart , Ext_literate_haskell + , Ext_short_subsuperscripts , Ext_rebase_relative_paths ] getAll "markdown_strict" = allMarkdownExtensions diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 2dc7ddf52..536e502cf 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1692,21 +1692,29 @@ strikeout = fmap B.strikeout <$> superscript :: PandocMonad m => MarkdownParser m (F Inlines) superscript = do - guardEnabled Ext_superscript fmap B.superscript <$> try (do char '^' - mconcat <$> many1Till (do notFollowedBy spaceChar - notFollowedBy newline - inline) (char '^')) + mconcat <$> (try regularSuperscript <|> try mmdShortSuperscript)) + where regularSuperscript = many1Till (do guardEnabled Ext_superscript + notFollowedBy spaceChar + notFollowedBy newline + inline) (char '^') + mmdShortSuperscript = do guardEnabled Ext_short_subsuperscripts + result <- take1WhileP isAlphaNum + return $ return $ return $ B.str result subscript :: PandocMonad m => MarkdownParser m (F Inlines) subscript = do - guardEnabled Ext_subscript fmap B.subscript <$> try (do char '~' - mconcat <$> many1Till (do notFollowedBy spaceChar - notFollowedBy newline - inline) (char '~')) + mconcat <$> (try regularSubscript <|> mmdShortSubscript)) + where regularSubscript = many1Till (do guardEnabled Ext_subscript + notFollowedBy spaceChar + notFollowedBy newline + inline) (char '~') + mmdShortSubscript = do guardEnabled Ext_short_subsuperscripts + result <- take1WhileP isAlphaNum + return $ return $ return $ B.str result whitespace :: PandocMonad m => MarkdownParser m (F Inlines) whitespace = spaceChar >> return <$> (lb <|> regsp) "whitespace" diff --git a/test/Tests/Readers/Markdown.hs b/test/Tests/Readers/Markdown.hs index f055ab197..02fc0d8ce 100644 --- a/test/Tests/Readers/Markdown.hs +++ b/test/Tests/Readers/Markdown.hs @@ -36,6 +36,9 @@ markdownGH :: Text -> Pandoc markdownGH = purely $ readMarkdown def { readerExtensions = githubMarkdownExtensions } +markdownMMD :: Text -> Pandoc +markdownMMD = purely $ readMarkdown def { + readerExtensions = multimarkdownExtensions } infix 4 =: (=:) :: ToString c => String -> (Text, c) -> TestTree @@ -360,6 +363,51 @@ tests = [ testGroup "inline code" ("**this should \"be bold**" =?> para (strong "this should \8220be bold")) ] + , testGroup "sub- and superscripts" + [ + test markdownMMD "normal subscript" + ("H~2~" + =?> para ("H" <> subscript "2")) + , test markdownMMD "normal superscript" + ("x^3^" + =?> para ("x" <> superscript "3")) + , test markdownMMD "short subscript delimeted by space" + ("O~2 is dangerous" + =?> para ("O" <> subscript "2" <> space <> "is dangerous")) + , test markdownMMD "short subscript delimeted by newline" + ("O~2\n" + =?> para ("O" <> subscript "2")) + , test markdownMMD "short subscript delimeted by EOF" + ("O~2" + =?> para ("O" <> subscript "2")) + , test markdownMMD "short subscript delimited by punctuation" + ("O~2." + =?> para ("O" <> subscript "2" <> ".")) + , test markdownMMD "short subscript delimited by emph" + ("O~2*combustible!*" + =?> para ("O" <> subscript "2" <> emph "combustible!")) + , test markdownMMD "no nesting in short subscripts" + ("y~*2*" + =?> para ("y~" <> emph "2")) + , test markdownMMD "short superscript delimeted by space" + ("x^2 = y" + =?> para ("x" <> superscript "2" <> space <> "= y")) + , test markdownMMD "short superscript delimeted by newline" + ("x^2\n" + =?> para ("x" <> superscript "2")) + , test markdownMMD "short superscript delimeted by ExF" + ("x^2" + =?> para ("x" <> superscript "2")) + , test markdownMMD "short superscript delimited by punctuation" + ("x^2." + =?> para ("x" <> superscript "2" <> ".")) + , test markdownMMD "short superscript delimited by emph" + ("x^2*combustible!*" + =?> para ("x" <> superscript "2" <> emph "combustible!")) + , test markdownMMD "no nesting in short superscripts" + ("y^*2*" + =?> para ("y^" <> emph "2")) + ] , testGroup "footnotes" [ "indent followed by newline and flush-left text" =: "[^1]\n\n[^1]: my note\n\n \nnot in note\n" -- cgit v1.2.3 From abb35d8b0ffa1160dd63a15ec0d5c391da31093f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 16 Aug 2021 08:09:20 -0700 Subject: Fix bug in last commit due to removal of take1WhileP. --- src/Text/Pandoc/Readers/Markdown.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 536e502cf..0f2239394 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1700,7 +1700,7 @@ superscript = do notFollowedBy newline inline) (char '^') mmdShortSuperscript = do guardEnabled Ext_short_subsuperscripts - result <- take1WhileP isAlphaNum + result <- T.pack <$> many1 alphaNum return $ return $ return $ B.str result subscript :: PandocMonad m => MarkdownParser m (F Inlines) @@ -1713,7 +1713,7 @@ subscript = do notFollowedBy newline inline) (char '~') mmdShortSubscript = do guardEnabled Ext_short_subsuperscripts - result <- take1WhileP isAlphaNum + result <- T.pack <$> many1 alphaNum return $ return $ return $ B.str result whitespace :: PandocMonad m => MarkdownParser m (F Inlines) -- cgit v1.2.3 From 415f445fc136f5832a6e2512833c2ff6a3e89038 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Tue, 17 Aug 2021 16:20:33 +0100 Subject: Escape backslashes in haddock comments (#7505) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Any literal backslash needs to be escaped: these are currently showing up as “‘r’” instead of “‘\r’”. Co-authored-by: Emily Bourke --- src/Text/Pandoc/UTF8.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Text/Pandoc/UTF8.hs b/src/Text/Pandoc/UTF8.hs index 4d5921faf..e154f0535 100644 --- a/src/Text/Pandoc/UTF8.hs +++ b/src/Text/Pandoc/UTF8.hs @@ -96,7 +96,7 @@ hGetContents :: Handle -> IO Text hGetContents = fmap toText . B.hGetContents -- | Convert UTF8-encoded ByteString to Text, also --- removing '\r' characters. +-- removing '\\r' characters. toText :: B.ByteString -> Text toText = T.decodeUtf8 . filterCRs . dropBOM where dropBOM bs = @@ -106,12 +106,12 @@ toText = T.decodeUtf8 . filterCRs . dropBOM filterCRs = B.filter (/='\r') -- | Convert UTF8-encoded ByteString to String, also --- removing '\r' characters. +-- removing '\\r' characters. toString :: B.ByteString -> String toString = T.unpack . toText -- | Convert UTF8-encoded ByteString to Text, also --- removing '\r' characters. +-- removing '\\r' characters. toTextLazy :: BL.ByteString -> TL.Text toTextLazy = TL.decodeUtf8 . filterCRs . dropBOM where dropBOM bs = @@ -121,7 +121,7 @@ toTextLazy = TL.decodeUtf8 . filterCRs . dropBOM filterCRs = BL.filter (/='\r') -- | Convert UTF8-encoded ByteString to String, also --- removing '\r' characters. +-- removing '\\r' characters. toStringLazy :: BL.ByteString -> String toStringLazy = TL.unpack . toTextLazy -- cgit v1.2.3 From 88d82203a188415e02a5964b9030f970f1c67aaf Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Tue, 10 Aug 2021 17:19:20 +0100 Subject: Add TemplateWarning log message type [API change] This is a general warning to use for messages about templates. --- src/Text/Pandoc/Logging.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs index 193b8b61c..a5c227770 100644 --- a/src/Text/Pandoc/Logging.hs +++ b/src/Text/Pandoc/Logging.hs @@ -76,6 +76,7 @@ data LogMessage = | InlineNotRendered Inline | BlockNotRendered Block | DocxParserWarning Text + | TemplateWarning Text | IgnoredIOError Text | CouldNotFetchResource Text Text | CouldNotDetermineImageSize Text Text @@ -174,6 +175,8 @@ instance ToJSON LogMessage where ["contents" .= toJSON bl] DocxParserWarning s -> ["contents" .= s] + TemplateWarning s -> + ["contents" .= s] IgnoredIOError s -> ["contents" .= s] CouldNotFetchResource fp s -> @@ -291,6 +294,8 @@ showLogMessage msg = "Not rendering " <> Text.pack (show bl) DocxParserWarning s -> "Docx parser warning: " <> s + TemplateWarning s -> + "Pptx parser warning: " <> s IgnoredIOError s -> "IO Error (ignored): " <> s CouldNotFetchResource fp s -> @@ -386,6 +391,7 @@ messageVerbosity msg = InlineNotRendered{} -> INFO BlockNotRendered{} -> INFO DocxParserWarning{} -> INFO + TemplateWarning{} -> WARNING IgnoredIOError{} -> WARNING CouldNotFetchResource{} -> WARNING CouldNotDetermineImageSize{} -> WARNING -- cgit v1.2.3 From 8474d488a52343d53ee438301d66622aad6e7bb5 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Mon, 16 Aug 2021 15:48:28 +0100 Subject: Provide more detailed XML diff in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I had some failing tests and couldn’t tell what was different in the XML. Updating the comparison to return what’s different made it easier to figure out what was wrong, and I think will be helpful for others in future. --- test/Tests/Writers/OOXML.hs | 72 ++++++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 21 deletions(-) diff --git a/test/Tests/Writers/OOXML.hs b/test/Tests/Writers/OOXML.hs index 83f05cfec..299e3e547 100644 --- a/test/Tests/Writers/OOXML.hs +++ b/test/Tests/Writers/OOXML.hs @@ -3,13 +3,15 @@ module Tests.Writers.OOXML (ooxmlTest) where -import Text.Pandoc +import Text.Pandoc hiding (Attr) import Test.Tasty import Test.Tasty.Golden.Advanced +import Control.Applicative ((<|>)) import Codec.Archive.Zip import Text.XML.Light import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as BL +import Data.Foldable (asum) import qualified Data.Text.IO as T import Data.List (isSuffixOf, sort, (\\), intercalate, union) import Data.Maybe (catMaybes, mapMaybe) @@ -17,29 +19,55 @@ import Tests.Helpers import Data.Algorithm.Diff import System.FilePath.Glob (compile, match) -compareXMLBool :: Content -> Content -> Bool +compareXML :: Content -> Content -> Maybe XMLDifference -- We make a special exception for times at the moment, and just pass -- them because we can't control the utctime when running IO. Besides, -- so long as we have two times, we're okay. -compareXMLBool (Elem myElem) (Elem goodElem) +compareXML (Elem myElem) (Elem goodElem) | (QName "created" _ (Just "dcterms")) <- elName myElem , (QName "created" _ (Just "dcterms")) <- elName goodElem = - True -compareXMLBool (Elem myElem) (Elem goodElem) + Nothing +compareXML (Elem myElem) (Elem goodElem) | (QName "modified" _ (Just "dcterms")) <- elName myElem , (QName "modified" _ (Just "dcterms")) <- elName goodElem = - True -compareXMLBool (Elem myElem) (Elem goodElem) = - elName myElem == elName goodElem && - elAttribs myElem == elAttribs goodElem && - and (zipWith compareXMLBool (elContent myElem) (elContent goodElem)) -compareXMLBool (Text myCData) (Text goodCData) = - cdVerbatim myCData == cdVerbatim goodCData && - cdData myCData == cdData goodCData && - cdLine myCData == cdLine goodCData -compareXMLBool (CRef myStr) (CRef goodStr) = - myStr == goodStr -compareXMLBool _ _ = False + Nothing +compareXML (Elem myElem) (Elem goodElem) = + (if elName myElem == elName goodElem + then Nothing + else Just + (ElemNamesDiffer + (Comparison {mine = elName myElem, good = elName goodElem})) + ) + <|> (if sort (elAttribs myElem) == sort (elAttribs goodElem) + then Nothing + else Just + (ElemAttributesDiffer + (Comparison { mine = sort (elAttribs myElem) + , good = sort (elAttribs goodElem) + }))) + <|> asum (zipWith compareXML (elContent myElem) (elContent goodElem)) +compareXML (Text myCData) (Text goodCData) = + (if cdVerbatim myCData == cdVerbatim goodCData + && cdData myCData == cdData goodCData + && cdLine myCData == cdLine goodCData + then Nothing + else Just (CDatasDiffer (Comparison { mine = myCData, good = goodCData }))) +compareXML (CRef myStr) (CRef goodStr) = + if myStr == goodStr + then Nothing + else Just (CRefsDiffer (Comparison { mine = myStr, good = goodStr })) +compareXML m g = Just (OtherContentsDiffer (Comparison {mine = m, good = g})) + +data XMLDifference + = ElemNamesDiffer (Comparison QName) + | ElemAttributesDiffer (Comparison [Attr]) + | CDatasDiffer (Comparison CData) + | CRefsDiffer (Comparison String) + | OtherContentsDiffer (Comparison Content) + deriving (Show) + +data Comparison a = Comparison { good :: a, mine :: a } + deriving (Show) displayDiff :: Content -> Content -> String displayDiff elemA elemB = @@ -106,11 +134,13 @@ compareXMLFile' fp goldenArch testArch = do let testContent = Elem testXMLDoc goldenContent = Elem goldenXMLDoc + display difference = "Non-matching xml in " + ++ fp ++ ":\n" + ++ "* " ++ show difference ++ "\n" + ++ displayDiff testContent goldenContent - if compareXMLBool goldenContent testContent - then Right () - else Left $ - "Non-matching xml in " ++ fp ++ ":\n" ++ displayDiff testContent goldenContent + + maybe (Right ()) (Left . display) (compareXML goldenContent testContent) compareXMLFile :: FilePath -> Archive -> Archive -> Maybe String compareXMLFile fp goldenArch testArch = -- cgit v1.2.3 From 9204e5c9b1ef5d1f038dbc93928f6bbc71bf6b2f Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Tue, 17 Aug 2021 11:55:29 +0100 Subject: Don’t compare cdLine in OOXML golden tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `cdLine` field gives the line of the file some CData was found on. I don’t think this is a difference that should fail these golden tests, as the XML should still be parsable if nothing else has changed. --- test/Tests/Writers/OOXML.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/test/Tests/Writers/OOXML.hs b/test/Tests/Writers/OOXML.hs index 299e3e547..56a27a4b8 100644 --- a/test/Tests/Writers/OOXML.hs +++ b/test/Tests/Writers/OOXML.hs @@ -49,7 +49,6 @@ compareXML (Elem myElem) (Elem goodElem) = compareXML (Text myCData) (Text goodCData) = (if cdVerbatim myCData == cdVerbatim goodCData && cdData myCData == cdData goodCData - && cdLine myCData == cdLine goodCData then Nothing else Just (CDatasDiffer (Comparison { mine = myCData, good = goodCData }))) compareXML (CRef myStr) (CRef goodStr) = -- cgit v1.2.3 From 72823ad947face43ef45eaeb7e611979531abed6 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Tue, 10 Aug 2021 17:20:53 +0100 Subject: pptx: Select layouts from reference doc by name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now, users had to make sure that their reference doc contains layouts in a specific order: the first four layouts in the file had to have a specific structure, or else pandoc would error (or sometimes successfully produce a pptx file, which PowerPoint would then fail to open). This commit changes the layout selection to use the layout names rather than order: users must make sure their reference doc contains four layouts with specific names, and if a layout with the right name isn’t found pandoc will output a warning and use the corresponding layout from the default reference doc as a fallback. I believe the use of names rather than order will be clearer to users, and the clearer errors will help them troubleshoot when things go wrong. - Add tests for moved layouts - Add tests for deleted layouts - Add newly included layouts to slideMaster1.xml to fix tests --- MANUAL.txt | 19 +- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 225 +++++++++++++++++++-- test/Tests/Writers/Powerpoint.hs | 31 ++- test/pptx/code-custom_deleted_layouts.pptx | Bin 0 -> 31033 bytes test/pptx/code-custom_moved_layouts.pptx | Bin 0 -> 41822 bytes test/pptx/code_deleted_layouts.pptx | Bin 0 -> 31032 bytes test/pptx/code_moved_layouts.pptx | Bin 0 -> 41826 bytes ...ment-properties-short-desc_deleted_layouts.pptx | Bin 0 -> 29806 bytes ...cument-properties-short-desc_moved_layouts.pptx | Bin 0 -> 40600 bytes test/pptx/document-properties_deleted_layouts.pptx | Bin 0 -> 30210 bytes test/pptx/document-properties_moved_layouts.pptx | Bin 0 -> 41004 bytes test/pptx/endnotes_deleted_layouts.pptx | Bin 0 -> 29774 bytes test/pptx/endnotes_moved_layouts.pptx | Bin 0 -> 40566 bytes test/pptx/endnotes_toc_deleted_layouts.pptx | Bin 0 -> 30596 bytes test/pptx/endnotes_toc_moved_layouts.pptx | Bin 0 -> 41384 bytes test/pptx/images_deleted_layouts.pptx | Bin 0 -> 47424 bytes test/pptx/images_moved_layouts.pptx | Bin 0 -> 58213 bytes test/pptx/inline_formatting_deleted_layouts.pptx | Bin 0 -> 28966 bytes test/pptx/inline_formatting_moved_layouts.pptx | Bin 0 -> 39758 bytes test/pptx/lists_deleted_layouts.pptx | Bin 0 -> 29861 bytes test/pptx/lists_moved_layouts.pptx | Bin 0 -> 40653 bytes test/pptx/raw_ooxml_deleted_layouts.pptx | Bin 0 -> 29754 bytes test/pptx/raw_ooxml_moved_layouts.pptx | Bin 0 -> 40546 bytes test/pptx/reference_deleted_layouts.pptx | Bin 0 -> 18160 bytes test/pptx/reference_moved_layouts.pptx | Bin 0 -> 44237 bytes test/pptx/remove_empty_slides_deleted_layouts.pptx | Bin 0 -> 46867 bytes test/pptx/remove_empty_slides_moved_layouts.pptx | Bin 0 -> 57656 bytes test/pptx/slide_breaks_deleted_layouts.pptx | Bin 0 -> 31378 bytes test/pptx/slide_breaks_moved_layouts.pptx | Bin 0 -> 42171 bytes ...slide_breaks_slide_level_1_deleted_layouts.pptx | Bin 0 -> 30554 bytes .../slide_breaks_slide_level_1_moved_layouts.pptx | Bin 0 -> 41343 bytes test/pptx/slide_breaks_toc_deleted_layouts.pptx | Bin 0 -> 32328 bytes test/pptx/slide_breaks_toc_moved_layouts.pptx | Bin 0 -> 43118 bytes ...eaker_notes_after_metadata_deleted_layouts.pptx | Bin 0 -> 34473 bytes ...speaker_notes_after_metadata_moved_layouts.pptx | Bin 0 -> 45269 bytes .../speaker_notes_afterheader_deleted_layouts.pptx | Bin 0 -> 33500 bytes .../speaker_notes_afterheader_moved_layouts.pptx | Bin 0 -> 44297 bytes .../speaker_notes_afterseps_deleted_layouts.pptx | Bin 0 -> 54390 bytes .../speaker_notes_afterseps_moved_layouts.pptx | Bin 0 -> 65181 bytes test/pptx/speaker_notes_deleted_layouts.pptx | Bin 0 -> 38203 bytes test/pptx/speaker_notes_moved_layouts.pptx | Bin 0 -> 49002 bytes test/pptx/start_numbering_at_deleted_layouts.pptx | Bin 0 -> 29837 bytes test/pptx/start_numbering_at_moved_layouts.pptx | Bin 0 -> 40630 bytes test/pptx/tables_deleted_layouts.pptx | Bin 0 -> 30381 bytes test/pptx/tables_moved_layouts.pptx | Bin 0 -> 41174 bytes test/pptx/two_column_deleted_layouts.pptx | Bin 0 -> 28883 bytes test/pptx/two_column_moved_layouts.pptx | Bin 0 -> 39676 bytes 47 files changed, 242 insertions(+), 33 deletions(-) create mode 100644 test/pptx/code-custom_deleted_layouts.pptx create mode 100644 test/pptx/code-custom_moved_layouts.pptx create mode 100644 test/pptx/code_deleted_layouts.pptx create mode 100644 test/pptx/code_moved_layouts.pptx create mode 100644 test/pptx/document-properties-short-desc_deleted_layouts.pptx create mode 100644 test/pptx/document-properties-short-desc_moved_layouts.pptx create mode 100644 test/pptx/document-properties_deleted_layouts.pptx create mode 100644 test/pptx/document-properties_moved_layouts.pptx create mode 100644 test/pptx/endnotes_deleted_layouts.pptx create mode 100644 test/pptx/endnotes_moved_layouts.pptx create mode 100644 test/pptx/endnotes_toc_deleted_layouts.pptx create mode 100644 test/pptx/endnotes_toc_moved_layouts.pptx create mode 100644 test/pptx/images_deleted_layouts.pptx create mode 100644 test/pptx/images_moved_layouts.pptx create mode 100644 test/pptx/inline_formatting_deleted_layouts.pptx create mode 100644 test/pptx/inline_formatting_moved_layouts.pptx create mode 100644 test/pptx/lists_deleted_layouts.pptx create mode 100644 test/pptx/lists_moved_layouts.pptx create mode 100644 test/pptx/raw_ooxml_deleted_layouts.pptx create mode 100644 test/pptx/raw_ooxml_moved_layouts.pptx create mode 100644 test/pptx/reference_deleted_layouts.pptx create mode 100644 test/pptx/reference_moved_layouts.pptx create mode 100644 test/pptx/remove_empty_slides_deleted_layouts.pptx create mode 100644 test/pptx/remove_empty_slides_moved_layouts.pptx create mode 100644 test/pptx/slide_breaks_deleted_layouts.pptx create mode 100644 test/pptx/slide_breaks_moved_layouts.pptx create mode 100644 test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx create mode 100644 test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx create mode 100644 test/pptx/slide_breaks_toc_deleted_layouts.pptx create mode 100644 test/pptx/slide_breaks_toc_moved_layouts.pptx create mode 100644 test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx create mode 100644 test/pptx/speaker_notes_after_metadata_moved_layouts.pptx create mode 100644 test/pptx/speaker_notes_afterheader_deleted_layouts.pptx create mode 100644 test/pptx/speaker_notes_afterheader_moved_layouts.pptx create mode 100644 test/pptx/speaker_notes_afterseps_deleted_layouts.pptx create mode 100644 test/pptx/speaker_notes_afterseps_moved_layouts.pptx create mode 100644 test/pptx/speaker_notes_deleted_layouts.pptx create mode 100644 test/pptx/speaker_notes_moved_layouts.pptx create mode 100644 test/pptx/start_numbering_at_deleted_layouts.pptx create mode 100644 test/pptx/start_numbering_at_moved_layouts.pptx create mode 100644 test/pptx/tables_deleted_layouts.pptx create mode 100644 test/pptx/tables_moved_layouts.pptx create mode 100644 test/pptx/two_column_deleted_layouts.pptx create mode 100644 test/pptx/two_column_moved_layouts.pptx diff --git a/MANUAL.txt b/MANUAL.txt index bed3b2009..0b1424d47 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1165,13 +1165,18 @@ header when requesting a document from a URL: `.pptx` or `.potx` extension) are known to work, as are most templates derived from these. - The specific requirement is that the template should begin with - the following first four layouts: - - 1. Title Slide - 2. Title and Content - 3. Section Header - 4. Two Content + The specific requirement is that the template should contain layouts + with the following names (as seen within PowerPoint): + + - Title Slide + - Title and Content + - Section Header + - Two Content + + For each name, the first layout found with that name will be used. + If no layout is found with one of the names, pandoc will output a + warning and use the layout with that name from the default reference + doc instead. All templates included with a recent version of MS PowerPoint will fit these criteria. (You can click on `Layout` under the diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 157810216..a757516a8 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {- | @@ -21,14 +22,19 @@ import Control.Monad.Reader import Control.Monad.State import Codec.Archive.Zip import Data.List (intercalate, stripPrefix, nub, union, isPrefixOf, intersperse) +import Data.CaseInsensitive (CI) +import qualified Data.CaseInsensitive as CI import Data.Default +import Data.Foldable (toList) +import Data.List.NonEmpty (nonEmpty, NonEmpty ((:|))) import Data.Text (Text) import qualified Data.Text as T -import qualified Data.Text.Read +import Data.Text.Read (decimal) import Data.Time (formatTime, defaultTimeLocale) import Data.Time.Clock (UTCTime) import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds, posixSecondsToUTCTime) -import System.FilePath.Posix (splitDirectories, splitExtension, takeExtension) +import Data.Traversable (for) +import System.FilePath.Posix (splitDirectories, splitExtension, takeExtension, takeFileName) import Text.Pandoc.XML.Light as XML import Text.Pandoc.Definition import qualified Text.Pandoc.UTF8 as UTF8 @@ -48,11 +54,11 @@ import System.FilePath.Glob import Text.DocTemplates (FromContext(lookupContext), Context) import Text.DocLayout (literal) import Text.TeXMath +import Text.Pandoc.Logging (LogMessage(TemplateWarning)) import Text.Pandoc.Writers.Math (convertMath) import Text.Pandoc.Writers.Powerpoint.Presentation import Text.Pandoc.Shared (tshow, stringify) import Skylighting (fromColor) -import Data.List.NonEmpty (nonEmpty) -- |The 'EMU' type is used to specify sizes in English Metric Units. type EMU = Integer @@ -117,6 +123,7 @@ data WriterEnv = WriterEnv { envRefArchive :: Archive -- no entry in the map for it. , envSpeakerNotesIdMap :: M.Map Int Int , envInSpeakerNotes :: Bool + , envSlideLayouts :: Maybe SlideLayouts } deriving (Show) @@ -136,8 +143,33 @@ instance Default WriterEnv where , envSlideIdMap = mempty , envSpeakerNotesIdMap = mempty , envInSpeakerNotes = False + , envSlideLayouts = Nothing } +type SlideLayouts = SlideLayoutsOf SlideLayout + +data SlideLayoutsOf a = SlideLayouts + { metadata :: a + , title :: a + , content :: a + , twoColumn :: a + } deriving (Show, Functor, Foldable, Traversable) + +data SlideLayout = SlideLayout + { slElement :: Element + , slInReferenceDoc :: Bool + -- ^ True if the layout is in the provided reference doc, False if it's in + -- the default reference doc. + , slPath :: FilePath + , slEntry :: Entry + } deriving (Show) + +getSlideLayouts :: PandocMonad m => P m SlideLayouts +getSlideLayouts = asks envSlideLayouts >>= maybe (throwError e) pure + where + e = PandocSomeError ("Slide layouts aren't defined, even though they should " + <> "always be. This is a bug in pandoc.") + data ContentType = NormalContent | TwoColumnLeftContent | TwoColumnRightContent @@ -264,7 +296,24 @@ presentationToArchiveP p@(Presentation docProps slides) = do T.unlines (map (T.pack . (" " <>)) missingFiles) ) - newArch' <- foldM copyFileToArchive emptyArchive filePaths + newArch <- foldM copyFileToArchive emptyArchive filePaths + + -- Add any layouts taken from the default archive, + -- overwriting any already added. + slideLayouts <- getSlideLayouts + let f layout = + if not (slInReferenceDoc layout) + then addEntryToArchive (slEntry layout) + else id + let newArch' = foldr f newArch slideLayouts + + -- Update the master to make sure it includes any layouts we've just added + master <- getMaster + masterRels <- getMasterRels + let (updatedMasterElem, updatedMasterRelElem) = updateMasterElems slideLayouts master masterRels + updatedMasterEntry <- elemToEntry "ppt/slideMasters/slideMaster1.xml" updatedMasterElem + updatedMasterRelEntry <- elemToEntry "ppt/slideMasters/_rels/slideMaster1.xml.rels" updatedMasterRelElem + -- we make a modified ppt/viewProps.xml out of the presentation viewProps viewPropsEntry <- makeViewPropsEntry -- we make a docProps/core.xml entry out of the presentation docprops @@ -293,9 +342,82 @@ presentationToArchiveP p@(Presentation docProps slides) = do spkNotesEntries <> spkNotesRelEntries <> mediaEntries <> + [updatedMasterEntry, updatedMasterRelEntry] <> [contentTypesEntry, docPropsEntry, docCustomPropsEntry, relsEntry, presEntry, presRelsEntry, viewPropsEntry] +updateMasterElems :: SlideLayouts -> Element -> Element -> (Element, Element) +updateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels) + where + updatedMaster = master { elContent = updateSldLayoutIdLst <$> elContent master } + (updatedRelationshipIds, updatedMasterRels) = addLayoutRels masterRels + + updateSldLayoutIdLst :: Content -> Content + updateSldLayoutIdLst (Elem e) = case elName e of + (QName "sldLayoutIdLst" _ _) -> let + mkChild relationshipId (lastId, children) = let + thisId = lastId + 1 + newChild = Element + { elName = QName "sldLayoutId" Nothing (Just "p") + , elAttribs = + [ Attr (QName "id" Nothing Nothing) (T.pack (show thisId)) + , Attr (QName "id" Nothing (Just "r")) relationshipId + ] + , elContent = [] + , elLine = Nothing + } + in (thisId, Elem newChild : children) + newChildren = snd (foldr mkChild (maxIdNumber' e, []) updatedRelationshipIds) + in Elem e { elContent = elContent e <> newChildren } + _ -> Elem e + updateSldLayoutIdLst c = c + + addLayoutRels :: + Element -> + ([Text], Element) + addLayoutRels e = let + layoutsToAdd = filter (not . slInReferenceDoc) (toList layouts) + newRelationships = snd (foldr mkRelationship (maxIdNumber e, []) layoutsToAdd) + newRelationshipIds = mapMaybe getRelationshipId newRelationships + mkRelationship layout (lastId, relationships) = let + thisId = lastId + 1 + slideLayoutPath = "../slideLayouts/" <> T.pack (takeFileName (slPath layout)) + newRelationship = Element + { elName = QName "Relationship" Nothing Nothing + , elAttribs = + [ Attr (QName "Id" Nothing Nothing) ("rId" <> T.pack (show thisId)) + , Attr (QName "Type" Nothing Nothing) "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" + , Attr (QName "Target" Nothing Nothing) slideLayoutPath + ] + , elContent = [] + , elLine = Nothing + } + in (thisId, Elem newRelationship : relationships) + in (newRelationshipIds, e {elContent = elContent e <> newRelationships}) + + getRelationshipId :: Content -> Maybe Text + getRelationshipId (Elem e) = findAttr (QName "Id" Nothing Nothing) e + getRelationshipId _ = Nothing + + maxIdNumber :: Element -> Integer + maxIdNumber relationships = maximum (0 : idNumbers) + where + idNumbers = fst <$> mapMaybe (hush . decimal . T.drop 3) idAttributes + idAttributes = mapMaybe getIdAttribute (elContent relationships) + getIdAttribute (Elem e) = findAttr (QName "Id" Nothing Nothing) e + getIdAttribute _ = Nothing + + maxIdNumber' :: Element -> Integer + maxIdNumber' sldLayouts = maximum (0 : idNumbers) + where + idNumbers = fst <$> mapMaybe (hush . decimal) idAttributes + idAttributes = mapMaybe getIdAttribute (elContent sldLayouts) + getIdAttribute (Elem e) = findAttr (QName "id" Nothing Nothing) e + getIdAttribute _ = Nothing + + hush :: Either a b -> Maybe b + hush = either (const Nothing) Just + makeSlideIdMap :: Presentation -> M.Map SlideId Int makeSlideIdMap (Presentation _ slides) = M.fromList $ map slideId slides `zip` [1..] @@ -318,6 +440,40 @@ presentationToArchive opts meta pres = do Nothing -> toArchive . BL.fromStrict <$> P.readDataFile "reference.pptx" + let (referenceLayouts, defaultReferenceLayouts) = + (getLayoutsFromArchive refArchive, getLayoutsFromArchive distArchive) + let layoutTitles = SlideLayouts { metadata = "Title Slide" :: Text + , title = "Section Header" + , content = "Title and Content" + , twoColumn = "Two Content" + } + layouts <- for layoutTitles $ \layoutTitle -> do + let layout = M.lookup (CI.mk layoutTitle) referenceLayouts + let defaultLayout = M.lookup (CI.mk layoutTitle) defaultReferenceLayouts + case (layout, defaultLayout) of + (Nothing, Nothing) -> + throwError (PandocSomeError ("Couldn't find layout named \"" + <> layoutTitle <> "\" in the provided " + <> "reference doc or in the default " + <> "reference doc included with pandoc.")) + (Nothing, Just ((element, path, entry) :| _)) -> do + P.logOutput (TemplateWarning ("Couldn't find layout named \"" + <> layoutTitle <> "\" in provided " + <> "reference doc. Falling back to " + <> "the default included with pandoc.")) + pure SlideLayout { slElement = element + , slPath = path + , slEntry = entry + , slInReferenceDoc = False + } + (Just ((element, path, entry) :| _), _ ) -> + pure SlideLayout { slElement = element + , slPath = path + , slEntry = entry + , slInReferenceDoc = True + } + + utctime <- P.getTimestamp presSize <- case getPresentationSize refArchive distArchive of @@ -341,6 +497,7 @@ presentationToArchive opts meta pres = do , envPresentationSize = presSize , envSlideIdMap = makeSlideIdMap pres , envSpeakerNotesIdMap = makeSpeakerNotesMap pres + , envSlideLayouts = Just layouts } let st = def { stMediaGlobalIds = initialGlobalIds refArchive distArchive @@ -348,7 +505,30 @@ presentationToArchive opts meta pres = do runP env st $ presentationToArchiveP pres - +-- | Get all slide layouts from an archive, as a map where the layout's name +-- gives the map key. +-- +-- For each layout, the map contains its XML representation, its path within +-- the archive, and the archive entry. +getLayoutsFromArchive :: Archive -> M.Map (CI Text) (NonEmpty (Element, FilePath, Entry)) +getLayoutsFromArchive archive = + M.fromListWith (<>) ((\t@(e, _, _) -> (CI.mk (name e), pure t)) <$> layouts) + where + layouts :: [(Element, FilePath, Entry)] + layouts = mapMaybe findElementByPath paths + parseXml' entry = case parseXMLElement (UTF8.toTextLazy (fromEntry entry)) of + Left _ -> Nothing + Right element -> Just element + findElementByPath :: FilePath -> Maybe (Element, FilePath, Entry) + findElementByPath path = do + entry <- findEntryByPath path archive + element <- parseXml' entry + pure (element, path, entry) + paths = filter (match (compile "ppt/slideLayouts/slideLayout*.xml")) (filesInArchive archive) + name element = fromMaybe "Untitled layout" $ do + let ns = elemToNameSpaces element + cSld <- findChild (elemName ns "p" "cSld") element + findAttr (QName "name" Nothing Nothing) cSld -------------------------------------------------- @@ -365,15 +545,14 @@ curSlideHasSpeakerNotes = -------------------------------------------------- getLayout :: PandocMonad m => Layout -> P m Element -getLayout layout = do - let layoutpath = case layout of - MetadataSlide{} -> "ppt/slideLayouts/slideLayout1.xml" - TitleSlide{} -> "ppt/slideLayouts/slideLayout3.xml" - ContentSlide{} -> "ppt/slideLayouts/slideLayout2.xml" - TwoColumnSlide{} -> "ppt/slideLayouts/slideLayout4.xml" - refArchive <- asks envRefArchive - distArchive <- asks envDistArchive - parseXml refArchive distArchive layoutpath +getLayout layout = getElement <$> getSlideLayouts + where + getElement = + slElement . case layout of + MetadataSlide{} -> metadata + TitleSlide{} -> title + ContentSlide{} -> content + TwoColumnSlide{} -> twoColumn shapeHasId :: NameSpaces -> T.Text -> Element -> Bool shapeHasId ns ident element @@ -604,6 +783,12 @@ getMaster = do distArchive <- asks envDistArchive parseXml refArchive distArchive "ppt/slideMasters/slideMaster1.xml" +getMasterRels :: PandocMonad m => P m Element +getMasterRels = do + refArchive <- asks envRefArchive + distArchive <- asks envDistArchive + parseXml refArchive distArchive "ppt/slideMasters/_rels/slideMaster1.xml.rels" + -- We want to get the header dimensions, so we can make sure that the -- image goes underneath it. We only use this in a content slide if it -- has a header. @@ -1606,11 +1791,13 @@ speakerNotesSlideRelElement slide = do slideToSlideRelElement :: PandocMonad m => Slide -> P m Element slideToSlideRelElement slide = do idNum <- slideNum slide - let target = case slide of - (Slide _ MetadataSlide{} _) -> "../slideLayouts/slideLayout1.xml" - (Slide _ TitleSlide{} _) -> "../slideLayouts/slideLayout3.xml" - (Slide _ ContentSlide{} _) -> "../slideLayouts/slideLayout2.xml" - (Slide _ TwoColumnSlide{} _) -> "../slideLayouts/slideLayout4.xml" + target <- flip fmap getSlideLayouts $ + T.pack . ("../slideLayouts/" <>) . takeFileName . + slPath . case slide of + (Slide _ MetadataSlide{} _) -> metadata + (Slide _ TitleSlide{} _) -> title + (Slide _ ContentSlide{} _) -> content + (Slide _ TwoColumnSlide{} _) -> twoColumn speakerNotesRels <- maybeToList <$> speakerNotesSlideRelElement slide diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 87ebe990c..344d20238 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -7,18 +7,21 @@ import System.FilePath import Text.DocTemplates (ToContext(toVal), Context(..)) import qualified Data.Map as M import Data.Text (pack) +import Data.List (unzip4) -- templating is important enough, and can break enough things, that -- we want to run all our tests with both default formatting and a -- template. -modifyPptxName :: FilePath -> FilePath -modifyPptxName fp = - addExtension (dropExtension fp ++ "_templated") "pptx" +modifyPptxName :: FilePath -> String -> FilePath +modifyPptxName fp suffix = + addExtension (dropExtension fp ++ suffix) "pptx" -pptxTests :: String -> WriterOptions -> FilePath -> FilePath -> (TestTree, TestTree) +pptxTests :: String -> WriterOptions -> FilePath -> FilePath -> (TestTree, TestTree, TestTree, TestTree) pptxTests name opts native pptx = let referenceDoc = "pptx/reference_depth.pptx" + movedLayoutsReferenceDoc = "pptx/reference_moved_layouts.pptx" + deletedLayoutsReferenceDoc = "pptx/reference_deleted_layouts.pptx" in ( ooxmlTest writePowerpoint @@ -31,15 +34,29 @@ pptxTests name opts native pptx = name opts{writerReferenceDoc=Just referenceDoc} native - (modifyPptxName pptx) + (modifyPptxName pptx "_templated") + , ooxmlTest + writePowerpoint + name + opts{writerReferenceDoc=Just movedLayoutsReferenceDoc} + native + (modifyPptxName pptx "_moved_layouts") + , ooxmlTest + writePowerpoint + name + opts{writerReferenceDoc=Just deletedLayoutsReferenceDoc} + native + (modifyPptxName pptx "_deleted_layouts") ) -groupPptxTests :: [(TestTree, TestTree)] -> [TestTree] +groupPptxTests :: [(TestTree, TestTree, TestTree, TestTree)] -> [TestTree] groupPptxTests pairs = - let (noRefs, refs) = unzip pairs + let (noRefs, refs, movedLayouts, deletedLayouts) = unzip4 pairs in [ testGroup "Default slide formatting" noRefs , testGroup "With `--reference-doc` pptx file" refs + , testGroup "With layouts in reference doc moved" movedLayouts + , testGroup "With layouts in reference doc deleted" deletedLayouts ] diff --git a/test/pptx/code-custom_deleted_layouts.pptx b/test/pptx/code-custom_deleted_layouts.pptx new file mode 100644 index 000000000..9282e6354 Binary files /dev/null and b/test/pptx/code-custom_deleted_layouts.pptx differ diff --git a/test/pptx/code-custom_moved_layouts.pptx b/test/pptx/code-custom_moved_layouts.pptx new file mode 100644 index 000000000..a14eeb6c8 Binary files /dev/null and b/test/pptx/code-custom_moved_layouts.pptx differ diff --git a/test/pptx/code_deleted_layouts.pptx b/test/pptx/code_deleted_layouts.pptx new file mode 100644 index 000000000..0f503f553 Binary files /dev/null and b/test/pptx/code_deleted_layouts.pptx differ diff --git a/test/pptx/code_moved_layouts.pptx b/test/pptx/code_moved_layouts.pptx new file mode 100644 index 000000000..4d66b1310 Binary files /dev/null and b/test/pptx/code_moved_layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc_deleted_layouts.pptx b/test/pptx/document-properties-short-desc_deleted_layouts.pptx new file mode 100644 index 000000000..e4cf6bd7b Binary files /dev/null and b/test/pptx/document-properties-short-desc_deleted_layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc_moved_layouts.pptx b/test/pptx/document-properties-short-desc_moved_layouts.pptx new file mode 100644 index 000000000..8834f885f Binary files /dev/null and b/test/pptx/document-properties-short-desc_moved_layouts.pptx differ diff --git a/test/pptx/document-properties_deleted_layouts.pptx b/test/pptx/document-properties_deleted_layouts.pptx new file mode 100644 index 000000000..a00c8059d Binary files /dev/null and b/test/pptx/document-properties_deleted_layouts.pptx differ diff --git a/test/pptx/document-properties_moved_layouts.pptx b/test/pptx/document-properties_moved_layouts.pptx new file mode 100644 index 000000000..c1d2d5282 Binary files /dev/null and b/test/pptx/document-properties_moved_layouts.pptx differ diff --git a/test/pptx/endnotes_deleted_layouts.pptx b/test/pptx/endnotes_deleted_layouts.pptx new file mode 100644 index 000000000..5c69a6310 Binary files /dev/null and b/test/pptx/endnotes_deleted_layouts.pptx differ diff --git a/test/pptx/endnotes_moved_layouts.pptx b/test/pptx/endnotes_moved_layouts.pptx new file mode 100644 index 000000000..0d4c491b9 Binary files /dev/null and b/test/pptx/endnotes_moved_layouts.pptx differ diff --git a/test/pptx/endnotes_toc_deleted_layouts.pptx b/test/pptx/endnotes_toc_deleted_layouts.pptx new file mode 100644 index 000000000..46708544c Binary files /dev/null and b/test/pptx/endnotes_toc_deleted_layouts.pptx differ diff --git a/test/pptx/endnotes_toc_moved_layouts.pptx b/test/pptx/endnotes_toc_moved_layouts.pptx new file mode 100644 index 000000000..d1200bd7d Binary files /dev/null and b/test/pptx/endnotes_toc_moved_layouts.pptx differ diff --git a/test/pptx/images_deleted_layouts.pptx b/test/pptx/images_deleted_layouts.pptx new file mode 100644 index 000000000..7a38ea625 Binary files /dev/null and b/test/pptx/images_deleted_layouts.pptx differ diff --git a/test/pptx/images_moved_layouts.pptx b/test/pptx/images_moved_layouts.pptx new file mode 100644 index 000000000..08d1c27e0 Binary files /dev/null and b/test/pptx/images_moved_layouts.pptx differ diff --git a/test/pptx/inline_formatting_deleted_layouts.pptx b/test/pptx/inline_formatting_deleted_layouts.pptx new file mode 100644 index 000000000..bbd5bfeb4 Binary files /dev/null and b/test/pptx/inline_formatting_deleted_layouts.pptx differ diff --git a/test/pptx/inline_formatting_moved_layouts.pptx b/test/pptx/inline_formatting_moved_layouts.pptx new file mode 100644 index 000000000..427492130 Binary files /dev/null and b/test/pptx/inline_formatting_moved_layouts.pptx differ diff --git a/test/pptx/lists_deleted_layouts.pptx b/test/pptx/lists_deleted_layouts.pptx new file mode 100644 index 000000000..6512e44bb Binary files /dev/null and b/test/pptx/lists_deleted_layouts.pptx differ diff --git a/test/pptx/lists_moved_layouts.pptx b/test/pptx/lists_moved_layouts.pptx new file mode 100644 index 000000000..2947c3211 Binary files /dev/null and b/test/pptx/lists_moved_layouts.pptx differ diff --git a/test/pptx/raw_ooxml_deleted_layouts.pptx b/test/pptx/raw_ooxml_deleted_layouts.pptx new file mode 100644 index 000000000..2ea155657 Binary files /dev/null and b/test/pptx/raw_ooxml_deleted_layouts.pptx differ diff --git a/test/pptx/raw_ooxml_moved_layouts.pptx b/test/pptx/raw_ooxml_moved_layouts.pptx new file mode 100644 index 000000000..e58304172 Binary files /dev/null and b/test/pptx/raw_ooxml_moved_layouts.pptx differ diff --git a/test/pptx/reference_deleted_layouts.pptx b/test/pptx/reference_deleted_layouts.pptx new file mode 100644 index 000000000..a9a74ecd5 Binary files /dev/null and b/test/pptx/reference_deleted_layouts.pptx differ diff --git a/test/pptx/reference_moved_layouts.pptx b/test/pptx/reference_moved_layouts.pptx new file mode 100644 index 000000000..72c4f3fd7 Binary files /dev/null and b/test/pptx/reference_moved_layouts.pptx differ diff --git a/test/pptx/remove_empty_slides_deleted_layouts.pptx b/test/pptx/remove_empty_slides_deleted_layouts.pptx new file mode 100644 index 000000000..7ae4a5fab Binary files /dev/null and b/test/pptx/remove_empty_slides_deleted_layouts.pptx differ diff --git a/test/pptx/remove_empty_slides_moved_layouts.pptx b/test/pptx/remove_empty_slides_moved_layouts.pptx new file mode 100644 index 000000000..2572f2447 Binary files /dev/null and b/test/pptx/remove_empty_slides_moved_layouts.pptx differ diff --git a/test/pptx/slide_breaks_deleted_layouts.pptx b/test/pptx/slide_breaks_deleted_layouts.pptx new file mode 100644 index 000000000..86dfad3b2 Binary files /dev/null and b/test/pptx/slide_breaks_deleted_layouts.pptx differ diff --git a/test/pptx/slide_breaks_moved_layouts.pptx b/test/pptx/slide_breaks_moved_layouts.pptx new file mode 100644 index 000000000..90b3b94a6 Binary files /dev/null and b/test/pptx/slide_breaks_moved_layouts.pptx differ diff --git a/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx b/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx new file mode 100644 index 000000000..2c7fd4d8b Binary files /dev/null and b/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx differ diff --git a/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx b/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx new file mode 100644 index 000000000..8471b1d10 Binary files /dev/null and b/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx differ diff --git a/test/pptx/slide_breaks_toc_deleted_layouts.pptx b/test/pptx/slide_breaks_toc_deleted_layouts.pptx new file mode 100644 index 000000000..1e0b76d46 Binary files /dev/null and b/test/pptx/slide_breaks_toc_deleted_layouts.pptx differ diff --git a/test/pptx/slide_breaks_toc_moved_layouts.pptx b/test/pptx/slide_breaks_toc_moved_layouts.pptx new file mode 100644 index 000000000..918264bc5 Binary files /dev/null and b/test/pptx/slide_breaks_toc_moved_layouts.pptx differ diff --git a/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx b/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx new file mode 100644 index 000000000..1298870e2 Binary files /dev/null and b/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx differ diff --git a/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx b/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx new file mode 100644 index 000000000..b844a0b51 Binary files /dev/null and b/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx b/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx new file mode 100644 index 000000000..853b918cb Binary files /dev/null and b/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterheader_moved_layouts.pptx b/test/pptx/speaker_notes_afterheader_moved_layouts.pptx new file mode 100644 index 000000000..9fff9f855 Binary files /dev/null and b/test/pptx/speaker_notes_afterheader_moved_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx b/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx new file mode 100644 index 000000000..1e7f4968d Binary files /dev/null and b/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterseps_moved_layouts.pptx b/test/pptx/speaker_notes_afterseps_moved_layouts.pptx new file mode 100644 index 000000000..e092ae444 Binary files /dev/null and b/test/pptx/speaker_notes_afterseps_moved_layouts.pptx differ diff --git a/test/pptx/speaker_notes_deleted_layouts.pptx b/test/pptx/speaker_notes_deleted_layouts.pptx new file mode 100644 index 000000000..6a5ad524f Binary files /dev/null and b/test/pptx/speaker_notes_deleted_layouts.pptx differ diff --git a/test/pptx/speaker_notes_moved_layouts.pptx b/test/pptx/speaker_notes_moved_layouts.pptx new file mode 100644 index 000000000..f95df9622 Binary files /dev/null and b/test/pptx/speaker_notes_moved_layouts.pptx differ diff --git a/test/pptx/start_numbering_at_deleted_layouts.pptx b/test/pptx/start_numbering_at_deleted_layouts.pptx new file mode 100644 index 000000000..d9cf91804 Binary files /dev/null and b/test/pptx/start_numbering_at_deleted_layouts.pptx differ diff --git a/test/pptx/start_numbering_at_moved_layouts.pptx b/test/pptx/start_numbering_at_moved_layouts.pptx new file mode 100644 index 000000000..e1b2d4de8 Binary files /dev/null and b/test/pptx/start_numbering_at_moved_layouts.pptx differ diff --git a/test/pptx/tables_deleted_layouts.pptx b/test/pptx/tables_deleted_layouts.pptx new file mode 100644 index 000000000..a52222551 Binary files /dev/null and b/test/pptx/tables_deleted_layouts.pptx differ diff --git a/test/pptx/tables_moved_layouts.pptx b/test/pptx/tables_moved_layouts.pptx new file mode 100644 index 000000000..56608a039 Binary files /dev/null and b/test/pptx/tables_moved_layouts.pptx differ diff --git a/test/pptx/two_column_deleted_layouts.pptx b/test/pptx/two_column_deleted_layouts.pptx new file mode 100644 index 000000000..60a244f94 Binary files /dev/null and b/test/pptx/two_column_deleted_layouts.pptx differ diff --git a/test/pptx/two_column_moved_layouts.pptx b/test/pptx/two_column_moved_layouts.pptx new file mode 100644 index 000000000..a17f96b18 Binary files /dev/null and b/test/pptx/two_column_moved_layouts.pptx differ -- cgit v1.2.3 From 4c6af94f1c1f9977aa3bcd683cef940bb9caddd0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 17 Aug 2021 14:30:17 -0700 Subject: Use released citeproc 0.5. --- cabal.project | 4 ---- pandoc.cabal | 2 +- stack.yaml | 4 +--- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cabal.project b/cabal.project index 401992868..26373c616 100644 --- a/cabal.project +++ b/cabal.project @@ -2,7 +2,3 @@ packages: pandoc.cabal tests: True flags: +embed_data_files -source-repository-package - type: git - location: https://github.com/jgm/citeproc.git - tag: 8d03cb722fac3ea8f17f432ac20abe35361df551 diff --git a/pandoc.cabal b/pandoc.cabal index f4a173f59..fb7da0a05 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -452,7 +452,7 @@ library blaze-markup >= 0.8 && < 0.9, bytestring >= 0.9 && < 0.12, case-insensitive >= 1.2 && < 1.3, - citeproc >= 0.4.1 && < 0.4.2, + citeproc >= 0.5 && < 0.6, commonmark >= 0.2.1 && < 0.3, commonmark-extensions >= 0.2.1.2 && < 0.3, commonmark-pandoc >= 0.2.1.1 && < 0.3, diff --git a/stack.yaml b/stack.yaml index ce58cf732..a8df254d7 100644 --- a/stack.yaml +++ b/stack.yaml @@ -13,9 +13,7 @@ extra-deps: - skylighting-0.11 - doctemplates-0.10 - texmath-0.12.3.1 -# - citeproc-0.4.1 -- git: https://github.com/jgm/citeproc.git - commit: 8d03cb722fac3ea8f17f432ac20abe35361df551 +- citeproc-0.5 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.0 -- cgit v1.2.3 From 8451bce6ded6b9150f5ab8ae824d99ce1919dfa9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 17 Aug 2021 15:12:23 -0700 Subject: Rename TemplateWarning -> PowerpointTemplateWarning. @undergroundquizscene - I think TemplateWarning is apt to be confusing, since this actually doesn't have anything to do with what we call 'templates' in pandoc. Hence the change to a powerpoint-specific name. --- src/Text/Pandoc/Logging.hs | 10 +++++----- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs index a5c227770..c49726040 100644 --- a/src/Text/Pandoc/Logging.hs +++ b/src/Text/Pandoc/Logging.hs @@ -76,7 +76,7 @@ data LogMessage = | InlineNotRendered Inline | BlockNotRendered Block | DocxParserWarning Text - | TemplateWarning Text + | PowerpointTemplateWarning Text | IgnoredIOError Text | CouldNotFetchResource Text Text | CouldNotDetermineImageSize Text Text @@ -175,7 +175,7 @@ instance ToJSON LogMessage where ["contents" .= toJSON bl] DocxParserWarning s -> ["contents" .= s] - TemplateWarning s -> + PowerpointTemplateWarning s -> ["contents" .= s] IgnoredIOError s -> ["contents" .= s] @@ -294,8 +294,8 @@ showLogMessage msg = "Not rendering " <> Text.pack (show bl) DocxParserWarning s -> "Docx parser warning: " <> s - TemplateWarning s -> - "Pptx parser warning: " <> s + PowerpointTemplateWarning s -> + "Powerpoint template warning: " <> s IgnoredIOError s -> "IO Error (ignored): " <> s CouldNotFetchResource fp s -> @@ -391,7 +391,7 @@ messageVerbosity msg = InlineNotRendered{} -> INFO BlockNotRendered{} -> INFO DocxParserWarning{} -> INFO - TemplateWarning{} -> WARNING + PowerpointTemplateWarning{} -> WARNING IgnoredIOError{} -> WARNING CouldNotFetchResource{} -> WARNING CouldNotDetermineImageSize{} -> WARNING diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index a757516a8..feb1c08f5 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -457,7 +457,8 @@ presentationToArchive opts meta pres = do <> "reference doc or in the default " <> "reference doc included with pandoc.")) (Nothing, Just ((element, path, entry) :| _)) -> do - P.logOutput (TemplateWarning ("Couldn't find layout named \"" + P.logOutput (PowerpointTemplateWarning + ("Couldn't find layout named \"" <> layoutTitle <> "\" in provided " <> "reference doc. Falling back to " <> "the default included with pandoc.")) -- cgit v1.2.3 From 2e9a8935fb7e27969f7bd878899382b63cac0b3a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 17 Aug 2021 15:33:10 -0700 Subject: OOXML tests: silence warnings. These can make the test output confusing, making people think tests are failing when they're passing. --- test/Tests/Writers/OOXML.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Tests/Writers/OOXML.hs b/test/Tests/Writers/OOXML.hs index 56a27a4b8..f2957f7a6 100644 --- a/test/Tests/Writers/OOXML.hs +++ b/test/Tests/Writers/OOXML.hs @@ -84,6 +84,7 @@ testArchive writerFn opts fp = do txt <- T.readFile fp bs <- runIOorExplode $ do setTranslations "en-US" + setVerbosity ERROR -- otherwise test output is confusingly noisy readNative def txt >>= writerFn opts return $ toArchive bs -- cgit v1.2.3 From 10dfd81000160f2b48bf9fe47ce4e6441bc1db52 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 17 Aug 2021 15:33:49 -0700 Subject: Document new link-bibliography metadata field. This affects whether hyperlinks are added to the bibliography by citeproc. --- MANUAL.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 0b1424d47..877021cd8 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5655,9 +5655,16 @@ or BibLaTeX (for `--biblatex`) format. A few other metadata fields affect bibliography formatting: `link-citations` -: If true, citations will be - hyperlinked to the corresponding bibliography entries - (for author-date and numerical styles only). +: If true, citations will be hyperlinked to the + corresponding bibliography entries (for author-date and + numerical styles only). Defaults to false. + +`link-bibliography` +: If true, DOIs, PMCIDs, PMID, and URLs in bibliographies will + be rendered as hyperlinks. (If an entry contains a DOI, PMCID, + PMID, or URL, but none of these fields are rendered by the style, + then the title, or in the absence of a title the whole entry, will + be hyperlinked.) Defaults to true. `lang` : The `lang` field will affect how the style is localized, -- cgit v1.2.3 From fd99fe4d7ee5459d32505ef14f4453839cfcefab Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 17 Aug 2021 15:34:23 -0700 Subject: Revise citeproc code to fit new citeproc 0.5 API. Linkification of URLs in the bibliography is now done in the citeproc library, depending on the setting of an option. We set that option depending on the value of the metadata field `link-bibliography` (defaulting to true, for consistency with earlier behavior, though the new behavior includes the CSL draft recommendation of hyperlinking the title or the whole entry if a DOI, PMID, PMCID, or URL field is present but not explicitly rendered). These changes implement the following recommendations from the draft CSL v1.0.2 spec (Appendix VI): > The CSL syntax does not have support for configuration of links. > However, processors should include links on bibliographic references, > using the following rules: > If the bibliography entry for an item renders any of the following > identifiers, the identifier should be anchored as a link, with the > target of the link as follows: > - url: output as is > - doi: prepend with "`https://doi.org/`" > - pmid: prepend with "`https://www.ncbi.nlm.nih.gov/pubmed/`" > - pmcid: prepend with "`https://www.ncbi.nlm.nih.gov/pmc/articles/`" > If the identifier is rendered as a URI, include rendered URI components > (e.g. "`https://doi.org/`") in the link anchor. Do not include any other > affix text in the link anchor (e.g. "Available from: ", "doi: ", "PMID: "). > If the bibliography entry for an item does not render any of > the above identifiers, then set the anchor of the link as the item > title. If title is not rendered, then set the anchor of the link as the > full bibliography entry for the item. Set the target of the link as one > of the following, in order of priority: > > - doi: prepend with "`https://doi.org/`" > - pmcid: prepend with "`https://www.ncbi.nlm.nih.gov/pmc/articles/`" > - pmid: prepend with "`https://www.ncbi.nlm.nih.gov/pubmed/`" > - url: output as is > > If the item data does not include any of the above identifiers, do not > include a link. > > Citation processors should include an option flag for calling > applications to disable bibliography linking behavior. Thanks to Benjamin Bray for getting this all working. --- src/Text/Pandoc/Citeproc.hs | 43 ++++------------------------ src/Text/Pandoc/Citeproc/CslJson.hs | 1 + src/Text/Pandoc/Writers/Powerpoint/Output.hs | 12 ++++---- test/command/pandoc-citeproc-31.md | 5 ++-- test/command/pandoc-citeproc-327.md | 4 +-- test/command/pandoc-citeproc-338.md | 3 +- test/command/pandoc-citeproc-386.md | 4 +-- 7 files changed, 21 insertions(+), 51 deletions(-) diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 39760776d..9a649402e 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -73,7 +73,9 @@ processCitations (Pandoc meta bs) = do let linkCites = maybe False truish $ lookupMeta "link-citations" meta - let opts = defaultCiteprocOptions{ linkCitations = linkCites } + let linkBib = maybe True truish $ lookupMeta "link-bibliography" meta + let opts = defaultCiteprocOptions{ linkCitations = linkCites + , linkBibliography = linkBib } let result = Citeproc.citeproc opts style mblang refs citations mapM_ (report . CiteprocWarning) (resultWarnings result) let sopts = styleOptions style @@ -105,8 +107,7 @@ processCitations (Pandoc meta bs) = do $ cits return $ walk removeQuoteSpan $ Pandoc meta'' - $ insertRefs refkvs classes meta'' - (walk fixLinks $ B.toList bibs) bs' + $ insertRefs refkvs classes meta'' (B.toList bibs) bs' removeQuoteSpan :: Inline -> Inline removeQuoteSpan (Span ("",["csl-quoted"],[]) xs) = Span nullAttr xs @@ -210,7 +211,7 @@ getReferences mblocale (Pandoc meta bs) = do Nothing -> return [] let addQuoteSpan (Quoted _ xs) = Span ("",["csl-quoted"],[]) xs addQuoteSpan x = x - return $ map (linkifyVariables . legacyDateRanges . walk addQuoteSpan) + return $ map (legacyDateRanges . walk addQuoteSpan) (externalRefs ++ inlineRefs) -- note that inlineRefs can override externalRefs @@ -278,7 +279,7 @@ insertResolvedCitations (Cite cs ils) = do [] -> return (Cite cs ils) (x:xs) -> do put xs - return $ Cite cs (walk fixLinks $ B.toList x) + return $ Cite cs (B.toList x) insertResolvedCitations x = return x getCitations :: Locale @@ -419,15 +420,6 @@ mvPunct moveNotes locale (Cite cs ils : Str "." : ys) mvPunct moveNotes locale (x:xs) = x : mvPunct moveNotes locale xs mvPunct _ _ [] = [] --- move https://doi.org etc. prefix inside link text (#6723): -fixLinks :: [Inline] -> [Inline] -fixLinks (Str t : Link attr [Str u1] (u2,tit) : xs) - | u2 == t <> u1 - = Link attr [Str (t <> u1)] (u2,tit) : fixLinks xs -fixLinks (x:xs) = x : fixLinks xs -fixLinks [] = [] - - endWithPunct :: Bool -> [Inline] -> Bool endWithPunct _ [] = False endWithPunct onlyFinal xs@(_:_) = @@ -523,29 +515,6 @@ legacyDateRanges ref = _ -> DateVal d go x = x -linkifyVariables :: Reference Inlines -> Reference Inlines -linkifyVariables ref = - ref{ referenceVariables = M.mapWithKey go $ referenceVariables ref } - where - go "URL" x = tolink "https://" x - go "DOI" x = tolink "https://doi.org/" (fixShortDOI x) - go "ISBN" x = tolink "https://worldcat.org/isbn/" x - go "PMID" x = tolink "https://www.ncbi.nlm.nih.gov/pubmed/" x - go "PMCID" x = tolink "https://www.ncbi.nlm.nih.gov/pmc/articles/" x - go _ x = x - fixShortDOI x = let x' = extractText x - in if "10/" `T.isPrefixOf` x' - then TextVal $ T.drop 3 x' - -- see https://shortdoi.org - else TextVal x' - tolink pref x = let x' = extractText x - x'' = if "://" `T.isInfixOf` x' - then x' - else pref <> x' - in if T.null x' - then x - else FancyVal (B.link x'' "" (B.str x')) - extractText :: Val Inlines -> Text extractText (TextVal x) = x extractText (FancyVal x) = toText x diff --git a/src/Text/Pandoc/Citeproc/CslJson.hs b/src/Text/Pandoc/Citeproc/CslJson.hs index 862af5188..43c1a87ec 100644 --- a/src/Text/Pandoc/Citeproc/CslJson.hs +++ b/src/Text/Pandoc/Citeproc/CslJson.hs @@ -28,6 +28,7 @@ fromCslJson (CslSub x) = B.subscript (fromCslJson x) fromCslJson (CslSup x) = B.superscript (fromCslJson x) fromCslJson (CslNoCase x) = B.spanWith ("",["nocase"],[]) (fromCslJson x) fromCslJson (CslDiv t x) = B.spanWith ("",["csl-" <> t],[]) (fromCslJson x) +fromCslJson (CslLink u x) = B.link u "" (fromCslJson x) cslJsonToReferences :: ByteString -> Either String [Reference Inlines] cslJsonToReferences raw = diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index feb1c08f5..e0eb72161 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -54,7 +54,7 @@ import System.FilePath.Glob import Text.DocTemplates (FromContext(lookupContext), Context) import Text.DocLayout (literal) import Text.TeXMath -import Text.Pandoc.Logging (LogMessage(TemplateWarning)) +import Text.Pandoc.Logging (LogMessage(PowerpointTemplateWarning)) import Text.Pandoc.Writers.Math (convertMath) import Text.Pandoc.Writers.Powerpoint.Presentation import Text.Pandoc.Shared (tshow, stringify) @@ -457,11 +457,11 @@ presentationToArchive opts meta pres = do <> "reference doc or in the default " <> "reference doc included with pandoc.")) (Nothing, Just ((element, path, entry) :| _)) -> do - P.logOutput (PowerpointTemplateWarning - ("Couldn't find layout named \"" - <> layoutTitle <> "\" in provided " - <> "reference doc. Falling back to " - <> "the default included with pandoc.")) + P.report (PowerpointTemplateWarning + ("Couldn't find layout named \"" + <> layoutTitle <> "\" in provided " + <> "reference doc. Falling back to " + <> "the default included with pandoc.")) pure SlideLayout { slElement = element , slPath = path , slEntry = entry diff --git a/test/command/pandoc-citeproc-31.md b/test/command/pandoc-citeproc-31.md index a06b2ae41..91aaa8f0b 100644 --- a/test/command/pandoc-citeproc-31.md +++ b/test/command/pandoc-citeproc-31.md @@ -29,8 +29,9 @@ Foo.[^1] Bar.[^2] Baz.[^3] ::: {#refs .references .csl-bib-body} ::: {#ref-item1 .csl-entry} -Olson HA, 'Codes, Costs, and Critiques: The Organization of Information -in *Library Quarterly*, 1931--2004' (2006) 76 *Library Quarterly* 19 +Olson HA, '[Codes, Costs, and Critiques: The Organization of Information +in *Library Quarterly*, 1931--2004](https://doi.org/10.1086/504343)' +(2006) 76 *Library Quarterly* 19 ::: ::: {#ref-item2 .csl-entry} diff --git a/test/command/pandoc-citeproc-327.md b/test/command/pandoc-citeproc-327.md index 92b29bdf8..5cfd59576 100644 --- a/test/command/pandoc-citeproc-327.md +++ b/test/command/pandoc-citeproc-327.md @@ -44,8 +44,8 @@ I referenced something here^\[1\]^ ::: {#refs .references .csl-bib-body} ::: {#ref-LiLiaoDongWanHaiYuDiQiDongWuCiJiShengChanLiYanJiuJiShengJingGuaYiXingPingJie2017 .csl-entry} [\[1\] ]{.csl-left-margin}[李轶平, 于旭光, 孙明, 等. -辽东湾海域底栖动物次级生产力研究及生境适宜性评价\[J\]. 水产科学, -2017(06): 728--734.]{.csl-right-inline} +[辽东湾海域底栖动物次级生产力研究及生境适宜性评价](http://kns.cnki.net/kns/detail/detail.aspx?QueryID=4&CurRec=4&recid=&FileName=CHAN201706006&DbName=CJFDLAST2018&DbCode=CJFQ&yx=Y&pr=&URLID=21.1110.S.20171129.1725.006)\[J\]. +水产科学, 2017(06): 728--734.]{.csl-right-inline} ::: ::: ``` diff --git a/test/command/pandoc-citeproc-338.md b/test/command/pandoc-citeproc-338.md index 3250b680e..c9cf0d254 100644 --- a/test/command/pandoc-citeproc-338.md +++ b/test/command/pandoc-citeproc-338.md @@ -28,8 +28,7 @@ references: ::: {#ref-item-1 .csl-entry} [Wolfinger, Christine]{.smallcaps}: *Keine Angst vor Linux, Unix: ein Lehrbuch für Linux- und Unix-Anwender*. 11., vollst. überarb. Aufl. -Aufl. Berlin \[u.a.\] : Springer Vieweg, 2013 ---- ISBN [978-3-642-32078-1](https://worldcat.org/isbn/978-3-642-32078-1) +Aufl. Berlin \[u.a.\] : Springer Vieweg, 2013 --- ISBN 978-3-642-32078-1 ::: ::: ``` diff --git a/test/command/pandoc-citeproc-386.md b/test/command/pandoc-citeproc-386.md index 6f346e7db..ae709fc34 100644 --- a/test/command/pandoc-citeproc-386.md +++ b/test/command/pandoc-citeproc-386.md @@ -28,8 +28,8 @@ references: ::: {#refs .references .csl-bib-body line-spacing="2"} ::: {#ref-ding_metallic_2012 .csl-entry} -[\[1\] ]{.csl-left-margin}[K. Ding, C. Z. Ning, *Light Sci. Appl.* -**2012**, *1*, e20.]{.csl-right-inline} +[[\[1\]K. Ding, C. Z. Ning, *Light Sci. Appl.* **2012**, *1*, +e20](https://doi.org/10.1038/lsa.2012.20)]{.csl-left-margin}. ::: ::: ``` -- cgit v1.2.3 From 5616d00d09d3a940364befd380dde328c6ac1a08 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Wed, 18 Aug 2021 10:13:54 +0100 Subject: pptx: Include image title in description The image title (i.e. `![alt text](link "title")`) was previously ignored when writing to pptx. This commit includes it in PowerPoint's description of the image, along with the link (which was already included). Fixes 7352. --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 13 +++++++++---- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 18 ++++++++++-------- test/pptx/images.pptx | Bin 44579 -> 44596 bytes test/pptx/images_deleted_layouts.pptx | Bin 47424 -> 47437 bytes test/pptx/images_moved_layouts.pptx | Bin 58213 -> 58160 bytes test/pptx/images_templated.pptx | Bin 57729 -> 57660 bytes test/pptx/speaker_notes_afterseps.pptx | Bin 51548 -> 51557 bytes .../speaker_notes_afterseps_deleted_layouts.pptx | Bin 54390 -> 54396 bytes .../pptx/speaker_notes_afterseps_moved_layouts.pptx | Bin 65181 -> 65121 bytes test/pptx/speaker_notes_afterseps_templated.pptx | Bin 64695 -> 64619 bytes 10 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index e0eb72161..0e6a67861 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -872,9 +872,10 @@ makePicElements :: PandocMonad m => Element -> PicProps -> MediaInfo + -> Text -> [ParaElem] -> P m [Element] -makePicElements layout picProps mInfo alt = do +makePicElements layout picProps mInfo titleText alt = do opts <- asks envOpts (pageWidth, pageHeight) <- asks envPresentationSize -- hasHeader <- asks envSlideHasHeader @@ -907,7 +908,11 @@ makePicElements layout picProps mInfo alt = do ,("noChangeAspect","1")] () -- cNvPr will contain the link information so we do that separately, -- and register the link if necessary. - let cNvPrAttr = [("descr", T.pack $ mInfoFilePath mInfo), + let description = (if T.null titleText + then "" + else titleText <> "\n\n") + <> T.pack (mInfoFilePath mInfo) + let cNvPrAttr = [("descr", description), ("id","0"), ("name","Picture 1")] cNvPr <- case picPropLink picProps of @@ -1106,11 +1111,11 @@ shapeToElement layout (TextBox paras) shapeToElement _ _ = return $ mknode "p:sp" [] () shapeToElements :: PandocMonad m => Element -> Shape -> P m [Content] -shapeToElements layout (Pic picProps fp alt) = do +shapeToElements layout (Pic picProps fp titleText alt) = do mInfo <- registerMedia fp alt case mInfoExt mInfo of Just _ -> map Elem <$> - makePicElements layout picProps mInfo alt + makePicElements layout picProps mInfo titleText alt Nothing -> shapeToElements layout $ TextBox [Paragraph def alt] shapeToElements layout (GraphicFrame tbls cptn) = map Elem <$> graphicFrameToElements layout tbls cptn diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 9246a93e9..0400783e3 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -197,7 +197,8 @@ data Layout = MetadataSlide [ParaElem] [ParaElem] [[ParaElem]] [ParaElem] -- heading left right deriving (Show, Eq) -data Shape = Pic PicProps FilePath [ParaElem] +data Shape = Pic PicProps FilePath T.Text [ParaElem] + -- title alt-text | GraphicFrame [Graphic] [ParaElem] | TextBox [Paragraph] | RawOOXMLShape T.Text @@ -525,21 +526,22 @@ rowToParagraphs algns tblCells = do mapM (uncurry cellToParagraphs) pairs withAttr :: Attr -> Shape -> Shape -withAttr attr (Pic picPr url caption) = +withAttr attr (Pic picPr url title caption) = let picPr' = picPr { picWidth = dimension Width attr , picHeight = dimension Height attr } in - Pic picPr' url caption + Pic picPr' url title caption withAttr _ sp = sp blockToShape :: Block -> Pres Shape blockToShape (Plain ils) = blockToShape (Para ils) -blockToShape (Para (il:_)) | Image attr ils (url, _) <- il = - withAttr attr . Pic def (T.unpack url) <$> inlinesToParElems ils +blockToShape (Para (il:_)) | Image attr ils (url, title) <- il = + withAttr attr . Pic def (T.unpack url) title <$> inlinesToParElems ils blockToShape (Para (il:_)) | Link _ (il':_) target <- il - , Image attr ils (url, _) <- il' = - withAttr attr . Pic def{picPropLink = Just $ ExternalTarget target} (T.unpack url) + , Image attr ils (url, title) <- il' = + withAttr attr . + Pic def{picPropLink = Just $ ExternalTarget target} (T.unpack url) title <$> inlinesToParElems ils blockToShape (Table _ blkCapt specs thead tbody tfoot) = do let (caption, algn, _, hdrCells, rows) = toLegacyTable blkCapt specs thead tbody tfoot @@ -805,7 +807,7 @@ applyToParagraph f para = do return $ para {paraElems = paraElems'} applyToShape :: Monad m => (ParaElem -> m ParaElem) -> Shape -> m Shape -applyToShape f (Pic pPr fp pes) = Pic pPr fp <$> mapM f pes +applyToShape f (Pic pPr fp title pes) = Pic pPr fp title <$> mapM f pes applyToShape f (GraphicFrame gfx pes) = GraphicFrame gfx <$> mapM f pes applyToShape f (TextBox paras) = TextBox <$> mapM (applyToParagraph f) paras applyToShape _ (RawOOXMLShape str) = return $ RawOOXMLShape str diff --git a/test/pptx/images.pptx b/test/pptx/images.pptx index 670a825de..89325e577 100644 Binary files a/test/pptx/images.pptx and b/test/pptx/images.pptx differ diff --git a/test/pptx/images_deleted_layouts.pptx b/test/pptx/images_deleted_layouts.pptx index 7a38ea625..053928863 100644 Binary files a/test/pptx/images_deleted_layouts.pptx and b/test/pptx/images_deleted_layouts.pptx differ diff --git a/test/pptx/images_moved_layouts.pptx b/test/pptx/images_moved_layouts.pptx index 08d1c27e0..7951a09f6 100644 Binary files a/test/pptx/images_moved_layouts.pptx and b/test/pptx/images_moved_layouts.pptx differ diff --git a/test/pptx/images_templated.pptx b/test/pptx/images_templated.pptx index 48ebf66d6..7c0ed9a17 100644 Binary files a/test/pptx/images_templated.pptx and b/test/pptx/images_templated.pptx differ diff --git a/test/pptx/speaker_notes_afterseps.pptx b/test/pptx/speaker_notes_afterseps.pptx index 13f564bf0..9542fe8b5 100644 Binary files a/test/pptx/speaker_notes_afterseps.pptx and b/test/pptx/speaker_notes_afterseps.pptx differ diff --git a/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx b/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx index 1e7f4968d..9fec1c279 100644 Binary files a/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx and b/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterseps_moved_layouts.pptx b/test/pptx/speaker_notes_afterseps_moved_layouts.pptx index e092ae444..de697cbd8 100644 Binary files a/test/pptx/speaker_notes_afterseps_moved_layouts.pptx and b/test/pptx/speaker_notes_afterseps_moved_layouts.pptx differ diff --git a/test/pptx/speaker_notes_afterseps_templated.pptx b/test/pptx/speaker_notes_afterseps_templated.pptx index 9c22eaf38..5a3d15d57 100644 Binary files a/test/pptx/speaker_notes_afterseps_templated.pptx and b/test/pptx/speaker_notes_afterseps_templated.pptx differ -- cgit v1.2.3 From 5159d6653b0e04f03066a50794bc24195bdf81aa Mon Sep 17 00:00:00 2001 From: William Lupton Date: Thu, 19 Aug 2021 14:18:54 +0100 Subject: Clarify that each YAML block is a separate YAML document --- MANUAL.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MANUAL.txt b/MANUAL.txt index 877021cd8..c94b69289 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -4179,6 +4179,10 @@ A document may contain multiple metadata blocks. If two metadata blocks attempt to set the same field, the value from the second block will be taken. +Each metadata block is handled internally as an independent YAML document. +This means, for example, that any YAML anchors defined in a block cannot be +referenced in another block. + When pandoc is used with `-t markdown` to create a Markdown document, a YAML metadata block will be produced only if the `-s/--standalone` option is used. All of the metadata will appear in a single block -- cgit v1.2.3 From ef4efa5373a419edbb99355808ddc63d35ddef20 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 19 Aug 2021 10:49:20 -0700 Subject: Improve docx reader's robustness in extracting images. The docx reader made a couple assumptions about how docx containers were laid out that were not always true, with the result that some images in documents did not get found/extracted. Closes #7511. --- src/Text/Pandoc/Readers/Docx/Parse.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index dbb16a821..eb048ab14 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -507,9 +507,7 @@ archiveToRelationships archive docXmlPath = filePathIsMedia :: FilePath -> Bool filePathIsMedia fp = - let (dir, _) = splitFileName fp - in - (dir == "word/media/") + "media" `elem` splitPath (takeDirectory fp) lookupLevel :: T.Text -> T.Text -> Numbering -> Maybe Level lookupLevel numId ilvl (Numbering _ numbs absNumbs) = do @@ -774,8 +772,11 @@ expandDrawingId s = do target <- asks (fmap T.unpack . lookupRelationship location s . envRelationships) case target of Just filepath -> do - bytes <- asks (lookup ("word/" ++ filepath) . envMedia) - case bytes of + media <- asks envMedia + let filepath' = case filepath of + ('/':rest) -> rest + _ -> "word/" ++ filepath + case lookup filepath' media of Just bs -> return (filepath, bs) Nothing -> throwError DocxError Nothing -> throwError DocxError -- cgit v1.2.3 From 9879953a4f385be65c0c64d02cd281a4ad676d0d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 19 Aug 2021 22:59:55 -0700 Subject: Update changelog and AUTHORS. --- AUTHORS.md | 6 +++ changelog.md | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 0ed8e62a3..3c1cfa393 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -33,6 +33,7 @@ - Ben Gamari - Ben Steinberg - Beni Cherniavsky-Paskin +- Benjamin Bray - Benoit Schweblin - Bjorn Buckwalter - Blake Eryx @@ -212,6 +213,7 @@ - Nils Carlson - Nixon Enraght-Moony - Nokome Bentley +- OCzarnecki - Ole Martin Ruud - Oliver Matthews - Ophir Lifshitz @@ -224,6 +226,7 @@ - Paul Rivier - Paulo Tanimoto - Pete Ryland +- Peter Fabinksi - Peter Wang - Philip Pesca - Philippe Ombredanne @@ -272,12 +275,14 @@ - Vaibhav Sagar - Vanessa McHale - Vasily Alferov +- Veratyr - Viktor Kronvall - Vincent - Vlad Hanciuta - Wandmalfarbe - Waldir Pimenta - Wikiwide +- William Lupton - Winnie Hellmann - Xavier Olive - Yan Pashkovsky @@ -304,6 +309,7 @@ - lux-lth - lwolfsonkin - mbrackeantidot +- mt_caret - nkalvi - niszet - nuew diff --git a/changelog.md b/changelog.md index 2dfaa9618..9171fe63b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,176 @@ # Revision history for pandoc +## pandoc 2.14.2 (provisional) + + * Allow `--slide-level=0` (#7476). When the slide level is set + to 0, headings won't be used at all in splitting the document + into slides. Horizontal rules must be used to separate slides. + + * Add RTF reader (#3982). `rtf` is now supported as an input + format as well as an output format. New module + Text.Pandoc.Readers.RTF (exporting `readRTF`). [API change] + + * HTML reader: treat commments as blank when parsing (#7482). + + * Markdown reader: + + + Fix raw LaTeX injection issue (#7497). Using a code block + containing `\end{verbatim}`, one could inject raw TeX into a + LaTeX document even when `raw_tex` is disabled. Thanks to + Augustin Laville for noticing the bug. + + Multimarkdown sub- and superscripts (#5512, OCzarnecki). + Added an extension `short_subsuperscripts` which modifies + the behavior of `subscript` and `superscript`, allowing + subscripts or superscripts containing only alphanumerics + to end with a space character (eg. `x^2 = 4` or `H~2 is + combustible`). This improves support for multimarkdown. + + * LaTeX reader: + + + Proper implicit grouping around environment macros. + + Support `\global` before `\def`, `\let`, etc. (#7494). + + Fix scope for LaTeX macros (#7494). They should by default + scope over the group in which they are defined (except `\gdef` + and `\xdef`, which are global). In addition, environments must + be treated as groups. + + Improve handling of plain TeX macro primitives (#7474). + Fixed semantics for `\let`. + + Implement `\edef`, `\gdef`, and `\xdef`. + + * Docx reader: Improve docx reader's robustness in extracting + images (#7511). The docx reader made some assumptions about + how docx containers were laid out that were not always true, with + the result that some images in documents did not get + extracted. + + * LaTeX writer: Increase table column width precision (#7466, + Peter Fabinski). In some cases, the rounding performed by the + LaTeX table writer would introduce visible overrun outside + the text area. This adds two more decimal places to the width + values. + + * Powerpoint writer: + + + Include image title in description (#7352, Emily Bourke). The + image title (i.e. `![alt text](link "title")`) was previously + ignored when writing to pptx. This commit includes it in + PowerPoint's description of the image, along with the link. + + Select layouts from reference doc by name (Emily Bourke). Until + now, users had to make sure that their reference doc contains + layouts in a specific order: the first four layouts in the file + had to have a specific structure. Now the layout selection uses + the layout names rather than order: users must make sure their + reference doc contains four layouts with specific names, and if + a layout with the right name isn’t found pandoc will emit + a warning and use the corresponding layout from the default + reference doc as a fallback. + + * Docx writer: be sensitive to the `native_numbering` extension + (#7499). Figure and table numbers are now only included if + `native_numbering` is enabled. (By default it is disabled.) + This is a behavior change with respect to 2.14.1, but the + default behavior is now that of previous versions. The + change was necessary to avoid incompatibilities between + pandoc's native numbering and third-party cross reference + filters like pandoc-crossref. + + * RTF writer: + + + Omit `\bin` in `\pict`. According to the spec, this is not + needed or wanted when the data is in hexadecimal format, as + here. + + Emit `\outlinelevel`` for section headings. + + * RTF template: specify font family for fixed-width font f1. + According to the spec, this is mandatory. + + * LaTeX writer: Use ulem for underline (#7351). ulem is + conditionally included already when the `strikeout` variable + is set, so we set this when there is underlined text, and use + `\uline` instead of `\underline`. This fixes wrapping for + underlined text. + + * Text.Pandoc.Citeproc: + + + Revise citeproc code to fit new citeproc 0.5 API (thanks to + Benjamin Bray). Linkification of URLs in the bibliography + is now done in the citeproc library, depending on the + setting of an option. We set that option depending on the + value of the metadata field `link-bibliography` (defaulting + to true, for consistency with earlier behavior). If a DOI, + PMID, PMCID, or URL field is present but not explicitly + rendered, the title (or if no title, the whole entry) is + hyperlinked. These changes implement the recommendations + from the draft CSL v1.0.2 spec (Appendix VI): + + + Avoid odd handling of quotes. Recent citeproc changes + allow us to ignore Quoted elements; citeproc now uses its own + method for represented quoted things, and only localizes and + flipflops quotes it adds itself. Convert Quoted in bib + entries to special Spans before passing them off to + citeproc. This ensures that we get proper localization and + flipflopping if, e.g., quotes are used in titles + (jgm/citeproc#87). + + Removed quote localization from citeproc processing. + This is now done in citeproc itself. + + * Text.Pandoc.Logging: Add PowerpointTemplateWarning log message + type [API change] (Emily Bourke). + + * Text.Pandoc.Extension: Add `Ext_short_subsuperscripts` + constructor to `Extension` [API change] (OCzarnecki). + + * Various sample.lua editorial fixes (#7493, #7487, William + Lupton). + + * Bump base-compat version so we get compatibility with base 4.12. + + * Use Prelude from base-compat for ghc 8.4 too. + + * Add haskell-language-server to shell.nix (#7496, Emily Bourke). + + * Tests.Helpers: export testGolden and use it in RTF reader. + This gives a diff output on failure. + + * Remove obsolete and incorrect sentence in `--slide-level` docs. + + * Add internal module Text.Pandoc.Network.HTTP, exporting + `urlEncode`. + + * Text.Pandoc.Parsing: `parseFromString`: preserve at least + the source directory (#7464). Previously we just set the + source name to "chunk" when parsing from strings, to avoid + misleading source positions. This had the side effect that + `rebase_relative_paths` would break inside sections that + were parsed as strings. So, now we use + "ORIGINAL_SOURCE_PATH_chunk" instead of just "chunk". + + * Text.Pandoc.MIME: use image/x-xcf instead of application/x-xcf + (#7454). + + * Don’t compare `cdLine` in OOXML golden tests (Emily Bourke). + The `cdLine` field gives the line of the file some CData was + found on, which reflects irrelevant formatting differences. + + * Provide more detailed XML diff in tests (Emily Bourke). + + * OOXML tests: silence warnings. These can make the test output + confusing, making people think tests are failing when they're + passing. + + * INSTALL.md: Add GitLab CI/CD example (#7448, Veratyr). + + * MANUAL.txt clarifications (William Lupton). + + * Document use of the 'underline' class (#7492, #7484, William + Lupton). + + * Add a FAQ about the "Cannot allocate memory" error on M1 macs. + + * Use released citeproc 0.5. + + * Remove dependency on HTTP package (#7456, mt_caret). + ## pandoc 2.14.1 (2021-07-18) * Text.Pandoc.ImageSize: Add Tiff constructor for ImageType (#7405) -- cgit v1.2.3 From 07d847a9100924e3c9bec1e536e2ad2b4b57162e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 20 Aug 2021 09:54:42 -0700 Subject: RST reader: Fix `:literal:` includes. These should create code blocks, not insert raw RST. Closes #7513. --- src/Text/Pandoc/Readers/RST.hs | 7 ++----- test/command/7436.md | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 3990f0cb5..ff891d3c6 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -466,14 +466,11 @@ includeDirective top fields body = do let classes = maybe [] T.words (lookup "class" fields) let ident = maybe "" trimr $ lookup "name" fields let parser = - case lookup "code" fields of + case lookup "code" fields `mplus` lookup "literal" fields of Just lang -> (codeblock ident classes fields (trimr lang) False . sourcesToText) <$> getInput - Nothing -> - case lookup "literal" fields of - Just _ -> B.rawBlock "rst" . sourcesToText <$> getInput - Nothing -> parseBlocks + Nothing -> parseBlocks let isLiteral = isJust (lookup "code" fields `mplus` lookup "literal" fields) let selectLines = (case trim <$> lookup "end-before" fields of diff --git a/test/command/7436.md b/test/command/7436.md index ad4cb8c2f..fd6e51aa8 100644 --- a/test/command/7436.md +++ b/test/command/7436.md @@ -9,6 +9,6 @@ .. include:: command/three.txt ^D [CodeBlock ("",[""],[("code","")]) "1st line.\n2nd line.\n3rd line.\n" -,RawBlock (Format "rst") "1st line.\n2nd line.\n3rd line.\n" +,CodeBlock ("",[""],[("literal","")]) "1st line.\n2nd line.\n3rd line.\n" ,Para [Str "1st",Space,Str "line.",SoftBreak,Str "2nd",Space,Str "line.",SoftBreak,Str "3rd",Space,Str "line."]] ``` -- cgit v1.2.3 From 13cf02acfd6ddc85bcd1788dc787d35fe92a2010 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 20 Aug 2021 21:43:22 -0700 Subject: MANUAL.txt/security: add a note on security risks of include directives. --- MANUAL.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index c94b69289..62ee9b593 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -6537,21 +6537,26 @@ application, here are some things to keep in mind: writer could in principle do anything on your file system. Please audit filters and custom writers very carefully before using them. -2. If your application uses pandoc as a Haskell library (rather than +2. Several input formats (including HTML, Org, and RST) support `include` + directives that allow the contents of a file to be included in the + output. An untrusted attacker could use these to view the contents of + files on the file system. + +3. If your application uses pandoc as a Haskell library (rather than shelling out to the executable), it is possible to use it in a mode that fully isolates pandoc from your file system, by running the pandoc operations in the `PandocPure` monad. See the document [Using the pandoc API](https://pandoc.org/using-the-pandoc-api.html) for more details. -3. Pandoc's parsers can exhibit pathological performance on some +4. Pandoc's parsers can exhibit pathological performance on some corner cases. It is wise to put any pandoc operations under a timeout, to avoid DOS attacks that exploit these issues. If you are using the pandoc executable, you can add the command line options `+RTS -M512M -RTS` (for example) to limit the heap size to 512MB. -4. The HTML generated by pandoc is not guaranteed to be safe. +5. The HTML generated by pandoc is not guaranteed to be safe. If `raw_html` is enabled for the Markdown input, users can inject arbitrary HTML. Even if `raw_html` is disabled, users can include dangerous content in URLs and attributes. -- cgit v1.2.3 From aa4bd00ec7f4eac58e00af0aee22d771523fb004 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 20 Aug 2021 21:53:55 -0700 Subject: Bump to 2.14.2, update changelog. --- changelog.md | 32 +++++++++++++++++++------------- pandoc.cabal | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/changelog.md b/changelog.md index 9171fe63b..82961ffd2 100644 --- a/changelog.md +++ b/changelog.md @@ -12,18 +12,21 @@ * HTML reader: treat commments as blank when parsing (#7482). - * Markdown reader: - - + Fix raw LaTeX injection issue (#7497). Using a code block - containing `\end{verbatim}`, one could inject raw TeX into a - LaTeX document even when `raw_tex` is disabled. Thanks to - Augustin Laville for noticing the bug. - + Multimarkdown sub- and superscripts (#5512, OCzarnecki). - Added an extension `short_subsuperscripts` which modifies - the behavior of `subscript` and `superscript`, allowing - subscripts or superscripts containing only alphanumerics - to end with a space character (eg. `x^2 = 4` or `H~2 is - combustible`). This improves support for multimarkdown. + * Markdown reader: + + + Fix raw LaTeX injection issue (#7497). Using a code block + containing `\end{verbatim}`, one could inject raw TeX into a + LaTeX document even when `raw_tex` is disabled. Thanks to + Augustin Laville for noticing the bug. + + Multimarkdown sub- and superscripts (#5512, OCzarnecki). + Added an extension `short_subsuperscripts` which modifies + the behavior of `subscript` and `superscript`, allowing + subscripts or superscripts containing only alphanumerics + to end with a space character (eg. `x^2 = 4` or `H~2 is + combustible`). This improves support for multimarkdown. + + * RST reader: Fix `:literal:` includes (#7513). These should create + code blocks, not insert raw RST. * LaTeX reader: @@ -160,7 +163,10 @@ * INSTALL.md: Add GitLab CI/CD example (#7448, Veratyr). - * MANUAL.txt clarifications (William Lupton). + * MANUAL.txt + + - Clarifications (William Lupton). + - Add a note on security risks of include directives. * Document use of the 'underline' class (#7492, #7484, William Lupton). diff --git a/pandoc.cabal b/pandoc.cabal index fb7da0a05..d924169e6 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: pandoc -version: 2.14.1 +version: 2.14.2 build-type: Simple license: GPL-2.0-or-later license-file: COPYING.md -- cgit v1.2.3 From 9b8a6917822da3dae933e9de74354fbe9484b2bd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 20 Aug 2021 21:56:32 -0700 Subject: Update manual date and man page. --- MANUAL.txt | 2 +- man/pandoc.1 | 105 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 89 insertions(+), 18 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 62ee9b593..c8a2b66be 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1,7 +1,7 @@ --- title: Pandoc User's Guide author: John MacFarlane -date: July 18, 2021 +date: August 20, 2021 --- # Synopsis diff --git a/man/pandoc.1 b/man/pandoc.1 index 59888e26a..a0092b385 100644 --- a/man/pandoc.1 +++ b/man/pandoc.1 @@ -1,7 +1,7 @@ '\" t .\" Automatically generated by Pandoc 2.14.1 .\" -.TH "Pandoc User\[cq]s Guide" "" "July 18, 2021" "pandoc 2.14.1" "" +.TH "Pandoc User\[cq]s Guide" "" "July 18, 2021" "pandoc 2.14.2" "" .hy .SH NAME pandoc - general markup converter @@ -291,6 +291,8 @@ if you need extensions not supported in \f[C]gfm\f[R]. .IP \[bu] 2 \f[C]org\f[R] (Emacs Org mode) .IP \[bu] 2 +\f[C]rtf\f[R] (Rich Text Format) +.IP \[bu] 2 \f[C]rst\f[R] (reStructuredText) .IP \[bu] 2 \f[C]t2t\f[R] (txt2tags) @@ -1059,10 +1061,13 @@ Specifies that headings with the specified level create slides (for Headings above this level in the hierarchy are used to divide the slide show into sections; headings below this level create subheads within a slide. -Note that content that is not contained under slide-level headings will -not appear in the slide show. -The default is to set the slide level based on the contents of the -document; see Structuring the slide show. +Valid values are 0-6. +If a slide level of 0 is specified, slides will not be split +automatically on headings, and horizontal rules must be used to indicate +slide boundaries. +If a slide level is not specified explicitly, the slide level will be +set automatically based on the contents of the document; see Structuring +the slide show. .TP \f[B]\f[CB]--section-divs\f[B]\f[R] Wrap sections in \f[C]
\f[R] tags (or \f[C]
\f[R] tags for @@ -1234,17 +1239,22 @@ Templates included with Microsoft PowerPoint 2013 (either with most templates derived from these. .RS .PP -The specific requirement is that the template should begin with the -following first four layouts: -.IP "1." 3 +The specific requirement is that the template should contain layouts +with the following names (as seen within PowerPoint): +.IP \[bu] 2 Title Slide -.IP "2." 3 +.IP \[bu] 2 Title and Content -.IP "3." 3 +.IP \[bu] 2 Section Header -.IP "4." 3 +.IP \[bu] 2 Two Content .PP +For each name, the first layout found with that name will be used. +If no layout is found with one of the names, pandoc will output a +warning and use the layout with that name from the default reference doc +instead. +.PP All templates included with a recent version of MS PowerPoint will fit these criteria. (You can click on \f[C]Layout\f[R] under the \f[C]Home\f[R] menu to @@ -3427,7 +3437,7 @@ Enumeration starts at 1. This extension can be enabled/disabled for the following formats: .TP output formats -\f[C]odt\f[R], \f[C]opendocument\f[R] +\f[C]odt\f[R], \f[C]opendocument\f[R], \f[C]docx\f[R] .SS Extension: \f[C]xrefs_name\f[R] .PP Links to headings, figures and tables inside the document are @@ -4789,6 +4799,11 @@ A document may contain multiple metadata blocks. If two metadata blocks attempt to set the same field, the value from the second block will be taken. .PP +Each metadata block is handled internally as an independent YAML +document. +This means, for example, that any YAML anchors defined in a block cannot +be referenced in another block. +.PP When pandoc is used with \f[C]-t markdown\f[R] to create a Markdown document, a YAML metadata block will be produced only if the \f[C]-s/--standalone\f[R] option is used. @@ -5084,6 +5099,26 @@ blocks: \[ga]<$>\[ga]{.haskell} \f[R] .fi +.SS Underline +.PP +To underline text, use the \f[C]underline\f[R] class: +.IP +.nf +\f[C] +[Underline]{.underline} +\f[R] +.fi +.PP +Or, without the \f[C]bracketed_spans\f[R] extension (but with +\f[C]native_spans\f[R]): +.IP +.nf +\f[C] +Underline +\f[R] +.fi +.PP +This will work in all output formats that support underline. .SS Small caps .PP To write small caps, use the \f[C]smallcaps\f[R] class: @@ -5823,14 +5858,16 @@ See the CSL user documentation for more information about CSL styles and how they affect rendering. .PP Unless a citation key start with a letter, digit, or \f[C]_\f[R], and -contains only alphanumerics and internal punctuation characters +contains only alphanumerics and single internal punctuation characters (\f[C]:.#$%&-+?<>\[ti]/\f[R]), it must be surrounded by curly braces, which are not considered part of the key. -In \f[C]\[at]Foo_bar.baz.\f[R], the key is \f[C]Foo_bar.baz\f[R]. -The final period is not \f[I]internal\f[R] punctuation, so it is not +In \f[C]\[at]Foo_bar.baz.\f[R], the key is \f[C]Foo_bar.baz\f[R] because +the final period is not \f[I]internal\f[R] punctuation, so it is not included in the key. In \f[C]\[at]{Foo_bar.baz.}\f[R], the key is \f[C]Foo_bar.baz.\f[R], including the final period. +In \f[C]\[at]Foo_bar--baz\f[R], the key is \f[C]Foo_bar\f[R] because the +repeated internal punctuation characters terminate the key. The curly braces are recommended if you use URLs as keys: \f[C][\[at]{https://example.com/bib?name=foobar&date=2000}, p. 33]\f[R]. .PP @@ -6147,6 +6184,26 @@ Include source position attributes when parsing \f[C]commonmark\f[R]. For elements that accept attributes, a \f[C]data-pos\f[R] attribute is added; other elements are placed in a surrounding Div or Span elemnet with a \f[C]data-pos\f[R] attribute. +.SS Extension: \f[C]short_subsuperscript\f[R] +.PP +Parse multimarkdown style subscripts and superscripts, which start with +a `\[ti]' or `\[ha]' character, respectively, and include the +alphanumeric sequence that follows. +For example: +.IP +.nf +\f[C] +x\[ha]2 = 4 +\f[R] +.fi +.PP +or +.IP +.nf +\f[C] +Oxygen is O\[ti]2. +\f[R] +.fi .SS Markdown variants .PP In addition to pandoc\[cq]s extended Markdown, the following Markdown @@ -6588,6 +6645,14 @@ A few other metadata fields affect bibliography formatting: \f[B]\f[CB]link-citations\f[B]\f[R] If true, citations will be hyperlinked to the corresponding bibliography entries (for author-date and numerical styles only). +Defaults to false. +.TP +\f[B]\f[CB]link-bibliography\f[B]\f[R] +If true, DOIs, PMCIDs, PMID, and URLs in bibliographies will be rendered +as hyperlinks. +(If an entry contains a DOI, PMCID, PMID, or URL, but none of these +fields are rendered by the style, then the title, or in the absence of a +title the whole entry, will be hyperlinked.) Defaults to true. .TP \f[B]\f[CB]lang\f[B]\f[R] The \f[C]lang\f[R] field will affect how the style is localized, for @@ -7699,12 +7764,18 @@ principle do anything on your file system. Please audit filters and custom writers very carefully before using them. .IP "2." 3 +Several input formats (including HTML, Org, and RST) support +\f[C]include\f[R] directives that allow the contents of a file to be +included in the output. +An untrusted attacker could use these to view the contents of files on +the file system. +.IP "3." 3 If your application uses pandoc as a Haskell library (rather than shelling out to the executable), it is possible to use it in a mode that fully isolates pandoc from your file system, by running the pandoc operations in the \f[C]PandocPure\f[R] monad. See the document Using the pandoc API for more details. -.IP "3." 3 +.IP "4." 3 Pandoc\[cq]s parsers can exhibit pathological performance on some corner cases. It is wise to put any pandoc operations under a timeout, to avoid DOS @@ -7712,7 +7783,7 @@ attacks that exploit these issues. If you are using the pandoc executable, you can add the command line options \f[C]+RTS -M512M -RTS\f[R] (for example) to limit the heap size to 512MB. -.IP "4." 3 +.IP "5." 3 The HTML generated by pandoc is not guaranteed to be safe. If \f[C]raw_html\f[R] is enabled for the Markdown input, users can inject arbitrary HTML. -- cgit v1.2.3 From dc961ca1b49d7f3109174b07910eeb6126fa5dc3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 20 Aug 2021 22:05:44 -0700 Subject: Fix typo in changelog. --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 82961ffd2..f9a2b0c27 100644 --- a/changelog.md +++ b/changelog.md @@ -10,7 +10,7 @@ format as well as an output format. New module Text.Pandoc.Readers.RTF (exporting `readRTF`). [API change] - * HTML reader: treat commments as blank when parsing (#7482). + * HTML reader: treat comments as blank when parsing (#7482). * Markdown reader: -- cgit v1.2.3 From a7d2559742ad449f80b182f9ad86129d7160266f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 20 Aug 2021 22:08:19 -0700 Subject: Add note to changelog. --- changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.md b/changelog.md index f9a2b0c27..b0bde683a 100644 --- a/changelog.md +++ b/changelog.md @@ -173,6 +173,8 @@ * Add a FAQ about the "Cannot allocate memory" error on M1 macs. + * Use texmath 0.12.3.1. + * Use released citeproc 0.5. * Remove dependency on HTTP package (#7456, mt_caret). -- cgit v1.2.3 From d05460d00d7c9af3b4913f1760ea385a7d855d84 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 21 Aug 2021 09:25:51 -0700 Subject: Regenerate README.md. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d72e86305..c9866b894 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,8 @@ library. It can convert *from* - `odt` ([ODT](https://en.wikipedia.org/wiki/OpenDocument)) - `opml` ([OPML](http://dev.opml.org/spec2.html)) - `org` ([Emacs Org mode](https://orgmode.org)) +- `rtf` ([Rich Text + Format](https://en.wikipedia.org/wiki/Rich_Text_Format)) - `rst` ([reStructuredText](https://docutils.sourceforge.io/docs/ref/rst/introduction.html)) - `t2t` ([txt2tags](https://txt2tags.org)) -- cgit v1.2.3 From 591cdca38b8af5a50a4e121b34d87f3c9bca5844 Mon Sep 17 00:00:00 2001 From: Simon Schuster Date: Fri, 20 Aug 2021 16:41:50 +0200 Subject: LaTeX-parser: restrict \endinput to current file --- pandoc.cabal | 1 + src/Text/Pandoc/Readers/LaTeX.hs | 6 +++++- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 4 ++++ test/command/bar-endinput.tex | 3 +++ test/command/input-with-endinput.md | 14 ++++++++++++++ 5 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test/command/bar-endinput.tex create mode 100644 test/command/input-with-endinput.md diff --git a/pandoc.cabal b/pandoc.cabal index d924169e6..b90a61942 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -242,6 +242,7 @@ extra-source-files: test/command/sub-file-chapter-1.tex test/command/sub-file-chapter-2.tex test/command/bar.tex + test/command/bar-endinput.tex test/command/yaml-metadata.yaml test/command/3510-subdoc.org test/command/3510-export.latex diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 31c8d9095..5d3ff5f95 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -890,7 +890,7 @@ blockCommands = M.fromList addMeta "bibliography" . splitBibs . untokenize)) , ("addbibresource", mempty <$ (skipopts *> braced >>= addMeta "bibliography" . splitBibs . untokenize)) - , ("endinput", mempty <$ skipMany anyTok) + , ("endinput", mempty <$ skipSameFileToks) -- includes , ("lstinputlisting", inputListing) , ("inputminted", inputMinted) @@ -921,6 +921,10 @@ blockCommands = M.fromList , ("epigraph", epigraph) ] +skipSameFileToks :: PandocMonad m => LP m () +skipSameFileToks = do + pos <- getPosition + skipMany $ infile (sourceName pos) environments :: PandocMonad m => M.Map Text (LP m Blocks) environments = M.union (tableEnvironments blocks inline) $ diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 075e1f656..9b84cdd21 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -45,6 +45,7 @@ module Text.Pandoc.Readers.LaTeX.Parsing , isNewlineTok , isWordTok , isArgTok + , infile , spaces , spaces1 , tokTypeIn @@ -646,6 +647,9 @@ isArgTok :: Tok -> Bool isArgTok (Tok _ (Arg _) _) = True isArgTok _ = False +infile :: PandocMonad m => SourceName -> LP m Tok +infile reference = satisfyTok (\(Tok source _ _) -> (sourceName source) == reference) + spaces :: PandocMonad m => LP m () spaces = skipMany (satisfyTok (tokTypeIn [Comment, Spaces, Newline])) diff --git a/test/command/bar-endinput.tex b/test/command/bar-endinput.tex new file mode 100644 index 000000000..2f3f9bd6c --- /dev/null +++ b/test/command/bar-endinput.tex @@ -0,0 +1,3 @@ +\emph{hi there} +\endinput +\emph{invisible} diff --git a/test/command/input-with-endinput.md b/test/command/input-with-endinput.md new file mode 100644 index 000000000..df0475a15 --- /dev/null +++ b/test/command/input-with-endinput.md @@ -0,0 +1,14 @@ +``` +% pandoc --from=latex -t native +\begin{document} +Visible + +\include{command/bar-endinput} + +Visible +\end{document} +^D +[Para [Str "Visible"] +,Para [Emph [Str "hi",Space,Str "there"]] +,Para [Str "Visible"]] +``` -- cgit v1.2.3 From 607d71662416786d716e4e93bfbb611851531ae7 Mon Sep 17 00:00:00 2001 From: Salim B Date: Sun, 22 Aug 2021 10:54:21 +0000 Subject: Harmonize spelling of 'slide show' --- MANUAL.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index c8a2b66be..a61c8ca09 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5998,13 +5998,13 @@ the [Beamer User's Guide] may also be used: `allowdisplaybreaks`, ## Background in reveal.js and beamer -Background images can be added to self-contained reveal.js slideshows and -to beamer slideshows. +Background images can be added to self-contained reveal.js slide shows and +to beamer slide shows. For the same image on every slide, use the configuration option `background-image` either in the YAML metadata block or as a command-line variable. (There are no other options in -beamer and the rest of this section concerns reveal.js slideshows.) +beamer and the rest of this section concerns reveal.js slide shows.) For reveal.js, you can instead use the reveal.js-native option `parallaxBackgroundImage`. You can also set `parallaxBackgroundHorizontal` @@ -6033,7 +6033,7 @@ For example in reveal.js: ``` --- -title: My Slideshow +title: My Slide Show parallaxBackgroundImage: /path/to/my/background_image.png title-slide-attributes: data-background-image: /path/to/title_image.png -- cgit v1.2.3 From 03b50c0f78ecdebf91a0dac76ccd07b547ff3d27 Mon Sep 17 00:00:00 2001 From: Salim B Date: Sun, 22 Aug 2021 11:13:39 +0000 Subject: Add some more info regarding `--slide-level=0` --- MANUAL.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index a61c8ca09..bc17763bc 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5781,8 +5781,8 @@ By default, the *slide level* is the highest heading level in the hierarchy that is followed immediately by content, and not another heading, somewhere in the document. In the example above, level-1 headings are always followed by level-2 headings, which are followed by content, -so the slide level is 2. This default can be overridden using -the `--slide-level` option. +so the slide level is 2. This default can be overridden using the +`--slide-level` option. The document is carved up into slides according to the following rules: @@ -5806,19 +5806,20 @@ rules: subsequent slide with the same title (for beamer). * A title page is constructed automatically from the document's title - block, if present. (In the case of beamer, this can be disabled + block, if present. (In the case of beamer, this can be disabled by commenting out some lines in the default template.) These rules are designed to support many different styles of slide show. If you don't care about structuring your slides into sections and subsections, -you can just use level-1 headings for all each slide. (In that case, level-1 -will be the slide level.) But you can also structure the slide show into -sections, as in the example above. +you can either just use level-1 headings for all slides (in that case, level 1 +will be the slide level) or you can set `--slide-level=0`. Note: in reveal.js slide shows, if slide level is 2, a two-dimensional layout will be produced, with level-1 headings building horizontally -and level-2 headings building vertically. It is not recommended that -you use deeper nesting of section levels with reveal.js. +and level-2 headings building vertically. It is not recommended that +you use deeper nesting of section levels with reveal.js unless you set +`--slide-level=0` (which lets reveal.js produce a one-dimensional layout +and only interprets horizontal rules as slide boundaries). ## Incremental lists -- cgit v1.2.3 From 10a71c484fd5f878730047f1dd6a4ee881f2dee2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 21 Aug 2021 15:23:42 -0700 Subject: App: Move output-file writing out of PandocMonad action. --- src/Text/Pandoc/App.hs | 58 +++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 98b072ffb..5696156ad 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -95,33 +95,15 @@ convertWithOpts opts = do Just xs | not (optIgnoreArgs opts) -> xs _ -> ["-"] - let runIO' :: PandocIO a -> IO a - runIO' f = do - (res, reports) <- runIOorExplode $ do - setTrace (optTrace opts) - setVerbosity verbosity - x <- f - rs <- getLog - return (x, rs) - case optLogFile opts of - Nothing -> return () - Just logfile -> BL.writeFile logfile (encodeLogMessages reports) - let isWarning msg = messageVerbosity msg == WARNING - when (optFailIfWarnings opts && any isWarning reports) $ - E.throwIO PandocFailOnWarningError - return res - - let eol = case optEol opts of - CRLF -> IO.CRLF - LF -> IO.LF - Native -> nativeNewline #ifdef _WINDOWS let istty = True #else istty <- liftIO $ queryTerminal stdOutput #endif - runIO' $ do + (output, reports) <- runIOorExplode $ do + setTrace (optTrace opts) + setVerbosity verbosity setUserDataDir datadir setResourcePath (optResourcePath opts) @@ -305,14 +287,14 @@ convertWithOpts opts = do >=> maybe return extractMedia (optExtractMedia opts) ) - case writer of - ByteStringWriter f -> f writerOptions doc >>= writeFnBinary outputFile + output <- case writer of + ByteStringWriter f -> BinaryOutput <$> f writerOptions doc TextWriter f -> case outputPdfProgram outputSettings of Just pdfProg -> do res <- makePDF pdfProg (optPdfEngineOpts opts) f writerOptions doc case res of - Right pdf -> writeFnBinary outputFile pdf + Right pdf -> return $ BinaryOutput pdf Left err' -> throwError $ PandocPDFError $ TL.toStrict (TE.decodeUtf8With TE.lenientDecode err') @@ -321,11 +303,29 @@ convertWithOpts opts = do | standalone = t | T.null t || T.last t /= '\n' = t <> T.singleton '\n' | otherwise = t - output <- ensureNl <$> f writerOptions doc - writerFn eol outputFile =<< - if optSelfContained opts && htmlFormat format - then makeSelfContained output - else return output + textOutput <- ensureNl <$> f writerOptions doc + if optSelfContained opts && htmlFormat format + then TextOutput <$> makeSelfContained textOutput + else return $ TextOutput textOutput + reports <- getLog + return (output, reports) + + case optLogFile opts of + Nothing -> return () + Just logfile -> BL.writeFile logfile (encodeLogMessages reports) + let isWarning msg = messageVerbosity msg == WARNING + when (optFailIfWarnings opts && any isWarning reports) $ + E.throwIO PandocFailOnWarningError + let eol = case optEol opts of + CRLF -> IO.CRLF + LF -> IO.LF + Native -> nativeNewline + case output of + TextOutput t -> writerFn eol outputFile t + BinaryOutput bs -> writeFnBinary outputFile bs + +data PandocOutput = TextOutput Text | BinaryOutput BL.ByteString + deriving (Show) type Transform = Pandoc -> Pandoc -- cgit v1.2.3 From aabcee60022c1bc0e81505403dc43ded2e99be4e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 08:45:36 -0700 Subject: MANUAL: document error code 25 --- MANUAL.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/MANUAL.txt b/MANUAL.txt index bc17763bc..a3e2b4c33 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1472,6 +1472,7 @@ Nonzero exit codes have the following meanings: 22 PandocUnknownWriterError 23 PandocUnsupportedExtensionError 24 PandocCiteprocError + 25 PandocBibliographyError 31 PandocEpubSubdirectoryError 43 PandocPDFError 44 PandocXMLError -- cgit v1.2.3 From d37dea9eeb788f53cdde386dba812a965539132a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 18:35:28 -0700 Subject: PandocIO: derive MonadCatch, MonadThrow, MonadMask. This will allow us to use withTempDir. --- src/Text/Pandoc/Class/PandocIO.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Text/Pandoc/Class/PandocIO.hs b/src/Text/Pandoc/Class/PandocIO.hs index 63cb94155..0e5247ff9 100644 --- a/src/Text/Pandoc/Class/PandocIO.hs +++ b/src/Text/Pandoc/Class/PandocIO.hs @@ -29,6 +29,7 @@ import Text.Pandoc.Class.PandocMonad import Text.Pandoc.Definition import Text.Pandoc.Error import qualified Text.Pandoc.Class.IO as IO +import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow) -- | Evaluate a 'PandocIO' operation. runIO :: PandocIO a -> IO (Either PandocError a) @@ -45,6 +46,9 @@ newtype PandocIO a = PandocIO { , Functor , Applicative , Monad + , MonadCatch + , MonadMask + , MonadThrow , MonadError PandocError ) -- cgit v1.2.3 From 5a23f8ff3eaa4051da3371da50a11b601f27d889 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 19:00:43 -0700 Subject: Clean up PDF module. Previously we had to run runIOorExplode inside withTempDir. Now that PandocIO is an instance of MonadMask, this is no longer necessary. --- src/Text/Pandoc/PDF.hs | 108 ++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 59 deletions(-) diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs index c4e30af34..2953b084c 100644 --- a/src/Text/Pandoc/PDF.hs +++ b/src/Text/Pandoc/PDF.hs @@ -2,6 +2,7 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE FlexibleContexts #-} {- | Module : Text.Pandoc.PDF Copyright : Copyright (C) 2012-2021 John MacFarlane @@ -54,9 +55,8 @@ import Text.Pandoc.Writers.Shared (getField, metaToContext) import Data.List (intercalate) #endif import Data.List (isPrefixOf, find) -import Text.Pandoc.Class.PandocIO (PandocIO, extractMedia, runIOorExplode) -import Text.Pandoc.Class.PandocMonad (fillMediaBag, getCommonState, getVerbosity, - putCommonState, report, setVerbosity) +import Text.Pandoc.Class.PandocIO (PandocIO, extractMedia) +import Text.Pandoc.Class.PandocMonad (fillMediaBag, getVerbosity, report) import Text.Pandoc.Logging #ifdef _WINDOWS @@ -86,50 +86,42 @@ makePDF program pdfargs writer opts doc = source <- writer opts doc let args = ["-ms", "-mpdfmark", "-mspdf", "-e", "-t", "-k", "-KUTF-8", "-i"] ++ pdfargs - verbosity <- getVerbosity - liftIO $ generic2pdf verbosity program args source + generic2pdf program args source baseProg -> do - commonState <- getCommonState - verbosity <- getVerbosity -- latex has trouble with tildes in paths, which -- you find in Windows temp dir paths with longer -- user names (see #777) - let withTempDir templ action = do - tmp <- getTemporaryDirectory - uname <- E.catch + let withTempDir :: FilePath -> (FilePath -> PandocIO a) -> PandocIO a + withTempDir templ action = do + tmp <- liftIO getTemporaryDirectory + uname <- liftIO $ E.catch (do (ec, sout, _) <- readProcessWithExitCode "uname" ["-o"] "" if ec == ExitSuccess then return $ Just $ filter (not . isSpace) sout else return Nothing) - (\(_ :: E.SomeException) -> return Nothing) + (\(_ :: E.SomeException) -> return Nothing) if '~' `elem` tmp || uname == Just "Cygwin" -- see #5451 then withTempDirectory "." templ action else withSystemTempDirectory templ action - (newCommonState, res) <- liftIO $ withTempDir "tex2pdf." $ \tmpdir' -> do + withTempDir "tex2pdf." $ \tmpdir' -> do #ifdef _WINDOWS -- note: we want / even on Windows, for TexLive let tmpdir = changePathSeparators tmpdir' #else let tmpdir = tmpdir' #endif - runIOorExplode $ do - putCommonState commonState - doc' <- handleImages opts tmpdir doc - source <- writer opts{ writerExtensions = -- disable use of quote - -- ligatures to avoid bad ligatures like ?` - disableExtension Ext_smart - (writerExtensions opts) } doc' - res <- case baseProg of - "context" -> context2pdf verbosity program pdfargs tmpdir source - "tectonic" -> tectonic2pdf verbosity program pdfargs tmpdir source - prog | prog `elem` ["pdflatex", "lualatex", "xelatex", "latexmk"] - -> tex2pdf verbosity program pdfargs tmpdir source - _ -> return $ Left $ UTF8.fromStringLazy - $ "Unknown program " ++ program - cs <- getCommonState - return (cs, res) - putCommonState newCommonState - return res + doc' <- handleImages opts tmpdir doc + source <- writer opts{ writerExtensions = -- disable use of quote + -- ligatures to avoid bad ligatures like ?` + disableExtension Ext_smart + (writerExtensions opts) } doc' + case baseProg of + "context" -> context2pdf program pdfargs tmpdir source + "tectonic" -> tectonic2pdf program pdfargs tmpdir source + prog | prog `elem` ["pdflatex", "lualatex", "xelatex", "latexmk"] + -> tex2pdf program pdfargs tmpdir source + _ -> return $ Left $ UTF8.fromStringLazy + $ "Unknown program " ++ program makeWithWkhtmltopdf :: String -- ^ wkhtmltopdf or path -> [String] -- ^ arguments @@ -221,33 +213,30 @@ convertImage opts tmpdir fname = do mime = getMimeType fname doNothing = return (Right fname) -tectonic2pdf :: Verbosity -- ^ Verbosity level - -> String -- ^ tex program +tectonic2pdf :: String -- ^ tex program -> [String] -- ^ Arguments to the latex-engine -> FilePath -- ^ temp directory for output -> Text -- ^ tex source -> PandocIO (Either ByteString ByteString) -tectonic2pdf verbosity program args tmpDir source = do - (exit, log', mbPdf) <- runTectonic verbosity program args tmpDir source +tectonic2pdf program args tmpDir source = do + (exit, log', mbPdf) <- runTectonic program args tmpDir source case (exit, mbPdf) of (ExitFailure _, _) -> return $ Left $ extractMsg log' (ExitSuccess, Nothing) -> return $ Left "" (ExitSuccess, Just pdf) -> do - missingCharacterWarnings verbosity log' + missingCharacterWarnings log' return $ Right pdf -tex2pdf :: Verbosity -- ^ Verbosity level - -> String -- ^ tex program +tex2pdf :: String -- ^ tex program -> [String] -- ^ Arguments to the latex-engine -> FilePath -- ^ temp directory for output -> Text -- ^ tex source -> PandocIO (Either ByteString ByteString) -tex2pdf verbosity program args tmpDir source = do +tex2pdf program args tmpDir source = do let numruns | takeBaseName program == "latexmk" = 1 | "\\tableofcontents" `T.isInfixOf` source = 3 -- to get page numbers | otherwise = 2 -- 1 run won't give you PDF bookmarks - (exit, log', mbPdf) <- runTeXProgram verbosity program args numruns - tmpDir source + (exit, log', mbPdf) <- runTeXProgram program args numruns tmpDir source case (exit, mbPdf) of (ExitFailure _, _) -> do let logmsg = extractMsg log' @@ -260,11 +249,11 @@ tex2pdf verbosity program args tmpDir source = do return $ Left $ logmsg <> extramsg (ExitSuccess, Nothing) -> return $ Left "" (ExitSuccess, Just pdf) -> do - missingCharacterWarnings verbosity log' + missingCharacterWarnings log' return $ Right pdf -missingCharacterWarnings :: Verbosity -> ByteString -> PandocIO () -missingCharacterWarnings verbosity log' = do +missingCharacterWarnings :: ByteString -> PandocIO () +missingCharacterWarnings log' = do let ls = BC.lines log' let isMissingCharacterWarning = BC.isPrefixOf "Missing character: " let toCodePoint c @@ -275,7 +264,6 @@ missingCharacterWarnings verbosity log' = do | l <- ls , isMissingCharacterWarning l ] - setVerbosity verbosity mapM_ (report . MissingCharacter) warnings -- parsing output @@ -299,9 +287,9 @@ extractConTeXtMsg log' = do -- running tex programs -runTectonic :: Verbosity -> String -> [String] -> FilePath +runTectonic :: String -> [String] -> FilePath -> Text -> PandocIO (ExitCode, ByteString, Maybe ByteString) -runTectonic verbosity program args' tmpDir' source = do +runTectonic program args' tmpDir' source = do let getOutDir acc (a:b:xs) = if a `elem` ["-o", "--outdir"] then (reverse acc ++ xs, Just b) else getOutDir (b:a:acc) xs @@ -313,6 +301,7 @@ runTectonic verbosity program args' tmpDir' source = do let sourceBL = BL.fromStrict $ UTF8.fromText source let programArgs = ["--outdir", tmpDir] ++ args ++ ["-"] env <- liftIO getEnvironment + verbosity <- getVerbosity when (verbosity >= INFO) $ liftIO $ showVerboseInfo (Just tmpDir) program programArgs env (utf8ToText sourceBL) @@ -353,9 +342,9 @@ getResultingPDF logFile pdfFile = do -- Run a TeX program on an input bytestring and return (exit code, -- contents of stdout, contents of produced PDF if any). Rerun -- a fixed number of times to resolve references. -runTeXProgram :: Verbosity -> String -> [String] -> Int -> FilePath +runTeXProgram :: String -> [String] -> Int -> FilePath -> Text -> PandocIO (ExitCode, ByteString, Maybe ByteString) -runTeXProgram verbosity program args numRuns tmpDir' source = do +runTeXProgram program args numRuns tmpDir' source = do let isOutdirArg x = "-outdir=" `isPrefixOf` x || "-output-directory=" `isPrefixOf` x let tmpDir = @@ -378,6 +367,7 @@ runTeXProgram verbosity program args numRuns tmpDir' source = do ("TEXMFOUTPUT", tmpDir) : [(k,v) | (k,v) <- env' , k /= "TEXINPUTS" && k /= "TEXMFOUTPUT"] + verbosity <- getVerbosity when (verbosity >= INFO) $ liftIO $ UTF8.readFile file >>= showVerboseInfo (Just tmpDir) program programArgs env'' @@ -398,16 +388,16 @@ runTeXProgram verbosity program args numRuns tmpDir' source = do return (exit, fromMaybe out log', pdf) runTeX 1 -generic2pdf :: Verbosity - -> String +generic2pdf :: String -> [String] -> Text - -> IO (Either ByteString ByteString) -generic2pdf verbosity program args source = do - env' <- getEnvironment + -> PandocIO (Either ByteString ByteString) +generic2pdf program args source = do + env' <- liftIO getEnvironment + verbosity <- getVerbosity when (verbosity >= INFO) $ - showVerboseInfo Nothing program args env' source - (exit, out) <- E.catch + liftIO $ showVerboseInfo Nothing program args env' source + (exit, out) <- liftIO $ E.catch (pipeProcess (Just env') program args (BL.fromStrict $ UTF8.fromText source)) (handlePDFProgramNotFound program) @@ -454,19 +444,19 @@ html2pdf verbosity program args source = (ExitSuccess, Nothing) -> Left "" (ExitSuccess, Just pdf) -> Right pdf -context2pdf :: Verbosity -- ^ Verbosity level - -> String -- ^ "context" or path to it +context2pdf :: String -- ^ "context" or path to it -> [String] -- ^ extra arguments -> FilePath -- ^ temp directory for output -> Text -- ^ ConTeXt source -> PandocIO (Either ByteString ByteString) -context2pdf verbosity program pdfargs tmpDir source = +context2pdf program pdfargs tmpDir source = do + verbosity <- getVerbosity liftIO $ inDirectory tmpDir $ do let file = "input.tex" BS.writeFile file $ UTF8.fromText source let programArgs = "--batchmode" : pdfargs ++ [file] env' <- getEnvironment - when (verbosity >= INFO) $ + when (verbosity >= INFO) $ liftIO $ UTF8.readFile file >>= showVerboseInfo (Just tmpDir) program programArgs env' (exit, out) <- E.catch -- cgit v1.2.3 From 3f9b7a10ad2de63f6a9c77ff361acf17f94d536b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 23 Aug 2021 22:06:39 -0700 Subject: Markdown reader: fix interaction of --strip-comments and list parsing. Use of `--strip-comments` was causing tight lists to be rendered as loose (as if the comment were a blank line). Closes #7521. --- src/Text/Pandoc/Readers/Markdown.hs | 2 +- test/command/7521.md | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/command/7521.md diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 0f2239394..45594e0fa 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -829,7 +829,7 @@ listLineCommon :: PandocMonad m => MarkdownParser m Text listLineCommon = T.concat <$> manyTill ( many1Char (satisfy $ \c -> c `notElem` ['\n', '<', '`']) <|> fmap snd (withRaw code) - <|> fmap snd (htmlTag isCommentTag) + <|> fmap (renderTags . (:[]) . fst) (htmlTag isCommentTag) <|> countChar 1 anyChar ) newline diff --git a/test/command/7521.md b/test/command/7521.md new file mode 100644 index 000000000..38bc40482 --- /dev/null +++ b/test/command/7521.md @@ -0,0 +1,11 @@ +``` +% pandoc -- --strip-comments +- one + +- two +- ^D +
    +
  • one
  • +
  • two
  • +
+``` -- cgit v1.2.3 From 7ff06a8c43019f56db3e647a55d4d8ec82d2fd62 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 24 Aug 2021 12:56:31 -0700 Subject: Fix test for #7521. --- test/command/7521.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/command/7521.md b/test/command/7521.md index 38bc40482..4a24f13e1 100644 --- a/test/command/7521.md +++ b/test/command/7521.md @@ -1,9 +1,9 @@ ``` -% pandoc -- --strip-comments +% pandoc --strip-comments - one - two -- ^D +^D
  • one
  • two
  • -- cgit v1.2.3 From 0df003b099ca16bddee215d6b9f151591f57c6d1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 12:01:28 -0700 Subject: Lua subsystem and custom writers: generalize types from PandocIO... to any instance of PandocMonad and MonadIO. This involves an API change, since the type of runLua is now (PandocMonad m, MonadIO m) => Lua a -> m (Either PandocError a) --- src/Text/Pandoc/Lua/Init.hs | 5 ++--- src/Text/Pandoc/Lua/PandocLua.hs | 5 ++--- src/Text/Pandoc/Writers/Custom.hs | 6 ++++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index baa6f0295..94691666c 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -18,8 +18,7 @@ import Control.Monad.Trans (MonadIO (..)) import Data.Data (Data, dataTypeConstrs, dataTypeOf, showConstr) import Foreign.Lua (Lua) import GHC.IO.Encoding (getForeignEncoding, setForeignEncoding, utf8) -import Text.Pandoc.Class.PandocMonad (readDataFile) -import Text.Pandoc.Class.PandocIO (PandocIO) +import Text.Pandoc.Class.PandocMonad (readDataFile, PandocMonad) import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Packages (installPandocPackageSearcher) import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, runPandocLua) @@ -30,7 +29,7 @@ import qualified Text.Pandoc.Lua.Module.Pandoc as ModulePandoc -- | Run the lua interpreter, using pandoc's default way of environment -- initialization. -runLua :: Lua a -> PandocIO (Either PandocError a) +runLua :: (PandocMonad m, MonadIO m) => Lua a -> m (Either PandocError a) runLua luaOp = do enc <- liftIO $ getForeignEncoding <* setForeignEncoding utf8 res <- runPandocLua . try $ do diff --git a/src/Text/Pandoc/Lua/PandocLua.hs b/src/Text/Pandoc/Lua/PandocLua.hs index 750e019b6..3f6641f95 100644 --- a/src/Text/Pandoc/Lua/PandocLua.hs +++ b/src/Text/Pandoc/Lua/PandocLua.hs @@ -30,7 +30,6 @@ import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow) import Control.Monad.Except (MonadError (catchError, throwError)) import Control.Monad.IO.Class (MonadIO (liftIO)) import Foreign.Lua (Lua (..), NumResults, Pushable, ToHaskellFunction) -import Text.Pandoc.Class.PandocIO (PandocIO) import Text.Pandoc.Class.PandocMonad (PandocMonad (..), readDefaultDataFile) import Text.Pandoc.Error (PandocError (PandocLuaError)) import Text.Pandoc.Lua.Global (Global (..), setGlobals) @@ -59,7 +58,7 @@ liftPandocLua = PandocLua -- | Evaluate a @'PandocLua'@ computation, running all contained Lua -- operations.. -runPandocLua :: PandocLua a -> PandocIO a +runPandocLua :: (PandocMonad m, MonadIO m) => PandocLua a -> m a runPandocLua pLua = do origState <- getCommonState globals <- defaultGlobals @@ -103,7 +102,7 @@ loadDefaultModule name = do throwError $ PandocLuaError (T.pack err) -- | Global variables which should always be set. -defaultGlobals :: PandocIO [Global] +defaultGlobals :: PandocMonad m => m [Global] defaultGlobals = do commonState <- getCommonState return diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs index 58c4bb5be..1e9f37d2f 100644 --- a/src/Text/Pandoc/Writers/Custom.hs +++ b/src/Text/Pandoc/Writers/Custom.hs @@ -22,11 +22,12 @@ import qualified Data.Text as T import Data.Text (Text, pack) import Foreign.Lua (Lua, Pushable) import Text.DocLayout (render, literal) -import Text.Pandoc.Class.PandocIO (PandocIO) +import Control.Monad.IO.Class (MonadIO) import Text.Pandoc.Definition import Text.Pandoc.Lua (Global (..), runLua, setGlobals) import Text.Pandoc.Lua.Util (addField, dofileWithTraceback) import Text.Pandoc.Options +import Text.Pandoc.Class (PandocMonad) import Text.Pandoc.Templates (renderTemplate) import Text.Pandoc.Writers.Shared @@ -79,7 +80,8 @@ instance (Pushable a, Pushable b) => Pushable (KeyValue a b) where Lua.rawset (Lua.nthFromTop 3) -- | Convert Pandoc to custom markup. -writeCustom :: FilePath -> WriterOptions -> Pandoc -> PandocIO Text +writeCustom :: (PandocMonad m, MonadIO m) + => FilePath -> WriterOptions -> Pandoc -> m Text writeCustom luaFile opts doc@(Pandoc meta _) = do let globals = [ PANDOC_DOCUMENT doc , PANDOC_SCRIPT_FILE luaFile -- cgit v1.2.3 From 65e78dac74d29e70db883930eaa384598a23855b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 19:27:32 -0700 Subject: PDF: generalize type of makePDF... instead of PandocIO, it can be used in any instance of PandocMonad, MonadIO, and MonadMask. [API change] --- src/Text/Pandoc/PDF.hs | 95 +++++++++++++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 40 deletions(-) diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs index 2953b084c..9ff4bfb09 100644 --- a/src/Text/Pandoc/PDF.hs +++ b/src/Text/Pandoc/PDF.hs @@ -51,12 +51,13 @@ import Text.Pandoc.Shared (inDirectory, stringify, tshow) import qualified Text.Pandoc.UTF8 as UTF8 import Text.Pandoc.Walk (walkM) import Text.Pandoc.Writers.Shared (getField, metaToContext) +import Control.Monad.Catch (MonadMask) #ifdef _WINDOWS import Data.List (intercalate) #endif import Data.List (isPrefixOf, find) -import Text.Pandoc.Class.PandocIO (PandocIO, extractMedia) -import Text.Pandoc.Class.PandocMonad (fillMediaBag, getVerbosity, report) +import Text.Pandoc.Class (fillMediaBag, getVerbosity, + report, extractMedia, PandocMonad) import Text.Pandoc.Logging #ifdef _WINDOWS @@ -67,14 +68,15 @@ changePathSeparators = intercalate "/" . map (filter (/='\\')) . splitDirectories #endif -makePDF :: String -- ^ pdf creator (pdflatex, lualatex, xelatex, +makePDF :: (PandocMonad m, MonadIO m, MonadMask m) + => String -- ^ pdf creator (pdflatex, lualatex, xelatex, -- wkhtmltopdf, weasyprint, prince, context, pdfroff, -- or path to executable) -> [String] -- ^ arguments to pass to pdf creator - -> (WriterOptions -> Pandoc -> PandocIO Text) -- ^ writer + -> (WriterOptions -> Pandoc -> m Text) -- ^ writer -> WriterOptions -- ^ options -> Pandoc -- ^ document - -> PandocIO (Either ByteString ByteString) + -> m (Either ByteString ByteString) makePDF program pdfargs writer opts doc = case takeBaseName program of "wkhtmltopdf" -> makeWithWkhtmltopdf program pdfargs writer opts doc @@ -88,21 +90,6 @@ makePDF program pdfargs writer opts doc = "-e", "-t", "-k", "-KUTF-8", "-i"] ++ pdfargs generic2pdf program args source baseProg -> do - -- latex has trouble with tildes in paths, which - -- you find in Windows temp dir paths with longer - -- user names (see #777) - let withTempDir :: FilePath -> (FilePath -> PandocIO a) -> PandocIO a - withTempDir templ action = do - tmp <- liftIO getTemporaryDirectory - uname <- liftIO $ E.catch - (do (ec, sout, _) <- readProcessWithExitCode "uname" ["-o"] "" - if ec == ExitSuccess - then return $ Just $ filter (not . isSpace) sout - else return Nothing) - (\(_ :: E.SomeException) -> return Nothing) - if '~' `elem` tmp || uname == Just "Cygwin" -- see #5451 - then withTempDirectory "." templ action - else withSystemTempDirectory templ action withTempDir "tex2pdf." $ \tmpdir' -> do #ifdef _WINDOWS -- note: we want / even on Windows, for TexLive @@ -123,12 +110,30 @@ makePDF program pdfargs writer opts doc = _ -> return $ Left $ UTF8.fromStringLazy $ "Unknown program " ++ program -makeWithWkhtmltopdf :: String -- ^ wkhtmltopdf or path +-- latex has trouble with tildes in paths, which +-- you find in Windows temp dir paths with longer +-- user names (see #777) +withTempDir :: (PandocMonad m, MonadMask m, MonadIO m) + => FilePath -> (FilePath -> m a) -> m a +withTempDir templ action = do + tmp <- liftIO getTemporaryDirectory + uname <- liftIO $ E.catch + (do (ec, sout, _) <- readProcessWithExitCode "uname" ["-o"] "" + if ec == ExitSuccess + then return $ Just $ filter (not . isSpace) sout + else return Nothing) + (\(_ :: E.SomeException) -> return Nothing) + if '~' `elem` tmp || uname == Just "Cygwin" -- see #5451 + then withTempDirectory "." templ action + else withSystemTempDirectory templ action + +makeWithWkhtmltopdf :: (PandocMonad m, MonadIO m) + => String -- ^ wkhtmltopdf or path -> [String] -- ^ arguments - -> (WriterOptions -> Pandoc -> PandocIO Text) -- ^ writer + -> (WriterOptions -> Pandoc -> m Text) -- ^ writer -> WriterOptions -- ^ options -> Pandoc -- ^ document - -> PandocIO (Either ByteString ByteString) + -> m (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: @@ -159,16 +164,18 @@ makeWithWkhtmltopdf program pdfargs writer opts doc@(Pandoc meta _) = do verbosity <- getVerbosity liftIO $ html2pdf verbosity program args source -handleImages :: WriterOptions +handleImages :: (PandocMonad m, MonadIO m) + => WriterOptions -> FilePath -- ^ temp dir to store images -> Pandoc -- ^ document - -> PandocIO Pandoc + -> m Pandoc handleImages opts tmpdir doc = fillMediaBag doc >>= extractMedia tmpdir >>= walkM (convertImages opts tmpdir) -convertImages :: WriterOptions -> FilePath -> Inline -> PandocIO Inline +convertImages :: (PandocMonad m, MonadIO m) + => WriterOptions -> FilePath -> Inline -> m Inline convertImages opts tmpdir (Image attr ils (src, tit)) = do img <- liftIO $ convertImage opts tmpdir $ T.unpack src newPath <- @@ -213,11 +220,12 @@ convertImage opts tmpdir fname = do mime = getMimeType fname doNothing = return (Right fname) -tectonic2pdf :: String -- ^ tex program +tectonic2pdf :: (PandocMonad m, MonadIO m) + => String -- ^ tex program -> [String] -- ^ Arguments to the latex-engine -> FilePath -- ^ temp directory for output -> Text -- ^ tex source - -> PandocIO (Either ByteString ByteString) + -> m (Either ByteString ByteString) tectonic2pdf program args tmpDir source = do (exit, log', mbPdf) <- runTectonic program args tmpDir source case (exit, mbPdf) of @@ -227,11 +235,12 @@ tectonic2pdf program args tmpDir source = do missingCharacterWarnings log' return $ Right pdf -tex2pdf :: String -- ^ tex program +tex2pdf :: (PandocMonad m, MonadIO m) + => String -- ^ tex program -> [String] -- ^ Arguments to the latex-engine -> FilePath -- ^ temp directory for output -> Text -- ^ tex source - -> PandocIO (Either ByteString ByteString) + -> m (Either ByteString ByteString) tex2pdf program args tmpDir source = do let numruns | takeBaseName program == "latexmk" = 1 | "\\tableofcontents" `T.isInfixOf` source = 3 -- to get page numbers @@ -252,7 +261,7 @@ tex2pdf program args tmpDir source = do missingCharacterWarnings log' return $ Right pdf -missingCharacterWarnings :: ByteString -> PandocIO () +missingCharacterWarnings :: PandocMonad m => ByteString -> m () missingCharacterWarnings log' = do let ls = BC.lines log' let isMissingCharacterWarning = BC.isPrefixOf "Missing character: " @@ -287,8 +296,9 @@ extractConTeXtMsg log' = do -- running tex programs -runTectonic :: String -> [String] -> FilePath - -> Text -> PandocIO (ExitCode, ByteString, Maybe ByteString) +runTectonic :: (PandocMonad m, MonadIO m) + => String -> [String] -> FilePath + -> Text -> m (ExitCode, ByteString, Maybe ByteString) runTectonic program args' tmpDir' source = do let getOutDir acc (a:b:xs) = if a `elem` ["-o", "--outdir"] then (reverse acc ++ xs, Just b) @@ -318,7 +328,9 @@ runTectonic program args' tmpDir' source = do -- read a pdf that has been written to a temporary directory, and optionally read -- logs -getResultingPDF :: Maybe String -> String -> PandocIO (Maybe ByteString, Maybe ByteString) +getResultingPDF :: (PandocMonad m, MonadIO m) + => Maybe String -> String + -> m (Maybe ByteString, Maybe ByteString) getResultingPDF logFile pdfFile = do pdfExists <- liftIO $ doesFileExist pdfFile pdf <- if pdfExists @@ -342,8 +354,9 @@ getResultingPDF logFile pdfFile = do -- Run a TeX program on an input bytestring and return (exit code, -- contents of stdout, contents of produced PDF if any). Rerun -- a fixed number of times to resolve references. -runTeXProgram :: String -> [String] -> Int -> FilePath - -> Text -> PandocIO (ExitCode, ByteString, Maybe ByteString) +runTeXProgram :: (PandocMonad m, MonadIO m) + => String -> [String] -> Int -> FilePath + -> Text -> m (ExitCode, ByteString, Maybe ByteString) runTeXProgram program args numRuns tmpDir' source = do let isOutdirArg x = "-outdir=" `isPrefixOf` x || "-output-directory=" `isPrefixOf` x @@ -388,10 +401,11 @@ runTeXProgram program args numRuns tmpDir' source = do return (exit, fromMaybe out log', pdf) runTeX 1 -generic2pdf :: String +generic2pdf :: (PandocMonad m, MonadIO m) + => String -> [String] -> Text - -> PandocIO (Either ByteString ByteString) + -> m (Either ByteString ByteString) generic2pdf program args source = do env' <- liftIO getEnvironment verbosity <- getVerbosity @@ -444,11 +458,12 @@ html2pdf verbosity program args source = (ExitSuccess, Nothing) -> Left "" (ExitSuccess, Just pdf) -> Right pdf -context2pdf :: String -- ^ "context" or path to it +context2pdf :: (PandocMonad m, MonadIO m) + => String -- ^ "context" or path to it -> [String] -- ^ extra arguments -> FilePath -- ^ temp directory for output -> Text -- ^ ConTeXt source - -> PandocIO (Either ByteString ByteString) + -> m (Either ByteString ByteString) context2pdf program pdfargs tmpDir source = do verbosity <- getVerbosity liftIO $ inDirectory tmpDir $ do -- cgit v1.2.3 From 0efbfb33ada6166eb53c5effb1b80393647a1c40 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 21:38:55 -0700 Subject: Text.Pandoc.Filter: Generalize type of applyFilters... from PandocIO to any instance of MonadIO and PandocMonad. [API change] --- src/Text/Pandoc/Class/PandocSandboxed.hs | 79 ++++++++++++++++++++++++++++++++ src/Text/Pandoc/Filter.hs | 10 ++-- src/Text/Pandoc/Filter/Lua.hs | 11 +++-- 3 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 src/Text/Pandoc/Class/PandocSandboxed.hs diff --git a/src/Text/Pandoc/Class/PandocSandboxed.hs b/src/Text/Pandoc/Class/PandocSandboxed.hs new file mode 100644 index 000000000..61ee1f1c6 --- /dev/null +++ b/src/Text/Pandoc/Class/PandocSandboxed.hs @@ -0,0 +1,79 @@ +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{- | +Module : Text.Pandoc.Class.PandocIO +Copyright : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane +License : GNU GPL, version 2 or above + +Maintainer : Jesse Rosenthal +Stability : alpha +Portability : portable + +This module defines @'PandocIO'@, an IO-based instance of the +@'PandocMonad'@ type class. File, data, and network access all are run +using IO operators. +-} +module Text.Pandoc.Class.PandocIO + ( PandocIO(..) + , runIO + , runIOorExplode + , extractMedia + ) where + +import Control.Monad.Except (ExceptT, MonadError, runExceptT) +import Control.Monad.IO.Class (MonadIO) +import Control.Monad.State (StateT, evalStateT, lift, get, put) +import Data.Default (Default (def)) +import Text.Pandoc.Class.CommonState (CommonState (..)) +import Text.Pandoc.Class.PandocMonad +import Text.Pandoc.Definition +import Text.Pandoc.Error +import qualified Text.Pandoc.Class.IO as IO +import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow) + +-- | Evaluate a 'PandocIO' operation. +runIO :: PandocIO a -> IO (Either PandocError a) +runIO ma = flip evalStateT def $ runExceptT $ unPandocIO ma + +-- | Evaluate a 'PandocIO' operation, handling any errors +-- by exiting with an appropriate message and error status. +runIOorExplode :: PandocIO a -> IO a +runIOorExplode ma = runIO ma >>= handleError + +newtype PandocIO a = PandocIO { + unPandocIO :: ExceptT PandocError (StateT CommonState IO) a + } deriving ( MonadIO + , Functor + , Applicative + , Monad + , MonadCatch + , MonadMask + , MonadThrow + , MonadError PandocError + ) + +instance PandocMonad PandocIO where + lookupEnv = IO.lookupEnv + getCurrentTime = IO.getCurrentTime + getCurrentTimeZone = IO.getCurrentTimeZone + newStdGen = IO.newStdGen + newUniqueHash = IO.newUniqueHash + + openURL = IO.openURL + readFileLazy = IO.readFileLazy + readFileStrict = IO.readFileStrict + readStdinStrict = IO.readStdinStrict + + glob = IO.glob + fileExists = IO.fileExists + getDataFileName = IO.getDataFileName + getModificationTime = IO.getModificationTime + + getCommonState = PandocIO $ lift get + putCommonState = PandocIO . lift . put + + logOutput = IO.logOutput + +-- | Extract media from the mediabag into a directory. +extractMedia :: (PandocMonad m, MonadIO m) => FilePath -> Pandoc -> m Pandoc +extractMedia = IO.extractMedia diff --git a/src/Text/Pandoc/Filter.hs b/src/Text/Pandoc/Filter.hs index 1209ceeb7..c2f522109 100644 --- a/src/Text/Pandoc/Filter.hs +++ b/src/Text/Pandoc/Filter.hs @@ -21,8 +21,7 @@ module Text.Pandoc.Filter import System.CPUTime (getCPUTime) import Data.Aeson.TH (deriveJSON, defaultOptions) import GHC.Generics (Generic) -import Text.Pandoc.Class.PandocIO (PandocIO) -import Text.Pandoc.Class.PandocMonad (report, getVerbosity) +import Text.Pandoc.Class (report, getVerbosity, PandocMonad) import Text.Pandoc.Definition (Pandoc) import Text.Pandoc.Options (ReaderOptions) import Text.Pandoc.Logging @@ -66,11 +65,12 @@ instance FromYAML Filter where _ -> JSONFilter fp) node -- | Modify the given document using a filter. -applyFilters :: ReaderOptions +applyFilters :: (PandocMonad m, MonadIO m) + => ReaderOptions -> [Filter] -> [String] -> Pandoc - -> PandocIO Pandoc + -> m Pandoc applyFilters ropts filters args d = do expandedFilters <- mapM expandFilterPath filters foldM applyFilter d expandedFilters @@ -92,7 +92,7 @@ applyFilters ropts filters args d = do toMilliseconds picoseconds = picoseconds `div` 1000000000 -- | Expand paths of filters, searching the data directory. -expandFilterPath :: Filter -> PandocIO Filter +expandFilterPath :: (PandocMonad m, MonadIO m) => Filter -> m Filter expandFilterPath (LuaFilter fp) = LuaFilter <$> Path.expandFilterPath fp expandFilterPath (JSONFilter fp) = JSONFilter <$> Path.expandFilterPath fp expandFilterPath CiteprocFilter = return CiteprocFilter diff --git a/src/Text/Pandoc/Filter/Lua.hs b/src/Text/Pandoc/Filter/Lua.hs index c238e53d9..4e264261b 100644 --- a/src/Text/Pandoc/Filter/Lua.hs +++ b/src/Text/Pandoc/Filter/Lua.hs @@ -14,7 +14,8 @@ module Text.Pandoc.Filter.Lua (apply) where import Control.Exception (throw) import Control.Monad ((>=>)) import qualified Data.Text as T -import Text.Pandoc.Class.PandocIO (PandocIO) +import Text.Pandoc.Class (PandocMonad) +import Control.Monad.Trans (MonadIO) import Text.Pandoc.Definition (Pandoc) import Text.Pandoc.Error (PandocError (PandocFilterError, PandocLuaError)) import Text.Pandoc.Lua (Global (..), runLua, runFilterFile, setGlobals) @@ -23,11 +24,12 @@ import Text.Pandoc.Options (ReaderOptions) -- | Run the Lua filter in @filterPath@ for a transformation to the -- target format (first element in args). Pandoc uses Lua init files to -- setup the Lua interpreter. -apply :: ReaderOptions +apply :: (PandocMonad m, MonadIO m) + => ReaderOptions -> [String] -> FilePath -> Pandoc - -> PandocIO Pandoc + -> m Pandoc apply ropts args fp doc = do let format = case args of (x:_) -> x @@ -39,7 +41,8 @@ apply ropts args fp doc = do ] runFilterFile fp doc -forceResult :: FilePath -> Either PandocError Pandoc -> PandocIO Pandoc +forceResult :: (PandocMonad m, MonadIO m) + => FilePath -> Either PandocError Pandoc -> m Pandoc forceResult fp eitherResult = case eitherResult of Right x -> return x Left err -> throw . PandocFilterError (T.pack fp) $ case err of -- cgit v1.2.3 From bf860df938782fc1862ce95d12b47c40e564373b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 21:41:54 -0700 Subject: T.P.App.OutputSettings: Generalize some types... so we can run this with any instance of PandocMonad and MonadIO, not just PandocIO. --- src/Text/Pandoc/App.hs | 2 +- src/Text/Pandoc/App/OutputSettings.hs | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 5696156ad..dd58b1b39 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -133,7 +133,7 @@ convertWithOpts opts = do <> "` instead of `pandoc " <> inputFile <> " -o " <> outputFile <> "`." _ -> return () - (reader :: Reader PandocIO, readerExts) <- getReader readerName + (reader, readerExts) <- getReader readerName let convertTabs = tabFilter (if optPreserveTabs opts || readerNameBase == "t2t" || diff --git a/src/Text/Pandoc/App/OutputSettings.hs b/src/Text/Pandoc/App/OutputSettings.hs index 3864ab188..3f83f4b21 100644 --- a/src/Text/Pandoc/App/OutputSettings.hs +++ b/src/Text/Pandoc/App/OutputSettings.hs @@ -45,16 +45,16 @@ readUtf8File :: PandocMonad m => FilePath -> m T.Text readUtf8File = fmap UTF8.toText . readFileStrict -- | Settings specifying how document output should be produced. -data OutputSettings = OutputSettings +data OutputSettings m = OutputSettings { outputFormat :: T.Text - , outputWriter :: Writer PandocIO + , outputWriter :: Writer m , outputWriterName :: T.Text , outputWriterOptions :: WriterOptions , outputPdfProgram :: Maybe String } -- | Get output settings from command line options. -optToOutputSettings :: Opt -> PandocIO OutputSettings +optToOutputSettings :: (PandocMonad m, MonadIO m) => Opt -> m (OutputSettings m) optToOutputSettings opts = do let outputFile = fromMaybe "-" (optOutputFile opts) @@ -90,11 +90,10 @@ optToOutputSettings opts = do then writerName else T.toLower $ baseWriterName writerName - (writer :: Writer PandocIO, writerExts) <- + (writer, writerExts) <- if ".lua" `T.isSuffixOf` format then return (TextWriter - (\o d -> writeCustom (T.unpack writerName) o d) - :: Writer PandocIO, mempty) + (\o d -> writeCustom (T.unpack writerName) o d), mempty) else getWriter (T.toLower writerName) let standalone = optStandalone opts || not (isTextFormat format) || pdfOutput -- cgit v1.2.3 From 8ad22002cb5ac4c79acda84c7256c6a122e2dd93 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 19:26:53 -0700 Subject: Class: Generalize type of extractMedia. It was uselessly restricted to PandocIO, instead of any instance of PandocMonad and MonadIO. [API change] --- src/Text/Pandoc/Class/PandocIO.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Class/PandocIO.hs b/src/Text/Pandoc/Class/PandocIO.hs index 0e5247ff9..86038a659 100644 --- a/src/Text/Pandoc/Class/PandocIO.hs +++ b/src/Text/Pandoc/Class/PandocIO.hs @@ -74,5 +74,5 @@ instance PandocMonad PandocIO where logOutput = IO.logOutput -- | Extract media from the mediabag into a directory. -extractMedia :: FilePath -> Pandoc -> PandocIO Pandoc +extractMedia :: (PandocMonad m, MonadIO m) => FilePath -> Pandoc -> m Pandoc extractMedia = IO.extractMedia -- cgit v1.2.3 From c39ddeb8f86e9dec5bd6096685812452e3f2c65e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 17:47:18 -0700 Subject: Text.Pandoc.Class: add readStdinStrict method to PandocMonad. [API change] --- src/Text/Pandoc/Class/IO.hs | 6 ++++++ src/Text/Pandoc/Class/PandocIO.hs | 1 + src/Text/Pandoc/Class/PandocMonad.hs | 5 +++++ src/Text/Pandoc/Class/PandocPure.hs | 4 ++++ src/Text/Pandoc/Lua/PandocLua.hs | 1 + 5 files changed, 17 insertions(+) diff --git a/src/Text/Pandoc/Class/IO.hs b/src/Text/Pandoc/Class/IO.hs index f4cfc8682..305f07a01 100644 --- a/src/Text/Pandoc/Class/IO.hs +++ b/src/Text/Pandoc/Class/IO.hs @@ -30,6 +30,7 @@ module Text.Pandoc.Class.IO , openURL , readFileLazy , readFileStrict + , readStdinStrict , extractMedia ) where @@ -158,6 +159,11 @@ readFileLazy s = liftIOError BL.readFile s readFileStrict :: (PandocMonad m, MonadIO m) => FilePath -> m B.ByteString readFileStrict s = liftIOError B.readFile s +-- | Read the strict ByteString contents from stdin, raising +-- an error on failure. +readStdinStrict :: (PandocMonad m, MonadIO m) => m B.ByteString +readStdinStrict = liftIOError (const B.getContents) "stdin" + -- | Return a list of paths that match a glob, relative to the working -- directory. See 'System.FilePath.Glob' for the glob syntax. glob :: (PandocMonad m, MonadIO m) => String -> m [FilePath] diff --git a/src/Text/Pandoc/Class/PandocIO.hs b/src/Text/Pandoc/Class/PandocIO.hs index 86038a659..61ee1f1c6 100644 --- a/src/Text/Pandoc/Class/PandocIO.hs +++ b/src/Text/Pandoc/Class/PandocIO.hs @@ -62,6 +62,7 @@ instance PandocMonad PandocIO where openURL = IO.openURL readFileLazy = IO.readFileLazy readFileStrict = IO.readFileStrict + readStdinStrict = IO.readStdinStrict glob = IO.glob fileExists = IO.fileExists diff --git a/src/Text/Pandoc/Class/PandocMonad.hs b/src/Text/Pandoc/Class/PandocMonad.hs index 439aec071..d3cf1201c 100644 --- a/src/Text/Pandoc/Class/PandocMonad.hs +++ b/src/Text/Pandoc/Class/PandocMonad.hs @@ -117,6 +117,9 @@ class (Functor m, Applicative m, Monad m, MonadError PandocError m) -- | Read the strict ByteString contents from a file path, -- raising an error on failure. readFileStrict :: FilePath -> m B.ByteString + -- | Read the contents of stdin as a strict ByteString, raising + -- an error on failure. + readStdinStrict :: m B.ByteString -- | Return a list of paths that match a glob, relative to -- the working directory. See 'System.FilePath.Glob' for -- the glob syntax. @@ -674,6 +677,7 @@ instance (MonadTrans t, PandocMonad m, Functor (t m), openURL = lift . openURL readFileLazy = lift . readFileLazy readFileStrict = lift . readFileStrict + readStdinStrict = lift readStdinStrict glob = lift . glob fileExists = lift . fileExists getDataFileName = lift . getDataFileName @@ -691,6 +695,7 @@ instance {-# OVERLAPS #-} PandocMonad m => PandocMonad (ParsecT s st m) where openURL = lift . openURL readFileLazy = lift . readFileLazy readFileStrict = lift . readFileStrict + readStdinStrict = lift readStdinStrict glob = lift . glob fileExists = lift . fileExists getDataFileName = lift . getDataFileName diff --git a/src/Text/Pandoc/Class/PandocPure.hs b/src/Text/Pandoc/Class/PandocPure.hs index 23c941839..290a6d97c 100644 --- a/src/Text/Pandoc/Class/PandocPure.hs +++ b/src/Text/Pandoc/Class/PandocPure.hs @@ -64,6 +64,7 @@ data PureState = PureState , stReferencePptx :: Archive , stReferenceODT :: Archive , stFiles :: FileTree + , stStdin :: B.ByteString , stUserDataFiles :: FileTree , stCabalDataFiles :: FileTree } @@ -80,6 +81,7 @@ instance Default PureState where , stReferencePptx = emptyArchive , stReferenceODT = emptyArchive , stFiles = mempty + , stStdin = mempty , stUserDataFiles = mempty , stCabalDataFiles = mempty } @@ -193,6 +195,8 @@ instance PandocMonad PandocPure where Just bs -> return bs Nothing -> throwError $ PandocResourceNotFound $ T.pack fp + readStdinStrict = getsPureState stStdin + glob s = do FileTree ftmap <- getsPureState stFiles return $ filter (match (compile s)) $ M.keys ftmap diff --git a/src/Text/Pandoc/Lua/PandocLua.hs b/src/Text/Pandoc/Lua/PandocLua.hs index 3f6641f95..b7f084957 100644 --- a/src/Text/Pandoc/Lua/PandocLua.hs +++ b/src/Text/Pandoc/Lua/PandocLua.hs @@ -126,6 +126,7 @@ instance PandocMonad PandocLua where readFileLazy = IO.readFileLazy readFileStrict = IO.readFileStrict + readStdinStrict = IO.readStdinStrict glob = IO.glob fileExists = IO.fileExists -- cgit v1.2.3 From fd7c140cde7544c0236586e2aa22691c33c3265a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 17:47:47 -0700 Subject: Reorganize App to make it easier to limit IO in main loop. Previously we used liftIO fairly liberally. The code has been restructured to avoid this. A small behavior change is that pandoc will now fall back to latin1 encoding for inputs that can't be read as UTF-8. This is what it did previously for content fetched from the web and not marked as to content type. It makes sense to do the same for local files. --- src/Text/Pandoc/App.hs | 185 ++++++++++++++++++++++++++----------------------- 1 file changed, 100 insertions(+), 85 deletions(-) diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index dd58b1b39..66d659ba1 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE TupleSections #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} @@ -27,7 +28,7 @@ module Text.Pandoc.App ( import qualified Control.Exception as E import Control.Monad ( (>=>), when ) import Control.Monad.Trans ( MonadIO(..) ) -import Control.Monad.Except (throwError) +import Control.Monad.Except (throwError, catchError) import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as B8 import qualified Data.ByteString.Lazy as BL @@ -38,6 +39,7 @@ import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Lazy as TL import qualified Data.Text.Lazy.Encoding as TE +import qualified Data.Text.Encoding as TSE import qualified Data.Text.Encoding.Error as TE import qualified Data.Text.Encoding.Error as TSE import Network.URI (URI (..), parseURI) @@ -48,7 +50,7 @@ import System.IO (nativeNewline, stdout) import qualified System.IO as IO (Newline (..)) import Text.Pandoc import Text.Pandoc.Builder (setMeta) -import Text.Pandoc.MIME (getCharset) +import Text.Pandoc.MIME (getCharset, MimeType) import Text.Pandoc.App.FormatHeuristics (formatFromFilePaths) import Text.Pandoc.App.Opt (Opt (..), LineEnding (..), defaultOpts, IpynbOutput (..)) @@ -69,6 +71,7 @@ import qualified Text.Pandoc.UTF8 as UTF8 import System.Posix.IO (stdOutput) import System.Posix.Terminal (queryTerminal) #endif +import Debug.Trace convertWithOpts :: Opt -> IO () convertWithOpts opts = do @@ -94,14 +97,14 @@ convertWithOpts opts = do let sources = case optInputFiles opts of Just xs | not (optIgnoreArgs opts) -> xs _ -> ["-"] - #ifdef _WINDOWS let istty = True #else istty <- liftIO $ queryTerminal stdOutput #endif - (output, reports) <- runIOorExplode $ do + res <- runIO $ do + setTrace (optTrace opts) setVerbosity verbosity setUserDataDir datadir @@ -110,6 +113,8 @@ convertWithOpts opts = do setInputFiles (fromMaybe ["-"] (optInputFiles opts)) setOutputFile (optOutputFile opts) + inputs <- readSources sources + -- assign reader and writer based on options and filenames readerName <- case optFrom opts of Just f -> return f @@ -135,20 +140,6 @@ convertWithOpts opts = do (reader, readerExts) <- getReader readerName - let convertTabs = tabFilter (if optPreserveTabs opts || - readerNameBase == "t2t" || - readerNameBase == "man" - then 0 - else optTabStop opts) - - - let readSources :: [FilePath] -> PandocIO [(FilePath, Text)] - readSources srcs = - mapM (\fp -> do - t <- readSource fp - return (if fp == "-" then "" else fp, convertTabs t)) srcs - - outputSettings <- optToOutputSettings opts let format = outputFormat outputSettings let writer = outputWriter outputSettings @@ -236,20 +227,11 @@ convertWithOpts opts = do _ -> Format format) :)) $ [] - let sourceToDoc :: [FilePath] -> PandocIO Pandoc - sourceToDoc sources' = - case reader of - TextReader r - | readerNameBase == "json" -> - mconcat <$> mapM (readSource >=> r readerOpts) sources' - | optFileScope opts -> - -- Read source and convert tabs (see #6709) - let readSource' = fmap convertTabs . readSource - in mconcat <$> mapM (readSource' >=> r readerOpts) sources' - | otherwise -> - readSources sources' >>= r readerOpts - ByteStringReader r -> - mconcat <$> mapM (readFile' >=> r readerOpts) sources' + let convertTabs = tabFilter (if optPreserveTabs opts || + readerNameBase == "t2t" || + readerNameBase == "man" + then 0 + else optTabStop opts) when (readerNameBase == "markdown_github" || @@ -275,7 +257,22 @@ convertWithOpts opts = do maybe id (setMeta "citation-abbreviations") (optCitationAbbreviations opts) $ mempty - doc <- sourceToDoc sources >>= + doc <- (case reader of + TextReader r + | readerNameBase == "json" -> + mconcat <$> + mapM (inputToText convertTabs + >=> r readerOpts . (:[])) inputs + | optFileScope opts -> + mconcat <$> mapM + (inputToText convertTabs + >=> r readerOpts . (:[])) + inputs + | otherwise -> mapM (inputToText convertTabs) inputs + >>= r readerOpts + ByteStringReader r -> + mconcat <$> mapM (r readerOpts . inputToLazyByteString) inputs) + >>= ( (if isJust (optExtractMedia opts) then fillMediaBag else return) @@ -310,19 +307,22 @@ convertWithOpts opts = do reports <- getLog return (output, reports) - case optLogFile opts of - Nothing -> return () - Just logfile -> BL.writeFile logfile (encodeLogMessages reports) - let isWarning msg = messageVerbosity msg == WARNING - when (optFailIfWarnings opts && any isWarning reports) $ - E.throwIO PandocFailOnWarningError - let eol = case optEol opts of - CRLF -> IO.CRLF - LF -> IO.LF - Native -> nativeNewline - case output of - TextOutput t -> writerFn eol outputFile t - BinaryOutput bs -> writeFnBinary outputFile bs + case res of + Left e -> E.throwIO e + Right (output, reports) -> do + case optLogFile opts of + Nothing -> return () + Just logfile -> BL.writeFile logfile (encodeLogMessages reports) + let isWarning msg = messageVerbosity msg == WARNING + when (optFailIfWarnings opts && any isWarning reports) $ + E.throwIO PandocFailOnWarningError + let eol = case optEol opts of + CRLF -> IO.CRLF + LF -> IO.LF + Native -> nativeNewline + case output of + TextOutput t -> writerFn eol outputFile t + BinaryOutput bs -> writeFnBinary outputFile bs data PandocOutput = TextOutput Text | BinaryOutput BL.ByteString deriving (Show) @@ -344,49 +344,64 @@ adjustMetadata f (Pandoc meta bs) = Pandoc (f meta) bs applyTransforms :: Monad m => [Transform] -> Pandoc -> m Pandoc applyTransforms transforms d = return $ foldr ($) d transforms -readSource :: FilePath -> PandocIO Text -readSource src = case parseURI src of - Just u | uriScheme u `elem` ["http:","https:"] -> - readURI src - | uriScheme u == "file:" -> liftIO $ - readTextFile (uriPathToPath $ T.pack $ uriPath u) - _ -> liftIO $ readTextFile src - where readTextFile :: FilePath -> IO Text - readTextFile fp = do - bs <- if src == "-" - then BS.getContents - else BS.readFile fp - E.catch (return $! UTF8.toText bs) - (\e -> E.throwIO $ case e of - TSE.DecodeError _ (Just w) -> - case BS.elemIndex w bs of - Just offset -> - PandocUTF8DecodingError (T.pack fp) offset w - _ -> PandocUTF8DecodingError (T.pack fp) 0 w - _ -> PandocAppError (tshow e)) - -readURI :: FilePath -> PandocIO Text -readURI src = do - (bs, mt) <- openURL (T.pack src) +readSources :: (PandocMonad m, MonadIO m) + => [FilePath] -> m [(FilePath, (BS.ByteString, Maybe MimeType))] +readSources srcs = + mapM (\fp -> do t <- readSource fp + return (if fp == "-" then "" else fp, t)) srcs + +readSource :: (PandocMonad m, MonadIO m) + => FilePath -> m (BS.ByteString, Maybe MimeType) +readSource "-" = (,Nothing) <$> readStdinStrict +readSource src = + case parseURI src of + Just u | uriScheme u `elem` ["http:","https:"] -> openURL (T.pack src) + | uriScheme u == "file:" -> + (,Nothing) <$> + readFileStrict (uriPathToPath $ T.pack $ uriPath u) + _ -> (,Nothing) <$> readFileStrict src + +utf8ToText :: PandocMonad m => FilePath -> BS.ByteString -> m Text +utf8ToText fp bs = + case TSE.decodeUtf8' . dropBOM $ bs of + Left (TSE.DecodeError _ (Just w)) -> + case BS.elemIndex w bs of + Just offset -> throwError $ PandocUTF8DecodingError (T.pack fp) offset w + Nothing -> throwError $ PandocUTF8DecodingError (T.pack fp) 0 w + Left e -> throwError $ PandocAppError (tshow e) + Right t -> return t + where + dropBOM bs' = + if "\xEF\xBB\xBF" `BS.isPrefixOf` bs' + then BS.drop 3 bs' + else bs' + + +inputToText :: PandocMonad m + => (Text -> Text) + -> (FilePath, (BS.ByteString, Maybe MimeType)) + -> m (FilePath, Text) +inputToText convTabs (fp, (bs,mt)) = + (fp,) . convTabs . T.filter (/='\r') <$> case mt >>= getCharset of - Just "UTF-8" -> return $ UTF8.toText bs + Just "UTF-8" -> utf8ToText fp bs Just "ISO-8859-1" -> return $ T.pack $ B8.unpack bs Just charset -> throwError $ PandocUnsupportedCharsetError charset - Nothing -> liftIO $ -- try first as UTF-8, then as latin1 - E.catch (return $! UTF8.toText bs) - (\case - TSE.DecodeError{} -> + Nothing -> catchError + (utf8ToText fp bs) + (\case + PandocUTF8DecodingError{} -> return $ T.pack $ B8.unpack bs - e -> E.throwIO e) + e -> throwError e) -readFile' :: MonadIO m => FilePath -> m BL.ByteString -readFile' "-" = liftIO BL.getContents -readFile' f = liftIO $ BL.readFile f +inputToLazyByteString :: (FilePath, (BS.ByteString, Maybe MimeType)) + -> BL.ByteString +inputToLazyByteString (_, (bs,_)) = BL.fromStrict bs -writeFnBinary :: MonadIO m => FilePath -> BL.ByteString -> m () -writeFnBinary "-" = liftIO . BL.putStr -writeFnBinary f = liftIO . BL.writeFile (UTF8.encodePath f) +writeFnBinary :: FilePath -> BL.ByteString -> IO () +writeFnBinary "-" = BL.putStr +writeFnBinary f = BL.writeFile (UTF8.encodePath f) -writerFn :: MonadIO m => IO.Newline -> FilePath -> Text -> m () -writerFn eol "-" = liftIO . UTF8.putStrWith eol -writerFn eol f = liftIO . UTF8.writeFileWith eol f +writerFn :: IO.Newline -> FilePath -> Text -> IO () +writerFn eol "-" = UTF8.putStrWith eol +writerFn eol f = UTF8.writeFileWith eol f -- cgit v1.2.3 From c29a72ffe7cd5dcbfec76cdf7faf243560367526 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 24 Aug 2021 23:27:59 -0700 Subject: Comment out unused module. --- src/Text/Pandoc/App.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 66d659ba1..0b7f2458d 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -71,7 +71,7 @@ import qualified Text.Pandoc.UTF8 as UTF8 import System.Posix.IO (stdOutput) import System.Posix.Terminal (queryTerminal) #endif -import Debug.Trace +-- import Debug.Trace convertWithOpts :: Opt -> IO () convertWithOpts opts = do -- cgit v1.2.3 From af9d464ceeca240b5bf5d2c9649e78c71a6db7c5 Mon Sep 17 00:00:00 2001 From: William Lupton Date: Fri, 27 Aug 2021 09:32:58 +0100 Subject: Clarify 'attributes' extension support --- MANUAL.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MANUAL.txt b/MANUAL.txt index a3e2b4c33..5dc35c8ff 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5124,7 +5124,8 @@ or image itself, if these differ. #### Extension: `attributes` #### Allows attributes to be attached to any inline or block-level -element. The syntax for the attributes is the same as that +element when parsing `commonmark`. +The syntax for the attributes is the same as that used in [`header_attributes`][Extension: `header_attributes`]. - Attributes that occur immediately after an inline -- cgit v1.2.3 From e4d7a6177f6ef7bf835f61ed01b0229423cd0e55 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 27 Aug 2021 09:41:46 -0700 Subject: Ensure we have unique ids for wp:docPr and pic:cNvPr elements. This will, I hope, fix #7527 and #7503. --- src/Text/Pandoc/Writers/Docx.hs | 20 +++++++++++--------- test/docx/golden/image.docx | Bin 26776 -> 26811 bytes test/docx/golden/inline_images.docx | Bin 26703 -> 26711 bytes 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 756583d1f..efd8b2658 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -175,6 +175,7 @@ writeDocx opts doc = do let initialSt = defaultWriterState { stStyleMaps = styleMaps , stTocTitle = tocTitle + , stCurId = 20 } let isRTLmeta = case lookupMeta "dir" meta of @@ -783,8 +784,6 @@ rStyleM styleName = do return $ mknode "w:rStyle" [("w:val", fromStyleId sty')] () getUniqueId :: (PandocMonad m) => WS m Text --- the + 20 is to ensure that there are no clashes with the rIds --- already in word/document.xml.rel getUniqueId = do n <- gets stCurId modify $ \st -> st{stCurId = n + 1} @@ -1234,7 +1233,9 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do imgs <- gets stImages let stImage = M.lookup (T.unpack src) imgs - generateImgElt (ident, _, _, img) = + generateImgElt (ident, _, _, img) = do + docprid <- getUniqueId + nvpicprid <- getUniqueId let (xpt,ypt) = desiredSizeInPoints opts attr (either (const def) id (imageSize opts img)) @@ -1246,7 +1247,9 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do ,("noChangeAspect","1")] () nvPicPr = mknode "pic:nvPicPr" [] [ mknode "pic:cNvPr" - [("descr",src),("id","0"),("name","Picture")] () + [("descr",src) + ,("id", nvpicprid) + ,("name","Picture")] () , cNvPicPr ] blipFill = mknode "pic:blipFill" [] [ mknode "a:blip" [("r:embed",T.pack ident)] () @@ -1283,16 +1286,15 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do , mknode "wp:docPr" [ ("descr", stringify alt) , ("title", title) - , ("id","1") + , ("id", docprid) , ("name","Picture") ] () , graphic ] - in - imgElt + return [Elem imgElt] wrapBookmark imgident =<< case stImage of - Just imgData -> return [Elem $ generateImgElt imgData] + Just imgData -> generateImgElt imgData Nothing -> ( do --try (img, mt) <- P.fetchItem src ident <- ("rId" <>) <$> getUniqueId @@ -1321,7 +1323,7 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do else do -- insert mime type to use in constructing [Content_Types].xml modify $ \st -> st { stImages = M.insert (T.unpack src) imgData $ stImages st } - return [Elem $ generateImgElt imgData] + generateImgElt imgData ) `catchError` ( \e -> do report $ CouldNotFetchResource src $ T.pack (show e) diff --git a/test/docx/golden/image.docx b/test/docx/golden/image.docx index 7c2d8a9ac..a84eed100 100644 Binary files a/test/docx/golden/image.docx and b/test/docx/golden/image.docx differ diff --git a/test/docx/golden/inline_images.docx b/test/docx/golden/inline_images.docx index 662e70556..f3c19555f 100644 Binary files a/test/docx/golden/inline_images.docx and b/test/docx/golden/inline_images.docx differ -- cgit v1.2.3 From 8e5a79f264dd1ebe80e048397b6281e318d25e82 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Fri, 20 Aug 2021 14:40:09 +0100 Subject: pptx: Make first heading title if slide level is 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, the pptx writer adds a slide break before any table, “columns” div, or paragraph starting with an image, unless the only thing before it on the same slide is a heading at the slide level. In that case, the item and heading are kept on the same slide, and the heading is used as the slide title (inserted into the layout’s “title” placeholder). However, if the slide level is set to 0 (as was recently enabled) this makes it impossible to have a slide with a title which contains any of those items in its body. This commit changes this behaviour: now if the slide level is 0, then items will be kept with a heading of any level, if the heading’s the only thing before the item on the same slide. --- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 53 +++++++++++---------- test/Tests/Writers/Powerpoint.hs | 25 ++++++++++ test/pptx/slide-level-0-h1-h2-with-table.native | 14 ++++++ test/pptx/slide-level-0-h1-h2-with-table.pptx | Bin 0 -> 26985 bytes ...e-level-0-h1-h2-with-table_deleted_layouts.pptx | Bin 0 -> 29828 bytes ...ide-level-0-h1-h2-with-table_moved_layouts.pptx | Bin 0 -> 40552 bytes .../slide-level-0-h1-h2-with-table_templated.pptx | Bin 0 -> 40052 bytes test/pptx/slide-level-0-h1-with-image.native | 2 + test/pptx/slide-level-0-h1-with-image.pptx | Bin 0 -> 42596 bytes ...lide-level-0-h1-with-image_deleted_layouts.pptx | Bin 0 -> 45433 bytes .../slide-level-0-h1-with-image_moved_layouts.pptx | Bin 0 -> 56156 bytes .../slide-level-0-h1-with-image_templated.pptx | Bin 0 -> 55657 bytes test/pptx/slide-level-0-h1-with-table.native | 13 +++++ test/pptx/slide-level-0-h1-with-table.pptx | Bin 0 -> 26166 bytes ...lide-level-0-h1-with-table_deleted_layouts.pptx | Bin 0 -> 29008 bytes .../slide-level-0-h1-with-table_moved_layouts.pptx | Bin 0 -> 39731 bytes .../slide-level-0-h1-with-table_templated.pptx | Bin 0 -> 39232 bytes test/pptx/slide-level-0-h2-with-image.native | 2 + test/pptx/slide-level-0-h2-with-image.pptx | Bin 0 -> 42596 bytes ...lide-level-0-h2-with-image_deleted_layouts.pptx | Bin 0 -> 45433 bytes .../slide-level-0-h2-with-image_moved_layouts.pptx | Bin 0 -> 56156 bytes .../slide-level-0-h2-with-image_templated.pptx | Bin 0 -> 55657 bytes 22 files changed, 85 insertions(+), 24 deletions(-) create mode 100644 test/pptx/slide-level-0-h1-h2-with-table.native create mode 100644 test/pptx/slide-level-0-h1-h2-with-table.pptx create mode 100644 test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-h2-with-table_templated.pptx create mode 100644 test/pptx/slide-level-0-h1-with-image.native create mode 100644 test/pptx/slide-level-0-h1-with-image.pptx create mode 100644 test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-with-image_templated.pptx create mode 100644 test/pptx/slide-level-0-h1-with-table.native create mode 100644 test/pptx/slide-level-0-h1-with-table.pptx create mode 100644 test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx create mode 100644 test/pptx/slide-level-0-h1-with-table_templated.pptx create mode 100644 test/pptx/slide-level-0-h2-with-image.native create mode 100644 test/pptx/slide-level-0-h2-with-image.pptx create mode 100644 test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx create mode 100644 test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx create mode 100644 test/pptx/slide-level-0-h2-with-image_templated.pptx diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 0400783e3..284b9ae62 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -604,7 +604,7 @@ splitBlocks' cur acc (Para (il:ils) : blks) | isImage il = do then span isNotesDiv blks else ([], blks) case cur of - [Header n _ _] | n == slideLevel -> + [Header n _ _] | n == slideLevel || slideLevel == 0 -> splitBlocks' [] (acc ++ [cur ++ [Para [il]] ++ nts]) (if null ils then blks' else Para ils : blks') @@ -615,14 +615,14 @@ splitBlocks' cur acc (tbl@Table{} : blks) = do slideLevel <- asks envSlideLevel let (nts, blks') = span isNotesDiv blks case cur of - [Header n _ _] | n == slideLevel -> + [Header n _ _] | n == slideLevel || slideLevel == 0 -> splitBlocks' [] (acc ++ [cur ++ [tbl] ++ nts]) blks' _ -> splitBlocks' [] (acc ++ ([cur | not (null cur)]) ++ [tbl : nts]) blks' splitBlocks' cur acc (d@(Div (_, classes, _) _): blks) | "columns" `elem` classes = do slideLevel <- asks envSlideLevel let (nts, blks') = span isNotesDiv blks case cur of - [Header n _ _] | n == slideLevel -> + [Header n _ _] | n == slideLevel || slideLevel == 0 -> splitBlocks' [] (acc ++ [cur ++ [d] ++ nts]) blks' _ -> splitBlocks' [] (acc ++ ([cur | not (null cur)]) ++ [d : nts]) blks' splitBlocks' cur acc (blk : blks) = splitBlocks' (cur ++ [blk]) acc blks @@ -630,25 +630,10 @@ splitBlocks' cur acc (blk : blks) = splitBlocks' (cur ++ [blk]) acc blks splitBlocks :: [Block] -> Pres [[Block]] splitBlocks = splitBlocks' [] [] -blocksToSlide' :: Int -> [Block] -> SpeakerNotes -> Pres Slide -blocksToSlide' lvl (Header n (ident, _, _) ils : blks) spkNotes - | n < lvl = do - registerAnchorId ident - sldId <- asks envCurSlideId - hdr <- inlinesToParElems ils - return $ Slide sldId (TitleSlide hdr) spkNotes - | n == lvl = do - registerAnchorId ident - hdr <- inlinesToParElems ils - -- Now get the slide without the header, and then add the header - -- in. - slide <- blocksToSlide' lvl blks spkNotes - let layout = case slideLayout slide of - ContentSlide _ cont -> ContentSlide hdr cont - TwoColumnSlide _ contL contR -> TwoColumnSlide hdr contL contR - layout' -> layout' - return $ slide{slideLayout = layout} -blocksToSlide' _ (blk : blks) spkNotes +-- | Assuming the slide title is already handled, convert these blocks to the +-- body content for the slide. +bodyBlocksToSlide :: Int -> [Block] -> SpeakerNotes -> Pres Slide +bodyBlocksToSlide _ (blk : blks) spkNotes | Div (_, classes, _) divBlks <- blk , "columns" `elem` classes , Div (_, clsL, _) blksL : Div (_, clsR, _) blksR : remaining <- divBlks @@ -669,7 +654,7 @@ blocksToSlide' _ (blk : blks) spkNotes sldId (TwoColumnSlide [] shapesL shapesR) spkNotes -blocksToSlide' _ (blk : blks) spkNotes = do +bodyBlocksToSlide _ (blk : blks) spkNotes = do inNoteSlide <- asks envInNoteSlide shapes <- if inNoteSlide then forceFontSize noteSize $ blocksToShapes (blk : blks) @@ -680,7 +665,7 @@ blocksToSlide' _ (blk : blks) spkNotes = do sldId (ContentSlide [] shapes) spkNotes -blocksToSlide' _ [] spkNotes = do +bodyBlocksToSlide _ [] spkNotes = do sldId <- asks envCurSlideId return $ Slide @@ -688,6 +673,26 @@ blocksToSlide' _ [] spkNotes = do (ContentSlide [] []) spkNotes +blocksToSlide' :: Int -> [Block] -> SpeakerNotes -> Pres Slide +blocksToSlide' lvl (Header n (ident, _, _) ils : blks) spkNotes + | n < lvl = do + registerAnchorId ident + sldId <- asks envCurSlideId + hdr <- inlinesToParElems ils + return $ Slide sldId (TitleSlide hdr) spkNotes + | n == lvl || lvl == 0 = do + registerAnchorId ident + hdr <- inlinesToParElems ils + -- Now get the slide without the header, and then add the header + -- in. + slide <- bodyBlocksToSlide lvl blks spkNotes + let layout = case slideLayout slide of + ContentSlide _ cont -> ContentSlide hdr cont + TwoColumnSlide _ contL contR -> TwoColumnSlide hdr contL contR + layout' -> layout' + return $ slide{slideLayout = layout} +blocksToSlide' lvl blks spkNotes = bodyBlocksToSlide lvl blks spkNotes + blockToSpeakerNotes :: Block -> Pres SpeakerNotes blockToSpeakerNotes (Div (_, ["notes"], _) blks) = local (\env -> env{envInSpeakerNotes=True}) $ diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 344d20238..fd6d01d2d 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -146,4 +146,29 @@ tests = groupPptxTests [ pptxTests "Inline formatting" [(pack "monofont", toVal $ pack "Consolas")] } "pptx/code.native" "pptx/code-custom.pptx" + , pptxTests ("Using slide level 0, if the first thing on " + <> "a slide is a h1 it's used as the " + <> "slide title") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0-h1-with-image.native" + "pptx/slide-level-0-h1-with-image.pptx" + , pptxTests ("Using slide level 0, if the first thing on " + <> "a slide is a h2 it's used as the " + <> "slide title") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0-h2-with-image.native" + "pptx/slide-level-0-h2-with-image.pptx" + , pptxTests ("Using slide level 0, if the first thing on " + <> "a slide is a heading it's used as the " + <> "slide title (works with a table)") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0-h1-with-table.native" + "pptx/slide-level-0-h1-with-table.pptx" + , pptxTests ("Using slide level 0, if the first thing on " + <> "a slide is a heading it's used as the " + <> "slide title (two headings forces a " + <> "slide break though)") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0-h1-h2-with-table.native" + "pptx/slide-level-0-h1-h2-with-table.pptx" ] diff --git a/test/pptx/slide-level-0-h1-h2-with-table.native b/test/pptx/slide-level-0-h1-h2-with-table.native new file mode 100644 index 000000000..c6e65ecf5 --- /dev/null +++ b/test/pptx/slide-level-0-h1-h2-with-table.native @@ -0,0 +1,14 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Header 2 ("there",[],[]) [Str "There"] +,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + [])] diff --git a/test/pptx/slide-level-0-h1-h2-with-table.pptx b/test/pptx/slide-level-0-h1-h2-with-table.pptx new file mode 100644 index 000000000..197a6833f Binary files /dev/null and b/test/pptx/slide-level-0-h1-h2-with-table.pptx differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx new file mode 100644 index 000000000..5e776e05c Binary files /dev/null and b/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx b/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx new file mode 100644 index 000000000..35204de1b Binary files /dev/null and b/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx b/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx new file mode 100644 index 000000000..5c659952e Binary files /dev/null and b/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-image.native b/test/pptx/slide-level-0-h1-with-image.native new file mode 100644 index 000000000..0f5033b54 --- /dev/null +++ b/test/pptx/slide-level-0-h1-with-image.native @@ -0,0 +1,2 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0-h1-with-image.pptx b/test/pptx/slide-level-0-h1-with-image.pptx new file mode 100644 index 000000000..2f3a53f5c Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-image.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx new file mode 100644 index 000000000..16c61d1be Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx b/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx new file mode 100644 index 000000000..395036069 Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-image_templated.pptx b/test/pptx/slide-level-0-h1-with-image_templated.pptx new file mode 100644 index 000000000..d306375e9 Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-image_templated.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-table.native b/test/pptx/slide-level-0-h1-with-table.native new file mode 100644 index 000000000..b961e900d --- /dev/null +++ b/test/pptx/slide-level-0-h1-with-table.native @@ -0,0 +1,13 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + [])] diff --git a/test/pptx/slide-level-0-h1-with-table.pptx b/test/pptx/slide-level-0-h1-with-table.pptx new file mode 100644 index 000000000..44dbbf90c Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-table.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx new file mode 100644 index 000000000..0eb7c0b08 Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx b/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx new file mode 100644 index 000000000..197499bc3 Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h1-with-table_templated.pptx b/test/pptx/slide-level-0-h1-with-table_templated.pptx new file mode 100644 index 000000000..87b45dda2 Binary files /dev/null and b/test/pptx/slide-level-0-h1-with-table_templated.pptx differ diff --git a/test/pptx/slide-level-0-h2-with-image.native b/test/pptx/slide-level-0-h2-with-image.native new file mode 100644 index 000000000..5def0cb92 --- /dev/null +++ b/test/pptx/slide-level-0-h2-with-image.native @@ -0,0 +1,2 @@ +[Header 2 ("hello",[],[]) [Str "Hello"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0-h2-with-image.pptx b/test/pptx/slide-level-0-h2-with-image.pptx new file mode 100644 index 000000000..948659d6a Binary files /dev/null and b/test/pptx/slide-level-0-h2-with-image.pptx differ diff --git a/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx b/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx new file mode 100644 index 000000000..afc096ce6 Binary files /dev/null and b/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx b/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx new file mode 100644 index 000000000..395036069 Binary files /dev/null and b/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx differ diff --git a/test/pptx/slide-level-0-h2-with-image_templated.pptx b/test/pptx/slide-level-0-h2-with-image_templated.pptx new file mode 100644 index 000000000..d306375e9 Binary files /dev/null and b/test/pptx/slide-level-0-h2-with-image_templated.pptx differ -- cgit v1.2.3 From 7d0db790032bddd29db1eaeb36c9c25929431748 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 27 Aug 2021 16:25:50 -0700 Subject: T.P.Image: svgToPng, change first parameter from WriterOptions to Int. The information we need is just a DPI, so why require more? --- src/Text/Pandoc/Image.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Text/Pandoc/Image.hs b/src/Text/Pandoc/Image.hs index e0c938938..ce3c0e41d 100644 --- a/src/Text/Pandoc/Image.hs +++ b/src/Text/Pandoc/Image.hs @@ -21,14 +21,14 @@ import qualified Control.Exception as E -- | Convert svg image to png. rsvg-convert -- is used and must be available on the path. -svgToPng :: WriterOptions +svgToPng :: Int -> L.ByteString -- ^ Input image as bytestring -> IO (Either Text L.ByteString) -svgToPng opts bs = do - let dpi = show $ writerDpi opts +svgToPng dpi bs = do + let dpi' = show dpi E.catch (do (exit, out) <- pipeProcess Nothing "rsvg-convert" - ["-f","png","-a","--dpi-x",dpi,"--dpi-y",dpi] + ["-f","png","-a","--dpi-x",dpi',"--dpi-y",dpi'] bs return $ if exit == ExitSuccess then Right out -- cgit v1.2.3 From eb7ed27f3f30ef954fe22c8b194f39f8ac8d0029 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 27 Aug 2021 16:35:58 -0700 Subject: Add haddock for dpi parameter. --- src/Text/Pandoc/Image.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Image.hs b/src/Text/Pandoc/Image.hs index ce3c0e41d..468edf2c2 100644 --- a/src/Text/Pandoc/Image.hs +++ b/src/Text/Pandoc/Image.hs @@ -21,7 +21,7 @@ import qualified Control.Exception as E -- | Convert svg image to png. rsvg-convert -- is used and must be available on the path. -svgToPng :: Int +svgToPng :: Int -- ^ DPI -> L.ByteString -- ^ Input image as bytestring -> IO (Either Text L.ByteString) svgToPng dpi bs = do -- cgit v1.2.3 From 4d7cdc467163601fd819199a69860616a9778040 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 27 Aug 2021 22:27:01 -0700 Subject: Image: Generalize svgToPng to MonadIO. --- src/Text/Pandoc/Image.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Text/Pandoc/Image.hs b/src/Text/Pandoc/Image.hs index 468edf2c2..cbc26c981 100644 --- a/src/Text/Pandoc/Image.hs +++ b/src/Text/Pandoc/Image.hs @@ -11,22 +11,23 @@ Portability : portable Functions for converting images. -} module Text.Pandoc.Image ( svgToPng ) where -import Text.Pandoc.Options (WriterOptions(..)) import Text.Pandoc.Process (pipeProcess) import qualified Data.ByteString.Lazy as L import System.Exit import Data.Text (Text) import Text.Pandoc.Shared (tshow) import qualified Control.Exception as E +import Control.Monad.IO.Class (MonadIO(liftIO)) -- | Convert svg image to png. rsvg-convert -- is used and must be available on the path. -svgToPng :: Int -- ^ DPI +svgToPng :: MonadIO m + => Int -- ^ DPI -> L.ByteString -- ^ Input image as bytestring - -> IO (Either Text L.ByteString) + -> m (Either Text L.ByteString) svgToPng dpi bs = do let dpi' = show dpi - E.catch + liftIO $ E.catch (do (exit, out) <- pipeProcess Nothing "rsvg-convert" ["-f","png","-a","--dpi-x",dpi',"--dpi-y",dpi'] bs -- cgit v1.2.3 From 51caa8b78d66ac81253766cc2c6916d39c14efc2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 28 Aug 2021 09:19:50 -0700 Subject: Docx writer: handle SVG images. This change has several parts: - In Text.Pandoc.App, if the writer is docx, we fill the media bag and attempt to convert any SVG images to PNG, adding these to the media bag. The PNG backups have the same filenames as the SVG images, but with an added .png extension. If the conversion cannot be done (e.g. because rsvg-convert is not present), a warning is omitted. - In Text.Pandoc.Writers.Docx, we now use Word 2016's syntax for including SVG images. If a PNG fallback is present in the media bag, we include a link to that too. It would be helpful if someone with an old Word version could test to see that the documents we produce can be opened and viewed with the PNG fallbacks. If not, then perhaps we can eliminate the slightly complex code for producing these fallbacks. Closes #4058. --- src/Text/Pandoc/App.hs | 21 ++++++++++++++++++--- src/Text/Pandoc/Writers/Docx.hs | 41 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 0b7f2458d..15236896c 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -26,7 +26,7 @@ module Text.Pandoc.App ( , applyFilters ) where import qualified Control.Exception as E -import Control.Monad ( (>=>), when ) +import Control.Monad ( (>=>), when, forM_ ) import Control.Monad.Trans ( MonadIO(..) ) import Control.Monad.Except (throwError, catchError) import qualified Data.ByteString as BS @@ -45,12 +45,14 @@ import qualified Data.Text.Encoding.Error as TSE import Network.URI (URI (..), parseURI) import System.Directory (doesDirectoryExist) import System.Exit (exitSuccess) -import System.FilePath ( takeBaseName, takeExtension ) +import System.FilePath ( takeBaseName, takeExtension) import System.IO (nativeNewline, stdout) import qualified System.IO as IO (Newline (..)) import Text.Pandoc import Text.Pandoc.Builder (setMeta) +import Text.Pandoc.MediaBag (mediaItems) import Text.Pandoc.MIME (getCharset, MimeType) +import Text.Pandoc.Image (svgToPng) import Text.Pandoc.App.FormatHeuristics (formatFromFilePaths) import Text.Pandoc.App.Opt (Opt (..), LineEnding (..), defaultOpts, IpynbOutput (..)) @@ -71,7 +73,6 @@ import qualified Text.Pandoc.UTF8 as UTF8 import System.Posix.IO (stdOutput) import System.Posix.Terminal (queryTerminal) #endif --- import Debug.Trace convertWithOpts :: Opt -> IO () convertWithOpts opts = do @@ -274,6 +275,7 @@ convertWithOpts opts = do mconcat <$> mapM (r readerOpts . inputToLazyByteString) inputs) >>= ( (if isJust (optExtractMedia opts) + || writerNameBase == "docx" -- for fallback png creation then fillMediaBag else return) >=> return . adjustMetadata (metadataFromFile <>) @@ -284,6 +286,19 @@ convertWithOpts opts = do >=> maybe return extractMedia (optExtractMedia opts) ) + when (writerNameBase == "docx") $ do -- create fallback pngs for svgs + items <- mediaItems <$> getMediaBag + forM_ items $ \(fp, mt, bs) -> + case T.takeWhile (/=';') mt of + "image/svg+xml" -> do + res <- svgToPng (writerDpi writerOptions) bs + case res of + Right bs' -> do + let fp' = fp <> ".png" + insertMedia fp' (Just "image/png") bs' + Left e -> report $ CouldNotConvertImage (T.pack fp) (tshow e) + _ -> return () + output <- case writer of ByteStringWriter f -> BinaryOutput <$> f writerOptions doc TextWriter f -> case outputPdfProgram outputSettings of diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index efd8b2658..c0e2aae97 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -36,7 +36,9 @@ import Data.Time.Clock.POSIX import Data.Digest.Pure.SHA (sha1, showDigest) import Skylighting import Text.Collate.Lang (renderLang) -import Text.Pandoc.Class.PandocMonad (PandocMonad, report, toLang, translateTerm) +import Text.Pandoc.Class (PandocMonad, report, toLang, translateTerm, + getMediaBag) +import Text.Pandoc.MediaBag (lookupMedia, mediaItems, MediaItem(..)) import qualified Text.Pandoc.Translations as Term import qualified Text.Pandoc.Class.PandocMonad as P import Data.Time @@ -1233,9 +1235,42 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do imgs <- gets stImages let stImage = M.lookup (T.unpack src) imgs - generateImgElt (ident, _, _, img) = do + generateImgElt (ident, _fp, mt, img) = do docprid <- getUniqueId nvpicprid <- getUniqueId + (blipAttrs, blipContents) <- + case T.takeWhile (/=';') <$> mt of + Just "image/svg+xml" -> do + -- get fallback png + mediabag <- getMediaBag + mbFallback <- + case lookupMedia (T.unpack (src <> ".png")) mediabag of + Just item -> do + id' <- T.unpack . ("rId" <>) <$> getUniqueId + let fp' = "media/" <> id' <> ".png" + let imgdata = (id', + fp', + Just (mediaMimeType item), + BL.toStrict $ mediaContents item) + modify $ \st -> st { stImages = + M.insert fp' imgdata $ stImages st } + return $ Just id' + Nothing -> return Nothing + let extLst = mknode "a:extLst" [] + [ mknode "a:ext" + [("uri","{28A0092B-C50C-407E-A947-70E740481C1C}")] + [ mknode "a14:useLocalDpi" + [("xmlns:a14","http://schemas.microsoft.com/office/drawing/2010/main"), + ("val","0")] () ] + , mknode "a:ext" + [("uri","{96DAC541-7B7A-43D3-8B79-37D633B846F1}")] + [ mknode "asvg:svgBlip" + [("xmlns:asvg", "http://schemas.microsoft.com/office/drawing/2016/SVG/main"), + ("r:embed",T.pack ident)] () ] + ] + return (maybe [] (\id'' -> [("r:embed", T.pack id'')]) mbFallback, + [extLst]) + _ -> return ([("r:embed", T.pack ident)], []) let (xpt,ypt) = desiredSizeInPoints opts attr (either (const def) id (imageSize opts img)) @@ -1252,7 +1287,7 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do ,("name","Picture")] () , cNvPicPr ] blipFill = mknode "pic:blipFill" [] - [ mknode "a:blip" [("r:embed",T.pack ident)] () + [ mknode "a:blip" blipAttrs blipContents , mknode "a:stretch" [] $ mknode "a:fillRect" [] () ] -- cgit v1.2.3 From b76796eae8ce842f8414cca8cd8e3b55be513694 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 28 Aug 2021 12:44:03 -0700 Subject: Remove unneeded import. --- src/Text/Pandoc/Writers/Docx.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index c0e2aae97..78d0840a4 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -38,7 +38,7 @@ import Skylighting import Text.Collate.Lang (renderLang) import Text.Pandoc.Class (PandocMonad, report, toLang, translateTerm, getMediaBag) -import Text.Pandoc.MediaBag (lookupMedia, mediaItems, MediaItem(..)) +import Text.Pandoc.MediaBag (lookupMedia, MediaItem(..)) import qualified Text.Pandoc.Translations as Term import qualified Text.Pandoc.Class.PandocMonad as P import Data.Time -- cgit v1.2.3 From d6d7c9620abddc5e5e45450c091bc8a73bac8f66 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 21 Aug 2021 15:30:13 -0700 Subject: Add `--sandbox` option. + Add sandbox feature for readers. When this option is used, readers and writers only have access to input files (and other files specified directly on command line). This restriction is enforced in the type system. + Filters, PDF production, custom writers are unaffected. This feature only insulates the actual readers and writers, not the pipeline around them in Text.Pandoc.App. + Note that when `--sandboxed` is specified, readers won't have access to the resource path, nor will anything have access to the user data directory. + Add module Text.Pandoc.Class.Sandbox, defining `sandbox`. Exported via Text.Pandoc.Class. [API change] Closes #5045. --- MANUAL.txt | 13 ++++- pandoc.cabal | 1 + src/Text/Pandoc/App.hs | 29 ++++++++++-- src/Text/Pandoc/App/CommandLineOptions.hs | 5 ++ src/Text/Pandoc/App/Opt.hs | 4 ++ src/Text/Pandoc/App/OutputSettings.hs | 22 ++++++++- src/Text/Pandoc/Class.hs | 2 + src/Text/Pandoc/Class/PandocSandboxed.hs | 79 ------------------------------- src/Text/Pandoc/Class/Sandbox.hs | 50 +++++++++++++++++++ 9 files changed, 120 insertions(+), 85 deletions(-) delete mode 100644 src/Text/Pandoc/Class/PandocSandboxed.hs create mode 100644 src/Text/Pandoc/Class/Sandbox.hs diff --git a/MANUAL.txt b/MANUAL.txt index 5dc35c8ff..75e74f1cd 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -730,6 +730,16 @@ header when requesting a document from a URL: document in standalone mode. If no *VAL* is specified, the key will be given the value `true`. +`--sandbox` + +: Run pandoc in a sandbox, limiting IO operations in readers + and writers to reading the files specified on the command line. + Note that this option does not limit IO operations by + filters or in the production of PDF documents. But it does + offer security against, for example, disclosure of files + through the use of `include` directives. Anyone using + pandoc on untrusted user input should use this option. + `-D` *FORMAT*, `--print-default-template=`*FORMAT* : Print the system default template for an output *FORMAT*. (See `-t` @@ -6543,7 +6553,8 @@ application, here are some things to keep in mind: 2. Several input formats (including HTML, Org, and RST) support `include` directives that allow the contents of a file to be included in the output. An untrusted attacker could use these to view the contents of - files on the file system. + files on the file system. (Using the `--sandbox` option can + protect against this threat.) 3. If your application uses pandoc as a Haskell library (rather than shelling out to the executable), it is possible to use it in a mode diff --git a/pandoc.cabal b/pandoc.cabal index b90a61942..da53cb1cd 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -622,6 +622,7 @@ library Text.Pandoc.Class.PandocMonad, Text.Pandoc.Class.PandocIO, Text.Pandoc.Class.PandocPure, + Text.Pandoc.Class.Sandbox, Text.Pandoc.Filter.JSON, Text.Pandoc.Filter.Lua, Text.Pandoc.Filter.Path, diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 15236896c..f7c1f218d 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -139,7 +139,26 @@ convertWithOpts opts = do <> "` instead of `pandoc " <> inputFile <> " -o " <> outputFile <> "`." _ -> return () - (reader, readerExts) <- getReader readerName + + let makeSandboxed pureReader = + let files = maybe id (:) (optReferenceDoc opts) . + maybe id (:) (optEpubMetadata opts) . + maybe id (:) (optEpubCoverImage opts) . + maybe id (:) (optCSL opts) . + maybe id (:) (optCitationAbbreviations opts) $ + optEpubFonts opts ++ + optBibliography opts + in case pureReader of + TextReader r -> TextReader $ \o t -> sandbox files (r o t) + ByteStringReader r + -> ByteStringReader $ \o t -> sandbox files (r o t) + + (reader, readerExts) <- + if optSandbox opts + then case runPure (getReader readerName) of + Left e -> throwError e + Right (r, rexts) -> return (makeSandboxed r, rexts) + else getReader readerName outputSettings <- optToOutputSettings opts let format = outputFormat outputSettings @@ -274,8 +293,9 @@ convertWithOpts opts = do ByteStringReader r -> mconcat <$> mapM (r readerOpts . inputToLazyByteString) inputs) >>= - ( (if isJust (optExtractMedia opts) - || writerNameBase == "docx" -- for fallback png creation + ( (if not (optSandbox opts) && + (isJust (optExtractMedia opts) + || writerNameBase == "docx") -- for fallback pngs then fillMediaBag else return) >=> return . adjustMetadata (metadataFromFile <>) @@ -286,7 +306,8 @@ convertWithOpts opts = do >=> maybe return extractMedia (optExtractMedia opts) ) - when (writerNameBase == "docx") $ do -- create fallback pngs for svgs + when (writerNameBase == "docx" && not (optSandbox opts)) $ do + -- create fallback pngs for svgs items <- mediaItems <$> getMediaBag forM_ items $ \(fp, mt, bs) -> case T.takeWhile (/=';') mt of diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index d2c12573c..99017000a 100644 --- a/src/Text/Pandoc/App/CommandLineOptions.hs +++ b/src/Text/Pandoc/App/CommandLineOptions.hs @@ -188,6 +188,11 @@ options = (\opt -> return opt { optFileScope = True })) "" -- "Parse input files before combining" + , Option "" ["sandbox"] + (NoArg + (\opt -> return opt { optSandbox = True })) + "" + , Option "s" ["standalone"] (NoArg (\opt -> return opt { optStandalone = True })) diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs index d54d932b7..48eb15fdf 100644 --- a/src/Text/Pandoc/App/Opt.hs +++ b/src/Text/Pandoc/App/Opt.hs @@ -160,6 +160,7 @@ data Opt = Opt , optCSL :: Maybe FilePath -- ^ CSL stylesheet , optBibliography :: [FilePath] -- ^ Bibliography files , optCitationAbbreviations :: Maybe FilePath -- ^ Citation abbreviations + , optSandbox :: Bool } deriving (Generic, Show) instance FromYAML (Opt -> Opt) where @@ -595,6 +596,8 @@ doOpt (k',v) = do parseYAML v >>= \x -> return (\o -> o{ optEol = x }) "strip-comments" -> parseYAML v >>= \x -> return (\o -> o { optStripComments = x }) + "sandbox" -> + parseYAML v >>= \x -> return (\o -> o { optSandbox = x }) _ -> failAtNode k' $ "Unknown option " ++ show k -- | Defaults for command-line options. @@ -673,6 +676,7 @@ defaultOpts = Opt , optCSL = Nothing , optBibliography = [] , optCitationAbbreviations = Nothing + , optSandbox = False } parseStringKey :: Node Pos -> Parser Text diff --git a/src/Text/Pandoc/App/OutputSettings.hs b/src/Text/Pandoc/App/OutputSettings.hs index 3f83f4b21..7b057713b 100644 --- a/src/Text/Pandoc/App/OutputSettings.hs +++ b/src/Text/Pandoc/App/OutputSettings.hs @@ -90,11 +90,31 @@ optToOutputSettings opts = do then writerName else T.toLower $ baseWriterName writerName + let makeSandboxed pureWriter = + let files = maybe id (:) (optReferenceDoc opts) . + maybe id (:) (optEpubMetadata opts) . + maybe id (:) (optEpubCoverImage opts) . + maybe id (:) (optCSL opts) . + maybe id (:) (optCitationAbbreviations opts) $ + optEpubFonts opts ++ + optBibliography opts + in case pureWriter of + TextWriter w -> TextWriter $ \o d -> sandbox files (w o d) + ByteStringWriter w + -> ByteStringWriter $ \o d -> sandbox files (w o d) + + (writer, writerExts) <- if ".lua" `T.isSuffixOf` format then return (TextWriter (\o d -> writeCustom (T.unpack writerName) o d), mempty) - else getWriter (T.toLower writerName) + else if optSandbox opts + then + case runPure (getWriter writerName) of + Left e -> throwError e + Right (w, wexts) -> + return (makeSandboxed w, wexts) + else getWriter (T.toLower writerName) let standalone = optStandalone opts || not (isTextFormat format) || pdfOutput diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs index 2f28ac4dd..6394df251 100644 --- a/src/Text/Pandoc/Class.hs +++ b/src/Text/Pandoc/Class.hs @@ -19,6 +19,7 @@ module Text.Pandoc.Class , module Text.Pandoc.Class.PandocIO , module Text.Pandoc.Class.PandocMonad , module Text.Pandoc.Class.PandocPure + , module Text.Pandoc.Class.Sandbox , Translations ) where @@ -27,3 +28,4 @@ import Text.Pandoc.Class.PandocMonad import Text.Pandoc.Class.PandocIO import Text.Pandoc.Class.PandocPure import Text.Pandoc.Translations (Translations) +import Text.Pandoc.Class.Sandbox diff --git a/src/Text/Pandoc/Class/PandocSandboxed.hs b/src/Text/Pandoc/Class/PandocSandboxed.hs deleted file mode 100644 index 61ee1f1c6..000000000 --- a/src/Text/Pandoc/Class/PandocSandboxed.hs +++ /dev/null @@ -1,79 +0,0 @@ -{-# LANGUAGE DeriveFunctor #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{- | -Module : Text.Pandoc.Class.PandocIO -Copyright : Copyright (C) 2016-2020 Jesse Rosenthal, John MacFarlane -License : GNU GPL, version 2 or above - -Maintainer : Jesse Rosenthal -Stability : alpha -Portability : portable - -This module defines @'PandocIO'@, an IO-based instance of the -@'PandocMonad'@ type class. File, data, and network access all are run -using IO operators. --} -module Text.Pandoc.Class.PandocIO - ( PandocIO(..) - , runIO - , runIOorExplode - , extractMedia - ) where - -import Control.Monad.Except (ExceptT, MonadError, runExceptT) -import Control.Monad.IO.Class (MonadIO) -import Control.Monad.State (StateT, evalStateT, lift, get, put) -import Data.Default (Default (def)) -import Text.Pandoc.Class.CommonState (CommonState (..)) -import Text.Pandoc.Class.PandocMonad -import Text.Pandoc.Definition -import Text.Pandoc.Error -import qualified Text.Pandoc.Class.IO as IO -import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow) - --- | Evaluate a 'PandocIO' operation. -runIO :: PandocIO a -> IO (Either PandocError a) -runIO ma = flip evalStateT def $ runExceptT $ unPandocIO ma - --- | Evaluate a 'PandocIO' operation, handling any errors --- by exiting with an appropriate message and error status. -runIOorExplode :: PandocIO a -> IO a -runIOorExplode ma = runIO ma >>= handleError - -newtype PandocIO a = PandocIO { - unPandocIO :: ExceptT PandocError (StateT CommonState IO) a - } deriving ( MonadIO - , Functor - , Applicative - , Monad - , MonadCatch - , MonadMask - , MonadThrow - , MonadError PandocError - ) - -instance PandocMonad PandocIO where - lookupEnv = IO.lookupEnv - getCurrentTime = IO.getCurrentTime - getCurrentTimeZone = IO.getCurrentTimeZone - newStdGen = IO.newStdGen - newUniqueHash = IO.newUniqueHash - - openURL = IO.openURL - readFileLazy = IO.readFileLazy - readFileStrict = IO.readFileStrict - readStdinStrict = IO.readStdinStrict - - glob = IO.glob - fileExists = IO.fileExists - getDataFileName = IO.getDataFileName - getModificationTime = IO.getModificationTime - - getCommonState = PandocIO $ lift get - putCommonState = PandocIO . lift . put - - logOutput = IO.logOutput - --- | Extract media from the mediabag into a directory. -extractMedia :: (PandocMonad m, MonadIO m) => FilePath -> Pandoc -> m Pandoc -extractMedia = IO.extractMedia diff --git a/src/Text/Pandoc/Class/Sandbox.hs b/src/Text/Pandoc/Class/Sandbox.hs new file mode 100644 index 000000000..8bc0f1e77 --- /dev/null +++ b/src/Text/Pandoc/Class/Sandbox.hs @@ -0,0 +1,50 @@ +{- | +Module : Text.Pandoc.Class.Sandbox +Copyright : Copyright (C) 2021 John MacFarlane +License : GNU GPL, version 2 or above + +Maintainer : John MacFarlane () +Stability : alpha +Portability : portable + +This module provides a way to run PandocMonad actions in a sandbox +(pure context, with no IO allowed and access only to designated files). +-} + +module Text.Pandoc.Class.Sandbox + ( sandbox ) +where + +import Control.Monad (foldM) +import Control.Monad.Except (throwError) +import Control.Monad.IO.Class (MonadIO (liftIO)) +import Text.Pandoc.Class.PandocMonad +import Text.Pandoc.Class.PandocPure +import Text.Pandoc.Class.CommonState (CommonState(..)) +import Text.Pandoc.Logging (messageVerbosity) + +-- | Lift a PandocPure action into any instance of PandocMonad. +-- The main computation is done purely, but CommonState is preserved +-- continuously, and warnings are emitted after the action completes. +-- The parameter is a list of FilePaths which will be added to the +-- ersatz file system and be available for reading. +sandbox :: (PandocMonad m, MonadIO m) => [FilePath] -> PandocPure a -> m a +sandbox files action = do + oldState <- getCommonState + tree <- liftIO $ foldM addToFileTree mempty files + case runPure (do putCommonState oldState + modifyPureState $ \ps -> ps{ stFiles = tree } + result <- action + st <- getCommonState + return (st, result)) of + Left e -> throwError e + Right (st, result) -> do + putCommonState st + let verbosity = stVerbosity st + -- emit warnings, since these are not printed in runPure + let newMessages = reverse $ take + (length (stLog st) - length (stLog oldState)) (stLog st) + mapM_ logOutput + (filter ((<= verbosity) . messageVerbosity) newMessages) + return result + -- cgit v1.2.3 From 6180d42434526c4c5137ceb4e7bfa284daaf6089 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 28 Aug 2021 21:31:51 -0700 Subject: Add more potential threats to security section of manual. --- MANUAL.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 75e74f1cd..f81f4c70b 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -6556,21 +6556,29 @@ application, here are some things to keep in mind: files on the file system. (Using the `--sandbox` option can protect against this threat.) -3. If your application uses pandoc as a Haskell library (rather than +3. Several output formats (including RTF, FB2, HTML with + `--self-contained`, EPUB, Docx, and ODT) will embed encoded + or raw images into the output file. An untrusted attacker + could exploit this to view the contents of non-image files on the + file system. (Using the `--sandbox` option can protect + against this threat, but will also prevent including images in + these formats.) + +4. If your application uses pandoc as a Haskell library (rather than shelling out to the executable), it is possible to use it in a mode that fully isolates pandoc from your file system, by running the pandoc operations in the `PandocPure` monad. See the document [Using the pandoc API](https://pandoc.org/using-the-pandoc-api.html) for more details. -4. Pandoc's parsers can exhibit pathological performance on some +5. Pandoc's parsers can exhibit pathological performance on some corner cases. It is wise to put any pandoc operations under a timeout, to avoid DOS attacks that exploit these issues. If you are using the pandoc executable, you can add the command line options `+RTS -M512M -RTS` (for example) to limit the heap size to 512MB. -5. The HTML generated by pandoc is not guaranteed to be safe. +6. The HTML generated by pandoc is not guaranteed to be safe. If `raw_html` is enabled for the Markdown input, users can inject arbitrary HTML. Even if `raw_html` is disabled, users can include dangerous content in URLs and attributes. -- cgit v1.2.3 From 5dcd4610e2301baf73f96abcd80315be45d41f3e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 29 Aug 2021 10:12:20 -0700 Subject: Improve asciidoc escaping for `--` in URLs. Closes #7529. --- src/Text/Pandoc/Writers/AsciiDoc.hs | 14 +++++++++++--- test/command/7529.md | 7 +++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 test/command/7529.md diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index ab7e5f1a9..bcef4a089 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -546,6 +546,7 @@ inlineToAsciiDoc opts (Link _ txt (src, _tit)) = do -- or my@email.com[email john] linktext <- inlineListToAsciiDoc opts txt let isRelative = T.all (/= ':') src + let needsPassthrough = "--" `T.isInfixOf` src let prefix = if isRelative then text "link:" else empty @@ -553,9 +554,16 @@ inlineToAsciiDoc opts (Link _ txt (src, _tit)) = do let useAuto = case txt of [Str s] | escapeURI s == srcSuffix -> True _ -> False - return $ if useAuto - then literal srcSuffix - else prefix <> literal src <> "[" <> linktext <> "]" + return $ + if needsPassthrough + then + if useAuto + then "link:++" <> literal srcSuffix <> "++[]" + else "link:++" <> literal src <> "++[" <> linktext <> "]" + else + if useAuto + then literal srcSuffix + else prefix <> literal src <> "[" <> linktext <> "]" inlineToAsciiDoc opts (Image attr alternate (src, tit)) = ("image:" <>) <$> imageArguments opts attr alternate src tit inlineToAsciiDoc opts (Note [Para inlines]) = diff --git a/test/command/7529.md b/test/command/7529.md new file mode 100644 index 000000000..f0c443d73 --- /dev/null +++ b/test/command/7529.md @@ -0,0 +1,7 @@ +``` +pandoc -f html -t asciidoc +https://example.com/show.cgi?id=hi--there--everyone +^D +link:++https://example.com/show.cgi?id=hi--there--everyone++[] +``` + -- cgit v1.2.3 From 7d91ff28ace66fdbe49d7984b56ae097550e166c Mon Sep 17 00:00:00 2001 From: Jeroen de Haas Date: Mon, 30 Aug 2021 12:52:45 +0200 Subject: Do not leak working directory in TikZ filter --- doc/lua-filters.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index e2a65fe1e..52e54cb5b 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -695,12 +695,12 @@ end function RawBlock(el) if starts_with('\\begin{tikzpicture}', el.text) then local filetype = extension_for[FORMAT] or 'svg' - local fname = system.get_working_directory() .. '/' .. - pandoc.sha1(el.text) .. '.' .. filetype + local fbasename = pandoc.sha1(el.text) .. '.' .. filetype + local fname = system.get_working_directory() .. '/' .. fbasename if not file_exists(fname) then tikz2image(el.text, filetype, fname) end - return pandoc.Para({pandoc.Image({}, fname)}) + return pandoc.Para({pandoc.Image({}, fbasename)}) else return el end -- cgit v1.2.3 From 0617d3a88bb1f84622b8a94bd3366c7c8c9e8f8a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 30 Aug 2021 09:38:13 -0700 Subject: Hlint: ignore "Use void." --- .hlint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.hlint.yaml b/.hlint.yaml index ad0f7ddb9..177aa2e32 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -10,6 +10,7 @@ # - ignore: {name: "Avoid lambda"} - ignore: {name: "Use bimap"} +- ignore: {name: "Use void"} - ignore: {name: "Eta reduce"} - ignore: {name: "Evaluate"} - ignore: {name: "Reduce duplication"} # TODO: could be more fine-grained -- cgit v1.2.3 From 8dbea4909211ef7b2acc677288be7c5f10cbb40e Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Wed, 25 Aug 2021 14:35:19 +0100 Subject: pptx: Restructure tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use dashes consistently rather than underscores - Make a folder for each set of tests - List test files explicitly (Cabal doesn’t support ** until version 2.4) --- pandoc.cabal | 55 +++++++++- test/Tests/Writers/Powerpoint.hs | 114 ++++++++++----------- test/pptx/code-custom.pptx | Bin 28184 -> 0 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 0 -> 31033 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 0 -> 41822 bytes test/pptx/code-custom/output.pptx | Bin 0 -> 28184 bytes test/pptx/code-custom/templated.pptx | Bin 0 -> 41337 bytes test/pptx/code-custom_deleted_layouts.pptx | Bin 31033 -> 0 bytes test/pptx/code-custom_moved_layouts.pptx | Bin 41822 -> 0 bytes test/pptx/code-custom_templated.pptx | Bin 41337 -> 0 bytes test/pptx/code.native | 21 ---- test/pptx/code.pptx | Bin 28183 -> 0 bytes test/pptx/code/deleted-layouts.pptx | Bin 0 -> 31032 bytes test/pptx/code/input.native | 21 ++++ test/pptx/code/moved-layouts.pptx | Bin 0 -> 41826 bytes test/pptx/code/output.pptx | Bin 0 -> 28183 bytes test/pptx/code/templated.pptx | Bin 0 -> 41337 bytes test/pptx/code_deleted_layouts.pptx | Bin 31032 -> 0 bytes test/pptx/code_moved_layouts.pptx | Bin 41826 -> 0 bytes test/pptx/code_templated.pptx | Bin 41337 -> 0 bytes test/pptx/document-properties-short-desc.native | 2 - test/pptx/document-properties-short-desc.pptx | Bin 26967 -> 0 bytes .../deleted-layouts.pptx | Bin 0 -> 29806 bytes .../document-properties-short-desc/input.native | 2 + .../moved-layouts.pptx | Bin 0 -> 40600 bytes .../document-properties-short-desc/output.pptx | Bin 0 -> 26967 bytes .../document-properties-short-desc/templated.pptx | Bin 0 -> 40113 bytes ...ment-properties-short-desc_deleted_layouts.pptx | Bin 29806 -> 0 bytes ...cument-properties-short-desc_moved_layouts.pptx | Bin 40600 -> 0 bytes .../document-properties-short-desc_templated.pptx | Bin 40113 -> 0 bytes test/pptx/document-properties.native | 2 - test/pptx/document-properties.pptx | Bin 27375 -> 0 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 0 -> 30210 bytes test/pptx/document-properties/input.native | 2 + test/pptx/document-properties/moved-layouts.pptx | Bin 0 -> 41004 bytes test/pptx/document-properties/output.pptx | Bin 0 -> 27375 bytes test/pptx/document-properties/templated.pptx | Bin 0 -> 40517 bytes test/pptx/document-properties_deleted_layouts.pptx | Bin 30210 -> 0 bytes test/pptx/document-properties_moved_layouts.pptx | Bin 41004 -> 0 bytes test/pptx/document-properties_templated.pptx | Bin 40517 -> 0 bytes test/pptx/endnotes-toc/deleted-layouts.pptx | Bin 0 -> 30596 bytes test/pptx/endnotes-toc/moved-layouts.pptx | Bin 0 -> 41384 bytes test/pptx/endnotes-toc/output.pptx | Bin 0 -> 27747 bytes test/pptx/endnotes-toc/templated.pptx | Bin 0 -> 40899 bytes test/pptx/endnotes.native | 2 - test/pptx/endnotes.pptx | Bin 26928 -> 0 bytes test/pptx/endnotes/deleted-layouts.pptx | Bin 0 -> 29774 bytes test/pptx/endnotes/input.native | 2 + test/pptx/endnotes/moved-layouts.pptx | Bin 0 -> 40566 bytes test/pptx/endnotes/output.pptx | Bin 0 -> 26928 bytes test/pptx/endnotes/templated.pptx | Bin 0 -> 40078 bytes test/pptx/endnotes_deleted_layouts.pptx | Bin 29774 -> 0 bytes test/pptx/endnotes_moved_layouts.pptx | Bin 40566 -> 0 bytes test/pptx/endnotes_templated.pptx | Bin 40078 -> 0 bytes test/pptx/endnotes_toc.pptx | Bin 27747 -> 0 bytes test/pptx/endnotes_toc_deleted_layouts.pptx | Bin 30596 -> 0 bytes test/pptx/endnotes_toc_moved_layouts.pptx | Bin 41384 -> 0 bytes test/pptx/endnotes_toc_templated.pptx | Bin 40899 -> 0 bytes test/pptx/images.native | 5 - test/pptx/images.pptx | Bin 44596 -> 0 bytes test/pptx/images/deleted-layouts.pptx | Bin 0 -> 47437 bytes test/pptx/images/input.native | 5 + test/pptx/images/moved-layouts.pptx | Bin 0 -> 58160 bytes test/pptx/images/output.pptx | Bin 0 -> 44596 bytes test/pptx/images/templated.pptx | Bin 0 -> 57660 bytes test/pptx/images_deleted_layouts.pptx | Bin 47437 -> 0 bytes test/pptx/images_moved_layouts.pptx | Bin 58160 -> 0 bytes test/pptx/images_templated.pptx | Bin 57660 -> 0 bytes test/pptx/inline-formatting/deleted-layouts.pptx | Bin 0 -> 28966 bytes test/pptx/inline-formatting/input.native | 5 + test/pptx/inline-formatting/moved-layouts.pptx | Bin 0 -> 39758 bytes test/pptx/inline-formatting/output.pptx | Bin 0 -> 26121 bytes test/pptx/inline-formatting/templated.pptx | Bin 0 -> 39272 bytes test/pptx/inline_formatting.native | 5 - test/pptx/inline_formatting.pptx | Bin 26121 -> 0 bytes test/pptx/inline_formatting_deleted_layouts.pptx | Bin 28966 -> 0 bytes test/pptx/inline_formatting_moved_layouts.pptx | Bin 39758 -> 0 bytes test/pptx/inline_formatting_templated.pptx | Bin 39272 -> 0 bytes test/pptx/lists.native | 18 ---- test/pptx/lists.pptx | Bin 27015 -> 0 bytes test/pptx/lists/deleted-layouts.pptx | Bin 0 -> 29861 bytes test/pptx/lists/input.native | 18 ++++ test/pptx/lists/moved-layouts.pptx | Bin 0 -> 40653 bytes test/pptx/lists/output.pptx | Bin 0 -> 27015 bytes test/pptx/lists/templated.pptx | Bin 0 -> 40166 bytes test/pptx/lists_deleted_layouts.pptx | Bin 29861 -> 0 bytes test/pptx/lists_moved_layouts.pptx | Bin 40653 -> 0 bytes test/pptx/lists_templated.pptx | Bin 40166 -> 0 bytes test/pptx/raw-ooxml/deleted-layouts.pptx | Bin 0 -> 29754 bytes test/pptx/raw-ooxml/input.native | 3 + test/pptx/raw-ooxml/moved-layouts.pptx | Bin 0 -> 40546 bytes test/pptx/raw-ooxml/output.pptx | Bin 0 -> 26908 bytes test/pptx/raw-ooxml/templated.pptx | Bin 0 -> 40059 bytes test/pptx/raw_ooxml.native | 3 - test/pptx/raw_ooxml.pptx | Bin 26908 -> 0 bytes test/pptx/raw_ooxml_deleted_layouts.pptx | Bin 29754 -> 0 bytes test/pptx/raw_ooxml_moved_layouts.pptx | Bin 40546 -> 0 bytes test/pptx/raw_ooxml_templated.pptx | Bin 40059 -> 0 bytes test/pptx/reference-deleted-layouts.pptx | Bin 0 -> 18160 bytes test/pptx/reference-depth.pptx | Bin 0 -> 43743 bytes test/pptx/reference-moved-layouts.pptx | Bin 0 -> 44237 bytes test/pptx/reference_deleted_layouts.pptx | Bin 18160 -> 0 bytes test/pptx/reference_depth.pptx | Bin 43743 -> 0 bytes test/pptx/reference_moved_layouts.pptx | Bin 44237 -> 0 bytes test/pptx/remove-empty-slides/deleted-layouts.pptx | Bin 0 -> 46867 bytes test/pptx/remove-empty-slides/input.native | 5 + test/pptx/remove-empty-slides/moved-layouts.pptx | Bin 0 -> 57656 bytes test/pptx/remove-empty-slides/output.pptx | Bin 0 -> 44025 bytes test/pptx/remove-empty-slides/templated.pptx | Bin 0 -> 57172 bytes test/pptx/remove_empty_slides.native | 5 - test/pptx/remove_empty_slides.pptx | Bin 44025 -> 0 bytes test/pptx/remove_empty_slides_deleted_layouts.pptx | Bin 46867 -> 0 bytes test/pptx/remove_empty_slides_moved_layouts.pptx | Bin 57656 -> 0 bytes test/pptx/remove_empty_slides_templated.pptx | Bin 57172 -> 0 bytes .../deleted-layouts.pptx | Bin 0 -> 30554 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 0 -> 41343 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 0 -> 27705 bytes .../pptx/slide-breaks-slide-level-1/templated.pptx | Bin 0 -> 40858 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 0 -> 32328 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 0 -> 43118 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 0 -> 29481 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 0 -> 42634 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 0 -> 31378 bytes test/pptx/slide-breaks/input.native | 7 ++ test/pptx/slide-breaks/moved-layouts.pptx | Bin 0 -> 42171 bytes test/pptx/slide-breaks/output.pptx | Bin 0 -> 28531 bytes test/pptx/slide-breaks/templated.pptx | Bin 0 -> 41683 bytes test/pptx/slide-level-0-h1-h2-with-table.native | 14 --- test/pptx/slide-level-0-h1-h2-with-table.pptx | Bin 26985 -> 0 bytes ...e-level-0-h1-h2-with-table_deleted_layouts.pptx | Bin 29828 -> 0 bytes ...ide-level-0-h1-h2-with-table_moved_layouts.pptx | Bin 40552 -> 0 bytes .../slide-level-0-h1-h2-with-table_templated.pptx | Bin 40052 -> 0 bytes test/pptx/slide-level-0-h1-with-image.native | 2 - test/pptx/slide-level-0-h1-with-image.pptx | Bin 42596 -> 0 bytes ...lide-level-0-h1-with-image_deleted_layouts.pptx | Bin 45433 -> 0 bytes .../slide-level-0-h1-with-image_moved_layouts.pptx | Bin 56156 -> 0 bytes .../slide-level-0-h1-with-image_templated.pptx | Bin 55657 -> 0 bytes test/pptx/slide-level-0-h1-with-table.native | 13 --- test/pptx/slide-level-0-h1-with-table.pptx | Bin 26166 -> 0 bytes ...lide-level-0-h1-with-table_deleted_layouts.pptx | Bin 29008 -> 0 bytes .../slide-level-0-h1-with-table_moved_layouts.pptx | Bin 39731 -> 0 bytes .../slide-level-0-h1-with-table_templated.pptx | Bin 39232 -> 0 bytes test/pptx/slide-level-0-h2-with-image.native | 2 - test/pptx/slide-level-0-h2-with-image.pptx | Bin 42596 -> 0 bytes ...lide-level-0-h2-with-image_deleted_layouts.pptx | Bin 45433 -> 0 bytes .../slide-level-0-h2-with-image_moved_layouts.pptx | Bin 56156 -> 0 bytes .../slide-level-0-h2-with-image_templated.pptx | Bin 55657 -> 0 bytes .../h1-h2-with-table/deleted-layouts.pptx | Bin 0 -> 29828 bytes .../slide-level-0/h1-h2-with-table/input.native | 14 +++ .../h1-h2-with-table/moved-layouts.pptx | Bin 0 -> 40552 bytes .../slide-level-0/h1-h2-with-table/output.pptx | Bin 0 -> 26985 bytes .../slide-level-0/h1-h2-with-table/templated.pptx | Bin 0 -> 40052 bytes .../h1-with-image/deleted-layouts.pptx | Bin 0 -> 45433 bytes test/pptx/slide-level-0/h1-with-image/input.native | 2 + .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 0 -> 56156 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 0 -> 42596 bytes .../slide-level-0/h1-with-image/templated.pptx | Bin 0 -> 55657 bytes .../h1-with-table/deleted-layouts.pptx | Bin 0 -> 29008 bytes test/pptx/slide-level-0/h1-with-table/input.native | 13 +++ .../slide-level-0/h1-with-table/moved-layouts.pptx | Bin 0 -> 39731 bytes test/pptx/slide-level-0/h1-with-table/output.pptx | Bin 0 -> 26166 bytes .../slide-level-0/h1-with-table/templated.pptx | Bin 0 -> 39232 bytes .../h2-with-image/deleted-layouts.pptx | Bin 0 -> 45433 bytes test/pptx/slide-level-0/h2-with-image/input.native | 2 + .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 0 -> 56156 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 0 -> 42596 bytes .../slide-level-0/h2-with-image/templated.pptx | Bin 0 -> 55657 bytes test/pptx/slide_breaks.native | 7 -- test/pptx/slide_breaks.pptx | Bin 28531 -> 0 bytes test/pptx/slide_breaks_deleted_layouts.pptx | Bin 31378 -> 0 bytes test/pptx/slide_breaks_moved_layouts.pptx | Bin 42171 -> 0 bytes test/pptx/slide_breaks_slide_level_1.pptx | Bin 27705 -> 0 bytes ...slide_breaks_slide_level_1_deleted_layouts.pptx | Bin 30554 -> 0 bytes .../slide_breaks_slide_level_1_moved_layouts.pptx | Bin 41343 -> 0 bytes .../pptx/slide_breaks_slide_level_1_templated.pptx | Bin 40858 -> 0 bytes test/pptx/slide_breaks_templated.pptx | Bin 41683 -> 0 bytes test/pptx/slide_breaks_toc.pptx | Bin 29481 -> 0 bytes test/pptx/slide_breaks_toc_deleted_layouts.pptx | Bin 32328 -> 0 bytes test/pptx/slide_breaks_toc_moved_layouts.pptx | Bin 43118 -> 0 bytes test/pptx/slide_breaks_toc_templated.pptx | Bin 42634 -> 0 bytes .../deleted-layouts.pptx | Bin 0 -> 34473 bytes .../pptx/speaker-notes-after-metadata/input.native | 5 + .../moved-layouts.pptx | Bin 0 -> 45269 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 0 -> 31636 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 0 -> 44775 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 0 -> 33500 bytes test/pptx/speaker-notes-afterheader/input.native | 3 + .../speaker-notes-afterheader/moved-layouts.pptx | Bin 0 -> 44297 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 0 -> 30657 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 0 -> 43803 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 0 -> 54396 bytes test/pptx/speaker-notes-afterseps/input.native | 63 ++++++++++++ .../speaker-notes-afterseps/moved-layouts.pptx | Bin 0 -> 65121 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 0 -> 51557 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 0 -> 64619 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 0 -> 38203 bytes test/pptx/speaker-notes/input.native | 17 +++ test/pptx/speaker-notes/moved-layouts.pptx | Bin 0 -> 49002 bytes test/pptx/speaker-notes/output.pptx | Bin 0 -> 35360 bytes test/pptx/speaker-notes/templated.pptx | Bin 0 -> 48507 bytes test/pptx/speaker_notes.native | 17 --- test/pptx/speaker_notes.pptx | Bin 35360 -> 0 bytes test/pptx/speaker_notes_after_metadata.native | 5 - test/pptx/speaker_notes_after_metadata.pptx | Bin 31636 -> 0 bytes ...eaker_notes_after_metadata_deleted_layouts.pptx | Bin 34473 -> 0 bytes ...speaker_notes_after_metadata_moved_layouts.pptx | Bin 45269 -> 0 bytes .../speaker_notes_after_metadata_templated.pptx | Bin 44775 -> 0 bytes test/pptx/speaker_notes_afterheader.native | 3 - test/pptx/speaker_notes_afterheader.pptx | Bin 30657 -> 0 bytes .../speaker_notes_afterheader_deleted_layouts.pptx | Bin 33500 -> 0 bytes .../speaker_notes_afterheader_moved_layouts.pptx | Bin 44297 -> 0 bytes test/pptx/speaker_notes_afterheader_templated.pptx | Bin 43803 -> 0 bytes test/pptx/speaker_notes_afterseps.native | 63 ------------ test/pptx/speaker_notes_afterseps.pptx | Bin 51557 -> 0 bytes .../speaker_notes_afterseps_deleted_layouts.pptx | Bin 54396 -> 0 bytes .../speaker_notes_afterseps_moved_layouts.pptx | Bin 65121 -> 0 bytes test/pptx/speaker_notes_afterseps_templated.pptx | Bin 64619 -> 0 bytes test/pptx/speaker_notes_deleted_layouts.pptx | Bin 38203 -> 0 bytes test/pptx/speaker_notes_moved_layouts.pptx | Bin 49002 -> 0 bytes test/pptx/speaker_notes_templated.pptx | Bin 48507 -> 0 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 0 -> 29837 bytes test/pptx/start-numbering-at/input.native | 9 ++ test/pptx/start-numbering-at/moved-layouts.pptx | Bin 0 -> 40630 bytes test/pptx/start-numbering-at/output.pptx | Bin 0 -> 26991 bytes test/pptx/start-numbering-at/templated.pptx | Bin 0 -> 40142 bytes test/pptx/start_numbering_at.native | 9 -- test/pptx/start_numbering_at.pptx | Bin 26991 -> 0 bytes test/pptx/start_numbering_at_deleted_layouts.pptx | Bin 29837 -> 0 bytes test/pptx/start_numbering_at_moved_layouts.pptx | Bin 40630 -> 0 bytes test/pptx/start_numbering_at_templated.pptx | Bin 40142 -> 0 bytes test/pptx/tables.native | 95 ----------------- test/pptx/tables.pptx | Bin 27532 -> 0 bytes test/pptx/tables/deleted-layouts.pptx | Bin 0 -> 30381 bytes test/pptx/tables/input.native | 95 +++++++++++++++++ test/pptx/tables/moved-layouts.pptx | Bin 0 -> 41174 bytes test/pptx/tables/output.pptx | Bin 0 -> 27532 bytes test/pptx/tables/templated.pptx | Bin 0 -> 40686 bytes test/pptx/tables_deleted_layouts.pptx | Bin 30381 -> 0 bytes test/pptx/tables_moved_layouts.pptx | Bin 41174 -> 0 bytes test/pptx/tables_templated.pptx | Bin 40686 -> 0 bytes test/pptx/two-column/deleted-layouts.pptx | Bin 0 -> 28883 bytes test/pptx/two-column/input.native | 9 ++ test/pptx/two-column/moved-layouts.pptx | Bin 0 -> 39676 bytes test/pptx/two-column/output.pptx | Bin 0 -> 26038 bytes test/pptx/two-column/templated.pptx | Bin 0 -> 39189 bytes test/pptx/two_column.native | 9 -- test/pptx/two_column.pptx | Bin 26038 -> 0 bytes test/pptx/two_column_deleted_layouts.pptx | Bin 28883 -> 0 bytes test/pptx/two_column_moved_layouts.pptx | Bin 39676 -> 0 bytes test/pptx/two_column_templated.pptx | Bin 39189 -> 0 bytes 250 files changed, 413 insertions(+), 360 deletions(-) delete mode 100644 test/pptx/code-custom.pptx create mode 100644 test/pptx/code-custom/deleted-layouts.pptx create mode 100644 test/pptx/code-custom/moved-layouts.pptx create mode 100644 test/pptx/code-custom/output.pptx create mode 100644 test/pptx/code-custom/templated.pptx delete mode 100644 test/pptx/code-custom_deleted_layouts.pptx delete mode 100644 test/pptx/code-custom_moved_layouts.pptx delete mode 100644 test/pptx/code-custom_templated.pptx delete mode 100644 test/pptx/code.native delete mode 100644 test/pptx/code.pptx create mode 100644 test/pptx/code/deleted-layouts.pptx create mode 100644 test/pptx/code/input.native create mode 100644 test/pptx/code/moved-layouts.pptx create mode 100644 test/pptx/code/output.pptx create mode 100644 test/pptx/code/templated.pptx delete mode 100644 test/pptx/code_deleted_layouts.pptx delete mode 100644 test/pptx/code_moved_layouts.pptx delete mode 100644 test/pptx/code_templated.pptx delete mode 100644 test/pptx/document-properties-short-desc.native delete mode 100644 test/pptx/document-properties-short-desc.pptx create mode 100644 test/pptx/document-properties-short-desc/deleted-layouts.pptx create mode 100644 test/pptx/document-properties-short-desc/input.native create mode 100644 test/pptx/document-properties-short-desc/moved-layouts.pptx create mode 100644 test/pptx/document-properties-short-desc/output.pptx create mode 100644 test/pptx/document-properties-short-desc/templated.pptx delete mode 100644 test/pptx/document-properties-short-desc_deleted_layouts.pptx delete mode 100644 test/pptx/document-properties-short-desc_moved_layouts.pptx delete mode 100644 test/pptx/document-properties-short-desc_templated.pptx delete mode 100644 test/pptx/document-properties.native delete mode 100644 test/pptx/document-properties.pptx create mode 100644 test/pptx/document-properties/deleted-layouts.pptx create mode 100644 test/pptx/document-properties/input.native create mode 100644 test/pptx/document-properties/moved-layouts.pptx create mode 100644 test/pptx/document-properties/output.pptx create mode 100644 test/pptx/document-properties/templated.pptx delete mode 100644 test/pptx/document-properties_deleted_layouts.pptx delete mode 100644 test/pptx/document-properties_moved_layouts.pptx delete mode 100644 test/pptx/document-properties_templated.pptx create mode 100644 test/pptx/endnotes-toc/deleted-layouts.pptx create mode 100644 test/pptx/endnotes-toc/moved-layouts.pptx create mode 100644 test/pptx/endnotes-toc/output.pptx create mode 100644 test/pptx/endnotes-toc/templated.pptx delete mode 100644 test/pptx/endnotes.native delete mode 100644 test/pptx/endnotes.pptx create mode 100644 test/pptx/endnotes/deleted-layouts.pptx create mode 100644 test/pptx/endnotes/input.native create mode 100644 test/pptx/endnotes/moved-layouts.pptx create mode 100644 test/pptx/endnotes/output.pptx create mode 100644 test/pptx/endnotes/templated.pptx delete mode 100644 test/pptx/endnotes_deleted_layouts.pptx delete mode 100644 test/pptx/endnotes_moved_layouts.pptx delete mode 100644 test/pptx/endnotes_templated.pptx delete mode 100644 test/pptx/endnotes_toc.pptx delete mode 100644 test/pptx/endnotes_toc_deleted_layouts.pptx delete mode 100644 test/pptx/endnotes_toc_moved_layouts.pptx delete mode 100644 test/pptx/endnotes_toc_templated.pptx delete mode 100644 test/pptx/images.native delete mode 100644 test/pptx/images.pptx create mode 100644 test/pptx/images/deleted-layouts.pptx create mode 100644 test/pptx/images/input.native create mode 100644 test/pptx/images/moved-layouts.pptx create mode 100644 test/pptx/images/output.pptx create mode 100644 test/pptx/images/templated.pptx delete mode 100644 test/pptx/images_deleted_layouts.pptx delete mode 100644 test/pptx/images_moved_layouts.pptx delete mode 100644 test/pptx/images_templated.pptx create mode 100644 test/pptx/inline-formatting/deleted-layouts.pptx create mode 100644 test/pptx/inline-formatting/input.native create mode 100644 test/pptx/inline-formatting/moved-layouts.pptx create mode 100644 test/pptx/inline-formatting/output.pptx create mode 100644 test/pptx/inline-formatting/templated.pptx delete mode 100644 test/pptx/inline_formatting.native delete mode 100644 test/pptx/inline_formatting.pptx delete mode 100644 test/pptx/inline_formatting_deleted_layouts.pptx delete mode 100644 test/pptx/inline_formatting_moved_layouts.pptx delete mode 100644 test/pptx/inline_formatting_templated.pptx delete mode 100644 test/pptx/lists.native delete mode 100644 test/pptx/lists.pptx create mode 100644 test/pptx/lists/deleted-layouts.pptx create mode 100644 test/pptx/lists/input.native create mode 100644 test/pptx/lists/moved-layouts.pptx create mode 100644 test/pptx/lists/output.pptx create mode 100644 test/pptx/lists/templated.pptx delete mode 100644 test/pptx/lists_deleted_layouts.pptx delete mode 100644 test/pptx/lists_moved_layouts.pptx delete mode 100644 test/pptx/lists_templated.pptx create mode 100644 test/pptx/raw-ooxml/deleted-layouts.pptx create mode 100644 test/pptx/raw-ooxml/input.native create mode 100644 test/pptx/raw-ooxml/moved-layouts.pptx create mode 100644 test/pptx/raw-ooxml/output.pptx create mode 100644 test/pptx/raw-ooxml/templated.pptx delete mode 100644 test/pptx/raw_ooxml.native delete mode 100644 test/pptx/raw_ooxml.pptx delete mode 100644 test/pptx/raw_ooxml_deleted_layouts.pptx delete mode 100644 test/pptx/raw_ooxml_moved_layouts.pptx delete mode 100644 test/pptx/raw_ooxml_templated.pptx create mode 100644 test/pptx/reference-deleted-layouts.pptx create mode 100644 test/pptx/reference-depth.pptx create mode 100644 test/pptx/reference-moved-layouts.pptx delete mode 100644 test/pptx/reference_deleted_layouts.pptx delete mode 100644 test/pptx/reference_depth.pptx delete mode 100644 test/pptx/reference_moved_layouts.pptx create mode 100644 test/pptx/remove-empty-slides/deleted-layouts.pptx create mode 100644 test/pptx/remove-empty-slides/input.native create mode 100644 test/pptx/remove-empty-slides/moved-layouts.pptx create mode 100644 test/pptx/remove-empty-slides/output.pptx create mode 100644 test/pptx/remove-empty-slides/templated.pptx delete mode 100644 test/pptx/remove_empty_slides.native delete mode 100644 test/pptx/remove_empty_slides.pptx delete mode 100644 test/pptx/remove_empty_slides_deleted_layouts.pptx delete mode 100644 test/pptx/remove_empty_slides_moved_layouts.pptx delete mode 100644 test/pptx/remove_empty_slides_templated.pptx create mode 100644 test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx create mode 100644 test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx create mode 100644 test/pptx/slide-breaks-slide-level-1/output.pptx create mode 100644 test/pptx/slide-breaks-slide-level-1/templated.pptx create mode 100644 test/pptx/slide-breaks-toc/deleted-layouts.pptx create mode 100644 test/pptx/slide-breaks-toc/moved-layouts.pptx create mode 100644 test/pptx/slide-breaks-toc/output.pptx create mode 100644 test/pptx/slide-breaks-toc/templated.pptx create mode 100644 test/pptx/slide-breaks/deleted-layouts.pptx create mode 100644 test/pptx/slide-breaks/input.native create mode 100644 test/pptx/slide-breaks/moved-layouts.pptx create mode 100644 test/pptx/slide-breaks/output.pptx create mode 100644 test/pptx/slide-breaks/templated.pptx delete mode 100644 test/pptx/slide-level-0-h1-h2-with-table.native delete mode 100644 test/pptx/slide-level-0-h1-h2-with-table.pptx delete mode 100644 test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-h2-with-table_templated.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-image.native delete mode 100644 test/pptx/slide-level-0-h1-with-image.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-image_templated.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-table.native delete mode 100644 test/pptx/slide-level-0-h1-with-table.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h1-with-table_templated.pptx delete mode 100644 test/pptx/slide-level-0-h2-with-image.native delete mode 100644 test/pptx/slide-level-0-h2-with-image.pptx delete mode 100644 test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx delete mode 100644 test/pptx/slide-level-0-h2-with-image_templated.pptx create mode 100644 test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-h2-with-table/input.native create mode 100644 test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-h2-with-table/output.pptx create mode 100644 test/pptx/slide-level-0/h1-h2-with-table/templated.pptx create mode 100644 test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-with-image/input.native create mode 100644 test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-with-image/output.pptx create mode 100644 test/pptx/slide-level-0/h1-with-image/templated.pptx create mode 100644 test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-with-table/input.native create mode 100644 test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx create mode 100644 test/pptx/slide-level-0/h1-with-table/output.pptx create mode 100644 test/pptx/slide-level-0/h1-with-table/templated.pptx create mode 100644 test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx create mode 100644 test/pptx/slide-level-0/h2-with-image/input.native create mode 100644 test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx create mode 100644 test/pptx/slide-level-0/h2-with-image/output.pptx create mode 100644 test/pptx/slide-level-0/h2-with-image/templated.pptx delete mode 100644 test/pptx/slide_breaks.native delete mode 100644 test/pptx/slide_breaks.pptx delete mode 100644 test/pptx/slide_breaks_deleted_layouts.pptx delete mode 100644 test/pptx/slide_breaks_moved_layouts.pptx delete mode 100644 test/pptx/slide_breaks_slide_level_1.pptx delete mode 100644 test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx delete mode 100644 test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx delete mode 100644 test/pptx/slide_breaks_slide_level_1_templated.pptx delete mode 100644 test/pptx/slide_breaks_templated.pptx delete mode 100644 test/pptx/slide_breaks_toc.pptx delete mode 100644 test/pptx/slide_breaks_toc_deleted_layouts.pptx delete mode 100644 test/pptx/slide_breaks_toc_moved_layouts.pptx delete mode 100644 test/pptx/slide_breaks_toc_templated.pptx create mode 100644 test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx create mode 100644 test/pptx/speaker-notes-after-metadata/input.native create mode 100644 test/pptx/speaker-notes-after-metadata/moved-layouts.pptx create mode 100644 test/pptx/speaker-notes-after-metadata/output.pptx create mode 100644 test/pptx/speaker-notes-after-metadata/templated.pptx create mode 100644 test/pptx/speaker-notes-afterheader/deleted-layouts.pptx create mode 100644 test/pptx/speaker-notes-afterheader/input.native create mode 100644 test/pptx/speaker-notes-afterheader/moved-layouts.pptx create mode 100644 test/pptx/speaker-notes-afterheader/output.pptx create mode 100644 test/pptx/speaker-notes-afterheader/templated.pptx create mode 100644 test/pptx/speaker-notes-afterseps/deleted-layouts.pptx create mode 100644 test/pptx/speaker-notes-afterseps/input.native create mode 100644 test/pptx/speaker-notes-afterseps/moved-layouts.pptx create mode 100644 test/pptx/speaker-notes-afterseps/output.pptx create mode 100644 test/pptx/speaker-notes-afterseps/templated.pptx create mode 100644 test/pptx/speaker-notes/deleted-layouts.pptx create mode 100644 test/pptx/speaker-notes/input.native create mode 100644 test/pptx/speaker-notes/moved-layouts.pptx create mode 100644 test/pptx/speaker-notes/output.pptx create mode 100644 test/pptx/speaker-notes/templated.pptx delete mode 100644 test/pptx/speaker_notes.native delete mode 100644 test/pptx/speaker_notes.pptx delete mode 100644 test/pptx/speaker_notes_after_metadata.native delete mode 100644 test/pptx/speaker_notes_after_metadata.pptx delete mode 100644 test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx delete mode 100644 test/pptx/speaker_notes_after_metadata_moved_layouts.pptx delete mode 100644 test/pptx/speaker_notes_after_metadata_templated.pptx delete mode 100644 test/pptx/speaker_notes_afterheader.native delete mode 100644 test/pptx/speaker_notes_afterheader.pptx delete mode 100644 test/pptx/speaker_notes_afterheader_deleted_layouts.pptx delete mode 100644 test/pptx/speaker_notes_afterheader_moved_layouts.pptx delete mode 100644 test/pptx/speaker_notes_afterheader_templated.pptx delete mode 100644 test/pptx/speaker_notes_afterseps.native delete mode 100644 test/pptx/speaker_notes_afterseps.pptx delete mode 100644 test/pptx/speaker_notes_afterseps_deleted_layouts.pptx delete mode 100644 test/pptx/speaker_notes_afterseps_moved_layouts.pptx delete mode 100644 test/pptx/speaker_notes_afterseps_templated.pptx delete mode 100644 test/pptx/speaker_notes_deleted_layouts.pptx delete mode 100644 test/pptx/speaker_notes_moved_layouts.pptx delete mode 100644 test/pptx/speaker_notes_templated.pptx create mode 100644 test/pptx/start-numbering-at/deleted-layouts.pptx create mode 100644 test/pptx/start-numbering-at/input.native create mode 100644 test/pptx/start-numbering-at/moved-layouts.pptx create mode 100644 test/pptx/start-numbering-at/output.pptx create mode 100644 test/pptx/start-numbering-at/templated.pptx delete mode 100644 test/pptx/start_numbering_at.native delete mode 100644 test/pptx/start_numbering_at.pptx delete mode 100644 test/pptx/start_numbering_at_deleted_layouts.pptx delete mode 100644 test/pptx/start_numbering_at_moved_layouts.pptx delete mode 100644 test/pptx/start_numbering_at_templated.pptx delete mode 100644 test/pptx/tables.native delete mode 100644 test/pptx/tables.pptx create mode 100644 test/pptx/tables/deleted-layouts.pptx create mode 100644 test/pptx/tables/input.native create mode 100644 test/pptx/tables/moved-layouts.pptx create mode 100644 test/pptx/tables/output.pptx create mode 100644 test/pptx/tables/templated.pptx delete mode 100644 test/pptx/tables_deleted_layouts.pptx delete mode 100644 test/pptx/tables_moved_layouts.pptx delete mode 100644 test/pptx/tables_templated.pptx create mode 100644 test/pptx/two-column/deleted-layouts.pptx create mode 100644 test/pptx/two-column/input.native create mode 100644 test/pptx/two-column/moved-layouts.pptx create mode 100644 test/pptx/two-column/output.pptx create mode 100644 test/pptx/two-column/templated.pptx delete mode 100644 test/pptx/two_column.native delete mode 100644 test/pptx/two_column.pptx delete mode 100644 test/pptx/two_column_deleted_layouts.pptx delete mode 100644 test/pptx/two_column_moved_layouts.pptx delete mode 100644 test/pptx/two_column_templated.pptx diff --git a/pandoc.cabal b/pandoc.cabal index da53cb1cd..7fb951488 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -380,7 +380,60 @@ extra-source-files: test/rtf/*.native test/rtf/*.rtf test/pptx/*.pptx - test/pptx/*.native + test/pptx/code-custom/*.pptx + test/pptx/code/input.native + test/pptx/code/*.pptx + test/pptx/comparison-both-columns/input.native + test/pptx/comparison-both-columns/*.pptx + test/pptx/comparison-extra-text/input.native + test/pptx/comparison-extra-text/*.pptx + test/pptx/comparison-non-text-first/input.native + test/pptx/comparison-non-text-first/*.pptx + test/pptx/comparison-one-column/input.native + test/pptx/comparison-one-column/*.pptx + test/pptx/document-properties-short-desc/input.native + test/pptx/document-properties-short-desc/*.pptx + test/pptx/document-properties/input.native + test/pptx/document-properties/*.pptx + test/pptx/endnotes-toc/*.pptx + test/pptx/endnotes/input.native + test/pptx/endnotes/*.pptx + test/pptx/images/input.native + test/pptx/images/*.pptx + test/pptx/inline-formatting/input.native + test/pptx/inline-formatting/*.pptx + test/pptx/lists/input.native + test/pptx/lists/*.pptx + test/pptx/raw-ooxml/input.native + test/pptx/raw-ooxml/*.pptx + test/pptx/remove-empty-slides/input.native + test/pptx/remove-empty-slides/*.pptx + test/pptx/slide-breaks-slide-level-1/*.pptx + test/pptx/slide-breaks-toc/*.pptx + test/pptx/slide-breaks/input.native + test/pptx/slide-breaks/*.pptx + test/pptx/slide-level-0/h1-h2-with-table/input.native + test/pptx/slide-level-0/h1-h2-with-table/*.pptx + test/pptx/slide-level-0/h1-with-image/input.native + test/pptx/slide-level-0/h1-with-image/*.pptx + test/pptx/slide-level-0/h1-with-table/input.native + test/pptx/slide-level-0/h1-with-table/*.pptx + test/pptx/slide-level-0/h2-with-image/input.native + test/pptx/slide-level-0/h2-with-image/*.pptx + test/pptx/speaker-notes-after-metadata/input.native + test/pptx/speaker-notes-after-metadata/*.pptx + test/pptx/speaker-notes-afterheader/input.native + test/pptx/speaker-notes-afterheader/*.pptx + test/pptx/speaker-notes-afterseps/input.native + test/pptx/speaker-notes-afterseps/*.pptx + test/pptx/speaker-notes/input.native + test/pptx/speaker-notes/*.pptx + test/pptx/start-numbering-at/input.native + test/pptx/start-numbering-at/*.pptx + test/pptx/tables/input.native + test/pptx/tables/*.pptx + test/pptx/two-column/input.native + test/pptx/two-column/*.pptx test/ipynb/*.in.native test/ipynb/*.out.native test/ipynb/*.ipynb diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index fd6d01d2d..fd9871659 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -15,13 +15,13 @@ import Data.List (unzip4) modifyPptxName :: FilePath -> String -> FilePath modifyPptxName fp suffix = - addExtension (dropExtension fp ++ suffix) "pptx" + addExtension (takeDirectory fp ++ suffix) "pptx" pptxTests :: String -> WriterOptions -> FilePath -> FilePath -> (TestTree, TestTree, TestTree, TestTree) pptxTests name opts native pptx = - let referenceDoc = "pptx/reference_depth.pptx" - movedLayoutsReferenceDoc = "pptx/reference_moved_layouts.pptx" - deletedLayoutsReferenceDoc = "pptx/reference_deleted_layouts.pptx" + let referenceDoc = "pptx/reference-depth.pptx" + movedLayoutsReferenceDoc = "pptx/reference-moved-layouts.pptx" + deletedLayoutsReferenceDoc = "pptx/reference-deleted-layouts.pptx" in ( ooxmlTest writePowerpoint @@ -34,19 +34,19 @@ pptxTests name opts native pptx = name opts{writerReferenceDoc=Just referenceDoc} native - (modifyPptxName pptx "_templated") + (modifyPptxName pptx "/templated") , ooxmlTest writePowerpoint name opts{writerReferenceDoc=Just movedLayoutsReferenceDoc} native - (modifyPptxName pptx "_moved_layouts") + (modifyPptxName pptx "/moved-layouts") , ooxmlTest writePowerpoint name opts{writerReferenceDoc=Just deletedLayoutsReferenceDoc} native - (modifyPptxName pptx "_deleted_layouts") + (modifyPptxName pptx "/deleted-layouts") ) groupPptxTests :: [(TestTree, TestTree, TestTree, TestTree)] -> [TestTree] @@ -63,112 +63,112 @@ groupPptxTests pairs = tests :: [TestTree] tests = groupPptxTests [ pptxTests "Inline formatting" def - "pptx/inline_formatting.native" - "pptx/inline_formatting.pptx" + "pptx/inline-formatting/input.native" + "pptx/inline-formatting/output.pptx" , pptxTests "Slide breaks (default slide-level)" def - "pptx/slide_breaks.native" - "pptx/slide_breaks.pptx" + "pptx/slide-breaks/input.native" + "pptx/slide-breaks/output.pptx" , pptxTests "slide breaks (slide-level set to 1)" def{ writerSlideLevel = Just 1 } - "pptx/slide_breaks.native" - "pptx/slide_breaks_slide_level_1.pptx" + "pptx/slide-breaks/input.native" + "pptx/slide-breaks-slide-level-1/output.pptx" , pptxTests "lists" def - "pptx/lists.native" - "pptx/lists.pptx" + "pptx/lists/input.native" + "pptx/lists/output.pptx" , pptxTests "start ordered list at specified num" def - "pptx/start_numbering_at.native" - "pptx/start_numbering_at.pptx" + "pptx/start-numbering-at/input.native" + "pptx/start-numbering-at/output.pptx" , pptxTests "tables" def - "pptx/tables.native" - "pptx/tables.pptx" + "pptx/tables/input.native" + "pptx/tables/output.pptx" , pptxTests "table of contents" def{ writerTableOfContents = True } - "pptx/slide_breaks.native" - "pptx/slide_breaks_toc.pptx" + "pptx/slide-breaks/input.native" + "pptx/slide-breaks-toc/output.pptx" , pptxTests "end notes" def - "pptx/endnotes.native" - "pptx/endnotes.pptx" + "pptx/endnotes/input.native" + "pptx/endnotes/output.pptx" , pptxTests "end notes, with table of contents" def { writerTableOfContents = True } - "pptx/endnotes.native" - "pptx/endnotes_toc.pptx" + "pptx/endnotes/input.native" + "pptx/endnotes-toc/output.pptx" , pptxTests "images" def - "pptx/images.native" - "pptx/images.pptx" + "pptx/images/input.native" + "pptx/images/output.pptx" , pptxTests "two-column layout" def - "pptx/two_column.native" - "pptx/two_column.pptx" + "pptx/two-column/input.native" + "pptx/two-column/output.pptx" , pptxTests "speaker notes" def - "pptx/speaker_notes.native" - "pptx/speaker_notes.pptx" + "pptx/speaker-notes/input.native" + "pptx/speaker-notes/output.pptx" , pptxTests "speaker notes after a separating block" def - "pptx/speaker_notes_afterseps.native" - "pptx/speaker_notes_afterseps.pptx" + "pptx/speaker-notes-afterseps/input.native" + "pptx/speaker-notes-afterseps/output.pptx" , pptxTests "speaker notes after a separating header" def - "pptx/speaker_notes_afterheader.native" - "pptx/speaker_notes_afterheader.pptx" + "pptx/speaker-notes-afterheader/input.native" + "pptx/speaker-notes-afterheader/output.pptx" , pptxTests "speaker notes after metadata" def - "pptx/speaker_notes_after_metadata.native" - "pptx/speaker_notes_after_metadata.pptx" + "pptx/speaker-notes-after-metadata/input.native" + "pptx/speaker-notes-after-metadata/output.pptx" , pptxTests "remove empty slides" def - "pptx/remove_empty_slides.native" - "pptx/remove_empty_slides.pptx" + "pptx/remove-empty-slides/input.native" + "pptx/remove-empty-slides/output.pptx" , pptxTests "raw ooxml" def - "pptx/raw_ooxml.native" - "pptx/raw_ooxml.pptx" + "pptx/raw-ooxml/input.native" + "pptx/raw-ooxml/output.pptx" , pptxTests "metadata, custom properties" def - "pptx/document-properties.native" - "pptx/document-properties.pptx" + "pptx/document-properties/input.native" + "pptx/document-properties/output.pptx" , pptxTests "metadata, short description" def - "pptx/document-properties-short-desc.native" - "pptx/document-properties-short-desc.pptx" + "pptx/document-properties-short-desc/input.native" + "pptx/document-properties-short-desc/output.pptx" , pptxTests "inline code and code blocks" def - "pptx/code.native" - "pptx/code.pptx" + "pptx/code/input.native" + "pptx/code/output.pptx" , pptxTests "inline code and code blocks, custom formatting" def { writerVariables = Context $ M.fromList [(pack "monofont", toVal $ pack "Consolas")] } - "pptx/code.native" - "pptx/code-custom.pptx" + "pptx/code/input.native" + "pptx/code-custom/output.pptx" , pptxTests ("Using slide level 0, if the first thing on " <> "a slide is a h1 it's used as the " <> "slide title") def { writerSlideLevel = Just 0 } - "pptx/slide-level-0-h1-with-image.native" - "pptx/slide-level-0-h1-with-image.pptx" + "pptx/slide-level-0/h1-with-image/input.native" + "pptx/slide-level-0/h1-with-image/output.pptx" , pptxTests ("Using slide level 0, if the first thing on " <> "a slide is a h2 it's used as the " <> "slide title") def { writerSlideLevel = Just 0 } - "pptx/slide-level-0-h2-with-image.native" - "pptx/slide-level-0-h2-with-image.pptx" + "pptx/slide-level-0/h2-with-image/input.native" + "pptx/slide-level-0/h2-with-image/output.pptx" , pptxTests ("Using slide level 0, if the first thing on " <> "a slide is a heading it's used as the " <> "slide title (works with a table)") def { writerSlideLevel = Just 0 } - "pptx/slide-level-0-h1-with-table.native" - "pptx/slide-level-0-h1-with-table.pptx" + "pptx/slide-level-0/h1-with-table/input.native" + "pptx/slide-level-0/h1-with-table/output.pptx" , pptxTests ("Using slide level 0, if the first thing on " <> "a slide is a heading it's used as the " <> "slide title (two headings forces a " <> "slide break though)") def { writerSlideLevel = Just 0 } - "pptx/slide-level-0-h1-h2-with-table.native" - "pptx/slide-level-0-h1-h2-with-table.pptx" + "pptx/slide-level-0/h1-h2-with-table/input.native" + "pptx/slide-level-0/h1-h2-with-table/output.pptx" ] diff --git a/test/pptx/code-custom.pptx b/test/pptx/code-custom.pptx deleted file mode 100644 index 5e9c2c630..000000000 Binary files a/test/pptx/code-custom.pptx and /dev/null differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx new file mode 100644 index 000000000..9282e6354 Binary files /dev/null and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx new file mode 100644 index 000000000..a14eeb6c8 Binary files /dev/null and b/test/pptx/code-custom/moved-layouts.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx new file mode 100644 index 000000000..5e9c2c630 Binary files /dev/null and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx new file mode 100644 index 000000000..0e640f373 Binary files /dev/null and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code-custom_deleted_layouts.pptx b/test/pptx/code-custom_deleted_layouts.pptx deleted file mode 100644 index 9282e6354..000000000 Binary files a/test/pptx/code-custom_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/code-custom_moved_layouts.pptx b/test/pptx/code-custom_moved_layouts.pptx deleted file mode 100644 index a14eeb6c8..000000000 Binary files a/test/pptx/code-custom_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/code-custom_templated.pptx b/test/pptx/code-custom_templated.pptx deleted file mode 100644 index 0e640f373..000000000 Binary files a/test/pptx/code-custom_templated.pptx and /dev/null differ diff --git a/test/pptx/code.native b/test/pptx/code.native deleted file mode 100644 index be7f512f7..000000000 --- a/test/pptx/code.native +++ /dev/null @@ -1,21 +0,0 @@ -[Header 1 ("header-with-inline-code",[],[]) [Str "Header",Space,Str "with",Space,Code ("",[],[]) "inline code"] -,CodeBlock ("",[],[]) "Code at level 0" -,BulletList - [[Para [Str "Bullet",Space,Str "item",Space,Str "with",Space,Code ("",[],[]) "inline code"] - ,CodeBlock ("",[],[]) "Code block at level 1" - ,BulletList - [[Para [Str "with",Space,Code ("",[],[]) "nested"] - ,CodeBlock ("",[],[]) "lvl2\nlvl2\nlvl2" - ,Header 2 ("second-heading-level-with-code",[],[]) [Str "Second",Space,Str "heading",Space,Str "level",Space,Str "with",Space,Code ("",[],[]) "code"]]]]] -,Header 1 ("syntax-highlighting",[],[]) [Str "Syntax",Space,Str "highlighting"] -,CodeBlock ("",["haskell"],[]) "id :: a -> a\nid x = x" -,BulletList - [[Para [Str "Nested"] - ,CodeBlock ("",["haskell"],[]) "g :: Int -> Int\ng x = x * 3"]] -,Header 1 ("two-column-slide",[],[]) [Str "Two",Space,Str "column",Space,Str "slide"] -,Div ("",["columns"],[]) - [Div ("",["column"],[("width","50%")]) - [BulletList - [[Plain [Str "A",Space,Str "total",Space,Str "alternative",Space,Str "for",Space,Code ("",[],[]) "head"]]]] - ,Div ("",["column"],[("width","50%")]) - [CodeBlock ("",[],[]) "safeHead :: [a] -> Maybe a\nsafeHead [] = Nothing\nsafeHead (x:_) = Just x"]]] diff --git a/test/pptx/code.pptx b/test/pptx/code.pptx deleted file mode 100644 index aab0cc6f5..000000000 Binary files a/test/pptx/code.pptx and /dev/null differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx new file mode 100644 index 000000000..0f503f553 Binary files /dev/null and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/code/input.native b/test/pptx/code/input.native new file mode 100644 index 000000000..be7f512f7 --- /dev/null +++ b/test/pptx/code/input.native @@ -0,0 +1,21 @@ +[Header 1 ("header-with-inline-code",[],[]) [Str "Header",Space,Str "with",Space,Code ("",[],[]) "inline code"] +,CodeBlock ("",[],[]) "Code at level 0" +,BulletList + [[Para [Str "Bullet",Space,Str "item",Space,Str "with",Space,Code ("",[],[]) "inline code"] + ,CodeBlock ("",[],[]) "Code block at level 1" + ,BulletList + [[Para [Str "with",Space,Code ("",[],[]) "nested"] + ,CodeBlock ("",[],[]) "lvl2\nlvl2\nlvl2" + ,Header 2 ("second-heading-level-with-code",[],[]) [Str "Second",Space,Str "heading",Space,Str "level",Space,Str "with",Space,Code ("",[],[]) "code"]]]]] +,Header 1 ("syntax-highlighting",[],[]) [Str "Syntax",Space,Str "highlighting"] +,CodeBlock ("",["haskell"],[]) "id :: a -> a\nid x = x" +,BulletList + [[Para [Str "Nested"] + ,CodeBlock ("",["haskell"],[]) "g :: Int -> Int\ng x = x * 3"]] +,Header 1 ("two-column-slide",[],[]) [Str "Two",Space,Str "column",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[("width","50%")]) + [BulletList + [[Plain [Str "A",Space,Str "total",Space,Str "alternative",Space,Str "for",Space,Code ("",[],[]) "head"]]]] + ,Div ("",["column"],[("width","50%")]) + [CodeBlock ("",[],[]) "safeHead :: [a] -> Maybe a\nsafeHead [] = Nothing\nsafeHead (x:_) = Just x"]]] diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx new file mode 100644 index 000000000..4d66b1310 Binary files /dev/null and b/test/pptx/code/moved-layouts.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx new file mode 100644 index 000000000..aab0cc6f5 Binary files /dev/null and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx new file mode 100644 index 000000000..a03109217 Binary files /dev/null and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/code_deleted_layouts.pptx b/test/pptx/code_deleted_layouts.pptx deleted file mode 100644 index 0f503f553..000000000 Binary files a/test/pptx/code_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/code_moved_layouts.pptx b/test/pptx/code_moved_layouts.pptx deleted file mode 100644 index 4d66b1310..000000000 Binary files a/test/pptx/code_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/code_templated.pptx b/test/pptx/code_templated.pptx deleted file mode 100644 index a03109217..000000000 Binary files a/test/pptx/code_templated.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc.native b/test/pptx/document-properties-short-desc.native deleted file mode 100644 index fe3193dc1..000000000 --- a/test/pptx/document-properties-short-desc.native +++ /dev/null @@ -1,2 +0,0 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "A.",Space,Str "M."]]),("description",MetaInlines [Str "Short",Space,RawInline (Format "html") "",Str "description",RawInline (Format "html") "",Space,Str "&."]),("keywords",MetaList [MetaInlines [Str "keyword",Space,Str "1"],MetaInlines [Str "keyword",Space,Str "2"]]),("subject",MetaInlines [Str "This",Space,Str "is",Space,Str "the",Space,Str "subject"]),("title",MetaInlines [Str "Testing",Space,Str "custom",Space,Str "properties"])]}) -[Para [Str "Testing",Space,Str "document",Space,Str "properties"]] diff --git a/test/pptx/document-properties-short-desc.pptx b/test/pptx/document-properties-short-desc.pptx deleted file mode 100644 index de5e68151..000000000 Binary files a/test/pptx/document-properties-short-desc.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx new file mode 100644 index 000000000..e4cf6bd7b Binary files /dev/null and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/input.native b/test/pptx/document-properties-short-desc/input.native new file mode 100644 index 000000000..fe3193dc1 --- /dev/null +++ b/test/pptx/document-properties-short-desc/input.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "A.",Space,Str "M."]]),("description",MetaInlines [Str "Short",Space,RawInline (Format "html") "",Str "description",RawInline (Format "html") "",Space,Str "&."]),("keywords",MetaList [MetaInlines [Str "keyword",Space,Str "1"],MetaInlines [Str "keyword",Space,Str "2"]]),("subject",MetaInlines [Str "This",Space,Str "is",Space,Str "the",Space,Str "subject"]),("title",MetaInlines [Str "Testing",Space,Str "custom",Space,Str "properties"])]}) +[Para [Str "Testing",Space,Str "document",Space,Str "properties"]] diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx new file mode 100644 index 000000000..8834f885f Binary files /dev/null and b/test/pptx/document-properties-short-desc/moved-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx new file mode 100644 index 000000000..de5e68151 Binary files /dev/null and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/templated.pptx b/test/pptx/document-properties-short-desc/templated.pptx new file mode 100644 index 000000000..d39dc0c91 Binary files /dev/null and b/test/pptx/document-properties-short-desc/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc_deleted_layouts.pptx b/test/pptx/document-properties-short-desc_deleted_layouts.pptx deleted file mode 100644 index e4cf6bd7b..000000000 Binary files a/test/pptx/document-properties-short-desc_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc_moved_layouts.pptx b/test/pptx/document-properties-short-desc_moved_layouts.pptx deleted file mode 100644 index 8834f885f..000000000 Binary files a/test/pptx/document-properties-short-desc_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc_templated.pptx b/test/pptx/document-properties-short-desc_templated.pptx deleted file mode 100644 index d39dc0c91..000000000 Binary files a/test/pptx/document-properties-short-desc_templated.pptx and /dev/null differ diff --git a/test/pptx/document-properties.native b/test/pptx/document-properties.native deleted file mode 100644 index 59ca53f4d..000000000 --- a/test/pptx/document-properties.native +++ /dev/null @@ -1,2 +0,0 @@ -Pandoc (Meta {unMeta = fromList [("Company",MetaInlines [Str "My",Space,Str "Company"]),("Second Custom Property",MetaInlines [Str "Second",Space,Str "custom",Space,Str "property",Space,Str "value"]),("abstract",MetaBlocks [Plain [Str "Quite",Space,Str "a",Space,Str "long",Space,Str "description",SoftBreak,Str "spanning",Space,Str "several",Space,Str "lines"]]),("author",MetaList [MetaInlines [Str "A.",Space,Str "M."]]),("category",MetaInlines [Str "My",Space,Str "Category"]),("custom1",MetaInlines [Str "First",Space,Str "custom",Space,Str "property",Space,Str "value"]),("custom3",MetaInlines [Str "Escaping",Space,Str "amp",Space,Str "&",Space,Str "."]),("custom4",MetaInlines [Str "Escaping",Space,Str "LT,GT",Space,Str "<",Space,Str "asdf",Space,Str ">",Space,Str "<"]),("custom5",MetaInlines [Str "Escaping",Space,Str "html",Space,RawInline (Format "html") "",Str "asdf",RawInline (Format "html") ""]),("custom6",MetaInlines [Str "Escaping",Space,Emph [Str "MD"],Space,Str "\225",Space,Str "a"]),("custom9",MetaInlines [Str "Extended",Space,Str "chars:",Space,Str "\8364",Space,Str "\225",Space,Str "\233",Space,Str "\237",Space,Str "\243",Space,Str "\250",Space,Str "$"]),("description",MetaBlocks [Para [Str "Long",Space,Str "description",Space,Str "spanning",SoftBreak,Str "several",Space,Str "lines."],Plain [Str "This",Space,Str "is",Space,Str "\225",Space,Str "second",Space,RawInline (Format "html") "",Str "line",RawInline (Format "html") "",Str "."]]),("keywords",MetaList [MetaInlines [Str "keyword",Space,Str "1"],MetaInlines [Str "keyword",Space,Str "2"]]),("lang",MetaInlines [Str "en-US"]),("nested-custom",MetaList [MetaMap (fromList [("custom 7",MetaInlines [Str "Nested",Space,Str "Custom",Space,Str "value",Space,Str "7"])]),MetaMap (fromList [("custom 8",MetaInlines [Str "Nested",Space,Str "Custom",Space,Str "value",Space,Str "8"])])]),("subject",MetaInlines [Str "This",Space,Str "is",Space,Str "the",Space,Str "subject"]),("subtitle",MetaInlines [Str "This",Space,Str "is",Space,Str "a",Space,Str "subtitle"]),("title",MetaInlines [Str "Testing",Space,Str "custom",Space,Str "properties"])]}) -[Para [Str "Testing",Space,Str "document",Space,Str "properties"]] diff --git a/test/pptx/document-properties.pptx b/test/pptx/document-properties.pptx deleted file mode 100644 index 6bcbd1b9c..000000000 Binary files a/test/pptx/document-properties.pptx and /dev/null differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx new file mode 100644 index 000000000..a00c8059d Binary files /dev/null and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/input.native b/test/pptx/document-properties/input.native new file mode 100644 index 000000000..59ca53f4d --- /dev/null +++ b/test/pptx/document-properties/input.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList [("Company",MetaInlines [Str "My",Space,Str "Company"]),("Second Custom Property",MetaInlines [Str "Second",Space,Str "custom",Space,Str "property",Space,Str "value"]),("abstract",MetaBlocks [Plain [Str "Quite",Space,Str "a",Space,Str "long",Space,Str "description",SoftBreak,Str "spanning",Space,Str "several",Space,Str "lines"]]),("author",MetaList [MetaInlines [Str "A.",Space,Str "M."]]),("category",MetaInlines [Str "My",Space,Str "Category"]),("custom1",MetaInlines [Str "First",Space,Str "custom",Space,Str "property",Space,Str "value"]),("custom3",MetaInlines [Str "Escaping",Space,Str "amp",Space,Str "&",Space,Str "."]),("custom4",MetaInlines [Str "Escaping",Space,Str "LT,GT",Space,Str "<",Space,Str "asdf",Space,Str ">",Space,Str "<"]),("custom5",MetaInlines [Str "Escaping",Space,Str "html",Space,RawInline (Format "html") "",Str "asdf",RawInline (Format "html") ""]),("custom6",MetaInlines [Str "Escaping",Space,Emph [Str "MD"],Space,Str "\225",Space,Str "a"]),("custom9",MetaInlines [Str "Extended",Space,Str "chars:",Space,Str "\8364",Space,Str "\225",Space,Str "\233",Space,Str "\237",Space,Str "\243",Space,Str "\250",Space,Str "$"]),("description",MetaBlocks [Para [Str "Long",Space,Str "description",Space,Str "spanning",SoftBreak,Str "several",Space,Str "lines."],Plain [Str "This",Space,Str "is",Space,Str "\225",Space,Str "second",Space,RawInline (Format "html") "",Str "line",RawInline (Format "html") "",Str "."]]),("keywords",MetaList [MetaInlines [Str "keyword",Space,Str "1"],MetaInlines [Str "keyword",Space,Str "2"]]),("lang",MetaInlines [Str "en-US"]),("nested-custom",MetaList [MetaMap (fromList [("custom 7",MetaInlines [Str "Nested",Space,Str "Custom",Space,Str "value",Space,Str "7"])]),MetaMap (fromList [("custom 8",MetaInlines [Str "Nested",Space,Str "Custom",Space,Str "value",Space,Str "8"])])]),("subject",MetaInlines [Str "This",Space,Str "is",Space,Str "the",Space,Str "subject"]),("subtitle",MetaInlines [Str "This",Space,Str "is",Space,Str "a",Space,Str "subtitle"]),("title",MetaInlines [Str "Testing",Space,Str "custom",Space,Str "properties"])]}) +[Para [Str "Testing",Space,Str "document",Space,Str "properties"]] diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx new file mode 100644 index 000000000..c1d2d5282 Binary files /dev/null and b/test/pptx/document-properties/moved-layouts.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx new file mode 100644 index 000000000..6bcbd1b9c Binary files /dev/null and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/document-properties/templated.pptx b/test/pptx/document-properties/templated.pptx new file mode 100644 index 000000000..841ae8c42 Binary files /dev/null and b/test/pptx/document-properties/templated.pptx differ diff --git a/test/pptx/document-properties_deleted_layouts.pptx b/test/pptx/document-properties_deleted_layouts.pptx deleted file mode 100644 index a00c8059d..000000000 Binary files a/test/pptx/document-properties_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties_moved_layouts.pptx b/test/pptx/document-properties_moved_layouts.pptx deleted file mode 100644 index c1d2d5282..000000000 Binary files a/test/pptx/document-properties_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties_templated.pptx b/test/pptx/document-properties_templated.pptx deleted file mode 100644 index 841ae8c42..000000000 Binary files a/test/pptx/document-properties_templated.pptx and /dev/null differ diff --git a/test/pptx/endnotes-toc/deleted-layouts.pptx b/test/pptx/endnotes-toc/deleted-layouts.pptx new file mode 100644 index 000000000..46708544c Binary files /dev/null and b/test/pptx/endnotes-toc/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes-toc/moved-layouts.pptx b/test/pptx/endnotes-toc/moved-layouts.pptx new file mode 100644 index 000000000..d1200bd7d Binary files /dev/null and b/test/pptx/endnotes-toc/moved-layouts.pptx differ diff --git a/test/pptx/endnotes-toc/output.pptx b/test/pptx/endnotes-toc/output.pptx new file mode 100644 index 000000000..a028b346f Binary files /dev/null and b/test/pptx/endnotes-toc/output.pptx differ diff --git a/test/pptx/endnotes-toc/templated.pptx b/test/pptx/endnotes-toc/templated.pptx new file mode 100644 index 000000000..38a0c437d Binary files /dev/null and b/test/pptx/endnotes-toc/templated.pptx differ diff --git a/test/pptx/endnotes.native b/test/pptx/endnotes.native deleted file mode 100644 index f6caeb62f..000000000 --- a/test/pptx/endnotes.native +++ /dev/null @@ -1,2 +0,0 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Str "Here",Space,Str "is",Space,Str "one",Space,Str "note.",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "note."]],Space,Str "And",Space,Str "one",Space,Str "more",Space,Str "note.",Note [Para [Str "And",Space,Str "another",Space,Str "note."]]]] diff --git a/test/pptx/endnotes.pptx b/test/pptx/endnotes.pptx deleted file mode 100644 index 9d46036fe..000000000 Binary files a/test/pptx/endnotes.pptx and /dev/null differ diff --git a/test/pptx/endnotes/deleted-layouts.pptx b/test/pptx/endnotes/deleted-layouts.pptx new file mode 100644 index 000000000..5c69a6310 Binary files /dev/null and b/test/pptx/endnotes/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes/input.native b/test/pptx/endnotes/input.native new file mode 100644 index 000000000..f6caeb62f --- /dev/null +++ b/test/pptx/endnotes/input.native @@ -0,0 +1,2 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Str "Here",Space,Str "is",Space,Str "one",Space,Str "note.",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "note."]],Space,Str "And",Space,Str "one",Space,Str "more",Space,Str "note.",Note [Para [Str "And",Space,Str "another",Space,Str "note."]]]] diff --git a/test/pptx/endnotes/moved-layouts.pptx b/test/pptx/endnotes/moved-layouts.pptx new file mode 100644 index 000000000..0d4c491b9 Binary files /dev/null and b/test/pptx/endnotes/moved-layouts.pptx differ diff --git a/test/pptx/endnotes/output.pptx b/test/pptx/endnotes/output.pptx new file mode 100644 index 000000000..9d46036fe Binary files /dev/null and b/test/pptx/endnotes/output.pptx differ diff --git a/test/pptx/endnotes/templated.pptx b/test/pptx/endnotes/templated.pptx new file mode 100644 index 000000000..863cc29d4 Binary files /dev/null and b/test/pptx/endnotes/templated.pptx differ diff --git a/test/pptx/endnotes_deleted_layouts.pptx b/test/pptx/endnotes_deleted_layouts.pptx deleted file mode 100644 index 5c69a6310..000000000 Binary files a/test/pptx/endnotes_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes_moved_layouts.pptx b/test/pptx/endnotes_moved_layouts.pptx deleted file mode 100644 index 0d4c491b9..000000000 Binary files a/test/pptx/endnotes_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes_templated.pptx b/test/pptx/endnotes_templated.pptx deleted file mode 100644 index 863cc29d4..000000000 Binary files a/test/pptx/endnotes_templated.pptx and /dev/null differ diff --git a/test/pptx/endnotes_toc.pptx b/test/pptx/endnotes_toc.pptx deleted file mode 100644 index a028b346f..000000000 Binary files a/test/pptx/endnotes_toc.pptx and /dev/null differ diff --git a/test/pptx/endnotes_toc_deleted_layouts.pptx b/test/pptx/endnotes_toc_deleted_layouts.pptx deleted file mode 100644 index 46708544c..000000000 Binary files a/test/pptx/endnotes_toc_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes_toc_moved_layouts.pptx b/test/pptx/endnotes_toc_moved_layouts.pptx deleted file mode 100644 index d1200bd7d..000000000 Binary files a/test/pptx/endnotes_toc_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes_toc_templated.pptx b/test/pptx/endnotes_toc_templated.pptx deleted file mode 100644 index 38a0c437d..000000000 Binary files a/test/pptx/endnotes_toc_templated.pptx and /dev/null differ diff --git a/test/pptx/images.native b/test/pptx/images.native deleted file mode 100644 index 54827e5cc..000000000 --- a/test/pptx/images.native +++ /dev/null @@ -1,5 +0,0 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Image ("",[],[]) [] ("lalune.jpg","")] -,Para [Image ("",[],[]) [Str "The",Space,Str "Moon"] ("lalune.jpg","fig:")] -,Header 1 ("one-more",[],[]) [Str "One",Space,Str "More"] -,Para [Image ("",[],[]) [Str "The",Space,Str "Moon"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/images.pptx b/test/pptx/images.pptx deleted file mode 100644 index 89325e577..000000000 Binary files a/test/pptx/images.pptx and /dev/null differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx new file mode 100644 index 000000000..053928863 Binary files /dev/null and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/images/input.native b/test/pptx/images/input.native new file mode 100644 index 000000000..54827e5cc --- /dev/null +++ b/test/pptx/images/input.native @@ -0,0 +1,5 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Image ("",[],[]) [] ("lalune.jpg","")] +,Para [Image ("",[],[]) [Str "The",Space,Str "Moon"] ("lalune.jpg","fig:")] +,Header 1 ("one-more",[],[]) [Str "One",Space,Str "More"] +,Para [Image ("",[],[]) [Str "The",Space,Str "Moon"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx new file mode 100644 index 000000000..7951a09f6 Binary files /dev/null and b/test/pptx/images/moved-layouts.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx new file mode 100644 index 000000000..89325e577 Binary files /dev/null and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/images/templated.pptx b/test/pptx/images/templated.pptx new file mode 100644 index 000000000..7c0ed9a17 Binary files /dev/null and b/test/pptx/images/templated.pptx differ diff --git a/test/pptx/images_deleted_layouts.pptx b/test/pptx/images_deleted_layouts.pptx deleted file mode 100644 index 053928863..000000000 Binary files a/test/pptx/images_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/images_moved_layouts.pptx b/test/pptx/images_moved_layouts.pptx deleted file mode 100644 index 7951a09f6..000000000 Binary files a/test/pptx/images_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/images_templated.pptx b/test/pptx/images_templated.pptx deleted file mode 100644 index 7c0ed9a17..000000000 Binary files a/test/pptx/images_templated.pptx and /dev/null differ diff --git a/test/pptx/inline-formatting/deleted-layouts.pptx b/test/pptx/inline-formatting/deleted-layouts.pptx new file mode 100644 index 000000000..bbd5bfeb4 Binary files /dev/null and b/test/pptx/inline-formatting/deleted-layouts.pptx differ diff --git a/test/pptx/inline-formatting/input.native b/test/pptx/inline-formatting/input.native new file mode 100644 index 000000000..164176af2 --- /dev/null +++ b/test/pptx/inline-formatting/input.native @@ -0,0 +1,5 @@ +[Para [Str "Here",Space,Str "are",Space,Str "examples",Space,Str "of",Space,Emph [Str "italics"],Str ",",Space,Strong [Str "bold"],Str ",",Space,Str "and",Space,Strong [Emph [Str "bold",Space,Str "italics"]],Str "."] +,Para [Str "Here",Space,Str "is",Space,Strikeout [Str "strook-three"],Space,Str "strike-through",Space,Str "and",Space,SmallCaps [Str "small",Space,Str "caps"],Str "."] +,Para [Str "Here",Space,Str "is",Space,Span ("",["underline"],[]) [Str "some",Space,Emph [Str "underlined"],Space,Strong [Str "text"]],Str "."] +,Para [Str "We",Space,Str "can",Space,Str "also",Space,Str "do",Space,Str "subscripts",Space,Str "(H",Subscript [Str "2"],Str "0)",Space,Str "and",Space,Str "super",Superscript [Str "script"],Str "."] +,RawBlock (Format "html") ""] diff --git a/test/pptx/inline-formatting/moved-layouts.pptx b/test/pptx/inline-formatting/moved-layouts.pptx new file mode 100644 index 000000000..427492130 Binary files /dev/null and b/test/pptx/inline-formatting/moved-layouts.pptx differ diff --git a/test/pptx/inline-formatting/output.pptx b/test/pptx/inline-formatting/output.pptx new file mode 100644 index 000000000..473b9498d Binary files /dev/null and b/test/pptx/inline-formatting/output.pptx differ diff --git a/test/pptx/inline-formatting/templated.pptx b/test/pptx/inline-formatting/templated.pptx new file mode 100644 index 000000000..dd778a102 Binary files /dev/null and b/test/pptx/inline-formatting/templated.pptx differ diff --git a/test/pptx/inline_formatting.native b/test/pptx/inline_formatting.native deleted file mode 100644 index 164176af2..000000000 --- a/test/pptx/inline_formatting.native +++ /dev/null @@ -1,5 +0,0 @@ -[Para [Str "Here",Space,Str "are",Space,Str "examples",Space,Str "of",Space,Emph [Str "italics"],Str ",",Space,Strong [Str "bold"],Str ",",Space,Str "and",Space,Strong [Emph [Str "bold",Space,Str "italics"]],Str "."] -,Para [Str "Here",Space,Str "is",Space,Strikeout [Str "strook-three"],Space,Str "strike-through",Space,Str "and",Space,SmallCaps [Str "small",Space,Str "caps"],Str "."] -,Para [Str "Here",Space,Str "is",Space,Span ("",["underline"],[]) [Str "some",Space,Emph [Str "underlined"],Space,Strong [Str "text"]],Str "."] -,Para [Str "We",Space,Str "can",Space,Str "also",Space,Str "do",Space,Str "subscripts",Space,Str "(H",Subscript [Str "2"],Str "0)",Space,Str "and",Space,Str "super",Superscript [Str "script"],Str "."] -,RawBlock (Format "html") ""] diff --git a/test/pptx/inline_formatting.pptx b/test/pptx/inline_formatting.pptx deleted file mode 100644 index 473b9498d..000000000 Binary files a/test/pptx/inline_formatting.pptx and /dev/null differ diff --git a/test/pptx/inline_formatting_deleted_layouts.pptx b/test/pptx/inline_formatting_deleted_layouts.pptx deleted file mode 100644 index bbd5bfeb4..000000000 Binary files a/test/pptx/inline_formatting_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/inline_formatting_moved_layouts.pptx b/test/pptx/inline_formatting_moved_layouts.pptx deleted file mode 100644 index 427492130..000000000 Binary files a/test/pptx/inline_formatting_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/inline_formatting_templated.pptx b/test/pptx/inline_formatting_templated.pptx deleted file mode 100644 index dd778a102..000000000 Binary files a/test/pptx/inline_formatting_templated.pptx and /dev/null differ diff --git a/test/pptx/lists.native b/test/pptx/lists.native deleted file mode 100644 index 61249c7fe..000000000 --- a/test/pptx/lists.native +++ /dev/null @@ -1,18 +0,0 @@ -[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 "arbitrary",Space,Str "depth."] - ,BulletList - [[Para [Str "Like",Space,Str "this"] - ,BulletList - [[Plain [Str "Or",Space,Str "this"]]]] - ,[Para [Str "Back",Space,Str "to",Space,Str "here."]]]]] -,Header 1 ("lists-continued",[],[]) [Str "Lists",Space,Str "(continued)"] -,Para [Str "Lists",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "numbered:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "Tomatoes"]] - ,[Para [Str "Potatoes",Space,Str "of",Space,Str "various",Space,Str "sorts"] - ,OrderedList (1,LowerAlpha,Period) - [[Para [Str "sweet",Space,Str "potatoes"]] - ,[Para [Str "russet",Space,Str "potates"]]]] - ,[Para [Str "Tornadoes,",Space,Str "for",Space,Str "the",Space,Str "rhyme."]]]] diff --git a/test/pptx/lists.pptx b/test/pptx/lists.pptx deleted file mode 100644 index ffc2eb9f7..000000000 Binary files a/test/pptx/lists.pptx and /dev/null differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx new file mode 100644 index 000000000..6512e44bb Binary files /dev/null and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/lists/input.native b/test/pptx/lists/input.native new file mode 100644 index 000000000..61249c7fe --- /dev/null +++ b/test/pptx/lists/input.native @@ -0,0 +1,18 @@ +[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 "arbitrary",Space,Str "depth."] + ,BulletList + [[Para [Str "Like",Space,Str "this"] + ,BulletList + [[Plain [Str "Or",Space,Str "this"]]]] + ,[Para [Str "Back",Space,Str "to",Space,Str "here."]]]]] +,Header 1 ("lists-continued",[],[]) [Str "Lists",Space,Str "(continued)"] +,Para [Str "Lists",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "numbered:"] +,OrderedList (1,Decimal,Period) + [[Para [Str "Tomatoes"]] + ,[Para [Str "Potatoes",Space,Str "of",Space,Str "various",Space,Str "sorts"] + ,OrderedList (1,LowerAlpha,Period) + [[Para [Str "sweet",Space,Str "potatoes"]] + ,[Para [Str "russet",Space,Str "potates"]]]] + ,[Para [Str "Tornadoes,",Space,Str "for",Space,Str "the",Space,Str "rhyme."]]]] diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx new file mode 100644 index 000000000..2947c3211 Binary files /dev/null and b/test/pptx/lists/moved-layouts.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx new file mode 100644 index 000000000..ffc2eb9f7 Binary files /dev/null and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx new file mode 100644 index 000000000..2493e7890 Binary files /dev/null and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/lists_deleted_layouts.pptx b/test/pptx/lists_deleted_layouts.pptx deleted file mode 100644 index 6512e44bb..000000000 Binary files a/test/pptx/lists_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/lists_moved_layouts.pptx b/test/pptx/lists_moved_layouts.pptx deleted file mode 100644 index 2947c3211..000000000 Binary files a/test/pptx/lists_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/lists_templated.pptx b/test/pptx/lists_templated.pptx deleted file mode 100644 index 2493e7890..000000000 Binary files a/test/pptx/lists_templated.pptx and /dev/null differ diff --git a/test/pptx/raw-ooxml/deleted-layouts.pptx b/test/pptx/raw-ooxml/deleted-layouts.pptx new file mode 100644 index 000000000..2ea155657 Binary files /dev/null and b/test/pptx/raw-ooxml/deleted-layouts.pptx differ diff --git a/test/pptx/raw-ooxml/input.native b/test/pptx/raw-ooxml/input.native new file mode 100644 index 000000000..ae5bdd140 --- /dev/null +++ b/test/pptx/raw-ooxml/input.native @@ -0,0 +1,3 @@ +[Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "text,",Space,Str "written",Space,Str "as",Space,Str "a",Space,Str "raw",Space,Str "inline:",Space,RawInline (Format "openxml") "Here are examples of italics, bold"] +,HorizontalRule +,RawBlock (Format "openxml") "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Bulleted bulleted lists.\n \n \n \n \n \n \n And go to arbitrary depth.\n \n \n \n \n \n \n Like this\n \n \n \n \n \n \n Or this\n \n \n \n \n \n \n Back to here.\n \n \n \n "] diff --git a/test/pptx/raw-ooxml/moved-layouts.pptx b/test/pptx/raw-ooxml/moved-layouts.pptx new file mode 100644 index 000000000..e58304172 Binary files /dev/null and b/test/pptx/raw-ooxml/moved-layouts.pptx differ diff --git a/test/pptx/raw-ooxml/output.pptx b/test/pptx/raw-ooxml/output.pptx new file mode 100644 index 000000000..29164af15 Binary files /dev/null and b/test/pptx/raw-ooxml/output.pptx differ diff --git a/test/pptx/raw-ooxml/templated.pptx b/test/pptx/raw-ooxml/templated.pptx new file mode 100644 index 000000000..0f20f9826 Binary files /dev/null and b/test/pptx/raw-ooxml/templated.pptx differ diff --git a/test/pptx/raw_ooxml.native b/test/pptx/raw_ooxml.native deleted file mode 100644 index ae5bdd140..000000000 --- a/test/pptx/raw_ooxml.native +++ /dev/null @@ -1,3 +0,0 @@ -[Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "text,",Space,Str "written",Space,Str "as",Space,Str "a",Space,Str "raw",Space,Str "inline:",Space,RawInline (Format "openxml") "Here are examples of italics, bold"] -,HorizontalRule -,RawBlock (Format "openxml") "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Bulleted bulleted lists.\n \n \n \n \n \n \n And go to arbitrary depth.\n \n \n \n \n \n \n Like this\n \n \n \n \n \n \n Or this\n \n \n \n \n \n \n Back to here.\n \n \n \n "] diff --git a/test/pptx/raw_ooxml.pptx b/test/pptx/raw_ooxml.pptx deleted file mode 100644 index 29164af15..000000000 Binary files a/test/pptx/raw_ooxml.pptx and /dev/null differ diff --git a/test/pptx/raw_ooxml_deleted_layouts.pptx b/test/pptx/raw_ooxml_deleted_layouts.pptx deleted file mode 100644 index 2ea155657..000000000 Binary files a/test/pptx/raw_ooxml_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/raw_ooxml_moved_layouts.pptx b/test/pptx/raw_ooxml_moved_layouts.pptx deleted file mode 100644 index e58304172..000000000 Binary files a/test/pptx/raw_ooxml_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/raw_ooxml_templated.pptx b/test/pptx/raw_ooxml_templated.pptx deleted file mode 100644 index 0f20f9826..000000000 Binary files a/test/pptx/raw_ooxml_templated.pptx and /dev/null differ diff --git a/test/pptx/reference-deleted-layouts.pptx b/test/pptx/reference-deleted-layouts.pptx new file mode 100644 index 000000000..a9a74ecd5 Binary files /dev/null and b/test/pptx/reference-deleted-layouts.pptx differ diff --git a/test/pptx/reference-depth.pptx b/test/pptx/reference-depth.pptx new file mode 100644 index 000000000..97f444788 Binary files /dev/null and b/test/pptx/reference-depth.pptx differ diff --git a/test/pptx/reference-moved-layouts.pptx b/test/pptx/reference-moved-layouts.pptx new file mode 100644 index 000000000..72c4f3fd7 Binary files /dev/null and b/test/pptx/reference-moved-layouts.pptx differ diff --git a/test/pptx/reference_deleted_layouts.pptx b/test/pptx/reference_deleted_layouts.pptx deleted file mode 100644 index a9a74ecd5..000000000 Binary files a/test/pptx/reference_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/reference_depth.pptx b/test/pptx/reference_depth.pptx deleted file mode 100644 index 97f444788..000000000 Binary files a/test/pptx/reference_depth.pptx and /dev/null differ diff --git a/test/pptx/reference_moved_layouts.pptx b/test/pptx/reference_moved_layouts.pptx deleted file mode 100644 index 72c4f3fd7..000000000 Binary files a/test/pptx/reference_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/remove-empty-slides/deleted-layouts.pptx b/test/pptx/remove-empty-slides/deleted-layouts.pptx new file mode 100644 index 000000000..7ae4a5fab Binary files /dev/null and b/test/pptx/remove-empty-slides/deleted-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/input.native b/test/pptx/remove-empty-slides/input.native new file mode 100644 index 000000000..51c042281 --- /dev/null +++ b/test/pptx/remove-empty-slides/input.native @@ -0,0 +1,5 @@ +[Para [Str "Content"] +,Para [Image ("",[],[]) [] ("lalune.jpg",""),Space,RawInline (Format "html") ""] +,HorizontalRule +,HorizontalRule +,Para [Str "More",Space,Str "content"]] diff --git a/test/pptx/remove-empty-slides/moved-layouts.pptx b/test/pptx/remove-empty-slides/moved-layouts.pptx new file mode 100644 index 000000000..2572f2447 Binary files /dev/null and b/test/pptx/remove-empty-slides/moved-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/output.pptx b/test/pptx/remove-empty-slides/output.pptx new file mode 100644 index 000000000..c6df8e18e Binary files /dev/null and b/test/pptx/remove-empty-slides/output.pptx differ diff --git a/test/pptx/remove-empty-slides/templated.pptx b/test/pptx/remove-empty-slides/templated.pptx new file mode 100644 index 000000000..1df48c5ad Binary files /dev/null and b/test/pptx/remove-empty-slides/templated.pptx differ diff --git a/test/pptx/remove_empty_slides.native b/test/pptx/remove_empty_slides.native deleted file mode 100644 index 51c042281..000000000 --- a/test/pptx/remove_empty_slides.native +++ /dev/null @@ -1,5 +0,0 @@ -[Para [Str "Content"] -,Para [Image ("",[],[]) [] ("lalune.jpg",""),Space,RawInline (Format "html") ""] -,HorizontalRule -,HorizontalRule -,Para [Str "More",Space,Str "content"]] diff --git a/test/pptx/remove_empty_slides.pptx b/test/pptx/remove_empty_slides.pptx deleted file mode 100644 index c6df8e18e..000000000 Binary files a/test/pptx/remove_empty_slides.pptx and /dev/null differ diff --git a/test/pptx/remove_empty_slides_deleted_layouts.pptx b/test/pptx/remove_empty_slides_deleted_layouts.pptx deleted file mode 100644 index 7ae4a5fab..000000000 Binary files a/test/pptx/remove_empty_slides_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/remove_empty_slides_moved_layouts.pptx b/test/pptx/remove_empty_slides_moved_layouts.pptx deleted file mode 100644 index 2572f2447..000000000 Binary files a/test/pptx/remove_empty_slides_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/remove_empty_slides_templated.pptx b/test/pptx/remove_empty_slides_templated.pptx deleted file mode 100644 index 1df48c5ad..000000000 Binary files a/test/pptx/remove_empty_slides_templated.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx new file mode 100644 index 000000000..2c7fd4d8b Binary files /dev/null and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx new file mode 100644 index 000000000..8471b1d10 Binary files /dev/null and b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx new file mode 100644 index 000000000..449339778 Binary files /dev/null and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/templated.pptx b/test/pptx/slide-breaks-slide-level-1/templated.pptx new file mode 100644 index 000000000..e2815159a Binary files /dev/null and b/test/pptx/slide-breaks-slide-level-1/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx new file mode 100644 index 000000000..1e0b76d46 Binary files /dev/null and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx new file mode 100644 index 000000000..918264bc5 Binary files /dev/null and b/test/pptx/slide-breaks-toc/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx new file mode 100644 index 000000000..9dbfa41a0 Binary files /dev/null and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx new file mode 100644 index 000000000..b83f3f596 Binary files /dev/null and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx new file mode 100644 index 000000000..86dfad3b2 Binary files /dev/null and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/input.native b/test/pptx/slide-breaks/input.native new file mode 100644 index 000000000..084c61737 --- /dev/null +++ b/test/pptx/slide-breaks/input.native @@ -0,0 +1,7 @@ +Pandoc (Meta {unMeta = fromList []}) +[Para [Str "Break",Space,Str "with",Space,Str "a",Space,Str "new",Space,Str "section-level",Space,Str "header"] +,Header 1 ("below-section-level",[],[]) [Str "Below",Space,Str "section-level"] +,Header 2 ("section-level",[],[]) [Str "Section-level"] +,Para [Str "Third",Space,Str "slide",Space,Str "(with",Space,Str "a",Space,Str "section-level",Space,Str "of",Space,Str "2)"] +,HorizontalRule +,Para [Str "This",Space,Str "is",Space,Str "another",Space,Str "slide."]] diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx new file mode 100644 index 000000000..90b3b94a6 Binary files /dev/null and b/test/pptx/slide-breaks/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx new file mode 100644 index 000000000..e06d9079d Binary files /dev/null and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-breaks/templated.pptx b/test/pptx/slide-breaks/templated.pptx new file mode 100644 index 000000000..71ba99701 Binary files /dev/null and b/test/pptx/slide-breaks/templated.pptx differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table.native b/test/pptx/slide-level-0-h1-h2-with-table.native deleted file mode 100644 index c6e65ecf5..000000000 --- a/test/pptx/slide-level-0-h1-h2-with-table.native +++ /dev/null @@ -1,14 +0,0 @@ -[Header 1 ("hello",[],[]) [Str "Hello"] -,Header 2 ("there",[],[]) [Str "There"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 5.555555555555555e-2)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - [])] diff --git a/test/pptx/slide-level-0-h1-h2-with-table.pptx b/test/pptx/slide-level-0-h1-h2-with-table.pptx deleted file mode 100644 index 197a6833f..000000000 Binary files a/test/pptx/slide-level-0-h1-h2-with-table.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx deleted file mode 100644 index 5e776e05c..000000000 Binary files a/test/pptx/slide-level-0-h1-h2-with-table_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx b/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx deleted file mode 100644 index 35204de1b..000000000 Binary files a/test/pptx/slide-level-0-h1-h2-with-table_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx b/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx deleted file mode 100644 index 5c659952e..000000000 Binary files a/test/pptx/slide-level-0-h1-h2-with-table_templated.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-image.native b/test/pptx/slide-level-0-h1-with-image.native deleted file mode 100644 index 0f5033b54..000000000 --- a/test/pptx/slide-level-0-h1-with-image.native +++ /dev/null @@ -1,2 +0,0 @@ -[Header 1 ("hello",[],[]) [Str "Hello"] -,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0-h1-with-image.pptx b/test/pptx/slide-level-0-h1-with-image.pptx deleted file mode 100644 index 2f3a53f5c..000000000 Binary files a/test/pptx/slide-level-0-h1-with-image.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx deleted file mode 100644 index 16c61d1be..000000000 Binary files a/test/pptx/slide-level-0-h1-with-image_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx b/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx deleted file mode 100644 index 395036069..000000000 Binary files a/test/pptx/slide-level-0-h1-with-image_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-image_templated.pptx b/test/pptx/slide-level-0-h1-with-image_templated.pptx deleted file mode 100644 index d306375e9..000000000 Binary files a/test/pptx/slide-level-0-h1-with-image_templated.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-table.native b/test/pptx/slide-level-0-h1-with-table.native deleted file mode 100644 index b961e900d..000000000 --- a/test/pptx/slide-level-0-h1-with-table.native +++ /dev/null @@ -1,13 +0,0 @@ -[Header 1 ("hello",[],[]) [Str "Hello"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 5.555555555555555e-2)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - [])] diff --git a/test/pptx/slide-level-0-h1-with-table.pptx b/test/pptx/slide-level-0-h1-with-table.pptx deleted file mode 100644 index 44dbbf90c..000000000 Binary files a/test/pptx/slide-level-0-h1-with-table.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx b/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx deleted file mode 100644 index 0eb7c0b08..000000000 Binary files a/test/pptx/slide-level-0-h1-with-table_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx b/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx deleted file mode 100644 index 197499bc3..000000000 Binary files a/test/pptx/slide-level-0-h1-with-table_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h1-with-table_templated.pptx b/test/pptx/slide-level-0-h1-with-table_templated.pptx deleted file mode 100644 index 87b45dda2..000000000 Binary files a/test/pptx/slide-level-0-h1-with-table_templated.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h2-with-image.native b/test/pptx/slide-level-0-h2-with-image.native deleted file mode 100644 index 5def0cb92..000000000 --- a/test/pptx/slide-level-0-h2-with-image.native +++ /dev/null @@ -1,2 +0,0 @@ -[Header 2 ("hello",[],[]) [Str "Hello"] -,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0-h2-with-image.pptx b/test/pptx/slide-level-0-h2-with-image.pptx deleted file mode 100644 index 948659d6a..000000000 Binary files a/test/pptx/slide-level-0-h2-with-image.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx b/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx deleted file mode 100644 index afc096ce6..000000000 Binary files a/test/pptx/slide-level-0-h2-with-image_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx b/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx deleted file mode 100644 index 395036069..000000000 Binary files a/test/pptx/slide-level-0-h2-with-image_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0-h2-with-image_templated.pptx b/test/pptx/slide-level-0-h2-with-image_templated.pptx deleted file mode 100644 index d306375e9..000000000 Binary files a/test/pptx/slide-level-0-h2-with-image_templated.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx new file mode 100644 index 000000000..5e776e05c Binary files /dev/null and b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/input.native b/test/pptx/slide-level-0/h1-h2-with-table/input.native new file mode 100644 index 000000000..c6e65ecf5 --- /dev/null +++ b/test/pptx/slide-level-0/h1-h2-with-table/input.native @@ -0,0 +1,14 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Header 2 ("there",[],[]) [Str "There"] +,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + [])] diff --git a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx new file mode 100644 index 000000000..35204de1b Binary files /dev/null and b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx new file mode 100644 index 000000000..197a6833f Binary files /dev/null and b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx new file mode 100644 index 000000000..5c659952e Binary files /dev/null and b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx new file mode 100644 index 000000000..16c61d1be Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/input.native b/test/pptx/slide-level-0/h1-with-image/input.native new file mode 100644 index 000000000..0f5033b54 --- /dev/null +++ b/test/pptx/slide-level-0/h1-with-image/input.native @@ -0,0 +1,2 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx new file mode 100644 index 000000000..395036069 Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx new file mode 100644 index 000000000..2f3a53f5c Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/templated.pptx b/test/pptx/slide-level-0/h1-with-image/templated.pptx new file mode 100644 index 000000000..d306375e9 Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-image/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx new file mode 100644 index 000000000..0eb7c0b08 Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/input.native b/test/pptx/slide-level-0/h1-with-table/input.native new file mode 100644 index 000000000..b961e900d --- /dev/null +++ b/test/pptx/slide-level-0/h1-with-table/input.native @@ -0,0 +1,13 @@ +[Header 1 ("hello",[],[]) [Str "Hello"] +,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + [])] diff --git a/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx new file mode 100644 index 000000000..197499bc3 Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/output.pptx b/test/pptx/slide-level-0/h1-with-table/output.pptx new file mode 100644 index 000000000..44dbbf90c Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/templated.pptx b/test/pptx/slide-level-0/h1-with-table/templated.pptx new file mode 100644 index 000000000..87b45dda2 Binary files /dev/null and b/test/pptx/slide-level-0/h1-with-table/templated.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx new file mode 100644 index 000000000..afc096ce6 Binary files /dev/null and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/input.native b/test/pptx/slide-level-0/h2-with-image/input.native new file mode 100644 index 000000000..5def0cb92 --- /dev/null +++ b/test/pptx/slide-level-0/h2-with-image/input.native @@ -0,0 +1,2 @@ +[Header 2 ("hello",[],[]) [Str "Hello"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx new file mode 100644 index 000000000..395036069 Binary files /dev/null and b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx new file mode 100644 index 000000000..948659d6a Binary files /dev/null and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/templated.pptx b/test/pptx/slide-level-0/h2-with-image/templated.pptx new file mode 100644 index 000000000..d306375e9 Binary files /dev/null and b/test/pptx/slide-level-0/h2-with-image/templated.pptx differ diff --git a/test/pptx/slide_breaks.native b/test/pptx/slide_breaks.native deleted file mode 100644 index 084c61737..000000000 --- a/test/pptx/slide_breaks.native +++ /dev/null @@ -1,7 +0,0 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Str "Break",Space,Str "with",Space,Str "a",Space,Str "new",Space,Str "section-level",Space,Str "header"] -,Header 1 ("below-section-level",[],[]) [Str "Below",Space,Str "section-level"] -,Header 2 ("section-level",[],[]) [Str "Section-level"] -,Para [Str "Third",Space,Str "slide",Space,Str "(with",Space,Str "a",Space,Str "section-level",Space,Str "of",Space,Str "2)"] -,HorizontalRule -,Para [Str "This",Space,Str "is",Space,Str "another",Space,Str "slide."]] diff --git a/test/pptx/slide_breaks.pptx b/test/pptx/slide_breaks.pptx deleted file mode 100644 index e06d9079d..000000000 Binary files a/test/pptx/slide_breaks.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_deleted_layouts.pptx b/test/pptx/slide_breaks_deleted_layouts.pptx deleted file mode 100644 index 86dfad3b2..000000000 Binary files a/test/pptx/slide_breaks_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_moved_layouts.pptx b/test/pptx/slide_breaks_moved_layouts.pptx deleted file mode 100644 index 90b3b94a6..000000000 Binary files a/test/pptx/slide_breaks_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_slide_level_1.pptx b/test/pptx/slide_breaks_slide_level_1.pptx deleted file mode 100644 index 449339778..000000000 Binary files a/test/pptx/slide_breaks_slide_level_1.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx b/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx deleted file mode 100644 index 2c7fd4d8b..000000000 Binary files a/test/pptx/slide_breaks_slide_level_1_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx b/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx deleted file mode 100644 index 8471b1d10..000000000 Binary files a/test/pptx/slide_breaks_slide_level_1_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_slide_level_1_templated.pptx b/test/pptx/slide_breaks_slide_level_1_templated.pptx deleted file mode 100644 index e2815159a..000000000 Binary files a/test/pptx/slide_breaks_slide_level_1_templated.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_templated.pptx b/test/pptx/slide_breaks_templated.pptx deleted file mode 100644 index 71ba99701..000000000 Binary files a/test/pptx/slide_breaks_templated.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_toc.pptx b/test/pptx/slide_breaks_toc.pptx deleted file mode 100644 index 9dbfa41a0..000000000 Binary files a/test/pptx/slide_breaks_toc.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_toc_deleted_layouts.pptx b/test/pptx/slide_breaks_toc_deleted_layouts.pptx deleted file mode 100644 index 1e0b76d46..000000000 Binary files a/test/pptx/slide_breaks_toc_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_toc_moved_layouts.pptx b/test/pptx/slide_breaks_toc_moved_layouts.pptx deleted file mode 100644 index 918264bc5..000000000 Binary files a/test/pptx/slide_breaks_toc_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/slide_breaks_toc_templated.pptx b/test/pptx/slide_breaks_toc_templated.pptx deleted file mode 100644 index b83f3f596..000000000 Binary files a/test/pptx/slide_breaks_toc_templated.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx new file mode 100644 index 000000000..1298870e2 Binary files /dev/null and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/input.native b/test/pptx/speaker-notes-after-metadata/input.native new file mode 100644 index 000000000..6fda4b1ab --- /dev/null +++ b/test/pptx/speaker-notes-after-metadata/input.native @@ -0,0 +1,5 @@ +Pandoc (Meta {unMeta = fromList [("author",MetaInlines [Str "Jesse",Space,Str "Rosenthal"]),("title",MetaInlines [Str "Testing"])]}) +[Div ("",["notes"],[]) + [Para [Str "Some",Space,Str "speaker",Space,Str "notes"]] +,Header 1 ("a-header",[],[]) [Str "A",Space,Str "header"] +,Para [Str "And",Space,Str "a",Space,Str "new",Space,Str "slide."]] diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx new file mode 100644 index 000000000..b844a0b51 Binary files /dev/null and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx new file mode 100644 index 000000000..6343bffe4 Binary files /dev/null and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx new file mode 100644 index 000000000..8d27c4c68 Binary files /dev/null and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx new file mode 100644 index 000000000..853b918cb Binary files /dev/null and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/input.native b/test/pptx/speaker-notes-afterheader/input.native new file mode 100644 index 000000000..0f7dd95d7 --- /dev/null +++ b/test/pptx/speaker-notes-afterheader/input.native @@ -0,0 +1,3 @@ +[Header 1 ("here-is-a-single-header",[],[]) [Str "Here",Space,Str "is",Space,Str "a",Space,Str "single",Space,Str "header"] +,Div ("",["notes"],[]) + [Para [Str "and",Space,Str "here",Space,Str "are",Space,Str "some",Space,Str "notes"]]] diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx new file mode 100644 index 000000000..9fff9f855 Binary files /dev/null and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx new file mode 100644 index 000000000..d581681aa Binary files /dev/null and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx new file mode 100644 index 000000000..d8d8481df Binary files /dev/null and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx new file mode 100644 index 000000000..9fec1c279 Binary files /dev/null and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/input.native b/test/pptx/speaker-notes-afterseps/input.native new file mode 100644 index 000000000..4fd7b1ccb --- /dev/null +++ b/test/pptx/speaker-notes-afterseps/input.native @@ -0,0 +1,63 @@ +[Para [Image ("",[],[]) [Str "The",Space,Str "moon"] ("lalune.jpg","fig:")] +,Div ("",["notes"],[]) + [Para [Str "chicken",Space,Str "and",Space,Str "dumplings"]] +,Table ("",[],[]) (Caption Nothing + [Para [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax,",Space,Str "with",Space,Str "alignment"]]) + [(AlignRight,ColWidthDefault) + ,(AlignLeft,ColWidthDefault) + ,(AlignCenter,ColWidthDefault) + ,(AlignDefault,ColWidthDefault)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Right"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Left"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Center"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Default"]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + []) +,Div ("",["notes"],[]) + [Para [Str "foo",Space,Str "bar"]] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [BulletList + [[Para [Str "some",Space,Str "stuff"]] + ,[Para [Str "some",Space,Str "more",Space,Str "stuff"]]] + ,Div ("",["notes"],[]) + [Para [Str "Some",Space,Str "notes",Space,Str "inside",Space,Str "a",Space,Str "column"]]] + ,Div ("",["column"],[]) + [Para [Str "Some",Space,Str "other",Space,Emph [Str "stuff"]]]] +,Div ("",["notes"],[]) + [Para [Str "Some",Space,Str "notes",Space,Str "outside",Space,Str "the",Space,Str "column"]]] \ No newline at end of file diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx new file mode 100644 index 000000000..de697cbd8 Binary files /dev/null and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx new file mode 100644 index 000000000..9542fe8b5 Binary files /dev/null and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx new file mode 100644 index 000000000..5a3d15d57 Binary files /dev/null and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx new file mode 100644 index 000000000..6a5ad524f Binary files /dev/null and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/input.native b/test/pptx/speaker-notes/input.native new file mode 100644 index 000000000..4eeca2107 --- /dev/null +++ b/test/pptx/speaker-notes/input.native @@ -0,0 +1,17 @@ +[Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "slide."] +,Div ("",["notes"],[]) + [Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "note."] + ,Para [Str "Here",Space,Str "is",Space,Emph [Str "some"],Space,Strong [Str "other"],Space,Str "formatting."]] +,HorizontalRule +,Para [Str "A",Space,Str "page",Space,Str "with",Space,Str "no",Space,Str "speaker",Space,Str "notes"] +,HorizontalRule +,Div ("",["notes"],[]) + [Para [Str "The",Space,Str "first",Space,Str "note",Space,Str "div"]] +,Para [Str "A",Space,Str "page",Space,Str "with",Space,Str "two",Space,Str "notes."] +,Div ("",["notes"],[]) + [Para [Str "The",Space,Str "second",Space,Str "note",Space,Str "div"]] +,HorizontalRule +,Para [Str "Strip",Space,Str "links",Space,Str "and",Space,Str "footnotes."] +,Div ("",["notes"],[]) + [Para [Str "No",Space,Link ("",[],[]) [Str "link"] ("https://www.google.com",""),Space,Str "here."] + ,Para [Str "No",Space,Str "note",Space,Str "here.",Note [Para [Str "You\8217ll",Space,Str "never",Space,Str "read",Space,Str "this"]]]]] diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx new file mode 100644 index 000000000..f95df9622 Binary files /dev/null and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx new file mode 100644 index 000000000..0ab1302da Binary files /dev/null and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx new file mode 100644 index 000000000..930377fbf Binary files /dev/null and b/test/pptx/speaker-notes/templated.pptx differ diff --git a/test/pptx/speaker_notes.native b/test/pptx/speaker_notes.native deleted file mode 100644 index 4eeca2107..000000000 --- a/test/pptx/speaker_notes.native +++ /dev/null @@ -1,17 +0,0 @@ -[Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "slide."] -,Div ("",["notes"],[]) - [Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "note."] - ,Para [Str "Here",Space,Str "is",Space,Emph [Str "some"],Space,Strong [Str "other"],Space,Str "formatting."]] -,HorizontalRule -,Para [Str "A",Space,Str "page",Space,Str "with",Space,Str "no",Space,Str "speaker",Space,Str "notes"] -,HorizontalRule -,Div ("",["notes"],[]) - [Para [Str "The",Space,Str "first",Space,Str "note",Space,Str "div"]] -,Para [Str "A",Space,Str "page",Space,Str "with",Space,Str "two",Space,Str "notes."] -,Div ("",["notes"],[]) - [Para [Str "The",Space,Str "second",Space,Str "note",Space,Str "div"]] -,HorizontalRule -,Para [Str "Strip",Space,Str "links",Space,Str "and",Space,Str "footnotes."] -,Div ("",["notes"],[]) - [Para [Str "No",Space,Link ("",[],[]) [Str "link"] ("https://www.google.com",""),Space,Str "here."] - ,Para [Str "No",Space,Str "note",Space,Str "here.",Note [Para [Str "You\8217ll",Space,Str "never",Space,Str "read",Space,Str "this"]]]]] diff --git a/test/pptx/speaker_notes.pptx b/test/pptx/speaker_notes.pptx deleted file mode 100644 index 0ab1302da..000000000 Binary files a/test/pptx/speaker_notes.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_after_metadata.native b/test/pptx/speaker_notes_after_metadata.native deleted file mode 100644 index 6fda4b1ab..000000000 --- a/test/pptx/speaker_notes_after_metadata.native +++ /dev/null @@ -1,5 +0,0 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaInlines [Str "Jesse",Space,Str "Rosenthal"]),("title",MetaInlines [Str "Testing"])]}) -[Div ("",["notes"],[]) - [Para [Str "Some",Space,Str "speaker",Space,Str "notes"]] -,Header 1 ("a-header",[],[]) [Str "A",Space,Str "header"] -,Para [Str "And",Space,Str "a",Space,Str "new",Space,Str "slide."]] diff --git a/test/pptx/speaker_notes_after_metadata.pptx b/test/pptx/speaker_notes_after_metadata.pptx deleted file mode 100644 index 6343bffe4..000000000 Binary files a/test/pptx/speaker_notes_after_metadata.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx b/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx deleted file mode 100644 index 1298870e2..000000000 Binary files a/test/pptx/speaker_notes_after_metadata_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx b/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx deleted file mode 100644 index b844a0b51..000000000 Binary files a/test/pptx/speaker_notes_after_metadata_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_after_metadata_templated.pptx b/test/pptx/speaker_notes_after_metadata_templated.pptx deleted file mode 100644 index 8d27c4c68..000000000 Binary files a/test/pptx/speaker_notes_after_metadata_templated.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterheader.native b/test/pptx/speaker_notes_afterheader.native deleted file mode 100644 index 0f7dd95d7..000000000 --- a/test/pptx/speaker_notes_afterheader.native +++ /dev/null @@ -1,3 +0,0 @@ -[Header 1 ("here-is-a-single-header",[],[]) [Str "Here",Space,Str "is",Space,Str "a",Space,Str "single",Space,Str "header"] -,Div ("",["notes"],[]) - [Para [Str "and",Space,Str "here",Space,Str "are",Space,Str "some",Space,Str "notes"]]] diff --git a/test/pptx/speaker_notes_afterheader.pptx b/test/pptx/speaker_notes_afterheader.pptx deleted file mode 100644 index d581681aa..000000000 Binary files a/test/pptx/speaker_notes_afterheader.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx b/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx deleted file mode 100644 index 853b918cb..000000000 Binary files a/test/pptx/speaker_notes_afterheader_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterheader_moved_layouts.pptx b/test/pptx/speaker_notes_afterheader_moved_layouts.pptx deleted file mode 100644 index 9fff9f855..000000000 Binary files a/test/pptx/speaker_notes_afterheader_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterheader_templated.pptx b/test/pptx/speaker_notes_afterheader_templated.pptx deleted file mode 100644 index d8d8481df..000000000 Binary files a/test/pptx/speaker_notes_afterheader_templated.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterseps.native b/test/pptx/speaker_notes_afterseps.native deleted file mode 100644 index 4fd7b1ccb..000000000 --- a/test/pptx/speaker_notes_afterseps.native +++ /dev/null @@ -1,63 +0,0 @@ -[Para [Image ("",[],[]) [Str "The",Space,Str "moon"] ("lalune.jpg","fig:")] -,Div ("",["notes"],[]) - [Para [Str "chicken",Space,Str "and",Space,Str "dumplings"]] -,Table ("",[],[]) (Caption Nothing - [Para [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax,",Space,Str "with",Space,Str "alignment"]]) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Div ("",["notes"],[]) - [Para [Str "foo",Space,Str "bar"]] -,Div ("",["columns"],[]) - [Div ("",["column"],[]) - [BulletList - [[Para [Str "some",Space,Str "stuff"]] - ,[Para [Str "some",Space,Str "more",Space,Str "stuff"]]] - ,Div ("",["notes"],[]) - [Para [Str "Some",Space,Str "notes",Space,Str "inside",Space,Str "a",Space,Str "column"]]] - ,Div ("",["column"],[]) - [Para [Str "Some",Space,Str "other",Space,Emph [Str "stuff"]]]] -,Div ("",["notes"],[]) - [Para [Str "Some",Space,Str "notes",Space,Str "outside",Space,Str "the",Space,Str "column"]]] \ No newline at end of file diff --git a/test/pptx/speaker_notes_afterseps.pptx b/test/pptx/speaker_notes_afterseps.pptx deleted file mode 100644 index 9542fe8b5..000000000 Binary files a/test/pptx/speaker_notes_afterseps.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx b/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx deleted file mode 100644 index 9fec1c279..000000000 Binary files a/test/pptx/speaker_notes_afterseps_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterseps_moved_layouts.pptx b/test/pptx/speaker_notes_afterseps_moved_layouts.pptx deleted file mode 100644 index de697cbd8..000000000 Binary files a/test/pptx/speaker_notes_afterseps_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_afterseps_templated.pptx b/test/pptx/speaker_notes_afterseps_templated.pptx deleted file mode 100644 index 5a3d15d57..000000000 Binary files a/test/pptx/speaker_notes_afterseps_templated.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_deleted_layouts.pptx b/test/pptx/speaker_notes_deleted_layouts.pptx deleted file mode 100644 index 6a5ad524f..000000000 Binary files a/test/pptx/speaker_notes_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_moved_layouts.pptx b/test/pptx/speaker_notes_moved_layouts.pptx deleted file mode 100644 index f95df9622..000000000 Binary files a/test/pptx/speaker_notes_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker_notes_templated.pptx b/test/pptx/speaker_notes_templated.pptx deleted file mode 100644 index 930377fbf..000000000 Binary files a/test/pptx/speaker_notes_templated.pptx and /dev/null differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx new file mode 100644 index 000000000..d9cf91804 Binary files /dev/null and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/input.native b/test/pptx/start-numbering-at/input.native new file mode 100644 index 000000000..ecffbb0ef --- /dev/null +++ b/test/pptx/start-numbering-at/input.native @@ -0,0 +1,9 @@ +[Header 2 ("example-numbering-mwe",[],[]) [Str "Example",Space,Str "numbering",Space,Str "MWE"] +,Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "slide",Space,Str "with",Space,Str "examples",Space,Str "in",Space,Str "(1)",Space,Str "and",Space,Str "(2)"] +,OrderedList (1,Example,TwoParens) + [[Plain [Str "First"]] + ,[Plain [Str "Second"]]] +,Header 2 ("a-second-slide",[],[]) [Str "A",Space,Str "second",Space,Str "slide"] +,Para [Str "This",Space,Str "second",Space,Str "slide",Space,Str "has",Space,Str "a",Space,Str "third",Space,Str "example",Space,Str "in",Space,Str "(3)."] +,OrderedList (3,Example,TwoParens) + [[Plain [Str "Third"]]]] diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx new file mode 100644 index 000000000..e1b2d4de8 Binary files /dev/null and b/test/pptx/start-numbering-at/moved-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx new file mode 100644 index 000000000..4320128b3 Binary files /dev/null and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx new file mode 100644 index 000000000..efc56ac7a Binary files /dev/null and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/start_numbering_at.native b/test/pptx/start_numbering_at.native deleted file mode 100644 index ecffbb0ef..000000000 --- a/test/pptx/start_numbering_at.native +++ /dev/null @@ -1,9 +0,0 @@ -[Header 2 ("example-numbering-mwe",[],[]) [Str "Example",Space,Str "numbering",Space,Str "MWE"] -,Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "slide",Space,Str "with",Space,Str "examples",Space,Str "in",Space,Str "(1)",Space,Str "and",Space,Str "(2)"] -,OrderedList (1,Example,TwoParens) - [[Plain [Str "First"]] - ,[Plain [Str "Second"]]] -,Header 2 ("a-second-slide",[],[]) [Str "A",Space,Str "second",Space,Str "slide"] -,Para [Str "This",Space,Str "second",Space,Str "slide",Space,Str "has",Space,Str "a",Space,Str "third",Space,Str "example",Space,Str "in",Space,Str "(3)."] -,OrderedList (3,Example,TwoParens) - [[Plain [Str "Third"]]]] diff --git a/test/pptx/start_numbering_at.pptx b/test/pptx/start_numbering_at.pptx deleted file mode 100644 index 4320128b3..000000000 Binary files a/test/pptx/start_numbering_at.pptx and /dev/null differ diff --git a/test/pptx/start_numbering_at_deleted_layouts.pptx b/test/pptx/start_numbering_at_deleted_layouts.pptx deleted file mode 100644 index d9cf91804..000000000 Binary files a/test/pptx/start_numbering_at_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/start_numbering_at_moved_layouts.pptx b/test/pptx/start_numbering_at_moved_layouts.pptx deleted file mode 100644 index e1b2d4de8..000000000 Binary files a/test/pptx/start_numbering_at_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/start_numbering_at_templated.pptx b/test/pptx/start_numbering_at_templated.pptx deleted file mode 100644 index efc56ac7a..000000000 Binary files a/test/pptx/start_numbering_at_templated.pptx and /dev/null differ diff --git a/test/pptx/tables.native b/test/pptx/tables.native deleted file mode 100644 index 27b843f2b..000000000 --- a/test/pptx/tables.native +++ /dev/null @@ -1,95 +0,0 @@ -[Header 2 ("a-table-with-a-caption",[],[]) [Str "A",Space,Str "Table,",Space,Str "with",Space,Str "a",Space,Str "caption"] -,Table ("",[],[]) (Caption Nothing - [Para [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax,",Space,Str "with",Space,Str "alignment"]]) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - [])] \ No newline at end of file diff --git a/test/pptx/tables.pptx b/test/pptx/tables.pptx deleted file mode 100644 index e41219844..000000000 Binary files a/test/pptx/tables.pptx and /dev/null differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx new file mode 100644 index 000000000..a52222551 Binary files /dev/null and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/tables/input.native b/test/pptx/tables/input.native new file mode 100644 index 000000000..27b843f2b --- /dev/null +++ b/test/pptx/tables/input.native @@ -0,0 +1,95 @@ +[Header 2 ("a-table-with-a-caption",[],[]) [Str "A",Space,Str "Table,",Space,Str "with",Space,Str "a",Space,Str "caption"] +,Table ("",[],[]) (Caption Nothing + [Para [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax,",Space,Str "with",Space,Str "alignment"]]) + [(AlignRight,ColWidthDefault) + ,(AlignLeft,ColWidthDefault) + ,(AlignCenter,ColWidthDefault) + ,(AlignDefault,ColWidthDefault)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Right"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Left"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Center"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Default"]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + []) +,Table ("",[],[]) (Caption Nothing + []) + [(AlignRight,ColWidthDefault) + ,(AlignLeft,ColWidthDefault) + ,(AlignCenter,ColWidthDefault) + ,(AlignDefault,ColWidthDefault)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Right"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Left"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Center"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "Default"]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "12"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "123"]]] + ,Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]])] + (TableFoot ("",[],[]) + [])] \ No newline at end of file diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx new file mode 100644 index 000000000..56608a039 Binary files /dev/null and b/test/pptx/tables/moved-layouts.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx new file mode 100644 index 000000000..e41219844 Binary files /dev/null and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/tables/templated.pptx b/test/pptx/tables/templated.pptx new file mode 100644 index 000000000..0a8c3e8d9 Binary files /dev/null and b/test/pptx/tables/templated.pptx differ diff --git a/test/pptx/tables_deleted_layouts.pptx b/test/pptx/tables_deleted_layouts.pptx deleted file mode 100644 index a52222551..000000000 Binary files a/test/pptx/tables_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/tables_moved_layouts.pptx b/test/pptx/tables_moved_layouts.pptx deleted file mode 100644 index 56608a039..000000000 Binary files a/test/pptx/tables_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/tables_templated.pptx b/test/pptx/tables_templated.pptx deleted file mode 100644 index 0a8c3e8d9..000000000 Binary files a/test/pptx/tables_templated.pptx and /dev/null differ diff --git a/test/pptx/two-column/deleted-layouts.pptx b/test/pptx/two-column/deleted-layouts.pptx new file mode 100644 index 000000000..60a244f94 Binary files /dev/null and b/test/pptx/two-column/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/input.native b/test/pptx/two-column/input.native new file mode 100644 index 000000000..086f74889 --- /dev/null +++ b/test/pptx/two-column/input.native @@ -0,0 +1,9 @@ +Pandoc (Meta {unMeta = fromList []}) +[Header 1 ("two-column-layout",[],[]) [Str "Two-Column",Space,Str "Layout"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "One",Space,Str "paragraph."] + ,Para [Str "Another",Space,Str "paragraph."]] + ,Div ("",["column"],[]) + [Para [Str "Second",Space,Str "column",Space,Str "paragraph."] + ,Para [Str "Another",Space,Str "second",Space,Str "paragraph."]]]] diff --git a/test/pptx/two-column/moved-layouts.pptx b/test/pptx/two-column/moved-layouts.pptx new file mode 100644 index 000000000..a17f96b18 Binary files /dev/null and b/test/pptx/two-column/moved-layouts.pptx differ diff --git a/test/pptx/two-column/output.pptx b/test/pptx/two-column/output.pptx new file mode 100644 index 000000000..270a7eeac Binary files /dev/null and b/test/pptx/two-column/output.pptx differ diff --git a/test/pptx/two-column/templated.pptx b/test/pptx/two-column/templated.pptx new file mode 100644 index 000000000..6d9470372 Binary files /dev/null and b/test/pptx/two-column/templated.pptx differ diff --git a/test/pptx/two_column.native b/test/pptx/two_column.native deleted file mode 100644 index 086f74889..000000000 --- a/test/pptx/two_column.native +++ /dev/null @@ -1,9 +0,0 @@ -Pandoc (Meta {unMeta = fromList []}) -[Header 1 ("two-column-layout",[],[]) [Str "Two-Column",Space,Str "Layout"] -,Div ("",["columns"],[]) - [Div ("",["column"],[]) - [Para [Str "One",Space,Str "paragraph."] - ,Para [Str "Another",Space,Str "paragraph."]] - ,Div ("",["column"],[]) - [Para [Str "Second",Space,Str "column",Space,Str "paragraph."] - ,Para [Str "Another",Space,Str "second",Space,Str "paragraph."]]]] diff --git a/test/pptx/two_column.pptx b/test/pptx/two_column.pptx deleted file mode 100644 index 270a7eeac..000000000 Binary files a/test/pptx/two_column.pptx and /dev/null differ diff --git a/test/pptx/two_column_deleted_layouts.pptx b/test/pptx/two_column_deleted_layouts.pptx deleted file mode 100644 index 60a244f94..000000000 Binary files a/test/pptx/two_column_deleted_layouts.pptx and /dev/null differ diff --git a/test/pptx/two_column_moved_layouts.pptx b/test/pptx/two_column_moved_layouts.pptx deleted file mode 100644 index a17f96b18..000000000 Binary files a/test/pptx/two_column_moved_layouts.pptx and /dev/null differ diff --git a/test/pptx/two_column_templated.pptx b/test/pptx/two_column_templated.pptx deleted file mode 100644 index 6d9470372..000000000 Binary files a/test/pptx/two_column_templated.pptx and /dev/null differ -- cgit v1.2.3 From b82a01b6883c1f6a9ce5d3edd80d5a2453ecef9e Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 19 Aug 2021 15:53:21 +0100 Subject: pptx: Add support for more layouts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now, the pptx writer only supported four slide layouts: “Title Slide” (used for the automatically generated metadata slide), “Section Header” (used for headings above the slide level), “Two Column” (used when there’s a columns div containing at least two column divs), and “Title and Content” (used for all other slides). This commit adds support for three more layouts: Comparison, Content with Caption, and Blank. - Support “Comparison” slide layout This layout is used when a slide contains at least two columns, at least one of which contains some text followed by some non-text (e.g. an image or table). The text in each column is inserted into the “body” placeholder for that column, and the non-text is inserted into the ObjType placeholder. Any extra content after the non-text is overlaid on top of the preceding content, rather than dropping it completely (as currently happens for the two-column layout). + Accept straightforward test changes Adding the new layout means the “-deleted-layouts” tests have an additional layout added to the master and master rels. + Add new tests for the comparison layout + Add new tests to pandoc.cabal - Support “Content with Caption” slide layout This layout is used when a slide’s body contains some text, followed by non-text (e.g. and image or a table). Before now, in this case the image or table would break onto a new slide: to get that output again, users can add a horizontal rule before the image or table. + Accept straightforward tests The “-deleted-layouts” tests all have an extra layout and relationship in the master for the Content with Caption layout. + Accept remove-empty-slides test Empty slides are still removed, but the Content with Caption layout is now used. + Change slide-level-0/h1-h2-with-text description This test now triggers the content with caption layout, giving a different (but still correct) result. + Add new tests for the new layout + Add new tests to the cabal file - Support “Blank” slide layout This layout is used when a slide contains only blank content (e.g. non-breaking spaces). No content is inserted into any placeholders in the layout. Fixes #5097. + Accept straightforward test changes Blank layout now copied over from reference doc as well, when layouts have been deleted. + Add some new tests A slide should use the blank layout if: - It contains only speaker notes - It contains only an empty heading with a body of nbsps - It contains only a heading containing only nbsps - Change ContentType -> Placeholder This type was starting to have a constructor for each placeholder on each slide (e.g. `ComparisonUpperLeftContent`). I’ve changed it instead to identify a placeholder by type and index, as I think that’s clearer and less redundant. - Describe layout-choosing logic in manual --- MANUAL.txt | 52 +++++- pandoc.cabal | 30 +++- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 179 ++++++++++++++++--- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 189 +++++++++++++++++---- test/Tests/Writers/Powerpoint.hs | 61 ++++++- .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 0 -> 35181 bytes test/pptx/blanks/just-speaker-notes/input.native | 7 + .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 0 -> 45873 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 0 -> 32304 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 0 -> 45369 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 0 -> 30444 bytes test/pptx/blanks/nbsp-in-body/input.native | 6 + test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 0 -> 41131 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 0 -> 27562 bytes test/pptx/blanks/nbsp-in-body/templated.pptx | Bin 0 -> 40630 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 0 -> 30444 bytes test/pptx/blanks/nbsp-in-heading/input.native | 5 + .../pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 0 -> 41131 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 0 -> 27562 bytes test/pptx/blanks/nbsp-in-heading/templated.pptx | Bin 0 -> 40630 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 31033 -> 31069 bytes test/pptx/code/deleted-layouts.pptx | Bin 31032 -> 31068 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 0 -> 45804 bytes test/pptx/comparison/both-columns/input.native | 23 +++ .../comparison/both-columns/moved-layouts.pptx | Bin 0 -> 56524 bytes test/pptx/comparison/both-columns/output.pptx | Bin 0 -> 42932 bytes test/pptx/comparison/both-columns/templated.pptx | Bin 0 -> 56025 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 0 -> 45833 bytes test/pptx/comparison/extra-image/input.native | 24 +++ .../pptx/comparison/extra-image/moved-layouts.pptx | Bin 0 -> 56552 bytes test/pptx/comparison/extra-image/output.pptx | Bin 0 -> 42961 bytes test/pptx/comparison/extra-image/templated.pptx | Bin 0 -> 56053 bytes .../comparison/extra-text/deleted-layouts.pptx | Bin 0 -> 45804 bytes test/pptx/comparison/extra-text/input.native | 23 +++ test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 0 -> 56524 bytes test/pptx/comparison/extra-text/output.pptx | Bin 0 -> 42932 bytes test/pptx/comparison/extra-text/templated.pptx | Bin 0 -> 56025 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 0 -> 45717 bytes test/pptx/comparison/non-text-first/input.native | 21 +++ .../comparison/non-text-first/moved-layouts.pptx | Bin 0 -> 56417 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 0 -> 42845 bytes test/pptx/comparison/non-text-first/templated.pptx | Bin 0 -> 55918 bytes .../comparison/one-column/deleted-layouts.pptx | Bin 0 -> 29136 bytes test/pptx/comparison/one-column/input.native | 21 +++ test/pptx/comparison/one-column/moved-layouts.pptx | Bin 0 -> 39856 bytes test/pptx/comparison/one-column/output.pptx | Bin 0 -> 26258 bytes test/pptx/comparison/one-column/templated.pptx | Bin 0 -> 39357 bytes .../heading-text-image/deleted-layouts.pptx | Bin 0 -> 45549 bytes .../heading-text-image/input.native | 3 + .../heading-text-image/moved-layouts.pptx | Bin 0 -> 56248 bytes .../heading-text-image/output.pptx | Bin 0 -> 42677 bytes .../heading-text-image/templated.pptx | Bin 0 -> 55749 bytes .../image-text/deleted-layouts.pptx | Bin 0 -> 46248 bytes .../content-with-caption/image-text/input.native | 2 + .../image-text/moved-layouts.pptx | Bin 0 -> 56934 bytes .../content-with-caption/image-text/output.pptx | Bin 0 -> 43374 bytes .../content-with-caption/image-text/templated.pptx | Bin 0 -> 56435 bytes .../text-image/deleted-layouts.pptx | Bin 0 -> 45488 bytes .../content-with-caption/text-image/input.native | 2 + .../text-image/moved-layouts.pptx | Bin 0 -> 56188 bytes .../content-with-caption/text-image/output.pptx | Bin 0 -> 42616 bytes .../content-with-caption/text-image/templated.pptx | Bin 0 -> 55689 bytes .../deleted-layouts.pptx | Bin 29806 -> 29842 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 30210 -> 30246 bytes test/pptx/endnotes-toc/deleted-layouts.pptx | Bin 30596 -> 30632 bytes test/pptx/endnotes/deleted-layouts.pptx | Bin 29774 -> 29810 bytes test/pptx/images/deleted-layouts.pptx | Bin 47437 -> 47473 bytes test/pptx/inline-formatting/deleted-layouts.pptx | Bin 28966 -> 29002 bytes test/pptx/lists/deleted-layouts.pptx | Bin 29861 -> 29897 bytes test/pptx/raw-ooxml/deleted-layouts.pptx | Bin 29754 -> 29790 bytes test/pptx/remove-empty-slides/deleted-layouts.pptx | Bin 46867 -> 46218 bytes test/pptx/remove-empty-slides/moved-layouts.pptx | Bin 57656 -> 56903 bytes test/pptx/remove-empty-slides/output.pptx | Bin 44025 -> 43346 bytes test/pptx/remove-empty-slides/templated.pptx | Bin 57172 -> 56404 bytes .../deleted-layouts.pptx | Bin 30554 -> 30590 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 32328 -> 32364 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 31378 -> 31414 bytes .../h1-h2-with-table/deleted-layouts.pptx | Bin 29828 -> 29137 bytes .../h1-h2-with-table/moved-layouts.pptx | Bin 40552 -> 39829 bytes .../slide-level-0/h1-h2-with-table/output.pptx | Bin 26985 -> 26259 bytes .../slide-level-0/h1-h2-with-table/templated.pptx | Bin 40052 -> 39330 bytes .../h1-with-image/deleted-layouts.pptx | Bin 45433 -> 45469 bytes .../h1-with-table/deleted-layouts.pptx | Bin 29008 -> 29044 bytes .../h2-with-image/deleted-layouts.pptx | Bin 45433 -> 45469 bytes .../deleted-layouts.pptx | Bin 34473 -> 34509 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33500 -> 33536 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54396 -> 54432 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38203 -> 38239 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 29837 -> 29873 bytes test/pptx/tables/deleted-layouts.pptx | Bin 30381 -> 30417 bytes test/pptx/two-column/deleted-layouts.pptx | Bin 28883 -> 28919 bytes 91 files changed, 580 insertions(+), 68 deletions(-) create mode 100644 test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx create mode 100644 test/pptx/blanks/just-speaker-notes/input.native create mode 100644 test/pptx/blanks/just-speaker-notes/moved-layouts.pptx create mode 100644 test/pptx/blanks/just-speaker-notes/output.pptx create mode 100644 test/pptx/blanks/just-speaker-notes/templated.pptx create mode 100644 test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx create mode 100644 test/pptx/blanks/nbsp-in-body/input.native create mode 100644 test/pptx/blanks/nbsp-in-body/moved-layouts.pptx create mode 100644 test/pptx/blanks/nbsp-in-body/output.pptx create mode 100644 test/pptx/blanks/nbsp-in-body/templated.pptx create mode 100644 test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx create mode 100644 test/pptx/blanks/nbsp-in-heading/input.native create mode 100644 test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx create mode 100644 test/pptx/blanks/nbsp-in-heading/output.pptx create mode 100644 test/pptx/blanks/nbsp-in-heading/templated.pptx create mode 100644 test/pptx/comparison/both-columns/deleted-layouts.pptx create mode 100644 test/pptx/comparison/both-columns/input.native create mode 100644 test/pptx/comparison/both-columns/moved-layouts.pptx create mode 100644 test/pptx/comparison/both-columns/output.pptx create mode 100644 test/pptx/comparison/both-columns/templated.pptx create mode 100644 test/pptx/comparison/extra-image/deleted-layouts.pptx create mode 100644 test/pptx/comparison/extra-image/input.native create mode 100644 test/pptx/comparison/extra-image/moved-layouts.pptx create mode 100644 test/pptx/comparison/extra-image/output.pptx create mode 100644 test/pptx/comparison/extra-image/templated.pptx create mode 100644 test/pptx/comparison/extra-text/deleted-layouts.pptx create mode 100644 test/pptx/comparison/extra-text/input.native create mode 100644 test/pptx/comparison/extra-text/moved-layouts.pptx create mode 100644 test/pptx/comparison/extra-text/output.pptx create mode 100644 test/pptx/comparison/extra-text/templated.pptx create mode 100644 test/pptx/comparison/non-text-first/deleted-layouts.pptx create mode 100644 test/pptx/comparison/non-text-first/input.native create mode 100644 test/pptx/comparison/non-text-first/moved-layouts.pptx create mode 100644 test/pptx/comparison/non-text-first/output.pptx create mode 100644 test/pptx/comparison/non-text-first/templated.pptx create mode 100644 test/pptx/comparison/one-column/deleted-layouts.pptx create mode 100644 test/pptx/comparison/one-column/input.native create mode 100644 test/pptx/comparison/one-column/moved-layouts.pptx create mode 100644 test/pptx/comparison/one-column/output.pptx create mode 100644 test/pptx/comparison/one-column/templated.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/input.native create mode 100644 test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/output.pptx create mode 100644 test/pptx/content-with-caption/heading-text-image/templated.pptx create mode 100644 test/pptx/content-with-caption/image-text/deleted-layouts.pptx create mode 100644 test/pptx/content-with-caption/image-text/input.native create mode 100644 test/pptx/content-with-caption/image-text/moved-layouts.pptx create mode 100644 test/pptx/content-with-caption/image-text/output.pptx create mode 100644 test/pptx/content-with-caption/image-text/templated.pptx create mode 100644 test/pptx/content-with-caption/text-image/deleted-layouts.pptx create mode 100644 test/pptx/content-with-caption/text-image/input.native create mode 100644 test/pptx/content-with-caption/text-image/moved-layouts.pptx create mode 100644 test/pptx/content-with-caption/text-image/output.pptx create mode 100644 test/pptx/content-with-caption/text-image/templated.pptx diff --git a/MANUAL.txt b/MANUAL.txt index f81f4c70b..afdd66ddd 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1182,11 +1182,15 @@ header when requesting a document from a URL: - Title and Content - Section Header - Two Content + - Comparison + - Content with Caption + - Blank For each name, the first layout found with that name will be used. If no layout is found with one of the names, pandoc will output a warning and use the layout with that name from the default reference - doc instead. + doc instead. (How these layouts are used is described in [PowerPoint + layout choice](#powerpoint-layout-choice).) All templates included with a recent version of MS PowerPoint will fit these criteria. (You can click on `Layout` under the @@ -1195,8 +1199,8 @@ header when requesting a document from a URL: You can also modify the default `reference.pptx`: first run `pandoc -o custom-reference.pptx --print-default-data-file reference.pptx`, and then modify `custom-reference.pptx` - in MS PowerPoint (pandoc will use the first four layout - slides, as mentioned above). + in MS PowerPoint (pandoc will use the layouts with the names + listed above). `--epub-cover-image=`*FILE* @@ -5833,6 +5837,48 @@ you use deeper nesting of section levels with reveal.js unless you set `--slide-level=0` (which lets reveal.js produce a one-dimensional layout and only interprets horizontal rules as slide boundaries). +### PowerPoint layout choice + +When creating slides, the pptx writer chooses from a number of pre-defined +layouts, based on the content of the slide: + +Title Slide +: This layout is used for the initial slide, which is generated and + filled from the metadata fields `date`, `author`, and `title`, if + they are present. + +Section Header +: This layout is used for what pandoc calls “title slides”, i.e. + slides which start with a header which is above the slide level in + the hierarchy. + +Two Content +: This layout is used for two-column slides, i.e. slides containing a + div with class `columns` which contains at least two divs with class + `column`. + +Comparison +: This layout is used instead of “Two Content” for any two-column + slides in which at least one column contains text followed by + non-text (e.g. an image or a table). + +Content with Caption +: This layout is used for any non-two-column slides which contain text + followed by non-text (e.g. an image or a table). + +Blank +: This layout is used for any slides which only contain blank content, + e.g. a slide containing only speaker notes, or a slide containing + only a non-breaking space. + +Title and Content +: This layout is used for all slides which do not match the criteria + for another layout. + +These layouts are chosen from the default pptx reference doc included with +pandoc, unless an alternative reference doc is specified using +`--reference-doc`. + ## Incremental lists By default, these writers produce lists that display "all at once." diff --git a/pandoc.cabal b/pandoc.cabal index 7fb951488..3de7da39c 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -380,17 +380,31 @@ extra-source-files: test/rtf/*.native test/rtf/*.rtf test/pptx/*.pptx + test/pptx/blanks/just-speaker-notes/input.native + test/pptx/blanks/just-speaker-notes/*.pptx + test/pptx/blanks/nbsp-in-body/input.native + test/pptx/blanks/nbsp-in-body/*.pptx + test/pptx/blanks/nbsp-in-heading/input.native + test/pptx/blanks/nbsp-in-heading/*.pptx test/pptx/code-custom/*.pptx test/pptx/code/input.native test/pptx/code/*.pptx - test/pptx/comparison-both-columns/input.native - test/pptx/comparison-both-columns/*.pptx - test/pptx/comparison-extra-text/input.native - test/pptx/comparison-extra-text/*.pptx - test/pptx/comparison-non-text-first/input.native - test/pptx/comparison-non-text-first/*.pptx - test/pptx/comparison-one-column/input.native - test/pptx/comparison-one-column/*.pptx + test/pptx/content-with-caption/heading-text-image/input.native + test/pptx/content-with-caption/heading-text-image/*.pptx + test/pptx/content-with-caption/image-text/input.native + test/pptx/content-with-caption/image-text/*.pptx + test/pptx/content-with-caption/text-image/input.native + test/pptx/content-with-caption/text-image/*.pptx + test/pptx/comparison/both-columns/input.native + test/pptx/comparison/both-columns/*.pptx + test/pptx/comparison/extra-image/input.native + test/pptx/comparison/extra-image/*.pptx + test/pptx/comparison/extra-text/input.native + test/pptx/comparison/extra-text/*.pptx + test/pptx/comparison/non-text-first/input.native + test/pptx/comparison/non-text-first/*.pptx + test/pptx/comparison/one-column/input.native + test/pptx/comparison/one-column/*.pptx test/pptx/document-properties-short-desc/input.native test/pptx/document-properties-short-desc/*.pptx test/pptx/document-properties/input.native diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 0e6a67861..d83fb2182 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -1,6 +1,7 @@ {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} +{-# LANGUAGE RecordWildCards #-} {- | Module : Text.Pandoc.Writers.Powerpoint.Output Copyright : Copyright (C) 2017-2020 Jesse Rosenthal @@ -115,7 +116,7 @@ data WriterEnv = WriterEnv { envRefArchive :: Archive -- the end of the slide file name and -- the rId number , envSlideIdOffset :: Int - , envContentType :: ContentType + , envPlaceholder :: Placeholder , envSlideIdMap :: M.Map SlideId Int -- maps the slide number to the -- corresponding notes id number. If there @@ -139,7 +140,7 @@ instance Default WriterEnv where , envInNoteSlide = False , envCurSlideId = 1 , envSlideIdOffset = 1 - , envContentType = NormalContent + , envPlaceholder = Placeholder ObjType 0 , envSlideIdMap = mempty , envSpeakerNotesIdMap = mempty , envInSpeakerNotes = False @@ -153,6 +154,9 @@ data SlideLayoutsOf a = SlideLayouts , title :: a , content :: a , twoColumn :: a + , comparison :: a + , contentWithCaption :: a + , blank :: a } deriving (Show, Functor, Foldable, Traversable) data SlideLayout = SlideLayout @@ -170,10 +174,14 @@ getSlideLayouts = asks envSlideLayouts >>= maybe (throwError e) pure e = PandocSomeError ("Slide layouts aren't defined, even though they should " <> "always be. This is a bug in pandoc.") -data ContentType = NormalContent - | TwoColumnLeftContent - | TwoColumnRightContent - deriving (Show, Eq) +-- | A placeholder within a layout, identified by type and index. +-- +-- E.g., @Placeholder ObjType 2@ is the third placeholder of type 'ObjType' in +-- the layout. +data Placeholder = Placeholder + { placeholderType :: PHType + , index :: Int + } deriving (Show, Eq) data MediaInfo = MediaInfo { mInfoFilePath :: FilePath , mInfoLocalId :: Int @@ -446,6 +454,9 @@ presentationToArchive opts meta pres = do , title = "Section Header" , content = "Title and Content" , twoColumn = "Two Content" + , comparison = "Comparison" + , contentWithCaption = "Content with Caption" + , blank = "Blank" } layouts <- for layoutTitles $ \layoutTitle -> do let layout = M.lookup (CI.mk layoutTitle) referenceLayouts @@ -550,10 +561,13 @@ getLayout layout = getElement <$> getSlideLayouts where getElement = slElement . case layout of - MetadataSlide{} -> metadata - TitleSlide{} -> title - ContentSlide{} -> content - TwoColumnSlide{} -> twoColumn + MetadataSlide{} -> metadata + TitleSlide{} -> title + ContentSlide{} -> content + TwoColumnSlide{} -> twoColumn + ComparisonSlide{} -> comparison + ContentWithCaptionSlide{} -> contentWithCaption + BlankSlide{} -> blank shapeHasId :: NameSpaces -> T.Text -> Element -> Bool shapeHasId ns ident element @@ -566,17 +580,31 @@ shapeHasId ns ident element getContentShape :: PandocMonad m => NameSpaces -> Element -> P m Element getContentShape ns spTreeElem | isElem ns "p" "spTree" spTreeElem = do - contentType <- asks envContentType - let contentShapes = getShapesByPlaceHolderType ns spTreeElem ObjType - case contentType of - NormalContent | (sp : _) <- contentShapes -> return sp - TwoColumnLeftContent | (sp : _) <- contentShapes -> return sp - TwoColumnRightContent | (_ : sp : _) <- contentShapes -> return sp - _ -> throwError $ PandocSomeError - "Could not find shape for Powerpoint content" + ph@Placeholder{..} <- asks envPlaceholder + case drop index (getShapesByPlaceHolderType ns spTreeElem placeholderType) of + sp : _ -> return sp + [] -> throwError $ PandocSomeError $ missingPlaceholderMessage ph getContentShape _ _ = throwError $ PandocSomeError "Attempted to find content on non shapeTree" +missingPlaceholderMessage :: Placeholder -> Text +missingPlaceholderMessage Placeholder{..} = + "Could not find a " <> ordinal + <> " placeholder of type " <> placeholderText + where + ordinal = T.pack (show index) <> + case (index `mod` 100, index `mod` 10) of + (11, _) -> "th" + (12, _) -> "th" + (13, _) -> "th" + (_, 1) -> "st" + (_, 2) -> "nd" + (_, 3) -> "rd" + _ -> "th" + placeholderText = case placeholderType of + ObjType -> "obj (or nothing)" + PHType t -> t + getShapeDimensions :: NameSpaces -> Element -> Maybe ((Integer, Integer), (Integer, Integer)) @@ -1302,7 +1330,7 @@ contentToElement layout hdrShape shapes element <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] contentElements <- local - (\env -> env {envContentType = NormalContent}) + (\env -> env {envPlaceholder = Placeholder ObjType 0}) (shapesToElements layout shapes) return $ buildSpTree ns spTree (hdrShapeElements <> contentElements) contentToElement _ _ _ = return $ mknode "p:sp" [] () @@ -1315,10 +1343,10 @@ twoColumnToElement layout hdrShape shapesL shapesR element <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] contentElementsL <- local - (\env -> env {envContentType =TwoColumnLeftContent}) + (\env -> env {envPlaceholder = Placeholder ObjType 0}) (shapesToElements layout shapesL) contentElementsR <- local - (\env -> env {envContentType =TwoColumnRightContent}) + (\env -> env {envPlaceholder = Placeholder ObjType 1}) (shapesToElements layout shapesR) -- let contentElementsL' = map (setIdx ns "1") contentElementsL -- contentElementsR' = map (setIdx ns "2") contentElementsR @@ -1326,6 +1354,76 @@ twoColumnToElement layout hdrShape shapesL shapesR hdrShapeElements <> contentElementsL <> contentElementsR twoColumnToElement _ _ _ _= return $ mknode "p:sp" [] () +comparisonToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + ([Shape], [Shape]) -> + ([Shape], [Shape]) -> + P m Element +comparisonToElement layout hdrShape (shapesL1, shapesL2) (shapesR1, shapesR2) + | ns <- elemToNameSpaces layout + , Just cSld <- findChild (elemName ns "p" "cSld") layout + , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do + element <- nonBodyTextToElement layout [PHType "title"] hdrShape + let hdrShapeElements = [Elem element | not (null hdrShape)] + contentElementsL1 <- local + (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) + (shapesToElements layout shapesL1) + contentElementsL2 <- local + (\env -> env {envPlaceholder = Placeholder ObjType 0}) + (shapesToElements layout shapesL2) + contentElementsR1 <- local + (\env -> env {envPlaceholder = Placeholder (PHType "body") 1}) + (shapesToElements layout shapesR1) + contentElementsR2 <- local + (\env -> env {envPlaceholder = Placeholder ObjType 1}) + (shapesToElements layout shapesR2) + return $ buildSpTree ns spTree $ + mconcat [ hdrShapeElements + , contentElementsL1 + , contentElementsL2 + , contentElementsR1 + , contentElementsR2 + ] +comparisonToElement _ _ _ _= return $ mknode "p:sp" [] () + +contentWithCaptionToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + [Shape] -> + [Shape] -> + P m Element +contentWithCaptionToElement layout hdrShape textShapes contentShapes + | ns <- elemToNameSpaces layout + , Just cSld <- findChild (elemName ns "p" "cSld") layout + , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do + element <- nonBodyTextToElement layout [PHType "title"] hdrShape + let hdrShapeElements = [Elem element | not (null hdrShape)] + textElements <- local + (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) + (shapesToElements layout textShapes) + contentElements <- local + (\env -> env {envPlaceholder = Placeholder ObjType 0}) + (shapesToElements layout contentShapes) + return $ buildSpTree ns spTree $ + mconcat [ hdrShapeElements + , textElements + , contentElements + ] +contentWithCaptionToElement _ _ _ _ = return $ mknode "p:sp" [] () + +blankToElement :: + PandocMonad m => + Element -> + P m Element +blankToElement layout + | ns <- elemToNameSpaces layout + , Just cSld <- findChild (elemName ns "p" "cSld") layout + , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do + return $ buildSpTree ns spTree [] +blankToElement _ = return $ mknode "p:sp" [] () titleToElement :: PandocMonad m => Element -> [ParaElem] -> P m Element titleToElement layout titleElems @@ -1380,6 +1478,17 @@ slideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _) = do ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") ] [mknode "p:cSld" [] [spTree]] +slideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _) = do + layout <- getLayout l + spTree <- local (\env -> if null hdrElems + then env + else env{envSlideHasHeader=True}) $ + comparisonToElement layout hdrElems shapesL shapesR + return $ mknode "p:sld" + [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), + ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), + ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") + ] [mknode "p:cSld" [] [spTree]] slideToElement (Slide _ l@(TitleSlide hdrElems) _) = do layout <- getLayout l spTree <- titleToElement layout hdrElems @@ -1396,7 +1505,22 @@ slideToElement (Slide _ l@(MetadataSlide titleElems subtitleElems authorElems da ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") ] [mknode "p:cSld" [] [spTree]] - +slideToElement (Slide _ l@(ContentWithCaptionSlide hdrElems captionShapes contentShapes) _) = do + layout <- getLayout l + spTree <- contentWithCaptionToElement layout hdrElems captionShapes contentShapes + return $ mknode "p:sld" + [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), + ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), + ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") + ] [mknode "p:cSld" [] [spTree]] +slideToElement (Slide _ BlankSlide _) = do + layout <- getLayout BlankSlide + spTree <- blankToElement layout + return $ mknode "p:sld" + [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), + ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), + ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") + ] [mknode "p:cSld" [] [spTree]] -------------------------------------------------------------------- -- Notes: @@ -1800,10 +1924,13 @@ slideToSlideRelElement slide = do target <- flip fmap getSlideLayouts $ T.pack . ("../slideLayouts/" <>) . takeFileName . slPath . case slide of - (Slide _ MetadataSlide{} _) -> metadata - (Slide _ TitleSlide{} _) -> title - (Slide _ ContentSlide{} _) -> content - (Slide _ TwoColumnSlide{} _) -> twoColumn + (Slide _ MetadataSlide{} _) -> metadata + (Slide _ TitleSlide{} _) -> title + (Slide _ ContentSlide{} _) -> content + (Slide _ TwoColumnSlide{} _) -> twoColumn + (Slide _ ComparisonSlide{} _) -> comparison + (Slide _ ContentWithCaptionSlide{} _) -> contentWithCaption + (Slide _ BlankSlide _) -> blank speakerNotesRels <- maybeToList <$> speakerNotesSlideRelElement slide diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 284b9ae62..10060d975 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -2,6 +2,7 @@ {-# LANGUAGE PatternGuards #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE LambdaCase #-} {- | Module : Text.Pandoc.Writers.Powerpoint.Presentation Copyright : Copyright (C) 2017-2020 Jesse Rosenthal @@ -61,11 +62,13 @@ import Text.Pandoc.Writers.Shared (lookupMetaInlines, lookupMetaBlocks , toLegacyTable) import qualified Data.Map as M import qualified Data.Set as S -import Data.Maybe (maybeToList, fromMaybe) +import Data.Maybe (maybeToList, fromMaybe, listToMaybe) import Text.Pandoc.Highlighting import qualified Data.Text as T import Control.Applicative ((<|>)) import Skylighting +import Data.Bifunctor (bimap) +import Data.Char (isSpace) data WriterEnv = WriterEnv { envMetadata :: Meta , envRunProps :: RunProps @@ -195,6 +198,11 @@ data Layout = MetadataSlide [ParaElem] [ParaElem] [[ParaElem]] [ParaElem] -- heading content | TwoColumnSlide [ParaElem] [Shape] [Shape] -- heading left right + | ComparisonSlide [ParaElem] ([Shape], [Shape]) ([Shape], [Shape]) + -- heading left@(text, content) right@(text, content) + | ContentWithCaptionSlide [ParaElem] [Shape] [Shape] + -- heading text content + | BlankSlide deriving (Show, Eq) data Shape = Pic PicProps FilePath T.Text [ParaElem] @@ -584,7 +592,30 @@ isImage Image{} = True isImage (Link _ (Image{} : _) _) = True isImage _ = False -splitBlocks' :: [Block] -> [[Block]] -> [Block] -> Pres [[Block]] +plainOrPara :: Block -> Maybe [Inline] +plainOrPara (Plain ils) = Just ils +plainOrPara (Para ils) = Just ils +plainOrPara _ = Nothing + +notText :: Block -> Bool +notText block | startsWithImage block = True +notText Table{} = True +notText _ = False + +startsWithImage :: Block -> Bool +startsWithImage block = fromMaybe False $ do + inline <- plainOrPara block >>= listToMaybe + pure (isImage inline) + +-- | Group blocks into a number of "splits" +splitBlocks' :: + -- | Blocks so far in the current split + [Block] -> + -- | Splits so far + [[Block]] -> + -- | All remaining blocks + [Block] -> + Pres [[Block]] splitBlocks' cur acc [] = return $ acc ++ ([cur | not (null cur)]) splitBlocks' cur acc (HorizontalRule : blks) = splitBlocks' [] (acc ++ ([cur | not (null cur)])) blks @@ -609,7 +640,9 @@ splitBlocks' cur acc (Para (il:ils) : blks) | isImage il = do (acc ++ [cur ++ [Para [il]] ++ nts]) (if null ils then blks' else Para ils : blks') _ -> splitBlocks' [] - (acc ++ ([cur | not (null cur)]) ++ [Para [il] : nts]) + (if any notText cur + then acc ++ ([cur | not (null cur)]) ++ [Para [il] : nts] + else acc ++ [cur ++ [Para [il]] ++ nts]) (if null ils then blks' else Para ils : blks') splitBlocks' cur acc (tbl@Table{} : blks) = do slideLevel <- asks envSlideLevel @@ -617,7 +650,11 @@ splitBlocks' cur acc (tbl@Table{} : blks) = do case cur of [Header n _ _] | n == slideLevel || slideLevel == 0 -> splitBlocks' [] (acc ++ [cur ++ [tbl] ++ nts]) blks' - _ -> splitBlocks' [] (acc ++ ([cur | not (null cur)]) ++ [tbl : nts]) blks' + _ -> splitBlocks' [] + (if any notText cur + then acc ++ ([cur | not (null cur)]) ++ [tbl : nts] + else acc ++ ([cur ++ [tbl] ++ nts])) + blks' splitBlocks' cur acc (d@(Div (_, classes, _) _): blks) | "columns" `elem` classes = do slideLevel <- asks envSlideLevel let (nts, blks') = span isNotesDiv blks @@ -639,38 +676,56 @@ bodyBlocksToSlide _ (blk : blks) spkNotes , Div (_, clsL, _) blksL : Div (_, clsR, _) blksR : remaining <- divBlks , "column" `elem` clsL, "column" `elem` clsR = do mapM_ (addLogMessage . BlockNotRendered) (blks ++ remaining) - mbSplitBlksL <- splitBlocks blksL - mbSplitBlksR <- splitBlocks blksR - let blksL' = case mbSplitBlksL of - bs : _ -> bs - [] -> [] - let blksR' = case mbSplitBlksR of - bs : _ -> bs - [] -> [] - shapesL <- blocksToShapes blksL' - shapesR <- blocksToShapes blksR' - sldId <- asks envCurSlideId - return $ Slide - sldId - (TwoColumnSlide [] shapesL shapesR) - spkNotes + let mkTwoColumn left right = do + blksL' <- join . take 1 <$> splitBlocks left + blksR' <- join . take 1 <$> splitBlocks right + shapesL <- blocksToShapes blksL' + shapesR <- blocksToShapes blksR' + sldId <- asks envCurSlideId + return $ Slide + sldId + (TwoColumnSlide [] shapesL shapesR) + spkNotes + let mkComparison blksL1 blksL2 blksR1 blksR2 = do + shapesL1 <- blocksToShapes blksL1 + shapesL2 <- blocksToShapes blksL2 + shapesR1 <- blocksToShapes blksR1 + shapesR2 <- blocksToShapes blksR2 + sldId <- asks envCurSlideId + return $ Slide + sldId + (ComparisonSlide [] (shapesL1, shapesL2) (shapesR1, shapesR2)) + spkNotes + case (break notText blksL, break notText blksR) of + ((_, []), (_, [])) -> mkTwoColumn blksL blksR + (([], _), ([], _)) -> mkTwoColumn blksL blksR + ((blksL1, blksL2), (blksR1, blksR2)) -> mkComparison blksL1 blksL2 blksR1 blksR2 bodyBlocksToSlide _ (blk : blks) spkNotes = do - inNoteSlide <- asks envInNoteSlide - shapes <- if inNoteSlide - then forceFontSize noteSize $ blocksToShapes (blk : blks) - else blocksToShapes (blk : blks) sldId <- asks envCurSlideId - return $ - Slide - sldId - (ContentSlide [] shapes) - spkNotes + inNoteSlide <- asks envInNoteSlide + let mkSlide s = + Slide sldId s spkNotes + if inNoteSlide + then mkSlide . ContentSlide [] <$> + forceFontSize noteSize (blocksToShapes (blk : blks)) + else let + contentOrBlankSlide = + if makesBlankSlide (blk : blks) + then pure (mkSlide BlankSlide) + else mkSlide . ContentSlide [] <$> blocksToShapes (blk : blks) + in case break notText (blk : blks) of + ([], _) -> contentOrBlankSlide + (_, []) -> contentOrBlankSlide + (textBlocks, contentBlocks) -> do + textShapes <- blocksToShapes textBlocks + contentShapes <- blocksToShapes contentBlocks + return (mkSlide (ContentWithCaptionSlide [] textShapes contentShapes)) bodyBlocksToSlide _ [] spkNotes = do sldId <- asks envCurSlideId return $ Slide sldId - (ContentSlide [] []) + BlankSlide spkNotes blocksToSlide' :: Int -> [Block] -> SpeakerNotes -> Pres Slide @@ -689,6 +744,9 @@ blocksToSlide' lvl (Header n (ident, _, _) ils : blks) spkNotes let layout = case slideLayout slide of ContentSlide _ cont -> ContentSlide hdr cont TwoColumnSlide _ contL contR -> TwoColumnSlide hdr contL contR + ComparisonSlide _ contL contR -> ComparisonSlide hdr contL contR + ContentWithCaptionSlide _ text content -> ContentWithCaptionSlide hdr text content + BlankSlide -> if all inlineIsBlank ils then BlankSlide else ContentSlide hdr [] layout' -> layout' return $ slide{slideLayout = layout} blocksToSlide' lvl blks spkNotes = bodyBlocksToSlide lvl blks spkNotes @@ -834,6 +892,19 @@ applyToLayout f (TwoColumnSlide hdr contentL contentR) = do contentL' <- mapM (applyToShape f) contentL contentR' <- mapM (applyToShape f) contentR return $ TwoColumnSlide hdr' contentL' contentR' +applyToLayout f (ComparisonSlide hdr (contentL1, contentL2) (contentR1, contentR2)) = do + hdr' <- mapM f hdr + contentL1' <- mapM (applyToShape f) contentL1 + contentL2' <- mapM (applyToShape f) contentL2 + contentR1' <- mapM (applyToShape f) contentR1 + contentR2' <- mapM (applyToShape f) contentR2 + return $ ComparisonSlide hdr' (contentL1', contentL2') (contentR1', contentR2') +applyToLayout f (ContentWithCaptionSlide hdr textShapes contentShapes) = do + hdr' <- mapM f hdr + textShapes' <- mapM (applyToShape f) textShapes + contentShapes' <- mapM (applyToShape f) contentShapes + return $ ContentWithCaptionSlide hdr' textShapes' contentShapes' +applyToLayout _ BlankSlide = pure BlankSlide applyToSlide :: Monad m => (ParaElem -> m ParaElem) -> Slide -> m Slide applyToSlide f slide = do @@ -885,10 +956,70 @@ emptyLayout layout = case layout of all emptyParaElem hdr && all emptyShape shapes1 && all emptyShape shapes2 + ComparisonSlide hdr (shapesL1, shapesL2) (shapesR1, shapesR2) -> + all emptyParaElem hdr && + all emptyShape shapesL1 && + all emptyShape shapesL2 && + all emptyShape shapesR1 && + all emptyShape shapesR2 + ContentWithCaptionSlide hdr textShapes contentShapes -> + all emptyParaElem hdr && + all emptyShape textShapes && + all emptyShape contentShapes + BlankSlide -> False + emptySlide :: Slide -> Bool emptySlide (Slide _ layout notes) = (notes == mempty) && emptyLayout layout +makesBlankSlide :: [Block] -> Bool +makesBlankSlide = all blockIsBlank + +blockIsBlank :: Block -> Bool +blockIsBlank + = \case + Plain ins -> all inlineIsBlank ins + Para ins -> all inlineIsBlank ins + LineBlock inss -> all (all inlineIsBlank) inss + CodeBlock _ txt -> textIsBlank txt + RawBlock _ txt -> textIsBlank txt + BlockQuote bls -> all blockIsBlank bls + OrderedList _ blss -> all (all blockIsBlank) blss + BulletList blss -> all (all blockIsBlank) blss + DefinitionList ds -> all (uncurry (&&) . bimap (all inlineIsBlank) (all (all blockIsBlank))) ds + Header _ _ ils -> all inlineIsBlank ils + HorizontalRule -> True + Table{} -> False + Div _ bls -> all blockIsBlank bls + Null -> True + +textIsBlank :: T.Text -> Bool +textIsBlank = T.all isSpace + +inlineIsBlank :: Inline -> Bool +inlineIsBlank + = \case + (Str txt) -> textIsBlank txt + (Emph ins) -> all inlineIsBlank ins + (Underline ins) -> all inlineIsBlank ins + (Strong ins) -> all inlineIsBlank ins + (Strikeout ins) -> all inlineIsBlank ins + (Superscript ins) -> all inlineIsBlank ins + (Subscript ins) -> all inlineIsBlank ins + (SmallCaps ins) -> all inlineIsBlank ins + (Quoted _ ins) -> all inlineIsBlank ins + (Cite _ _) -> False + (Code _ txt) -> textIsBlank txt + Space -> True + SoftBreak -> True + LineBreak -> True + (Math _ txt) -> textIsBlank txt + (RawInline _ txt) -> textIsBlank txt + (Link _ ins (t1, t2)) -> all inlineIsBlank ins && textIsBlank t1 && textIsBlank t2 + (Image _ ins (t1, t2)) -> all inlineIsBlank ins && textIsBlank t1 && textIsBlank t2 + (Note bls) -> all blockIsBlank bls + (Span _ ins) -> all inlineIsBlank ins + blocksToPresentationSlides :: [Block] -> Pres [Slide] blocksToPresentationSlides blks = do opts <- asks envOpts diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index fd9871659..256ee1f7f 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -166,9 +166,66 @@ tests = groupPptxTests [ pptxTests "Inline formatting" "pptx/slide-level-0/h1-with-table/output.pptx" , pptxTests ("Using slide level 0, if the first thing on " <> "a slide is a heading it's used as the " - <> "slide title (two headings forces a " - <> "slide break though)") + <> "slide title (content with caption layout)") def { writerSlideLevel = Just 0 } "pptx/slide-level-0/h1-h2-with-table/input.native" "pptx/slide-level-0/h1-h2-with-table/output.pptx" + , pptxTests ("comparison layout used when two columns " + <> "contain text plus non-text") + def + "pptx/comparison/both-columns/input.native" + "pptx/comparison/both-columns/output.pptx" + , pptxTests ("comparison layout used even when only one " + <> "column contains text plus non-text") + def + "pptx/comparison/one-column/input.native" + "pptx/comparison/one-column/output.pptx" + , pptxTests ("extra text in one column in comparison " + <> "layout gets overlaid") + def + "pptx/comparison/extra-text/input.native" + "pptx/comparison/extra-text/output.pptx" + , pptxTests ("extra image in one column in comparison " + <> "layout gets overlaid") + def + "pptx/comparison/extra-image/input.native" + "pptx/comparison/extra-image/output.pptx" + , pptxTests "comparison not used if the non-text comes first" + def + "pptx/comparison/non-text-first/input.native" + "pptx/comparison/non-text-first/output.pptx" + , pptxTests ("Heading, text and an image on the same " + <> "slide uses the Content with Caption " + <> "layout") + def + "pptx/content-with-caption/heading-text-image/input.native" + "pptx/content-with-caption/heading-text-image/output.pptx" + , pptxTests ("Text and an image on the same " + <> "slide uses the Content with Caption " + <> "layout") + def + "pptx/content-with-caption/text-image/input.native" + "pptx/content-with-caption/text-image/output.pptx" + , pptxTests ("If the image comes first, Content with " + <> "Caption is not used") + def + "pptx/content-with-caption/image-text/input.native" + "pptx/content-with-caption/image-text/output.pptx" + , pptxTests ("If a slide contains only speaker notes, the " + <> "Blank layout is used") + def + "pptx/blanks/just-speaker-notes/input.native" + "pptx/blanks/just-speaker-notes/output.pptx" + , pptxTests ("If a slide contains only an empty heading " + <> "with a body of only non-breaking spaces" + <> ", the Blank layout is used") + def + "pptx/blanks/nbsp-in-body/input.native" + "pptx/blanks/nbsp-in-body/output.pptx" + , pptxTests ("If a slide contains only a heading " + <> "containing only non-breaking spaces, " + <> "the Blank layout is used") + def + "pptx/blanks/nbsp-in-heading/input.native" + "pptx/blanks/nbsp-in-heading/output.pptx" ] diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx new file mode 100644 index 000000000..82800a074 Binary files /dev/null and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/input.native b/test/pptx/blanks/just-speaker-notes/input.native new file mode 100644 index 000000000..d2e2cfbe2 --- /dev/null +++ b/test/pptx/blanks/just-speaker-notes/input.native @@ -0,0 +1,7 @@ +[Header 1 ("first-slide",[],[]) [Str "First",Space,Str "slide"] +,Para [Str "Nothing",Space,Str "to",Space,Str "see",Space,Str "here"] +,Header 1 ("section",[],[]) [] +,Div ("",["notes"],[]) + [Para [Str "Some",Space,Str "notes",Space,Str "here:",Space,Str "this",Space,Str "first",Space,Str "slide",Space,Str "should",Space,Str "use",Space,Str "the",Space,Str "Blank",Space,Str "template"]] +,Header 1 ("third-slide",[],[]) [Str "Third",Space,Str "slide"] +,Para [Str "The",Space,Str "second",Space,Str "slide",Space,Str "should",Space,Str "be",Space,Str "blank"]] diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx new file mode 100644 index 000000000..f5ef1d7bd Binary files /dev/null and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx new file mode 100644 index 000000000..59a643c3e Binary files /dev/null and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx new file mode 100644 index 000000000..8cc7be75b Binary files /dev/null and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx new file mode 100644 index 000000000..98a1586df Binary files /dev/null and b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/input.native b/test/pptx/blanks/nbsp-in-body/input.native new file mode 100644 index 000000000..56c105fb0 --- /dev/null +++ b/test/pptx/blanks/nbsp-in-body/input.native @@ -0,0 +1,6 @@ +[Header 1 ("first-slide",[],[]) [Str "First",Space,Str "slide"] +,Para [Str "Uninteresting,",Space,Str "normal"] +,Header 1 ("section",[],[]) [] +,Para [Str "\160"] +,Header 1 ("third-slide",[],[]) [Str "Third",Space,Str "slide"] +,Para [Str "Was",Space,Str "the",Space,Str "previous",Space,Str "one",Space,Str "blank?"]] diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx new file mode 100644 index 000000000..fca99b672 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx new file mode 100644 index 000000000..ed5c77e05 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/templated.pptx b/test/pptx/blanks/nbsp-in-body/templated.pptx new file mode 100644 index 000000000..4104f6230 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-body/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx new file mode 100644 index 000000000..98a1586df Binary files /dev/null and b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/input.native b/test/pptx/blanks/nbsp-in-heading/input.native new file mode 100644 index 000000000..a5c7fc1ca --- /dev/null +++ b/test/pptx/blanks/nbsp-in-heading/input.native @@ -0,0 +1,5 @@ +[Header 1 ("first-slide",[],[]) [Str "First",Space,Str "slide"] +,Para [Str "Uninteresting,",Space,Str "normal"] +,Header 1 ("section",[],[]) [Str "\160"] +,Header 1 ("third-slide",[],[]) [Str "Third",Space,Str "slide"] +,Para [Str "Was",Space,Str "the",Space,Str "previous",Space,Str "one",Space,Str "blank?"]] diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx new file mode 100644 index 000000000..fca99b672 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx new file mode 100644 index 000000000..ed5c77e05 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/templated.pptx b/test/pptx/blanks/nbsp-in-heading/templated.pptx new file mode 100644 index 000000000..4104f6230 Binary files /dev/null and b/test/pptx/blanks/nbsp-in-heading/templated.pptx differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx index 9282e6354..fdcc7ce1d 100644 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx index 0f503f553..c7f78ac40 100644 Binary files a/test/pptx/code/deleted-layouts.pptx and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx new file mode 100644 index 000000000..6a5affdbf Binary files /dev/null and b/test/pptx/comparison/both-columns/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/input.native b/test/pptx/comparison/both-columns/input.native new file mode 100644 index 000000000..2557880d4 --- /dev/null +++ b/test/pptx/comparison/both-columns/input.native @@ -0,0 +1,23 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Then",Space,Str "some",Space,Str "more",Space,Str "text"]] + ,Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Para [Image ("",[],[]) [Str "Plus",Space,Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx new file mode 100644 index 000000000..88282fabb Binary files /dev/null and b/test/pptx/comparison/both-columns/moved-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx new file mode 100644 index 000000000..477072fb4 Binary files /dev/null and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx new file mode 100644 index 000000000..431d22392 Binary files /dev/null and b/test/pptx/comparison/both-columns/templated.pptx differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx new file mode 100644 index 000000000..beed077f7 Binary files /dev/null and b/test/pptx/comparison/extra-image/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/input.native b/test/pptx/comparison/extra-image/input.native new file mode 100644 index 000000000..34aeb8f2b --- /dev/null +++ b/test/pptx/comparison/extra-image/input.native @@ -0,0 +1,24 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Then",Space,Str "some",Space,Str "more",Space,Str "text"]] + ,Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Para [Image ("",[],[]) [Str "Plus",Space,Str "an",Space,Str "image"] ("lalune.jpg","fig:")] + ,Para [Image ("",[],[]) [Str "And",Space,Str "another",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx new file mode 100644 index 000000000..f86f5b043 Binary files /dev/null and b/test/pptx/comparison/extra-image/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx new file mode 100644 index 000000000..a0eb5e847 Binary files /dev/null and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx new file mode 100644 index 000000000..a434ba29f Binary files /dev/null and b/test/pptx/comparison/extra-image/templated.pptx differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx new file mode 100644 index 000000000..6a5affdbf Binary files /dev/null and b/test/pptx/comparison/extra-text/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/input.native b/test/pptx/comparison/extra-text/input.native new file mode 100644 index 000000000..2557880d4 --- /dev/null +++ b/test/pptx/comparison/extra-text/input.native @@ -0,0 +1,23 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Then",Space,Str "some",Space,Str "more",Space,Str "text"]] + ,Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Para [Image ("",[],[]) [Str "Plus",Space,Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx new file mode 100644 index 000000000..88282fabb Binary files /dev/null and b/test/pptx/comparison/extra-text/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx new file mode 100644 index 000000000..8de7d23b2 Binary files /dev/null and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx new file mode 100644 index 000000000..431d22392 Binary files /dev/null and b/test/pptx/comparison/extra-text/templated.pptx differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx new file mode 100644 index 000000000..bd7aa69b7 Binary files /dev/null and b/test/pptx/comparison/non-text-first/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/input.native b/test/pptx/comparison/non-text-first/input.native new file mode 100644 index 000000000..a8caad151 --- /dev/null +++ b/test/pptx/comparison/non-text-first/input.native @@ -0,0 +1,21 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "table"]]]])] + (TableFoot ("",[],[]) + []) + ,Para [Str "Plus",Space,Str "a",Space,Str "paragraph",Space,Str "here"]] + ,Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "Just",Space,Str "an",Space,Str "image",Space,Str "on",Space,Str "this",Space,Str "side"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx new file mode 100644 index 000000000..a01def95c Binary files /dev/null and b/test/pptx/comparison/non-text-first/moved-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx new file mode 100644 index 000000000..cb7843fce Binary files /dev/null and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx new file mode 100644 index 000000000..32db19cbf Binary files /dev/null and b/test/pptx/comparison/non-text-first/templated.pptx differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx new file mode 100644 index 000000000..5fd7cf9b6 Binary files /dev/null and b/test/pptx/comparison/one-column/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/input.native b/test/pptx/comparison/one-column/input.native new file mode 100644 index 000000000..b99740a14 --- /dev/null +++ b/test/pptx/comparison/one-column/input.native @@ -0,0 +1,21 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "A",Space,Str "paragraph",Space,Str "here"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 0.125) + ,(AlignDefault,ColWidth 0.125)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "plus"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "a",Space,Str "table"]]]])] + (TableFoot ("",[],[]) + [])] + ,Div ("",["column"],[]) + [Para [Str "Only",Space,Str "a",Space,Str "paragraph",Space,Str "here"]]]] diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx new file mode 100644 index 000000000..d5df2b751 Binary files /dev/null and b/test/pptx/comparison/one-column/moved-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx new file mode 100644 index 000000000..6914162ff Binary files /dev/null and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx new file mode 100644 index 000000000..a30a24453 Binary files /dev/null and b/test/pptx/comparison/one-column/templated.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx new file mode 100644 index 000000000..b5afcc021 Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/input.native b/test/pptx/content-with-caption/heading-text-image/input.native new file mode 100644 index 000000000..576bc1658 --- /dev/null +++ b/test/pptx/content-with-caption/heading-text-image/input.native @@ -0,0 +1,3 @@ +[Header 1 ("a-slide",[],[]) [Str "A",Space,Str "slide"] +,Para [Str "Some",Space,Str "text",Space,Str "here"] +,Para [Image ("",[],[]) [Str "Followed",Space,Str "by",Space,Str "a",Space,Str "picture"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx new file mode 100644 index 000000000..05806a767 Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx new file mode 100644 index 000000000..b3e89757b Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx new file mode 100644 index 000000000..3b0fe64c3 Binary files /dev/null and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx new file mode 100644 index 000000000..e9e0551ac Binary files /dev/null and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/input.native b/test/pptx/content-with-caption/image-text/input.native new file mode 100644 index 000000000..2ffbf0888 --- /dev/null +++ b/test/pptx/content-with-caption/image-text/input.native @@ -0,0 +1,2 @@ +[Para [Image ("",[],[]) [Str "The",Space,Str "picture",Space,Str "first"] ("lalune.jpg","fig:")] +,Para [Str "Then",Space,Str "some",Space,Str "text",Space,Str "here"]] diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx new file mode 100644 index 000000000..77d706ed3 Binary files /dev/null and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx new file mode 100644 index 000000000..94a2e8b88 Binary files /dev/null and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx new file mode 100644 index 000000000..bef1921a7 Binary files /dev/null and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx new file mode 100644 index 000000000..68d3d7b9b Binary files /dev/null and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/input.native b/test/pptx/content-with-caption/text-image/input.native new file mode 100644 index 000000000..762d18426 --- /dev/null +++ b/test/pptx/content-with-caption/text-image/input.native @@ -0,0 +1,2 @@ +[Para [Str "Some",Space,Str "text",Space,Str "here"] +,Para [Image ("",[],[]) [Str "Followed",Space,Str "by",Space,Str "a",Space,Str "picture"] ("lalune.jpg","fig:")]] diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx new file mode 100644 index 000000000..feade1096 Binary files /dev/null and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx new file mode 100644 index 000000000..efa814d65 Binary files /dev/null and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx new file mode 100644 index 000000000..ebd552252 Binary files /dev/null and b/test/pptx/content-with-caption/text-image/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx index e4cf6bd7b..a866f3c1f 100644 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx index a00c8059d..1f52481f3 100644 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes-toc/deleted-layouts.pptx b/test/pptx/endnotes-toc/deleted-layouts.pptx index 46708544c..60110a64e 100644 Binary files a/test/pptx/endnotes-toc/deleted-layouts.pptx and b/test/pptx/endnotes-toc/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes/deleted-layouts.pptx b/test/pptx/endnotes/deleted-layouts.pptx index 5c69a6310..0b0bd2f53 100644 Binary files a/test/pptx/endnotes/deleted-layouts.pptx and b/test/pptx/endnotes/deleted-layouts.pptx differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx index 053928863..2f8754e90 100644 Binary files a/test/pptx/images/deleted-layouts.pptx and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/inline-formatting/deleted-layouts.pptx b/test/pptx/inline-formatting/deleted-layouts.pptx index bbd5bfeb4..2fbe21a45 100644 Binary files a/test/pptx/inline-formatting/deleted-layouts.pptx and b/test/pptx/inline-formatting/deleted-layouts.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx index 6512e44bb..e527d3c5f 100644 Binary files a/test/pptx/lists/deleted-layouts.pptx and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/raw-ooxml/deleted-layouts.pptx b/test/pptx/raw-ooxml/deleted-layouts.pptx index 2ea155657..2da1b7a63 100644 Binary files a/test/pptx/raw-ooxml/deleted-layouts.pptx and b/test/pptx/raw-ooxml/deleted-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/deleted-layouts.pptx b/test/pptx/remove-empty-slides/deleted-layouts.pptx index 7ae4a5fab..51981b241 100644 Binary files a/test/pptx/remove-empty-slides/deleted-layouts.pptx and b/test/pptx/remove-empty-slides/deleted-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/moved-layouts.pptx b/test/pptx/remove-empty-slides/moved-layouts.pptx index 2572f2447..ddca32a52 100644 Binary files a/test/pptx/remove-empty-slides/moved-layouts.pptx and b/test/pptx/remove-empty-slides/moved-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/output.pptx b/test/pptx/remove-empty-slides/output.pptx index c6df8e18e..9e8b5eed2 100644 Binary files a/test/pptx/remove-empty-slides/output.pptx and b/test/pptx/remove-empty-slides/output.pptx differ diff --git a/test/pptx/remove-empty-slides/templated.pptx b/test/pptx/remove-empty-slides/templated.pptx index 1df48c5ad..579467452 100644 Binary files a/test/pptx/remove-empty-slides/templated.pptx and b/test/pptx/remove-empty-slides/templated.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx index 2c7fd4d8b..2c891cd1d 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx index 1e0b76d46..b63994cce 100644 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx index 86dfad3b2..fbf4054be 100644 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx index 5e776e05c..217b000b6 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx index 35204de1b..d8a6c90fe 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx index 197a6833f..512b324bf 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx index 5c659952e..5ab88e94c 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx index 16c61d1be..5be799e3b 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx index 0eb7c0b08..127dcea01 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx index afc096ce6..5be799e3b 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 1298870e2..33304ae3e 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 853b918cb..00f05fae5 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index 9fec1c279..139af783b 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index 6a5ad524f..c63125d8a 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx index d9cf91804..68b4215df 100644 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx index a52222551..d533d3c28 100644 Binary files a/test/pptx/tables/deleted-layouts.pptx and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/deleted-layouts.pptx b/test/pptx/two-column/deleted-layouts.pptx index 60a244f94..9622ed2cd 100644 Binary files a/test/pptx/two-column/deleted-layouts.pptx and b/test/pptx/two-column/deleted-layouts.pptx differ -- cgit v1.2.3 From e5d0b702c7d8b11f8ed4ecf10afa320103473dd0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 3 Sep 2021 19:52:52 -0700 Subject: RTF reader: Ignore `\pgdsc` group. Otherwise we get style names treated as test. --- src/Text/Pandoc/Readers/RTF.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Text/Pandoc/Readers/RTF.hs b/src/Text/Pandoc/Readers/RTF.hs index 0e7fbac5a..5e5799b49 100644 --- a/src/Text/Pandoc/Readers/RTF.hs +++ b/src/Text/Pandoc/Readers/RTF.hs @@ -411,6 +411,7 @@ processTok bs (Tok pos tok') = do -- eject any previous list items...sometimes TextEdit -- doesn't put in a \par emitBlocks bs + Grouped (Tok _ (ControlWord "pgdsc" _) : _) -> pure bs Grouped (Tok _ (ControlWord "colortbl" _) : _) -> pure bs Grouped (Tok _ (ControlWord "listtable" _) : toks) -> bs <$ inGroup (handleListTable toks) -- cgit v1.2.3 From 10c471907693aac3e01e9550ce203834ff367de1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 3 Sep 2021 21:50:30 -0700 Subject: RTF reader: if doc begins with {\rtf1 ... } only parse its contents. Some documents seem to have non-RTF (e.g. XML) material after the `{\rtf1 ... }` group. --- src/Text/Pandoc/Readers/RTF.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/RTF.hs b/src/Text/Pandoc/Readers/RTF.hs index 5e5799b49..e577ee70b 100644 --- a/src/Text/Pandoc/Readers/RTF.hs +++ b/src/Text/Pandoc/Readers/RTF.hs @@ -204,7 +204,13 @@ parseRTF = do skipMany nl toks <- many tok -- return $! traceShowId toks - bs <- (foldM processTok mempty toks >>= emitBlocks) + bs <- (case toks of + -- if we start with {\rtf1...}, parse that and ignore + -- what follows (which in certain cases can be non-RTF content) + tok@(Tok _ (Grouped (Tok _ (ControlWord "rtf" (Just 1)) : _))) : _ + -> foldM processTok mempty [tok] + _ -> foldM processTok mempty toks) + >>= emitBlocks unclosed <- closeContainers let doc = B.doc $ bs <> unclosed kvs <- sMetadata <$> getState -- cgit v1.2.3 From 531eb2a92a6c1f54acc01d5867e819f172060e22 Mon Sep 17 00:00:00 2001 From: Quinn <78063175+quinn-dev@users.noreply.github.com> Date: Fri, 3 Sep 2021 14:17:23 +0000 Subject: Add missing type for Image title --- doc/lua-filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 52e54cb5b..61c26dc2c 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -1216,7 +1216,7 @@ Fields: : path to the image file (string) `title` -: brief image description +: brief image description (string) `identifier` : alias for `attr.identifier` (string) -- cgit v1.2.3 From db03e75e279696c29e7b749c79add60b9083d571 Mon Sep 17 00:00:00 2001 From: Quinn <78063175+quinn-dev@users.noreply.github.com> Date: Fri, 3 Sep 2021 14:24:03 +0000 Subject: Improve order of Image fields Ensure consistency throughout docs --- doc/lua-filters.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 61c26dc2c..11059bd7a 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -1206,9 +1206,6 @@ Values of this type can be created with the Fields: -`attr` -: attributes ([Attr]) - `caption` : text used to describe the image ([List] of [Inlines]) @@ -1218,6 +1215,9 @@ Fields: `title` : brief image description (string) +`attr` +: attributes ([Attr]) + `identifier` : alias for `attr.identifier` (string) -- cgit v1.2.3 From 481ff8ac44cff104494b89589326b6cb78565cbf Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 4 Sep 2021 09:59:48 -0700 Subject: Extensions: put Ext_short_subsuperscripts in alphabetical order. --- src/Text/Pandoc/Extensions.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index 2ef8f64e9..f11e67723 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -124,7 +124,6 @@ data Extension = | Ext_mmd_header_identifiers -- ^ Multimarkdown style header identifiers [myid] | Ext_mmd_link_attributes -- ^ MMD style reference link attributes | Ext_mmd_title_block -- ^ Multimarkdown metadata block - | Ext_short_subsuperscripts -- ^ sub-&superscripts w/o closing char (v~i) | Ext_multiline_tables -- ^ Pandoc-style multiline tables | Ext_native_divs -- ^ Use Div blocks for contents of
    tags | Ext_native_spans -- ^ Use Span inlines for contents of @@ -139,6 +138,7 @@ data Extension = | Ext_raw_markdown -- ^ Parse markdown in ipynb as raw markdown | Ext_rebase_relative_paths -- ^ Rebase relative image and link paths, -- relative to directory of containing file + | Ext_short_subsuperscripts -- ^ sub-&superscripts w/o closing char (v~i) | Ext_shortcut_reference_links -- ^ Shortcut reference links | Ext_simple_tables -- ^ Pandoc-style simple tables | Ext_smart -- ^ "Smart" quotes, apostrophes, ellipses, dashes -- cgit v1.2.3 From aaef51707c1b7612232d1d97276862ec473bb686 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 4 Sep 2021 10:02:08 -0700 Subject: Minor renaming to avoid shadowing. --- src/Text/Pandoc/Readers/RTF.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/RTF.hs b/src/Text/Pandoc/Readers/RTF.hs index e577ee70b..26a132758 100644 --- a/src/Text/Pandoc/Readers/RTF.hs +++ b/src/Text/Pandoc/Readers/RTF.hs @@ -207,8 +207,8 @@ parseRTF = do bs <- (case toks of -- if we start with {\rtf1...}, parse that and ignore -- what follows (which in certain cases can be non-RTF content) - tok@(Tok _ (Grouped (Tok _ (ControlWord "rtf" (Just 1)) : _))) : _ - -> foldM processTok mempty [tok] + rtftok@(Tok _ (Grouped (Tok _ (ControlWord "rtf" (Just 1)) : _))) : _ + -> foldM processTok mempty [rtftok] _ -> foldM processTok mempty toks) >>= emitBlocks unclosed <- closeContainers -- cgit v1.2.3 From b185560a8ec1fd8a0b578de4d94ea72a3d3e2943 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 4 Sep 2021 10:02:38 -0700 Subject: RTF reader: better handling of `\*` and bookmarks. We now ensure that groups starting with `\*` never cause text to be added to the document. In addition, bookmarks now create a span between the start and end of the bookmark, rather than an empty span. --- src/Text/Pandoc/Readers/RTF.hs | 16 ++++++++-------- test/rtf/bookmark.native | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Text/Pandoc/Readers/RTF.hs b/src/Text/Pandoc/Readers/RTF.hs index 26a132758..4eeab1312 100644 --- a/src/Text/Pandoc/Readers/RTF.hs +++ b/src/Text/Pandoc/Readers/RTF.hs @@ -395,15 +395,15 @@ isUnderline _ = False processTok :: PandocMonad m => Blocks -> Tok -> RTFParser m Blocks processTok bs (Tok pos tok') = do setPosition pos - -- ignore \* at beginning of group: - let tok'' = case tok' of - Grouped (Tok _ (ControlSymbol '*') : toks) -> Grouped toks - _ -> tok' - case tok'' of + case tok' of HexVal{} -> return () UnformattedText{} -> return () _ -> updateState $ \s -> s{ sEatChars = 0 } - case tok'' of + case tok' of + Grouped (Tok _ (ControlSymbol '*') : toks) -> + bs <$ (do oldTextContent <- sTextContent <$> getState + processTok mempty (Tok pos (Grouped toks)) + updateState $ \st -> st{ sTextContent = oldTextContent }) Grouped (Tok _ (ControlWord "fonttbl" _) : toks) -> inGroup $ do updateState $ \s -> s{ sFontTable = processFontTable toks } pure bs @@ -440,10 +440,10 @@ processTok bs (Tok pos tok') = do -- TODO ideally we'd put the span around bkmkstart/end, but this -- is good for now: modifyGroup (\g -> g{ gAnchor = Just $ T.strip t }) - addText "" + pure bs + Grouped (Tok _ (ControlWord "bkmkend" _) : _) -> do modifyGroup (\g -> g{ gAnchor = Nothing }) pure bs - Grouped (Tok _ (ControlWord "bkmkend" _) : _) -> pure bs -- TODO Grouped (Tok _ (ControlWord f _) : _) | isHeaderFooter f -> pure bs Grouped (Tok _ (ControlWord "footnote" _) : toks) -> do noteBs <- inGroup $ processDestinationToks toks diff --git a/test/rtf/bookmark.native b/test/rtf/bookmark.native index bc5b67afc..f142f1c5c 100644 --- a/test/rtf/bookmark.native +++ b/test/rtf/bookmark.native @@ -1,3 +1,3 @@ Pandoc (Meta {unMeta = fromList []}) -[Para [Span ("bookmark_1",[],[]) [],Str "Bookmark_1"] +[Para [Span ("bookmark_1",[],[]) [Str "Bookmark_1"]] ,Para [Link ("",[],[]) [Str "click",Space,Str "me"] ("#bookmark_1","")]] -- cgit v1.2.3 From 2b427331d9906ee52e4c818375614f1931028de7 Mon Sep 17 00:00:00 2001 From: Quinn <78063175+quinn-dev@users.noreply.github.com> Date: Sun, 5 Sep 2021 05:47:01 +0000 Subject: Rephrase pandoc.path docs (#7548) --- doc/lua-filters.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 11059bd7a..e7cdd256d 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3442,7 +3442,7 @@ filepath Returns: -- `true` iff `filepath` is an absolute path, `false` otherwise. +- `true` if `filepath` is an absolute path, `false` otherwise. (boolean) ### is_relative (filepath) {#pandoc.path.is_relative} @@ -3456,7 +3456,7 @@ filepath Returns: -- `true` iff `filepath` is a relative path, `false` otherwise. +- `true` if `filepath` is a relative path, `false` otherwise. (boolean) ### join (filepaths) {#pandoc.path.join} -- cgit v1.2.3 From d87c44ed3a63e6536adb02b9663ad2a63dfbd58a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Sep 2021 09:01:02 -0700 Subject: Makefile: disable ansi tricks for tasty; use v2- instead of new-. --- Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 6ae6ab491..47acb80dd 100644 --- a/Makefile +++ b/Makefile @@ -22,20 +22,20 @@ REVISION?=1 BENCHARGS?=--csv bench_$(TIMESTAMP).csv $(BASELINECMD) --timeout=6 +RTS -T -RTS $(if $(PATTERN),--pattern "$(PATTERN)",) quick: - stack install --ghc-options='$(GHCOPTS)' --install-ghc --flag 'pandoc:embed_data_files' --fast --test --ghc-options='$(GHCOPTS)' --test-arguments='-j4 --hide-successes $(TESTARGS)' + stack install --ghc-options='$(GHCOPTS)' --install-ghc --flag 'pandoc:embed_data_files' --fast --test --ghc-options='$(GHCOPTS)' --test-arguments='-j4 --hide-successes --ansi-tricks=false $(TESTARGS)' quick-cabal: - cabal new-configure . --ghc-options '$(GHCOPTS)' --disable-optimization --enable-tests - cabal new-build -j4 . --disable-optimization - cabal new-run test-pandoc --disable-optimization -- --hide-successes $(TESTARGS) + cabal v2-configure . --ghc-options '$(GHCOPTS)' --disable-optimization --enable-tests + cabal v2-build -j4 . --disable-optimization + cabal v2-run test-pandoc --disable-optimization -- --hide-successes --ansi-tricks=false $(TESTARGS) full-cabal: - cabal new-configure . --ghc-options '$(GHCOPTS)' --flags '+embed_data_files +trypandoc' --enable-tests --enable-benchmarks - cabal new-build . --disable-optimization - cabal new-run test-pandoc --disable-optimization -- --hide-successes $(TESTARGS) + cabal v2-configure . --ghc-options '$(GHCOPTS)' --flags '+embed_data_files +trypandoc' --enable-tests --enable-benchmarks + cabal v2-build . --disable-optimization + cabal v2-run test-pandoc --disable-optimization -- --hide-successes --ansi-tricks=false $(TESTARGS) full: - stack install --flag 'pandoc:embed_data_files' --flag 'pandoc:trypandoc' --bench --no-run-benchmarks --test --test-arguments='-j4 --hide-successes' --ghc-options '-Wall -Werror -fno-warn-unused-do-bind -O0 $(GHCOPTS)' + stack install --flag 'pandoc:embed_data_files' --flag 'pandoc:trypandoc' --bench --no-run-benchmarks --test --test-arguments='-j4 --hide-successes--ansi-tricks-false' --ghc-options '-Wall -Werror -fno-warn-unused-do-bind -O0 $(GHCOPTS)' ghci: stack ghci --flag 'pandoc:embed_data_files' @@ -46,7 +46,7 @@ haddock: # Note: to accept current results of golden tests, # make test TESTARGS='--accept' test: - stack test --flag 'pandoc:embed_data_files' --fast --test-arguments='-j4 --hide-successes $(TESTARGS)' --ghc-options '$(GHCOPTS)' + stack test --flag 'pandoc:embed_data_files' --fast --test-arguments='-j4 --hide-successes --ansi-tricks=false $(TESTARGS)' --ghc-options '$(GHCOPTS)' ghcid: ghcid -c "stack repl --flag 'pandoc:embed_data_files'" -- cgit v1.2.3 From 395d65fdbe398e42270acfe6a76ad98a00ecb35d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Sep 2021 09:01:25 -0700 Subject: CI: disable ansi-tricks in tasty. This will prevent the test output from being overwhelmed with headings from passing tests. --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b8a72efa..c75fcd213 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,22 +62,22 @@ jobs: cabal: '3.2' prefix: '' cabalopts: '' - testopts: '--test-option=--hide-successes' + testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false' - ghc: '8.8.4' cabal: '3.2' prefix: '' cabalopts: '' - testopts: '--test-option=--hide-successes' + testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false' - ghc: '8.10.4' cabal: '3.2' prefix: '' cabalopts: '-ftrypandoc' - testopts: '--test-option=--hide-successes' + testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false' - ghc: '9.0.1' cabal: '3.4' prefix: '' cabalopts: '' - testopts: '--test-option=--hide-successes' + testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false' steps: - uses: actions/checkout@v2 @@ -166,7 +166,7 @@ jobs: - name: Build and test shell: cmd run: | - stack test --fast --test-arguments=--hide-successes + stack test --fast --test-arguments="--hide-successes --ansi-tricks=false" macos: @@ -216,7 +216,7 @@ jobs: cabal v2-build --enable-tests --disable-optimization 2>&1 | tee build.log # fail if warnings in local build ! grep -q ": *[Ww]arning:" build.log || exit 1 - cabal v2-test --disable-optimization + cabal v2-test --disable-optimization --test-option=--hide-successes --test-option=--ansi-tricks=false benchmark: -- cgit v1.2.3 From dee30e2a1b455650dbbbec3bfab3dda43582a5fe Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Sep 2021 09:29:46 -0700 Subject: Logging: add NotUTF8Encoded constructor to LogMessage. [API change] --- src/Text/Pandoc/Logging.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs index c49726040..bb2fb5d36 100644 --- a/src/Text/Pandoc/Logging.hs +++ b/src/Text/Pandoc/Logging.hs @@ -105,6 +105,7 @@ data LogMessage = | ATXHeadingInLHS Int Text | EnvironmentVariableUndefined Text | DuplicateAttribute Text Text + | NotUTF8Encoded FilePath deriving (Show, Eq, Data, Ord, Typeable, Generic) instance ToJSON LogMessage where @@ -244,6 +245,8 @@ instance ToJSON LogMessage where DuplicateAttribute attr val -> ["attribute" .= attr ,"value" .= val] + NotUTF8Encoded src -> + ["source" .= src] showPos :: SourcePos -> Text showPos pos = Text.pack $ sn ++ "line " ++ @@ -370,6 +373,9 @@ showLogMessage msg = "Undefined environment variable " <> var <> " in defaults file." DuplicateAttribute attr val -> "Ignoring duplicate attribute " <> attr <> "=" <> tshow val <> "." + NotUTF8Encoded src -> + Text.pack src <> + " is not UTF-8 encoded: falling back to latin1." messageVerbosity :: LogMessage -> Verbosity messageVerbosity msg = @@ -420,3 +426,4 @@ messageVerbosity msg = ATXHeadingInLHS{} -> WARNING EnvironmentVariableUndefined{}-> WARNING DuplicateAttribute{} -> WARNING + NotUTF8Encoded{} -> WARNING -- cgit v1.2.3 From ddfa7b2a630bd123c7b6291769c6ae1fe347aff4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Sep 2021 09:30:16 -0700 Subject: App: Issue NotUTF8Encoded warning when falling back to latin1. --- src/Text/Pandoc/App.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index f7c1f218d..b639a97b7 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -426,8 +426,12 @@ inputToText convTabs (fp, (bs,mt)) = Nothing -> catchError (utf8ToText fp bs) (\case - PandocUTF8DecodingError{} -> - return $ T.pack $ B8.unpack bs + PandocUTF8DecodingError{} -> do + report $ NotUTF8Encoded + (if null fp + then "input" + else fp) + return $ T.pack $ B8.unpack bs e -> throwError e) inputToLazyByteString :: (FilePath, (BS.ByteString, Maybe MimeType)) -- cgit v1.2.3 From 0b1c5a87da1117a4dc4a04e308c9edbdc0ea1ec6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Sep 2021 09:30:58 -0700 Subject: RTF reader: support `\binN` for binary image data. --- src/Text/Pandoc/Readers/RTF.hs | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/Text/Pandoc/Readers/RTF.hs b/src/Text/Pandoc/Readers/RTF.hs index 4eeab1312..72d1f51d2 100644 --- a/src/Text/Pandoc/Readers/RTF.hs +++ b/src/Text/Pandoc/Readers/RTF.hs @@ -31,7 +31,7 @@ import Text.Pandoc.Definition import Text.Pandoc.Options import Text.Pandoc.Parsing import Text.Pandoc.Shared (safeRead, tshow) -import Data.Char (isAlphaNum, chr, digitToInt, isAscii, isLetter, isSpace) +import Data.Char (isAlphaNum, chr, digitToInt, isAscii, isLetter, isSpace, ord) import qualified Data.ByteString.Lazy as BL import Data.Digest.Pure.SHA (sha1, showDigest) import Data.Maybe (mapMaybe, fromMaybe) @@ -223,6 +223,7 @@ data TokContents = ControlWord Text (Maybe Int) | ControlSymbol Char | UnformattedText Text + | BinData BL.ByteString | HexVal Word8 | Grouped [Tok] deriving (Show, Eq) @@ -234,9 +235,22 @@ tok = do where controlThing = do char '\\' *> - ( (ControlWord <$> letterSequence <*> (parameter <* optional delimChar)) + ( binData + <|> (ControlWord <$> letterSequence <*> (parameter <* optional delimChar)) <|> (HexVal <$> hexVal) <|> (ControlSymbol <$> anyChar) ) + binData = try $ do + string "bin" <* notFollowedBy letter + n <- fromMaybe 0 <$> parameter + spaces + -- NOTE: We assume here that if the document contains binary + -- data, it will not be valid UTF-8 and hence it will have been + -- read as latin1, so we can recover the data in the following + -- way. This is probably not completely reliable, but I don't + -- know if we can do better without making this reader take + -- a ByteString input. + dat <- BL.pack . map (fromIntegral . ord) <$> count n anyChar + return $ BinData dat parameter = do hyph <- string "-" <|> pure "" rest <- many digit @@ -860,14 +874,10 @@ handlePict :: PandocMonad m => [Tok] -> RTFParser m () handlePict toks = do let pict = foldl' getPictData def toks let altText = "image" - let binToWord = T.foldl' (\acc x -> acc * 2 + fromIntegral (digitToInt x)) 0 - let isBinaryDigit '0' = True - isBinaryDigit '1' = True - isBinaryDigit _ = False - let bytes = BL.pack $ - if picBinary pict && T.all isBinaryDigit (picData pict) - then map binToWord $ T.chunksOf 8 $ picData pict - else map hexToWord $ T.chunksOf 2 $ picData pict + let bytes = + if picBinary pict + then picBytes pict + else BL.pack $ map hexToWord $ T.chunksOf 2 $ picData pict let (mimetype, ext) = case picType pict of Just Emfblip -> (Just "image/x-emf", ".emf") @@ -894,7 +904,8 @@ handlePict toks = do ControlWord "pich" (Just h) -> pict{ picHeight = Just h } ControlWord "picwgoal" (Just w) -> pict{ picWidthGoal = Just w } ControlWord "pichgoal" (Just h) -> pict{ picHeightGoal = Just h } - ControlWord "bin" _ -> pict{ picBinary = True } + BinData d | not (BL.null d) + -> pict{ picBinary = True, picBytes = picBytes pict <> d } UnformattedText t -> pict{ picData = t } _ -> pict -- cgit v1.2.3 From 37e30560ad546055d17f56df468cd35976b3218a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 9 Sep 2021 23:27:58 -0700 Subject: Use dev version of citeproc. --- cabal.project | 5 +++++ stack.yaml | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index 26373c616..55026979e 100644 --- a/cabal.project +++ b/cabal.project @@ -2,3 +2,8 @@ packages: pandoc.cabal tests: True flags: +embed_data_files +source-repository-package + type: git + location: https://github.com/jgm/citeproc.git + tag: 59e98e8d1e13ddb53bef9f90adbd1c64652f0173 + diff --git a/stack.yaml b/stack.yaml index a8df254d7..9b73f2bd1 100644 --- a/stack.yaml +++ b/stack.yaml @@ -13,7 +13,8 @@ extra-deps: - skylighting-0.11 - doctemplates-0.10 - texmath-0.12.3.1 -- citeproc-0.5 +- git: https://github.com/jgm/citeproc.git + commit: 59e98e8d1e13ddb53bef9f90adbd1c64652f0173 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.0 -- cgit v1.2.3 From 1481dae629b97c5b7ad28cd162e22a52c7647784 Mon Sep 17 00:00:00 2001 From: Kolen Cheung Date: Fri, 10 Sep 2021 09:26:55 -0700 Subject: Ipynb reader handleData: support text/markdown (#7561) `text/markdown` is now a supported mime type for raw output. --- src/Text/Pandoc/Readers/Ipynb.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Text/Pandoc/Readers/Ipynb.hs b/src/Text/Pandoc/Readers/Ipynb.hs index cd1093109..9d46111c3 100644 --- a/src/Text/Pandoc/Readers/Ipynb.hs +++ b/src/Text/Pandoc/Readers/Ipynb.hs @@ -192,6 +192,9 @@ handleData metadata (MimeBundle mb) = dataBlock ("text/latex", TextualData t) = return $ B.rawBlock "latex" t + dataBlock ("text/markdown", TextualData t) + = return $ B.rawBlock "markdown" t + dataBlock ("text/plain", TextualData t) = return $ B.codeBlock t -- cgit v1.2.3 From 99a4d1d0b06bb68e4d7a10acd642d439842004d1 Mon Sep 17 00:00:00 2001 From: Francesco Mazzoli Date: Fri, 10 Sep 2021 18:30:05 +0200 Subject: Support `--reference-location` for HTML output (#7461) The HTML writer now supports `EndOfBlock`, `EndOfSection`, and `EndOfDocument` for reference locations. EPUB and HTML slide show formats are also affected by this change. This works similarly to the markdown writer, but with special care taken to skipping section divs with what regards to the block level. The change also takes care to not modify the output if `EndOfDocument` is used. --- MANUAL.txt | 2 +- man/pandoc.1 | 2 +- src/Text/Pandoc/Writers/HTML.hs | 121 +++++++++++++++++++++++++++++----------- test/Tests/Writers/HTML.hs | 75 ++++++++++++++++++++++++- test/command/4235.md | 2 +- test/command/7006.md | 2 +- test/writer.html4 | 2 +- test/writer.html5 | 2 +- 8 files changed, 169 insertions(+), 39 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index afdd66ddd..57b9f3b2c 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -972,7 +972,7 @@ header when requesting a document from a URL: : Specify whether footnotes (and references, if `reference-links` is set) are placed at the end of the current (top-level) block, the current section, or the document. The default is - `document`. Currently only affects the markdown writer. + `document`. Currently only affects the markdown and HTML writers. `--markdown-headings=setext`|`atx` diff --git a/man/pandoc.1 b/man/pandoc.1 index a0092b385..e901f60b3 100644 --- a/man/pandoc.1 +++ b/man/pandoc.1 @@ -995,7 +995,7 @@ Specify whether footnotes (and references, if \f[C]reference-links\f[R] is set) are placed at the end of the current (top-level) block, the current section, or the document. The default is \f[C]document\f[R]. -Currently only affects the markdown writer. +Currently only affects the markdown and HTML writers. .TP \f[B]\f[CB]--markdown-headings=setext\f[B]\f[R]|\f[B]\f[CB]atx\f[B]\f[R] Specify whether to use ATX-style (\f[C]#\f[R]-prefixed) or Setext-style diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 89fc110ef..c96d4622a 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -74,9 +74,11 @@ import Text.TeXMath import Text.XML.Light (elChildren, unode, unqual) import qualified Text.XML.Light as XML import Text.XML.Light.Output +import Data.String (fromString) data WriterState = WriterState { stNotes :: [Html] -- ^ List of notes + , stEmittedNotes :: Int -- ^ How many notes we've already pushed out to the HTML , stMath :: Bool -- ^ Math is used in document , stQuotes :: Bool -- ^ tag is used , stHighlighting :: Bool -- ^ Syntax highlighting is used @@ -88,10 +90,11 @@ data WriterState = WriterState , stCodeBlockNum :: Int -- ^ Number of code block , stCsl :: Bool -- ^ Has CSL references , stCslEntrySpacing :: Maybe Int -- ^ CSL entry spacing + , stBlockLevel :: Int -- ^ Current block depth, excluding section divs } defaultWriterState :: WriterState -defaultWriterState = WriterState {stNotes= [], stMath = False, stQuotes = False, +defaultWriterState = WriterState {stNotes= [], stEmittedNotes = 0, stMath = False, stQuotes = False, stHighlighting = False, stHtml5 = False, stEPUBVersion = Nothing, @@ -100,7 +103,8 @@ defaultWriterState = WriterState {stNotes= [], stMath = False, stQuotes = False, stInSection = False, stCodeBlockNum = 0, stCsl = False, - stCslEntrySpacing = Nothing} + stCslEntrySpacing = Nothing, + stBlockLevel = 0} -- Helpers to render HTML with the appropriate function. @@ -266,8 +270,16 @@ pandocToHtml opts (Pandoc meta blocks) = do then fmap renderHtml' <$> tableOfContents opts sects else return Nothing blocks' <- blockListToHtml opts sects + notes <- do + -- make the st private just to be safe, since we modify it right afterwards + st <- get + if null (stNotes st) + then return mempty + else do + notes <- footnoteSection opts EndOfDocument (stEmittedNotes st + 1) (reverse (stNotes st)) + modify (\st' -> st'{ stNotes = mempty, stEmittedNotes = stEmittedNotes st' + length (stNotes st') }) + return notes st <- get - notes <- footnoteSection opts (reverse (stNotes st)) let thebody = blocks' >> notes let math = case writerHTMLMathMethod opts of MathJax url @@ -490,28 +502,43 @@ tableOfContents opts sects = do -- | Convert list of Note blocks to a footnote
    . -- Assumes notes are sorted. -footnoteSection :: PandocMonad m - => WriterOptions -> [Html] -> StateT WriterState m Html -footnoteSection opts notes = do +footnoteSection :: + PandocMonad m => WriterOptions -> ReferenceLocation -> Int -> [Html] -> StateT WriterState m Html +footnoteSection opts refLocation startCounter notes = do html5 <- gets stHtml5 slideVariant <- gets stSlideVariant - let hrtag = if html5 then H5.hr else H.hr + let hrtag = if refLocation /= EndOfBlock then (if html5 then H5.hr else H.hr) else mempty + let additionalClassName = case refLocation of + EndOfBlock -> "footnotes-end-of-block" + EndOfDocument -> "footnotes-end-of-document" + EndOfSection -> "footnotes-end-of-section" + let className = "footnotes " <> additionalClassName epubVersion <- gets stEPUBVersion let container x | html5 , epubVersion == Just EPUB3 - = H5.section ! A.class_ "footnotes" + = H5.section ! A.class_ className ! customAttribute "epub:type" "footnotes" $ x - | html5 = H5.section ! A.class_ "footnotes" + | html5 = H5.section ! A.class_ className ! customAttribute "role" "doc-endnotes" $ x | slideVariant /= NoSlides = H.div ! A.class_ "footnotes slide" $ x - | otherwise = H.div ! A.class_ "footnotes" $ x + | otherwise = H.div ! A.class_ className $ x return $ if null notes then mempty - else nl opts >> container (nl opts >> hrtag >> nl opts >> - H.ol (mconcat notes >> nl opts) >> nl opts) + else do + nl opts + container $ do + nl opts + hrtag + nl opts + -- Keep the previous output exactly the same if we don't + -- have multiple notes sections + if startCounter == 1 + then H.ol $ mconcat notes >> nl opts + else H.ol ! A.start (fromString (show startCounter)) $ mconcat notes >> nl opts + nl opts -- | Parse a mailto link; return Just (name, domain) or Nothing. parseMailto :: Text -> Maybe (Text, Text) @@ -702,11 +729,10 @@ adjustNumbers opts doc = fixnum x = x showSecNum = T.intercalate "." . map tshow --- | Convert Pandoc block element to HTML. -blockToHtml :: PandocMonad m => WriterOptions -> Block -> StateT WriterState m Html -blockToHtml _ Null = return mempty -blockToHtml opts (Plain lst) = inlineListToHtml opts lst -blockToHtml opts (Para [Image attr@(_,classes,_) txt (src,tit)]) +blockToHtmlInner :: PandocMonad m => WriterOptions -> Block -> StateT WriterState m Html +blockToHtmlInner _ Null = return mempty +blockToHtmlInner opts (Plain lst) = inlineListToHtml opts lst +blockToHtmlInner opts (Para [Image attr@(_,classes,_) txt (src,tit)]) | "stretch" `elem` classes = do slideVariant <- gets stSlideVariant case slideVariant of @@ -716,20 +742,20 @@ blockToHtml opts (Para [Image attr@(_,classes,_) txt (src,tit)]) inlineToHtml opts (Image attr txt (src, tit)) _ -> figure opts attr txt (src, tit) -- title beginning with fig: indicates that the image is a figure -blockToHtml opts (Para [Image attr txt (s,T.stripPrefix "fig:" -> Just tit)]) = +blockToHtmlInner opts (Para [Image attr txt (s,T.stripPrefix "fig:" -> Just tit)]) = figure opts attr txt (s,tit) -blockToHtml opts (Para lst) = do +blockToHtmlInner opts (Para lst) = do contents <- inlineListToHtml opts lst case contents of Empty _ | not (isEnabled Ext_empty_paragraphs opts) -> return mempty _ -> return $ H.p contents -blockToHtml opts (LineBlock lns) = +blockToHtmlInner opts (LineBlock lns) = if writerWrapText opts == WrapNone then blockToHtml opts $ linesToPara lns else do htmlLines <- inlineListToHtml opts $ intercalate [LineBreak] lns return $ H.div ! A.class_ "line-block" $ htmlLines -blockToHtml opts (Div (ident, "section":dclasses, dkvs) +blockToHtmlInner opts (Div (ident, "section":dclasses, dkvs) (Header level hattr@(hident,hclasses,hkvs) ils : xs)) = do slideVariant <- gets stSlideVariant @@ -810,7 +836,7 @@ blockToHtml opts (Div (ident, "section":dclasses, dkvs) if null innerSecs then mempty else nl opts <> innerContents -blockToHtml opts (Div attr@(ident, classes, kvs') bs) = do +blockToHtmlInner opts (Div attr@(ident, classes, kvs') bs) = do html5 <- gets stHtml5 slideVariant <- gets stSlideVariant let isCslBibBody = ident == "refs" || "csl-bib-body" `elem` classes @@ -864,7 +890,7 @@ blockToHtml opts (Div attr@(ident, classes, kvs') bs) = do _ -> return mempty else addAttrs opts (ident, classes'', kvs) $ divtag contents' -blockToHtml opts (RawBlock f str) = do +blockToHtmlInner opts (RawBlock f str) = do ishtml <- isRawHtml f if ishtml then return $ preEscapedText str @@ -875,10 +901,10 @@ blockToHtml opts (RawBlock f str) = do else do report $ BlockNotRendered (RawBlock f str) return mempty -blockToHtml _ HorizontalRule = do +blockToHtmlInner _ HorizontalRule = do html5 <- gets stHtml5 return $ if html5 then H5.hr else H.hr -blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do +blockToHtmlInner opts (CodeBlock (id',classes,keyvals) rawCode) = do id'' <- if T.null id' then do modify $ \st -> st{ stCodeBlockNum = stCodeBlockNum st + 1 } @@ -910,7 +936,7 @@ blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do -- we set writerIdentifierPrefix to "" since id'' already -- includes it: addAttrs opts{writerIdentifierPrefix = ""} (id'',[],keyvals) h -blockToHtml opts (BlockQuote blocks) = do +blockToHtmlInner opts (BlockQuote blocks) = do -- in S5, treat list in blockquote specially -- if default is incremental, make it nonincremental; -- otherwise incremental @@ -932,7 +958,7 @@ blockToHtml opts (BlockQuote blocks) = do else do contents <- blockListToHtml opts blocks return $ H.blockquote $ nl opts >> contents >> nl opts -blockToHtml opts (Header level (ident,classes,kvs) lst) = do +blockToHtmlInner opts (Header level (ident,classes,kvs) lst) = do contents <- inlineListToHtml opts lst let secnum = fromMaybe mempty $ lookup "number" kvs let contents' = if writerNumberSections opts && not (T.null secnum) @@ -955,12 +981,12 @@ blockToHtml opts (Header level (ident,classes,kvs) lst) = do 5 -> H.h5 contents' 6 -> H.h6 contents' _ -> H.p ! A.class_ "heading" $ contents' -blockToHtml opts (BulletList lst) = do +blockToHtmlInner opts (BulletList lst) = do contents <- mapM (listItemToHtml opts) lst let isTaskList = not (null lst) && all isTaskListItem lst (if isTaskList then (! A.class_ "task-list") else id) <$> unordList opts contents -blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do +blockToHtmlInner opts (OrderedList (startnum, numstyle, _) lst) = do contents <- mapM (listItemToHtml opts) lst html5 <- gets stHtml5 let numstyle' = case numstyle of @@ -983,7 +1009,7 @@ blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do else []) l <- ordList opts contents return $ foldl' (!) l attribs -blockToHtml opts (DefinitionList lst) = do +blockToHtmlInner opts (DefinitionList lst) = do contents <- mapM (\(term, defs) -> do term' <- liftM H.dt $ inlineListToHtml opts term defs' <- mapM (liftM (\x -> H.dd (x >> nl opts)) . @@ -991,9 +1017,39 @@ blockToHtml opts (DefinitionList lst) = do return $ mconcat $ nl opts : term' : nl opts : intersperse (nl opts) defs') lst defList opts contents -blockToHtml opts (Table attr caption colspecs thead tbody tfoot) = +blockToHtmlInner opts (Table attr caption colspecs thead tbody tfoot) = tableToHtml opts (Ann.toTable attr caption colspecs thead tbody tfoot) +-- | Convert Pandoc block element to HTML. All the legwork is done by +-- 'blockToHtmlInner', this just takes care of emitting the notes after +-- the block if necessary. +blockToHtml :: PandocMonad m => WriterOptions -> Block -> StateT WriterState m Html +blockToHtml opts block = do + -- Ignore inserted section divs -- they are not blocks as they came from + -- the document itself (at least not when coming from markdown) + let isSection = case block of + Div (_, classes, _) _ | "section" `elem` classes -> True + _ -> False + let increaseLevel = not isSection + when increaseLevel $ + modify (\st -> st{ stBlockLevel = stBlockLevel st + 1 }) + doc <- blockToHtmlInner opts block + st <- get + let emitNotes = + (writerReferenceLocation opts == EndOfBlock && stBlockLevel st == 1) || + (writerReferenceLocation opts == EndOfSection && isSection) + res <- if emitNotes + then do + notes <- if null (stNotes st) + then return mempty + else footnoteSection opts (writerReferenceLocation opts) (stEmittedNotes st + 1) (reverse (stNotes st)) + modify (\st' -> st'{ stNotes = mempty, stEmittedNotes = stEmittedNotes st' + length (stNotes st') }) + return (doc <> notes) + else return doc + when increaseLevel $ + modify (\st' -> st'{ stBlockLevel = stBlockLevel st' - 1 }) + return res + tableToHtml :: PandocMonad m => WriterOptions -> Ann.Table @@ -1468,7 +1524,8 @@ inlineToHtml opts inline = do -- note: null title included, as in Markdown.pl (Note contents) -> do notes <- gets stNotes - let number = length notes + 1 + emittedNotes <- gets stEmittedNotes + let number = emittedNotes + length notes + 1 let ref = tshow number htmlContents <- blockListToNote opts ref contents epubVersion <- gets stEPUBVersion diff --git a/test/Tests/Writers/HTML.hs b/test/Tests/Writers/HTML.hs index 404f6da98..50775b171 100644 --- a/test/Tests/Writers/HTML.hs +++ b/test/Tests/Writers/HTML.hs @@ -8,8 +8,11 @@ import Text.Pandoc import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder +htmlWithOpts :: (ToPandoc a) => WriterOptions -> a -> String +htmlWithOpts opts = unpack . purely (writeHtml4String opts{ writerWrapText = WrapNone }) . toPandoc + html :: (ToPandoc a) => a -> String -html = unpack . purely (writeHtml4String def{ writerWrapText = WrapNone }) . toPandoc +html = htmlWithOpts def htmlQTags :: (ToPandoc a) => a -> String htmlQTags = unpack @@ -33,6 +36,21 @@ infix 4 =: => String -> (a, String) -> TestTree (=:) = test html +noteTestDoc :: Blocks +noteTestDoc = + header 1 "Page title" <> + header 2 "First section" <> + para ("This is a footnote." <> + note (para "Down here.") <> + " And this is a " <> + link "https://www.google.com" "" "link" <> + ".") <> + blockQuote (para ("A note inside a block quote." <> + note (para "The second note.")) <> + para "A second paragraph.") <> + header 2 "Second section" <> + para "Some more text." + tests :: [TestTree] tests = [ testGroup "inline code" @@ -86,6 +104,61 @@ tests = =?> ("" ++ ">>=") ] + , testGroup "footnotes" + [ test (htmlWithOpts def{writerReferenceLocation=EndOfDocument}) + "at the end of a document" $ + noteTestDoc =?> + concat + [ "

    Page title

    " + , "

    First section

    " + , "

    This is a footnote.1 And this is a link.

    " + , "

    A note inside a block quote.2

    A second paragraph.

    " + , "

    Second section

    " + , "

    Some more text.

    " + , "

    1. Down here.↩︎

    2. The second note.↩︎

    " + ] + , test (htmlWithOpts def{writerReferenceLocation=EndOfBlock}) + "at the end of a block" $ + noteTestDoc =?> + concat + [ "

    Page title

    " + , "

    First section

    " + , "

    This is a footnote.1 And this is a link.

    " + , "
    1. Down here.↩︎

    " + , "

    A note inside a block quote.2

    A second paragraph.

    " + , "
    1. The second note.↩︎

    " + , "

    Second section

    " + , "

    Some more text.

    " + ] + , test (htmlWithOpts def{writerReferenceLocation=EndOfSection}) + "at the end of a section" $ + noteTestDoc =?> + concat + [ "

    Page title

    " + , "

    First section

    " + , "

    This is a footnote.1 And this is a link.

    " + , "

    A note inside a block quote.2

    A second paragraph.

    " + , "

    1. Down here.↩︎

    2. The second note.↩︎

    " + , "

    Second section

    " + , "

    Some more text.

    " + ] + , test (htmlWithOpts def{writerReferenceLocation=EndOfSection, writerSectionDivs=True}) + "at the end of a section, with section divs" $ + noteTestDoc =?> + -- Footnotes are rendered _after_ their section (in this case after the level2 section + -- that contains it). + concat + [ "
    " + , "

    Page title

    " + , "
    " + , "

    First section

    " + , "

    This is a footnote.1 And this is a link.

    A note inside a block quote.2

    A second paragraph.

    " + , "
    " + , "

    1. Down here.↩︎

    2. The second note.↩︎

    " + , "

    Second section

    Some more text.

    " + , "
    " + ] + ] ] where tQ :: (ToString a, ToPandoc a) diff --git a/test/command/4235.md b/test/command/4235.md index 8bbf43ff9..4f2644dd6 100644 --- a/test/command/4235.md +++ b/test/command/4235.md @@ -3,7 +3,7 @@ This.^[Has a footnote.] ^D

    This.1

    -
    +

    1. Has a footnote.↩︎

    2. diff --git a/test/command/7006.md b/test/command/7006.md index e7951fb1a..7e2215cdf 100644 --- a/test/command/7006.md +++ b/test/command/7006.md @@ -7,7 +7,7 @@ Test.[^fn] ![Caption.](/image.jpg) ^D

      Test.1

      -
      +

      1. Foo:

        diff --git a/test/writer.html4 b/test/writer.html4 index 215a1efb9..257d86ddb 100644 --- a/test/writer.html4 +++ b/test/writer.html4 @@ -665,7 +665,7 @@ Blah
      2. And in list items.5

      This paragraph should not be part of the note, as it is not indented.

      -
      +

      1. Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.↩︎

      2. diff --git a/test/writer.html5 b/test/writer.html5 index 387df4058..0141bf9fe 100644 --- a/test/writer.html5 +++ b/test/writer.html5 @@ -667,7 +667,7 @@ Blah
      3. And in list items.5

      This paragraph should not be part of the note, as it is not indented.

      -
      +

      1. Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.↩︎

      2. -- cgit v1.2.3 From 12b3ee3787043f4c072c338762a5928c84ce5b5f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 10 Sep 2021 09:32:51 -0700 Subject: MANUAL: Document formats affected by `--reference-location`. --- MANUAL.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MANUAL.txt b/MANUAL.txt index 57b9f3b2c..f0d3c8965 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -972,7 +972,9 @@ header when requesting a document from a URL: : Specify whether footnotes (and references, if `reference-links` is set) are placed at the end of the current (top-level) block, the current section, or the document. The default is - `document`. Currently only affects the markdown and HTML writers. + `document`. Currently this option only affects the + `markdown`, `muse`, `html`, `epub`, `slidy`, `s5`, `slideous`, + `dzslides`, and `revealjs` writers. `--markdown-headings=setext`|`atx` -- cgit v1.2.3 From 0216a2f5047dd78ecc3c26659281a8b629a83de0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 10 Sep 2021 09:50:05 -0700 Subject: Org reader: don't parse a list as first item in a list item. Closes #7557. --- src/Text/Pandoc/Readers/Org/Blocks.hs | 5 ++++- test/command/7557.md | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/command/7557.md diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs index f18d2f9a7..2ec97d903 100644 --- a/src/Text/Pandoc/Readers/Org/Blocks.hs +++ b/src/Text/Pandoc/Readers/Org/Blocks.hs @@ -889,7 +889,10 @@ listItem parseIndentedMarker = try . withContext ListItemState $ do firstLine <- anyLineNewline blank <- option "" ("\n" <$ blankline) rest <- T.concat <$> many (listContinuation markerLength) - contents <- parseFromString blocks $ firstLine <> blank <> rest + contents <- parseFromString (do initial <- paraOrPlain <|> pure mempty + subsequent <- blocks + return $ initial <> subsequent) + (firstLine <> blank <> rest) return (maybe id (prependInlines . checkboxToInlines) box <$> contents) -- | Prepend inlines to blocks, adding them to the first paragraph or diff --git a/test/command/7557.md b/test/command/7557.md new file mode 100644 index 000000000..a62a3f14b --- /dev/null +++ b/test/command/7557.md @@ -0,0 +1,7 @@ +``` +% pandoc -f org -t native +- 11. and 12. 09. meeting +- ^D +[BulletList + [[Plain [Str "11.",Space,Str "and",Space,Str "12.",Space,Str "09.",Space,Str "meeting"]]]] +``` -- cgit v1.2.3 From 78b2d747565e33e5f7e460532c1b070072cf6d6b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 10 Sep 2021 11:02:22 -0700 Subject: Remove redundant import. --- src/Text/Pandoc/Readers/RTF.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/RTF.hs b/src/Text/Pandoc/Readers/RTF.hs index 72d1f51d2..3938681f4 100644 --- a/src/Text/Pandoc/Readers/RTF.hs +++ b/src/Text/Pandoc/Readers/RTF.hs @@ -31,7 +31,7 @@ import Text.Pandoc.Definition import Text.Pandoc.Options import Text.Pandoc.Parsing import Text.Pandoc.Shared (safeRead, tshow) -import Data.Char (isAlphaNum, chr, digitToInt, isAscii, isLetter, isSpace, ord) +import Data.Char (isAlphaNum, chr, isAscii, isLetter, isSpace, ord) import qualified Data.ByteString.Lazy as BL import Data.Digest.Pure.SHA (sha1, showDigest) import Data.Maybe (mapMaybe, fromMaybe) -- cgit v1.2.3 From 8beca46611f42ff0fed67e5a6420175cf744d32e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 10 Sep 2021 12:07:11 -0700 Subject: Fix command test for #7557. --- test/command/7557.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/command/7557.md b/test/command/7557.md index a62a3f14b..26e2df740 100644 --- a/test/command/7557.md +++ b/test/command/7557.md @@ -1,7 +1,7 @@ ``` % pandoc -f org -t native - 11. and 12. 09. meeting -- ^D +^D [BulletList [[Plain [Str "11.",Space,Str "and",Space,Str "12.",Space,Str "09.",Space,Str "meeting"]]]] ``` -- cgit v1.2.3 From 8ec9b884f1005e2935181045339614937159a0ad Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Wed, 1 Sep 2021 14:40:26 +0100 Subject: pptx: Fix capitalisation of notesMasterId MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I don’t think this has caused any problems, but before now it’s been "NotesMasterId", which is incorrect according to [ECMA-376]. [ECMA-376]: https://www.ecma-international.org/publications-and-standards/standards/ecma-376/ --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 2 +- .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35181 -> 35233 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45873 -> 45925 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32304 -> 32356 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 45369 -> 45421 bytes .../deleted-layouts.pptx | Bin 34509 -> 34561 bytes .../speaker-notes-after-metadata/moved-layouts.pptx | Bin 45269 -> 45321 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31636 -> 31688 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 44775 -> 44828 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33536 -> 33588 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44297 -> 44349 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30657 -> 30709 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 43803 -> 43855 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54432 -> 54484 bytes .../pptx/speaker-notes-afterseps/moved-layouts.pptx | Bin 65121 -> 65173 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51557 -> 51609 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64619 -> 64671 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38239 -> 38291 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 49002 -> 49054 bytes test/pptx/speaker-notes/output.pptx | Bin 35360 -> 35412 bytes test/pptx/speaker-notes/templated.pptx | Bin 48507 -> 48560 bytes 21 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index d83fb2182..a28eaf54c 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -1981,7 +1981,7 @@ presentationToPresentationElement pres@(Presentation _ slds) = do notesMasterElem = mknode "p:notesMasterIdLst" [] [ mknode - "p:NotesMasterId" + "p:notesMasterId" [("r:id", "rId" <> tshow notesMasterRId)] () ] diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx index 82800a074..100da7c7f 100644 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx index f5ef1d7bd..d142f045b 100644 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 59a643c3e..18f44c4cd 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx index 8cc7be75b..8beb704a4 100644 Binary files a/test/pptx/blanks/just-speaker-notes/templated.pptx and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 33304ae3e..48f75ae42 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx index b844a0b51..8f7aee710 100644 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index 6343bffe4..7fe3d3ae7 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx index 8d27c4c68..a9e883ada 100644 Binary files a/test/pptx/speaker-notes-after-metadata/templated.pptx and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 00f05fae5..831d37446 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx index 9fff9f855..7ba1c3a11 100644 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index d581681aa..bcb5dd214 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx index d8d8481df..010c4cce4 100644 Binary files a/test/pptx/speaker-notes-afterheader/templated.pptx and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index 139af783b..de607ae41 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx index de697cbd8..8eb81bee1 100644 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 9542fe8b5..4288b84b6 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index 5a3d15d57..96338a2b5 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index c63125d8a..558bb7930 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx index f95df9622..283170569 100644 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index 0ab1302da..f0e51e597 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx index 930377fbf..27df2d994 100644 Binary files a/test/pptx/speaker-notes/templated.pptx and b/test/pptx/speaker-notes/templated.pptx differ -- cgit v1.2.3 From b60c6157fecd868671baf055045a324ffe20c233 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 2 Sep 2021 10:54:55 +0100 Subject: pptx: Don’t add relationships unnecessarily MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before now, for any layouts added to the output from the default reference doc, the relationships were unconditionally added to the output. However, if there was already a layout in slideMaster1 at the same index then that results in duplicate relationships. This commit checks first, and only adds the relationship if it doesn’t already exist. --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index a28eaf54c..0b6ca50c2 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -384,9 +384,11 @@ updateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels) Element -> ([Text], Element) addLayoutRels e = let - layoutsToAdd = filter (not . slInReferenceDoc) (toList layouts) + layoutsToAdd = filter (\l -> not (slInReferenceDoc l) && isNew e l) + (toList layouts) newRelationships = snd (foldr mkRelationship (maxIdNumber e, []) layoutsToAdd) - newRelationshipIds = mapMaybe getRelationshipId newRelationships + newRelationshipIds = + mapMaybe (findElemAttr (QName "Id" Nothing Nothing)) newRelationships mkRelationship layout (lastId, relationships) = let thisId = lastId + 1 slideLayoutPath = "../slideLayouts/" <> T.pack (takeFileName (slPath layout)) @@ -403,9 +405,16 @@ updateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels) in (thisId, Elem newRelationship : relationships) in (newRelationshipIds, e {elContent = elContent e <> newRelationships}) - getRelationshipId :: Content -> Maybe Text - getRelationshipId (Elem e) = findAttr (QName "Id" Nothing Nothing) e - getRelationshipId _ = Nothing + -- | Whether the layout needs to be added to the Relationships element. + isNew :: Element -> SlideLayout -> Bool + isNew relationships SlideLayout{..} = let + toDetails = fmap (takeFileName . T.unpack) + . findElemAttr (QName "Target" Nothing Nothing) + in takeFileName slPath `notElem` mapMaybe toDetails (elContent relationships) + + findElemAttr :: QName -> Content -> Maybe Text + findElemAttr attr (Elem e) = findAttr attr e + findElemAttr _ _ = Nothing maxIdNumber :: Element -> Integer maxIdNumber relationships = maximum (0 : idNumbers) -- cgit v1.2.3 From 2b98991551a95f9f91fd6b643f52bf6065f5057a Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 2 Sep 2021 16:56:40 +0100 Subject: pptx: Include all themes in output archive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Accept test changes: they’re adding the second theme (for all tests not containing speaker notes), or changing its position in the XML (for the ones containing speaker notes). --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 6 ++---- .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35233 -> 35178 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45925 -> 45870 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32356 -> 32297 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 45421 -> 45365 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 30444 -> 32092 bytes test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 41131 -> 42780 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 27562 -> 29211 bytes test/pptx/blanks/nbsp-in-body/templated.pptx | Bin 40630 -> 42280 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 30444 -> 32092 bytes test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 41131 -> 42780 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 27562 -> 29211 bytes test/pptx/blanks/nbsp-in-heading/templated.pptx | Bin 40630 -> 42280 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 31069 -> 32717 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 41822 -> 43405 bytes test/pptx/code-custom/output.pptx | Bin 28184 -> 29836 bytes test/pptx/code-custom/templated.pptx | Bin 41337 -> 42905 bytes test/pptx/code/deleted-layouts.pptx | Bin 31068 -> 32716 bytes test/pptx/code/moved-layouts.pptx | Bin 41826 -> 43405 bytes test/pptx/code/output.pptx | Bin 28183 -> 29835 bytes test/pptx/code/templated.pptx | Bin 41337 -> 42905 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 45804 -> 47453 bytes .../pptx/comparison/both-columns/moved-layouts.pptx | Bin 56524 -> 58172 bytes test/pptx/comparison/both-columns/output.pptx | Bin 42932 -> 44581 bytes test/pptx/comparison/both-columns/templated.pptx | Bin 56025 -> 57674 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 45833 -> 47482 bytes test/pptx/comparison/extra-image/moved-layouts.pptx | Bin 56552 -> 58200 bytes test/pptx/comparison/extra-image/output.pptx | Bin 42961 -> 44610 bytes test/pptx/comparison/extra-image/templated.pptx | Bin 56053 -> 57702 bytes .../pptx/comparison/extra-text/deleted-layouts.pptx | Bin 45804 -> 47453 bytes test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 56524 -> 58172 bytes test/pptx/comparison/extra-text/output.pptx | Bin 42932 -> 44581 bytes test/pptx/comparison/extra-text/templated.pptx | Bin 56025 -> 57674 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 45717 -> 47366 bytes .../comparison/non-text-first/moved-layouts.pptx | Bin 56417 -> 58065 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 42845 -> 44494 bytes test/pptx/comparison/non-text-first/templated.pptx | Bin 55918 -> 57567 bytes .../pptx/comparison/one-column/deleted-layouts.pptx | Bin 29136 -> 30785 bytes test/pptx/comparison/one-column/moved-layouts.pptx | Bin 39856 -> 41506 bytes test/pptx/comparison/one-column/output.pptx | Bin 26258 -> 27906 bytes test/pptx/comparison/one-column/templated.pptx | Bin 39357 -> 41006 bytes .../heading-text-image/deleted-layouts.pptx | Bin 45549 -> 47198 bytes .../heading-text-image/moved-layouts.pptx | Bin 56248 -> 57896 bytes .../heading-text-image/output.pptx | Bin 42677 -> 44326 bytes .../heading-text-image/templated.pptx | Bin 55749 -> 57398 bytes .../image-text/deleted-layouts.pptx | Bin 46248 -> 47896 bytes .../image-text/moved-layouts.pptx | Bin 56934 -> 58584 bytes .../content-with-caption/image-text/output.pptx | Bin 43374 -> 45022 bytes .../content-with-caption/image-text/templated.pptx | Bin 56435 -> 58084 bytes .../text-image/deleted-layouts.pptx | Bin 45488 -> 47137 bytes .../text-image/moved-layouts.pptx | Bin 56188 -> 57836 bytes .../content-with-caption/text-image/output.pptx | Bin 42616 -> 44265 bytes .../content-with-caption/text-image/templated.pptx | Bin 55689 -> 57338 bytes .../deleted-layouts.pptx | Bin 29842 -> 31490 bytes .../moved-layouts.pptx | Bin 40600 -> 42178 bytes .../pptx/document-properties-short-desc/output.pptx | Bin 26967 -> 28619 bytes .../document-properties-short-desc/templated.pptx | Bin 40113 -> 41678 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 30246 -> 31894 bytes test/pptx/document-properties/moved-layouts.pptx | Bin 41004 -> 42582 bytes test/pptx/document-properties/output.pptx | Bin 27375 -> 29025 bytes test/pptx/document-properties/templated.pptx | Bin 40517 -> 42082 bytes test/pptx/endnotes-toc/deleted-layouts.pptx | Bin 30632 -> 32280 bytes test/pptx/endnotes-toc/moved-layouts.pptx | Bin 41384 -> 42967 bytes test/pptx/endnotes-toc/output.pptx | Bin 27747 -> 29399 bytes test/pptx/endnotes-toc/templated.pptx | Bin 40899 -> 42467 bytes test/pptx/endnotes/deleted-layouts.pptx | Bin 29810 -> 31458 bytes test/pptx/endnotes/moved-layouts.pptx | Bin 40566 -> 42146 bytes test/pptx/endnotes/output.pptx | Bin 26928 -> 28580 bytes test/pptx/endnotes/templated.pptx | Bin 40078 -> 41645 bytes test/pptx/images/deleted-layouts.pptx | Bin 47473 -> 49121 bytes test/pptx/images/moved-layouts.pptx | Bin 58160 -> 59809 bytes test/pptx/images/output.pptx | Bin 44596 -> 46244 bytes test/pptx/images/templated.pptx | Bin 57660 -> 59308 bytes test/pptx/inline-formatting/deleted-layouts.pptx | Bin 29002 -> 30651 bytes test/pptx/inline-formatting/moved-layouts.pptx | Bin 39758 -> 41339 bytes test/pptx/inline-formatting/output.pptx | Bin 26121 -> 27772 bytes test/pptx/inline-formatting/templated.pptx | Bin 39272 -> 40839 bytes test/pptx/lists/deleted-layouts.pptx | Bin 29897 -> 31545 bytes test/pptx/lists/moved-layouts.pptx | Bin 40653 -> 42233 bytes test/pptx/lists/output.pptx | Bin 27015 -> 28667 bytes test/pptx/lists/templated.pptx | Bin 40166 -> 41733 bytes test/pptx/raw-ooxml/deleted-layouts.pptx | Bin 29790 -> 31438 bytes test/pptx/raw-ooxml/moved-layouts.pptx | Bin 40546 -> 42126 bytes test/pptx/raw-ooxml/output.pptx | Bin 26908 -> 28560 bytes test/pptx/raw-ooxml/templated.pptx | Bin 40059 -> 41626 bytes test/pptx/remove-empty-slides/deleted-layouts.pptx | Bin 46218 -> 47866 bytes test/pptx/remove-empty-slides/moved-layouts.pptx | Bin 56903 -> 58553 bytes test/pptx/remove-empty-slides/output.pptx | Bin 43346 -> 44994 bytes test/pptx/remove-empty-slides/templated.pptx | Bin 56404 -> 58053 bytes .../slide-breaks-slide-level-1/deleted-layouts.pptx | Bin 30590 -> 32238 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 41343 -> 42926 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 27705 -> 29357 bytes test/pptx/slide-breaks-slide-level-1/templated.pptx | Bin 40858 -> 42426 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 32364 -> 34012 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 43118 -> 44701 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 29481 -> 31133 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 42634 -> 44201 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 31414 -> 33062 bytes test/pptx/slide-breaks/moved-layouts.pptx | Bin 42171 -> 43751 bytes test/pptx/slide-breaks/output.pptx | Bin 28531 -> 30183 bytes test/pptx/slide-breaks/templated.pptx | Bin 41683 -> 43250 bytes .../h1-h2-with-table/deleted-layouts.pptx | Bin 29137 -> 30786 bytes .../h1-h2-with-table/moved-layouts.pptx | Bin 39829 -> 41479 bytes .../pptx/slide-level-0/h1-h2-with-table/output.pptx | Bin 26259 -> 27907 bytes .../slide-level-0/h1-h2-with-table/templated.pptx | Bin 39330 -> 40979 bytes .../h1-with-image/deleted-layouts.pptx | Bin 45469 -> 47118 bytes .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 56156 -> 57804 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 42596 -> 44245 bytes .../pptx/slide-level-0/h1-with-image/templated.pptx | Bin 55657 -> 57306 bytes .../h1-with-table/deleted-layouts.pptx | Bin 29044 -> 30693 bytes .../slide-level-0/h1-with-table/moved-layouts.pptx | Bin 39731 -> 41381 bytes test/pptx/slide-level-0/h1-with-table/output.pptx | Bin 26166 -> 27814 bytes .../pptx/slide-level-0/h1-with-table/templated.pptx | Bin 39232 -> 40881 bytes .../h2-with-image/deleted-layouts.pptx | Bin 45469 -> 47118 bytes .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 56156 -> 57804 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 42596 -> 44245 bytes .../pptx/slide-level-0/h2-with-image/templated.pptx | Bin 55657 -> 57306 bytes .../deleted-layouts.pptx | Bin 34561 -> 34504 bytes .../speaker-notes-after-metadata/moved-layouts.pptx | Bin 45321 -> 45193 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31688 -> 31634 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 44828 -> 44690 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33588 -> 33532 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44349 -> 44220 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30709 -> 30653 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 43855 -> 43719 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54484 -> 54429 bytes .../pptx/speaker-notes-afterseps/moved-layouts.pptx | Bin 65173 -> 65119 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51609 -> 51548 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64671 -> 64614 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38291 -> 38236 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 49054 -> 48929 bytes test/pptx/speaker-notes/output.pptx | Bin 35412 -> 35358 bytes test/pptx/speaker-notes/templated.pptx | Bin 48560 -> 48423 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 29873 -> 31521 bytes test/pptx/start-numbering-at/moved-layouts.pptx | Bin 40630 -> 42209 bytes test/pptx/start-numbering-at/output.pptx | Bin 26991 -> 28643 bytes test/pptx/start-numbering-at/templated.pptx | Bin 40142 -> 41709 bytes test/pptx/tables/deleted-layouts.pptx | Bin 30417 -> 32065 bytes test/pptx/tables/moved-layouts.pptx | Bin 41174 -> 42753 bytes test/pptx/tables/output.pptx | Bin 27532 -> 29184 bytes test/pptx/tables/templated.pptx | Bin 40686 -> 42253 bytes test/pptx/two-column/deleted-layouts.pptx | Bin 28919 -> 30568 bytes test/pptx/two-column/moved-layouts.pptx | Bin 39676 -> 41256 bytes test/pptx/two-column/output.pptx | Bin 26038 -> 27689 bytes test/pptx/two-column/templated.pptx | Bin 39189 -> 40756 bytes 145 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 0b6ca50c2..43f94b247 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -239,8 +239,8 @@ alwaysInheritedPatterns = , "ppt/slideLayouts/_rels/slideLayout*.xml.rels" , "ppt/slideMasters/slideMaster1.xml" , "ppt/slideMasters/_rels/slideMaster1.xml.rels" - , "ppt/theme/theme1.xml" - , "ppt/theme/_rels/theme1.xml.rels" + , "ppt/theme/theme*.xml" + , "ppt/theme/_rels/theme*.xml.rels" , "ppt/presProps.xml" , "ppt/tableStyles.xml" , "ppt/media/image*" @@ -252,8 +252,6 @@ contingentInheritedPatterns pres = [] <> if presHasSpeakerNotes pres then map compile [ "ppt/notesMasters/notesMaster*.xml" , "ppt/notesMasters/_rels/notesMaster*.xml.rels" - , "ppt/theme/theme2.xml" - , "ppt/theme/_rels/theme2.xml.rels" ] else [] diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx index 100da7c7f..5038f2aaf 100644 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx index d142f045b..90353a560 100644 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 18f44c4cd..799c0f14a 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx index 8beb704a4..5e3afb5f8 100644 Binary files a/test/pptx/blanks/just-speaker-notes/templated.pptx and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx index 98a1586df..7716e1cbf 100644 Binary files a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx index fca99b672..3dc6c817e 100644 Binary files a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx index ed5c77e05..1df3f9574 100644 Binary files a/test/pptx/blanks/nbsp-in-body/output.pptx and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/templated.pptx b/test/pptx/blanks/nbsp-in-body/templated.pptx index 4104f6230..1cf58a1bb 100644 Binary files a/test/pptx/blanks/nbsp-in-body/templated.pptx and b/test/pptx/blanks/nbsp-in-body/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx index 98a1586df..7716e1cbf 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx index fca99b672..3dc6c817e 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx index ed5c77e05..e528091d7 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/output.pptx and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/templated.pptx b/test/pptx/blanks/nbsp-in-heading/templated.pptx index 4104f6230..1f2d91399 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/templated.pptx and b/test/pptx/blanks/nbsp-in-heading/templated.pptx differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx index fdcc7ce1d..b49cd4896 100644 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx index a14eeb6c8..c6806f37f 100644 Binary files a/test/pptx/code-custom/moved-layouts.pptx and b/test/pptx/code-custom/moved-layouts.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index 5e9c2c630..a72bebbe2 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 0e640f373..2bdb526fa 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx index c7f78ac40..df7814599 100644 Binary files a/test/pptx/code/deleted-layouts.pptx and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx index 4d66b1310..71e8560bd 100644 Binary files a/test/pptx/code/moved-layouts.pptx and b/test/pptx/code/moved-layouts.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index aab0cc6f5..4b70df2c7 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index a03109217..1285a9273 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx index 6a5affdbf..27f9d9ac7 100644 Binary files a/test/pptx/comparison/both-columns/deleted-layouts.pptx and b/test/pptx/comparison/both-columns/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx index 88282fabb..a658045ef 100644 Binary files a/test/pptx/comparison/both-columns/moved-layouts.pptx and b/test/pptx/comparison/both-columns/moved-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx index 477072fb4..560c7d41a 100644 Binary files a/test/pptx/comparison/both-columns/output.pptx and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx index 431d22392..2fb38880d 100644 Binary files a/test/pptx/comparison/both-columns/templated.pptx and b/test/pptx/comparison/both-columns/templated.pptx differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx index beed077f7..267c7cb69 100644 Binary files a/test/pptx/comparison/extra-image/deleted-layouts.pptx and b/test/pptx/comparison/extra-image/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx index f86f5b043..b7023026c 100644 Binary files a/test/pptx/comparison/extra-image/moved-layouts.pptx and b/test/pptx/comparison/extra-image/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx index a0eb5e847..06d632ee7 100644 Binary files a/test/pptx/comparison/extra-image/output.pptx and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx index a434ba29f..af84388c4 100644 Binary files a/test/pptx/comparison/extra-image/templated.pptx and b/test/pptx/comparison/extra-image/templated.pptx differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx index 6a5affdbf..27f9d9ac7 100644 Binary files a/test/pptx/comparison/extra-text/deleted-layouts.pptx and b/test/pptx/comparison/extra-text/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx index 88282fabb..a658045ef 100644 Binary files a/test/pptx/comparison/extra-text/moved-layouts.pptx and b/test/pptx/comparison/extra-text/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx index 8de7d23b2..560c7d41a 100644 Binary files a/test/pptx/comparison/extra-text/output.pptx and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx index 431d22392..2fb38880d 100644 Binary files a/test/pptx/comparison/extra-text/templated.pptx and b/test/pptx/comparison/extra-text/templated.pptx differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx index bd7aa69b7..be30d8368 100644 Binary files a/test/pptx/comparison/non-text-first/deleted-layouts.pptx and b/test/pptx/comparison/non-text-first/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx index a01def95c..c4879b7d5 100644 Binary files a/test/pptx/comparison/non-text-first/moved-layouts.pptx and b/test/pptx/comparison/non-text-first/moved-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx index cb7843fce..099cf6729 100644 Binary files a/test/pptx/comparison/non-text-first/output.pptx and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx index 32db19cbf..31ac01f18 100644 Binary files a/test/pptx/comparison/non-text-first/templated.pptx and b/test/pptx/comparison/non-text-first/templated.pptx differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx index 5fd7cf9b6..27620f05f 100644 Binary files a/test/pptx/comparison/one-column/deleted-layouts.pptx and b/test/pptx/comparison/one-column/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx index d5df2b751..fc64d3af5 100644 Binary files a/test/pptx/comparison/one-column/moved-layouts.pptx and b/test/pptx/comparison/one-column/moved-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx index 6914162ff..854a968af 100644 Binary files a/test/pptx/comparison/one-column/output.pptx and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx index a30a24453..9e671af1d 100644 Binary files a/test/pptx/comparison/one-column/templated.pptx and b/test/pptx/comparison/one-column/templated.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx index b5afcc021..3cd09a916 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx index 05806a767..8e76bc94c 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx index b3e89757b..5c680e878 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/output.pptx and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx index 3b0fe64c3..bdde384a4 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/templated.pptx and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx index e9e0551ac..376880b41 100644 Binary files a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx index 77d706ed3..9e33d3163 100644 Binary files a/test/pptx/content-with-caption/image-text/moved-layouts.pptx and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx index 94a2e8b88..c88030b94 100644 Binary files a/test/pptx/content-with-caption/image-text/output.pptx and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx index bef1921a7..a22e9ae3e 100644 Binary files a/test/pptx/content-with-caption/image-text/templated.pptx and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx index 68d3d7b9b..2dcb8b78e 100644 Binary files a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx index feade1096..7d187a168 100644 Binary files a/test/pptx/content-with-caption/text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx index efa814d65..751121cf2 100644 Binary files a/test/pptx/content-with-caption/text-image/output.pptx and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx index ebd552252..4f0aaaa7a 100644 Binary files a/test/pptx/content-with-caption/text-image/templated.pptx and b/test/pptx/content-with-caption/text-image/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx index a866f3c1f..79517481a 100644 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx index 8834f885f..51608c2e9 100644 Binary files a/test/pptx/document-properties-short-desc/moved-layouts.pptx and b/test/pptx/document-properties-short-desc/moved-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx index de5e68151..02c241b89 100644 Binary files a/test/pptx/document-properties-short-desc/output.pptx and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/templated.pptx b/test/pptx/document-properties-short-desc/templated.pptx index d39dc0c91..82ccc072c 100644 Binary files a/test/pptx/document-properties-short-desc/templated.pptx and b/test/pptx/document-properties-short-desc/templated.pptx differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx index 1f52481f3..12f6570cf 100644 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx index c1d2d5282..9a9d4ac3e 100644 Binary files a/test/pptx/document-properties/moved-layouts.pptx and b/test/pptx/document-properties/moved-layouts.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx index 6bcbd1b9c..cfd3261bc 100644 Binary files a/test/pptx/document-properties/output.pptx and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/document-properties/templated.pptx b/test/pptx/document-properties/templated.pptx index 841ae8c42..3d52d22df 100644 Binary files a/test/pptx/document-properties/templated.pptx and b/test/pptx/document-properties/templated.pptx differ diff --git a/test/pptx/endnotes-toc/deleted-layouts.pptx b/test/pptx/endnotes-toc/deleted-layouts.pptx index 60110a64e..3e613e038 100644 Binary files a/test/pptx/endnotes-toc/deleted-layouts.pptx and b/test/pptx/endnotes-toc/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes-toc/moved-layouts.pptx b/test/pptx/endnotes-toc/moved-layouts.pptx index d1200bd7d..e64cd9c77 100644 Binary files a/test/pptx/endnotes-toc/moved-layouts.pptx and b/test/pptx/endnotes-toc/moved-layouts.pptx differ diff --git a/test/pptx/endnotes-toc/output.pptx b/test/pptx/endnotes-toc/output.pptx index a028b346f..bb431f511 100644 Binary files a/test/pptx/endnotes-toc/output.pptx and b/test/pptx/endnotes-toc/output.pptx differ diff --git a/test/pptx/endnotes-toc/templated.pptx b/test/pptx/endnotes-toc/templated.pptx index 38a0c437d..63b066f0d 100644 Binary files a/test/pptx/endnotes-toc/templated.pptx and b/test/pptx/endnotes-toc/templated.pptx differ diff --git a/test/pptx/endnotes/deleted-layouts.pptx b/test/pptx/endnotes/deleted-layouts.pptx index 0b0bd2f53..1d7ccb928 100644 Binary files a/test/pptx/endnotes/deleted-layouts.pptx and b/test/pptx/endnotes/deleted-layouts.pptx differ diff --git a/test/pptx/endnotes/moved-layouts.pptx b/test/pptx/endnotes/moved-layouts.pptx index 0d4c491b9..0f071207c 100644 Binary files a/test/pptx/endnotes/moved-layouts.pptx and b/test/pptx/endnotes/moved-layouts.pptx differ diff --git a/test/pptx/endnotes/output.pptx b/test/pptx/endnotes/output.pptx index 9d46036fe..e4e661804 100644 Binary files a/test/pptx/endnotes/output.pptx and b/test/pptx/endnotes/output.pptx differ diff --git a/test/pptx/endnotes/templated.pptx b/test/pptx/endnotes/templated.pptx index 863cc29d4..a97a7eed8 100644 Binary files a/test/pptx/endnotes/templated.pptx and b/test/pptx/endnotes/templated.pptx differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx index 2f8754e90..9f0f41c37 100644 Binary files a/test/pptx/images/deleted-layouts.pptx and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx index 7951a09f6..f26ac9e8f 100644 Binary files a/test/pptx/images/moved-layouts.pptx and b/test/pptx/images/moved-layouts.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx index 89325e577..993209a45 100644 Binary files a/test/pptx/images/output.pptx and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/images/templated.pptx b/test/pptx/images/templated.pptx index 7c0ed9a17..06b337538 100644 Binary files a/test/pptx/images/templated.pptx and b/test/pptx/images/templated.pptx differ diff --git a/test/pptx/inline-formatting/deleted-layouts.pptx b/test/pptx/inline-formatting/deleted-layouts.pptx index 2fbe21a45..ac9fa4725 100644 Binary files a/test/pptx/inline-formatting/deleted-layouts.pptx and b/test/pptx/inline-formatting/deleted-layouts.pptx differ diff --git a/test/pptx/inline-formatting/moved-layouts.pptx b/test/pptx/inline-formatting/moved-layouts.pptx index 427492130..49a2409d1 100644 Binary files a/test/pptx/inline-formatting/moved-layouts.pptx and b/test/pptx/inline-formatting/moved-layouts.pptx differ diff --git a/test/pptx/inline-formatting/output.pptx b/test/pptx/inline-formatting/output.pptx index 473b9498d..f1a4a0a36 100644 Binary files a/test/pptx/inline-formatting/output.pptx and b/test/pptx/inline-formatting/output.pptx differ diff --git a/test/pptx/inline-formatting/templated.pptx b/test/pptx/inline-formatting/templated.pptx index dd778a102..6930b785c 100644 Binary files a/test/pptx/inline-formatting/templated.pptx and b/test/pptx/inline-formatting/templated.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx index e527d3c5f..1670eada1 100644 Binary files a/test/pptx/lists/deleted-layouts.pptx and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx index 2947c3211..f7590c5f9 100644 Binary files a/test/pptx/lists/moved-layouts.pptx and b/test/pptx/lists/moved-layouts.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index ffc2eb9f7..95510e92e 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 2493e7890..7af437bfe 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/raw-ooxml/deleted-layouts.pptx b/test/pptx/raw-ooxml/deleted-layouts.pptx index 2da1b7a63..a7bd12281 100644 Binary files a/test/pptx/raw-ooxml/deleted-layouts.pptx and b/test/pptx/raw-ooxml/deleted-layouts.pptx differ diff --git a/test/pptx/raw-ooxml/moved-layouts.pptx b/test/pptx/raw-ooxml/moved-layouts.pptx index e58304172..614682671 100644 Binary files a/test/pptx/raw-ooxml/moved-layouts.pptx and b/test/pptx/raw-ooxml/moved-layouts.pptx differ diff --git a/test/pptx/raw-ooxml/output.pptx b/test/pptx/raw-ooxml/output.pptx index 29164af15..841495315 100644 Binary files a/test/pptx/raw-ooxml/output.pptx and b/test/pptx/raw-ooxml/output.pptx differ diff --git a/test/pptx/raw-ooxml/templated.pptx b/test/pptx/raw-ooxml/templated.pptx index 0f20f9826..1dd23da2e 100644 Binary files a/test/pptx/raw-ooxml/templated.pptx and b/test/pptx/raw-ooxml/templated.pptx differ diff --git a/test/pptx/remove-empty-slides/deleted-layouts.pptx b/test/pptx/remove-empty-slides/deleted-layouts.pptx index 51981b241..488abc02a 100644 Binary files a/test/pptx/remove-empty-slides/deleted-layouts.pptx and b/test/pptx/remove-empty-slides/deleted-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/moved-layouts.pptx b/test/pptx/remove-empty-slides/moved-layouts.pptx index ddca32a52..1e1cf1e44 100644 Binary files a/test/pptx/remove-empty-slides/moved-layouts.pptx and b/test/pptx/remove-empty-slides/moved-layouts.pptx differ diff --git a/test/pptx/remove-empty-slides/output.pptx b/test/pptx/remove-empty-slides/output.pptx index 9e8b5eed2..e2871a882 100644 Binary files a/test/pptx/remove-empty-slides/output.pptx and b/test/pptx/remove-empty-slides/output.pptx differ diff --git a/test/pptx/remove-empty-slides/templated.pptx b/test/pptx/remove-empty-slides/templated.pptx index 579467452..c730b2103 100644 Binary files a/test/pptx/remove-empty-slides/templated.pptx and b/test/pptx/remove-empty-slides/templated.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx index 2c891cd1d..334fdea9c 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx index 8471b1d10..3faabfd93 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx index 449339778..96b9907cc 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/output.pptx and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/templated.pptx b/test/pptx/slide-breaks-slide-level-1/templated.pptx index e2815159a..9f23f1d9f 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/templated.pptx and b/test/pptx/slide-breaks-slide-level-1/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx index b63994cce..0492ee2ec 100644 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx index 918264bc5..f3e56652c 100644 Binary files a/test/pptx/slide-breaks-toc/moved-layouts.pptx and b/test/pptx/slide-breaks-toc/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index 9dbfa41a0..b3063b15e 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index b83f3f596..bcb2f8276 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx index fbf4054be..827c7dfda 100644 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx index 90b3b94a6..241605754 100644 Binary files a/test/pptx/slide-breaks/moved-layouts.pptx and b/test/pptx/slide-breaks/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx index e06d9079d..55c09a80e 100644 Binary files a/test/pptx/slide-breaks/output.pptx and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-breaks/templated.pptx b/test/pptx/slide-breaks/templated.pptx index 71ba99701..f60f7da06 100644 Binary files a/test/pptx/slide-breaks/templated.pptx and b/test/pptx/slide-breaks/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx index 217b000b6..c315a7a7a 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx index d8a6c90fe..81b49936d 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx index 512b324bf..3f815d830 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx index 5ab88e94c..b270d2d4f 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx index 5be799e3b..7bc7cfeee 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx index 395036069..602df1c77 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx index 2f3a53f5c..f725760dc 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/output.pptx and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/templated.pptx b/test/pptx/slide-level-0/h1-with-image/templated.pptx index d306375e9..b203ff671 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/templated.pptx and b/test/pptx/slide-level-0/h1-with-image/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx index 127dcea01..9d58c2c52 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx index 197499bc3..62424de73 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/output.pptx b/test/pptx/slide-level-0/h1-with-table/output.pptx index 44dbbf90c..d30fd88c3 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/output.pptx and b/test/pptx/slide-level-0/h1-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/templated.pptx b/test/pptx/slide-level-0/h1-with-table/templated.pptx index 87b45dda2..eb2a78647 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/templated.pptx and b/test/pptx/slide-level-0/h1-with-table/templated.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx index 5be799e3b..7bc7cfeee 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx index 395036069..602df1c77 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx index 948659d6a..f725760dc 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/output.pptx and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/templated.pptx b/test/pptx/slide-level-0/h2-with-image/templated.pptx index d306375e9..b203ff671 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/templated.pptx and b/test/pptx/slide-level-0/h2-with-image/templated.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 48f75ae42..9010ba04a 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx index 8f7aee710..ca53605b7 100644 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index 7fe3d3ae7..607115858 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx index a9e883ada..3be3ed0af 100644 Binary files a/test/pptx/speaker-notes-after-metadata/templated.pptx and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 831d37446..2c2a0936b 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx index 7ba1c3a11..a9c8bfa0a 100644 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index bcb5dd214..ff403aa1c 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx index 010c4cce4..15435c45a 100644 Binary files a/test/pptx/speaker-notes-afterheader/templated.pptx and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index de607ae41..f6abb0b27 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx index 8eb81bee1..6a770fc75 100644 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 4288b84b6..7e56147f1 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index 96338a2b5..3184ff74e 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index 558bb7930..5429b88e0 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx index 283170569..13e34698d 100644 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index f0e51e597..74041a40d 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx index 27df2d994..80a3e3dea 100644 Binary files a/test/pptx/speaker-notes/templated.pptx and b/test/pptx/speaker-notes/templated.pptx differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx index 68b4215df..7bfe9868f 100644 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx index e1b2d4de8..0100365ec 100644 Binary files a/test/pptx/start-numbering-at/moved-layouts.pptx and b/test/pptx/start-numbering-at/moved-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index 4320128b3..3ba9a236a 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index efc56ac7a..8a144d601 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx index d533d3c28..163d4ca5e 100644 Binary files a/test/pptx/tables/deleted-layouts.pptx and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx index 56608a039..1b0e606da 100644 Binary files a/test/pptx/tables/moved-layouts.pptx and b/test/pptx/tables/moved-layouts.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx index e41219844..1c89d8032 100644 Binary files a/test/pptx/tables/output.pptx and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/tables/templated.pptx b/test/pptx/tables/templated.pptx index 0a8c3e8d9..5755bfe9d 100644 Binary files a/test/pptx/tables/templated.pptx and b/test/pptx/tables/templated.pptx differ diff --git a/test/pptx/two-column/deleted-layouts.pptx b/test/pptx/two-column/deleted-layouts.pptx index 9622ed2cd..1d7bd87d3 100644 Binary files a/test/pptx/two-column/deleted-layouts.pptx and b/test/pptx/two-column/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/moved-layouts.pptx b/test/pptx/two-column/moved-layouts.pptx index a17f96b18..71760268c 100644 Binary files a/test/pptx/two-column/moved-layouts.pptx and b/test/pptx/two-column/moved-layouts.pptx differ diff --git a/test/pptx/two-column/output.pptx b/test/pptx/two-column/output.pptx index 270a7eeac..396dc2a74 100644 Binary files a/test/pptx/two-column/output.pptx and b/test/pptx/two-column/output.pptx differ diff --git a/test/pptx/two-column/templated.pptx b/test/pptx/two-column/templated.pptx index 6d9470372..8901695b1 100644 Binary files a/test/pptx/two-column/templated.pptx and b/test/pptx/two-column/templated.pptx differ -- cgit v1.2.3 From ec7cea294dce270f358594c33018c2d8bdadf8a8 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 2 Sep 2021 16:57:02 +0100 Subject: pptx: Fix presentation rel numbering Before now, the numbering of rIds was inconsistent when making the presentation XML and when making the presentation relationships XML. For the relationships, the slides were inserted into the rId order after the first master, and everything else was moved up out of the way. However, this change was then missed in the presentation XML, I think because `envSlideOffset` was never set. The result was that any slide masters after the first would have the wrong rIds in the presentation XML, clashing with the slides, which would lead PowerPoint to view produced files as corrupt. As well, other relationships (like embedded fonts) would have their rId changed in the relationships XML but not in the presentation XML. This commit: - Removes `envSlideOffset` in favour of directly passed function arguments - Inserts the slides into the rId order after all masters rather than after the first - Updates any other rIds in presentation.xml that need to be changed --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 194 ++++++++++++++++++--------- 1 file changed, 131 insertions(+), 63 deletions(-) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 43f94b247..d86ab32bc 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -115,7 +115,6 @@ data WriterEnv = WriterEnv { envRefArchive :: Archive -- the difference between the number at -- the end of the slide file name and -- the rId number - , envSlideIdOffset :: Int , envPlaceholder :: Placeholder , envSlideIdMap :: M.Map SlideId Int -- maps the slide number to the @@ -139,7 +138,6 @@ instance Default WriterEnv where , envInList = False , envInNoteSlide = False , envCurSlideId = 1 - , envSlideIdOffset = 1 , envPlaceholder = Placeholder ObjType 0 , envSlideIdMap = mempty , envSpeakerNotesIdMap = mempty @@ -329,10 +327,9 @@ presentationToArchiveP p@(Presentation docProps slides) = do -- we make this ourself in case there's something unexpected in the -- one in the reference doc. relsEntry <- topLevelRelsEntry - -- presentation entry and rels. We have to do the rels first to make - -- sure we know the correct offset for the rIds. - presEntry <- presentationToPresEntry p - presRelsEntry <- presentationToRelsEntry p + -- presentation entry and rels. + (presentationRIdUpdateData, presRelsEntry) <- presentationToRelsEntry p + presEntry <- presentationToPresEntry presentationRIdUpdateData p slideEntries <- mapM slideToEntry slides slideRelEntries <- mapM slideToSlideRelEntry slides spkNotesEntries <- catMaybes <$> mapM slideToSpeakerNotesEntry slides @@ -430,8 +427,8 @@ updateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels) getIdAttribute (Elem e) = findAttr (QName "id" Nothing Nothing) e getIdAttribute _ = Nothing - hush :: Either a b -> Maybe b - hush = either (const Nothing) Just +hush :: Either a b -> Maybe b +hush = either (const Nothing) Just makeSlideIdMap :: Presentation -> M.Map SlideId Int makeSlideIdMap (Presentation _ slides) = @@ -1695,11 +1692,14 @@ slideToFilePath slide = do idNum <- slideNum slide return $ "slide" <> show idNum <> ".xml" -slideToRelId :: PandocMonad m => Slide -> P m T.Text -slideToRelId slide = do +slideToRelId :: + PandocMonad m => + MinimumRId -> + Slide -> + P m T.Text +slideToRelId minSlideRId slide = do n <- slideNum slide - offset <- asks envSlideIdOffset - return $ "rId" <> tshow (n + offset) + return $ "rId" <> tshow (n + minSlideRId - 1) data Relationship = Relationship { relId :: Int @@ -1718,19 +1718,18 @@ elementToRel element return $ Relationship num type' (T.unpack target) | otherwise = Nothing -slideToPresRel :: PandocMonad m => Slide -> P m Relationship -slideToPresRel slide = do +slideToPresRel :: PandocMonad m => Int -> Slide -> P m Relationship +slideToPresRel minimumSlideRId slide = do idNum <- slideNum slide - n <- asks envSlideIdOffset - let rId = idNum + n + let rId = idNum + minimumSlideRId - 1 fp = "slides/" <> idNumToFilePath idNum return $ Relationship { relId = rId , relType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" , relTarget = fp } -getRels :: PandocMonad m => P m [Relationship] -getRels = do +getPresentationRels :: PandocMonad m => P m [Relationship] +getPresentationRels = do refArchive <- asks envRefArchive distArchive <- asks envDistArchive relsElem <- parseXml refArchive distArchive "ppt/_rels/presentation.xml.rels" @@ -1738,42 +1737,77 @@ getRels = do let relElems = findChildren (QName "Relationship" (Just globalNS) Nothing) relsElem return $ mapMaybe elementToRel relElems -presentationToRels :: PandocMonad m => Presentation -> P m [Relationship] +-- | Info required to update a presentation rId from the reference doc for the +-- output. +type PresentationRIdUpdateData = (ReferenceMinRIdAfterSlides, NewRIdBounds) + +-- | The minimum and maximum rIds for presentation relationships created from +-- the presentation content (as opposed to from the reference doc). +-- +-- Relationships taken from the reference doc should have their rId number +-- adjusted to make sure it sits outside this range. +type NewRIdBounds = (MinimumRId, MaximumRId) + +-- | The minimum presentation rId from the reference doc which comes after the +-- first slide rId (in the reference doc). +type ReferenceMinRIdAfterSlides = Int +type MinimumRId = Int +type MaximumRId = Int + +-- | Given a presentation rId from the reference doc, return the value it should +-- have in the output. +updatePresentationRId :: PresentationRIdUpdateData -> Int -> Int +updatePresentationRId (minOverlappingRId, (minNewId, maxNewId)) n + | n < minNewId = n + | otherwise = n - minOverlappingRId + maxNewId + 1 + +presentationToRels :: + PandocMonad m => + Presentation -> + P m (PresentationRIdUpdateData, [Relationship]) presentationToRels pres@(Presentation _ slides) = do - mySlideRels <- mapM slideToPresRel slides - let notesMasterRels = - [Relationship { relId = length mySlideRels + 2 - , relType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster" - , relTarget = "notesMasters/notesMaster1.xml" - } | presHasSpeakerNotes pres] - insertedRels = mySlideRels <> notesMasterRels - rels <- getRels - -- we remove the slide rels and the notesmaster (if it's - -- there). We'll put these back in ourselves, if necessary. - let relsWeKeep = filter + rels <- getPresentationRels + + -- We want to make room for the slides in the id space. We'll assume the slide + -- masters come first (this seems to be what PowerPoint does by default, and + -- is true of the reference doc), and we'll put the slides next. So we find + -- the starting rId for the slides by finding the maximum rId for the masters + -- and adding 1. + -- + -- Then: + -- 1. We look to see what the minimum rId which is greater than or equal to + -- the minimum slide rId is, in the rels we're keeping from the reference + -- doc (i.e. the minimum rId which might overlap with the slides). + -- 2. We increase this minimum overlapping rId to 1 higher than the last slide + -- rId (or the notesMaster rel, if we're including one), and increase all + -- rIds higher than this minimum by the same amount. + + let masterRels = filter (T.isSuffixOf "slideMaster" . relType) rels + slideStartId = maybe 1 ((+ 1) . maximum . fmap relId) (nonEmpty masterRels) + -- we remove the slide rels and the notesmaster (if it's + -- there). We'll put these back in ourselves, if necessary. + relsWeKeep = filter (\r -> relType r /= "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" && relType r /= "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster") rels - -- We want to make room for the slides in the id space. The slides - -- will start at Id2 (since Id1 is for the slide master). There are - -- two slides in the data file, but that might change in the future, - -- so we will do this: - -- - -- 1. We look to see what the minimum relWithoutSlide id (greater than 1) is. - -- 2. We add the difference between this and the number of slides to - -- all relWithoutSlide rels (unless they're 1) - -- 3. If we have a notesmaster slide, we make space for that as well. + minOverlappingRel = maybe 0 minimum + (nonEmpty (filter (slideStartId <=) + (relId <$> relsWeKeep))) - let minRelNotOne = maybe 0 minimum $ nonEmpty - $ filter (1 <) $ map relId relsWeKeep + mySlideRels <- mapM (slideToPresRel slideStartId) slides - modifyRelNum :: Int -> Int - modifyRelNum 1 = 1 - modifyRelNum n = n - minRelNotOne + 2 + length insertedRels + let notesMasterRels = + [Relationship { relId = slideStartId + length mySlideRels + , relType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster" + , relTarget = "notesMasters/notesMaster1.xml" + } | presHasSpeakerNotes pres] + insertedRels = mySlideRels <> notesMasterRels + newRIdBounds = (slideStartId, slideStartId + length insertedRels - 1) + updateRId = updatePresentationRId (minOverlappingRel, newRIdBounds) - relsWeKeep' = map (\r -> r{relId = modifyRelNum $ relId r}) relsWeKeep + relsWeKeep' = map (\r -> r{relId = updateRId $ relId r}) relsWeKeep - return $ insertedRels <> relsWeKeep' + return ((minOverlappingRel, newRIdBounds), insertedRels <> relsWeKeep') -- We make this ourselves, in case there's a thumbnail in the one from -- the template. @@ -1810,10 +1844,14 @@ relsToElement rels = mknode "Relationships" [("xmlns", "http://schemas.openxmlformats.org/package/2006/relationships")] (map relToElement rels) -presentationToRelsEntry :: PandocMonad m => Presentation -> P m Entry +presentationToRelsEntry :: + PandocMonad m => + Presentation -> + P m (PresentationRIdUpdateData, Entry) presentationToRelsEntry pres = do - rels <- presentationToRels pres - elemToEntry "ppt/_rels/presentation.xml.rels" $ relsToElement rels + (presentationRIdUpdateData, rels) <- presentationToRels pres + element <- elemToEntry "ppt/_rels/presentation.xml.rels" $ relsToElement rels + pure (presentationRIdUpdateData, element) elemToEntry :: PandocMonad m => FilePath -> Element -> P m Entry elemToEntry fp element = do @@ -1959,24 +1997,37 @@ slideToSlideRelElement slide = do , ("Target", target)] () ] <> speakerNotesRels <> linkRels <> mediaRels) -slideToSldIdElement :: PandocMonad m => Slide -> P m Element -slideToSldIdElement slide = do +slideToSldIdElement :: + PandocMonad m => + MinimumRId -> + Slide -> + P m Element +slideToSldIdElement minimumSlideRId slide = do n <- slideNum slide let id' = tshow $ n + 255 - rId <- slideToRelId slide + rId <- slideToRelId minimumSlideRId slide return $ mknode "p:sldId" [("id", id'), ("r:id", rId)] () -presentationToSldIdLst :: PandocMonad m => Presentation -> P m Element -presentationToSldIdLst (Presentation _ slides) = do - ids <- mapM slideToSldIdElement slides +presentationToSldIdLst :: + PandocMonad m => + MinimumRId -> + Presentation -> + P m Element +presentationToSldIdLst minimumSlideRId (Presentation _ slides) = do + ids <- mapM (slideToSldIdElement minimumSlideRId) slides return $ mknode "p:sldIdLst" [] ids -presentationToPresentationElement :: PandocMonad m => Presentation -> P m Element -presentationToPresentationElement pres@(Presentation _ slds) = do +presentationToPresentationElement :: + PandocMonad m => + PresentationRIdUpdateData -> + Presentation -> + P m Element +presentationToPresentationElement presentationUpdateRIdData pres = do + let (_, (minSlideRId, maxSlideRId)) = presentationUpdateRIdData refArchive <- asks envRefArchive distArchive <- asks envDistArchive element <- parseXml refArchive distArchive "ppt/presentation.xml" - sldIdLst <- presentationToSldIdLst pres + sldIdLst <- presentationToSldIdLst minSlideRId pres let modifySldIdLst :: Content -> Content modifySldIdLst (Elem e) = case elName e of @@ -1984,7 +2035,7 @@ presentationToPresentationElement pres@(Presentation _ slds) = do _ -> Elem e modifySldIdLst ct = ct - notesMasterRId = length slds + 2 + notesMasterRId = maxSlideRId notesMasterElem = mknode "p:notesMasterIdLst" [] [ mknode @@ -2019,16 +2070,33 @@ presentationToPresentationElement pres@(Presentation _ slds) = do then concatMap insertNotesMaster' else id + updateRIds :: Content -> Content + updateRIds (Elem el) = + Elem (el { elAttribs = fmap updateRIdAttribute (elAttribs el) + , elContent = fmap updateRIds (elContent el) + }) + updateRIds content = content + + updateRIdAttribute :: XML.Attr -> XML.Attr + updateRIdAttribute attr = fromMaybe attr $ do + (oldValue, _) <- case attrKey attr of + QName "id" _ (Just "r") -> + T.stripPrefix "rId" (attrVal attr) >>= (hush . decimal) + _ -> Nothing + let newValue = updatePresentationRId presentationUpdateRIdData oldValue + pure attr {attrVal = "rId" <> T.pack (show newValue)} + newContent = insertNotesMaster $ removeUnwantedMaster $ - map modifySldIdLst $ + (modifySldIdLst . updateRIds) <$> elContent element return $ element{elContent = newContent} -presentationToPresEntry :: PandocMonad m => Presentation -> P m Entry -presentationToPresEntry pres = presentationToPresentationElement pres >>= - elemToEntry "ppt/presentation.xml" +presentationToPresEntry :: PandocMonad m => PresentationRIdUpdateData -> Presentation -> P m Entry +presentationToPresEntry presentationRIdUpdateData pres = + presentationToPresentationElement presentationRIdUpdateData pres >>= + elemToEntry "ppt/presentation.xml" -- adapted from the Docx writer docPropsElement :: PandocMonad m => DocProps -> P m Element -- cgit v1.2.3 From 1dba1e6dc881e606beae6323e6cab74db5153bd0 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Fri, 3 Sep 2021 15:19:25 +0100 Subject: pptx: Copy embedded fonts from reference doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We already copy the relationships and elements in presentation.xml for embedded fonts, so at the moment using a reference doc with embedded fonts is broken, producing a pptx that PowerPoint says needs repairing. This commit copies the fonts over, which I believe is all that’s needed to work correctly with reference docs with embedded fonts. --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index d86ab32bc..14cd82fdf 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -242,6 +242,7 @@ alwaysInheritedPatterns = , "ppt/presProps.xml" , "ppt/tableStyles.xml" , "ppt/media/image*" + , "ppt/fonts/*" ] -- We only look for these under special conditions -- cgit v1.2.3 From 6aa1087b97466bd733e10c8e826c522e6acf874b Mon Sep 17 00:00:00 2001 From: Kolen Cheung Date: Fri, 10 Sep 2021 18:33:03 -0700 Subject: fix!: rst mime type BREAKING CHANGE: fix rst mime type according to https://docutils.sourceforge.io/FAQ.html --- src/Text/Pandoc/Readers/Ipynb.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/Ipynb.hs b/src/Text/Pandoc/Readers/Ipynb.hs index 9d46111c3..dc2c61f56 100644 --- a/src/Text/Pandoc/Readers/Ipynb.hs +++ b/src/Text/Pandoc/Readers/Ipynb.hs @@ -101,7 +101,7 @@ cellToBlocks opts lang c = do "text/latex" -> "latex" "application/pdf" -> "latex" "text/markdown" -> "markdown" - "text/x-rsrt" -> "rst" + "text/x-rst" -> "rst" _ -> format return $ B.divWith ("",["cell","raw"],kvs) $ B.rawBlock format' source Ipynb.Code{ codeOutputs = outputs, codeExecutionCount = ec } -> do -- cgit v1.2.3 From e6bf1626d2088d95827e8cce43fddd6bbd422e74 Mon Sep 17 00:00:00 2001 From: Kolen Cheung Date: Fri, 10 Sep 2021 18:33:24 -0700 Subject: feat(ipynb reader): add more Jupyter's "Raw NBConvert Format" This adds most of the available formats selectable from Jupyter's interface "Raw NBConvert Format". --- src/Text/Pandoc/Readers/Ipynb.hs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Readers/Ipynb.hs b/src/Text/Pandoc/Readers/Ipynb.hs index dc2c61f56..dbb58fbe5 100644 --- a/src/Text/Pandoc/Readers/Ipynb.hs +++ b/src/Text/Pandoc/Readers/Ipynb.hs @@ -97,12 +97,16 @@ cellToBlocks opts lang c = do let format = fromMaybe "ipynb" $ lookup "format" kvs let format' = case format of - "text/html" -> "html" - "text/latex" -> "latex" - "application/pdf" -> "latex" - "text/markdown" -> "markdown" - "text/x-rst" -> "rst" - _ -> format + "text/html" -> "html" + "slides" -> "html" + "text/latex" -> "latex" + "application/pdf" -> "latex" + "pdf" -> "latex" + "text/markdown" -> "markdown" + "text/x-rst" -> "rst" + "text/restructuredtext" -> "rst" + "text/asciidoc" -> "asciidoc" + _ -> format return $ B.divWith ("",["cell","raw"],kvs) $ B.rawBlock format' source Ipynb.Code{ codeOutputs = outputs, codeExecutionCount = ec } -> do outputBlocks <- mconcat <$> mapM outputToBlock outputs -- cgit v1.2.3 From 3483a54c72b4ebe9de0e7aea5b3168f65b24d958 Mon Sep 17 00:00:00 2001 From: Kolen Cheung Date: Fri, 10 Sep 2021 18:34:26 -0700 Subject: feat(ipynb reader): get cell output mime from raw_mimetype too While the spec defined format, in practice raw_mimetype is used. See jupyter/nbformat#229 --- src/Text/Pandoc/Readers/Ipynb.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/Ipynb.hs b/src/Text/Pandoc/Readers/Ipynb.hs index dbb58fbe5..e6de29b44 100644 --- a/src/Text/Pandoc/Readers/Ipynb.hs +++ b/src/Text/Pandoc/Readers/Ipynb.hs @@ -19,6 +19,7 @@ import Data.Char (isDigit) import Data.Maybe (fromMaybe) import Data.Digest.Pure.SHA (sha1, showDigest) import Text.Pandoc.Options +import Control.Applicative ((<|>)) import qualified Data.Scientific as Scientific import qualified Text.Pandoc.Builder as B import Text.Pandoc.Logging @@ -94,7 +95,7 @@ cellToBlocks opts lang c = do $ B.fromList bs Ipynb.Raw -> do -- we use ipynb to indicate no format given (a wildcard in nbformat) - let format = fromMaybe "ipynb" $ lookup "format" kvs + let format = fromMaybe "ipynb" $ lookup "raw_mimetype" kvs <|> lookup "format" kvs let format' = case format of "text/html" -> "html" -- cgit v1.2.3 From 17092454c5ba0e16f26b8787e6a9b9c8a35b7b67 Mon Sep 17 00:00:00 2001 From: Kolen Cheung Date: Fri, 10 Sep 2021 18:34:45 -0700 Subject: feat(ipynb writer): add more Jupyter's "Raw NBConvert Format" Adds more formats that Jupyter's "Raw NBConvert Format" uses natively (asciidoc), and maps more formats to text/html whenever it makes sense. --- src/Text/Pandoc/Writers/Ipynb.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Text/Pandoc/Writers/Ipynb.hs b/src/Text/Pandoc/Writers/Ipynb.hs index 2613851c5..3c3bdb3a5 100644 --- a/src/Text/Pandoc/Writers/Ipynb.hs +++ b/src/Text/Pandoc/Writers/Ipynb.hs @@ -138,10 +138,17 @@ extractCells opts (Div (_id,classes,kvs) xs : bs) let format' = case T.toLower f of "html" -> "text/html" + "html4" -> "text/html" + "html5" -> "text/html" + "s5" -> "text/html" + "slidy" -> "text/html" + "slideous" -> "text/html" + "dzslides" -> "text/html" "revealjs" -> "text/html" "latex" -> "text/latex" "markdown" -> "text/markdown" "rst" -> "text/x-rst" + "asciidoc" -> "text/asciidoc" _ -> f (Ipynb.Cell{ cellType = Raw -- cgit v1.2.3 From c66cedaa7137f1f731677b13e4b883be02573b9e Mon Sep 17 00:00:00 2001 From: Kolen Cheung Date: Fri, 10 Sep 2021 18:35:22 -0700 Subject: fix!(ipynb writer): improve round trip identity for raw cell output BREAKING CHANGE: The Jupyter ecosystem, including nbconvert, lab and notebook, deviated from their own spec in nbformat, where they used the key `raw_mimetype` instead of `format`. Moreover, the mime-type of rst used in Jupyter deviated from that suggested by https://docutils.sourceforge.io/FAQ.html and is defined as `text/restructuredtext` when chosen from "Raw NBConvert Format" in Jupyter. So while this is backward-compatible, it should matches the real world usage better, hence improving the round-trip "identity" in raw-cell. See #229, jupyter/nbformat#229. --- src/Text/Pandoc/Writers/Ipynb.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/Ipynb.hs b/src/Text/Pandoc/Writers/Ipynb.hs index 3c3bdb3a5..30ef100ad 100644 --- a/src/Text/Pandoc/Writers/Ipynb.hs +++ b/src/Text/Pandoc/Writers/Ipynb.hs @@ -147,7 +147,7 @@ extractCells opts (Div (_id,classes,kvs) xs : bs) "revealjs" -> "text/html" "latex" -> "text/latex" "markdown" -> "text/markdown" - "rst" -> "text/x-rst" + "rst" -> "text/restructuredtext" "asciidoc" -> "text/asciidoc" _ -> f (Ipynb.Cell{ @@ -155,7 +155,7 @@ extractCells opts (Div (_id,classes,kvs) xs : bs) , cellSource = Source $ breakLines raw , cellMetadata = if format' == "ipynb" -- means no format given then mempty - else M.insert "format" + else M.insert "raw_mimetype" (Aeson.String format') mempty , cellAttachments = Nothing } :) <$> extractCells opts bs _ -> extractCells opts bs -- cgit v1.2.3 From 84b5c55448cbbfc4b8d9433d61d46b57a1ba5876 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 10 Sep 2021 17:06:54 -0700 Subject: Use latest dev citeproc. --- cabal.project | 2 +- stack.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cabal.project b/cabal.project index 55026979e..7256c16ec 100644 --- a/cabal.project +++ b/cabal.project @@ -5,5 +5,5 @@ flags: +embed_data_files source-repository-package type: git location: https://github.com/jgm/citeproc.git - tag: 59e98e8d1e13ddb53bef9f90adbd1c64652f0173 + tag: b27201c3ac48ffd2853f77152df19b6e2cf36987 diff --git a/stack.yaml b/stack.yaml index 9b73f2bd1..e93b6b0a7 100644 --- a/stack.yaml +++ b/stack.yaml @@ -14,7 +14,7 @@ extra-deps: - doctemplates-0.10 - texmath-0.12.3.1 - git: https://github.com/jgm/citeproc.git - commit: 59e98e8d1e13ddb53bef9f90adbd1c64652f0173 + commit: b27201c3ac48ffd2853f77152df19b6e2cf36987 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.0 -- cgit v1.2.3 From d43f9cf4146400721cf8dca15a411c2ecc1342fb Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 12 Sep 2021 11:10:05 -0700 Subject: Add note to Security section that commonmark is better... than markdown as far as pathological performance goes. --- MANUAL.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MANUAL.txt b/MANUAL.txt index f0d3c8965..b65e45bfe 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -6624,7 +6624,10 @@ application, here are some things to keep in mind: a timeout, to avoid DOS attacks that exploit these issues. If you are using the pandoc executable, you can add the command line options `+RTS -M512M -RTS` (for example) to limit - the heap size to 512MB. + the heap size to 512MB. Note that the `commonmark` parser + (including `commonmark_x` and `gfm`) is much less vulnerable + to pathological performance than the `markdown` parser, so + it is a better choice when processing untrusted input. 6. The HTML generated by pandoc is not guaranteed to be safe. If `raw_html` is enabled for the Markdown input, users can -- cgit v1.2.3 From 6271b09c50444b107d8595f553700fa382718246 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 12 Sep 2021 15:30:29 -0700 Subject: Docx writer: make id used in native_numbering predictable. If the image has the id IMAGEID, then we use the id ref_IMAGEID for the figure number. Closes #7551. This allows one to create a filter that adds a figure number with figure name, e.g. Figure X For this to be possible it must be possible to predict the figure number id from the image id. If images lack an id, an id of the form `ref_fig1` is used. --- src/Text/Pandoc/Writers/Docx.hs | 9 ++++++--- test/docx/golden/image.docx | Bin 26811 -> 26816 bytes 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 78d0840a4..686a2f662 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -854,11 +854,14 @@ blockToOpenXML' opts (Plain lst) = do then withParaProp prop block else block -- title beginning with fig: indicates that the image is a figure -blockToOpenXML' opts (Para [Image attr alt (src,T.stripPrefix "fig:" -> Just tit)]) = do +blockToOpenXML' opts (Para [Image attr@(imgident,_,_) alt + (src,T.stripPrefix "fig:" -> Just tit)]) = do setFirstPara fignum <- gets stNextFigureNum unless (null alt) $ modify $ \st -> st{ stNextFigureNum = fignum + 1 } - let figid = "fig" <> tshow fignum + let refid = if T.null imgident + then "ref_fig" <> tshow fignum + else "ref_" <> imgident figname <- translateTerm Term.Figure prop <- pStyleM $ if null alt @@ -872,7 +875,7 @@ blockToOpenXML' opts (Para [Image attr alt (src,T.stripPrefix "fig:" -> Just tit $ blockToOpenXML opts $ Para $ if isEnabled Ext_native_numbering opts - then Span (figid,[],[]) + then Span (refid,[],[]) [Str (figname <> "\160"), RawInline (Format "openxml") (" Date: Wed, 8 Sep 2021 14:05:22 +0100 Subject: pptx: Fix logic for choosing Comparison layout There was a mistake in the logic used to choose between the Comparison and Two Content layouts: if one column contained only non-text (an image or a table) and the other contained only text, the Comparison layout was chosen instead of the desired Two Content layout. This commit fixes that logic: > If either column contains text followed by non-text, use Comparison. Otherwise, use Two Content. It also adds a test asserting this behaviour. --- pandoc.cabal | 6 ++++-- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 9 +++++---- test/Tests/Writers/Powerpoint.hs | 8 ++++++-- test/pptx/two-column/all-text/deleted-layouts.pptx | Bin 0 -> 30568 bytes test/pptx/two-column/all-text/input.native | 9 +++++++++ test/pptx/two-column/all-text/moved-layouts.pptx | Bin 0 -> 41256 bytes test/pptx/two-column/all-text/output.pptx | Bin 0 -> 27689 bytes test/pptx/two-column/all-text/templated.pptx | Bin 0 -> 40756 bytes test/pptx/two-column/deleted-layouts.pptx | Bin 30568 -> 0 bytes test/pptx/two-column/input.native | 9 --------- test/pptx/two-column/moved-layouts.pptx | Bin 41256 -> 0 bytes test/pptx/two-column/output.pptx | Bin 27689 -> 0 bytes test/pptx/two-column/templated.pptx | Bin 40756 -> 0 bytes .../pptx/two-column/text-and-image/deleted-layouts.pptx | Bin 0 -> 48392 bytes test/pptx/two-column/text-and-image/input.native | 12 ++++++++++++ test/pptx/two-column/text-and-image/moved-layouts.pptx | Bin 0 -> 59086 bytes test/pptx/two-column/text-and-image/output.pptx | Bin 0 -> 45520 bytes test/pptx/two-column/text-and-image/templated.pptx | Bin 0 -> 58586 bytes 18 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 test/pptx/two-column/all-text/deleted-layouts.pptx create mode 100644 test/pptx/two-column/all-text/input.native create mode 100644 test/pptx/two-column/all-text/moved-layouts.pptx create mode 100644 test/pptx/two-column/all-text/output.pptx create mode 100644 test/pptx/two-column/all-text/templated.pptx delete mode 100644 test/pptx/two-column/deleted-layouts.pptx delete mode 100644 test/pptx/two-column/input.native delete mode 100644 test/pptx/two-column/moved-layouts.pptx delete mode 100644 test/pptx/two-column/output.pptx delete mode 100644 test/pptx/two-column/templated.pptx create mode 100644 test/pptx/two-column/text-and-image/deleted-layouts.pptx create mode 100644 test/pptx/two-column/text-and-image/input.native create mode 100644 test/pptx/two-column/text-and-image/moved-layouts.pptx create mode 100644 test/pptx/two-column/text-and-image/output.pptx create mode 100644 test/pptx/two-column/text-and-image/templated.pptx diff --git a/pandoc.cabal b/pandoc.cabal index 3de7da39c..347c33d51 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -446,8 +446,10 @@ extra-source-files: test/pptx/start-numbering-at/*.pptx test/pptx/tables/input.native test/pptx/tables/*.pptx - test/pptx/two-column/input.native - test/pptx/two-column/*.pptx + test/pptx/two-column/all-text/input.native + test/pptx/two-column/all-text/*.pptx + test/pptx/two-column/text-and-image/input.native + test/pptx/two-column/text-and-image/*.pptx test/ipynb/*.in.native test/ipynb/*.out.native test/ipynb/*.ipynb diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 10060d975..015e2cbdd 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -696,10 +696,11 @@ bodyBlocksToSlide _ (blk : blks) spkNotes sldId (ComparisonSlide [] (shapesL1, shapesL2) (shapesR1, shapesR2)) spkNotes - case (break notText blksL, break notText blksR) of - ((_, []), (_, [])) -> mkTwoColumn blksL blksR - (([], _), ([], _)) -> mkTwoColumn blksL blksR - ((blksL1, blksL2), (blksR1, blksR2)) -> mkComparison blksL1 blksL2 blksR1 blksR2 + let (blksL1, blksL2) = break notText blksL + (blksR1, blksR2) = break notText blksR + if (any null [blksL1, blksL2]) && (any null [blksR1, blksR2]) + then mkTwoColumn blksL blksR + else mkComparison blksL1 blksL2 blksR1 blksR2 bodyBlocksToSlide _ (blk : blks) spkNotes = do sldId <- asks envCurSlideId inNoteSlide <- asks envInNoteSlide diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 256ee1f7f..dd3846fef 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -103,8 +103,12 @@ tests = groupPptxTests [ pptxTests "Inline formatting" "pptx/images/output.pptx" , pptxTests "two-column layout" def - "pptx/two-column/input.native" - "pptx/two-column/output.pptx" + "pptx/two-column/all-text/input.native" + "pptx/two-column/all-text/output.pptx" + , pptxTests "two-column (not comparison)" + def + "pptx/two-column/text-and-image/input.native" + "pptx/two-column/text-and-image/output.pptx" , pptxTests "speaker notes" def "pptx/speaker-notes/input.native" diff --git a/test/pptx/two-column/all-text/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx new file mode 100644 index 000000000..1d7bd87d3 Binary files /dev/null and b/test/pptx/two-column/all-text/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/input.native b/test/pptx/two-column/all-text/input.native new file mode 100644 index 000000000..086f74889 --- /dev/null +++ b/test/pptx/two-column/all-text/input.native @@ -0,0 +1,9 @@ +Pandoc (Meta {unMeta = fromList []}) +[Header 1 ("two-column-layout",[],[]) [Str "Two-Column",Space,Str "Layout"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "One",Space,Str "paragraph."] + ,Para [Str "Another",Space,Str "paragraph."]] + ,Div ("",["column"],[]) + [Para [Str "Second",Space,Str "column",Space,Str "paragraph."] + ,Para [Str "Another",Space,Str "second",Space,Str "paragraph."]]]] diff --git a/test/pptx/two-column/all-text/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx new file mode 100644 index 000000000..71760268c Binary files /dev/null and b/test/pptx/two-column/all-text/moved-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/output.pptx b/test/pptx/two-column/all-text/output.pptx new file mode 100644 index 000000000..396dc2a74 Binary files /dev/null and b/test/pptx/two-column/all-text/output.pptx differ diff --git a/test/pptx/two-column/all-text/templated.pptx b/test/pptx/two-column/all-text/templated.pptx new file mode 100644 index 000000000..8901695b1 Binary files /dev/null and b/test/pptx/two-column/all-text/templated.pptx differ diff --git a/test/pptx/two-column/deleted-layouts.pptx b/test/pptx/two-column/deleted-layouts.pptx deleted file mode 100644 index 1d7bd87d3..000000000 Binary files a/test/pptx/two-column/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/input.native b/test/pptx/two-column/input.native deleted file mode 100644 index 086f74889..000000000 --- a/test/pptx/two-column/input.native +++ /dev/null @@ -1,9 +0,0 @@ -Pandoc (Meta {unMeta = fromList []}) -[Header 1 ("two-column-layout",[],[]) [Str "Two-Column",Space,Str "Layout"] -,Div ("",["columns"],[]) - [Div ("",["column"],[]) - [Para [Str "One",Space,Str "paragraph."] - ,Para [Str "Another",Space,Str "paragraph."]] - ,Div ("",["column"],[]) - [Para [Str "Second",Space,Str "column",Space,Str "paragraph."] - ,Para [Str "Another",Space,Str "second",Space,Str "paragraph."]]]] diff --git a/test/pptx/two-column/moved-layouts.pptx b/test/pptx/two-column/moved-layouts.pptx deleted file mode 100644 index 71760268c..000000000 Binary files a/test/pptx/two-column/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/output.pptx b/test/pptx/two-column/output.pptx deleted file mode 100644 index 396dc2a74..000000000 Binary files a/test/pptx/two-column/output.pptx and /dev/null differ diff --git a/test/pptx/two-column/templated.pptx b/test/pptx/two-column/templated.pptx deleted file mode 100644 index 8901695b1..000000000 Binary files a/test/pptx/two-column/templated.pptx and /dev/null differ diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx new file mode 100644 index 000000000..297fd6bad Binary files /dev/null and b/test/pptx/two-column/text-and-image/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/input.native b/test/pptx/two-column/text-and-image/input.native new file mode 100644 index 000000000..796c2c7f4 --- /dev/null +++ b/test/pptx/two-column/text-and-image/input.native @@ -0,0 +1,12 @@ +[Header 1 ("slide-1",[],[]) [Str "Slide",Space,Str "1"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [Para [Str "This",Space,Str "should",Space,Str "use",Space,Str "Two",Space,Str "Content,",Space,Emph [Str "not"],Space,Str "Comparison!"]]] +,Header 1 ("slide-2",[],[]) [Str "Slide",Space,Str "2"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "This",Space,Str "should",Space,Str "also",Space,Str "use",Space,Str "Two",Space,Str "Content"]] + ,Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]]] diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx new file mode 100644 index 000000000..c9a6e577e Binary files /dev/null and b/test/pptx/two-column/text-and-image/moved-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx new file mode 100644 index 000000000..bfd532ed9 Binary files /dev/null and b/test/pptx/two-column/text-and-image/output.pptx differ diff --git a/test/pptx/two-column/text-and-image/templated.pptx b/test/pptx/two-column/text-and-image/templated.pptx new file mode 100644 index 000000000..23e6b283f Binary files /dev/null and b/test/pptx/two-column/text-and-image/templated.pptx differ -- cgit v1.2.3 From 7b863ba04ef6b995e15d197f81af1421e33772a5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 13 Sep 2021 22:36:09 -0700 Subject: Modernize quick-cabal Makefile target --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 47acb80dd..58dc8c9c6 100644 --- a/Makefile +++ b/Makefile @@ -25,9 +25,8 @@ quick: stack install --ghc-options='$(GHCOPTS)' --install-ghc --flag 'pandoc:embed_data_files' --fast --test --ghc-options='$(GHCOPTS)' --test-arguments='-j4 --hide-successes --ansi-tricks=false $(TESTARGS)' quick-cabal: - cabal v2-configure . --ghc-options '$(GHCOPTS)' --disable-optimization --enable-tests - cabal v2-build -j4 . --disable-optimization - cabal v2-run test-pandoc --disable-optimization -- --hide-successes --ansi-tricks=false $(TESTARGS) + cabal v2-build -j8 --ghc-options '$(GHCOPTS)' --disable-optimization --enable-tests + cabal v2-test --hide-successes --ansi-tricks=false $(TESTARGS) full-cabal: cabal v2-configure . --ghc-options '$(GHCOPTS)' --flags '+embed_data_files +trypandoc' --enable-tests --enable-benchmarks -- cgit v1.2.3 From b34dc28926c11701f61e91e6f64244b438e8f701 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 13 Sep 2021 22:36:14 -0700 Subject: Use latest dev version of texmath. --- cabal.project | 5 +++++ stack.yaml | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index 7256c16ec..7c94a74af 100644 --- a/cabal.project +++ b/cabal.project @@ -7,3 +7,8 @@ source-repository-package location: https://github.com/jgm/citeproc.git tag: b27201c3ac48ffd2853f77152df19b6e2cf36987 +source-repository-package + type: git + location: https://github.com/jgm/texmath.git + tag: 19700530733707284bb41f24add757f19ca23430 + diff --git a/stack.yaml b/stack.yaml index e93b6b0a7..90735215e 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,7 +12,8 @@ extra-deps: - skylighting-core-0.11 - skylighting-0.11 - doctemplates-0.10 -- texmath-0.12.3.1 +- git: https://github.com/jgm/texmath.git + commit: 19700530733707284bb41f24add757f19ca23430 - git: https://github.com/jgm/citeproc.git commit: b27201c3ac48ffd2853f77152df19b6e2cf36987 ghc-options: -- cgit v1.2.3 From a3162d341b2937113514b5f515cbc86141fbfcf2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 13 Sep 2021 22:57:08 -0700 Subject: RST reader: handle escaped colons in reference definitions. Cloess #7568. --- src/Text/Pandoc/Readers/RST.hs | 3 ++- test/command/7568.md | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/command/7568.md diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index ff891d3c6..458a2d48b 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -1155,10 +1155,11 @@ referenceNames = do let rn = try $ do string ".. _" ref <- quotedReferenceName - <|> manyChar ( noneOf ":\n" + <|> manyChar ( noneOf "\\:\n" <|> try (char '\n' <* string " " <* notFollowedBy blankline) + <|> try (char '\\' *> char ':') <|> try (char ':' <* lookAhead alphaNum) ) char ':' diff --git a/test/command/7568.md b/test/command/7568.md new file mode 100644 index 000000000..42f1e37b1 --- /dev/null +++ b/test/command/7568.md @@ -0,0 +1,11 @@ +``` +% pandoc -f rst +While `Labyrinth Lord: Revised Edition`_ (LLRE; PDF and POD) has been +criticized for not being a completely faithful retro-clone of the +Moldvay/Cook/Marsh Basic/Expert D&D rules (B/X), I think it still +holds a useful spot. + +.. _Labyrinth Lord\: Revised Edition: https://www.drivethrurpg.com/product/64332/Labyrinth-Lord-Revised-Edition +^D +

        While Labyrinth Lord: Revised Edition (LLRE; PDF and POD) has been criticized for not being a completely faithful retro-clone of the Moldvay/Cook/Marsh Basic/Expert D&D rules (B/X), I think it still holds a useful spot.

        +``` -- cgit v1.2.3 From 0fb6474a55427b52bf9aebd179f7b26f30c7dbaf Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Tue, 7 Sep 2021 13:38:47 +0100 Subject: pptx: Add support for incremental lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Support -i option - Support incremental/noincremental divs - Support older block quote syntax - Add tests One thing not clear from the manual is what should happen when the input uses a combination of these things. For example, what should the following produce? ```md ::: {.incremental .nonincremental} - are - these - incremental? ::: ::: incremental ::::: nonincremental - or - these? ::::: ::: ::: nonincremental > - how > - about > - these? ::: ``` In this commit I’ve taken the following approach, matching the observed behaviour for beamer and reveal.js output: - if a div with both classes, incremental wins - the innermost incremental/nonincremental div is the one which takes effect - a block quote containing a list as its first element inverts whether the list is incremental, whether or not the quote is inside an incremental/non-incremental div I’ve added some tests to verify this behaviour. This commit closes issue #5689 (https://github.com/jgm/pandoc/issues/5689). --- MANUAL.txt | 3 - pandoc.cabal | 4 + src/Text/Pandoc/Writers/Powerpoint/Output.hs | 566 +++++++++++++++------ src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 51 +- test/Tests/Writers/Powerpoint.hs | 8 + .../with-flag/deleted-layouts.pptx | Bin 0 -> 80172 bytes test/pptx/incremental-lists/with-flag/input.native | 139 +++++ .../incremental-lists/with-flag/moved-layouts.pptx | Bin 0 -> 90917 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 0 -> 77298 bytes .../incremental-lists/with-flag/templated.pptx | Bin 0 -> 90414 bytes .../without-flag/deleted-layouts.pptx | Bin 0 -> 78405 bytes .../incremental-lists/without-flag/input.native | 137 +++++ .../without-flag/moved-layouts.pptx | Bin 0 -> 89148 bytes .../incremental-lists/without-flag/output.pptx | Bin 0 -> 75533 bytes .../incremental-lists/without-flag/templated.pptx | Bin 0 -> 88645 bytes 15 files changed, 743 insertions(+), 165 deletions(-) create mode 100644 test/pptx/incremental-lists/with-flag/deleted-layouts.pptx create mode 100644 test/pptx/incremental-lists/with-flag/input.native create mode 100644 test/pptx/incremental-lists/with-flag/moved-layouts.pptx create mode 100644 test/pptx/incremental-lists/with-flag/output.pptx create mode 100644 test/pptx/incremental-lists/with-flag/templated.pptx create mode 100644 test/pptx/incremental-lists/without-flag/deleted-layouts.pptx create mode 100644 test/pptx/incremental-lists/without-flag/input.native create mode 100644 test/pptx/incremental-lists/without-flag/moved-layouts.pptx create mode 100644 test/pptx/incremental-lists/without-flag/output.pptx create mode 100644 test/pptx/incremental-lists/without-flag/templated.pptx diff --git a/MANUAL.txt b/MANUAL.txt index b65e45bfe..82fc21684 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5919,9 +5919,6 @@ option): Both methods allow incremental and nonincremental lists to be mixed in a single document. -Note: Neither the `-i/--incremental` option nor any of the -methods described here currently works for PowerPoint output. - ## Inserting pauses You can add "pauses" within a slide by including a paragraph containing diff --git a/pandoc.cabal b/pandoc.cabal index 347c33d51..6fcc384f9 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -414,6 +414,10 @@ extra-source-files: test/pptx/endnotes/*.pptx test/pptx/images/input.native test/pptx/images/*.pptx + test/pptx/incremental-lists/with-flag/input.native + test/pptx/incremental-lists/with-flag/*.pptx + test/pptx/incremental-lists/without-flag/input.native + test/pptx/incremental-lists/without-flag/*.pptx test/pptx/inline-formatting/input.native test/pptx/inline-formatting/*.pptx test/pptx/lists/input.native diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 14cd82fdf..5eadf1312 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -1,7 +1,9 @@ {-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TupleSections #-} {- | Module : Text.Pandoc.Writers.Powerpoint.Output Copyright : Copyright (C) 2017-2020 Jesse Rosenthal @@ -23,6 +25,7 @@ import Control.Monad.Reader import Control.Monad.State import Codec.Archive.Zip import Data.List (intercalate, stripPrefix, nub, union, isPrefixOf, intersperse) +import Data.Bifunctor (bimap) import Data.CaseInsensitive (CI) import qualified Data.CaseInsensitive as CI import Data.Default @@ -415,7 +418,7 @@ updateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels) maxIdNumber :: Element -> Integer maxIdNumber relationships = maximum (0 : idNumbers) where - idNumbers = fst <$> mapMaybe (hush . decimal . T.drop 3) idAttributes + idNumbers = mapMaybe (readTextAsInteger . T.drop 3) idAttributes idAttributes = mapMaybe getIdAttribute (elContent relationships) getIdAttribute (Elem e) = findAttr (QName "Id" Nothing Nothing) e getIdAttribute _ = Nothing @@ -423,14 +426,11 @@ updateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels) maxIdNumber' :: Element -> Integer maxIdNumber' sldLayouts = maximum (0 : idNumbers) where - idNumbers = fst <$> mapMaybe (hush . decimal) idAttributes + idNumbers = mapMaybe readTextAsInteger idAttributes idAttributes = mapMaybe getIdAttribute (elContent sldLayouts) getIdAttribute (Elem e) = findAttr (QName "id" Nothing Nothing) e getIdAttribute _ = Nothing -hush :: Either a b -> Maybe b -hush = either (const Nothing) Just - makeSlideIdMap :: Presentation -> M.Map SlideId Int makeSlideIdMap (Presentation _ slides) = M.fromList $ map slideId slides `zip` [1..] @@ -575,19 +575,24 @@ getLayout layout = getElement <$> getSlideLayouts BlankSlide{} -> blank shapeHasId :: NameSpaces -> T.Text -> Element -> Bool -shapeHasId ns ident element - | Just nvSpPr <- findChild (elemName ns "p" "nvSpPr") element - , Just cNvPr <- findChild (elemName ns "p" "cNvPr") nvSpPr - , Just nm <- findAttr (QName "id" Nothing Nothing) cNvPr = - nm == ident - | otherwise = False +shapeHasId ns ident element = getShapeId ns element == Just ident + +getShapeId :: NameSpaces -> Element -> Maybe Text +getShapeId ns element = do + nvSpPr <- findChild (elemName ns "p" "nvSpPr") element + cNvPr <- findChild (elemName ns "p" "cNvPr") nvSpPr + findAttr (QName "id" Nothing Nothing) cNvPr -getContentShape :: PandocMonad m => NameSpaces -> Element -> P m Element +type ShapeId = Integer + +getContentShape :: PandocMonad m => NameSpaces -> Element -> P m (Maybe ShapeId, Element) getContentShape ns spTreeElem | isElem ns "p" "spTree" spTreeElem = do - ph@Placeholder{..} <- asks envPlaceholder + ph@Placeholder{index, placeholderType} <- asks envPlaceholder case drop index (getShapesByPlaceHolderType ns spTreeElem placeholderType) of - sp : _ -> return sp + sp : _ -> let + shapeId = getShapeId ns sp >>= readTextAsInteger + in return (shapeId, sp) [] -> throwError $ PandocSomeError $ missingPlaceholderMessage ph getContentShape _ _ = throwError $ PandocSomeError "Attempted to find content on non shapeTree" @@ -651,7 +656,7 @@ getContentShapeSize ns layout master | isElem ns "p" "sldLayout" layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - sp <- getContentShape ns spTree + (_, sp) <- getContentShape ns spTree case getShapeDimensions ns sp of Just sz -> return sz Nothing -> do let mbSz = @@ -873,33 +878,35 @@ captionHeight = 40 createCaption :: PandocMonad m => ((Integer, Integer), (Integer, Integer)) -> [ParaElem] - -> P m Element + -> P m (ShapeId, Element) createCaption contentShapeDimensions paraElements = do let para = Paragraph def{pPropAlign = Just AlgnCenter} paraElements elements <- mapM paragraphToElement [para] let ((x, y), (cx, cy)) = contentShapeDimensions let txBody = mknode "p:txBody" [] $ [mknode "a:bodyPr" [] (), mknode "a:lstStyle" [] ()] <> elements - return $ - mknode "p:sp" [] [ mknode "p:nvSpPr" [] - [ mknode "p:cNvPr" [("id","1"), ("name","TextBox 3")] () - , mknode "p:cNvSpPr" [("txBox", "1")] () - , mknode "p:nvPr" [] () - ] - , mknode "p:spPr" [] - [ mknode "a:xfrm" [] - [ mknode "a:off" [("x", tshow $ 12700 * x), - ("y", tshow $ 12700 * (y + cy - captionHeight))] () - , mknode "a:ext" [("cx", tshow $ 12700 * cx), - ("cy", tshow $ 12700 * captionHeight)] () - ] - , mknode "a:prstGeom" [("prst", "rect")] - [ mknode "a:avLst" [] () - ] - , mknode "a:noFill" [] () - ] - , txBody - ] + return + ( 1 + , mknode "p:sp" [] [ mknode "p:nvSpPr" [] + [ mknode "p:cNvPr" [("id","1"), ("name","TextBox 3")] () + , mknode "p:cNvSpPr" [("txBox", "1")] () + , mknode "p:nvPr" [] () + ] + , mknode "p:spPr" [] + [ mknode "a:xfrm" [] + [ mknode "a:off" [("x", tshow $ 12700 * x), + ("y", tshow $ 12700 * (y + cy - captionHeight))] () + , mknode "a:ext" [("cx", tshow $ 12700 * cx), + ("cy", tshow $ 12700 * captionHeight)] () + ] + , mknode "a:prstGeom" [("prst", "rect")] + [ mknode "a:avLst" [] () + ] + , mknode "a:noFill" [] () + ] + , txBody + ] + ) makePicElements :: PandocMonad m => Element @@ -907,7 +914,7 @@ makePicElements :: PandocMonad m -> MediaInfo -> Text -> [ParaElem] - -> P m [Element] + -> P m [(ShapeId, Element)] makePicElements layout picProps mInfo titleText alt = do opts <- asks envOpts (pageWidth, pageHeight) <- asks envPresentationSize @@ -975,10 +982,12 @@ makePicElements layout picProps mInfo titleText alt = do let spPr = mknode "p:spPr" [("bwMode","auto")] [xfrm, prstGeom, mknode "a:noFill" [] (), ln] - let picShape = mknode "p:pic" [] - [ nvPicPr - , blipFill - , spPr ] + let picShape = ( 0 + , mknode "p:pic" [] + [ nvPicPr + , blipFill + , spPr ] + ) -- And now, maybe create the caption: if hasCaption @@ -1125,44 +1134,50 @@ paragraphToElement par = do return $ mknode "a:p" [] $ [Elem $ mknode "a:pPr" attrs props] <> concat paras -shapeToElement :: PandocMonad m => Element -> Shape -> P m Element +shapeToElement :: PandocMonad m => Element -> Shape -> P m (Maybe ShapeId, Element) shapeToElement layout (TextBox paras) | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - sp <- getContentShape ns spTree + (shapeId, sp) <- getContentShape ns spTree elements <- mapM paragraphToElement paras let txBody = mknode "p:txBody" [] $ [mknode "a:bodyPr" [] (), mknode "a:lstStyle" [] ()] <> elements emptySpPr = mknode "p:spPr" [] () return + . (shapeId,) . surroundWithMathAlternate . replaceNamedChildren ns "p" "txBody" [txBody] . replaceNamedChildren ns "p" "spPr" [emptySpPr] $ sp -- GraphicFrame and Pic should never reach this. -shapeToElement _ _ = return $ mknode "p:sp" [] () +shapeToElement _ _ = return (Nothing, mknode "p:sp" [] ()) -shapeToElements :: PandocMonad m => Element -> Shape -> P m [Content] +shapeToElements :: PandocMonad m => Element -> Shape -> P m [(Maybe ShapeId, Content)] shapeToElements layout (Pic picProps fp titleText alt) = do mInfo <- registerMedia fp alt case mInfoExt mInfo of - Just _ -> map Elem <$> + Just _ -> map (bimap Just Elem) <$> makePicElements layout picProps mInfo titleText alt Nothing -> shapeToElements layout $ TextBox [Paragraph def alt] -shapeToElements layout (GraphicFrame tbls cptn) = map Elem <$> +shapeToElements layout (GraphicFrame tbls cptn) = map (bimap Just Elem) <$> graphicFrameToElements layout tbls cptn shapeToElements _ (RawOOXMLShape str) = return - [Text (CData CDataRaw str Nothing)] + [(Nothing, Text (CData CDataRaw str Nothing))] shapeToElements layout shp = do - element <- shapeToElement layout shp - return [Elem element] + (shapeId, element) <- shapeToElement layout shp + return [(shapeId, Elem element)] -shapesToElements :: PandocMonad m => Element -> [Shape] -> P m [Content] +shapesToElements :: PandocMonad m => Element -> [Shape] -> P m [(Maybe ShapeId, Content)] shapesToElements layout shps = concat <$> mapM (shapeToElements layout) shps -graphicFrameToElements :: PandocMonad m => Element -> [Graphic] -> [ParaElem] -> P m [Element] +graphicFrameToElements :: + PandocMonad m => + Element -> + [Graphic] -> + [ParaElem] -> + P m [(ShapeId, Element)] graphicFrameToElements layout tbls caption = do -- get the sizing master <- getMaster @@ -1176,21 +1191,23 @@ graphicFrameToElements layout tbls caption = do elements <- mapM (graphicToElement cx) tbls let graphicFrameElts = - mknode "p:graphicFrame" [] $ - [ mknode "p:nvGraphicFramePr" [] - [ mknode "p:cNvPr" [("id", "6"), ("name", "Content Placeholder 5")] () - , mknode "p:cNvGraphicFramePr" [] - [mknode "a:graphicFrameLocks" [("noGrp", "1")] ()] - , mknode "p:nvPr" [] - [mknode "p:ph" [("idx", "1")] ()] - ] - , mknode "p:xfrm" [] - [ mknode "a:off" [("x", tshow $ 12700 * x), - ("y", tshow $ 12700 * y)] () - , mknode "a:ext" [("cx", tshow $ 12700 * cx), - ("cy", tshow $ 12700 * cy)] () - ] - ] <> elements + ( 6 + , mknode "p:graphicFrame" [] $ + [ mknode "p:nvGraphicFramePr" [] + [ mknode "p:cNvPr" [("id", "6"), ("name", "Content Placeholder 5")] () + , mknode "p:cNvGraphicFramePr" [] + [mknode "a:graphicFrameLocks" [("noGrp", "1")] ()] + , mknode "p:nvPr" [] + [mknode "p:ph" [("idx", "1")] ()] + ] + , mknode "p:xfrm" [] + [ mknode "a:off" [("x", tshow $ 12700 * x), + ("y", tshow $ 12700 * y)] () + , mknode "a:ext" [("cx", tshow $ 12700 * cx), + ("cy", tshow $ 12700 * cy)] () + ] + ] <> elements + ) if not $ null caption then do capElt <- createCaption ((x, y), (cx, cytmp)) caption @@ -1312,52 +1329,101 @@ getShapeByPlaceHolderTypes ns spTreeElem (s:ss) = Just element -> Just element Nothing -> getShapeByPlaceHolderTypes ns spTreeElem ss -nonBodyTextToElement :: PandocMonad m => Element -> [PHType] -> [ParaElem] -> P m Element +nonBodyTextToElement :: + PandocMonad m => + Element -> + [PHType] -> + [ParaElem] -> + P m (Maybe ShapeId, Element) nonBodyTextToElement layout phTypes paraElements | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld - , Just sp <- getShapeByPlaceHolderTypes ns spTree phTypes = do + , Just sp <- getShapeByPlaceHolderTypes ns spTree phTypes + , Just nvSpPr <- findChild (elemName ns "p" "nvSpPr") sp + , Just cNvPr <- findChild (elemName ns "p" "cNvPr") nvSpPr + , Just shapeId <- findAttr (nodename "id") cNvPr + , Right (shapeIdNum, _) <- decimal shapeId = do let hdrPara = Paragraph def paraElements element <- paragraphToElement hdrPara let txBody = mknode "p:txBody" [] $ [mknode "a:bodyPr" [] (), mknode "a:lstStyle" [] ()] <> [element] - return $ replaceNamedChildren ns "p" "txBody" [txBody] sp + return (Just shapeIdNum, replaceNamedChildren ns "p" "txBody" [txBody] sp) -- XXX: TODO - | otherwise = return $ mknode "p:sp" [] () + | otherwise = return (Nothing, mknode "p:sp" [] ()) -contentToElement :: PandocMonad m => Element -> [ParaElem] -> [Shape] -> P m Element +data ContentShapeIds = ContentShapeIds + { contentHeaderId :: Maybe ShapeId + , contentContentIds :: [ShapeId] + } + +contentToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + [Shape] -> + P m (Maybe ContentShapeIds, Element) contentToElement layout hdrShape shapes | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - element <- nonBodyTextToElement layout [PHType "title"] hdrShape + (shapeId, element) <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] - contentElements <- local + contentHeaderId = if null hdrShape then Nothing else shapeId + content <- local (\env -> env {envPlaceholder = Placeholder ObjType 0}) (shapesToElements layout shapes) - return $ buildSpTree ns spTree (hdrShapeElements <> contentElements) -contentToElement _ _ _ = return $ mknode "p:sp" [] () - -twoColumnToElement :: PandocMonad m => Element -> [ParaElem] -> [Shape] -> [Shape] -> P m Element + let contentContentIds = mapMaybe fst content + contentElements = snd <$> content + return ( Just ContentShapeIds{..} + , buildSpTree ns spTree (hdrShapeElements <> contentElements) + ) +contentToElement _ _ _ = return (Nothing, mknode "p:sp" [] ()) + +data TwoColumnShapeIds = TwoColumnShapeIds + { twoColumnHeaderId :: Maybe ShapeId + , twoColumnLeftIds :: [ShapeId] + , twoColumnRightIds :: [ShapeId] + } + +twoColumnToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + [Shape] -> + [Shape] -> + P m (Maybe TwoColumnShapeIds, Element) twoColumnToElement layout hdrShape shapesL shapesR | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - element <- nonBodyTextToElement layout [PHType "title"] hdrShape + (headerId, element) <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] - contentElementsL <- local - (\env -> env {envPlaceholder = Placeholder ObjType 0}) - (shapesToElements layout shapesL) - contentElementsR <- local - (\env -> env {envPlaceholder = Placeholder ObjType 1}) - (shapesToElements layout shapesR) + twoColumnHeaderId = if null hdrShape then Nothing else headerId + contentL <- local (\env -> env {envPlaceholder = Placeholder ObjType 0}) + (shapesToElements layout shapesL) + let twoColumnLeftIds = mapMaybe fst contentL + contentElementsL = snd <$> contentL + contentR <- local (\env -> env {envPlaceholder = Placeholder ObjType 1}) + (shapesToElements layout shapesR) + let (twoColumnRightIds) = (mapMaybe fst contentR) + contentElementsR = snd <$> contentR -- let contentElementsL' = map (setIdx ns "1") contentElementsL -- contentElementsR' = map (setIdx ns "2") contentElementsR - return $ buildSpTree ns spTree $ - hdrShapeElements <> contentElementsL <> contentElementsR -twoColumnToElement _ _ _ _= return $ mknode "p:sp" [] () + return + $ (Just TwoColumnShapeIds{..}, ) + $ buildSpTree ns spTree + $ hdrShapeElements <> contentElementsL <> contentElementsR +twoColumnToElement _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) + +data ComparisonShapeIds = ComparisonShapeIds + { comparisonHeaderId :: Maybe ShapeId + , comparisonLeftTextIds :: [ShapeId] + , comparisonLeftContentIds :: [ShapeId] + , comparisonRightTextIds :: [ShapeId] + , comparisonRightContentIds :: [ShapeId] + } comparisonToElement :: PandocMonad m => @@ -1365,33 +1431,46 @@ comparisonToElement :: [ParaElem] -> ([Shape], [Shape]) -> ([Shape], [Shape]) -> - P m Element + P m (Maybe ComparisonShapeIds, Element) comparisonToElement layout hdrShape (shapesL1, shapesL2) (shapesR1, shapesR2) | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - element <- nonBodyTextToElement layout [PHType "title"] hdrShape + (headerShapeId, element) <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] - contentElementsL1 <- local - (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) - (shapesToElements layout shapesL1) - contentElementsL2 <- local - (\env -> env {envPlaceholder = Placeholder ObjType 0}) - (shapesToElements layout shapesL2) - contentElementsR1 <- local - (\env -> env {envPlaceholder = Placeholder (PHType "body") 1}) - (shapesToElements layout shapesR1) - contentElementsR2 <- local - (\env -> env {envPlaceholder = Placeholder ObjType 1}) - (shapesToElements layout shapesR2) - return $ buildSpTree ns spTree $ - mconcat [ hdrShapeElements - , contentElementsL1 - , contentElementsL2 - , contentElementsR1 - , contentElementsR2 - ] -comparisonToElement _ _ _ _= return $ mknode "p:sp" [] () + comparisonHeaderId = if null hdrShape then Nothing else headerShapeId + contentL1 <- local (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) + (shapesToElements layout shapesL1) + let comparisonLeftTextIds = mapMaybe fst contentL1 + contentElementsL1 = snd <$> contentL1 + contentL2 <- local (\env -> env {envPlaceholder = Placeholder ObjType 0}) + (shapesToElements layout shapesL2) + let comparisonLeftContentIds = mapMaybe fst contentL2 + contentElementsL2 = snd <$> contentL2 + contentR1 <- local (\env -> env {envPlaceholder = Placeholder (PHType "body") 1}) + (shapesToElements layout shapesR1) + let comparisonRightTextIds = mapMaybe fst contentR1 + contentElementsR1 = snd <$> contentR1 + contentR2 <- local (\env -> env {envPlaceholder = Placeholder ObjType 1}) + (shapesToElements layout shapesR2) + let comparisonRightContentIds = mapMaybe fst contentR2 + contentElementsR2 = snd <$> contentR2 + return + $ (Just ComparisonShapeIds{..}, ) + $ buildSpTree ns spTree + $ mconcat [ hdrShapeElements + , contentElementsL1 + , contentElementsL2 + , contentElementsR1 + , contentElementsR2 + ] +comparisonToElement _ _ _ _= return (Nothing, mknode "p:sp" [] ()) + +data ContentWithCaptionShapeIds = ContentWithCaptionShapeIds + { contentWithCaptionHeaderId :: Maybe ShapeId + , contentWithCaptionCaptionIds :: [ShapeId] + , contentWithCaptionContentIds :: [ShapeId] + } contentWithCaptionToElement :: PandocMonad m => @@ -1399,25 +1478,30 @@ contentWithCaptionToElement :: [ParaElem] -> [Shape] -> [Shape] -> - P m Element + P m (Maybe ContentWithCaptionShapeIds, Element) contentWithCaptionToElement layout hdrShape textShapes contentShapes | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - element <- nonBodyTextToElement layout [PHType "title"] hdrShape + (shapeId, element) <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] - textElements <- local - (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) - (shapesToElements layout textShapes) - contentElements <- local - (\env -> env {envPlaceholder = Placeholder ObjType 0}) - (shapesToElements layout contentShapes) - return $ buildSpTree ns spTree $ - mconcat [ hdrShapeElements - , textElements - , contentElements - ] -contentWithCaptionToElement _ _ _ _ = return $ mknode "p:sp" [] () + contentWithCaptionHeaderId = if null hdrShape then Nothing else shapeId + text <- local (\env -> env {envPlaceholder = Placeholder (PHType "body") 0}) + (shapesToElements layout textShapes) + let contentWithCaptionCaptionIds = mapMaybe fst text + textElements = snd <$> text + content <- local (\env -> env {envPlaceholder = Placeholder ObjType 0}) + (shapesToElements layout contentShapes) + let contentWithCaptionContentIds = mapMaybe fst content + contentElements = snd <$> content + return + $ (Just ContentWithCaptionShapeIds{..}, ) + $ buildSpTree ns spTree + $ mconcat [ hdrShapeElements + , textElements + , contentElements + ] +contentWithCaptionToElement _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) blankToElement :: PandocMonad m => @@ -1430,73 +1514,116 @@ blankToElement layout return $ buildSpTree ns spTree [] blankToElement _ = return $ mknode "p:sp" [] () -titleToElement :: PandocMonad m => Element -> [ParaElem] -> P m Element +newtype TitleShapeIds = TitleShapeIds + { titleHeaderId :: Maybe ShapeId + } + +titleToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + P m (Maybe TitleShapeIds, Element) titleToElement layout titleElems | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - element <- nonBodyTextToElement layout [PHType "title", PHType "ctrTitle"] titleElems + (shapeId, element) <- nonBodyTextToElement layout [PHType "title", PHType "ctrTitle"] titleElems let titleShapeElements = [Elem element | not (null titleElems)] - return $ buildSpTree ns spTree titleShapeElements -titleToElement _ _ = return $ mknode "p:sp" [] () + titleHeaderId = if null titleElems then Nothing else shapeId + return $ (Just TitleShapeIds{..}, ) $ buildSpTree ns spTree titleShapeElements +titleToElement _ _ = return (Nothing, mknode "p:sp" [] ()) + +data MetadataShapeIds = MetadataShapeIds + { metadataTitleId :: Maybe ShapeId + , metadataSubtitleId :: Maybe ShapeId + , metadataDateId :: Maybe ShapeId + } -metadataToElement :: PandocMonad m => Element -> [ParaElem] -> [ParaElem] -> [[ParaElem]] -> [ParaElem] -> P m Element +metadataToElement :: + PandocMonad m => + Element -> + [ParaElem] -> + [ParaElem] -> + [[ParaElem]] -> + [ParaElem] -> + P m (Maybe MetadataShapeIds, Element) metadataToElement layout titleElems subtitleElems authorsElems dateElems | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - titleShapeElements <- if null titleElems - then return [] - else sequence [nonBodyTextToElement layout [PHType "ctrTitle"] titleElems] let combinedAuthorElems = intercalate [Break] authorsElems subtitleAndAuthorElems = intercalate [Break, Break] [subtitleElems, combinedAuthorElems] - subtitleShapeElements <- if null subtitleAndAuthorElems - then return [] - else sequence [nonBodyTextToElement layout [PHType "subTitle"] subtitleAndAuthorElems] - dateShapeElements <- if null dateElems - then return [] - else sequence [nonBodyTextToElement layout [PHType "dt"] dateElems] - return . buildSpTree ns spTree . map Elem $ - (titleShapeElements <> subtitleShapeElements <> dateShapeElements) -metadataToElement _ _ _ _ _ = return $ mknode "p:sp" [] () + (titleId, titleElement) <- nonBodyTextToElement layout [PHType "ctrTitle"] titleElems + (subtitleId, subtitleElement) <- nonBodyTextToElement layout [PHType "subTitle"] subtitleAndAuthorElems + (dateId, dateElement) <- nonBodyTextToElement layout [PHType "dt"] dateElems + let titleShapeElements = [titleElement | not (null titleElems)] + metadataTitleId = if null titleElems then Nothing else titleId + subtitleShapeElements = [subtitleElement | not (null subtitleAndAuthorElems)] + metadataSubtitleId = if null subtitleAndAuthorElems then Nothing else subtitleId + dateShapeElements = [dateElement | not (null dateElems)] + metadataDateId = if null dateElems then Nothing else dateId + return + $ (Just MetadataShapeIds{..}, ) + $ buildSpTree ns spTree + $ map Elem + $ titleShapeElements <> subtitleShapeElements <> dateShapeElements +metadataToElement _ _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) slideToElement :: PandocMonad m => Slide -> P m Element slideToElement (Slide _ l@(ContentSlide hdrElems shapes) _ )= do layout <- getLayout l - spTree <- local (\env -> if null hdrElems - then env - else env{envSlideHasHeader=True}) $ - contentToElement layout hdrElems shapes + (shapeIds, spTree) + <- local (\env -> if null hdrElems + then env + else env{envSlideHasHeader=True}) + (contentToElement layout hdrElems shapes) + let animations = case shapeIds of + Nothing -> [] + Just ContentShapeIds{..} -> + slideToIncrementalAnimations (zip contentContentIds shapes) return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] + ] (mknode "p:cSld" [] [spTree] : animations) slideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _) = do layout <- getLayout l - spTree <- local (\env -> if null hdrElems + (shapeIds, spTree) <- local (\env -> if null hdrElems then env else env{envSlideHasHeader=True}) $ twoColumnToElement layout hdrElems shapesL shapesR + let animations = case shapeIds of + Nothing -> [] + Just TwoColumnShapeIds{..} -> + slideToIncrementalAnimations (zip twoColumnLeftIds shapesL + <> zip twoColumnRightIds shapesR) return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] + ] (mknode "p:cSld" [] [spTree] : animations) slideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _) = do layout <- getLayout l - spTree <- local (\env -> if null hdrElems + (shapeIds, spTree) <- local (\env -> if null hdrElems then env else env{envSlideHasHeader=True}) $ comparisonToElement layout hdrElems shapesL shapesR + let animations = case shapeIds of + Nothing -> [] + Just ComparisonShapeIds{..} -> + slideToIncrementalAnimations + (zip comparisonLeftTextIds (fst shapesL) + <> zip comparisonLeftContentIds (snd shapesL) + <> zip comparisonRightTextIds (fst shapesR) + <> zip comparisonRightContentIds (snd shapesR)) return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] + ] (mknode "p:cSld" [] [spTree] : animations) slideToElement (Slide _ l@(TitleSlide hdrElems) _) = do layout <- getLayout l - spTree <- titleToElement layout hdrElems + (_, spTree) <- titleToElement layout hdrElems return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), @@ -1504,7 +1631,7 @@ slideToElement (Slide _ l@(TitleSlide hdrElems) _) = do ] [mknode "p:cSld" [] [spTree]] slideToElement (Slide _ l@(MetadataSlide titleElems subtitleElems authorElems dateElems) _) = do layout <- getLayout l - spTree <- metadataToElement layout titleElems subtitleElems authorElems dateElems + (_, spTree) <- metadataToElement layout titleElems subtitleElems authorElems dateElems return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), @@ -1512,12 +1639,18 @@ slideToElement (Slide _ l@(MetadataSlide titleElems subtitleElems authorElems da ] [mknode "p:cSld" [] [spTree]] slideToElement (Slide _ l@(ContentWithCaptionSlide hdrElems captionShapes contentShapes) _) = do layout <- getLayout l - spTree <- contentWithCaptionToElement layout hdrElems captionShapes contentShapes + (shapeIds, spTree) <- contentWithCaptionToElement layout hdrElems captionShapes contentShapes + let animations = case shapeIds of + Nothing -> [] + Just ContentWithCaptionShapeIds{..} -> + slideToIncrementalAnimations + (zip contentWithCaptionCaptionIds captionShapes + <> zip contentWithCaptionContentIds contentShapes) return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] + ] (mknode "p:cSld" [] [spTree] : animations) slideToElement (Slide _ BlankSlide _) = do layout <- getLayout BlankSlide spTree <- blankToElement layout @@ -1527,6 +1660,27 @@ slideToElement (Slide _ BlankSlide _) = do ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") ] [mknode "p:cSld" [] [spTree]] +slideToIncrementalAnimations :: + [(ShapeId, Shape)] -> + [Element] +slideToIncrementalAnimations shapes = let + incrementals :: [(ShapeId, [Bool])] + incrementals = do + (shapeId, TextBox ps) <- shapes + pure . (shapeId,) $ do + Paragraph ParaProps{pPropIncremental} _ <- ps + pure pPropIncremental + toIndices :: [Bool] -> Maybe (NonEmpty (Integer, Integer)) + toIndices bs = do + let indexed = zip [0..] bs + ts <- nonEmpty (filter snd indexed) + pure (fmap (\(n, _) -> (n, n)) ts) + indices :: [(ShapeId, NonEmpty (Integer, Integer))] + indices = do + (shapeId, bs) <- incrementals + toList ((,) shapeId <$> toIndices bs) + in toList (incrementalAnimation <$> nonEmpty indices) + -------------------------------------------------------------------- -- Notes: @@ -2080,9 +2234,10 @@ presentationToPresentationElement presentationUpdateRIdData pres = do updateRIdAttribute :: XML.Attr -> XML.Attr updateRIdAttribute attr = fromMaybe attr $ do - (oldValue, _) <- case attrKey attr of + oldValue <- case attrKey attr of QName "id" _ (Just "r") -> - T.stripPrefix "rId" (attrVal attr) >>= (hush . decimal) + T.stripPrefix "rId" (attrVal attr) + >>= fmap fromIntegral . readTextAsInteger _ -> Nothing let newValue = updatePresentationRId presentationUpdateRIdData oldValue pure attr {attrVal = "rId" <> T.pack (show newValue)} @@ -2316,3 +2471,102 @@ autoNumAttrs (startNum, numStyle, numDelim) = OneParen -> "ParenR" TwoParens -> "ParenBoth" _ -> "Period" + +-- | The XML required to insert an "appear" animation for each of the given +-- groups of paragraphs, identified by index. +incrementalAnimation :: + -- | (ShapeId, [(startParagraphIndex, endParagraphIndex)]) + NonEmpty (ShapeId, NonEmpty (Integer, Integer)) -> + Element +incrementalAnimation indices = mknode "p:timing" [] [tnLst, bldLst] + where + triples :: NonEmpty (ShapeId, Integer, Integer) + triples = do + (shapeId, paragraphIds) <- indices + (start, end) <- paragraphIds + pure (shapeId, start, end) + + tnLst = mknode "p:tnLst" [] + $ mknode "p:par" [] + $ mknode "p:cTn" [ ("id", "1") + , ("dur", "indefinite") + , ("restart", "never") + , ("nodeType", "tmRoot") + ] + $ mknode "p:childTnLst" [] + $ mknode "p:seq" [ ("concurrent", "1") + , ("nextAc", "seek") + ] + [ mknode "p:cTn" [ ("id", "2") + , ("dur", "indefinite") + , ("nodeType", "mainSeq") + ] + $ mknode "p:childTnLst" [] + $ zipWith makePar [3, 7 ..] (toList triples) + , mknode "p:prevCondLst" [] + $ mknode "p:cond" ([("evt", "onPrev"), ("delay", "0")]) + $ mknode "p:tgtEl" [] + $ mknode "p:sldTgt" [] () + , mknode "p:nextCondLst" [] + $ mknode "p:cond" ([("evt", "onNext"), ("delay", "0")]) + $ mknode "p:tgtEl" [] + $ mknode "p:sldTgt" [] () + ] + bldLst = mknode "p:bldLst" [] + [ mknode "p:bldP" [ ("spid", T.pack (show shapeId)) + , ("grpId", "0") + , ("uiExpand", "1") + , ("build", "p") + ] + () | (shapeId, _) <- toList indices + ] + + makePar :: Integer -> (ShapeId, Integer, Integer) -> Element + makePar nextId (shapeId, start, end) = + mknode "p:par" [] + $ mknode "p:cTn" [("id", T.pack (show nextId)), ("fill", "hold")] + [ mknode "p:stCondLst" [] + $ mknode "p:cond" [("delay", "indefinite")] () + , mknode "p:childTnLst" [] + $ mknode "p:par" [] + $ mknode "p:cTn" [ ("id", T.pack (show (nextId + 1))) + , ("fill", "hold") + ] + [ mknode "p:stCondLst" [] + $ mknode "p:cond" [("delay", "0")] () + , mknode "p:childTnLst" [] + $ mknode "p:par" [] + $ mknode "p:cTn" [ ("id", T.pack (show (nextId + 2))) + , ("presetID", "1") + , ("presetClass", "entr") + , ("presetSubtype", "0") + , ("fill", "hold") + , ("grpId", "0") + , ("nodeType", "clickEffect") + ] + [ mknode "p:stCondLst" [] + $ mknode "p:cond" [("delay", "0")] () + , mknode "p:childTnLst" [] + $ mknode "p:set" [] + [ mknode "p:cBhvr" [] + [ mknode "p:cTn" [ ("id", T.pack (show (nextId + 3))) + , ("dur", "1") + , ("fill", "hold") + ] + $ mknode "p:stCondLst" [] + $ mknode "p:cond" [("delay", "0")] () + , mknode "p:tgtEl" [] + $ mknode "p:spTgt" [("spid", T.pack (show shapeId))] + $ mknode "p:txEl" [] + $ mknode "p:pRg" [ ("st", T.pack (show start)) + , ("end", T.pack (show end))] + () + , mknode "p:attrNameLst" [] + $ mknode "p:attrName" [] ("style.visibility" :: Text) + ] + , mknode "p:to" [] + $ mknode "p:strVal" [("val", "visible")] () + ] + ] + ] + ] diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 015e2cbdd..a7660fc5e 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -1,8 +1,9 @@ +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE ViewPatterns #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE LambdaCase #-} {- | Module : Text.Pandoc.Writers.Powerpoint.Presentation Copyright : Copyright (C) 2017-2020 Jesse Rosenthal @@ -80,6 +81,8 @@ data WriterEnv = WriterEnv { envMetadata :: Meta , envInNoteSlide :: Bool , envCurSlideId :: SlideId , envInSpeakerNotes :: Bool + , envInIncrementalDiv :: Maybe InIncrementalDiv + , envInListInBlockQuote :: Bool } deriving (Show) @@ -94,6 +97,8 @@ instance Default WriterEnv where , envInNoteSlide = False , envCurSlideId = SlideId "Default" , envInSpeakerNotes = False + , envInIncrementalDiv = Nothing + , envInListInBlockQuote = False } @@ -114,6 +119,23 @@ instance Default WriterState where , stSpeakerNotes = mempty } +data InIncrementalDiv + = InIncremental + -- ^ The current content is contained within an "incremental" div. + | InNonIncremental + -- ^ The current content is contained within a "nonincremental" div. + deriving (Show) + +listShouldBeIncremental :: Pres Bool +listShouldBeIncremental = do + incrementalOption <- asks (writerIncremental . envOpts) + inIncrementalDiv <- asks envInIncrementalDiv + inBlockQuote <- asks envInListInBlockQuote + let toBoolean = (\case InIncremental -> True + InNonIncremental -> False) + maybeInvert = if inBlockQuote then not else id + pure (maybeInvert (maybe incrementalOption toBoolean inIncrementalDiv)) + metadataSlideId :: SlideId metadataSlideId = SlideId "Metadata" @@ -227,7 +249,7 @@ data Graphic = Tbl TableProps [TableCell] [[TableCell]] data Paragraph = Paragraph { paraProps :: ParaProps - , paraElems :: [ParaElem] + , paraElems :: [ParaElem] } deriving (Show, Eq) data BulletType = Bullet @@ -244,6 +266,7 @@ data ParaProps = ParaProps { pPropMarginLeft :: Maybe Pixels , pPropAlign :: Maybe Algnment , pPropSpaceBefore :: Maybe Pixels , pPropIndent :: Maybe Pixels + , pPropIncremental :: Bool } deriving (Show, Eq) instance Default ParaProps where @@ -254,6 +277,7 @@ instance Default ParaProps where , pPropAlign = Nothing , pPropSpaceBefore = Nothing , pPropIndent = Just 0 + , pPropIncremental = False } newtype TeXString = TeXString {unTeXString :: T.Text} @@ -449,7 +473,8 @@ blockToParagraphs (CodeBlock attr str) = do -- (BlockQuote List) as a list to maintain compatibility with other -- formats. blockToParagraphs (BlockQuote (blk : blks)) | isListType blk = do - ps <- blockToParagraphs blk + ps <- local (\env -> env { envInListInBlockQuote = True }) + (blockToParagraphs blk) ps' <- blockToParagraphs $ BlockQuote blks return $ ps ++ ps' blockToParagraphs (BlockQuote blks) = @@ -474,25 +499,30 @@ blockToParagraphs (Header _ (ident, _, _) ils) = do return [Paragraph def{pPropSpaceBefore = Just 30} parElems] blockToParagraphs (BulletList blksLst) = do pProps <- asks envParaProps + incremental <- listShouldBeIncremental let lvl = pPropLevel pProps local (\env -> env{ envInList = True , envParaProps = pProps{ pPropLevel = lvl + 1 , pPropBullet = Just Bullet , pPropMarginLeft = Nothing , pPropIndent = Nothing + , pPropIncremental = incremental }}) $ concatMapM multiParBullet blksLst blockToParagraphs (OrderedList listAttr blksLst) = do pProps <- asks envParaProps + incremental <- listShouldBeIncremental let lvl = pPropLevel pProps local (\env -> env{ envInList = True , envParaProps = pProps{ pPropLevel = lvl + 1 , pPropBullet = Just (AutoNumbering listAttr) , pPropMarginLeft = Nothing , pPropIndent = Nothing + , pPropIncremental = incremental }}) $ concatMapM multiParBullet blksLst blockToParagraphs (DefinitionList entries) = do + incremental <- listShouldBeIncremental let go :: ([Inline], [[Block]]) -> Pres [Paragraph] go (ils, blksLst) = do term <-blockToParagraphs $ Para [Strong ils] @@ -500,8 +530,17 @@ blockToParagraphs (DefinitionList entries) = do -- blockquote. We can extend this further later. definition <- concatMapM (blockToParagraphs . BlockQuote) blksLst return $ term ++ definition - concatMapM go entries -blockToParagraphs (Div _ blks) = concatMapM blockToParagraphs blks + local (\env -> env {envParaProps = + (envParaProps env) {pPropIncremental = incremental}}) + $ concatMapM go entries +blockToParagraphs (Div (_, classes, _) blks) = let + hasIncremental = "incremental" `elem` classes + hasNonIncremental = "nonincremental" `elem` classes + incremental = if | hasIncremental -> Just InIncremental + | hasNonIncremental -> Just InNonIncremental + | otherwise -> Nothing + addIncremental env = env { envInIncrementalDiv = incremental } + in local addIncremental (concatMapM blockToParagraphs blks) blockToParagraphs blk = do addLogMessage $ BlockNotRendered blk return [] diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index dd3846fef..6eb8c7f67 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -232,4 +232,12 @@ tests = groupPptxTests [ pptxTests "Inline formatting" def "pptx/blanks/nbsp-in-heading/input.native" "pptx/blanks/nbsp-in-heading/output.pptx" + , pptxTests ("Incremental lists are supported") + def { writerIncremental = True } + "pptx/incremental-lists/with-flag/input.native" + "pptx/incremental-lists/with-flag/output.pptx" + , pptxTests ("One-off incremental lists are supported") + def + "pptx/incremental-lists/without-flag/input.native" + "pptx/incremental-lists/without-flag/output.pptx" ] diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx new file mode 100644 index 000000000..5a74826a4 Binary files /dev/null and b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/input.native b/test/pptx/incremental-lists/with-flag/input.native new file mode 100644 index 000000000..b690794dc --- /dev/null +++ b/test/pptx/incremental-lists/with-flag/input.native @@ -0,0 +1,139 @@ +[Header 1 ("slide-1-content",[],[]) [Str "Slide",Space,Str "1",Space,Str "(Content)"] +,BulletList + [[Plain [Str "These"]] + ,[Plain [Str "bullets"]] + ,[Plain [Str "should"]] + ,[Plain [Str "be"]] + ,[Plain [Str "incremental"]]] +,Header 1 ("slide-2-content",[],[]) [Str "Slide",Space,Str "2",Space,Str "(Content)"] +,BulletList + [[Para [Str "as"]] + ,[Para [Str "should"]] + ,[Para [Str "these"]]] +,Header 1 ("slide-3-content",[],[]) [Str "Slide",Space,Str "3",Space,Str "(Content)"] +,Para [Str "Even",Space,Str "with",Space,Str "some",Space,Str "text",Space,Str "first,",Space,Str "these",Space,Str "should:"] +,BulletList + [[Plain [Str "also"]] + ,[Plain [Str "be"]] + ,[Plain [Str "incremental"]]] +,Header 1 ("slide-4-content",[],[]) [Str "Slide",Space,Str "4",Space,Str "(Content)"] +,OrderedList (1,Decimal,Period) + [[Plain [Str "These"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]]] +,Para [Str "But",Space,Str "this",Space,Str "text",Space,Str "isn\8217t"] +,BulletList + [[Plain [Str "But"]] + ,[Plain [Str "these"]] + ,[Plain [Str "are"]]] +,Header 1 ("slide-5-two-content",[],[]) [Str "Slide",Space,Str "5",Space,Str "(Two",Space,Str "Content)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "left:"] + ,BulletList + [[Plain [Str "one"]] + ,[Plain [Str "by"]] + ,[Plain [Str "one"]]] + ,Para [Str "With",Space,Str "something",Space,Str "below"]] + ,Div ("",["column"],[]) + [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "right:"] + ,BulletList + [[Plain [Str "one"]] + ,[Plain [Str "by"]] + ,[Plain [Str "one"]]] + ,Para [Str "With",Space,Str "something",Space,Str "else",Space,Str "below"]]] +,Header 1 ("slide-6-two-content-right",[],[]) [Str "Slide",Space,Str "6",Space,Str "(Two",Space,Str "Content",Space,Str "Right)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [BulletList + [[Plain [Str "An"]] + ,[Plain [Str "Incremental"]] + ,[Plain [Str "List"]]]]] +,Header 1 ("slide-7-content-with-caption",[],[]) [Str "Slide",Space,Str "7",Space,Str "(Content",Space,Str "with",Space,Str "Caption)"] +,Para [Str "First,",Space,Str "we",Space,Str "have",Space,Str "some",Space,Str "incremental",Space,Str "bullets:"] +,BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]] +,Para [Str "Then,",Space,Str "a",Space,Str "picture:"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")] +,Header 1 ("slide-8-comparison",[],[]) [Str "Slide",Space,Str "8",Space,Str "(Comparison)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]] + ,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [OrderedList (1,Decimal,Period) + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "2"]]]])] + (TableFoot ("",[],[]) + [])]] +,Header 1 ("slide-9-content",[],[]) [Str "Slide",Space,Str "9",Space,Str "(Content)"] +,Div ("",["nonincremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "not"]] + ,[Plain [Str "incremental"]]]] +,BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]]] +,Header 1 ("slide-10-content",[],[]) [Str "Slide",Space,Str "10",Space,Str "(Content)"] +,Div ("",["incremental","nonincremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]] + ,[Plain [Str "(the",Space,Str "incremental",Space,Str "class",Space,Str "wins)"]]]] +,Header 1 ("slide-11-content",[],[]) [Str "Slide",Space,Str "11",Space,Str "(Content)"] +,Para [Str "These",Space,Str "bullets",Space,Str "are",Space,Str "not",Space,Str "incremental:"] +,BlockQuote + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]] +,Para [Str "These",Space,Str "are:"] +,Div ("",["nonincremental"],[]) + [BlockQuote + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]]] +,Para [Str "These",Space,Str "are",Space,Str "not:"] +,BlockQuote + [Div ("",["nonincremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]]] +,Header 1 ("slide-12-content",[],[]) [Str "Slide",Space,Str "12",Space,Str "(Content)"] +,Div ("",["nonincremental"],[]) + [Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]]]]] +,Div ("",["incremental"],[]) + [Div ("",["nonincremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "not"]]]]]] diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx new file mode 100644 index 000000000..f20dd2906 Binary files /dev/null and b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx new file mode 100644 index 000000000..d4f76f1e7 Binary files /dev/null and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx new file mode 100644 index 000000000..f5ee2ff5f Binary files /dev/null and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx new file mode 100644 index 000000000..16bd85ffd Binary files /dev/null and b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/input.native b/test/pptx/incremental-lists/without-flag/input.native new file mode 100644 index 000000000..87a4aea7e --- /dev/null +++ b/test/pptx/incremental-lists/without-flag/input.native @@ -0,0 +1,137 @@ +[Header 1 ("slide-1-content",[],[]) [Str "Slide",Space,Str "1",Space,Str "(Content)"] +,Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "These"]] + ,[Plain [Str "bullets"]] + ,[Plain [Str "should"]] + ,[Plain [Str "be"]] + ,[Plain [Str "incremental"]]]] +,Header 1 ("slide-2-content",[],[]) [Str "Slide",Space,Str "2",Space,Str "(Content)"] +,BulletList + [[Plain [Str "These"]] + ,[Plain [Str "are"]] + ,[Plain [Str "not"]]] +,Header 1 ("slide-3-content",[],[]) [Str "Slide",Space,Str "3",Space,Str "(Content)"] +,Para [Str "Even",Space,Str "with",Space,Str "some",Space,Str "text",Space,Str "first,",Space,Str "these",Space,Str "should:"] +,Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "also"]] + ,[Plain [Str "be"]] + ,[Plain [Str "incremental"]]]] +,Header 1 ("slide-4-content",[],[]) [Str "Slide",Space,Str "4",Space,Str "(Content)"] +,Div ("",["incremental"],[]) + [OrderedList (1,Decimal,Period) + [[Plain [Str "These"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]]]] +,Para [Str "But",Space,Str "this",Space,Str "text",Space,Str "isn\8217t"] +,Header 1 ("slide-5-two-content",[],[]) [Str "Slide",Space,Str "5",Space,Str "(Two",Space,Str "Content)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "left:"] + ,Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "by"]] + ,[Plain [Str "one"]]]] + ,Para [Str "With",Space,Str "something",Space,Str "below"]] + ,Div ("",["column"],[]) + [Para [Str "Incremental",Space,Str "on",Space,Str "the",Space,Str "right:"] + ,Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "by"]] + ,[Plain [Str "one"]]]] + ,BulletList + [[Plain [Str "already"]] + ,[Plain [Str "here"]] + ,[Plain [Str "though"]]]]] +,Header 1 ("slide-6-two-content-right",[],[]) [Str "Slide",Space,Str "6",Space,Str "(Two",Space,Str "Content",Space,Str "Right)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "An"]] + ,[Plain [Str "Incremental"]] + ,[Plain [Str "List"]]]]]] +,Header 1 ("slide-7-content-with-caption",[],[]) [Str "Slide",Space,Str "7",Space,Str "(Content",Space,Str "with",Space,Str "Caption)"] +,Para [Str "First,",Space,Str "we",Space,Str "have",Space,Str "some",Space,Str "incremental",Space,Str "bullets:"] +,Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]] +,Para [Str "Then,",Space,Str "a",Space,Str "picture:"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")] +,Header 1 ("slide-8-comparison",[],[]) [Str "Slide",Space,Str "8",Space,Str "(Comparison)"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]] + ,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("./lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [Div ("",["incremental"],[]) + [OrderedList (1,Decimal,Period) + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "2"]]]])] + (TableFoot ("",[],[]) + [])]] +,Header 1 ("slide-10-content",[],[]) [Str "Slide",Space,Str "10",Space,Str "(Content)"] +,Div ("",["incremental","nonincremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]] + ,[Plain [Str "(the",Space,Str "incremental",Space,Str "class",Space,Str "wins)"]]]] +,Header 1 ("slide-11-content",[],[]) [Str "Slide",Space,Str "11",Space,Str "(Content)"] +,Para [Str "These",Space,Str "bullets",Space,Str "are",Space,Str "incremental:"] +,BlockQuote + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]] +,Para [Str "These",Space,Str "are",Space,Str "not:"] +,Div ("",["incremental"],[]) + [BlockQuote + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]]] +,Para [Str "These",Space,Str "are:"] +,BlockQuote + [Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "one"]] + ,[Plain [Str "two"]] + ,[Plain [Str "three"]]]]] +,Header 1 ("slide-12-content",[],[]) [Str "Slide",Space,Str "12",Space,Str "(Content)"] +,Div ("",["nonincremental"],[]) + [Div ("",["incremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "incremental"]]]]] +,Div ("",["incremental"],[]) + [Div ("",["nonincremental"],[]) + [BulletList + [[Plain [Str "these"]] + ,[Plain [Str "are"]] + ,[Plain [Str "not"]]]]]] diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx new file mode 100644 index 000000000..054fe918e Binary files /dev/null and b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx new file mode 100644 index 000000000..1b326461d Binary files /dev/null and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx new file mode 100644 index 000000000..dee6e9b06 Binary files /dev/null and b/test/pptx/incremental-lists/without-flag/templated.pptx differ -- cgit v1.2.3 From 71b82396a276899e0fc28bb26f213a038050fb9a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 16 Sep 2021 19:19:38 -0700 Subject: Fix quick-cabal target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 58dc8c9c6..2560994e4 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ quick: quick-cabal: cabal v2-build -j8 --ghc-options '$(GHCOPTS)' --disable-optimization --enable-tests - cabal v2-test --hide-successes --ansi-tricks=false $(TESTARGS) + cabal v2-test --test-option=--hide-successes --test-option=--ansi-tricks=false $(TESTARGS) full-cabal: cabal v2-configure . --ghc-options '$(GHCOPTS)' --flags '+embed_data_files +trypandoc' --enable-tests --enable-benchmarks -- cgit v1.2.3 From d2449ad92642a5ba380979192029600a4f3e4424 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 16 Sep 2021 19:27:34 -0700 Subject: HTML writer: set "hash" to True by default (for reveal.js). Closes #7574. See #6968 where the motivation for setting "hash" to True is explained. --- src/Text/Pandoc/Writers/HTML.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index c96d4622a..3592bd2d4 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -367,7 +367,7 @@ pandocToHtml opts (Pandoc meta blocks) = do defField "slideNumber" False . defField "showSlideNumber" ("all" :: Text) . defField "hashOneBasedIndex" False . - defField "hash" False . + defField "hash" True . defField "respondToHashChanges" True . defField "history" False . defField "keyboard" True . -- cgit v1.2.3 From c6cd92a0a34603c949b115f041fb30b1806b200e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 16 Sep 2021 19:28:38 -0700 Subject: stack.yaml: use lts-18.10 resolver. --- stack.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stack.yaml b/stack.yaml index 90735215e..75e01ee8b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -7,8 +7,6 @@ flags: packages: - '.' extra-deps: -- commonmark-0.2.1 -- commonmark-pandoc-0.2.1.1 - skylighting-core-0.11 - skylighting-0.11 - doctemplates-0.10 @@ -18,7 +16,7 @@ extra-deps: commit: b27201c3ac48ffd2853f77152df19b6e2cf36987 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules -resolver: lts-18.0 +resolver: lts-18.10 nix: packages: [zlib] -- cgit v1.2.3 From 7c22c0202e8ed706d33f301e65f0aa1a847b4ec4 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Mon, 13 Sep 2021 18:16:19 +0100 Subject: pptx: Support specifying slide background images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the reveal-js output, it’s possible to use reveal’s `data-background-image` class on a slide’s title to specify a background image for the slide. With this commit, it’s possible to use `background-image` in the same way for pptx output. Only the “stretch” mode is supported, and the background image is centred around the slide in the image’s larger axis, matching the observed default behaviour of PowerPoint. - Support `background-image` per slide. - Add tests. - Update manual. --- MANUAL.txt | 69 +++++++----- pandoc.cabal | 2 + src/Text/Pandoc/Writers/Powerpoint/Output.hs | 117 ++++++++++++++++----- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 29 +++-- test/Tests/Writers/Powerpoint.hs | 4 + test/pptx/background-image/deleted-layouts.pptx | Bin 0 -> 56282 bytes test/pptx/background-image/input.native | 17 +++ test/pptx/background-image/moved-layouts.pptx | Bin 0 -> 66987 bytes test/pptx/background-image/output.pptx | Bin 0 -> 53408 bytes test/pptx/background-image/templated.pptx | Bin 0 -> 66487 bytes 10 files changed, 178 insertions(+), 60 deletions(-) create mode 100644 test/pptx/background-image/deleted-layouts.pptx create mode 100644 test/pptx/background-image/input.native create mode 100644 test/pptx/background-image/moved-layouts.pptx create mode 100644 test/pptx/background-image/output.pptx create mode 100644 test/pptx/background-image/templated.pptx diff --git a/MANUAL.txt b/MANUAL.txt index 82fc21684..98a2f4299 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -6054,40 +6054,61 @@ the [Beamer User's Guide] may also be used: `allowdisplaybreaks`, `allowframebreaks`, `b`, `c`, `t`, `environment`, `label`, `plain`, `shrink`, `standout`, `noframenumbering`. -## Background in reveal.js and beamer +## Background in reveal.js, beamer, and pptx -Background images can be added to self-contained reveal.js slide shows and -to beamer slide shows. +Background images can be added to self-contained reveal.js slide shows, +beamer slide shows, and pptx slide shows. -For the same image on every slide, use the configuration -option `background-image` either in the YAML metadata block -or as a command-line variable. (There are no other options in -beamer and the rest of this section concerns reveal.js slide shows.) +### On all slides (beamer, reveal.js, pptx) -For reveal.js, you can instead use the reveal.js-native option -`parallaxBackgroundImage`. You can also set `parallaxBackgroundHorizontal` -and `parallaxBackgroundVertical` the same way and must also set -`parallaxBackgroundSize` to have your values take effect. +With beamer and reveal.js, the configuration option `background-image` can be +used either in the YAML metadata block or as a command-line variable to get the +same image on every slide. -To set an image for a particular reveal.js slide, add -`{data-background-image="/path/to/image"}` -to the first slide-level heading on the slide (which may even be empty). +For pptx, you can use a [reference doc](#option--reference-doc) in which +background images have been set on the [relevant +layouts](#powerpoint-layout-choice). + +#### `parallaxBackgroundImage` (reveal.js) + +For reveal.js, there is also the reveal.js-native option +`parallaxBackgroundImage`, which can be used instead of `background-image` to +produce a parallax scrolling background. You must also set +`parallaxBackgroundSize`, and can optionally set `parallaxBackgroundHorizontal` +and `parallaxBackgroundVertical` to configure the scrolling behaviour. See the +[reveal.js documentation](https://revealjs.com/backgrounds/#parallax-background) +for more details about the meaning of these options. In reveal.js's overview mode, the parallaxBackgroundImage will show up only on the first slide. -Other reveal.js background settings also work on individual slides, including -`data-background-size`, `data-background-repeat`, `data-background-color`, -`data-transition`, and `data-transition-speed`. +### On individual slides (reveal.js, pptx) + +To set an image for a particular reveal.js or pptx slide, add +`{background-image="/path/to/image"}` to the first slide-level heading on the +slide (which may even be empty). + +As the [HTML writers pass unknown attributes +through](#extension-link_attributes), other reveal.js background settings also +work on individual slides, including `background-size`, `background-repeat`, +`background-color`, `transition`, and `transition-speed`. (The `data-` prefix +will automatically be added.) + +Note: `data-background-image` is also supported in pptx for consistency with +reveal.js – if `background-image` isn’t found, `data-background-image` will be +checked. + +### On the title slide (reveal.js, pptx) -To add a background image to the automatically generated title slide, use the -`title-slide-attributes` variable in the YAML metadata block. It must contain -a map of attribute names and values. +To add a background image to the automatically generated title slide for +reveal.js, use the `title-slide-attributes` variable in the YAML metadata block. +It must contain a map of attribute names and values. (Note that the `data-` +prefix is required here, as it isn’t added automatically.) -See the [reveal.js documentation](https://revealjs.com/backgrounds/) for more -details. +For pptx, pass a [reference doc](#option--reference-doc) with the background +image set on the “Title Slide” layout. -For example in reveal.js: +### Example (reveal.js) ``` --- @@ -6102,7 +6123,7 @@ title-slide-attributes: Slide 1 has background_image.png as its background. -## {data-background-image="/path/to/special_image.jpg"} +## {background-image="/path/to/special_image.jpg"} Slide 2 has a special image for its background, even though the heading has no content. ``` diff --git a/pandoc.cabal b/pandoc.cabal index 6fcc384f9..0c8cf0d61 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -380,6 +380,8 @@ extra-source-files: test/rtf/*.native test/rtf/*.rtf test/pptx/*.pptx + test/pptx/background-image/input.native + test/pptx/background-image/*.pptx test/pptx/blanks/just-speaker-notes/input.native test/pptx/blanks/just-speaker-notes/*.pptx test/pptx/blanks/nbsp-in-body/input.native diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 5eadf1312..1431469d3 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -31,6 +31,7 @@ import qualified Data.CaseInsensitive as CI import Data.Default import Data.Foldable (toList) import Data.List.NonEmpty (nonEmpty, NonEmpty ((:|))) +import Data.Ratio ((%), Ratio) import Data.Text (Text) import qualified Data.Text as T import Data.Text.Read (decimal) @@ -439,9 +440,9 @@ makeSpeakerNotesMap :: Presentation -> M.Map Int Int makeSpeakerNotesMap (Presentation _ slides) = M.fromList $ mapMaybe f (slides `zip` [1..]) `zip` [1..] - where f (Slide _ _ notes, n) = if notes == mempty - then Nothing - else Just n + where f (Slide _ _ notes _, n) = if notes == mempty + then Nothing + else Just n presentationToArchive :: PandocMonad m => WriterOptions -> Meta -> Presentation -> m Archive @@ -1570,8 +1571,9 @@ metadataToElement layout titleElems subtitleElems authorsElems dateElems metadataToElement _ _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) slideToElement :: PandocMonad m => Slide -> P m Element -slideToElement (Slide _ l@(ContentSlide hdrElems shapes) _ )= do +slideToElement (Slide _ l@(ContentSlide hdrElems shapes) _ backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (shapeIds, spTree) <- local (\env -> if null hdrElems then env @@ -1585,9 +1587,10 @@ slideToElement (Slide _ l@(ContentSlide hdrElems shapes) _ )= do [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] (mknode "p:cSld" [] [spTree] : animations) -slideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _) = do + ] (mknode "p:cSld" [] (toList backgroundImageElement <> [spTree]) : animations) +slideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _ backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (shapeIds, spTree) <- local (\env -> if null hdrElems then env else env{envSlideHasHeader=True}) $ @@ -1601,9 +1604,10 @@ slideToElement (Slide _ l@(TwoColumnSlide hdrElems shapesL shapesR) _) = do [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] (mknode "p:cSld" [] [spTree] : animations) -slideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _) = do + ] (mknode "p:cSld" [] (toList backgroundImageElement <> [spTree]) : animations) +slideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _ backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (shapeIds, spTree) <- local (\env -> if null hdrElems then env else env{envSlideHasHeader=True}) $ @@ -1620,25 +1624,36 @@ slideToElement (Slide _ l@(ComparisonSlide hdrElems shapesL shapesR) _) = do [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] (mknode "p:cSld" [] [spTree] : animations) -slideToElement (Slide _ l@(TitleSlide hdrElems) _) = do + ] (mknode "p:cSld" [] (toList backgroundImageElement <> [spTree]) : animations) +slideToElement (Slide _ l@(TitleSlide hdrElems) _ backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (_, spTree) <- titleToElement layout hdrElems return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] -slideToElement (Slide _ l@(MetadataSlide titleElems subtitleElems authorElems dateElems) _) = do + ] [mknode "p:cSld" [] (toList backgroundImageElement <> [spTree])] +slideToElement (Slide + _ + l@(MetadataSlide titleElems subtitleElems authorElems dateElems) + _ + backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (_, spTree) <- metadataToElement layout titleElems subtitleElems authorElems dateElems return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] -slideToElement (Slide _ l@(ContentWithCaptionSlide hdrElems captionShapes contentShapes) _) = do + ] [mknode "p:cSld" [] (toList backgroundImageElement <> [spTree])] +slideToElement (Slide + _ + l@(ContentWithCaptionSlide hdrElems captionShapes contentShapes) + _ + backgroundImage) = do layout <- getLayout l + backgroundImageElement <- traverse backgroundImageToElement backgroundImage (shapeIds, spTree) <- contentWithCaptionToElement layout hdrElems captionShapes contentShapes let animations = case shapeIds of Nothing -> [] @@ -1650,15 +1665,63 @@ slideToElement (Slide _ l@(ContentWithCaptionSlide hdrElems captionShapes conten [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] (mknode "p:cSld" [] [spTree] : animations) -slideToElement (Slide _ BlankSlide _) = do + ] (mknode "p:cSld" [] (toList backgroundImageElement <> [spTree]) : animations) +slideToElement (Slide _ BlankSlide _ backgroundImage) = do layout <- getLayout BlankSlide + backgroundImageElement <- traverse backgroundImageToElement backgroundImage spTree <- blankToElement layout return $ mknode "p:sld" [ ("xmlns:a", "http://schemas.openxmlformats.org/drawingml/2006/main"), ("xmlns:r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"), ("xmlns:p", "http://schemas.openxmlformats.org/presentationml/2006/main") - ] [mknode "p:cSld" [] [spTree]] + ] [mknode "p:cSld" [] (toList backgroundImageElement <> [spTree])] + +backgroundImageToElement :: PandocMonad m => FilePath -> P m Element +backgroundImageToElement path = do + MediaInfo{mInfoLocalId, mInfoFilePath} <- registerMedia path [] + (imgBytes, _) <- P.fetchItem (T.pack mInfoFilePath) + opts <- asks envOpts + let imageDimensions = either (const Nothing) + (Just . sizeInPixels) + (imageSize opts imgBytes) + pageSize <- asks envPresentationSize + let fillRectAttributes = maybe [] (offsetAttributes pageSize) imageDimensions + let rId = "rId" <> T.pack (show mInfoLocalId) + return + $ mknode "p:bg" [] + $ mknode "p:bgPr" [] + [ mknode "a:blipFill" [("dpi", "0"), ("rotWithShape", "1")] + [ mknode "a:blip" [("r:embed", rId)] + $ mknode "a:lum" [] () + , mknode "a:srcRect" [] () + , mknode "a:stretch" [] + $ mknode "a:fillRect" fillRectAttributes () + ] + , mknode "a:effectsLst" [] () + ] + where + offsetAttributes :: (Integer, Integer) -> (Integer, Integer) -> [(Text, Text)] + offsetAttributes (pageWidth, pageHeight) (pictureWidth, pictureHeight) = let + widthRatio = pictureWidth % pageWidth + heightRatio = pictureHeight % pageHeight + getOffset :: Ratio Integer -> Text + getOffset proportion = let + percentageOffset = (proportion - 1) * (-100 % 2) + integerOffset = round percentageOffset * 1000 :: Integer + in T.pack (show integerOffset) + in case compare widthRatio heightRatio of + EQ -> [] + LT -> let + offset = getOffset ((pictureHeight % pageHeight) / widthRatio) + in [ ("t", offset) + , ("b", offset) + ] + GT -> let + offset = getOffset ((pictureWidth % pageWidth) / heightRatio) + in [ ("l", offset) + , ("r", offset) + ] + slideToIncrementalAnimations :: [(ShapeId, Shape)] -> @@ -1790,8 +1853,8 @@ speakerNotesSlideNumber pgNum fieldId = ] slideToSpeakerNotesElement :: PandocMonad m => Slide -> P m (Maybe Element) -slideToSpeakerNotesElement (Slide _ _ (SpeakerNotes [])) = return Nothing -slideToSpeakerNotesElement slide@(Slide _ _ (SpeakerNotes paras)) = do +slideToSpeakerNotesElement (Slide _ _ (SpeakerNotes []) _) = return Nothing +slideToSpeakerNotesElement slide@(Slide _ _ (SpeakerNotes paras) _) = do master <- getNotesMaster fieldId <- getSlideNumberFieldId master num <- slideNum slide @@ -2037,7 +2100,7 @@ slideToSpeakerNotesEntry slide = do _ -> return Nothing slideToSpeakerNotesRelElement :: PandocMonad m => Slide -> P m (Maybe Element) -slideToSpeakerNotesRelElement (Slide _ _ (SpeakerNotes [])) = return Nothing +slideToSpeakerNotesRelElement (Slide _ _ (SpeakerNotes []) _) = return Nothing slideToSpeakerNotesRelElement slide@Slide{} = do idNum <- slideNum slide return $ Just $ @@ -2124,13 +2187,13 @@ slideToSlideRelElement slide = do target <- flip fmap getSlideLayouts $ T.pack . ("../slideLayouts/" <>) . takeFileName . slPath . case slide of - (Slide _ MetadataSlide{} _) -> metadata - (Slide _ TitleSlide{} _) -> title - (Slide _ ContentSlide{} _) -> content - (Slide _ TwoColumnSlide{} _) -> twoColumn - (Slide _ ComparisonSlide{} _) -> comparison - (Slide _ ContentWithCaptionSlide{} _) -> contentWithCaption - (Slide _ BlankSlide _) -> blank + (Slide _ MetadataSlide{} _ _) -> metadata + (Slide _ TitleSlide{} _ _) -> title + (Slide _ ContentSlide{} _ _) -> content + (Slide _ TwoColumnSlide{} _ _) -> twoColumn + (Slide _ ComparisonSlide{} _ _) -> comparison + (Slide _ ContentWithCaptionSlide{} _ _) -> contentWithCaption + (Slide _ BlankSlide _ _) -> blank speakerNotesRels <- maybeToList <$> speakerNotesSlideRelElement slide diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index a7660fc5e..fb4518bd7 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -63,7 +63,7 @@ import Text.Pandoc.Writers.Shared (lookupMetaInlines, lookupMetaBlocks , toLegacyTable) import qualified Data.Map as M import qualified Data.Set as S -import Data.Maybe (maybeToList, fromMaybe, listToMaybe) +import Data.Maybe (maybeToList, fromMaybe, listToMaybe, isNothing) import Text.Pandoc.Highlighting import qualified Data.Text as T import Control.Applicative ((<|>)) @@ -201,6 +201,7 @@ data DocProps = DocProps { dcTitle :: Maybe T.Text data Slide = Slide { slideId :: SlideId , slideLayout :: Layout , slideSpeakerNotes :: SpeakerNotes + , slideBackgroundImage :: Maybe FilePath } deriving (Show, Eq) newtype SlideId = SlideId T.Text @@ -223,7 +224,7 @@ data Layout = MetadataSlide [ParaElem] [ParaElem] [[ParaElem]] [ParaElem] | ComparisonSlide [ParaElem] ([Shape], [Shape]) ([Shape], [Shape]) -- heading left@(text, content) right@(text, content) | ContentWithCaptionSlide [ParaElem] [Shape] [Shape] - -- heading text content + -- heading text content | BlankSlide deriving (Show, Eq) @@ -725,6 +726,7 @@ bodyBlocksToSlide _ (blk : blks) spkNotes sldId (TwoColumnSlide [] shapesL shapesR) spkNotes + Nothing let mkComparison blksL1 blksL2 blksR1 blksR2 = do shapesL1 <- blocksToShapes blksL1 shapesL2 <- blocksToShapes blksL2 @@ -735,6 +737,7 @@ bodyBlocksToSlide _ (blk : blks) spkNotes sldId (ComparisonSlide [] (shapesL1, shapesL2) (shapesR1, shapesR2)) spkNotes + Nothing let (blksL1, blksL2) = break notText blksL (blksR1, blksR2) = break notText blksR if (any null [blksL1, blksL2]) && (any null [blksR1, blksR2]) @@ -744,7 +747,7 @@ bodyBlocksToSlide _ (blk : blks) spkNotes = do sldId <- asks envCurSlideId inNoteSlide <- asks envInNoteSlide let mkSlide s = - Slide sldId s spkNotes + Slide sldId s spkNotes Nothing if inNoteSlide then mkSlide . ContentSlide [] <$> forceFontSize noteSize (blocksToShapes (blk : blks)) @@ -767,14 +770,15 @@ bodyBlocksToSlide _ [] spkNotes = do sldId BlankSlide spkNotes + Nothing blocksToSlide' :: Int -> [Block] -> SpeakerNotes -> Pres Slide -blocksToSlide' lvl (Header n (ident, _, _) ils : blks) spkNotes +blocksToSlide' lvl (Header n (ident, _, attributes) ils : blks) spkNotes | n < lvl = do registerAnchorId ident sldId <- asks envCurSlideId hdr <- inlinesToParElems ils - return $ Slide sldId (TitleSlide hdr) spkNotes + return $ Slide sldId (TitleSlide hdr) spkNotes backgroundImage | n == lvl || lvl == 0 = do registerAnchorId ident hdr <- inlinesToParElems ils @@ -788,7 +792,10 @@ blocksToSlide' lvl (Header n (ident, _, _) ils : blks) spkNotes ContentWithCaptionSlide _ text content -> ContentWithCaptionSlide hdr text content BlankSlide -> if all inlineIsBlank ils then BlankSlide else ContentSlide hdr [] layout' -> layout' - return $ slide{slideLayout = layout} + return $ slide{slideLayout = layout, slideBackgroundImage = backgroundImage} + where + backgroundImage = T.unpack <$> (lookup "background-image" attributes + <|> lookup "data-background-image" attributes) blocksToSlide' lvl blks spkNotes = bodyBlocksToSlide lvl blks spkNotes blockToSpeakerNotes :: Block -> Pres SpeakerNotes @@ -869,12 +876,13 @@ getMetaSlide = do metadataSlideId (MetadataSlide title subtitle authors date) mempty + Nothing addSpeakerNotesToMetaSlide :: Slide -> [Block] -> Pres (Slide, [Block]) -addSpeakerNotesToMetaSlide (Slide sldId layout@MetadataSlide{} spkNotes) blks = +addSpeakerNotesToMetaSlide (Slide sldId layout@MetadataSlide{} spkNotes backgroundImage) blks = do let (ntsBlks, blks') = span isNotesDiv blks spkNotes' <- mconcat <$> mapM blockToSpeakerNotes ntsBlks - return (Slide sldId layout (spkNotes <> spkNotes'), blks') + return (Slide sldId layout (spkNotes <> spkNotes') backgroundImage, blks') addSpeakerNotesToMetaSlide sld blks = return (sld, blks) makeTOCSlide :: [Block] -> Pres Slide @@ -1010,7 +1018,10 @@ emptyLayout layout = case layout of emptySlide :: Slide -> Bool -emptySlide (Slide _ layout notes) = (notes == mempty) && emptyLayout layout +emptySlide (Slide _ layout notes backgroundImage) + = (notes == mempty) + && emptyLayout layout + && isNothing backgroundImage makesBlankSlide :: [Block] -> Bool makesBlankSlide = all blockIsBlank diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 6eb8c7f67..6e676dc37 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -240,4 +240,8 @@ tests = groupPptxTests [ pptxTests "Inline formatting" def "pptx/incremental-lists/without-flag/input.native" "pptx/incremental-lists/without-flag/output.pptx" + , pptxTests "Background images" + def + "pptx/background-image/input.native" + "pptx/background-image/output.pptx" ] diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx new file mode 100644 index 000000000..05d4104b7 Binary files /dev/null and b/test/pptx/background-image/deleted-layouts.pptx differ diff --git a/test/pptx/background-image/input.native b/test/pptx/background-image/input.native new file mode 100644 index 000000000..22b089a95 --- /dev/null +++ b/test/pptx/background-image/input.native @@ -0,0 +1,17 @@ +[Header 1 ("section-header-with-background-image",[],[("background-image","movie.jpg")]) [Str "Section",Space,Str "Header",Space,Str "(with",Space,Str "background",Space,Str "image)"] +,Header 2 ("slide-1",[],[("background-image","lalune.jpg")]) [Str "Slide",Space,Str "1"] +,Para [Str "This",Space,Str "slide",Space,Str "has",Space,Str "a",Space,Str "moon",Space,Str "background."] +,Header 2 ("slide-2",[],[("background-image","movie.jpg")]) [Str "Slide",Space,Str "2"] +,Para [Str "This",Space,Str "slide",Space,Str "has",Space,Str "a",Space,Str "movie",Space,Str "background."] +,Header 2 ("slide-3",[],[("background-image","movie.jpg")]) [Str "Slide",Space,Str "3"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "Background",Space,Str "images",Space,Str "work",Space,Str "in",Space,Str "two-column",Space,Str "layout."]] + ,Div ("",["column"],[]) + [Para [Str "hello"]]] +,Header 2 ("slide-4",[],[("background-image","movie.jpg")]) [Str "Slide",Space,Str "4"] +,Para [Str "You",Space,Str "can",Space,Str "have",Space,Str "images",Space,Str "on",Space,Str "slides",Space,Str "that",Space,Str "have",Space,Str "background",Space,Str "images:"] +,Para [Image ("",[],[]) [Str "An",Space,Str "image"] ("lalune.jpg","fig:")] +,Header 2 ("section",[],[("background-image","lalune.jpg")]) [] +,Div ("",["notes"],[]) + [Para [Str "Blank",Space,Str "slides",Space,Str "can",Space,Str "have",Space,Str "background",Space,Str "images."]]] diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx new file mode 100644 index 000000000..73b69e1d6 Binary files /dev/null and b/test/pptx/background-image/moved-layouts.pptx differ diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx new file mode 100644 index 000000000..9738eefb8 Binary files /dev/null and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/background-image/templated.pptx b/test/pptx/background-image/templated.pptx new file mode 100644 index 000000000..52d304957 Binary files /dev/null and b/test/pptx/background-image/templated.pptx differ -- cgit v1.2.3 From a07d955d6f96e78ade3e09c150ce580fb6e6f3a7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 16 Sep 2021 20:42:18 -0700 Subject: Fix code blocks using `--preserve-tabs`. Previously they did not behave as the equivalent input with spaces would. Closes #7573. --- src/Text/Pandoc/Readers/Markdown.hs | 8 +++++++- test/command/7573.md | 11 +++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/command/7573.md diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 45594e0fa..917eef287 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1124,7 +1124,13 @@ rawHtmlBlocks = do let selfClosing = "/>" `T.isSuffixOf` raw -- we don't want '
@ element, returning the column's width. -- An Either value is used: Left i means a "relative length" with @@ -183,11 +184,13 @@ pTableBody :: PandocMonad m -> TagParser m TableBody pTableBody block = try $ do skipMany pBlank - attribs <- option [] $ getAttribs <$> pSatisfy (matchTagOpen "tbody" []) - <* skipMany pBlank + mbattribs <- option Nothing $ Just . getAttribs <$> + pSatisfy (matchTagOpen "tbody" []) <* skipMany pBlank bodyheads <- many (pHeaderRow block) - (rowheads, rows) <- unzip <$> many1 (pRow block <* skipMany pBlank) + (rowheads, rows) <- unzip <$> many (pRow block <* skipMany pBlank) optional $ pSatisfy (matchTagClose "tbody") + guard $ isJust mbattribs || not (null bodyheads && null rows) + let attribs = fromMaybe [] mbattribs return $ TableBody (toAttr attribs) (foldr max 0 rowheads) bodyheads rows where getAttribs (TagOpen _ attribs) = attribs diff --git a/test/command/7589.md b/test/command/7589.md new file mode 100644 index 000000000..f9e8fb14f --- /dev/null +++ b/test/command/7589.md @@ -0,0 +1,73 @@ +``` +% pandoc -f html -t native +
" .. caption .. "" .. escape(caption) .. "
' .. h .. '
text' to be a code block: skipMany spaceChar - indentlevel <- (blankline >> length <$> many (char ' ')) <|> return 0 + tabStop <- getOption readerTabStop + indentlevel <- option 0 $ + do blankline + foldr (+) 0 <$> + many ( (1 <$ char ' ') + <|> + (tabStop <$ char '\t') ) -- try to find closing tag -- we set stateInHtmlBlock so that closing tags that can be either block or -- inline will not be parsed as inline tags diff --git a/test/command/7573.md b/test/command/7573.md new file mode 100644 index 000000000..d6529cde6 --- /dev/null +++ b/test/command/7573.md @@ -0,0 +1,11 @@ +``` +% pandoc --preserve-tabs +
    +
  1. one +
+^D +
    +
  1. +one +
+``` -- cgit v1.2.3 From d133d737ae4a9f37d0eb6361b3b367157d3dc3bf Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 16 Sep 2021 20:45:40 -0700 Subject: Use --system-ghc in make quick. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2560994e4..f8fea8028 100644 --- a/Makefile +++ b/Makefile @@ -22,11 +22,12 @@ REVISION?=1 BENCHARGS?=--csv bench_$(TIMESTAMP).csv $(BASELINECMD) --timeout=6 +RTS -T -RTS $(if $(PATTERN),--pattern "$(PATTERN)",) quick: - stack install --ghc-options='$(GHCOPTS)' --install-ghc --flag 'pandoc:embed_data_files' --fast --test --ghc-options='$(GHCOPTS)' --test-arguments='-j4 --hide-successes --ansi-tricks=false $(TESTARGS)' + stack install --ghc-options='$(GHCOPTS)' --system-ghc --flag 'pandoc:embed_data_files' --fast --test --test-arguments='-j4 --hide-successes --ansi-tricks=false $(TESTARGS)' quick-cabal: cabal v2-build -j8 --ghc-options '$(GHCOPTS)' --disable-optimization --enable-tests cabal v2-test --test-option=--hide-successes --test-option=--ansi-tricks=false $(TESTARGS) + cabal v2-install --disable-optimization full-cabal: cabal v2-configure . --ghc-options '$(GHCOPTS)' --flags '+embed_data_files +trypandoc' --enable-tests --enable-benchmarks -- cgit v1.2.3 From 44ec800b07cc2cc746df1ad88ae0fcadbac82106 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 17 Sep 2021 16:28:02 +0200 Subject: mention revealjs support of title-toc in MANUAL Following addition in #7171 --- MANUAL.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANUAL.txt b/MANUAL.txt index 98a2f4299..c2c46e05f 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -2816,7 +2816,7 @@ on the output format, and include the following: `toc-title` : title of table of contents (works only with EPUB, - HTML, opendocument, odt, docx, pptx, beamer, LaTeX) + HTML, revealjs, opendocument, odt, docx, pptx, beamer, LaTeX) [pandoc-templates]: https://github.com/jgm/pandoc-templates -- cgit v1.2.3 From 1487ee01fd1209217de4d21e6c459ca8a1bcea36 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 17 Sep 2021 09:21:53 -0700 Subject: Update list of supported source languages in org writer. See #5440. --- src/Text/Pandoc/Writers/Org.hs | 56 +++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index d404f1c8d..39af6717e 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -461,20 +461,52 @@ pandocLangToOrg cs = "c" -> "C" "commonlisp" -> "lisp" "r" -> "R" - "bash" -> "shell" - "lillypond" -> "ly" + "bash" -> "sh" _ -> cs -- | List of language identifiers recognized by org-mode. +-- See . orgLangIdentifiers :: [Text] orgLangIdentifiers = - [ "abc", "asymptote", "awk", "axiom", "C", "cpp", "calc", "clojure","comint" - , "coq", "css", "D", "ditaa", "dot", "ebnf", "elixir", "eukleides", "fomus" - , "forth", "F90", "gnuplot", "Translate", "groovy", "haskell" , "browser" - , "request", "io", "ipython", "J", "java", "js", "julia", "kotlin", "latex" - , "ledger", "ly", "lisp", "Flavored", "makefile", "mathematica", "mathomatic" - , "matlab", "max", "mongo", "mscgen", "cypher", "Caml", "octave" , "org", "oz" - , "perl", "picolisp", "plantuml", "processing", "prolog", "python" , "R" - , "rec", "ruby", "sass", "scala", "scheme", "screen", "sed", "shell", "shen" - , "sql", "sqlite", "stan", "ML", "stata", "tcl", "typescript", "vala" - ] + [ "asymptote" + , "lisp" + , "awk" + , "lua" + , "C" + , "matlab" + , "C++" + , "mscgen" + , "clojure" + , "ocaml" + , "css" + , "octave" + , "D" + , "org" + , "ditaa" + , "oz" + , "calc" + , "perl" + , "emacs-lisp" + , "plantuml" + , "eshell" + , "processing" + , "fortran" + , "python" + , "gnuplot" + , "R" + , "screen" + , "ruby" + , "dot" + , "sass" + , "haskell" + , "scheme" + , "java" + , "sed" + , "js" + , "sh" + , "latex" + , "sql" + , "ledger" + , "sqlite" + , "lilypond" + , "vala" ] -- cgit v1.2.3 From 57d93cca563cb162e4126e8738ecda27ce661623 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 17 Sep 2021 09:41:34 -0700 Subject: Org writer: don't indent contents of code blocks. We previously indented them by two spaces, following a common convention. Since the convention is fading, and the indentation is inconvenient for copy/paste, we are discontinuing this practice. Closes #5440. --- src/Text/Pandoc/Writers/Org.hs | 2 +- test/command/5178.md | 8 ++++---- test/writer.org | 40 ++++++++++++++++++++-------------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index 39af6717e..f4a22695c 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -154,7 +154,7 @@ blockToOrg (CodeBlock (_,classes,kvs) str) = do let (beg, end) = case at of [] -> ("#+begin_example" <> numberlines, "#+end_example") (x:_) -> ("#+begin_src " <> x <> numberlines, "#+end_src") - return $ literal beg $$ nest 2 (literal str) $$ text end $$ blankline + return $ literal beg $$ literal str $$ text end $$ blankline blockToOrg (BlockQuote blocks) = do contents <- blockListToOrg blocks return $ blankline $$ "#+begin_quote" $$ diff --git a/test/command/5178.md b/test/command/5178.md index 856f86abc..feb2c4b99 100644 --- a/test/command/5178.md +++ b/test/command/5178.md @@ -7,8 +7,8 @@ unsafePerformIO main ^D #+begin_src haskell -n 42 - main = putStrLn "Hello World!" - unsafePerformIO main +main = putStrLn "Hello World!" +unsafePerformIO main #+end_src ``` @@ -32,10 +32,10 @@ ,CodeBlock ("",["commonlisp","numberLines","continuedSourceBlock"],[("org-language","lisp"),("startFrom","10")]) "(+ 2 2)\n"] ^D #+begin_src lisp -n 20 - (+ 1 1) +(+ 1 1) #+end_src #+begin_src lisp +n 10 - (+ 2 2) +(+ 2 2) #+end_src ``` diff --git a/test/writer.org b/test/writer.org index df9d2b3a5..38ec35a3e 100644 --- a/test/writer.org +++ b/test/writer.org @@ -81,9 +81,9 @@ E-mail style: Code in a block quote: #+begin_example - sub status { - print "working"; - } + sub status { + print "working"; + } #+end_example A list: @@ -115,21 +115,21 @@ And a following paragraph. Code: #+begin_example - ---- (should be four hyphens) +---- (should be four hyphens) - sub status { - print "working"; - } +sub status { + print "working"; +} - this code block is indented by one tab +this code block is indented by one tab #+end_example And: #+begin_example - this code block is indented by two tabs + this code block is indented by two tabs - These should not be escaped: \$ \\ \> \[ \{ +These should not be escaped: \$ \\ \> \[ \{ #+end_example -------------- @@ -348,7 +348,7 @@ Multiple blocks with italics: - /orange/ :: orange fruit #+begin_example - { orange code block } + { orange code block } #+end_example #+begin_quote @@ -446,15 +446,15 @@ foo This should be a code block, though: #+begin_example -
- foo -
+
+ foo +
#+end_example As should this: #+begin_example -
foo
+
foo
#+end_example Now, nested: @@ -485,7 +485,7 @@ Multiline: Code block: #+begin_example - + #+end_example Just plain comment, with trailing spaces on the line: @@ -497,7 +497,7 @@ Just plain comment, with trailing spaces on the line: Code: #+begin_example -
+
#+end_example Hr's: @@ -728,7 +728,7 @@ Indented [[/url][thrice]]. This should [not][] be a link. #+begin_example - [not]: /url +[not]: /url #+end_example Foo [[/url/][bar]]. @@ -767,7 +767,7 @@ An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]] Auto-links should not occur here: == #+begin_example - or here: +or here: #+end_example -------------- @@ -810,7 +810,7 @@ This paragraph should not be part of the note, as it is not indented. (as with list items). #+begin_example - { } + { } #+end_example If you want, you can indent every line, but you can also be lazy and -- cgit v1.2.3 From cf7f80b11f5c266c7d1d7e200b41658a87f765b0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 17 Sep 2021 10:05:55 -0700 Subject: Fix linter warning. --- src/Text/Pandoc/Readers/Markdown.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 917eef287..85599abe4 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1127,10 +1127,9 @@ rawHtmlBlocks = do tabStop <- getOption readerTabStop indentlevel <- option 0 $ do blankline - foldr (+) 0 <$> - many ( (1 <$ char ' ') - <|> - (tabStop <$ char '\t') ) + sum <$> many ( (1 <$ char ' ') + <|> + (tabStop <$ char '\t') ) -- try to find closing tag -- we set stateInHtmlBlock so that closing tags that can be either block or -- inline will not be parsed as inline tags -- cgit v1.2.3 From 50adea220d09e445572e94e225fa7a81b3b2bf89 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Tue, 14 Sep 2021 17:07:46 +0100 Subject: pptx: Support footers in the reference doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In PowerPoint, it’s possible to specify footers across all slides, containing a date (optionally automatically updated to today’s date), the slide number (optionally starting from a higher number than 1), and static text. There’s also an option to hide the footer on the title slide. Before this commit, none of that footer content was pulled through from the reference doc: this commit supports all the functionality listed above. There is one behaviour which may not be immediately obvious: if the reference doc specifies a fixed date (i.e. not automatically updating), and there’s a date specified in the metadata for the document, the footer date is replaced by the metadata date. - Include date, slide number, and static footer content from reference doc - Respect “slide number starts from” option - Respect “Don’t show on title slide” option - Add tests --- pandoc.cabal | 5 + src/Text/Pandoc/Writers/Powerpoint/Output.hs | 103 +++++- test/Tests/Writers/Powerpoint.hs | 397 +++++++++++---------- test/pptx/footer/basic/output.pptx | Bin 0 -> 52775 bytes test/pptx/footer/basic/reference.pptx | Bin 0 -> 49063 bytes test/pptx/footer/fixed-date/output.pptx | Bin 0 -> 51397 bytes test/pptx/footer/fixed-date/reference.pptx | Bin 0 -> 47996 bytes test/pptx/footer/higher-slide-number/output.pptx | Bin 0 -> 52790 bytes .../pptx/footer/higher-slide-number/reference.pptx | Bin 0 -> 49082 bytes test/pptx/footer/input.native | 66 ++++ test/pptx/footer/no-title-slide/output.pptx | Bin 0 -> 52362 bytes test/pptx/footer/no-title-slide/reference.pptx | Bin 0 -> 48423 bytes 12 files changed, 372 insertions(+), 199 deletions(-) create mode 100644 test/pptx/footer/basic/output.pptx create mode 100644 test/pptx/footer/basic/reference.pptx create mode 100644 test/pptx/footer/fixed-date/output.pptx create mode 100644 test/pptx/footer/fixed-date/reference.pptx create mode 100644 test/pptx/footer/higher-slide-number/output.pptx create mode 100644 test/pptx/footer/higher-slide-number/reference.pptx create mode 100644 test/pptx/footer/input.native create mode 100644 test/pptx/footer/no-title-slide/output.pptx create mode 100644 test/pptx/footer/no-title-slide/reference.pptx diff --git a/pandoc.cabal b/pandoc.cabal index 0c8cf0d61..4881fe3a4 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -414,6 +414,11 @@ extra-source-files: test/pptx/endnotes-toc/*.pptx test/pptx/endnotes/input.native test/pptx/endnotes/*.pptx + test/pptx/footer/input.native + test/pptx/footer/basic/*.pptx + test/pptx/footer/fixed-date/*.pptx + test/pptx/footer/higher-slide-number/*.pptx + test/pptx/footer/no-title-slide/*.pptx test/pptx/images/input.native test/pptx/images/*.pptx test/pptx/incremental-lists/with-flag/input.native diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 1431469d3..acfd446de 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -2,6 +2,7 @@ {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} +{-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TupleSections #-} {- | @@ -159,7 +160,7 @@ data SlideLayoutsOf a = SlideLayouts , comparison :: a , contentWithCaption :: a , blank :: a - } deriving (Show, Functor, Foldable, Traversable) + } deriving (Show, Eq, Functor, Foldable, Traversable) data SlideLayout = SlideLayout { slElement :: Element @@ -197,12 +198,14 @@ data WriterState = WriterState { stLinkIds :: M.Map Int (M.Map Int LinkTarget) -- (FP, Local ID, Global ID, Maybe Mime) , stMediaIds :: M.Map Int [MediaInfo] , stMediaGlobalIds :: M.Map FilePath Int + , stFooterInfo :: Maybe FooterInfo } deriving (Show, Eq) instance Default WriterState where def = WriterState { stLinkIds = mempty , stMediaIds = mempty , stMediaGlobalIds = mempty + , stFooterInfo = Nothing } type P m = ReaderT WriterEnv (StateT WriterState m) @@ -316,8 +319,14 @@ presentationToArchiveP p@(Presentation docProps slides) = do else id let newArch' = foldr f newArch slideLayouts - -- Update the master to make sure it includes any layouts we've just added master <- getMaster + refArchive <- asks envRefArchive + distArchive <- asks envDistArchive + presentationElement <- parseXml refArchive distArchive "ppt/presentation.xml" + modify (\s -> s {stFooterInfo = + getFooterInfo slideLayouts master presentationElement}) + + -- Update the master to make sure it includes any layouts we've just added masterRels <- getMasterRels let (updatedMasterElem, updatedMasterRelElem) = updateMasterElems slideLayouts master masterRels updatedMasterEntry <- elemToEntry "ppt/slideMasters/slideMaster1.xml" updatedMasterElem @@ -432,6 +441,56 @@ updateMasterElems layouts master masterRels = (updatedMaster, updatedMasterRels) getIdAttribute (Elem e) = findAttr (QName "id" Nothing Nothing) e getIdAttribute _ = Nothing +data FooterInfo = FooterInfo + { fiDate :: SlideLayoutsOf (Maybe Element) + , fiFooter :: SlideLayoutsOf (Maybe Element) + , fiSlideNumber :: SlideLayoutsOf (Maybe Element) + , fiShowOnFirstSlide :: Bool + } deriving (Show, Eq) + +getFooterInfo :: SlideLayouts -> Element -> Element -> Maybe FooterInfo +getFooterInfo layouts master presentation = do + let ns = elemToNameSpaces master + hf <- findChild (elemName ns "p" "hf") master + let fiDate = getShape "dt" hf . slElement <$> layouts + fiFooter = getShape "ftr" hf . slElement <$> layouts + fiSlideNumber = getShape "sldNum" hf . slElement <$> layouts + fiShowOnFirstSlide = + fromMaybe True + (getBooleanAttribute "showSpecialPlsOnTitleSld" presentation) + pure FooterInfo{..} + where + getShape t hf layout = + if fromMaybe True (getBooleanAttribute t hf) + then do + let ns = elemToNameSpaces layout + cSld <- findChild (elemName ns "p" "cSld") layout + spTree <- findChild (elemName ns "p" "spTree") cSld + let containsPlaceholder sp = fromMaybe False $ do + nvSpPr <- findChild (elemName ns "p" "nvSpPr") sp + nvPr <- findChild (elemName ns "p" "nvPr") nvSpPr + ph <- findChild (elemName ns "p" "ph") nvPr + placeholderType <- findAttr (QName "type" Nothing Nothing) ph + pure (placeholderType == t) + listToMaybe (filterChildren containsPlaceholder spTree) + else Nothing + + getBooleanAttribute t e = + (`elem` ["1", "true"]) <$> + (findAttr (QName t Nothing Nothing) e) + +footerElements :: + PandocMonad m => + (forall a. SlideLayoutsOf a -> a) -> + P m [Content] +footerElements layout = do + footerInfo <- gets stFooterInfo + pure + $ Elem <$> + (toList (footerInfo >>= layout . fiDate) + <> toList (footerInfo >>= layout . fiFooter) + <> toList (footerInfo >>= layout . fiSlideNumber)) + makeSlideIdMap :: Presentation -> M.Map SlideId Int makeSlideIdMap (Presentation _ slides) = M.fromList $ map slideId slides `zip` [1..] @@ -1372,13 +1431,14 @@ contentToElement layout hdrShape shapes (shapeId, element) <- nonBodyTextToElement layout [PHType "title"] hdrShape let hdrShapeElements = [Elem element | not (null hdrShape)] contentHeaderId = if null hdrShape then Nothing else shapeId - content <- local + content' <- local (\env -> env {envPlaceholder = Placeholder ObjType 0}) (shapesToElements layout shapes) - let contentContentIds = mapMaybe fst content - contentElements = snd <$> content + let contentContentIds = mapMaybe fst content' + contentElements = snd <$> content' + footer <- footerElements content return ( Just ContentShapeIds{..} - , buildSpTree ns spTree (hdrShapeElements <> contentElements) + , buildSpTree ns spTree (hdrShapeElements <> contentElements <> footer) ) contentToElement _ _ _ = return (Nothing, mknode "p:sp" [] ()) @@ -1412,10 +1472,11 @@ twoColumnToElement layout hdrShape shapesL shapesR contentElementsR = snd <$> contentR -- let contentElementsL' = map (setIdx ns "1") contentElementsL -- contentElementsR' = map (setIdx ns "2") contentElementsR + footer <- footerElements twoColumn return $ (Just TwoColumnShapeIds{..}, ) $ buildSpTree ns spTree - $ hdrShapeElements <> contentElementsL <> contentElementsR + $ hdrShapeElements <> contentElementsL <> contentElementsR <> footer twoColumnToElement _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) data ComparisonShapeIds = ComparisonShapeIds @@ -1456,6 +1517,7 @@ comparisonToElement layout hdrShape (shapesL1, shapesL2) (shapesR1, shapesR2) (shapesToElements layout shapesR2) let comparisonRightContentIds = mapMaybe fst contentR2 contentElementsR2 = snd <$> contentR2 + footer <- footerElements comparison return $ (Just ComparisonShapeIds{..}, ) $ buildSpTree ns spTree @@ -1464,7 +1526,7 @@ comparisonToElement layout hdrShape (shapesL1, shapesL2) (shapesR1, shapesR2) , contentElementsL2 , contentElementsR1 , contentElementsR2 - ] + ] <> footer comparisonToElement _ _ _ _= return (Nothing, mknode "p:sp" [] ()) data ContentWithCaptionShapeIds = ContentWithCaptionShapeIds @@ -1495,13 +1557,14 @@ contentWithCaptionToElement layout hdrShape textShapes contentShapes (shapesToElements layout contentShapes) let contentWithCaptionContentIds = mapMaybe fst content contentElements = snd <$> content + footer <- footerElements contentWithCaption return $ (Just ContentWithCaptionShapeIds{..}, ) $ buildSpTree ns spTree $ mconcat [ hdrShapeElements , textElements , contentElements - ] + ] <> footer contentWithCaptionToElement _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) blankToElement :: @@ -1511,8 +1574,8 @@ blankToElement :: blankToElement layout | ns <- elemToNameSpaces layout , Just cSld <- findChild (elemName ns "p" "cSld") layout - , Just spTree <- findChild (elemName ns "p" "spTree") cSld = do - return $ buildSpTree ns spTree [] + , Just spTree <- findChild (elemName ns "p" "spTree") cSld = + buildSpTree ns spTree <$> footerElements blank blankToElement _ = return $ mknode "p:sp" [] () newtype TitleShapeIds = TitleShapeIds @@ -1531,7 +1594,10 @@ titleToElement layout titleElems (shapeId, element) <- nonBodyTextToElement layout [PHType "title", PHType "ctrTitle"] titleElems let titleShapeElements = [Elem element | not (null titleElems)] titleHeaderId = if null titleElems then Nothing else shapeId - return $ (Just TitleShapeIds{..}, ) $ buildSpTree ns spTree titleShapeElements + footer <- footerElements title + return + $ (Just TitleShapeIds{..}, ) + $ buildSpTree ns spTree (titleShapeElements <> footer) titleToElement _ _ = return (Nothing, mknode "p:sp" [] ()) data MetadataShapeIds = MetadataShapeIds @@ -1561,13 +1627,20 @@ metadataToElement layout titleElems subtitleElems authorsElems dateElems metadataTitleId = if null titleElems then Nothing else titleId subtitleShapeElements = [subtitleElement | not (null subtitleAndAuthorElems)] metadataSubtitleId = if null subtitleAndAuthorElems then Nothing else subtitleId - dateShapeElements = [dateElement | not (null dateElems)] + footerInfo <- gets stFooterInfo + footer <- (if maybe False fiShowOnFirstSlide footerInfo + then id + else const []) <$> footerElements metadata + let dateShapeElements = [dateElement + | not (null dateElems + || isJust (footerInfo >>= metadata . fiDate)) + ] metadataDateId = if null dateElems then Nothing else dateId return $ (Just MetadataShapeIds{..}, ) $ buildSpTree ns spTree - $ map Elem - $ titleShapeElements <> subtitleShapeElements <> dateShapeElements + $ map Elem (titleShapeElements <> subtitleShapeElements <> dateShapeElements) + <> footer metadataToElement _ _ _ _ _ = return (Nothing, mknode "p:sp" [] ()) slideToElement :: PandocMonad m => Slide -> P m Element diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 6e676dc37..b2df80e5f 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -61,187 +61,216 @@ groupPptxTests pairs = tests :: [TestTree] -tests = groupPptxTests [ pptxTests "Inline formatting" - def - "pptx/inline-formatting/input.native" - "pptx/inline-formatting/output.pptx" - , pptxTests "Slide breaks (default slide-level)" - def - "pptx/slide-breaks/input.native" - "pptx/slide-breaks/output.pptx" - , pptxTests "slide breaks (slide-level set to 1)" - def{ writerSlideLevel = Just 1 } - "pptx/slide-breaks/input.native" - "pptx/slide-breaks-slide-level-1/output.pptx" - , pptxTests "lists" - def - "pptx/lists/input.native" - "pptx/lists/output.pptx" - , pptxTests "start ordered list at specified num" - def - "pptx/start-numbering-at/input.native" - "pptx/start-numbering-at/output.pptx" - , pptxTests "tables" - def - "pptx/tables/input.native" - "pptx/tables/output.pptx" - , pptxTests "table of contents" - def{ writerTableOfContents = True } - "pptx/slide-breaks/input.native" - "pptx/slide-breaks-toc/output.pptx" - , pptxTests "end notes" - def - "pptx/endnotes/input.native" - "pptx/endnotes/output.pptx" - , pptxTests "end notes, with table of contents" - def { writerTableOfContents = True } - "pptx/endnotes/input.native" - "pptx/endnotes-toc/output.pptx" - , pptxTests "images" - def - "pptx/images/input.native" - "pptx/images/output.pptx" - , pptxTests "two-column layout" - def - "pptx/two-column/all-text/input.native" - "pptx/two-column/all-text/output.pptx" - , pptxTests "two-column (not comparison)" - def - "pptx/two-column/text-and-image/input.native" - "pptx/two-column/text-and-image/output.pptx" - , pptxTests "speaker notes" - def - "pptx/speaker-notes/input.native" - "pptx/speaker-notes/output.pptx" - , pptxTests "speaker notes after a separating block" - def - "pptx/speaker-notes-afterseps/input.native" - "pptx/speaker-notes-afterseps/output.pptx" - , pptxTests "speaker notes after a separating header" - def - "pptx/speaker-notes-afterheader/input.native" - "pptx/speaker-notes-afterheader/output.pptx" - , pptxTests "speaker notes after metadata" - def - "pptx/speaker-notes-after-metadata/input.native" - "pptx/speaker-notes-after-metadata/output.pptx" - , pptxTests "remove empty slides" - def - "pptx/remove-empty-slides/input.native" - "pptx/remove-empty-slides/output.pptx" - , pptxTests "raw ooxml" - def - "pptx/raw-ooxml/input.native" - "pptx/raw-ooxml/output.pptx" - , pptxTests "metadata, custom properties" - def - "pptx/document-properties/input.native" - "pptx/document-properties/output.pptx" - , pptxTests "metadata, short description" - def - "pptx/document-properties-short-desc/input.native" - "pptx/document-properties-short-desc/output.pptx" - , pptxTests "inline code and code blocks" - def - "pptx/code/input.native" - "pptx/code/output.pptx" - , pptxTests "inline code and code blocks, custom formatting" - def { writerVariables = Context $ M.fromList - [(pack "monofont", toVal $ pack "Consolas")] } - "pptx/code/input.native" - "pptx/code-custom/output.pptx" - , pptxTests ("Using slide level 0, if the first thing on " - <> "a slide is a h1 it's used as the " - <> "slide title") - def { writerSlideLevel = Just 0 } - "pptx/slide-level-0/h1-with-image/input.native" - "pptx/slide-level-0/h1-with-image/output.pptx" - , pptxTests ("Using slide level 0, if the first thing on " - <> "a slide is a h2 it's used as the " - <> "slide title") - def { writerSlideLevel = Just 0 } - "pptx/slide-level-0/h2-with-image/input.native" - "pptx/slide-level-0/h2-with-image/output.pptx" - , pptxTests ("Using slide level 0, if the first thing on " - <> "a slide is a heading it's used as the " - <> "slide title (works with a table)") - def { writerSlideLevel = Just 0 } - "pptx/slide-level-0/h1-with-table/input.native" - "pptx/slide-level-0/h1-with-table/output.pptx" - , pptxTests ("Using slide level 0, if the first thing on " - <> "a slide is a heading it's used as the " - <> "slide title (content with caption layout)") - def { writerSlideLevel = Just 0 } - "pptx/slide-level-0/h1-h2-with-table/input.native" - "pptx/slide-level-0/h1-h2-with-table/output.pptx" - , pptxTests ("comparison layout used when two columns " - <> "contain text plus non-text") - def - "pptx/comparison/both-columns/input.native" - "pptx/comparison/both-columns/output.pptx" - , pptxTests ("comparison layout used even when only one " - <> "column contains text plus non-text") - def - "pptx/comparison/one-column/input.native" - "pptx/comparison/one-column/output.pptx" - , pptxTests ("extra text in one column in comparison " - <> "layout gets overlaid") - def - "pptx/comparison/extra-text/input.native" - "pptx/comparison/extra-text/output.pptx" - , pptxTests ("extra image in one column in comparison " - <> "layout gets overlaid") - def - "pptx/comparison/extra-image/input.native" - "pptx/comparison/extra-image/output.pptx" - , pptxTests "comparison not used if the non-text comes first" - def - "pptx/comparison/non-text-first/input.native" - "pptx/comparison/non-text-first/output.pptx" - , pptxTests ("Heading, text and an image on the same " - <> "slide uses the Content with Caption " - <> "layout") - def - "pptx/content-with-caption/heading-text-image/input.native" - "pptx/content-with-caption/heading-text-image/output.pptx" - , pptxTests ("Text and an image on the same " - <> "slide uses the Content with Caption " - <> "layout") - def - "pptx/content-with-caption/text-image/input.native" - "pptx/content-with-caption/text-image/output.pptx" - , pptxTests ("If the image comes first, Content with " - <> "Caption is not used") - def - "pptx/content-with-caption/image-text/input.native" - "pptx/content-with-caption/image-text/output.pptx" - , pptxTests ("If a slide contains only speaker notes, the " - <> "Blank layout is used") - def - "pptx/blanks/just-speaker-notes/input.native" - "pptx/blanks/just-speaker-notes/output.pptx" - , pptxTests ("If a slide contains only an empty heading " - <> "with a body of only non-breaking spaces" - <> ", the Blank layout is used") - def - "pptx/blanks/nbsp-in-body/input.native" - "pptx/blanks/nbsp-in-body/output.pptx" - , pptxTests ("If a slide contains only a heading " - <> "containing only non-breaking spaces, " - <> "the Blank layout is used") - def - "pptx/blanks/nbsp-in-heading/input.native" - "pptx/blanks/nbsp-in-heading/output.pptx" - , pptxTests ("Incremental lists are supported") - def { writerIncremental = True } - "pptx/incremental-lists/with-flag/input.native" - "pptx/incremental-lists/with-flag/output.pptx" - , pptxTests ("One-off incremental lists are supported") - def - "pptx/incremental-lists/without-flag/input.native" - "pptx/incremental-lists/without-flag/output.pptx" - , pptxTests "Background images" - def - "pptx/background-image/input.native" - "pptx/background-image/output.pptx" - ] +tests = let + regularTests = + groupPptxTests [ pptxTests "Inline formatting" + def + "pptx/inline-formatting/input.native" + "pptx/inline-formatting/output.pptx" + , pptxTests "Slide breaks (default slide-level)" + def + "pptx/slide-breaks/input.native" + "pptx/slide-breaks/output.pptx" + , pptxTests "slide breaks (slide-level set to 1)" + def{ writerSlideLevel = Just 1 } + "pptx/slide-breaks/input.native" + "pptx/slide-breaks-slide-level-1/output.pptx" + , pptxTests "lists" + def + "pptx/lists/input.native" + "pptx/lists/output.pptx" + , pptxTests "start ordered list at specified num" + def + "pptx/start-numbering-at/input.native" + "pptx/start-numbering-at/output.pptx" + , pptxTests "tables" + def + "pptx/tables/input.native" + "pptx/tables/output.pptx" + , pptxTests "table of contents" + def{ writerTableOfContents = True } + "pptx/slide-breaks/input.native" + "pptx/slide-breaks-toc/output.pptx" + , pptxTests "end notes" + def + "pptx/endnotes/input.native" + "pptx/endnotes/output.pptx" + , pptxTests "end notes, with table of contents" + def { writerTableOfContents = True } + "pptx/endnotes/input.native" + "pptx/endnotes-toc/output.pptx" + , pptxTests "images" + def + "pptx/images/input.native" + "pptx/images/output.pptx" + , pptxTests "two-column layout" + def + "pptx/two-column/all-text/input.native" + "pptx/two-column/all-text/output.pptx" + , pptxTests "two-column (not comparison)" + def + "pptx/two-column/text-and-image/input.native" + "pptx/two-column/text-and-image/output.pptx" + , pptxTests "speaker notes" + def + "pptx/speaker-notes/input.native" + "pptx/speaker-notes/output.pptx" + , pptxTests "speaker notes after a separating block" + def + "pptx/speaker-notes-afterseps/input.native" + "pptx/speaker-notes-afterseps/output.pptx" + , pptxTests "speaker notes after a separating header" + def + "pptx/speaker-notes-afterheader/input.native" + "pptx/speaker-notes-afterheader/output.pptx" + , pptxTests "speaker notes after metadata" + def + "pptx/speaker-notes-after-metadata/input.native" + "pptx/speaker-notes-after-metadata/output.pptx" + , pptxTests "remove empty slides" + def + "pptx/remove-empty-slides/input.native" + "pptx/remove-empty-slides/output.pptx" + , pptxTests "raw ooxml" + def + "pptx/raw-ooxml/input.native" + "pptx/raw-ooxml/output.pptx" + , pptxTests "metadata, custom properties" + def + "pptx/document-properties/input.native" + "pptx/document-properties/output.pptx" + , pptxTests "metadata, short description" + def + "pptx/document-properties-short-desc/input.native" + "pptx/document-properties-short-desc/output.pptx" + , pptxTests "inline code and code blocks" + def + "pptx/code/input.native" + "pptx/code/output.pptx" + , pptxTests "inline code and code blocks, custom formatting" + def { writerVariables = Context $ M.fromList + [(pack "monofont", toVal $ pack "Consolas")] } + "pptx/code/input.native" + "pptx/code-custom/output.pptx" + , pptxTests ("Using slide level 0, if the first thing on " + <> "a slide is a h1 it's used as the " + <> "slide title") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0/h1-with-image/input.native" + "pptx/slide-level-0/h1-with-image/output.pptx" + , pptxTests ("Using slide level 0, if the first thing on " + <> "a slide is a h2 it's used as the " + <> "slide title") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0/h2-with-image/input.native" + "pptx/slide-level-0/h2-with-image/output.pptx" + , pptxTests ("Using slide level 0, if the first thing on " + <> "a slide is a heading it's used as the " + <> "slide title (works with a table)") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0/h1-with-table/input.native" + "pptx/slide-level-0/h1-with-table/output.pptx" + , pptxTests ("Using slide level 0, if the first thing on " + <> "a slide is a heading it's used as the " + <> "slide title (content with caption layout)") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0/h1-h2-with-table/input.native" + "pptx/slide-level-0/h1-h2-with-table/output.pptx" + , pptxTests ("comparison layout used when two columns " + <> "contain text plus non-text") + def + "pptx/comparison/both-columns/input.native" + "pptx/comparison/both-columns/output.pptx" + , pptxTests ("comparison layout used even when only one " + <> "column contains text plus non-text") + def + "pptx/comparison/one-column/input.native" + "pptx/comparison/one-column/output.pptx" + , pptxTests ("extra text in one column in comparison " + <> "layout gets overlaid") + def + "pptx/comparison/extra-text/input.native" + "pptx/comparison/extra-text/output.pptx" + , pptxTests ("extra image in one column in comparison " + <> "layout gets overlaid") + def + "pptx/comparison/extra-image/input.native" + "pptx/comparison/extra-image/output.pptx" + , pptxTests "comparison not used if the non-text comes first" + def + "pptx/comparison/non-text-first/input.native" + "pptx/comparison/non-text-first/output.pptx" + , pptxTests ("Heading, text and an image on the same " + <> "slide uses the Content with Caption " + <> "layout") + def + "pptx/content-with-caption/heading-text-image/input.native" + "pptx/content-with-caption/heading-text-image/output.pptx" + , pptxTests ("Text and an image on the same " + <> "slide uses the Content with Caption " + <> "layout") + def + "pptx/content-with-caption/text-image/input.native" + "pptx/content-with-caption/text-image/output.pptx" + , pptxTests ("If the image comes first, Content with " + <> "Caption is not used") + def + "pptx/content-with-caption/image-text/input.native" + "pptx/content-with-caption/image-text/output.pptx" + , pptxTests ("If a slide contains only speaker notes, the " + <> "Blank layout is used") + def + "pptx/blanks/just-speaker-notes/input.native" + "pptx/blanks/just-speaker-notes/output.pptx" + , pptxTests ("If a slide contains only an empty heading " + <> "with a body of only non-breaking spaces" + <> ", the Blank layout is used") + def + "pptx/blanks/nbsp-in-body/input.native" + "pptx/blanks/nbsp-in-body/output.pptx" + , pptxTests ("If a slide contains only a heading " + <> "containing only non-breaking spaces, " + <> "the Blank layout is used") + def + "pptx/blanks/nbsp-in-heading/input.native" + "pptx/blanks/nbsp-in-heading/output.pptx" + , pptxTests ("Incremental lists are supported") + def { writerIncremental = True } + "pptx/incremental-lists/with-flag/input.native" + "pptx/incremental-lists/with-flag/output.pptx" + , pptxTests ("One-off incremental lists are supported") + def + "pptx/incremental-lists/without-flag/input.native" + "pptx/incremental-lists/without-flag/output.pptx" + , pptxTests "Background images" + def + "pptx/background-image/input.native" + "pptx/background-image/output.pptx" + ] + referenceSpecificTests = + [ ooxmlTest + writePowerpoint + "Basic footer" + def { writerReferenceDoc = Just "pptx/footer/basic/reference.pptx"} + "pptx/footer/input.native" + "pptx/footer/basic/output.pptx" + , ooxmlTest + writePowerpoint + "Footer with fixed date, replaced by meta block date" + def { writerReferenceDoc = Just "pptx/footer/fixed-date/reference.pptx"} + "pptx/footer/input.native" + "pptx/footer/fixed-date/output.pptx" + , ooxmlTest + writePowerpoint + "Footer not shown on title slide" + def { writerReferenceDoc = Just "pptx/footer/no-title-slide/reference.pptx"} + "pptx/footer/input.native" + "pptx/footer/no-title-slide/output.pptx" + , ooxmlTest + writePowerpoint + "Footer with slide number starting from 3" + def { writerReferenceDoc = Just "pptx/footer/higher-slide-number/reference.pptx"} + "pptx/footer/input.native" + "pptx/footer/higher-slide-number/output.pptx" + ] + in regularTests <> referenceSpecificTests diff --git a/test/pptx/footer/basic/output.pptx b/test/pptx/footer/basic/output.pptx new file mode 100644 index 000000000..db8814418 Binary files /dev/null and b/test/pptx/footer/basic/output.pptx differ diff --git a/test/pptx/footer/basic/reference.pptx b/test/pptx/footer/basic/reference.pptx new file mode 100644 index 000000000..61f926fa6 Binary files /dev/null and b/test/pptx/footer/basic/reference.pptx differ diff --git a/test/pptx/footer/fixed-date/output.pptx b/test/pptx/footer/fixed-date/output.pptx new file mode 100644 index 000000000..85854a744 Binary files /dev/null and b/test/pptx/footer/fixed-date/output.pptx differ diff --git a/test/pptx/footer/fixed-date/reference.pptx b/test/pptx/footer/fixed-date/reference.pptx new file mode 100644 index 000000000..78bd3ce0d Binary files /dev/null and b/test/pptx/footer/fixed-date/reference.pptx differ diff --git a/test/pptx/footer/higher-slide-number/output.pptx b/test/pptx/footer/higher-slide-number/output.pptx new file mode 100644 index 000000000..c5bc3d047 Binary files /dev/null and b/test/pptx/footer/higher-slide-number/output.pptx differ diff --git a/test/pptx/footer/higher-slide-number/reference.pptx b/test/pptx/footer/higher-slide-number/reference.pptx new file mode 100644 index 000000000..6ada45399 Binary files /dev/null and b/test/pptx/footer/higher-slide-number/reference.pptx differ diff --git a/test/pptx/footer/input.native b/test/pptx/footer/input.native new file mode 100644 index 000000000..2c0ae5c06 --- /dev/null +++ b/test/pptx/footer/input.native @@ -0,0 +1,66 @@ +Pandoc (Meta {unMeta = fromList [("author",MetaInlines [Str "Me"]),("date",MetaInlines [Str "14/09/1995"]),("title",MetaInlines [Str "Slides"])]}) +[Header 2 ("slide-1",[],[]) [Str "Slide",Space,Str "1"] +,Para [Str "Hello",Space,Str "there"] +,Header 1 ("layouts",[],[]) [Str "Layouts"] +,Header 2 ("slide-3",[],[]) [Str "Slide",Space,Str "3"] +,Para [Str "Does",Space,Str "it",Space,Str "work",Space,Str "on",Space,Str "other",Space,Str "layouts?"] +,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2) + ,(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "2"]]]])] + (TableFoot ("",[],[]) + []) +,Header 2 ("slide-4",[],[]) [Str "Slide",Space,Str "4"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "hello",Space,Str "hello"]] + ,Div ("",["column"],[]) + [Para [Str "goood",Space,Str "bye"]]] +,Header 2 ("slide-5",[],[]) [Str "Slide",Space,Str "5"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "Hello",Space,Str "there"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2) + ,(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "2"]]]])] + (TableFoot ("",[],[]) + [])] + ,Div ("",["column"],[]) + [Para [Str "oh",Space,Str "wait"] + ,Table ("",[],[]) (Caption Nothing + []) + [(AlignDefault,ColWidth 5.555555555555555e-2) + ,(AlignDefault,ColWidth 5.555555555555555e-2)] + (TableHead ("",[],[]) + []) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) + [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "1"]] + ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) + [Plain [Str "2"]]]])] + (TableFoot ("",[],[]) + [])]] +,Header 2 ("section",[],[]) [] +,Div ("",["notes"],[]) + [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "blank",Space,Str "slide:",Space,Str "does",Space,Str "it",Space,Str "have",Space,Str "a",Space,Str "footer?"]]] diff --git a/test/pptx/footer/no-title-slide/output.pptx b/test/pptx/footer/no-title-slide/output.pptx new file mode 100644 index 000000000..d1475bf1f Binary files /dev/null and b/test/pptx/footer/no-title-slide/output.pptx differ diff --git a/test/pptx/footer/no-title-slide/reference.pptx b/test/pptx/footer/no-title-slide/reference.pptx new file mode 100644 index 000000000..ecd524a9b Binary files /dev/null and b/test/pptx/footer/no-title-slide/reference.pptx differ -- cgit v1.2.3 From 4a5ed7e04a0186afe159b030b5bf52260cb47da4 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Fri, 17 Sep 2021 13:53:54 +0100 Subject: pptx-footers: Replace fixed dates with yaml date --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 43 +++++++++++++++++++--- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 9 +++-- 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index acfd446de..f4700e8c1 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -323,8 +323,10 @@ presentationToArchiveP p@(Presentation docProps slides) = do refArchive <- asks envRefArchive distArchive <- asks envDistArchive presentationElement <- parseXml refArchive distArchive "ppt/presentation.xml" - modify (\s -> s {stFooterInfo = - getFooterInfo slideLayouts master presentationElement}) + modify (\s -> + s {stFooterInfo = + getFooterInfo (dcDate docProps) slideLayouts master presentationElement + }) -- Update the master to make sure it includes any layouts we've just added masterRels <- getMasterRels @@ -448,11 +450,19 @@ data FooterInfo = FooterInfo , fiShowOnFirstSlide :: Bool } deriving (Show, Eq) -getFooterInfo :: SlideLayouts -> Element -> Element -> Maybe FooterInfo -getFooterInfo layouts master presentation = do +getFooterInfo :: Maybe Text -> SlideLayouts -> Element -> Element -> Maybe FooterInfo +getFooterInfo date layouts master presentation = do let ns = elemToNameSpaces master hf <- findChild (elemName ns "p" "hf") master - let fiDate = getShape "dt" hf . slElement <$> layouts + let fiDate = let + f layoutDate = + case date of + Nothing -> layoutDate + Just d -> + if dateIsAutomatic (elemToNameSpaces layoutDate) layoutDate + then layoutDate + else replaceDate d layoutDate + in fmap f . getShape "dt" hf . slElement <$> layouts fiFooter = getShape "ftr" hf . slElement <$> layouts fiSlideNumber = getShape "sldNum" hf . slElement <$> layouts fiShowOnFirstSlide = @@ -475,6 +485,29 @@ getFooterInfo layouts master presentation = do listToMaybe (filterChildren containsPlaceholder spTree) else Nothing + dateIsAutomatic :: NameSpaces -> Element -> Bool + dateIsAutomatic ns shape = isJust $ do + txBody <- findChild (elemName ns "p" "txBody") shape + p <- findChild (elemName ns "a" "p") txBody + findChild (elemName ns "a" "fld") p + + replaceDate :: Text -> Element -> Element + replaceDate newDate e = + e { elContent = + case (elName e) of + QName "t" _ (Just "a") -> + [ Text (CData { cdVerbatim = CDataText + , cdData = newDate + , cdLine = Nothing + }) + ] + _ -> ifElem (replaceDate newDate) <$> elContent e + } + + ifElem :: (Element -> Element) -> (Content -> Content) + ifElem f (Elem e) = Elem (f e) + ifElem _ c = c + getBooleanAttribute t e = (`elem` ["1", "true"]) <$> (findAttr (QName t Nothing Nothing) e) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index fb4518bd7..327774cd8 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -55,7 +55,6 @@ import Text.Pandoc.Slides (getSlideLevel) import Text.Pandoc.Options import Text.Pandoc.Logging import Text.Pandoc.Walk -import Data.Time (UTCTime) import qualified Text.Pandoc.Shared as Shared -- so we don't overlap "Element" import Text.Pandoc.Shared (tshow) import Text.Pandoc.Writers.Shared (lookupMetaInlines, lookupMetaBlocks @@ -193,7 +192,7 @@ data DocProps = DocProps { dcTitle :: Maybe T.Text , dcKeywords :: Maybe [T.Text] , dcDescription :: Maybe T.Text , cpCategory :: Maybe T.Text - , dcCreated :: Maybe UTCTime + , dcDate :: Maybe T.Text , customProperties :: Maybe [(T.Text, T.Text)] } deriving (Show, Eq) @@ -1149,7 +1148,11 @@ metaToDocProps meta = , dcKeywords = keywords , dcDescription = description , cpCategory = Shared.stringify <$> lookupMeta "category" meta - , dcCreated = Nothing + , dcDate = + let t = Shared.stringify (docDate meta) + in if T.null t + then Nothing + else Just t , customProperties = customProperties' } -- cgit v1.2.3 From 5891f4f418694f71a4b553aa0518b620149a3466 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 18 Sep 2021 20:55:41 -0700 Subject: Use skylighting-0.12, skylighting-core-0.12. This fixes highlighting issues with typescript, scala, and other syntaxes that include keyword lists from different syntaxes. --- pandoc.cabal | 4 ++-- stack.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 4881fe3a4..333d9afdc 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -567,8 +567,8 @@ library random >= 1 && < 1.3, safe >= 0.3.18 && < 0.4, scientific >= 0.3 && < 0.4, - skylighting >= 0.11 && < 0.12, - skylighting-core >= 0.11 && < 0.12, + skylighting >= 0.12 && < 0.13, + skylighting-core >= 0.12 && < 0.13, split >= 0.2 && < 0.3, syb >= 0.1 && < 0.8, tagsoup >= 0.14.6 && < 0.15, diff --git a/stack.yaml b/stack.yaml index 75e01ee8b..5343c52be 100644 --- a/stack.yaml +++ b/stack.yaml @@ -7,8 +7,8 @@ flags: packages: - '.' extra-deps: -- skylighting-core-0.11 -- skylighting-0.11 +- skylighting-core-0.12 +- skylighting-0.12 - doctemplates-0.10 - git: https://github.com/jgm/texmath.git commit: 19700530733707284bb41f24add757f19ca23430 -- cgit v1.2.3 From 5684e6a76c6e180135349b6b4b049ac89faf5deb Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 18 Sep 2021 21:13:38 -0700 Subject: Alphabetize Extension constructors. --- src/Text/Pandoc/Extensions.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index f11e67723..b6d496eec 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -74,6 +74,7 @@ data Extension = | Ext_angle_brackets_escapable -- ^ Make < and > escapable | Ext_ascii_identifiers -- ^ ascii-only identifiers for headers; -- presupposes Ext_auto_identifiers + | Ext_attributes -- ^ Generic attribute syntax | Ext_auto_identifiers -- ^ Automatic identifiers for headers | Ext_autolink_bare_uris -- ^ Make all absolute URIs into links | Ext_backtick_code_blocks -- ^ GitHub style ``` code blocks @@ -105,6 +106,7 @@ data Extension = -- header identifiers; presupposes -- Ext_auto_identifiers | Ext_grid_tables -- ^ Grid tables (pandoc, reST) + | Ext_gutenberg -- ^ Use Project Gutenberg conventions for plain | Ext_hard_line_breaks -- ^ All newlines become hard line breaks | Ext_header_attributes -- ^ Explicit header attributes {#id .class k=v} | Ext_ignore_line_breaks -- ^ Newlines in paragraphs are ignored @@ -142,6 +144,7 @@ data Extension = | Ext_shortcut_reference_links -- ^ Shortcut reference links | Ext_simple_tables -- ^ Pandoc-style simple tables | Ext_smart -- ^ "Smart" quotes, apostrophes, ellipses, dashes + | Ext_sourcepos -- ^ Include source position attributes | Ext_space_in_atx_header -- ^ Require space between # and header text | Ext_spaced_reference_links -- ^ Allow space between two parts of ref link | Ext_startnum -- ^ Make start number of ordered list significant @@ -157,9 +160,6 @@ data Extension = | Ext_xrefs_name -- ^ Use xrefs with names | Ext_xrefs_number -- ^ Use xrefs with numbers | Ext_yaml_metadata_block -- ^ YAML metadata block - | Ext_gutenberg -- ^ Use Project Gutenberg conventions for plain - | Ext_attributes -- ^ Generic attribute syntax - | Ext_sourcepos -- ^ Include source position attributes deriving (Show, Read, Enum, Eq, Ord, Bounded, Data, Typeable, Generic) -- | Extensions to be used with pandoc-flavored markdown. -- cgit v1.2.3 From 92e0e424c059e568522b27ef438e651fe5b0a59b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 19 Sep 2021 09:12:55 -0700 Subject: Markdown writer: use `underline` class rather than `ul` for underline. This only affects output with bracketed_spans enabled. The markdown reader parses spans with either `.ul` or `.underline` as Underline elements, but we're moving towards preferring the latter. --- src/Text/Pandoc/Writers/Markdown/Inline.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs index f7a320db3..31c816e36 100644 --- a/src/Text/Pandoc/Writers/Markdown/Inline.hs +++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs @@ -307,7 +307,7 @@ inlineToMarkdown opts (Underline lst) = do case variant of PlainText -> return contents _ | isEnabled Ext_bracketed_spans opts -> - return $ "[" <> contents <> "]" <> "{.ul}" + return $ "[" <> contents <> "]" <> "{.underline}" | isEnabled Ext_native_spans opts -> return $ tagWithAttrs "span" ("", ["underline"], []) <> contents -- cgit v1.2.3 From ca20d5c10bb81147eb2342908ca87b453c8e5d78 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 19 Sep 2021 09:35:25 -0700 Subject: Fix changelog date for 2.14.2. --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index b0bde683a..3b7f5b270 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ # Revision history for pandoc -## pandoc 2.14.2 (provisional) +## pandoc 2.14.2 (2021-08-21) * Allow `--slide-level=0` (#7476). When the slide level is set to 0, headings won't be used at all in splitting the document -- cgit v1.2.3 From dd7b83ac9111b63786c1042c4849d7cea79c668b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 9 Sep 2021 18:32:37 -0700 Subject: Use babel, not polyglossia, with xelatex. Previously polyglossia worked better with xelatex, but that is no longer the case, so we simplify the code so that babel is used with all latex engines. This involves a change to the default LaTeX template. --- MANUAL.txt | 10 +++---- data/templates/default.latex | 14 +--------- src/Text/Pandoc/Writers/LaTeX.hs | 52 +++++------------------------------ src/Text/Pandoc/Writers/LaTeX/Lang.hs | 51 +--------------------------------- src/Text/Pandoc/Writers/LaTeX/Util.hs | 12 ++++---- test/writers-lang-and-dir.latex | 43 ++++++++--------------------- 6 files changed, 31 insertions(+), 151 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index c2c46e05f..3551b2a32 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -142,11 +142,11 @@ When using LaTeX, the following packages need to be available contains images), [`hyperref`], [`xcolor`], [`ulem`], [`geometry`] (with the `geometry` variable set), [`setspace`] (with `linestretch`), and -[`babel`] (with `lang`). The use of `xelatex` or `lualatex` as +[`babel`] (with `lang`). If `CJKmainfont` is set, [`xeCJK`] +is needed. The use of `xelatex` or `lualatex` as the PDF engine requires [`fontspec`]. `lualatex` uses -[`selnolig`]. `xelatex` uses [`polyglossia`] (with `lang`), -[`xecjk`], and [`bidi`] (with the `dir` variable set). If the -`mathspec` variable is set, `xelatex` will use [`mathspec`] +[`selnolig`]. `xelatex` uses [`bidi`] (with the `dir` variable set). +If the `mathspec` variable is set, `xelatex` will use [`mathspec`] instead of [`unicode-math`]. The [`upquote`] and [`microtype`] packages are used if available, and [`csquotes`] will be used for [typography] if the `csquotes` variable or metadata field is @@ -197,7 +197,7 @@ footnotes in tables). [`weasyprint`]: https://weasyprint.org [`wkhtmltopdf`]: https://wkhtmltopdf.org [`xcolor`]: https://ctan.org/pkg/xcolor -[`xecjk`]: https://ctan.org/pkg/xecjk +[`xeCJK`]: https://ctan.org/pkg/xecjk [`xurl`]: https://ctan.org/pkg/xurl [`selnolig`]: https://ctan.org/pkg/selnolig diff --git a/data/templates/default.latex b/data/templates/default.latex index d6a6208a9..27a3fc877 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -374,22 +374,10 @@ $for(header-includes)$ $header-includes$ $endfor$ $if(lang)$ -\ifXeTeX - % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic) - \usepackage{polyglossia} - \setmainlanguage[$for(polyglossia-lang.options)$$polyglossia-lang.options$$sep$,$endfor$]{$polyglossia-lang.name$} -$for(polyglossia-otherlangs)$ - \setotherlanguage[$for(polyglossia-otherlangs.options)$$polyglossia-otherlangs.options$$sep$,$endfor$]{$polyglossia-otherlangs.name$} -$endfor$ -\else - \usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} +\usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} % get rid of language-specific shorthands (see #6817): \let\LanguageShortHands\languageshorthands \def\languageshorthands#1{} -$if(babel-newcommands)$ - $babel-newcommands$ -$endif$ -\fi $endif$ \ifLuaTeX \usepackage{selnolig} % disable illegal ligatures diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index c365aebf5..8c45c8db5 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -21,15 +21,13 @@ module Text.Pandoc.Writers.LaTeX ( ) where import Control.Monad.State.Strict import Data.Char (isDigit) -import Data.List (intersperse, nubBy, (\\)) +import Data.List (intersperse, (\\)) import Data.Maybe (catMaybes, fromMaybe, isJust, mapMaybe, isNothing) -import qualified Data.Map as M import Data.Text (Text) import qualified Data.Text as T import Network.URI (unEscapeString) -import Text.DocTemplates (FromContext(lookupContext), renderTemplate, - Val(..), Context(..)) -import Text.Collate.Lang (Lang (..), renderLang) +import Text.DocTemplates (FromContext(lookupContext), renderTemplate) +import Text.Collate.Lang (renderLang) import Text.Pandoc.Class.PandocMonad (PandocMonad, report, toLang) import Text.Pandoc.Definition import Text.Pandoc.Highlighting (formatLaTeXBlock, formatLaTeXInline, highlight, @@ -46,7 +44,7 @@ import Text.Pandoc.Writers.LaTeX.Table (tableToLaTeX) import Text.Pandoc.Writers.LaTeX.Citation (citationsToNatbib, citationsToBiblatex) import Text.Pandoc.Writers.LaTeX.Types (LW, WriterState (..), startingState) -import Text.Pandoc.Writers.LaTeX.Lang (toPolyglossia, toBabel) +import Text.Pandoc.Writers.LaTeX.Lang (toBabel) import Text.Pandoc.Writers.LaTeX.Util (stringToLaTeX, StringContext(..), toLabel, inCmd, wrapDiv, hypertarget, labelFor, @@ -132,12 +130,6 @@ pandocToLaTeX options (Pandoc meta blocks) = do ,("tmargin","margin-top") ,("bmargin","margin-bottom") ] - let toPolyObj :: Lang -> Val Text - toPolyObj lang = MapVal $ Context $ - M.fromList [ ("name" , SimpleVal $ literal name) - , ("options" , SimpleVal $ literal opts) ] - where - (name, opts) = toPolyglossia lang mblang <- toLang $ case getLang options meta of Just l -> Just l Nothing | null docLangs -> Nothing @@ -216,36 +208,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do (literal $ toBabel l)) mblang $ defField "babel-otherlangs" (map (literal . toBabel) docLangs) - $ defField "babel-newcommands" (vcat $ - map (\(poly, babel) -> literal $ - -- \textspanish and \textgalician are already used by babel - -- save them as \oritext... and let babel use that - if poly `elem` ["spanish", "galician"] - then "\\let\\oritext" <> poly <> "\\text" <> poly <> "\n" <> - "\\AddBabelHook{" <> poly <> "}{beforeextras}" <> - "{\\renewcommand{\\text" <> poly <> "}{\\oritext" - <> poly <> "}}\n" <> - "\\AddBabelHook{" <> poly <> "}{afterextras}" <> - "{\\renewcommand{\\text" <> poly <> "}[2][]{\\foreignlanguage{" - <> poly <> "}{##2}}}" - else (if poly == "latin" -- see #4161 - then "\\providecommand{\\textlatin}{}\n\\renewcommand" - else "\\newcommand") <> "{\\text" <> poly <> - "}[2][]{\\foreignlanguage{" <> babel <> "}{#2}}\n" <> - "\\newenvironment{" <> poly <> - "}[2][]{\\begin{otherlanguage}{" <> - babel <> "}}{\\end{otherlanguage}}" - ) - -- eliminate duplicates that have same polyglossia name - $ nubBy (\a b -> fst a == fst b) - -- find polyglossia and babel names of languages used in the document - $ map (\l -> (fst $ toPolyglossia l, toBabel l)) docLangs - ) - $ maybe id (defField "polyglossia-lang" . toPolyObj) mblang - $ defField "polyglossia-otherlangs" - (ListVal (map toPolyObj docLangs :: [Val Text])) - $ - defField "latex-dir-rtl" + $ defField "latex-dir-rtl" ((render Nothing <$> getField "dir" context) == Just ("rtl" :: Text)) context return $ render colwidth $ @@ -771,9 +734,8 @@ inlineToLaTeX (Span (id',classes,kvs) ils) = do kvToCmd _ = Nothing langCmds = case lang of - Just lng -> let (l, o) = toPolyglossia lng - ops = if T.null o then "" else "[" <> o <> "]" - in ["text" <> l <> ops] + Just lng -> let l = toBabel lng + in ["foreignlanguage{" <> l <> "}"] Nothing -> [] let cmds = mapMaybe classToCmd classes ++ mapMaybe kvToCmd kvs ++ langCmds contents <- inlineListToLaTeX ils diff --git a/src/Text/Pandoc/Writers/LaTeX/Lang.hs b/src/Text/Pandoc/Writers/LaTeX/Lang.hs index 0ba68b74e..f6fa8d187 100644 --- a/src/Text/Pandoc/Writers/LaTeX/Lang.hs +++ b/src/Text/Pandoc/Writers/LaTeX/Lang.hs @@ -10,61 +10,12 @@ Portability : portable -} module Text.Pandoc.Writers.LaTeX.Lang - ( toPolyglossiaEnv, - toPolyglossia, - toBabel + ( toBabel ) where import Data.Text (Text) import Text.Collate.Lang (Lang(..)) --- In environments \Arabic instead of \arabic is used -toPolyglossiaEnv :: Lang -> (Text, Text) -toPolyglossiaEnv l = - case toPolyglossia l of - ("arabic", o) -> ("Arabic", o) - x -> x - --- Takes a list of the constituents of a BCP47 language code and --- converts it to a Polyglossia (language, options) tuple --- http://mirrors.ctan.org/macros/latex/contrib/polyglossia/polyglossia.pdf -toPolyglossia :: Lang -> (Text, Text) -toPolyglossia (Lang "ar" _ (Just "DZ") _ _ _) = ("arabic", "locale=algeria") -toPolyglossia (Lang "ar" _ (Just "IQ") _ _ _) = ("arabic", "locale=mashriq") -toPolyglossia (Lang "ar" _ (Just "JO") _ _ _) = ("arabic", "locale=mashriq") -toPolyglossia (Lang "ar" _ (Just "LB") _ _ _) = ("arabic", "locale=mashriq") -toPolyglossia (Lang "ar" _ (Just "LY") _ _ _) = ("arabic", "locale=libya") -toPolyglossia (Lang "ar" _ (Just "MA") _ _ _) = ("arabic", "locale=morocco") -toPolyglossia (Lang "ar" _ (Just "MR") _ _ _) = ("arabic", "locale=mauritania") -toPolyglossia (Lang "ar" _ (Just "PS") _ _ _) = ("arabic", "locale=mashriq") -toPolyglossia (Lang "ar" _ (Just "SY") _ _ _) = ("arabic", "locale=mashriq") -toPolyglossia (Lang "ar" _ (Just "TN") _ _ _) = ("arabic", "locale=tunisia") -toPolyglossia (Lang "de" _ _ vars _ _) - | "1901" `elem` vars = ("german", "spelling=old") -toPolyglossia (Lang "de" _ (Just "AT") vars _ _) - | "1901" `elem` vars = ("german", "variant=austrian, spelling=old") -toPolyglossia (Lang "de" _ (Just "AT") _ _ _) = ("german", "variant=austrian") -toPolyglossia (Lang "de" _ (Just "CH") vars _ _) - | "1901" `elem` vars = ("german", "variant=swiss, spelling=old") -toPolyglossia (Lang "de" _ (Just "CH") _ _ _) = ("german", "variant=swiss") -toPolyglossia (Lang "de" _ _ _ _ _) = ("german", "") -toPolyglossia (Lang "dsb" _ _ _ _ _) = ("lsorbian", "") -toPolyglossia (Lang "el" _ _ vars _ _) - | "polyton" `elem` vars = ("greek", "variant=poly") -toPolyglossia (Lang "en" _ (Just "AU") _ _ _) = ("english", "variant=australian") -toPolyglossia (Lang "en" _ (Just "CA") _ _ _) = ("english", "variant=canadian") -toPolyglossia (Lang "en" _ (Just "GB") _ _ _) = ("english", "variant=british") -toPolyglossia (Lang "en" _ (Just "NZ") _ _ _) = ("english", "variant=newzealand") -toPolyglossia (Lang "en" _ (Just "UK") _ _ _) = ("english", "variant=british") -toPolyglossia (Lang "en" _ (Just "US") _ _ _) = ("english", "variant=american") -toPolyglossia (Lang "grc" _ _ _ _ _) = ("greek", "variant=ancient") -toPolyglossia (Lang "hsb" _ _ _ _ _) = ("usorbian", "") -toPolyglossia (Lang "la" _ _ vars _ _) - | "x-classic" `elem` vars = ("latin", "variant=classic") -toPolyglossia (Lang "pt" _ (Just "BR") _ _ _) = ("portuguese", "variant=brazilian") -toPolyglossia (Lang "sl" _ _ _ _ _) = ("slovenian", "") -toPolyglossia x = (commonFromBcp47 x, "") - -- Takes a list of the constituents of a BCP47 language code and -- converts it to a Babel language string. -- http://mirrors.ctan.org/macros/latex/required/babel/base/babel.pdf diff --git a/src/Text/Pandoc/Writers/LaTeX/Util.hs b/src/Text/Pandoc/Writers/LaTeX/Util.hs index c34338121..d79326e0d 100644 --- a/src/Text/Pandoc/Writers/LaTeX/Util.hs +++ b/src/Text/Pandoc/Writers/LaTeX/Util.hs @@ -26,7 +26,7 @@ import Control.Monad (when) import Text.Pandoc.Class (PandocMonad, toLang) import Text.Pandoc.Options (WriterOptions(..), isEnabled) import Text.Pandoc.Writers.LaTeX.Types (LW, WriterState(..)) -import Text.Pandoc.Writers.LaTeX.Lang (toPolyglossiaEnv) +import Text.Pandoc.Writers.LaTeX.Lang (toBabel) import Text.Pandoc.Highlighting (toListingsLanguage) import Text.DocLayout import Text.Pandoc.Definition @@ -238,13 +238,11 @@ wrapDiv (_,classes,kvs) t = do Just "ltr" -> align "LTR" _ -> id wrapLang txt = case lang of - Just lng -> let (l, o) = toPolyglossiaEnv lng - ops = if T.null o - then "" - else brackets $ literal o - in inCmd "begin" (literal l) <> ops + Just lng -> let l = toBabel lng + in inCmd "begin" "otherlanguage" + <> (braces (literal l)) $$ blankline <> txt <> blankline - $$ inCmd "end" (literal l) + $$ inCmd "end" "otherlanguage" Nothing -> txt return $ wrapColumns . wrapColumn . wrapDir . wrapLang $ t diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index d91f77325..e7e5aa876 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -45,30 +45,10 @@ \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \setcounter{secnumdepth}{-\maxdimen} % remove section numbering -\ifXeTeX - % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic) - \usepackage{polyglossia} - \setmainlanguage[]{english} - \setotherlanguage[]{german} - \setotherlanguage[variant=british]{english} - \setotherlanguage[variant=swiss]{german} - \setotherlanguage[]{spanish} - \setotherlanguage[]{french} -\else - \usepackage[ngerman,british,nswissgerman,spanish,french,main=english]{babel} +\usepackage[ngerman,british,nswissgerman,spanish,french,main=english]{babel} % get rid of language-specific shorthands (see #6817): \let\LanguageShortHands\languageshorthands \def\languageshorthands#1{} - \newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}} - \newenvironment{german}[2][]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}} - \newcommand{\textenglish}[2][]{\foreignlanguage{british}{#2}} - \newenvironment{english}[2][]{\begin{otherlanguage}{british}}{\end{otherlanguage}} - \let\oritextspanish\textspanish - \AddBabelHook{spanish}{beforeextras}{\renewcommand{\textspanish}{\oritextspanish}} - \AddBabelHook{spanish}{afterextras}{\renewcommand{\textspanish}[2][]{\foreignlanguage{spanish}{##2}}} - \newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}} - \newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}} -\fi \ifLuaTeX \usepackage{selnolig} % disable illegal ligatures \fi @@ -123,18 +103,19 @@ word-that-includesa\LR{ltrspan}right? Some text and -\begin{german} +\begin{otherlanguage}{ngerman} German div contents -\end{german} +\end{otherlanguage} and more text. -Next paragraph with a \textenglish[variant=british]{British span} and a -word-that-includesa\textgerman[variant=swiss]{Swiss German span}right? +Next paragraph with a \foreignlanguage{british}{British span} and a +word-that-includesa\foreignlanguage{nswissgerman}{Swiss German +span}right? -Some \textspanish{Spanish text}. +Some \foreignlanguage{spanish}{Spanish text}. \hypertarget{combined}{% \section{Combined}\label{combined}} @@ -142,17 +123,17 @@ Some \textspanish{Spanish text}. Some text and \begin{RTL} -\begin{french} +\begin{otherlanguage}{french} French rtl div contents -\end{french} +\end{otherlanguage} \end{RTL} and more text. -Next paragraph with a \LR{\textenglish[variant=british]{British ltr -span}} and a word-that-includesa\LR{\textgerman[variant=swiss]{Swiss -German ltr span}}right? +Next paragraph with a \LR{\foreignlanguage{british}{British ltr span}} +and a word-that-includesa\LR{\foreignlanguage{nswissgerman}{Swiss German +ltr span}}right? \end{document} -- cgit v1.2.3 From 132a6df51e52463178711a648e848f6f73299dc8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 19 Sep 2021 10:10:45 -0700 Subject: Ignore (and gobble parameters of) CSLReferences environment. Otherwise we get the parameters as numbers in the output. Closes #7531. --- src/Text/Pandoc/Readers/LaTeX.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 5d3ff5f95..34eb53245 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -967,6 +967,7 @@ environments = M.union (tableEnvironments blocks inline) $ , ("toggletrue", braced >>= setToggle True) , ("togglefalse", braced >>= setToggle False) , ("iftoggle", try $ ifToggle >> block) + , ("CSLReferences", braced >> braced >> env "CSLReferences" blocks) ] filecontents :: PandocMonad m => LP m Blocks -- cgit v1.2.3 From c9ce6da1bb69edd5d81952e164fb32c3a0a8f344 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 19 Sep 2021 10:11:29 -0700 Subject: LaTeX reader: Recognize that `\vadjust` sometimes takes "pre". Closes #7531. --- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 9b84cdd21..7366d7b2d 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -941,6 +941,9 @@ getRawCommand name txt = do void $ count 4 braced "def" -> void $ manyTill anyTok braced + "vadjust" -> + void (manyTill anyTok braced) <|> + void (satisfyTok isPreTok) -- see #7531 _ | isFontSizeCommand name -> return () | otherwise -> do skipopts @@ -948,6 +951,10 @@ getRawCommand name txt = do void $ many braced return $ txt <> untokenize rawargs +isPreTok :: Tok -> Bool +isPreTok (Tok _ Word "pre") = True +isPreTok _ = False + isDigitTok :: Tok -> Bool isDigitTok (Tok _ Word t) = T.all isDigit t isDigitTok _ = False -- cgit v1.2.3 From 1cbaea673debae8bbfebbb7835a6145166fae67b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 20 Sep 2021 21:58:30 -0700 Subject: Stop doing lint in CI. The script failed for reasons I can't determine. For now, we disable it. --- .github/workflows/lint.yml | 33 --------------------------------- .github/workflows/lint.yml.bkp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/lint.yml.bkp diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index fb7d9d0b5..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Lint - -# Trigger the workflow on push or pull request, but only for the -# master branch -on: - pull_request: - branch: [master] - push: - branch: [master] - paths-ignore: - - LICENSE - - README.md - - CHANGELOG.md - - stack.yaml - - .travis.yml - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - env: - hlint_script: https://raw.github.com/ndmitchell/hlint/master/misc/run.sh - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Check cabal file for missing test files - run: make check-cabal - - - name: Download and run hlint - run: | - curl -sSL "${hlint_script}" | sh -s . diff --git a/.github/workflows/lint.yml.bkp b/.github/workflows/lint.yml.bkp new file mode 100644 index 000000000..13f4919da --- /dev/null +++ b/.github/workflows/lint.yml.bkp @@ -0,0 +1,33 @@ +name: Lint + +# Trigger the workflow on push or pull request, but only for the +# master branch +on: + pull_request: + branch: [master] + push: + branch: [master] + paths-ignore: + - LICENSE + - README.md + - CHANGELOG.md + - stack.yaml + - .travis.yml + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + env: + hlint_script: https://raw.github.com/ndmitchell/hlint/master/misc/run.sh + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Check cabal file for missing test files + run: make check-cabal + + - name: Download and run hlint + run: | + curl -sSL "${hlint_script}" | sh -s src app test -- cgit v1.2.3 From a1ca51c979849b5a29f54cd4eea49ca3d49cb4c9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Sep 2021 10:10:25 -0700 Subject: Command tests: raise error if command doesn't begin with `%`. --- test/Tests/Command.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/Tests/Command.hs b/test/Tests/Command.hs index c197fd11f..f437e026b 100644 --- a/test/Tests/Command.hs +++ b/test/Tests/Command.hs @@ -12,6 +12,7 @@ Run commands, and test results, defined in markdown files. module Tests.Command (runTest, tests) where +import Data.Maybe (fromMaybe) import Data.Algorithm.Diff import System.Environment (getExecutablePath) import qualified Data.ByteString as BS @@ -90,18 +91,19 @@ extractCode :: Block -> String extractCode (CodeBlock _ code) = T.unpack code extractCode _ = "" -dropPercent :: String -> String -dropPercent ('%':xs) = dropWhile (== ' ') xs -dropPercent xs = xs +dropPercent :: String -> Maybe String +dropPercent ('%':xs) = Just $ dropWhile (== ' ') xs +dropPercent _ = Nothing runCommandTest :: FilePath -> FilePath -> Int -> String -> TestTree -runCommandTest testExePath fp num code = +runCommandTest testExePath fp num code = do goldenTest testname getExpected getActual compareValues' updateGolden where testname = "#" <> show num codelines = lines code (continuations, r1) = span ("\\" `isSuffixOf`) codelines - cmd = dropPercent (unwords (map init continuations ++ take 1 r1)) + cmd = fromMaybe (error "Command test line does not begin with %") + (dropPercent (unwords (map init continuations ++ take 1 r1))) r2 = drop 1 r1 (inplines, r3) = break (=="^D") r2 normlines = takeWhile (/=".") (drop 1 r3) -- cgit v1.2.3 From 5f7e7f539a02818d0a94309b15d648d51d1eaee6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Sep 2021 10:16:45 -0700 Subject: Add missing `%` on command tests. This prevented `--accept` from working properly. --- test/command/1279.md | 2 +- test/command/1592.md | 2 +- test/command/2103.md | 2 +- test/command/3236.md | 2 +- test/command/3324.md | 2 +- test/command/3475.md | 8 ++++---- test/command/3518.md | 2 +- test/command/3706.md | 4 ++-- test/command/3880.md | 2 +- test/command/3983.md | 6 +++--- test/command/3989.md | 2 +- test/command/4007.md | 6 +++--- test/command/4012.md | 2 +- test/command/4016.md | 2 +- test/command/4019.md | 2 +- test/command/4068.md | 2 +- test/command/4119.md | 2 +- test/command/4306.md | 2 +- test/command/4528.md | 1 - test/command/4553.md | 4 ++-- test/command/4667.md | 2 +- test/command/4805-beamer-columns-alignment.md | 2 +- test/command/4833.md | 4 ++-- test/command/4842.md | 2 +- test/command/5050.md | 2 +- test/command/5080.md | 4 ++-- test/command/5128.md | 2 +- test/command/5182.md | 2 +- test/command/6658.md | 2 +- test/command/6836.md | 2 +- test/command/7216.md | 2 +- test/command/7529.md | 2 +- test/command/987.md | 2 +- test/command/ascii.md | 14 +++++++------- test/command/latex-command-comment.md | 2 +- 35 files changed, 51 insertions(+), 52 deletions(-) diff --git a/test/command/1279.md b/test/command/1279.md index d3572f245..522e399cf 100644 --- a/test/command/1279.md +++ b/test/command/1279.md @@ -1,5 +1,5 @@ ``` -pandoc -s -t markdown +% pandoc -s -t markdown --- author: 'John Doe[^1]' date: 2014 diff --git a/test/command/1592.md b/test/command/1592.md index 0f6151063..fb66f738a 100644 --- a/test/command/1592.md +++ b/test/command/1592.md @@ -41,7 +41,7 @@ ``` ``` -pandoc -f native -t markdown +% pandoc -f native -t markdown [Para [SmallCaps [Str "hi"]]] ^D [hi]{.smallcaps} diff --git a/test/command/2103.md b/test/command/2103.md index 14a522a5e..e5220def6 100644 --- a/test/command/2103.md +++ b/test/command/2103.md @@ -1,5 +1,5 @@ ``` -pandoc -t latex +% pandoc -t latex | A happy pandoc user said "fix this bug please | or I'll go crazy!" ^D diff --git a/test/command/3236.md b/test/command/3236.md index 1d1a9b2c3..2fcbb11f1 100644 --- a/test/command/3236.md +++ b/test/command/3236.md @@ -1,5 +1,5 @@ ``` -pandoc -f latex -t native +% pandoc -f latex -t native \newcommand{\mycolor}{red} \includegraphics[width=17cm]{\mycolor /header} diff --git a/test/command/3324.md b/test/command/3324.md index 9e9228ed1..45405fee5 100644 --- a/test/command/3324.md +++ b/test/command/3324.md @@ -1,5 +1,5 @@ ``` -pandoc -t latex +% pandoc -t latex Signatures \ diff --git a/test/command/3475.md b/test/command/3475.md index afba4ea3c..41a738f67 100644 --- a/test/command/3475.md +++ b/test/command/3475.md @@ -1,7 +1,7 @@ RST implicit internal links to headers: ``` -pandoc -f rst +% pandoc -f rst Years ----- @@ -12,7 +12,7 @@ Years_ ``` ``` -pandoc -f rst +% pandoc -f rst Years_ Years @@ -23,7 +23,7 @@ Years ``` ``` -pandoc -f rst +% pandoc -f rst Years and years --------------- @@ -34,7 +34,7 @@ Years and years ``` ``` -pandoc -f rst +% pandoc -f rst Years and *years* ----------------- diff --git a/test/command/3518.md b/test/command/3518.md index ec3322192..a4ba7a3a0 100644 --- a/test/command/3518.md +++ b/test/command/3518.md @@ -1,5 +1,5 @@ ``` -pandoc -f latex -t plain +% pandoc -f latex -t plain $\alpha^2 \cdot \alpha^{2+3} \equiv \alpha^7$ ^D α² ⋅ α² ⁺ ³ ≡ α⁷ diff --git a/test/command/3706.md b/test/command/3706.md index b6c2c6db1..361ff04f1 100644 --- a/test/command/3706.md +++ b/test/command/3706.md @@ -1,7 +1,7 @@ Results marker can be hidden in block attributes (#3706) ``` -pandoc -f org -t native +% pandoc -f org -t native #+begin_src r :exports results :colnames yes data.frame(Id = 1:3, Desc = rep("La",3)) #+end_src @@ -48,7 +48,7 @@ pandoc -f org -t native ``` ``` -pandoc -f org -t native +% pandoc -f org -t native #+begin_src R :exports none :colnames yes data.frame(Id = 1:2, Desc = rep("La",2)) #+end_src diff --git a/test/command/3880.md b/test/command/3880.md index b8edaf08f..700b44991 100644 --- a/test/command/3880.md +++ b/test/command/3880.md @@ -1,5 +1,5 @@ ``` -pandoc -f rst -t native +% pandoc -f rst -t native .. include:: command/3880.txt ^D [Para [Str "hi"]] diff --git a/test/command/3983.md b/test/command/3983.md index 5d83941e7..c2fbec32f 100644 --- a/test/command/3983.md +++ b/test/command/3983.md @@ -1,5 +1,5 @@ ``` -pandoc -f latex+raw_tex -t native +% pandoc -f latex+raw_tex -t native \def\filename@area{foo:bar:baz} \makeatletter \graphicspath\expandafter{\expandafter{\filename@area}}% @@ -10,7 +10,7 @@ pandoc -f latex+raw_tex -t native ``` ``` -pandoc -f latex+raw_tex -t native +% pandoc -f latex+raw_tex -t native \makeatletter \newcommand\urlfootnote@[1]{\footnote{\url@{#1}}} \DeclareRobustCommand{\urlfootnote}{\hyper@normalise\urlfootnote@} @@ -21,7 +21,7 @@ pandoc -f latex+raw_tex -t native ``` ``` -pandoc -f latex+raw_tex -t native +% pandoc -f latex+raw_tex -t native \def\foo{bar} \expandafter\bam\foo ^D diff --git a/test/command/3989.md b/test/command/3989.md index bf078b2e4..e0caaf50e 100644 --- a/test/command/3989.md +++ b/test/command/3989.md @@ -1,5 +1,5 @@ ``` -pandoc -f markdown -t native +% pandoc -f markdown -t native foo foo ^D diff --git a/test/command/4007.md b/test/command/4007.md index c6064e0f2..c18ea9366 100644 --- a/test/command/4007.md +++ b/test/command/4007.md @@ -1,5 +1,5 @@ ``` -pandoc -f latex -t native +% pandoc -f latex -t native \newcommand\arrow\to $a\arrow b$ ^D @@ -7,7 +7,7 @@ $a\arrow b$ ``` ``` -pandoc -f latex -t native +% pandoc -f latex -t native \newcommand\pfeil[1]{\to #1} $a\pfeil b$ ^D @@ -15,7 +15,7 @@ $a\pfeil b$ ``` ``` -pandoc -f latex -t native +% pandoc -f latex -t native \newcommand\fleche{\to} $a\fleche b$ ^D diff --git a/test/command/4012.md b/test/command/4012.md index 602c23219..9e32692d6 100644 --- a/test/command/4012.md +++ b/test/command/4012.md @@ -1,5 +1,5 @@ ``` -pandoc -f markdown-implicit_figures +% pandoc -f markdown-implicit_figures ![image] [image]: http://example.com/image.jpg {height=35mm} diff --git a/test/command/4016.md b/test/command/4016.md index 577ac1b09..8683c0056 100644 --- a/test/command/4016.md +++ b/test/command/4016.md @@ -1,5 +1,5 @@ ``` -pandoc -t beamer +% pandoc -t beamer # Level 2 blocks
diff --git a/test/command/4019.md b/test/command/4019.md index ab13f0233..641905b54 100644 --- a/test/command/4019.md +++ b/test/command/4019.md @@ -1,5 +1,5 @@ ``` -pandoc --wrap=preserve +% pandoc --wrap=preserve This works! This fails? ^D diff --git a/test/command/4068.md b/test/command/4068.md index 7b43a7084..ddd1aaee4 100644 --- a/test/command/4068.md +++ b/test/command/4068.md @@ -1,5 +1,5 @@ ``` -pandoc -f mediawiki -t native +% pandoc -f mediawiki -t native [https://domain.com/script.php?a=1&b=2&c=&d=4 open productname bugs] [http://domain.com?a=. open productname bugs] diff --git a/test/command/4119.md b/test/command/4119.md index c4efac30f..0f7da5fe0 100644 --- a/test/command/4119.md +++ b/test/command/4119.md @@ -1,5 +1,5 @@ ``` -pandoc -t native +% pandoc -t native | col1 | col2 | | ---- | ---- | | 1 | 2 | diff --git a/test/command/4306.md b/test/command/4306.md index f1267eb9b..82abd8005 100644 --- a/test/command/4306.md +++ b/test/command/4306.md @@ -1,5 +1,5 @@ ``` -pandoc -f latex -t native +% pandoc -f latex -t native \documentclass{article} \usepackage{hyperref} \begin{document} diff --git a/test/command/4528.md b/test/command/4528.md index a34af33c5..9b917f808 100644 --- a/test/command/4528.md +++ b/test/command/4528.md @@ -15,7 +15,6 @@ This has \textsc{small caps} in it. ^D This has small caps in it. ``` -``` ``` % pandoc --wrap=none -f latex -t markdown_strict+raw_html diff --git a/test/command/4553.md b/test/command/4553.md index e5122d4d9..c179a3567 100644 --- a/test/command/4553.md +++ b/test/command/4553.md @@ -1,5 +1,5 @@ ``` -pandoc -f latex -t native +% pandoc -f latex -t native foo \include{command/bar} ^D [Para [Str "foo"] @@ -7,7 +7,7 @@ foo \include{command/bar} ``` ``` -pandoc -f latex -t native +% pandoc -f latex -t native foo \input{command/bar} ^D [Para [Str "foo",Space,Emph [Str "hi",Space,Str "there"]]] diff --git a/test/command/4667.md b/test/command/4667.md index 1fff3708d..a4ea0a5f4 100644 --- a/test/command/4667.md +++ b/test/command/4667.md @@ -1,5 +1,5 @@ ``` -pandoc -t latex +% pandoc -t latex --- header-includes: - \newcommand{\blandscape}{\begin{landscape}} diff --git a/test/command/4805-beamer-columns-alignment.md b/test/command/4805-beamer-columns-alignment.md index bd1be0f20..d890730a8 100644 --- a/test/command/4805-beamer-columns-alignment.md +++ b/test/command/4805-beamer-columns-alignment.md @@ -1,5 +1,5 @@ ``` -pandoc -t beamer +% pandoc -t beamer :::: { .columns } ::: { .column align=center } ::: diff --git a/test/command/4833.md b/test/command/4833.md index 42001ec74..838fe1463 100644 --- a/test/command/4833.md +++ b/test/command/4833.md @@ -1,5 +1,5 @@ ``` -pandoc -f native -t rst +% pandoc -f native -t rst [Div ("",["warning"],[]) [Div ("",["title"],[]) [Para [Str "Warning"]] @@ -10,7 +10,7 @@ pandoc -f native -t rst Hi ``` ``` -pandoc -f native -t rst +% pandoc -f native -t rst [Div ("",["unknown"],[]) [Para [Str "Hi"]]] ^D diff --git a/test/command/4842.md b/test/command/4842.md index a311739b7..0403c4d11 100644 --- a/test/command/4842.md +++ b/test/command/4842.md @@ -1,5 +1,5 @@ ``` -pandoc -f latex -t native +% pandoc -f latex -t native \l ^D [Para [Str "\322"]] diff --git a/test/command/5050.md b/test/command/5050.md index 9c8fa1655..735156105 100644 --- a/test/command/5050.md +++ b/test/command/5050.md @@ -1,5 +1,5 @@ ``` -pandoc -t rst +% pandoc -t rst x ^D diff --git a/test/command/5080.md b/test/command/5080.md index c9e9a2971..2dfd0683a 100644 --- a/test/command/5080.md +++ b/test/command/5080.md @@ -1,12 +1,12 @@ ``` -pandoc -t asciidoc +% pandoc -t asciidoc [foo *bar*]{.small .red key=val} ^D [.small .red]#foo _bar_# ``` ``` -pandoc -f html -t asciidoc +% pandoc -f html -t asciidoc SMALL ^D [.small]#SMALL# diff --git a/test/command/5128.md b/test/command/5128.md index 35866547e..261cea507 100644 --- a/test/command/5128.md +++ b/test/command/5128.md @@ -1,5 +1,5 @@ ``` -pandoc -f org -t rst --columns=78 +% pandoc -f org -t rst --columns=78 | Option | Meaning | |--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | =<= | Left alignment, additional characters are added to the right (default for string). | diff --git a/test/command/5182.md b/test/command/5182.md index dc30a12ce..e11dd29f0 100644 --- a/test/command/5182.md +++ b/test/command/5182.md @@ -1,5 +1,5 @@ ``` -pandoc -f rst -t native +% pandoc -f rst -t native .. include:: command/5182.txt ^D [CodeBlock ("",["python","numberLines"],[]) "def func(x):\n return y"] diff --git a/test/command/6658.md b/test/command/6658.md index 96700c8fe..c4e5dbf3a 100644 --- a/test/command/6658.md +++ b/test/command/6658.md @@ -1,5 +1,5 @@ ``` -pandoc -f latex -t html +% pandoc -f latex -t html \num{12345,67890} \num{1+-2i} diff --git a/test/command/6836.md b/test/command/6836.md index c35048045..733318b69 100644 --- a/test/command/6836.md +++ b/test/command/6836.md @@ -1,5 +1,5 @@ ``` -pandoc -t native +% pandoc -t native [@buchanan] (@foo) diff --git a/test/command/7216.md b/test/command/7216.md index cab3b9689..2fb99c7b5 100644 --- a/test/command/7216.md +++ b/test/command/7216.md @@ -1,5 +1,5 @@ ``` -pandoc -t latex +% pandoc -t latex "This is some text in quotes. Another paragraph by the same speaker follows. The first paragraph should have no close quote. "The second paragraph should have open and close quotes." diff --git a/test/command/7529.md b/test/command/7529.md index f0c443d73..9515258e9 100644 --- a/test/command/7529.md +++ b/test/command/7529.md @@ -1,5 +1,5 @@ ``` -pandoc -f html -t asciidoc +% pandoc -f html -t asciidoc https://example.com/show.cgi?id=hi--there--everyone ^D link:++https://example.com/show.cgi?id=hi--there--everyone++[] diff --git a/test/command/987.md b/test/command/987.md index f632231ef..fc75d2c56 100644 --- a/test/command/987.md +++ b/test/command/987.md @@ -1,5 +1,5 @@ ``` -pandoc -f latex -t markdown +% pandoc -f latex -t markdown \documentclass{article} \newenvironment{flubble}{FOO}{BAR} \begin{document} diff --git a/test/command/ascii.md b/test/command/ascii.md index 0826d7414..a328ed863 100644 --- a/test/command/ascii.md +++ b/test/command/ascii.md @@ -1,19 +1,19 @@ ``` -pandoc -t html --ascii +% pandoc -t html --ascii äéıå ^D

äéıå

``` ``` -pandoc -t latex --ascii +% pandoc -t latex --ascii äéıå ^D \"{a}\'{e}\i\r{a} ``` ``` -pandoc -t man --ascii +% pandoc -t man --ascii äéıå ^D .PP @@ -21,7 +21,7 @@ pandoc -t man --ascii ``` ``` -pandoc -t ms --ascii +% pandoc -t ms --ascii äéıå ^D .LP @@ -29,7 +29,7 @@ pandoc -t ms --ascii ``` ``` -pandoc -t docbook --ascii +% pandoc -t docbook --ascii äéıå ^D @@ -38,14 +38,14 @@ pandoc -t docbook --ascii ``` ``` -pandoc -t jats --ascii +% pandoc -t jats --ascii äéıå ^D

äéıå

``` ``` -pandoc -t markdown-smart --ascii +% pandoc -t markdown-smart --ascii "äéıå" ^D “äéıå” diff --git a/test/command/latex-command-comment.md b/test/command/latex-command-comment.md index 640277f15..af679afba 100644 --- a/test/command/latex-command-comment.md +++ b/test/command/latex-command-comment.md @@ -1,5 +1,5 @@ ``` -pandoc -f latex -t native +% pandoc -f latex -t native \emph% {hi} ^D -- cgit v1.2.3 From c266734448544a118ed80e47deaa2590131c7f84 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 19 Sep 2021 12:09:51 -0700 Subject: Use pretty-simple to format native output. Previously we used our own homespun formatting. But this produces over-long lines that aren't ideal for diffs in tests. Easier to use something off-the-shelf and standard. Closes #7580. Performance is slower by about a factor of 10, but this isn't really a problem because native isn't suitable as a serialization format. (For serialization you should use json, because the reader is so much faster than native.) --- pandoc.cabal | 3 +- src/Text/Pandoc/Writers/Native.hs | 88 +- test/Tests/Old.hs | 6 +- test/command/1390.md | 4 +- test/command/1592.md | 44 +- test/command/1608.md | 189 +- test/command/168.md | 46 +- test/command/1718.md | 8 +- test/command/1773.md | 2 +- test/command/1881.md | 175 +- test/command/2118.md | 8 +- test/command/2549.md | 13 +- test/command/256.md | 34 +- test/command/3113.md | 4 +- test/command/3123.md | 6 +- test/command/3236.md | 14 +- test/command/3257.md | 4 +- test/command/3348.md | 77 +- test/command/3401.md | 4 +- test/command/3407.md | 4 +- test/command/3510.md | 23 +- test/command/3511.md | 47 +- test/command/3516.md | 60 +- test/command/3530.md | 58 +- test/command/3533-rst-csv-tables.md | 282 +- test/command/3534.md | 42 +- test/command/3537.md | 6 +- test/command/3539.md | 248 +- test/command/3558.md | 10 +- test/command/3585.md | 28 +- test/command/3587.md | 108 +- test/command/3681.md | 48 +- test/command/3706.md | 104 +- test/command/3708.md | 58 +- test/command/3733.md | 9 +- test/command/3755.md | 36 +- test/command/3779.md | 41 +- test/command/3794.md | 3 +- test/command/3804.md | 4 +- test/command/3853.md | 10 +- test/command/3880.md | 2 +- test/command/3916.md | 16 +- test/command/3947.md | 7 +- test/command/3958.md | 6 +- test/command/3971.md | 2 +- test/command/3983.md | 16 +- test/command/3989.md | 19 +- test/command/4007.md | 6 +- test/command/4054.md | 12 +- test/command/4056.md | 58 +- test/command/4063.md | 40 +- test/command/4068.md | 23 +- test/command/4119.md | 69 +- test/command/4134.md | 7 +- test/command/4159.md | 7 +- test/command/4162.md | 5 +- test/command/4183.md | 8 +- test/command/4186.md | 7 +- test/command/4193.md | 4 +- test/command/4199.md | 2 +- test/command/4240.md | 28 +- test/command/4253.md | 2 +- test/command/4280.md | 2 +- test/command/4281.md | 20 +- test/command/4284.md | 80 +- test/command/4306.md | 15 +- test/command/4374.md | 15 +- test/command/4382.md | 4 +- test/command/4424.md | 2 +- test/command/4454.md | 4 +- test/command/4499.md | 4 +- test/command/4513.md | 43 +- test/command/4528.md | 1 + test/command/4553.md | 5 +- test/command/4576.md | 2 +- test/command/4579.md | 64 +- test/command/4624.md | 16 +- test/command/4635.md | 8 +- test/command/4669.md | 26 +- test/command/4715.md | 24 +- test/command/4722.md | 57 +- test/command/4742.md | 36 +- test/command/4743.md | 24 +- test/command/4781.md | 22 +- test/command/4811.md | 24 +- test/command/4817.md | 15 +- test/command/4819.md | 24 +- test/command/4832.md | 24 +- test/command/4842.md | 2 +- test/command/4845.md | 12 +- test/command/4848.md | 67 +- test/command/4860.md | 13 +- test/command/4877.md | 4 +- test/command/4919.md | 7 +- test/command/4928.md | 192 +- test/command/4933.md | 2 +- test/command/5014.md | 45 +- test/command/5079.md | 32 +- test/command/5099.md | 18 +- test/command/5178.md | 17 +- test/command/5182.md | 4 +- test/command/5271.md | 33 +- test/command/5285.md | 27 +- test/command/5321.md | 12 +- test/command/5360.md | 26 +- test/command/5368.md | 32 +- test/command/5410.md | 2 +- test/command/5416.md | 4 +- test/command/5540.md | 8 +- test/command/5549.md | 3 +- test/command/5619.md | 29 +- test/command/5682.md | 2 +- test/command/5686.md | 26 +- test/command/5700.md | 38 +- test/command/5708.md | 44 +- test/command/5711.md | 32 +- test/command/5714.md | 15 +- test/command/5753.md | 7 +- test/command/5795.md | 7 +- test/command/5797.md | 2 +- test/command/5805.md | 2 +- test/command/5845.md | 20 +- test/command/5878.md | 12 +- test/command/6009.md | 19 +- test/command/6026.md | 30 +- test/command/6034.md | 4 +- test/command/6114.md | 8 +- test/command/6137.md | 162 +- test/command/6288.md | 2 +- test/command/6324.md | 12 +- test/command/6699.md | 8 +- test/command/6709.md | 2 +- test/command/6719.md | 4 +- test/command/6791.md | 40 +- test/command/6802.md | 4 +- test/command/6836.md | 36 +- test/command/6844.md | 6 +- test/command/6869.md | 16 +- test/command/6873.md | 35 +- test/command/6890.md | 113 +- test/command/6993.md | 6 +- test/command/7003.md | 21 +- test/command/7080.md | 7 +- test/command/7092.md | 2 +- test/command/7129.md | 60 +- test/command/7134.md | 45 +- test/command/7145.md | 65 +- test/command/7155.md | 22 +- test/command/7339.md | 7 +- test/command/7340.md | 2 +- test/command/7400.md | 4 +- test/command/7434.md | 14 +- test/command/7436.md | 25 +- test/command/7557.md | 18 +- test/command/934.md | 35 +- test/command/982.md | 2 +- test/command/adjacent_latex_blocks.md | 7 +- test/command/cite-in-inline-note.md | 22 +- test/command/citeproc-author-in-text-suffix.md | 24 +- test/command/csv.md | 129 +- test/command/docbook-bibliography.md | 35 +- test/command/dots.md | 4 +- test/command/empty_paragraphs.md | 22 +- test/command/gfm.md | 131 +- test/command/hspace.md | 22 +- test/command/html-read-figure.md | 22 +- test/command/html-trim-definition-list-terms.md | 12 +- test/command/hyphenat.md | 22 +- test/command/ifstrequal.md | 4 +- test/command/indented-fences.md | 4 +- test/command/input-with-endinput.md | 10 +- test/command/latex-center.md | 3 +- test/command/latex-color.md | 136 +- test/command/latex-command-comment.md | 2 +- test/command/latex-fontawesome.md | 4 +- test/command/latex-tabular-column-specs.md | 106 +- test/command/lettrine.md | 21 +- test/command/lstlisting.md | 30 +- test/command/macro-defs-in-preamble.md | 13 +- test/command/md-abbrevs.md | 4 +- test/command/multiple-metadata-blocks.md | 6 +- test/command/refs.md | 220 +- test/command/setext-fenced-div.md | 3 +- test/command/shift-heading-level-by.md | 31 +- test/command/sloppypar.md | 214 +- test/command/table-with-cell-align.md | 64 +- test/command/table-with-column-span.md | 224 +- test/command/tabularx.md | 393 +- test/command/translations.md | 8 +- test/command/write18.md | 4 +- test/command/yaml-metadata-blocks.md | 96 +- test/command/yaml-with-chomp.md | 13 +- test/creole-reader.native | 1124 +- test/docbook-chapter.native | 184 +- test/docbook-reader.native | 3639 ++++++- test/docbook-xref.native | 213 +- test/epub/features.native | 1837 +++- test/epub/formatting.native | 6791 +++++++++++- test/epub/wasteland.native | 12347 ++++++++++++++++++++-- test/fb2/reader/emphasis.native | 44 +- test/fb2/reader/epigraph.native | 27 +- test/fb2/reader/meta.native | 45 +- test/fb2/reader/notes.native | 28 +- test/fb2/reader/poem.native | 40 +- test/fb2/reader/titles.native | 41 +- test/haddock-reader.native | 463 +- test/html-reader.native | 4202 ++++++-- test/ipynb/simple.out.native | 121 +- test/jats-reader.native | 3564 +++++-- test/jira-reader.native | 1209 ++- test/latex-reader.native | 2935 ++++- test/lhs-test-markdown.native | 138 +- test/lhs-test.native | 138 +- test/man-reader.native | 1286 ++- test/markdown-citations.native | 556 +- test/markdown-reader-more.native | 1538 ++- test/mediawiki-reader.native | 1862 +++- test/opml-reader.native | 298 +- test/org-select-tags.native | 106 +- test/pipe-tables.native | 1176 ++- test/rst-reader.native | 2317 +++- test/rtf/accent.native | 20 +- test/rtf/bookmark.native | 14 +- test/rtf/footnote.native | 132 +- test/rtf/formatting.native | 61 +- test/rtf/heading.native | 19 +- test/rtf/image.native | 11 +- test/rtf/link.native | 7 +- test/rtf/list_complex.native | 108 +- test/rtf/list_simple.native | 19 +- test/rtf/table_error_codes.native | 515 +- test/rtf/table_simple.native | 99 +- test/rtf/unicode.native | 5 +- test/tables-rstsubset.native | 1214 ++- test/tables.haddock | 60 +- test/tables.markdown | 28 +- test/tables.muse | 48 +- test/tables.native | 1184 ++- test/tables.opendocument | 4 +- test/tables.plain | 28 +- test/tables.rst | 60 +- test/tables/planets.latex | 8 +- test/testsuite.native | 2900 ++++- test/textile-reader.native | 1560 ++- test/tikiwiki-reader.native | 973 +- test/twiki-reader.native | 1125 +- test/txt2tags.native | 6168 +++++++++-- test/vimwiki-reader.native | 2868 ++++- test/writer.asciidoc | 12 +- test/writer.asciidoctor | 16 +- test/writer.context | 12 +- test/writer.docbook4 | 32 +- test/writer.docbook5 | 35 +- test/writer.haddock | 43 +- test/writer.jats_archiving | 28 +- test/writer.jats_articleauthoring | 20 +- test/writer.jats_publishing | 28 +- test/writer.latex | 17 +- test/writer.man | 18 +- test/writer.markdown | 45 +- test/writer.ms | 12 +- test/writer.muse | 16 +- test/writer.native | 2794 ++++- test/writer.opendocument | 77 +- test/writer.org | 15 +- test/writer.plain | 38 +- test/writer.rst | 4 +- test/writer.tei | 22 +- test/writer.texinfo | 26 +- 269 files changed, 65524 insertions(+), 11857 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 333d9afdc..7003abe2c 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -583,7 +583,8 @@ library xml-conduit >= 1.9.1.1 && < 1.10, unicode-collation >= 0.1.1 && < 0.2, zip-archive >= 0.2.3.4 && < 0.5, - zlib >= 0.5 && < 0.7 + zlib >= 0.5 && < 0.7, + pretty-simple >= 4.0 && < 4.1 if os(windows) && arch(i386) build-depends: basement >= 0.0.10, foundation >= 0.0.23 diff --git a/src/Text/Pandoc/Writers/Native.hs b/src/Text/Pandoc/Writers/Native.hs index 9c2ce805d..67af39a31 100644 --- a/src/Text/Pandoc/Writers/Native.hs +++ b/src/Text/Pandoc/Writers/Native.hs @@ -12,82 +12,24 @@ Conversion of a 'Pandoc' document to a string representation. -} module Text.Pandoc.Writers.Native ( writeNative ) where -import Data.List (intersperse) import Data.Text (Text) +import qualified Data.Text.Lazy as TL import Text.Pandoc.Class.PandocMonad (PandocMonad) import Text.Pandoc.Definition -import Text.Pandoc.Options (WrapOption (..), WriterOptions (..)) -import Text.DocLayout - -prettyList :: [Doc Text] -> Doc Text -prettyList ds = - "[" <> - mconcat (intersperse (cr <> ",") $ map (nest 1) ds) <> "]" - --- | Prettyprint Pandoc block element. -prettyBlock :: Block -> Doc Text -prettyBlock (LineBlock lines') = - "LineBlock" $$ prettyList (map (text . show) lines') -prettyBlock (BlockQuote blocks) = - "BlockQuote" $$ prettyList (map prettyBlock blocks) -prettyBlock (OrderedList attribs blockLists) = - "OrderedList" <> space <> text (show attribs) $$ - prettyList (map (prettyList . map prettyBlock) blockLists) -prettyBlock (BulletList blockLists) = - "BulletList" $$ - prettyList (map (prettyList . map prettyBlock) blockLists) -prettyBlock (DefinitionList items) = "DefinitionList" $$ - prettyList (map deflistitem items) - where deflistitem (term, defs) = "(" <> text (show term) <> "," <> cr <> - nest 1 (prettyList $ map (prettyList . map prettyBlock) defs) <> ")" -prettyBlock (Table attr blkCapt specs thead tbody tfoot) = - mconcat [ "Table " - , text (show attr) - , " " - , prettyCaption blkCapt ] $$ - prettyList (map (text . show) specs) $$ - prettyHead thead $$ - prettyBodies tbody $$ - prettyFoot tfoot - where prettyRows = prettyList . map prettyRow - prettyRow (Row a body) = - text ("Row " <> show a) $$ prettyList (map prettyCell body) - prettyCell (Cell a ma h w b) = - mconcat [ "Cell " - , text (show a) - , " " - , text (show ma) - , " (" - , text (show h) - , ") (" - , text (show w) - , ")" ] $$ - prettyList (map prettyBlock b) - prettyCaption (Caption mshort body) = - "(Caption " <> text (showsPrec 11 mshort "") $$ prettyList (map prettyBlock body) <> ")" - prettyHead (TableHead thattr body) - = "(TableHead " <> text (show thattr) $$ prettyRows body <> ")" - prettyBody (TableBody tbattr rhc hd bd) - = mconcat [ "(TableBody " - , text (show tbattr) - , " (" - , text (show rhc) - , ")" ] $$ prettyRows hd $$ prettyRows bd <> ")" - prettyBodies = prettyList . map prettyBody - prettyFoot (TableFoot tfattr body) - = "(TableFoot " <> text (show tfattr) $$ prettyRows body <> ")" -prettyBlock (Div attr blocks) = - text ("Div " <> show attr) $$ prettyList (map prettyBlock blocks) -prettyBlock block = text $ show block +import Text.Pandoc.Options (WriterOptions (..)) +import Text.Pretty.Simple (pShowOpt, defaultOutputOptionsNoColor, + OutputOptions(..), StringOutputStyle(..)) -- | Prettyprint Pandoc document. writeNative :: PandocMonad m => WriterOptions -> Pandoc -> m Text -writeNative opts (Pandoc meta blocks) = return $ - let colwidth = if writerWrapText opts == WrapAuto - then Just $ writerColumns opts - else Nothing - withHead = case writerTemplate opts of - Just _ -> \bs -> text ("Pandoc (" ++ show meta ++ ")") $$ - bs $$ cr - Nothing -> id - in render colwidth $ withHead $ prettyList $ map prettyBlock blocks +writeNative opts (Pandoc meta blocks) = do + let popts = defaultOutputOptionsNoColor{ + outputOptionsIndentAmount = 2, + outputOptionsPageWidth = writerColumns opts, + outputOptionsCompact = True, + outputOptionsCompactParens = False, + outputOptionsStringStyle = Literal } + return $ + case writerTemplate opts of + Just _ -> TL.toStrict $ pShowOpt popts (Pandoc meta blocks) <> "\n" + Nothing -> TL.toStrict $ pShowOpt popts blocks diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs index 4baa16d45..d080f68f1 100644 --- a/test/Tests/Old.hs +++ b/test/Tests/Old.hs @@ -146,7 +146,7 @@ tests pandocPath = "dokuwiki_external_images.native" "dokuwiki_external_images.dokuwiki" ] , testGroup "opml" - [ test' "basic" ["-r", "native", "-w", "opml", "--columns=78", "-s"] + [ test' "basic" ["-r", "native", "-w", "opml", "--columns=80", "-s"] "testsuite.native" "writer.opml" , test' "reader" ["-r", "opml", "-w", "native", "-s"] "opml-reader.opml" "opml-reader.native" @@ -262,7 +262,7 @@ writerTests pandocPath format "tables" opts "tables.native" ("tables" <.> format) ] where - opts = ["-r", "native", "-w", format, "--columns=78", + opts = ["-r", "native", "-w", format, "--columns=80", "--variable", "pandoc-version="] extendedWriterTests :: FilePath -> String -> [TestTree] @@ -276,7 +276,7 @@ extendedWriterTests pandocPath format ("tables" name <.> format) in map testForTable ["planets", "nordics", "students"] where - opts = ["-r", "native", "-w", format, "--columns=78", + opts = ["-r", "native", "-w", format, "--columns=80", "--variable", "pandoc-version="] s5WriterTest :: FilePath -> String -> [String] -> String -> TestTree diff --git a/test/command/1390.md b/test/command/1390.md index ffd2cef8d..1d479dc94 100644 --- a/test/command/1390.md +++ b/test/command/1390.md @@ -3,7 +3,9 @@ \newcommand\foo{+} Testing: $\mu\foo\eta$. ^D -[Para [Str "Testing:",Space,Math InlineMath "\\mu+\\eta",Str "."]] +[ Para + [ Str "Testing:", Space, Math InlineMath "\\mu+\\eta", Str "." ] +] ``` " -,Para [Str "Just",Space,Str "plain",Space,Str "comment,",Space,Str "with",Space,Str "trailing",Space,Str "spaces",Space,Str "on",Space,Str "the",Space,Str "line:"] -,Para [Str "Code:"] -,CodeBlock ("",[],[]) "
" -,Para [Str "Hr\8217s:"] -,Div ("",["center"],[]) - [HorizontalRule] -,Header 1 ("inline-markup",[],[]) [Str "Inline",Space,Str "Markup"] -,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."] -,Para [Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str "."] -,Para [Str "An",Space,Emph [Link ("",[],[]) [Str "emphasized",Space,Str "link"] ("/url","")],Str "."] -,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]] -,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."] -,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]] -,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."] -,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",SoftBreak,Code ("",[],[]) "",Str "."] -,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "strikeout"],Str "."]] -,Para [Str "Superscripts:",Space,Str "a",Superscript [Str "bc"],Str "d",SoftBreak,Str "a",Superscript [Emph [Str "hello"]],Space,Str "a",Superscript [Str "hello",Space,Str "there"],Str "."] -,Para [Str "Subscripts:",Space,Str "H",Subscript [Str "2"],Str "O,",Space,Str "H",Subscript [Str "23"],Str "O,",SoftBreak,Str "H",Subscript [Str "many",Space,Str "of",Space,Str "them"],Str "O."] -,Para [Str "These",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "superscripts",Space,Str "or",Space,Str "subscripts,",Space,Str "because",Space,Str "of",Space,Str "the",SoftBreak,Str "unescaped",Space,Str "spaces:",Space,Str "a^b",Space,Str "c^d,",Space,Str "a",Math InlineMath "\\sim",Str "b",SoftBreak,Str "c",Math InlineMath "\\sim",Str "d."] -,Div ("",["center"],[]) - [HorizontalRule] -,Header 1 ("smart-quotes-ellipses-dashes",[],[]) [Str "Smart",Space,Str "quotes,",Space,Str "ellipses,",Space,Str "dashes"] -,Para [Quoted DoubleQuote [Str "Hello,"],Space,Str "said",Space,Str "the",Space,Str "spider.",Space,Quoted DoubleQuote [Str "\8198",Quoted SingleQuote [Str "Shelob"],Space,Str "is",Space,Str "my",Space,Str "name."]] -,Para [Quoted SingleQuote [Str "A"],Str ",",Space,Quoted SingleQuote [Str "B"],Str ",",Space,Str "and",Space,Quoted SingleQuote [Str "C"],Space,Str "are",Space,Str "letters."] -,Para [Quoted SingleQuote [Str "Oak,"],Space,Quoted SingleQuote [Str "elm,"],Space,Str "and",Space,Quoted SingleQuote [Str "beech"],Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees.",Space,Str "So",Space,Str "is",Space,Quoted SingleQuote [Str "pine."]] -,Para [Quoted SingleQuote [Str "He",Space,Str "said,",Space,Quoted DoubleQuote [Str "I",Space,Str "want",Space,Str "to",Space,Str "go."],Str "\8198"],Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70\8217s?"] -,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code ("",[],[]) "code"],Space,Str "and",Space,Str "a",SoftBreak,Quoted DoubleQuote [Link ("",[],[]) [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."] -,Para [Str "Some",Space,Str "dashes:",Space,Str "one\8212two\8212three\8212four\8212five."] -,Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5\8211\&7,",Space,Str "255\8211\&66,",Space,Str "1987\8211\&1999."] -,Para [Str "Ellipses\8230and\8230and\8230."] -,Div ("",["center"],[]) - [HorizontalRule] -,Header 1 ("latex",[],[]) [Str "LaTeX"] -,BulletList - [[Para [Cite [Citation {citationId = "smith.1899", citationPrefix = [], citationSuffix = [Str "22-23"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [RawInline (Format "latex") "\\cite[22-23]{smith.1899}"]]] - ,[RawBlock (Format "latex") "\\doublespacing"] - ,[Para [Math InlineMath "2+2=4"]] - ,[Para [Math InlineMath "x \\in y"]] - ,[Para [Math InlineMath "\\alpha \\wedge \\omega"]] - ,[Para [Math InlineMath "223"]] - ,[Para [Math InlineMath "p",Str "-Tree"]] - ,[Para [Math InlineMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"]] - ,[Para [Str "Here\8217s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",SoftBreak,Math InlineMath "\\alpha + \\omega \\times x^2",Str "."]]] -,Para [Str "These",Space,Str "shouldn\8217t",Space,Str "be",Space,Str "math:"] -,BulletList - [[Para [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code ("",[],[]) "$e = mc^2$",Str "."]] - ,[Para [Str "$22,000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money.",Space,Str "So",Space,Str "is",Space,Str "$34,000.",Space,Str "(It",Space,Str "worked",Space,Str "if",SoftBreak,Quoted DoubleQuote [Str "lot"],Space,Str "is",Space,Str "emphasized.)"]] - ,[Para [Str "Escaped",Space,Code ("",[],[]) "$",Str ":",Space,Str "$73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23$."]]] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignLeft,ColWidthDefault) - ,(AlignLeft,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Animal"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Number"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Dog"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cat"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "A",Space,Str "table",Space,Str "with",Space,Str "one",Space,Str "column:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Animal"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Vegetable"]]]])] - (TableFoot ("",[],[]) - []) -,Div ("",["center"],[]) - [HorizontalRule] -,Header 1 ("special-characters",[],[]) [Str "Special",Space,Str "Characters"] -,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode:"] -,BulletList - [[Para [Str "I",Space,Str "hat:",Space,Str "\206"]] - ,[Para [Str "o",Space,Str "umlaut:",Space,Str "\246"]] - ,[Para [Str "section:",Space,Str "\167"]] - ,[Para [Str "set",Space,Str "membership:",Space,Str "\8712"]] - ,[Para [Str "copyright:",Space,Str "\169"]]] -,Para [Str "AT&T",Space,Str "has",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "their",Space,Str "name."] -,Para [Str "AT&T",Space,Str "is",Space,Str "another",Space,Str "way",Space,Str "to",Space,Str "write",Space,Str "it."] -,Para [Str "This",Space,Str "&",Space,Str "that."] -,Para [Str "4",Space,Str "<",Space,Str "5."] -,Para [Str "6",Space,Str ">",Space,Str "5."] -,Para [Str "Backslash:",Space,Str "\\"] -,Para [Str "Backtick:",Space,Str "\8216"] -,Para [Str "Asterisk:",Space,Str "*"] -,Para [Str "Underscore:",Space,Str "_"] -,Para [Str "Left",Space,Str "brace:",Space,Str "{"] -,Para [Str "Right",Space,Str "brace:",Space,Str "}"] -,Para [Str "Left",Space,Str "bracket:",Space,Str "["] -,Para [Str "Right",Space,Str "bracket:",Space,Str "]"] -,Para [Str "Left",Space,Str "paren:",Space,Str "("] -,Para [Str "Right",Space,Str "paren:",Space,Str ")"] -,Para [Str "Greater-than:",Space,Str ">"] -,Para [Str "Hash:",Space,Str "#"] -,Para [Str "Period:",Space,Str "."] -,Para [Str "Bang:",Space,Str "!"] -,Para [Str "Plus:",Space,Str "+"] -,Para [Str "Minus:",Space,Str "-"] -,Div ("",["center"],[]) - [HorizontalRule] -,Header 1 ("links",[],[]) [Str "Links"] -,Header 2 ("explicit",[],[]) [Str "Explicit"] -,Para [Str "Just",Space,Str "a",Space,Link ("",[],[]) [Str "URL"] ("/url/",""),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/",""),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/",""),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/",""),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","")] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","")] -,Para [Link ("",[],[]) [Str "with_underscore"] ("/url/with_underscore","")] -,Para [Link ("",[],[]) [Str "Email",Space,Str "link"] ("mailto:nobody@nowhere.net","")] -,Para [Link ("",[],[]) [Str "Empty"] ("",""),Str "."] -,Header 2 ("reference",[],[]) [Str "Reference"] -,Para [Str "Foo",Space,Link ("",[],[]) [Str "bar"] ("/url/",""),Str "."] -,Para [Str "Foo",Space,Link ("",[],[]) [Str "bar"] ("/url/",""),Str "."] -,Para [Str "Foo",Space,Link ("",[],[]) [Str "bar"] ("/url/",""),Str "."] -,Para [Str "With",Space,Link ("",[],[]) [Str "embedded",Space,Str "[brackets]"] ("/url/",""),Str "."] -,Para [Link ("",[],[]) [Str "b"] ("/url/",""),Space,Str "by",Space,Str "itself",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "link."] -,Para [Str "Indented",Space,Link ("",[],[]) [Str "once"] ("/url",""),Str "."] -,Para [Str "Indented",Space,Link ("",[],[]) [Str "twice"] ("/url",""),Str "."] -,Para [Str "Indented",Space,Link ("",[],[]) [Str "thrice"] ("/url",""),Str "."] -,Para [Str "This",Space,Str "should",Space,Str "[not][]",Space,Str "be",Space,Str "a",Space,Str "link."] -,CodeBlock ("",[],[]) "[not]: /url" -,Para [Str "Foo",Space,Link ("",[],[]) [Str "bar"] ("/url/",""),Str "."] -,Para [Str "Foo",Space,Link ("",[],[]) [Str "biz"] ("/url/",""),Str "."] -,Header 2 ("with-ampersands",[],[]) [Str "With",Space,Str "ampersands"] -,Para [Str "Here\8217s",Space,Str "a",SoftBreak,Link ("",[],[]) [Str "link",Space,Str "with",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "the",Space,Str "URL"] ("http://example.com/?foo=1&bar=2",""),Str "."] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "link",Space,Str "with",Space,Str "an",Space,Str "amersand",Space,Str "in",Space,Str "the",Space,Str "link",Space,Str "text:",SoftBreak,Link ("",[],[]) [Str "AT&T"] ("http://att.com/",""),Str "."] -,Para [Str "Here\8217s",Space,Str "an",Space,Link ("",[],[]) [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."] -,Para [Str "Here\8217s",Space,Str "an",SoftBreak,Link ("",[],[]) [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."] -,Header 2 ("autolinks",[],[]) [Str "Autolinks"] -,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link ("",[],[]) [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] -,BulletList - [[Para [Str "In",Space,Str "a",Space,Str "list?"]] - ,[Para [Link ("",[],[]) [Str "http://example.com/"] ("http://example.com/","")]] - ,[Para [Str "It",Space,Str "should."]]] -,Para [Str "An",Space,Str "e-mail",Space,Str "address:",SoftBreak,Link ("",[],[]) [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] -,BlockQuote - [Para [Str "Blockquoted:",Space,Link ("",[],[]) [Str "http://example.com/"] ("http://example.com/","")]] -,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) ""] -,CodeBlock ("",[],[]) "or here: " -,Div ("",["center"],[]) - [HorizontalRule] -,Header 1 ("images",[],[]) [Str "Images"] -,Para [Str "From",Space,Quoted DoubleQuote [Str "Voyage",Space,Str "dans",Space,Str "la",Space,Str "Lune"],Space,Str "by",Space,Str "Georges",Space,Str "Melies",Space,Str "(1902):"] -,Para [Image ("",[],[]) [Str "image"] ("lalune.jpg","")] -,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image ("",[],[]) [Str "image"] ("movie.jpg",""),Space,Str "icon."] -,Div ("",["center"],[]) - [HorizontalRule] -,Header 1 ("footnotes",[],[]) [Str "Footnotes"] -,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",SoftBreak,Str "reference,",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote.",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",SoftBreak,Str "reference.",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document."]],SoftBreak,Str "and",SoftBreak,Str "another.",Note [Para [Str "Here\8217s",Space,Str "the",Space,Str "long",Space,Str "note.",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks."],Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",SoftBreak,Str "footnote",Space,Str "(as",Space,Str "with",Space,Str "list",Space,Str "items)."],CodeBlock ("",[],[]) " { }",Para [Str "If",Space,Str "you",Space,Str "want,",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line,",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",SoftBreak,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block."]],SoftBreak,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Space,Str "because",Space,Str "it",Space,Str "contains",SoftBreak,Str "a",Space,Str "space.[^my",Space,Str "note]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",SoftBreak,Str "note.",Note [Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type.",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",SoftBreak,Link ("",[],[]) [Str "links"] ("http://google.com",""),Space,Str "and",Space,Code ("",[],[]) "]",Space,Str "verbatim",Space,Str "characters,",SoftBreak,Str "as",Space,Str "well",Space,Str "as",Space,Str "[bracketed",Space,Str "text]."]]] -,BlockQuote - [Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes.",Note [Para [Str "In",Space,Str "quote."]]]] -,OrderedList (1,Decimal,Period) - [[Para [Str "And",Space,Str "in",Space,Str "list",Space,Str "items.",Note [Para [Str "In",Space,Str "list."]]]]] -,Para [Str "This",Space,Str "paragraph",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "part",Space,Str "of",Space,Str "the",Space,Str "note,",Space,Str "as",Space,Str "it",Space,Str "is",Space,Str "not",SoftBreak,Str "indented."] -,Header 1 ("escaped-characters",[],[]) [Str "Escaped",Space,Str "characters"] -,Para [Str "$",Space,Str "%",Space,Str "&",Space,Str "#",Space,Str "_",Space,Str "{",Space,Str "}"]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "author" + , MetaList + [ MetaInlines + [ Str "John", Space, Str "MacFarlane" ] + , MetaInlines + [ Str "Anonymous" ] + ] + ) + , + ( "date" + , MetaInlines + [ Str "July", Space, Str "17,", Space, Str "2006" ] + ) + , + ( "title" + , MetaInlines + [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] + ) + ] + } + ) + [ RawBlock + ( Format "latex" ) "\\maketitle" + , 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 "Most" + , Space + , Str "of" + , Space + , Str "them" + , Space + , Str "are" + , Space + , Str "adapted" + , Space + , Str "from" + , SoftBreak + , Str "John" + , Space + , Str "Gruber\8217s" + , Space + , Str "markdown" + , Space + , Str "test" + , Space + , Str "suite." + ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "headers", [], [] ) + [ Str "Headers" ] + , 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" ] + ( "/url", "" ) + ] + , Header 3 + ( "level-3-with-emphasis", [], [] ) + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph + [ Str "emphasis" ] + ] + , Para + [ Str "Level", Space, Str "4" ] + , Para + [ Str "Level", Space, Str "5" ] + , Header 1 + ( "level-1", [], [] ) + [ Str "Level", Space, Str "1" ] + , Header 2 + ( "level-2-with-emphasis", [], [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph + [ Str "emphasis" ] + ] + , Header 3 + ( "level-3", [], [] ) + [ Str "Level", Space, Str "3" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Header 2 + ( "level-2", [], [] ) + [ Str "Level", Space, Str "2" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "paragraphs", [], [] ) + [ Str "Paragraphs" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , Space + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , SoftBreak + , Str "list" + , Space + , Str "item." + , Space + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , SoftBreak + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , Space + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" + , LineBreak + , Str "here." + ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "block-quotes", [], [] ) + [ Str "Block", Space, Str "Quotes" ] + , Para + [ Str "E-mail", Space, Str "style:" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , Space + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] + ] + , BlockQuote + [ Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , CodeBlock + ( "", [], [] ) "sub status {\n print \"working\";\n}" + , Para + [ Str "A", Space, Str "list:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "item", Space, Str "one" ] ] + , + [ Para [ Str "item", Space, Str "two" ] ] + ] + , Para + [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] + , BlockQuote + [ Para [ Str "nested" ] ] + , BlockQuote + [ Para [ Str "nested" ] ] + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + , Space + , Str "2" + , Space + , Str ">" + , Space + , Str "1." + ] + , Para + [ Str "Box-style:" ] + , BlockQuote + [ Para + [ Str "Example:" ] + , CodeBlock + ( "", [], [] ) "sub status {\n print \"working\";\n}" + ] + , BlockQuote + [ OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "do", Space, Str "laundry" ] ] + , + [ Para + [ Str "take" + , Space + , Str "out" + , Space + , Str "the" + , Space + , Str "trash" + ] + ] + ] + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "nested" + , Space + , Str "one:" + ] + , BlockQuote + [ Para + [ Str "Joe", Space, Str "said:" ] + , BlockQuote + [ Para [ Str "Don\8217t", Space, Str "quote", Space, Str "me." ] ] + ] + , Para + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "code-blocks", [], [] ) + [ Str "Code", Space, Str "Blocks" ] + , Para + [ Str "Code:" ] + , CodeBlock + ( "" + , [] + , [] + ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + , Para + [ Str "And:" ] + , CodeBlock + ( "" + , [] + , [] + ) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + , Para + [ Str "this" + , Space + , Str "has" + , Space + , Emph + [ Str "two", LineBreak, Str "lines" ] + ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "lists", [], [] ) + [ Str "Lists" ] + , Header 2 + ( "unordered", [], [] ) + [ Str "Unordered" ] + , Para + [ Str "Asterisks", Space, Str "tight:" ] + , BulletList + [ + [ Para [ Str "asterisk", Space, Str "1" ] ] + , + [ Para [ Str "asterisk", Space, Str "2" ] ] + , + [ Para [ Str "asterisk", Space, Str "3" ] ] + ] + , Para + [ Str "Asterisks", Space, Str "loose:" ] + , BulletList + [ + [ Para [ Str "asterisk", Space, Str "1" ] ] + , + [ Para [ Str "asterisk", Space, Str "2" ] ] + , + [ Para [ Str "asterisk", Space, Str "3" ] ] + ] + , Para + [ Str "Pluses", Space, Str "tight:" ] + , BulletList + [ + [ Para [ Str "Plus", Space, Str "1" ] ] + , + [ Para [ Str "Plus", Space, Str "2" ] ] + , + [ Para [ Str "Plus", Space, Str "3" ] ] + ] + , Para + [ Str "Pluses", Space, Str "loose:" ] + , BulletList + [ + [ Para [ Str "Plus", Space, Str "1" ] ] + , + [ Para [ Str "Plus", Space, Str "2" ] ] + , + [ Para [ Str "Plus", Space, Str "3" ] ] + ] + , Para + [ Str "Minuses", Space, Str "tight:" ] + , BulletList + [ + [ Para [ Str "Minus", Space, Str "1" ] ] + , + [ Para [ Str "Minus", Space, Str "2" ] ] + , + [ Para [ Str "Minus", Space, Str "3" ] ] + ] + , Para + [ Str "Minuses", Space, Str "loose:" ] + , BulletList + [ + [ Para [ Str "Minus", Space, Str "1" ] ] + , + [ Para [ Str "Minus", Space, Str "2" ] ] + , + [ Para [ Str "Minus", Space, Str "3" ] ] + ] + , Header 2 + ( "ordered", [], [] ) + [ Str "Ordered" ] + , Para + [ Str "Tight:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para [ Str "Second" ] ] + , + [ Para [ Str "Third" ] ] + ] + , Para + [ Str "and:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "One" ] ] + , + [ Para [ Str "Two" ] ] + , + [ Para [ Str "Three" ] ] + ] + , Para + [ Str "Loose", Space, Str "using", Space, Str "tabs:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para [ Str "Second" ] ] + , + [ Para [ Str "Third" ] ] + ] + , Para + [ Str "and", Space, Str "using", Space, Str "spaces:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "One" ] ] + , + [ Para [ Str "Two" ] ] + , + [ Para [ Str "Three" ] ] + ] + , Para + [ Str "Multiple", Space, Str "paragraphs:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , SoftBreak + , Str "back." + ] + ] + , + [ Para [ Str "Item", Space, Str "2." ] ] + , + [ Para [ Str "Item", Space, Str "3." ] ] + ] + , Header 2 + ( "nested", [], [] ) + [ Str "Nested" ] + , BulletList + [ + [ Para + [ Str "Tab" ] + , BulletList + [ + [ Para [ Str "Tab" ], BulletList [ [ Para [ Str "Tab" ] ] ] ] + ] + ] + ] + , Para + [ Str "Here\8217s", Space, Str "another:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para + [ Str "Second:" ] + , BulletList + [ + [ Para [ Str "Fee" ] ] + , + [ Para [ Str "Fie" ] ] + , + [ Para [ Str "Foe" ] ] + ] + ] + , + [ Para [ Str "Third" ] ] + ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" + ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para + [ Str "Second:" ] + , BulletList + [ + [ Para [ Str "Fee" ] ] + , + [ Para [ Str "Fie" ] ] + , + [ Para [ Str "Foe" ] ] + ] + ] + , + [ Para [ Str "Third" ] ] + ] + , Header 2 + ( "tabs-and-spaces", [], [] ) + [ Str "Tabs", Space, Str "and", Space, Str "spaces" ] + , BulletList + [ + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + , BulletList + [ + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + ] + ] + ] + ] + , Header 2 + ( "fancy-list-markers", [], [] ) + [ Str "Fancy", Space, Str "list", Space, Str "markers" ] + , OrderedList + ( 2, Decimal, TwoParens ) + [ + [ Para [ Str "begins", Space, Str "with", Space, Str "2" ] ] + , + [ Para + [ Str "and", Space, Str "now", Space, Str "3" ] + , Para + [ Str "with", Space, Str "a", Space, Str "continuation" ] + , OrderedList + ( 4, LowerRoman, Period ) + [ + [ Para + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , Space + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" + ] + ] + , + [ Para + [ Str "more", Space, Str "items" ] + , OrderedList + ( 1, UpperAlpha, TwoParens ) + [ + [ Para [ Str "a", Space, Str "subsublist" ] ] + , + [ Para [ Str "a", Space, Str "subsublist" ] ] + ] + ] + ] + ] + ] + , Para + [ Str "Nesting:" ] + , OrderedList + ( 1, UpperAlpha, Period ) + [ + [ Para + [ Str "Upper", Space, Str "Alpha" ] + , OrderedList + ( 1, UpperRoman, Period ) + [ + [ Para + [ Str "Upper", Space, Str "Roman." ] + , OrderedList + ( 6, Decimal, TwoParens ) + [ + [ Para + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3, LowerAlpha, OneParen ) + [ + [ Para + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] + ] + ] + ] + ] + ] + ] + , Para + [ Str "Autonumbering:" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Para [ Str "Autonumber." ] ] + , + [ Para + [ Str "More." ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ [ Para [ Str "Nested." ] ] ] + ] + ] + , Para + [ Str "Should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item:" + ] + , Para + [ Str "M.A.", Space, Str "2007" ] + , Para + [ Str "B.", Space, Str "Williams" ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "definition-lists", [], [] ) + [ Str "Definition", Space, Str "Lists" ] + , Para + [ Str "Tight", Space, Str "using", Space, Str "spaces:" ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ [ Para [ Str "red", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "orange" ] + , + [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "banana" ] + , + [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Tight", Space, Str "using", Space, Str "tabs:" ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ [ Para [ Str "red", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "orange" ] + , + [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "banana" ] + , + [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Loose:" ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ [ Para [ Str "red", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "orange" ] + , + [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "banana" ] + , + [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "with" + , Space + , Str "italics:" + ] + , DefinitionList + [ + ( + [ Emph [ Str "apple" ] ] + , + [ + [ Para + [ Str "red", Space, Str "fruit" ] + , Para + [ Str "contains" + , Space + , Str "seeds," + , Space + , Str "crisp," + , Space + , Str "pleasant" + , Space + , Str "to" + , Space + , Str "taste" + ] + ] + ] + ) + , + ( + [ Emph [ Str "orange" ] ] + , + [ + [ Para + [ Str "orange", Space, Str "fruit" ] + , CodeBlock + ( "", [], [] ) "{ orange code block }" + , BlockQuote + [ Para + [ Str "orange", Space, Str "block", Space, Str "quote" ] + ] + ] + ] + ) + ] + , Header 1 + ( "html-blocks", [], [] ) + [ Str "HTML", Space, Str "Blocks" ] + , Para + [ Str "Simple" + , Space + , Str "block" + , Space + , Str "on" + , Space + , Str "one" + , Space + , Str "line:" + ] + , Para + [ Str "foo" + , SoftBreak + , Str "And" + , Space + , Str "nested" + , Space + , Str "without" + , Space + , Str "indentation:" + ] + , Para + [ Str "foo" + , SoftBreak + , Str "bar" + , SoftBreak + , Str "Interpreted" + , Space + , Str "markdown" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "table:" + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "emphasized" ] + , SoftBreak + , Str "And" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Strong + [ Str "strong" ] + , SoftBreak + , Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "simple" + , Space + , Str "block:" + ] + , Para + [ Str "foo" + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "code" + , Space + , Str "block," + , Space + , Str "though:" + ] + , CodeBlock + ( "", [], [] ) "
\n foo\n
" + , Para + [ Str "As", Space, Str "should", Space, Str "this:" ] + , CodeBlock + ( "", [], [] ) "
foo
" + , Para + [ Str "Now,", Space, Str "nested:" ] + , Para + [ Str "foo" + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Str "just" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "HTML" + , Space + , Str "comment:" + ] + , Para + [ Str "Multiline:" ] + , Para + [ Str "Code", Space, Str "block:" ] + , CodeBlock + ( "", [], [] ) "" + , Para + [ Str "Just" + , Space + , Str "plain" + , Space + , Str "comment," + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "spaces" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "line:" + ] + , Para + [ Str "Code:" ] + , CodeBlock + ( "", [], [] ) "
" + , Para + [ Str "Hr\8217s:" ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "inline-markup", [], [] ) + [ Str "Inline", Space, Str "Markup" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph + [ Str "is", Space, Str "this" ] + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Strong + [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Strong + [ Str "is", Space, Str "this" ] + , Str "." + ] + , Para + [ Str "An" + , Space + , Emph + [ Link + ( "", [], [] ) + [ Str "emphasized", Space, Str "link" ] + ( "/url", "" ) + ] + , Str "." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong + [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong + [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code + ( "", [], [] ) ">" + , Str "," + , Space + , Code + ( "", [], [] ) "$" + , Str "," + , Space + , Code + ( "", [], [] ) "\\" + , Str "," + , Space + , Code + ( "", [], [] ) "\\$" + , Str "," + , SoftBreak + , Code + ( "", [], [] ) "" + , Str "." + ] + , Para + [ Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "strikeout" ] + , Str "." + ] + ] + , Para + [ Str "Superscripts:" + , Space + , Str "a" + , Superscript + [ Str "bc" ] + , Str "d" + , SoftBreak + , Str "a" + , Superscript + [ Emph [ Str "hello" ] ] + , Space + , Str "a" + , Superscript + [ Str "hello", Space, Str "there" ] + , Str "." + ] + , Para + [ Str "Subscripts:" + , Space + , Str "H" + , Subscript + [ Str "2" ] + , Str "O," + , Space + , Str "H" + , Subscript + [ Str "23" ] + , Str "O," + , SoftBreak + , Str "H" + , Subscript + [ Str "many", Space, Str "of", Space, Str "them" ] + , Str "O." + ] + , Para + [ Str "These" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "superscripts" + , Space + , Str "or" + , Space + , Str "subscripts," + , Space + , Str "because" + , Space + , Str "of" + , Space + , Str "the" + , SoftBreak + , Str "unescaped" + , Space + , Str "spaces:" + , Space + , Str "a^b" + , Space + , Str "c^d," + , Space + , Str "a" + , Math InlineMath "\\sim" + , Str "b" + , SoftBreak + , Str "c" + , Math InlineMath "\\sim" + , Str "d." + ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "smart-quotes-ellipses-dashes", [], [] ) + [ Str "Smart" + , Space + , Str "quotes," + , Space + , Str "ellipses," + , Space + , Str "dashes" + ] + , Para + [ Quoted DoubleQuote + [ Str "Hello," ] + , Space + , Str "said" + , Space + , Str "the" + , Space + , Str "spider." + , Space + , Quoted DoubleQuote + [ Str "\8198" + , Quoted SingleQuote + [ Str "Shelob" ] + , Space + , Str "is" + , Space + , Str "my" + , Space + , Str "name." + ] + ] + , Para + [ Quoted SingleQuote + [ Str "A" ] + , Str "," + , Space + , Quoted SingleQuote + [ Str "B" ] + , Str "," + , Space + , Str "and" + , Space + , Quoted SingleQuote + [ Str "C" ] + , Space + , Str "are" + , Space + , Str "letters." + ] + , Para + [ Quoted SingleQuote + [ Str "Oak," ] + , Space + , Quoted SingleQuote + [ Str "elm," ] + , Space + , Str "and" + , Space + , Quoted SingleQuote + [ Str "beech" ] + , Space + , Str "are" + , Space + , Str "names" + , Space + , Str "of" + , Space + , Str "trees." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Quoted SingleQuote + [ Str "pine." ] + ] + , Para + [ Quoted SingleQuote + [ Str "He" + , Space + , Str "said," + , Space + , Quoted DoubleQuote + [ Str "I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "go." + ] + , Str "\8198" + ] + , Space + , Str "Were" + , Space + , Str "you" + , Space + , Str "alive" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "70\8217s?" + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "quoted" + , Space + , Quoted SingleQuote + [ Code ( "", [], [] ) "code" ] + , Space + , Str "and" + , Space + , Str "a" + , SoftBreak + , Quoted DoubleQuote + [ Link + ( "", [], [] ) + [ Str "quoted", Space, Str "link" ] + ( "http://example.com/?foo=1&bar=2", "" ) + ] + , Str "." + ] + , Para + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one\8212two\8212three\8212four\8212five." + ] + , Para + [ Str "Dashes" + , Space + , Str "between" + , Space + , Str "numbers:" + , Space + , Str "5\8211\&7," + , Space + , Str "255\8211\&66," + , Space + , Str "1987\8211\&1999." + ] + , Para + [ Str "Ellipses\8230and\8230and\8230." ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "latex", [], [] ) + [ Str "LaTeX" ] + , BulletList + [ + [ Para + [ Cite + [ Citation + { citationId = "smith.1899" + , citationPrefix = [] + , citationSuffix = + [ Str "22-23" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline ( Format "latex" ) "\\cite[22-23]{smith.1899}" ] + ] + ] + , + [ RawBlock ( Format "latex" ) "\\doublespacing" ] + , + [ Para [ Math InlineMath "2+2=4" ] ] + , + [ Para [ Math InlineMath "x \\in y" ] ] + , + [ Para [ Math InlineMath "\\alpha \\wedge \\omega" ] ] + , + [ Para [ Math InlineMath "223" ] ] + , + [ Para [ Math InlineMath "p", Str "-Tree" ] ] + , + [ Para + [ Math InlineMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}" ] + ] + , + [ Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "that" + , Space + , Str "has" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "break" + , Space + , Str "in" + , Space + , Str "it:" + , SoftBreak + , Math InlineMath "\\alpha + \\omega \\times x^2" + , Str "." + ] + ] + ] + , Para + [ Str "These" + , Space + , Str "shouldn\8217t" + , Space + , Str "be" + , Space + , Str "math:" + ] + , BulletList + [ + [ Para + [ Str "To" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "famous" + , Space + , Str "equation," + , Space + , Str "write" + , Space + , Code + ( "", [], [] ) "$e = mc^2$" + , Str "." + ] + ] + , + [ Para + [ Str "$22,000" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Emph + [ Str "lot" ] + , Space + , Str "of" + , Space + , Str "money." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "$34,000." + , Space + , Str "(It" + , Space + , Str "worked" + , Space + , Str "if" + , SoftBreak + , Quoted DoubleQuote + [ Str "lot" ] + , Space + , Str "is" + , Space + , Str "emphasized.)" + ] + ] + , + [ Para + [ Str "Escaped" + , Space + , Code + ( "", [], [] ) "$" + , Str ":" + , Space + , Str "$73" + , Space + , Emph + [ Str "this" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "emphasized" + ] + , Space + , Str "23$." + ] + ] + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "LaTeX" + , Space + , Str "table:" + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignLeft, ColWidthDefault ), ( AlignLeft, ColWidthDefault ) ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Animal" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Number" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Dog" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cat" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "A" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "one" + , Space + , Str "column:" + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignCenter, ColWidthDefault ) ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Animal" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Vegetable" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "special-characters", [], [] ) + [ Str "Special", Space, Str "Characters" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "unicode:" + ] + , BulletList + [ + [ Para [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] + , + [ Para [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] + , + [ Para [ Str "section:", Space, Str "\167" ] ] + , + [ Para + [ Str "set", Space, Str "membership:", Space, Str "\8712" ] + ] + , + [ Para [ Str "copyright:", Space, Str "\169" ] ] + ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] + , Para + [ Str "This", Space, Str "&", Space, Str "that." ] + , Para + [ Str "4", Space, Str "<", Space, Str "5." ] + , Para + [ Str "6", Space, Str ">", Space, Str "5." ] + , Para + [ Str "Backslash:", Space, Str "\\" ] + , Para + [ Str "Backtick:", Space, Str "\8216" ] + , Para + [ Str "Asterisk:", Space, Str "*" ] + , Para + [ Str "Underscore:", Space, Str "_" ] + , Para + [ Str "Left", Space, Str "brace:", Space, Str "{" ] + , Para + [ Str "Right", Space, Str "brace:", Space, Str "}" ] + , Para + [ Str "Left", Space, Str "bracket:", Space, Str "[" ] + , Para + [ Str "Right", Space, Str "bracket:", Space, Str "]" ] + , Para + [ Str "Left", Space, Str "paren:", Space, Str "(" ] + , Para + [ Str "Right", Space, Str "paren:", Space, Str ")" ] + , Para + [ Str "Greater-than:", Space, Str ">" ] + , Para + [ Str "Hash:", Space, Str "#" ] + , Para + [ Str "Period:", Space, Str "." ] + , Para + [ Str "Bang:", Space, Str "!" ] + , Para + [ Str "Plus:", Space, Str "+" ] + , Para + [ Str "Minus:", Space, Str "-" ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "links", [], [] ) + [ Str "Links" ] + , Header 2 + ( "explicit", [], [] ) + [ Str "Explicit" ] + , Para + [ Str "Just" + , Space + , Str "a" + , Space + , Link + ( "", [], [] ) + [ Str "URL" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "with_underscore" ] + ( "/url/with_underscore", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "Email", Space, Str "link" ] + ( "mailto:nobody@nowhere.net", "" ) + ] + , Para + [ Link ( "", [], [] ) [ Str "Empty" ] ( "", "" ), Str "." ] + , Header 2 + ( "reference", [], [] ) + [ Str "Reference" ] + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "bar" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "bar" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "bar" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Str "With" + , Space + , Link + ( "", [], [] ) + [ Str "embedded", Space, Str "[brackets]" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "b" ] + ( "/url/", "" ) + , Space + , Str "by" + , Space + , Str "itself" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , Para + [ Str "Indented" + , Space + , Link + ( "", [], [] ) + [ Str "once" ] + ( "/url", "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link + ( "", [], [] ) + [ Str "twice" ] + ( "/url", "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link + ( "", [], [] ) + [ Str "thrice" ] + ( "/url", "" ) + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "[not][]" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , CodeBlock + ( "", [], [] ) "[not]: /url" + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "bar" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "biz" ] + ( "/url/", "" ) + , Str "." + ] + , Header 2 + ( "with-ampersands", [], [] ) + [ Str "With", Space, Str "ampersands" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , SoftBreak + , Link + ( "", [], [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2", "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "amersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "link" + , Space + , Str "text:" + , SoftBreak + , Link + ( "", [], [] ) + [ Str "AT&T" ] + ( "http://att.com/", "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "", [], [] ) + [ Str "inline", Space, Str "link" ] + ( "/script?foo=1&bar=2", "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , SoftBreak + , Link + ( "", [], [] ) + [ Str "inline" + , Space + , Str "link" + , Space + , Str "in" + , Space + , Str "pointy" + , Space + , Str "braces" + ] + ( "/script?foo=1&bar=2", "" ) + , Str "." + ] + , Header 2 + ( "autolinks", [], [] ) + [ Str "Autolinks" ] + , Para + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" + , Space + , Link + ( "", [], [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2", "" ) + ] + , BulletList + [ + [ Para [ Str "In", Space, Str "a", Space, Str "list?" ] ] + , + [ Para + [ Link + ( "", [], [] ) + [ Str "http://example.com/" ] + ( "http://example.com/", "" ) + ] + ] + , + [ Para [ Str "It", Space, Str "should." ] ] + ] + , Para + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" + , SoftBreak + , Link + ( "", [], [] ) + [ Str "nobody@nowhere.net" ] + ( "mailto:nobody@nowhere.net", "" ) + ] + , BlockQuote + [ Para + [ Str "Blockquoted:" + , Space + , Link + ( "", [], [] ) + [ Str "http://example.com/" ] + ( "http://example.com/", "" ) + ] + ] + , Para + [ Str "Auto-links" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "occur" + , Space + , Str "here:" + , Space + , Code + ( "", [], [] ) "" + ] + , CodeBlock + ( "", [], [] ) "or here: " + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "images", [], [] ) + [ Str "Images" ] + , Para + [ Str "From" + , Space + , Quoted DoubleQuote + [ Str "Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune" + ] + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" + ] + , Para + [ Image ( "", [], [] ) [ Str "image" ] ( "lalune.jpg", "" ) ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space + , Image + ( "", [], [] ) + [ Str "image" ] + ( "movie.jpg", "" ) + , Space + , Str "icon." + ] + , Div + ( "", [ "center" ], [] ) [ HorizontalRule ] + , Header 1 + ( "footnotes", [], [] ) + [ Str "Footnotes" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "footnote" + , SoftBreak + , Str "reference," + , Note + [ Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "footnote." + , Space + , Str "It" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "anywhere" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "footnote" + , SoftBreak + , Str "reference." + , Space + , Str "It" + , Space + , Str "need" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "placed" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "document." + ] + ] + , SoftBreak + , Str "and" + , SoftBreak + , Str "another." + , Note + [ Para + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "long" + , Space + , Str "note." + , Space + , Str "This" + , Space + , Str "one" + , Space + , Str "contains" + , Space + , Str "multiple" + , Space + , Str "blocks." + ] + , Para + [ Str "Subsequent" + , Space + , Str "blocks" + , Space + , Str "are" + , Space + , Str "indented" + , Space + , Str "to" + , Space + , Str "show" + , Space + , Str "that" + , Space + , Str "they" + , Space + , Str "belong" + , Space + , Str "to" + , Space + , Str "the" + , SoftBreak + , Str "footnote" + , Space + , Str "(as" + , Space + , Str "with" + , Space + , Str "list" + , Space + , Str "items)." + ] + , CodeBlock + ( "", [], [] ) " { }" + , Para + [ Str "If" + , Space + , Str "you" + , Space + , Str "want," + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "indent" + , Space + , Str "every" + , Space + , Str "line," + , Space + , Str "but" + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "be" + , Space + , Str "lazy" + , SoftBreak + , Str "and" + , Space + , Str "just" + , Space + , Str "indent" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "line" + , Space + , Str "of" + , Space + , Str "each" + , Space + , Str "block." + ] + ] + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Emph + [ Str "not" ] + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Space + , Str "because" + , Space + , Str "it" + , Space + , Str "contains" + , SoftBreak + , Str "a" + , Space + , Str "space.[^my" + , Space + , Str "note]" + , Space + , Str "Here" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "inline" + , SoftBreak + , Str "note." + , Note + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "easier" ] + , Space + , Str "to" + , Space + , Str "type." + , Space + , Str "Inline" + , Space + , Str "notes" + , Space + , Str "may" + , Space + , Str "contain" + , SoftBreak + , Link + ( "", [], [] ) + [ Str "links" ] + ( "http://google.com", "" ) + , Space + , Str "and" + , Space + , Code + ( "", [], [] ) "]" + , Space + , Str "verbatim" + , Space + , Str "characters," + , SoftBreak + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str "[bracketed" + , Space + , Str "text]." + ] + ] + ] + , BlockQuote + [ Para + [ Str "Notes" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "in" + , Space + , Str "quotes." + , Note + [ Para [ Str "In", Space, Str "quote." ] ] + ] + ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para + [ Str "And" + , Space + , Str "in" + , Space + , Str "list" + , Space + , Str "items." + , Note + [ Para [ Str "In", Space, Str "list." ] ] + ] + ] + ] + , Para + [ Str "This" + , Space + , Str "paragraph" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "note," + , Space + , Str "as" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "not" + , SoftBreak + , Str "indented." + ] + , Header 1 + ( "escaped-characters", [], [] ) + [ Str "Escaped", Space, Str "characters" ] + , Para + [ Str "$" + , Space + , Str "%" + , Space + , Str "&" + , Space + , Str "#" + , Space + , Str "_" + , Space + , Str "{" + , Space + , Str "}" + ] + ] diff --git a/test/lhs-test-markdown.native b/test/lhs-test-markdown.native index 7a423b1ab..db2acd318 100644 --- a/test/lhs-test-markdown.native +++ b/test/lhs-test-markdown.native @@ -1,8 +1,130 @@ -[Header 1 ("lhs-test",[],[]) [Str "lhs",Space,Str "test"] -,Para [Code ("",[],[]) "unsplit",Space,Str "is",Space,Str "an",Space,Str "arrow",Space,Str "that",Space,Str "takes",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "and",Space,Str "combines",Space,Str "them",Space,Str "to",SoftBreak,Str "return",Space,Str "a",Space,Str "single",Space,Str "value:"] -,CodeBlock ("",["haskell","literate"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" -,Para [Code ("",[],[]) "(***)",Space,Str "combines",Space,Str "two",Space,Str "arrows",Space,Str "into",Space,Str "a",Space,Str "new",Space,Str "arrow",Space,Str "by",Space,Str "running",Space,Str "the",Space,Str "two",Space,Str "arrows",Space,Str "on",Space,Str "a",SoftBreak,Str "pair",Space,Str "of",Space,Str "values",Space,Str "(one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "first",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair",Space,Str "and",Space,Str "one",Space,Str "arrow",Space,Str "on",Space,Str "the",SoftBreak,Str "second",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair)."] -,CodeBlock ("",[],[]) "f *** g = first f >>> second g" -,Para [Str "Block",Space,Str "quote:"] -,BlockQuote - [Para [Str "foo",Space,Str "bar"]]] +[ Header 1 + ( "lhs-test", [], [] ) + [ Str "lhs", Space, Str "test" ] +, Para + [ Code + ( "", [], [] ) "unsplit" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "arrow" + , Space + , Str "that" + , Space + , Str "takes" + , Space + , Str "a" + , Space + , Str "pair" + , Space + , Str "of" + , Space + , Str "values" + , Space + , Str "and" + , Space + , Str "combines" + , Space + , Str "them" + , Space + , Str "to" + , SoftBreak + , Str "return" + , Space + , Str "a" + , Space + , Str "single" + , Space + , Str "value:" + ] +, CodeBlock + ( "" + , + [ "haskell", "literate" ] + , [] + ) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" +, Para + [ Code + ( "", [], [] ) "(***)" + , Space + , Str "combines" + , Space + , Str "two" + , Space + , Str "arrows" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "new" + , Space + , Str "arrow" + , Space + , Str "by" + , Space + , Str "running" + , Space + , Str "the" + , Space + , Str "two" + , Space + , Str "arrows" + , Space + , Str "on" + , Space + , Str "a" + , SoftBreak + , Str "pair" + , Space + , Str "of" + , Space + , Str "values" + , Space + , Str "(one" + , Space + , Str "arrow" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "item" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "pair" + , Space + , Str "and" + , Space + , Str "one" + , Space + , Str "arrow" + , Space + , Str "on" + , Space + , Str "the" + , SoftBreak + , Str "second" + , Space + , Str "item" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "pair)." + ] +, CodeBlock + ( "", [], [] ) "f *** g = first f >>> second g" +, Para + [ Str "Block", Space, Str "quote:" ] +, BlockQuote + [ Para [ Str "foo", Space, Str "bar" ] ] +] diff --git a/test/lhs-test.native b/test/lhs-test.native index 7a423b1ab..db2acd318 100644 --- a/test/lhs-test.native +++ b/test/lhs-test.native @@ -1,8 +1,130 @@ -[Header 1 ("lhs-test",[],[]) [Str "lhs",Space,Str "test"] -,Para [Code ("",[],[]) "unsplit",Space,Str "is",Space,Str "an",Space,Str "arrow",Space,Str "that",Space,Str "takes",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "and",Space,Str "combines",Space,Str "them",Space,Str "to",SoftBreak,Str "return",Space,Str "a",Space,Str "single",Space,Str "value:"] -,CodeBlock ("",["haskell","literate"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" -,Para [Code ("",[],[]) "(***)",Space,Str "combines",Space,Str "two",Space,Str "arrows",Space,Str "into",Space,Str "a",Space,Str "new",Space,Str "arrow",Space,Str "by",Space,Str "running",Space,Str "the",Space,Str "two",Space,Str "arrows",Space,Str "on",Space,Str "a",SoftBreak,Str "pair",Space,Str "of",Space,Str "values",Space,Str "(one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "first",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair",Space,Str "and",Space,Str "one",Space,Str "arrow",Space,Str "on",Space,Str "the",SoftBreak,Str "second",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair)."] -,CodeBlock ("",[],[]) "f *** g = first f >>> second g" -,Para [Str "Block",Space,Str "quote:"] -,BlockQuote - [Para [Str "foo",Space,Str "bar"]]] +[ Header 1 + ( "lhs-test", [], [] ) + [ Str "lhs", Space, Str "test" ] +, Para + [ Code + ( "", [], [] ) "unsplit" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "arrow" + , Space + , Str "that" + , Space + , Str "takes" + , Space + , Str "a" + , Space + , Str "pair" + , Space + , Str "of" + , Space + , Str "values" + , Space + , Str "and" + , Space + , Str "combines" + , Space + , Str "them" + , Space + , Str "to" + , SoftBreak + , Str "return" + , Space + , Str "a" + , Space + , Str "single" + , Space + , Str "value:" + ] +, CodeBlock + ( "" + , + [ "haskell", "literate" ] + , [] + ) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" +, Para + [ Code + ( "", [], [] ) "(***)" + , Space + , Str "combines" + , Space + , Str "two" + , Space + , Str "arrows" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "new" + , Space + , Str "arrow" + , Space + , Str "by" + , Space + , Str "running" + , Space + , Str "the" + , Space + , Str "two" + , Space + , Str "arrows" + , Space + , Str "on" + , Space + , Str "a" + , SoftBreak + , Str "pair" + , Space + , Str "of" + , Space + , Str "values" + , Space + , Str "(one" + , Space + , Str "arrow" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "item" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "pair" + , Space + , Str "and" + , Space + , Str "one" + , Space + , Str "arrow" + , Space + , Str "on" + , Space + , Str "the" + , SoftBreak + , Str "second" + , Space + , Str "item" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "pair)." + ] +, CodeBlock + ( "", [], [] ) "f *** g = first f >>> second g" +, Para + [ Str "Block", Space, Str "quote:" ] +, BlockQuote + [ Para [ Str "foo", Space, Str "bar" ] ] +] diff --git a/test/man-reader.native b/test/man-reader.native index 2ab088ff1..f8341fb84 100644 --- a/test/man-reader.native +++ b/test/man-reader.native @@ -1,300 +1,986 @@ -Pandoc (Meta {unMeta = fromList [("date",MetaInlines [Str "Oct",Space,Str "17,",Space,Str "2018"]),("section",MetaInlines []),("title",MetaInlines [Str "Pandoc",Space,Str "Man",Space,Str "tests"])]}) -[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc."] -,Para [Str "*",Space,Str "*",Space,Str "*",Space,Str "*",Space,Str "*"] -,Header 1 ("",[],[]) [Str "Headers"] -,Header 1 ("",[],[]) [Str "Level",Space,Str "1"] -,Header 2 ("",[],[]) [Str "Level",Space,Str "2"] -,Para [Str "*",Space,Str "*",Space,Str "*",Space,Str "*",Space,Str "*"] -,Header 1 ("",[],[]) [Str "Paragraphs"] -,Para [Str "Here's",Space,Str "a",Space,Str "regular",Space,Str "paragraph."] -,Para [Str "Another",Space,Str "paragraph",Space,Str "In",Space,Str "Markdown",Space,Str "1.0.0",Space,Str "and",Space,Str "earlier.",Space,Str "Version",Space,Str "8.",Space,Str "This",Space,Str "line",Space,Str "turns",Space,Str "into",Space,Str "a",Space,Str "list",Space,Str "item.",Space,Str "Because",Space,Str "a",Space,Str "hard-wrapped",Space,Str "line",Space,Str "in",Space,Str "the",Space,Str "middle",Space,Str "of",Space,Str "a",Space,Str "paragraph",Space,Str "looked",Space,Str "like",Space,Str "a",Space,Str "list",Space,Str "item."] -,Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "hard",Space,Str "line",Space,Str "break"] -,Para [Str "here."] -,Para [Str "*",Space,Str "*",Space,Str "*",Space,Str "*",Space,Str "*"] -,Header 1 ("",[],[]) [Str "Block",Space,Str "Quotes"] -,Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"] -,BlockQuote - [CodeBlock ("",[],[]) "sub status {\n print \"working\";\n}"] -,Para [Str "A",Space,Str "list:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "item",Space,Str "one"]] - ,[Para [Str "item",Space,Str "two"]]] -,Header 1 ("",[],[]) [Str "Code",Space,Str "Blocks"] -,Para [Str "Code:"] -,CodeBlock ("",[],[]) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n" -,Para [Str "And:"] -,CodeBlock ("",[],[]) "\tthis code line is indented by one tab" -,Para [Str "*",Space,Str "*",Space,Str "*",Space,Str "*",Space,Str "*"] -,Header 1 ("",[],[]) [Str "Lists"] -,Header 2 ("",[],[]) [Str "Unordered"] -,Para [Str "Asterisks:"] -,BulletList - [[Para [Str "asterisk",Space,Str "1"]] - ,[Para [Str "asterisk",Space,Str "2"]] - ,[Para [Str "asterisk",Space,Str "3"]]] -,Header 2 ("",[],[]) [Str "Ordered"] -,OrderedList (1,Decimal,Period) - [[Para [Str "First"]] - ,[Para [Str "Second"]] - ,[Para [Str "Third"]]] -,Header 2 ("",[],[]) [Str "Nested"] -,BulletList - [[Para [Str "Tab"] - ,BulletList - [[Para [Str "Tab"] - ,BulletList - [[Para [Str "Tab"]]]]]]] -,Para [Str "Here's",Space,Str "another:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "First"]] - ,[Para [Str "Second:"] - ,BulletList - [[Para [Str "Fee"]] - ,[Para [Str "Fie"]] - ,[Para [Str "Foe"]]]] - ,[Para [Str "Third"]]] -,Para [Str "Same",Space,Str "thing:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "First"]] - ,[Para [Str "Second:"] - ,BulletList - [[Para [Str "Fee"]] - ,[Para [Str "Fie"]] - ,[Para [Str "Foe"]]]] - ,[Para [Str "Third"]]] -,Header 2 ("",[],[]) [Str "different",Space,Str "styles:"] -,OrderedList (1,UpperAlpha,Period) - [[Para [Str "Upper",Space,Str "Alpha"] - ,OrderedList (1,UpperRoman,Period) - [[Para [Str "Upper",Space,Str "Roman."] - ,OrderedList (6,Decimal,TwoParens) - [[Para [Str "Decimal",Space,Str "start",Space,Str "with",Space,Str "6"] - ,OrderedList (3,LowerAlpha,OneParen) - [[Para [Str "Lower",Space,Str "alpha",Space,Str "with",Space,Str "paren"]]]]]]]]] -,Header 2 ("",[],[]) [Str "Ordered"] -,Para [Str "Definition",Space,Str "lists"] -,DefinitionList - [([Strong [Str "term1"]], - [[Para [Str "definition",Space,Str "1"] - ,Para [Str "continued"]]]) - ,([Strong [Str "term2"]], - [[Para [Str "definition",Space,Str "2",Space,Str "*",Space,Str "*",Space,Str "*",Space,Str "*",Space,Str "*"]]])] -,Header 1 ("",[],[]) [Str "Special",Space,Str "Characters"] -,Para [Str "AT&T",Space,Str "has",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "their",Space,Str "name."] -,Para [Str "4",Space,Str "<",Space,Str "5."] -,Para [Str "6",Space,Str ">",Space,Str "5."] -,Para [Str "Backslash:",Space,Str "\\"] -,Para [Str "Backtick:",Space,Str "`"] -,Para [Str "Asterisk:",Space,Str "*"] -,Para [Str "Underscore:",Space,Str "_"] -,Para [Str "Left",Space,Str "brace:",Space,Str "{"] -,Para [Str "Right",Space,Str "brace:",Space,Str "}"] -,Para [Str "Left",Space,Str "bracket:",Space,Str "["] -,Para [Str "Right",Space,Str "bracket:",Space,Str "]"] -,Para [Str "Left",Space,Str "paren:",Space,Str "("] -,Para [Str "Right",Space,Str "paren:",Space,Str ")"] -,Para [Str "Greater-than:",Space,Str ">"] -,Para [Str "Hash:",Space,Str "#"] -,Para [Str "Period:",Space,Str "."] -,Para [Str "Bang:",Space,Str "!"] -,Para [Str "Plus:",Space,Str "+"] -,Para [Str "Minus:",Space,Str "-"] -,Header 1 ("",[],[]) [Str "Links"] -,Para [Link ("",[],[]) [Str "some",Space,Str "randomsite"] ("http://example.com",""),Str "."] -,Para [Link ("",[],[]) [Str "my",Space,Str "email",Space,Str "address"] ("mailto:me@example.com",""),Str "."] -,Header 1 ("",[],[]) [Str "Macros"] -,Para [Strong [Str "Me",Space,Str "Myself"],Space,Str "and",Space,Str "I.",Space,Emph [Str "The",Space,Str "author",Space,Str "is",Space,Str "John",Space,Str "Jones."],Space,Str "It's",Space,Str "The",Space,Strong [Str "Author"],Str "."] -,Header 1 ("",[],[]) [Str "Tables"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignLeft,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignLeft,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left",Space,Emph [Str "more"]]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Centered",Space,Str "Header"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left",Space,Str "Aligned"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right",Space,Str "Aligned"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default",Space,Str "aligned"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "First"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Example",Space,Str "of",Space,Str "a",Space,Str "row",Space,Str "that",Space,Str "spans",Space,Str "multiple",Space,Str "lines."]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Second"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",Space,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "rows."]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Table",Space,Str "without",Space,Str "column",Space,Str "headers:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignRight,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidth 0.5) - ,(AlignLeft,ColWidth 0.5)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "a"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "one"] - ,Para [Str "two"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [CodeBlock ("",[],[]) "some\n code"]]])] - (TableFoot ("",[],[]) - [])] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "date" + , MetaInlines + [ Str "Oct", Space, Str "17,", Space, Str "2018" ] + ) + , + ( "section", MetaInlines [] ) + , + ( "title" + , MetaInlines + [ Str "Pandoc", Space, Str "Man", Space, Str "tests" ] + ) + ] + } + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "set" + , Space + , Str "of" + , Space + , Str "tests" + , Space + , Str "for" + , Space + , Str "pandoc." + ] + , Para + [ Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + ] + , Header 1 + ( "", [], [] ) + [ Str "Headers" ] + , Header 1 + ( "", [], [] ) + [ Str "Level", Space, Str "1" ] + , Header 2 + ( "", [], [] ) + [ Str "Level", Space, Str "2" ] + , Para + [ Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + ] + , Header 1 + ( "", [], [] ) + [ Str "Paragraphs" ] + , Para + [ Str "Here's" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "Another" + , Space + , Str "paragraph" + , Space + , Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , Space + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + , Space + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" + ] + , Para + [ Str "here." ] + , Para + [ Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + ] + , Header 1 + ( "", [], [] ) + [ Str "Block", Space, Str "Quotes" ] + , Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , BlockQuote + [ CodeBlock + ( "", [], [] ) "sub status {\n print \"working\";\n}" + ] + , Para + [ Str "A", Space, Str "list:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "item", Space, Str "one" ] ] + , + [ Para [ Str "item", Space, Str "two" ] ] + ] + , Header 1 + ( "", [], [] ) + [ Str "Code", Space, Str "Blocks" ] + , Para + [ Str "Code:" ] + , CodeBlock + ( "" + , [] + , [] + ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n" + , Para + [ Str "And:" ] + , CodeBlock + ( "", [], [] ) "\tthis code line is indented by one tab" + , Para + [ Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + ] + , Header 1 + ( "", [], [] ) + [ Str "Lists" ] + , Header 2 + ( "", [], [] ) + [ Str "Unordered" ] + , Para + [ Str "Asterisks:" ] + , BulletList + [ + [ Para [ Str "asterisk", Space, Str "1" ] ] + , + [ Para [ Str "asterisk", Space, Str "2" ] ] + , + [ Para [ Str "asterisk", Space, Str "3" ] ] + ] + , Header 2 + ( "", [], [] ) + [ Str "Ordered" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para [ Str "Second" ] ] + , + [ Para [ Str "Third" ] ] + ] + , Header 2 + ( "", [], [] ) + [ Str "Nested" ] + , BulletList + [ + [ Para + [ Str "Tab" ] + , BulletList + [ + [ Para [ Str "Tab" ], BulletList [ [ Para [ Str "Tab" ] ] ] ] + ] + ] + ] + , Para + [ Str "Here's", Space, Str "another:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para + [ Str "Second:" ] + , BulletList + [ + [ Para [ Str "Fee" ] ] + , + [ Para [ Str "Fie" ] ] + , + [ Para [ Str "Foe" ] ] + ] + ] + , + [ Para [ Str "Third" ] ] + ] + , Para + [ Str "Same", Space, Str "thing:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para + [ Str "Second:" ] + , BulletList + [ + [ Para [ Str "Fee" ] ] + , + [ Para [ Str "Fie" ] ] + , + [ Para [ Str "Foe" ] ] + ] + ] + , + [ Para [ Str "Third" ] ] + ] + , Header 2 + ( "", [], [] ) + [ Str "different", Space, Str "styles:" ] + , OrderedList + ( 1, UpperAlpha, Period ) + [ + [ Para + [ Str "Upper", Space, Str "Alpha" ] + , OrderedList + ( 1, UpperRoman, Period ) + [ + [ Para + [ Str "Upper", Space, Str "Roman." ] + , OrderedList + ( 6, Decimal, TwoParens ) + [ + [ Para + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3, LowerAlpha, OneParen ) + [ + [ Para + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] + ] + ] + ] + ] + ] + ] + , Header 2 + ( "", [], [] ) + [ Str "Ordered" ] + , Para + [ Str "Definition", Space, Str "lists" ] + , DefinitionList + [ + ( + [ Strong [ Str "term1" ] ] + , + [ + [ Para + [ Str "definition", Space, Str "1" ] + , Para + [ Str "continued" ] + ] + ] + ) + , + ( + [ Strong [ Str "term2" ] ] + , + [ + [ Para + [ Str "definition" + , Space + , Str "2" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + ] + ] + ] + ) + ] + , Header 1 + ( "", [], [] ) + [ Str "Special", Space, Str "Characters" ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "4", Space, Str "<", Space, Str "5." ] + , Para + [ Str "6", Space, Str ">", Space, Str "5." ] + , Para + [ Str "Backslash:", Space, Str "\\" ] + , Para + [ Str "Backtick:", Space, Str "`" ] + , Para + [ Str "Asterisk:", Space, Str "*" ] + , Para + [ Str "Underscore:", Space, Str "_" ] + , Para + [ Str "Left", Space, Str "brace:", Space, Str "{" ] + , Para + [ Str "Right", Space, Str "brace:", Space, Str "}" ] + , Para + [ Str "Left", Space, Str "bracket:", Space, Str "[" ] + , Para + [ Str "Right", Space, Str "bracket:", Space, Str "]" ] + , Para + [ Str "Left", Space, Str "paren:", Space, Str "(" ] + , Para + [ Str "Right", Space, Str "paren:", Space, Str ")" ] + , Para + [ Str "Greater-than:", Space, Str ">" ] + , Para + [ Str "Hash:", Space, Str "#" ] + , Para + [ Str "Period:", Space, Str "." ] + , Para + [ Str "Bang:", Space, Str "!" ] + , Para + [ Str "Plus:", Space, Str "+" ] + , Para + [ Str "Minus:", Space, Str "-" ] + , Header 1 + ( "", [], [] ) + [ Str "Links" ] + , Para + [ Link + ( "", [], [] ) + [ Str "some", Space, Str "randomsite" ] + ( "http://example.com", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "my", Space, Str "email", Space, Str "address" ] + ( "mailto:me@example.com", "" ) + , Str "." + ] + , Header 1 + ( "", [], [] ) + [ Str "Macros" ] + , Para + [ Strong + [ Str "Me", Space, Str "Myself" ] + , Space + , Str "and" + , Space + , Str "I." + , Space + , Emph + [ Str "The" + , Space + , Str "author" + , Space + , Str "is" + , Space + , Str "John" + , Space + , Str "Jones." + ] + , Space + , Str "It's" + , Space + , Str "The" + , Space + , Strong + [ Str "Author" ] + , Str "." + ] + , Header 1 + ( "", [], [] ) + [ Str "Tables" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Center" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Center" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left", Space, Emph [ Str "more" ] ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Centered", Space, Str "Header" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left", Space, Str "Aligned" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right", Space, Str "Aligned" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default", Space, Str "aligned" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "First" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Second" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , Space + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignRight, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignRight, ColWidth 0.5 ), ( AlignLeft, ColWidth 0.5 ) ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "a" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "one" ], Para [ Str "two" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ CodeBlock ( "", [], [] ) "some\n code" ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + ] diff --git a/test/markdown-citations.native b/test/markdown-citations.native index 1d4b1a8b2..bafdb0bbf 100644 --- a/test/markdown-citations.native +++ b/test/markdown-citations.native @@ -1,17 +1,539 @@ -[Header 1 ("pandoc-with-citeproc-hs",[],[]) [Str "Pandoc",Space,Str "with",Space,Str "citeproc-hs"] -,BulletList - [[Para [Cite [Citation {citationId = "nonexistent", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 1, citationHash = 0}] [Str "[@nonexistent]"]]] - ,[Para [Cite [Citation {citationId = "nonexistent", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 2, citationHash = 0}] [Str "@nonexistent"]]] - ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 3, citationHash = 0}] [Str "@item1"],Space,Str "says",Space,Str "blah."]] - ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Str "p.\160\&30"], citationMode = AuthorInText, citationNoteNum = 4, citationHash = 0}] [Str "@item1",Space,Str "[p.",Space,Str "30]"],Space,Str "says",Space,Str "blah."]] - ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Str "p.\160\&30,",Space,Str "with",Space,Str "suffix"], citationMode = AuthorInText, citationNoteNum = 5, citationHash = 0}] [Str "@item1",Space,Str "[p.",Space,Str "30,",Space,Str "with",Space,Str "suffix]"],Space,Str "says",Space,Str "blah."]] - ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 6, citationHash = 0},Citation {citationId = "item2", citationPrefix = [], citationSuffix = [Space,Str "p.\160\&30"], citationMode = SuppressAuthor, citationNoteNum = 6, citationHash = 0},Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [Str "see",Space,Str "also"], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 6, citationHash = 0}] [Str "@item1",Space,Str "[-@item2",Space,Str "p.",Space,Str "30;",Space,Str "see",Space,Str "also",Space,Str "@\1087\1091\1085\1082\1090\&3]"],Space,Str "says",Space,Str "blah."]] - ,[Para [Str "In",Space,Str "a",Space,Str "note.",Note [Para [Cite [Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [], citationSuffix = [Str "p.\160\&12"], citationMode = AuthorInText, citationNoteNum = 7, citationHash = 0}] [Str "@\1087\1091\1085\1082\1090\&3",Space,Str "[p.",Space,Str "12]"],Space,Str "and",Space,Str "a",Space,Str "citation",Space,Str "without",Space,Str "locators",Space,Cite [Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 7, citationHash = 0}] [Str "[@\1087\1091\1085\1082\1090\&3]"],Str "."]]]] - ,[Para [Str "A",Space,Str "citation",Space,Str "group",Space,Cite [Citation {citationId = "item1", citationPrefix = [Str "see"], citationSuffix = [Space,Str "chap.\160\&3"], citationMode = NormalCitation, citationNoteNum = 8, citationHash = 0},Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [Str "also"], citationSuffix = [Space,Str "p.\160\&34-35"], citationMode = NormalCitation, citationNoteNum = 8, citationHash = 0}] [Str "[see",Space,Str "@item1",Space,Str "chap.",Space,Str "3;",Space,Str "also",Space,Str "@\1087\1091\1085\1082\1090\&3",Space,Str "p.",Space,Str "34-35]"],Str "."]] - ,[Para [Str "Another",Space,Str "one",Space,Cite [Citation {citationId = "item1", citationPrefix = [Str "see"], citationSuffix = [Space,Str "p.\160\&34-35"], citationMode = NormalCitation, citationNoteNum = 9, citationHash = 0}] [Str "[see",Space,Str "@item1",Space,Str "p.",Space,Str "34-35]"],Str "."]] - ,[Para [Str "And",Space,Str "another",Space,Str "one",Space,Str "in",Space,Str "a",Space,Str "note.",Note [Para [Str "Some",Space,Str "citations",Space,Cite [Citation {citationId = "item1", citationPrefix = [Str "see"], citationSuffix = [Space,Str "chap.\160\&3"], citationMode = NormalCitation, citationNoteNum = 10, citationHash = 0},Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 10, citationHash = 0},Citation {citationId = "item2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 10, citationHash = 0}] [Str "[see",Space,Str "@item1",Space,Str "chap.",Space,Str "3;",Space,Str "@\1087\1091\1085\1082\1090\&3;",Space,Str "@item2]"],Str "."]]]] - ,[Para [Str "Citation",Space,Str "with",Space,Str "a",Space,Str "suffix",Space,Str "and",Space,Str "locator",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Space,Str "pp.\160\&33,",Space,Str "35-37,",Space,Str "and",Space,Str "nowhere",Space,Str "else"], citationMode = NormalCitation, citationNoteNum = 11, citationHash = 0}] [Str "[@item1",Space,Str "pp.",Space,Str "33,",Space,Str "35-37,",Space,Str "and",Space,Str "nowhere",Space,Str "else]"],Str "."]] - ,[Para [Str "Citation",Space,Str "with",Space,Str "suffix",Space,Str "only",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Space,Str "and",Space,Str "nowhere",Space,Str "else"], citationMode = NormalCitation, citationNoteNum = 12, citationHash = 0}] [Str "[@item1",Space,Str "and",Space,Str "nowhere",Space,Str "else]"],Str "."]] - ,[Para [Str "Now",Space,Str "some",Space,Str "modifiers.",Note [Para [Str "Like",Space,Str "a",Space,Str "citation",Space,Str "without",Space,Str "author:",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = SuppressAuthor, citationNoteNum = 13, citationHash = 0}] [Str "[-@item1]"],Str ",",Space,Str "and",Space,Str "now",Space,Str "Doe",Space,Str "with",Space,Str "a",Space,Str "locator",Space,Cite [Citation {citationId = "item2", citationPrefix = [], citationSuffix = [Space,Str "p.\160\&44"], citationMode = SuppressAuthor, citationNoteNum = 13, citationHash = 0}] [Str "[-@item2",Space,Str "p.",Space,Str "44]"],Str "."]]]] - ,[Para [Str "With",Space,Str "some",Space,Str "markup",Space,Cite [Citation {citationId = "item1", citationPrefix = [Emph [Str "see"]], citationSuffix = [Space,Str "p.\160",Strong [Str "32"]], citationMode = NormalCitation, citationNoteNum = 14, citationHash = 0}] [Str "[*see*",Space,Str "@item1",Space,Str "p.",Space,Str "**32**]"],Str "."]]] -,Header 1 ("references",[],[]) [Str "References"]] +[ Header 1 + ( "pandoc-with-citeproc-hs", [], [] ) + [ Str "Pandoc", Space, Str "with", Space, Str "citeproc-hs" ] +, BulletList + [ + [ Para + [ Cite + [ Citation + { citationId = "nonexistent" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "[@nonexistent]" ] + ] + ] + , + [ Para + [ Cite + [ Citation + { citationId = "nonexistent" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 2 + , citationHash = 0 + } + ] + [ Str "@nonexistent" ] + ] + ] + , + [ Para + [ Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 3 + , citationHash = 0 + } + ] + [ Str "@item1" ] + , Space + , Str "says" + , Space + , Str "blah." + ] + ] + , + [ Para + [ Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = + [ Str "p.\160\&30" ] + , citationMode = AuthorInText + , citationNoteNum = 4 + , citationHash = 0 + } + ] + [ Str "@item1", Space, Str "[p.", Space, Str "30]" ] + , Space + , Str "says" + , Space + , Str "blah." + ] + ] + , + [ Para + [ Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = + [ Str "p.\160\&30," + , Space + , Str "with" + , Space + , Str "suffix" + ] + , citationMode = AuthorInText + , citationNoteNum = 5 + , citationHash = 0 + } + ] + [ Str "@item1" + , Space + , Str "[p." + , Space + , Str "30," + , Space + , Str "with" + , Space + , Str "suffix]" + ] + , Space + , Str "says" + , Space + , Str "blah." + ] + ] + , + [ Para + [ Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 6 + , citationHash = 0 + } + , Citation + { citationId = "item2" + , citationPrefix = [] + , citationSuffix = + [ Space, Str "p.\160\&30" ] + , citationMode = SuppressAuthor + , citationNoteNum = 6 + , citationHash = 0 + } + , Citation + { citationId = "\1087\1091\1085\1082\1090\&3" + , citationPrefix = + [ Str "see", Space, Str "also" ] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 6 + , citationHash = 0 + } + ] + [ Str "@item1" + , Space + , Str "[-@item2" + , Space + , Str "p." + , Space + , Str "30;" + , Space + , Str "see" + , Space + , Str "also" + , Space + , Str "@\1087\1091\1085\1082\1090\&3]" + ] + , Space + , Str "says" + , Space + , Str "blah." + ] + ] + , + [ Para + [ Str "In" + , Space + , Str "a" + , Space + , Str "note." + , Note + [ Para + [ Cite + [ Citation + { citationId = "\1087\1091\1085\1082\1090\&3" + , citationPrefix = [] + , citationSuffix = + [ Str "p.\160\&12" ] + , citationMode = AuthorInText + , citationNoteNum = 7 + , citationHash = 0 + } + ] + [ Str "@\1087\1091\1085\1082\1090\&3" + , Space + , Str "[p." + , Space + , Str "12]" + ] + , Space + , Str "and" + , Space + , Str "a" + , Space + , Str "citation" + , Space + , Str "without" + , Space + , Str "locators" + , Space + , Cite + [ Citation + { citationId = "\1087\1091\1085\1082\1090\&3" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 7 + , citationHash = 0 + } + ] + [ Str "[@\1087\1091\1085\1082\1090\&3]" ] + , Str "." + ] + ] + ] + ] + , + [ Para + [ Str "A" + , Space + , Str "citation" + , Space + , Str "group" + , Space + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = + [ Str "see" ] + , citationSuffix = + [ Space, Str "chap.\160\&3" ] + , citationMode = NormalCitation + , citationNoteNum = 8 + , citationHash = 0 + } + , Citation + { citationId = "\1087\1091\1085\1082\1090\&3" + , citationPrefix = + [ Str "also" ] + , citationSuffix = + [ Space, Str "p.\160\&34-35" ] + , citationMode = NormalCitation + , citationNoteNum = 8 + , citationHash = 0 + } + ] + [ Str "[see" + , Space + , Str "@item1" + , Space + , Str "chap." + , Space + , Str "3;" + , Space + , Str "also" + , Space + , Str "@\1087\1091\1085\1082\1090\&3" + , Space + , Str "p." + , Space + , Str "34-35]" + ] + , Str "." + ] + ] + , + [ Para + [ Str "Another" + , Space + , Str "one" + , Space + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = + [ Str "see" ] + , citationSuffix = + [ Space, Str "p.\160\&34-35" ] + , citationMode = NormalCitation + , citationNoteNum = 9 + , citationHash = 0 + } + ] + [ Str "[see" + , Space + , Str "@item1" + , Space + , Str "p." + , Space + , Str "34-35]" + ] + , Str "." + ] + ] + , + [ Para + [ Str "And" + , Space + , Str "another" + , Space + , Str "one" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "note." + , Note + [ Para + [ Str "Some" + , Space + , Str "citations" + , Space + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = + [ Str "see" ] + , citationSuffix = + [ Space, Str "chap.\160\&3" ] + , citationMode = NormalCitation + , citationNoteNum = 10 + , citationHash = 0 + } + , Citation + { citationId = "\1087\1091\1085\1082\1090\&3" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 10 + , citationHash = 0 + } + , Citation + { citationId = "item2" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 10 + , citationHash = 0 + } + ] + [ Str "[see" + , Space + , Str "@item1" + , Space + , Str "chap." + , Space + , Str "3;" + , Space + , Str "@\1087\1091\1085\1082\1090\&3;" + , Space + , Str "@item2]" + ] + , Str "." + ] + ] + ] + ] + , + [ Para + [ Str "Citation" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "suffix" + , Space + , Str "and" + , Space + , Str "locator" + , Space + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = + [ Space + , Str "pp.\160\&33," + , Space + , Str "35-37," + , Space + , Str "and" + , Space + , Str "nowhere" + , Space + , Str "else" + ] + , citationMode = NormalCitation + , citationNoteNum = 11 + , citationHash = 0 + } + ] + [ Str "[@item1" + , Space + , Str "pp." + , Space + , Str "33," + , Space + , Str "35-37," + , Space + , Str "and" + , Space + , Str "nowhere" + , Space + , Str "else]" + ] + , Str "." + ] + ] + , + [ Para + [ Str "Citation" + , Space + , Str "with" + , Space + , Str "suffix" + , Space + , Str "only" + , Space + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = + [ Space + , Str "and" + , Space + , Str "nowhere" + , Space + , Str "else" + ] + , citationMode = NormalCitation + , citationNoteNum = 12 + , citationHash = 0 + } + ] + [ Str "[@item1" + , Space + , Str "and" + , Space + , Str "nowhere" + , Space + , Str "else]" + ] + , Str "." + ] + ] + , + [ Para + [ Str "Now" + , Space + , Str "some" + , Space + , Str "modifiers." + , Note + [ Para + [ Str "Like" + , Space + , Str "a" + , Space + , Str "citation" + , Space + , Str "without" + , Space + , Str "author:" + , Space + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = SuppressAuthor + , citationNoteNum = 13 + , citationHash = 0 + } + ] + [ Str "[-@item1]" ] + , Str "," + , Space + , Str "and" + , Space + , Str "now" + , Space + , Str "Doe" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "locator" + , Space + , Cite + [ Citation + { citationId = "item2" + , citationPrefix = [] + , citationSuffix = + [ Space, Str "p.\160\&44" ] + , citationMode = SuppressAuthor + , citationNoteNum = 13 + , citationHash = 0 + } + ] + [ Str "[-@item2", Space, Str "p.", Space, Str "44]" ] + , Str "." + ] + ] + ] + ] + , + [ Para + [ Str "With" + , Space + , Str "some" + , Space + , Str "markup" + , Space + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = + [ Emph [ Str "see" ] ] + , citationSuffix = + [ Space, Str "p.\160", Strong [ Str "32" ] ] + , citationMode = NormalCitation + , citationNoteNum = 14 + , citationHash = 0 + } + ] + [ Str "[*see*" + , Space + , Str "@item1" + , Space + , Str "p." + , Space + , Str "**32**]" + ] + , Str "." + ] + ] + ] +, Header 1 + ( "references", [], [] ) + [ Str "References" ] +] diff --git a/test/markdown-reader-more.native b/test/markdown-reader-more.native index b4a16f7cf..99ab260ba 100644 --- a/test/markdown-reader-more.native +++ b/test/markdown-reader-more.native @@ -1,311 +1,1227 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "Author",Space,Str "One"],MetaInlines [Str "Author",Space,Str "Two"],MetaInlines [Str "Author",Space,Str "Three"],MetaInlines [Str "Author",Space,Str "Four"]]),("title",MetaInlines [Str "Title",SoftBreak,Str "spanning",Space,Str "multiple",Space,Str "lines"])]}) -[Header 1 ("additional-markdown-reader-tests",[],[]) [Str "Additional",Space,Str "markdown",Space,Str "reader",Space,Str "tests"] -,Header 2 ("blank-line-before-url-in-link-reference",[],[]) [Str "Blank",Space,Str "line",Space,Str "before",Space,Str "URL",Space,Str "in",Space,Str "link",Space,Str "reference"] -,Para [Link ("",[],[]) [Str "foo"] ("/url",""),Space,Str "and",Space,Link ("",[],[]) [Str "bar"] ("/url","title")] -,Header 2 ("raw-context-environments",[],[]) [Str "Raw",Space,Str "ConTeXt",Space,Str "environments"] -,RawBlock (Format "tex") "\\placeformula \\startformula" -,Para [Str "L_{1}",Space,Str "=",Space,Str "L_{2}",SoftBreak,RawInline (Format "tex") "\\stopformula"] -,RawBlock (Format "tex") "\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]" -,Header 2 ("raw-latex-environments",[],[]) [Str "Raw",Space,Str "LaTeX",Space,Str "environments"] -,RawBlock (Format "tex") "\\begin{center}\n\\begin{tikzpicture}[baseline={([yshift=+-.5ex]current bounding box.center)}, level distance=24pt]\n\\Tree [.{S} [.NP John\\index{i} ] [.VP [.V likes ] [.NP himself\\index{i,*j} ]]]\n\\end{tikzpicture}\n\\end{center}" -,Header 2 ("urls-with-spaces-and-punctuation",[],[]) [Str "URLs",Space,Str "with",Space,Str "spaces",Space,Str "and",Space,Str "punctuation"] -,Para [Link ("",[],[]) [Str "foo"] ("/bar%20and%20baz",""),SoftBreak,Link ("",[],[]) [Str "foo"] ("/bar%20and%20baz",""),SoftBreak,Link ("",[],[]) [Str "foo"] ("/bar%20and%20baz",""),SoftBreak,Link ("",[],[]) [Str "foo"] ("bar%20baz","title")] -,Para [Link ("",[],[]) [Str "baz"] ("/foo%20foo",""),Space,Link ("",[],[]) [Str "bam"] ("/foo%20fee",""),Space,Link ("",[],[]) [Str "bork"] ("/foo/zee%20zob","title")] -,Para [Link ("",[],[]) [Str "Ward\8217s",Space,Str "method."] ("http://en.wikipedia.org/wiki/Ward's_method","")] -,Header 2 ("horizontal-rules-with-spaces-at-end",[],[]) [Str "Horizontal",Space,Str "rules",Space,Str "with",Space,Str "spaces",Space,Str "at",Space,Str "end"] -,HorizontalRule -,HorizontalRule -,Header 2 ("raw-html-before-header",[],[]) [Str "Raw",Space,Str "HTML",Space,Str "before",Space,Str "header"] -,Para [RawInline (Format "html") "",RawInline (Format "html") ""] -,Header 3 ("my-header",[],[]) [Str "my",Space,Str "header"] -,Header 2 ("in-math",[],[]) [Str "$",Space,Str "in",Space,Str "math"] -,Para [Math InlineMath "\\$2 + \\$3"] -,Para [Math InlineMath "x = \\text{the $n$th root of $y$}"] -,Para [Str "This",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "math:"] -,Para [Str "$PATH",Space,Str "90",Space,Str "$PATH"] -,Header 2 ("commented-out-list-item",[],[]) [Str "Commented-out",Space,Str "list",Space,Str "item"] -,BulletList - [[Plain [Str "one",SoftBreak,RawInline (Format "html") ""]] - ,[Plain [Str "three"]]] -,Header 2 ("indented-code-at-beginning-of-list",[],[]) [Str "Indented",Space,Str "code",Space,Str "at",Space,Str "beginning",Space,Str "of",Space,Str "list"] -,BulletList - [[CodeBlock ("",[],[]) "code\ncode" - ,OrderedList (1,Decimal,Period) - [[CodeBlock ("",[],[]) "code\ncode"] - ,[CodeBlock ("",[],[]) "code\ncode"]] - ,BulletList - [[CodeBlock ("",[],[]) "code\ncode"] - ,[Plain [Str "no",Space,Str "code"]]]]] -,Header 2 ("backslash-newline",[],[]) [Str "Backslash",Space,Str "newline"] -,Para [Str "hi",LineBreak,Str "there"] -,Header 2 ("code-spans",[],[]) [Str "Code",Space,Str "spans"] -,Para [Code ("",[],[]) "hi\\"] -,Para [Code ("",[],[]) "hi there"] -,Para [Code ("",[],[]) "hi````there"] -,Para [Str "`hi"] -,Para [Str "there`"] -,Header 2 ("multilingual-urls",[],[]) [Str "Multilingual",Space,Str "URLs"] -,Para [Link ("",["uri"],[]) [Str "http://\27979.com?\27979=\27979"] ("http://\27979.com?\27979=\27979","")] -,Para [Link ("",[],[]) [Str "foo"] ("/bar/\27979?x=\27979","title")] -,Para [Link ("",["email"],[]) [Str "\27979@foo.\27979.baz"] ("mailto:\27979@foo.\27979.baz","")] -,Header 2 ("numbered-examples",[],[]) [Str "Numbered",Space,Str "examples"] -,OrderedList (1,Example,TwoParens) - [[Plain [Str "First",Space,Str "example."]] - ,[Plain [Str "Second",Space,Str "example."]]] -,Para [Str "Explanation",Space,Str "of",Space,Str "examples",Space,Str "(2)",Space,Str "and",Space,Str "(3)."] -,OrderedList (3,Example,TwoParens) - [[Plain [Str "Third",Space,Str "example."]]] -,Header 2 ("macros",[],[]) [Str "Macros"] -,RawBlock (Format "tex") "\\newcommand{\\tuple}[1]{\\langle #1 \\rangle}" -,Para [Math InlineMath "\\langle x,y \\rangle"] -,Header 2 ("case-insensitive-references",[],[]) [Str "Case-insensitive",Space,Str "references"] -,Para [Link ("",[],[]) [Str "Fum"] ("/fum","")] -,Para [Link ("",[],[]) [Str "FUM"] ("/fum","")] -,Para [Link ("",[],[]) [Str "bat"] ("/bat","")] -,Header 2 ("curly-smart-quotes",[],[]) [Str "Curly",Space,Str "smart",Space,Str "quotes"] -,Para [Quoted DoubleQuote [Str "Hi"]] -,Para [Quoted SingleQuote [Str "Hi"]] -,Header 2 ("consecutive-lists",[],[]) [Str "Consecutive",Space,Str "lists"] -,BulletList - [[Plain [Str "one"]] - ,[Plain [Str "two"]]] -,OrderedList (1,Decimal,Period) - [[Plain [Str "one"]] - ,[Plain [Str "two"]]] -,OrderedList (1,LowerAlpha,Period) - [[Plain [Str "one"]] - ,[Plain [Str "two"]]] -,Header 2 ("implicit-header-references",[],[]) [Str "Implicit",Space,Str "header",Space,Str "references"] -,Header 3 ("my-header-1",[],[]) [Str "My",Space,Str "header"] -,Header 3 ("my-other-header",[],[]) [Str "My",Space,Str "other",Space,Str "header"] -,Para [Str "A",Space,Str "link",Space,Str "to",Space,Link ("",[],[]) [Str "My",Space,Str "header"] ("#my-header-1",""),Str "."] -,Para [Str "Another",Space,Str "link",Space,Str "to",Space,Link ("",[],[]) [Str "it"] ("#my-header-1",""),Str "."] -,Para [Str "Should",Space,Str "be",Space,Link ("",[],[]) [Str "case",Space,Str "insensitive"] ("#my-header-1",""),Str "."] -,Para [Str "Link",Space,Str "to",Space,Link ("",[],[]) [Str "Explicit",Space,Str "header",Space,Str "attributes"] ("#foobar",""),Str "."] -,Para [Str "But",Space,Str "this",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "link",Space,Str "to",Space,Link ("",[],[]) [Str "My",Space,Str "other",Space,Str "header"] ("/foo",""),Str ",",Space,Str "since",Space,Str "the",Space,Str "reference",Space,Str "is",Space,Str "defined."] -,Header 2 ("foobar",["baz"],[("key","val")]) [Str "Explicit",Space,Str "header",Space,Str "attributes"] -,BlockQuote - [Header 2 ("foobar",["baz"],[("key","val")]) [Str "Header",Space,Str "attributes",Space,Str "inside",Space,Str "block",Space,Str "quote"]] -,Header 2 ("line-blocks",[],[]) [Str "Line",Space,Str "blocks"] -,LineBlock - [[Str "But",Space,Str "can",Space,Str "a",Space,Str "bee",Space,Str "be",Space,Str "said",Space,Str "to",Space,Str "be"] - ,[Str "\160\160\160\160or",Space,Str "not",Space,Str "to",Space,Str "be",Space,Str "an",Space,Str "entire",Space,Str "bee,"] - ,[Str "\160\160\160\160\160\160\160\160when",Space,Str "half",Space,Str "the",Space,Str "bee",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "bee,"] - ,[Str "\160\160\160\160\160\160\160\160\160\160\160\160due",Space,Str "to",Space,Str "some",Space,Str "ancient",Space,Str "injury?"] - ,[] - ,[Str "Continuation",Space,Str "line"] - ,[Str "\160\160and",Space,Str "another"]] -,Header 2 ("grid-tables",[],[]) [Str "Grid",Space,Str "Tables"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.2638888888888889) - ,(AlignDefault,ColWidth 0.16666666666666666) - ,(AlignDefault,ColWidth 0.18055555555555555)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "3"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r1",Space,Str "a",SoftBreak,Str "r1",Space,Str "bis"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b",SoftBreak,Str "b",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c",SoftBreak,Str "c",Space,Str "2"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r2",Space,Str "d"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Headless"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.2638888888888889) - ,(AlignDefault,ColWidth 0.16666666666666666) - ,(AlignDefault,ColWidth 0.18055555555555555)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r1",Space,Str "a",SoftBreak,Str "r1",Space,Str "bis"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b",SoftBreak,Str "b",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c",SoftBreak,Str "c",Space,Str "2"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r2",Space,Str "d"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "With",Space,Str "alignments"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidth 0.2638888888888889) - ,(AlignLeft,ColWidth 0.16666666666666666) - ,(AlignCenter,ColWidth 0.18055555555555555)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "3"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r1",Space,Str "a",SoftBreak,Str "r1",Space,Str "bis"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b",SoftBreak,Str "b",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c",SoftBreak,Str "c",Space,Str "2"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r2",Space,Str "d"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Headless",Space,Str "with",Space,Str "alignments"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidth 0.2638888888888889) - ,(AlignLeft,ColWidth 0.16666666666666666) - ,(AlignCenter,ColWidth 0.18055555555555555)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r1",Space,Str "a",SoftBreak,Str "r1",Space,Str "bis"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b",SoftBreak,Str "b",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c",SoftBreak,Str "c",Space,Str "2"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r2",Space,Str "d"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Spaces",Space,Str "at",Space,Str "ends",Space,Str "of",Space,Str "lines"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.2638888888888889) - ,(AlignDefault,ColWidth 0.16666666666666666) - ,(AlignDefault,ColWidth 0.18055555555555555)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r1",Space,Str "a",SoftBreak,Str "r1",Space,Str "bis"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b",SoftBreak,Str "b",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c",SoftBreak,Str "c",Space,Str "2"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r2",Space,Str "d"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Multiple",Space,Str "blocks",Space,Str "in",Space,Str "a",Space,Str "cell"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.2638888888888889) - ,(AlignDefault,ColWidth 0.16666666666666666) - ,(AlignDefault,ColWidth 0.18055555555555555)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Header 1 ("col-1",[],[]) [Str "col",Space,Str "1"] - ,Plain [Str "col",Space,Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Header 1 ("col-2",[],[]) [Str "col",Space,Str "2"] - ,Plain [Str "col",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Header 1 ("col-3",[],[]) [Str "col",Space,Str "3"] - ,Plain [Str "col",Space,Str "3"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "r1",Space,Str "a"] - ,Para [Str "r1",Space,Str "bis"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [BulletList - [[Plain [Str "b"]] - ,[Plain [Str "b",Space,Str "2"]] - ,[Plain [Str "b",Space,Str "2"]]]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c",SoftBreak,Str "c",Space,Str "2",SoftBreak,Str "c",Space,Str "2"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Empty",Space,Str "cells"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 5.555555555555555e-2) - ,(AlignDefault,ColWidth 5.555555555555555e-2)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]])] - (TableFoot ("",[],[]) - []) -,Header 2 ("entities-in-links-and-titles",[],[]) [Str "Entities",Space,Str "in",Space,Str "links",Space,Str "and",Space,Str "titles"] -,Para [Link ("",[],[]) [Str "link"] ("/\252rl","\246\246!")] -,Para [Link ("",["uri"],[]) [Str "http://g\246\246gle.com"] ("http://g\246\246gle.com","")] -,Para [Link ("",["email"],[]) [Str "me@ex\228mple.com"] ("mailto:me@ex\228mple.com","")] -,Para [Link ("",[],[]) [Str "foobar"] ("/\252rl","\246\246!")] -,Header 2 ("parentheses-in-urls",[],[]) [Str "Parentheses",Space,Str "in",Space,Str "URLs"] -,Para [Link ("",[],[]) [Str "link"] ("/hi(there)","")] -,Para [Link ("",[],[]) [Str "link"] ("/hithere)","")] -,Para [Link ("",[],[]) [Str "linky"] ("hi_(there_(nested))","")] -,Header 2 ("backslashes-in-link-references",[],[]) [Str "Backslashes",Space,Str "in",Space,Str "link",Space,Str "references"] -,Para [Link ("",[],[]) [Str "*",RawInline (Format "tex") "\\a"] ("b","")] -,Header 2 ("reference-link-fallbacks",[],[]) [Str "Reference",Space,Str "link",Space,Str "fallbacks"] -,Para [Str "[",Emph [Str "not",Space,Str "a",Space,Str "link"],Str "]",Space,Str "[",Emph [Str "nope"],Str "]\8230"] -,Header 2 ("reference-link-followed-by-a-citation",[],[]) [Str "Reference",Space,Str "link",Space,Str "followed",Space,Str "by",Space,Str "a",Space,Str "citation"] -,Para [Str "MapReduce",Space,Str "is",Space,Str "a",Space,Str "paradigm",Space,Str "popularized",Space,Str "by",Space,Link ("",[],[]) [Str "Google"] ("http://google.com",""),Space,Cite [Citation {citationId = "mapreduce", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 2, citationHash = 0}] [Str "[@mapreduce]"],Space,Str "as",Space,Str "its",SoftBreak,Str "most",Space,Str "vocal",Space,Str "proponent."] -,Header 2 ("empty-reference-links",[],[]) [Str "Empty",Space,Str "reference",Space,Str "links"] -,Para [Str "bar"] -,Para [Link ("",[],[]) [Str "foo2"] ("","")] -,Header 2 ("wrapping-shouldnt-introduce-new-list-items",[],[]) [Str "Wrapping",Space,Str "shouldn\8217t",Space,Str "introduce",Space,Str "new",Space,Str "list",Space,Str "items"] -,BulletList - [[Plain [Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "blah",Space,Str "2015."]]] -,Header 2 ("bracketed-spans",[],[]) [Str "Bracketed",Space,Str "spans"] -,Para [Span ("id",["class"],[("key","val")]) [Emph [Str "foo"],Space,Str "bar",Space,Str "baz",Space,Link ("",[],[]) [Str "link"] ("url","")]]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "author" + , MetaList + [ MetaInlines + [ Str "Author", Space, Str "One" ] + , MetaInlines + [ Str "Author", Space, Str "Two" ] + , MetaInlines + [ Str "Author", Space, Str "Three" ] + , MetaInlines + [ Str "Author", Space, Str "Four" ] + ] + ) + , + ( "title" + , MetaInlines + [ Str "Title" + , SoftBreak + , Str "spanning" + , Space + , Str "multiple" + , Space + , Str "lines" + ] + ) + ] + } + ) + [ Header 1 + ( "additional-markdown-reader-tests", [], [] ) + [ Str "Additional" + , Space + , Str "markdown" + , Space + , Str "reader" + , Space + , Str "tests" + ] + , Header 2 + ( "blank-line-before-url-in-link-reference", [], [] ) + [ Str "Blank" + , Space + , Str "line" + , Space + , Str "before" + , Space + , Str "URL" + , Space + , Str "in" + , Space + , Str "link" + , Space + , Str "reference" + ] + , Para + [ Link + ( "", [], [] ) + [ Str "foo" ] + ( "/url", "" ) + , Space + , Str "and" + , Space + , Link + ( "", [], [] ) + [ Str "bar" ] + ( "/url", "title" ) + ] + , Header 2 + ( "raw-context-environments", [], [] ) + [ Str "Raw", Space, Str "ConTeXt", Space, Str "environments" ] + , RawBlock + ( Format "tex" ) "\\placeformula \\startformula" + , Para + [ Str "L_{1}" + , Space + , Str "=" + , Space + , Str "L_{2}" + , SoftBreak + , RawInline + ( Format "tex" ) "\\stopformula" + ] + , RawBlock + ( Format "tex" ) "\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]" + , Header 2 + ( "raw-latex-environments", [], [] ) + [ Str "Raw", Space, Str "LaTeX", Space, Str "environments" ] + , RawBlock + ( Format "tex" ) "\\begin{center}\n\\begin{tikzpicture}[baseline={([yshift=+-.5ex]current bounding box.center)}, level distance=24pt]\n\\Tree [.{S} [.NP John\\index{i} ] [.VP [.V likes ] [.NP himself\\index{i,*j} ]]]\n\\end{tikzpicture}\n\\end{center}" + , Header 2 + ( "urls-with-spaces-and-punctuation", [], [] ) + [ Str "URLs" + , Space + , Str "with" + , Space + , Str "spaces" + , Space + , Str "and" + , Space + , Str "punctuation" + ] + , Para + [ Link + ( "", [], [] ) + [ Str "foo" ] + ( "/bar%20and%20baz", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "foo" ] + ( "/bar%20and%20baz", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "foo" ] + ( "/bar%20and%20baz", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "foo" ] + ( "bar%20baz", "title" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "baz" ] + ( "/foo%20foo", "" ) + , Space + , Link + ( "", [], [] ) + [ Str "bam" ] + ( "/foo%20fee", "" ) + , Space + , Link + ( "", [], [] ) + [ Str "bork" ] + ( "/foo/zee%20zob", "title" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "Ward\8217s", Space, Str "method." ] + ( "http://en.wikipedia.org/wiki/Ward's_method", "" ) + ] + , Header 2 + ( "horizontal-rules-with-spaces-at-end", [], [] ) + [ Str "Horizontal" + , Space + , Str "rules" + , Space + , Str "with" + , Space + , Str "spaces" + , Space + , Str "at" + , Space + , Str "end" + ] + , HorizontalRule + , HorizontalRule + , Header 2 + ( "raw-html-before-header", [], [] ) + [ Str "Raw" + , Space + , Str "HTML" + , Space + , Str "before" + , Space + , Str "header" + ] + , Para + [ RawInline + ( Format "html" ) "" + , RawInline + ( Format "html" ) "" + ] + , Header 3 + ( "my-header", [], [] ) + [ Str "my", Space, Str "header" ] + , Header 2 + ( "in-math", [], [] ) + [ Str "$", Space, Str "in", Space, Str "math" ] + , Para + [ Math InlineMath "\\$2 + \\$3" ] + , Para + [ Math InlineMath "x = \\text{the $n$th root of $y$}" ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "math:" + ] + , Para + [ Str "$PATH", Space, Str "90", Space, Str "$PATH" ] + , Header 2 + ( "commented-out-list-item", [], [] ) + [ Str "Commented-out", Space, Str "list", Space, Str "item" ] + , BulletList + [ + [ Plain + [ Str "one" + , SoftBreak + , RawInline + ( Format "html" ) "" + ] + ] + , + [ Plain [ Str "three" ] ] + ] + , Header 2 + ( "indented-code-at-beginning-of-list", [], [] ) + [ Str "Indented" + , Space + , Str "code" + , Space + , Str "at" + , Space + , Str "beginning" + , Space + , Str "of" + , Space + , Str "list" + ] + , BulletList + [ + [ CodeBlock + ( "", [], [] ) "code\ncode" + , OrderedList + ( 1, Decimal, Period ) + [ + [ CodeBlock ( "", [], [] ) "code\ncode" ] + , + [ CodeBlock ( "", [], [] ) "code\ncode" ] + ] + , BulletList + [ + [ CodeBlock ( "", [], [] ) "code\ncode" ] + , + [ Plain [ Str "no", Space, Str "code" ] ] + ] + ] + ] + , Header 2 + ( "backslash-newline", [], [] ) + [ Str "Backslash", Space, Str "newline" ] + , Para + [ Str "hi", LineBreak, Str "there" ] + , Header 2 + ( "code-spans", [], [] ) + [ Str "Code", Space, Str "spans" ] + , Para + [ Code ( "", [], [] ) "hi\\" ] + , Para + [ Code ( "", [], [] ) "hi there" ] + , Para + [ Code ( "", [], [] ) "hi````there" ] + , Para + [ Str "`hi" ] + , Para + [ Str "there`" ] + , Header 2 + ( "multilingual-urls", [], [] ) + [ Str "Multilingual", Space, Str "URLs" ] + , Para + [ Link + ( "", [ "uri" ], [] ) + [ Str "http://\27979.com?\27979=\27979" ] + ( "http://\27979.com?\27979=\27979", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "foo" ] + ( "/bar/\27979?x=\27979", "title" ) + ] + , Para + [ Link + ( "", [ "email" ], [] ) + [ Str "\27979@foo.\27979.baz" ] + ( "mailto:\27979@foo.\27979.baz", "" ) + ] + , Header 2 + ( "numbered-examples", [], [] ) + [ Str "Numbered", Space, Str "examples" ] + , OrderedList + ( 1, Example, TwoParens ) + [ + [ Plain [ Str "First", Space, Str "example." ] ] + , + [ Plain [ Str "Second", Space, Str "example." ] ] + ] + , Para + [ Str "Explanation" + , Space + , Str "of" + , Space + , Str "examples" + , Space + , Str "(2)" + , Space + , Str "and" + , Space + , Str "(3)." + ] + , OrderedList + ( 3, Example, TwoParens ) + [ [ Plain [ Str "Third", Space, Str "example." ] ] ] + , Header 2 + ( "macros", [], [] ) + [ Str "Macros" ] + , RawBlock + ( Format "tex" ) "\\newcommand{\\tuple}[1]{\\langle #1 \\rangle}" + , Para + [ Math InlineMath "\\langle x,y \\rangle" ] + , Header 2 + ( "case-insensitive-references", [], [] ) + [ Str "Case-insensitive", Space, Str "references" ] + , Para + [ Link ( "", [], [] ) [ Str "Fum" ] ( "/fum", "" ) ] + , Para + [ Link ( "", [], [] ) [ Str "FUM" ] ( "/fum", "" ) ] + , Para + [ Link ( "", [], [] ) [ Str "bat" ] ( "/bat", "" ) ] + , Header 2 + ( "curly-smart-quotes", [], [] ) + [ Str "Curly", Space, Str "smart", Space, Str "quotes" ] + , Para + [ Quoted DoubleQuote [ Str "Hi" ] ] + , Para + [ Quoted SingleQuote [ Str "Hi" ] ] + , Header 2 + ( "consecutive-lists", [], [] ) + [ Str "Consecutive", Space, Str "lists" ] + , BulletList + [ [ Plain [ Str "one" ] ], [ Plain [ Str "two" ] ] ] + , OrderedList + ( 1, Decimal, Period ) + [ [ Plain [ Str "one" ] ], [ Plain [ Str "two" ] ] ] + , OrderedList + ( 1, LowerAlpha, Period ) + [ [ Plain [ Str "one" ] ], [ Plain [ Str "two" ] ] ] + , Header 2 + ( "implicit-header-references", [], [] ) + [ Str "Implicit", Space, Str "header", Space, Str "references" ] + , Header 3 + ( "my-header-1", [], [] ) + [ Str "My", Space, Str "header" ] + , Header 3 + ( "my-other-header", [], [] ) + [ Str "My", Space, Str "other", Space, Str "header" ] + , Para + [ Str "A" + , Space + , Str "link" + , Space + , Str "to" + , Space + , Link + ( "", [], [] ) + [ Str "My", Space, Str "header" ] + ( "#my-header-1", "" ) + , Str "." + ] + , Para + [ Str "Another" + , Space + , Str "link" + , Space + , Str "to" + , Space + , Link + ( "", [], [] ) + [ Str "it" ] + ( "#my-header-1", "" ) + , Str "." + ] + , Para + [ Str "Should" + , Space + , Str "be" + , Space + , Link + ( "", [], [] ) + [ Str "case", Space, Str "insensitive" ] + ( "#my-header-1", "" ) + , Str "." + ] + , Para + [ Str "Link" + , Space + , Str "to" + , Space + , Link + ( "", [], [] ) + [ Str "Explicit", Space, Str "header", Space, Str "attributes" ] + ( "#foobar", "" ) + , Str "." + ] + , Para + [ Str "But" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "to" + , Space + , Link + ( "", [], [] ) + [ Str "My", Space, Str "other", Space, Str "header" ] + ( "/foo", "" ) + , Str "," + , Space + , Str "since" + , Space + , Str "the" + , Space + , Str "reference" + , Space + , Str "is" + , Space + , Str "defined." + ] + , Header 2 + ( "foobar", [ "baz" ], [ ( "key", "val" ) ] ) + [ Str "Explicit", Space, Str "header", Space, Str "attributes" ] + , BlockQuote + [ Header 2 + ( "foobar", [ "baz" ], [ ( "key", "val" ) ] ) + [ Str "Header" + , Space + , Str "attributes" + , Space + , Str "inside" + , Space + , Str "block" + , Space + , Str "quote" + ] + ] + , Header 2 + ( "line-blocks", [], [] ) + [ Str "Line", Space, Str "blocks" ] + , LineBlock + [ + [ Str "But" + , Space + , Str "can" + , Space + , Str "a" + , Space + , Str "bee" + , Space + , Str "be" + , Space + , Str "said" + , Space + , Str "to" + , Space + , Str "be" + ] + , + [ Str "\160\160\160\160or" + , Space + , Str "not" + , Space + , Str "to" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "entire" + , Space + , Str "bee," + ] + , + [ Str "\160\160\160\160\160\160\160\160when" + , Space + , Str "half" + , Space + , Str "the" + , Space + , Str "bee" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "bee," + ] + , + [ Str "\160\160\160\160\160\160\160\160\160\160\160\160due" + , Space + , Str "to" + , Space + , Str "some" + , Space + , Str "ancient" + , Space + , Str "injury?" + ] + , [] + , + [ Str "Continuation", Space, Str "line" ] + , + [ Str "\160\160and", Space, Str "another" ] + ] + , Header 2 + ( "grid-tables", [], [] ) + [ Str "Grid", Space, Str "Tables" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.2638888888888889 ) + , + ( AlignDefault, ColWidth 0.16666666666666666 ) + , + ( AlignDefault, ColWidth 0.18055555555555555 ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "3" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r2", Space, Str "d" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Headless" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.2638888888888889 ) + , + ( AlignDefault, ColWidth 0.16666666666666666 ) + , + ( AlignDefault, ColWidth 0.18055555555555555 ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r2", Space, Str "d" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "With", Space, Str "alignments" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignRight, ColWidth 0.2638888888888889 ) + , + ( AlignLeft, ColWidth 0.16666666666666666 ) + , + ( AlignCenter, ColWidth 0.18055555555555555 ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "3" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r2", Space, Str "d" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Headless", Space, Str "with", Space, Str "alignments" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignRight, ColWidth 0.2638888888888889 ) + , + ( AlignLeft, ColWidth 0.16666666666666666 ) + , + ( AlignCenter, ColWidth 0.18055555555555555 ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r2", Space, Str "d" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Spaces" + , Space + , Str "at" + , Space + , Str "ends" + , Space + , Str "of" + , Space + , Str "lines" + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.2638888888888889 ) + , + ( AlignDefault, ColWidth 0.16666666666666666 ) + , + ( AlignDefault, ColWidth 0.18055555555555555 ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r2", Space, Str "d" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "cell" + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.2638888888888889 ) + , + ( AlignDefault, ColWidth 0.16666666666666666 ) + , + ( AlignDefault, ColWidth 0.18055555555555555 ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Header 1 + ( "col-1", [], [] ) + [ Str "col", Space, Str "1" ] + , Plain + [ Str "col", Space, Str "1" ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Header 1 + ( "col-2", [], [] ) + [ Str "col", Space, Str "2" ] + , Plain + [ Str "col", Space, Str "2" ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Header 1 + ( "col-3", [], [] ) + [ Str "col", Space, Str "3" ] + , Plain + [ Str "col", Space, Str "3" ] + ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para + [ Str "r1", Space, Str "a" ] + , Para + [ Str "r1", Space, Str "bis" ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ BulletList + [ + [ Plain [ Str "b" ] ] + , + [ Plain [ Str "b", Space, Str "2" ] ] + , + [ Plain [ Str "b", Space, Str "2" ] ] + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "c" + , SoftBreak + , Str "c" + , Space + , Str "2" + , SoftBreak + , Str "c" + , Space + , Str "2" + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Empty", Space, Str "cells" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 5.555555555555555 e- 2 ) + , + ( AlignDefault, ColWidth 5.555555555555555 e- 2 ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Header 2 + ( "entities-in-links-and-titles", [], [] ) + [ Str "Entities" + , Space + , Str "in" + , Space + , Str "links" + , Space + , Str "and" + , Space + , Str "titles" + ] + , Para + [ Link ( "", [], [] ) [ Str "link" ] ( "/\252rl", "\246\246!" ) ] + , Para + [ Link + ( "", [ "uri" ], [] ) + [ Str "http://g\246\246gle.com" ] + ( "http://g\246\246gle.com", "" ) + ] + , Para + [ Link + ( "", [ "email" ], [] ) + [ Str "me@ex\228mple.com" ] + ( "mailto:me@ex\228mple.com", "" ) + ] + , Para + [ Link ( "", [], [] ) [ Str "foobar" ] ( "/\252rl", "\246\246!" ) ] + , Header 2 + ( "parentheses-in-urls", [], [] ) + [ Str "Parentheses", Space, Str "in", Space, Str "URLs" ] + , Para + [ Link ( "", [], [] ) [ Str "link" ] ( "/hi(there)", "" ) ] + , Para + [ Link ( "", [], [] ) [ Str "link" ] ( "/hithere)", "" ) ] + , Para + [ Link + ( "", [], [] ) + [ Str "linky" ] + ( "hi_(there_(nested))", "" ) + ] + , Header 2 + ( "backslashes-in-link-references", [], [] ) + [ Str "Backslashes" + , Space + , Str "in" + , Space + , Str "link" + , Space + , Str "references" + ] + , Para + [ Link + ( "", [], [] ) + [ Str "*", RawInline ( Format "tex" ) "\\a" ] + ( "b", "" ) + ] + , Header 2 + ( "reference-link-fallbacks", [], [] ) + [ Str "Reference", Space, Str "link", Space, Str "fallbacks" ] + , Para + [ Str "[" + , Emph + [ Str "not", Space, Str "a", Space, Str "link" ] + , Str "]" + , Space + , Str "[" + , Emph + [ Str "nope" ] + , Str "]\8230" + ] + , Header 2 + ( "reference-link-followed-by-a-citation", [], [] ) + [ Str "Reference" + , Space + , Str "link" + , Space + , Str "followed" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "citation" + ] + , Para + [ Str "MapReduce" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paradigm" + , Space + , Str "popularized" + , Space + , Str "by" + , Space + , Link + ( "", [], [] ) + [ Str "Google" ] + ( "http://google.com", "" ) + , Space + , Cite + [ Citation + { citationId = "mapreduce" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 2 + , citationHash = 0 + } + ] + [ Str "[@mapreduce]" ] + , Space + , Str "as" + , Space + , Str "its" + , SoftBreak + , Str "most" + , Space + , Str "vocal" + , Space + , Str "proponent." + ] + , Header 2 + ( "empty-reference-links", [], [] ) + [ Str "Empty", Space, Str "reference", Space, Str "links" ] + , Para + [ Str "bar" ] + , Para + [ Link ( "", [], [] ) [ Str "foo2" ] ( "", "" ) ] + , Header 2 + ( "wrapping-shouldnt-introduce-new-list-items", [], [] ) + [ Str "Wrapping" + , Space + , Str "shouldn\8217t" + , Space + , Str "introduce" + , Space + , Str "new" + , Space + , Str "list" + , Space + , Str "items" + ] + , BulletList + [ + [ Plain + [ Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "2015." + ] + ] + ] + , Header 2 + ( "bracketed-spans", [], [] ) + [ Str "Bracketed", Space, Str "spans" ] + , Para + [ Span + ( "id", [ "class" ], [ ( "key", "val" ) ] ) + [ Emph + [ Str "foo" ] + , Space + , Str "bar" + , Space + , Str "baz" + , Space + , Link + ( "", [], [] ) + [ Str "link" ] + ( "url", "" ) + ] + ] + ] diff --git a/test/mediawiki-reader.native b/test/mediawiki-reader.native index d7ac63215..0a1e1c29d 100644 --- a/test/mediawiki-reader.native +++ b/test/mediawiki-reader.native @@ -1,418 +1,1444 @@ -Pandoc (Meta {unMeta = fromList []}) -[Header 1 ("header",[],[]) [Str "header"] -,Header 2 ("header_level_two",[],[]) [Str "header",Space,Str "level",Space,Str "two"] -,Header 3 ("header_level_3",[],[]) [Str "header",Space,Str "level",Space,Str "3"] -,Header 4 ("header_level_four",[],[]) [Str "header",Space,Emph [Str "level"],Space,Str "four"] -,Header 5 ("header_level_5",[],[]) [Str "header",Space,Str "level",Space,Str "5"] -,Header 6 ("header_level_6",[],[]) [Str "header",Space,Str "level",Space,Str "6"] -,Para [Str "=======",Space,Str "not",Space,Str "a",Space,Str "header",Space,Str "========"] -,Para [Code ("",[],[]) "==\160not\160a\160header\160=="] -,Header 2 ("emph_and_strong",[],[]) [Str "emph",Space,Str "and",Space,Str "strong"] -,Para [Emph [Str "emph"],Space,Strong [Str "strong"]] -,Para [Strong [Emph [Str "strong",Space,Str "and",Space,Str "emph"]]] -,Para [Strong [Emph [Str "emph",Space,Str "inside"],Space,Str "strong"]] -,Para [Strong [Str "strong",Space,Str "with",Space,Emph [Str "emph"]]] -,Para [Emph [Strong [Str "strong",Space,Str "inside"],Space,Str "emph"]] -,Header 2 ("horizontal_rule",[],[]) [Str "horizontal",Space,Str "rule"] -,Para [Str "top"] -,HorizontalRule -,Para [Str "bottom"] -,HorizontalRule -,Header 2 ("nowiki",[],[]) [Str "nowiki"] -,Para [Str "''not",Space,Str "emph''"] -,Header 2 ("strikeout",[],[]) [Str "strikeout"] -,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "struck",Space,Str "out"]]] -,Header 2 ("entities",[],[]) [Str "entities"] -,Para [Str "hi",Space,Str "&",Space,Str "low"] -,Para [Str "hi",Space,Str "&",Space,Str "low"] -,Para [Str "G\246del"] -,Para [Str "\777\2730"] -,Header 2 ("comments",[],[]) [Str "comments"] -,Para [Str "inline",Space,Str "comment"] -,Para [Str "between",Space,Str "blocks"] -,Header 2 ("linebreaks",[],[]) [Str "linebreaks"] -,Para [Str "hi",LineBreak,Str "there"] -,Para [Str "hi",LineBreak,Str "there"] -,Header 2 ("indents",[],[]) [Str ":",Space,Str "indents"] -,Para [Str "hi"] -,DefinitionList - [([], - [[Plain [Str "there"]]])] -,Para [Str "bud"] -,Para [Str "hi"] -,DefinitionList - [([], - [[DefinitionList - [([], - [[Plain [Str "there"]]])]]])] -,Para [Str "bud"] -,Header 2 ("p_tags",[],[]) [Str "p",Space,Str "tags"] -,Para [Str "hi",Space,Str "there"] -,Para [Str "bud"] -,Para [Str "another"] -,Header 2 ("raw_html",[],[]) [Str "raw",Space,Str "html"] -,Para [Str "hi",Space,RawInline (Format "html") "",Emph [Str "there"],RawInline (Format "html") "",Str "."] -,Para [RawInline (Format "html") "",Str "inserted",RawInline (Format "html") ""] -,RawBlock (Format "html") "
" -,Para [Str "hi",Space,Emph [Str "there"]] -,RawBlock (Format "html") "
" -,Header 2 ("sup_sub_del",[],[]) [Str "sup,",Space,Str "sub,",Space,Str "del"] -,Para [Str "H",Subscript [Str "2"],Str "O",Space,Str "base",Superscript [Emph [Str "exponent"]],SoftBreak,Strikeout [Str "hello"]] -,Header 2 ("inline_code",[],[]) [Str "inline",Space,Str "code"] -,Para [Code ("",[],[]) "*\8594*",Space,Code ("",[],[]) "typed",Space,Code ("",["haskell"],[]) ">>="] -,Header 2 ("code_blocks",[],[]) [Str "code",Space,Str "blocks"] -,CodeBlock ("",[],[]) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" -,CodeBlock ("",["haskell"],[]) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" -,CodeBlock ("",["ruby","numberLines"],[("startFrom","100")]) "widgets.each do |w|\n print w.price\nend" -,Header 2 ("block_quotes",[],[]) [Str "block",Space,Str "quotes"] -,Para [Str "Regular",Space,Str "paragraph"] -,BlockQuote - [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote."] - ,Para [Str "With",Space,Str "two",Space,Str "paragraphs."]] -,Para [Str "Nother",Space,Str "paragraph."] -,Header 2 ("external_links",[],[]) [Str "external",Space,Str "links"] -,Para [Link ("",[],[]) [Emph [Str "Google"],Space,Str "search",Space,Str "engine"] ("http://google.com","")] -,Para [Link ("",[],[]) [Str "http://pandoc.org"] ("http://pandoc.org","")] -,Para [Link ("",[],[]) [Str "1"] ("http://google.com",""),Space,Link ("",[],[]) [Str "2"] ("http://yahoo.com","")] -,Para [Link ("",[],[]) [Str "email",Space,Str "me"] ("mailto:info@example.org","")] -,Header 2 ("internal_links",[],[]) [Str "internal",Space,Str "links"] -,Para [Link ("",[],[]) [Str "Help"] ("Help","wikilink")] -,Para [Link ("",[],[]) [Str "the",Space,Str "help",Space,Str "page"] ("Help","wikilink")] -,Para [Link ("",[],[]) [Str "Helpers"] ("Help","wikilink")] -,Para [Link ("",[],[]) [Str "Help"] ("Help","wikilink"),Str "ers"] -,Para [Link ("",[],[]) [Str "Contents"] ("Help:Contents","wikilink")] -,Para [Link ("",[],[]) [Str "#My",Space,Str "anchor"] ("#My_anchor","wikilink")] -,Para [Link ("",[],[]) [Str "and",Space,Str "text"] ("Page#with_anchor","wikilink")] -,Header 2 ("images",[],[]) [Str "images"] -,Para [Image ("",[],[]) [Str "caption"] ("example.jpg","fig:caption")] -,Para [Image ("",[],[]) [Str "the",Space,Emph [Str "caption"],Space,Str "with",Space,Link ("",[],[]) [Str "external",Space,Str "link"] ("http://google.com","")] ("example.jpg","fig:the caption with external link")] -,Para [Image ("",[],[("width","30"),("height","40")]) [Str "caption"] ("example.jpg","fig:caption")] -,Para [Image ("",[],[("width","30")]) [Str "caption"] ("example.jpg","fig:caption")] -,Para [Image ("",[],[("width","30")]) [Str "caption"] ("example.jpg","fig:caption")] -,Para [Image ("",[],[]) [Str "example.jpg"] ("example.jpg","fig:example.jpg")] -,Para [Image ("",[],[]) [Str "example_es.jpg"] ("example_es.jpg","fig:example_es.jpg")] -,Header 2 ("lists",[],[]) [Str "lists"] -,BulletList - [[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"] - ,BulletList - [[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."] - ,BulletList - [[BulletList - [[Plain [Str "But",Space,Str "jumping",Space,Str "levels",Space,Str "creates",Space,Str "empty",Space,Str "space."]]]]]]] -,Para [Str "Any",Space,Str "other",Space,Str "start",Space,Str "ends",Space,Str "the",Space,Str "list."] -,BulletList - [[BulletList - [[Plain [Str "two"]]]] - ,[Plain [Str "one"]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Start",Space,Str "each",Space,Str "line"]] - ,[Plain [Str "with",Space,Str "a",Space,Str "number",Space,Str "sign",Space,Str "(#)."] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[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"]] - ,[Plain [Str "levels."]]]]]] - ,[Plain [Str "Line",Space,Str "breaks",LineBreak,Str "don't",Space,Str "break",Space,Str "levels."] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "But",Space,Str "jumping",Space,Str "levels",Space,Str "creates",Space,Str "empty",Space,Str "space."]]]]]] - ,[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."]]] -,Para [Str "Any",Space,Str "other",Space,Str "start",Space,Str "also",SoftBreak,Str "ends",Space,Str "the",Space,Str "list."] -,DefinitionList - [([Str "item",Space,Str "1"], - [[Plain [Str "definition",Space,Str "1"]]]) - ,([Str "item",Space,Str "2"], - [[Plain [Str "definition",Space,Str "2-1"]] - ,[Plain [Str "definition",Space,Str "2-2"]]])] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "one"]] - ,[Plain [Str "two"] - ,BulletList - [[Plain [Str "two",Space,Str "point",Space,Str "one"]] - ,[Plain [Str "two",Space,Str "point",Space,Str "two"]]]] - ,[Plain [Str "three"] - ,DefinitionList - [([Str "three",Space,Str "item",Space,Str "one"], - [[Plain [Str "three",Space,Str "def",Space,Str "one"]]])]] - ,[Plain [Str "four"] - ,DefinitionList - [([], - [[Plain [Str "four",Space,Str "def",Space,Str "one"]] - ,[Plain [Str "this",Space,Str "looks",Space,Str "like",Space,Str "a",Space,Str "continuation"]] - ,[Plain [Str "and",Space,Str "is",Space,Str "often",Space,Str "used"]] - ,[Plain [Str "instead",LineBreak,Str "of",Space,Str "
"]]])]] - ,[Plain [RawInline (Format "mediawiki") "{{{template\n|author=John\n|title=My Book\n}}}"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[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"]]]] - ,[Plain [Str "five",Space,Str "sub",Space,Str "2"]]]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "list",Space,Str "item",Space,Emph [Str "emph"]] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "list",Space,Str "item",Space,Str "B1"]] - ,[Plain [Str "list",Space,Str "item",Space,Str "B2"]]] - ,Para [Str "continuing",Space,Str "list",Space,Str "item",Space,Str "A1"]] - ,[Plain [Str "list",Space,Str "item",Space,Str "A2"]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "abc"]] - ,[Plain [Str "def"]] - ,[Plain [Str "ghi"]]] -,OrderedList (9,DefaultStyle,DefaultDelim) - [[Plain [Str "Amsterdam"]] - ,[Plain [Str "Rotterdam"]] - ,[Plain [Str "The",Space,Str "Hague"]]] -,Header 2 ("math",[],[]) [Str "math"] -,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Math InlineMath "x=\\frac{y^\\pi}{z}",Str "."] -,Para [Str "With",Space,Str "spaces:",Space,Math InlineMath "x=\\frac{y^\\pi}{z}",Str "."] -,Header 2 ("preformatted_blocks",[],[]) [Str "preformatted",Space,Str "blocks"] -,Para [Code ("",[],[]) "Start\160each\160line\160with\160a\160space.",LineBreak,Code ("",[],[]) "Text\160is\160",Strong [Code ("",[],[]) "preformatted"],Code ("",[],[]) "\160and",LineBreak,Emph [Code ("",[],[]) "markups"],Code ("",[],[]) "\160",Strong [Emph [Code ("",[],[]) "can"]],Code ("",[],[]) "\160be\160done."] -,Para [Code ("",[],[]) "\160hell\160\160\160\160\160\160yeah"] -,Para [Code ("",[],[]) "Start\160with\160a\160space\160in\160the\160first\160column,",LineBreak,Code ("",[],[]) "(before\160the\160).",LineBreak,Code ("",[],[]) "",LineBreak,Code ("",[],[]) "Then\160your\160block\160format\160will\160be",LineBreak,Code ("",[],[]) "\160\160\160\160maintained.",LineBreak,Code ("",[],[]) "",LineBreak,Code ("",[],[]) "This\160is\160good\160for\160copying\160in\160code\160blocks:",LineBreak,Code ("",[],[]) "",LineBreak,Code ("",[],[]) "def\160function():",LineBreak,Code ("",[],[]) "\160\160\160\160\"\"\"documentation\160string\"\"\"",LineBreak,Code ("",[],[]) "",LineBreak,Code ("",[],[]) "\160\160\160\160if\160True:",LineBreak,Code ("",[],[]) "\160\160\160\160\160\160\160\160print\160True",LineBreak,Code ("",[],[]) "\160\160\160\160else:",LineBreak,Code ("",[],[]) "\160\160\160\160\160\160\160\160print\160False"] -,Para [Str "Not"] -,RawBlock (Format "html") "
" -,Para [Str "preformatted"] -,Para [Str "Don't",Space,Str "need"] -,Para [Code ("",[],[]) "a\160blank\160line"] -,Para [Str "around",Space,Str "a",Space,Str "preformatted",Space,Str "block."] -,Header 2 ("templates",[],[]) [Str "templates"] -,RawBlock (Format "mediawiki") "{{Welcome}}" -,RawBlock (Format "mediawiki") "{{Foo:Bar}}" -,RawBlock (Format "mediawiki") "{{Thankyou|all your effort|Me}}" -,Para [Str "Written",Space,RawInline (Format "mediawiki") "{{{date}}}",Space,Str "by",Space,RawInline (Format "mediawiki") "{{{name}}}",Str "."] -,Header 2 ("tables",[],[]) [Str "tables"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Apple"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Bread"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Pie"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Butter"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Ice",Space,Str "cream"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - [Plain [Str "Food",Space,Str "complements"]]) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Apple"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Bread"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Pie"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Butter"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Ice",Space,Str "cream"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - [Plain [Str "Food",Space,Str "complements"]]) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Apple"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Bread"] - ,Para [Str "and",Space,Str "cheese"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Pie"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "apple"]] - ,[Plain [Str "carrot"]]]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Apple"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "more"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Bread"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Pie"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "more"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Butter"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Ice",Space,Str "cream"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "and",Space,Str "more"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignLeft,ColWidth 0.25) - ,(AlignRight,ColWidth 0.125) - ,(AlignCenter,ColWidth 0.125)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Center"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "15.00"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "centered"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "more"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "2.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "more"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Apple"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Bread"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "fruit"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "topping"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "apple"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "ice",Space,Str "cream"]]]])] - (TableFoot ("",[],[]) - [])]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Butter"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Ice",Space,Str "cream"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Orange"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Paragraph",Space,Str "after",Space,Str "the",Space,Str "table."] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "fruit"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "topping"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "apple"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "ice",Space,Str "cream"]]]])] - (TableFoot ("",[],[]) - []) -,Header 2 ("notes",[],[]) [Str "notes"] -,Para [Str "My",Space,Str "note!",Note [Plain [Str "This."]]] -,Para [Str "URL",Space,Str "note.",Note [Plain [Link ("",[],[]) [Str "http://docs.python.org/library/functions.html#range"] ("http://docs.python.org/library/functions.html#range","")]]]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Header 1 + ( "header", [], [] ) + [ Str "header" ] + , Header 2 + ( "header_level_two", [], [] ) + [ Str "header", Space, Str "level", Space, Str "two" ] + , Header 3 + ( "header_level_3", [], [] ) + [ Str "header", Space, Str "level", Space, Str "3" ] + , Header 4 + ( "header_level_four", [], [] ) + [ Str "header", Space, Emph [ Str "level" ], Space, Str "four" ] + , Header 5 + ( "header_level_5", [], [] ) + [ Str "header", Space, Str "level", Space, Str "5" ] + , Header 6 + ( "header_level_6", [], [] ) + [ Str "header", Space, Str "level", Space, Str "6" ] + , Para + [ Str "=======" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + , Space + , Str "========" + ] + , Para + [ Code ( "", [], [] ) "==\160not\160a\160header\160==" ] + , Header 2 + ( "emph_and_strong", [], [] ) + [ Str "emph", Space, Str "and", Space, Str "strong" ] + , Para + [ Emph [ Str "emph" ], Space, Strong [ Str "strong" ] ] + , Para + [ Strong + [ Emph [ Str "strong", Space, Str "and", Space, Str "emph" ] ] + ] + , Para + [ Strong + [ Emph [ Str "emph", Space, Str "inside" ], Space, Str "strong" ] + ] + , Para + [ Strong + [ Str "strong", Space, Str "with", Space, Emph [ Str "emph" ] ] + ] + , Para + [ Emph + [ Strong + [ Str "strong", Space, Str "inside" ] + , Space + , Str "emph" + ] + ] + , Header 2 + ( "horizontal_rule", [], [] ) + [ Str "horizontal", Space, Str "rule" ] + , Para + [ Str "top" ] + , HorizontalRule + , Para + [ Str "bottom" ] + , HorizontalRule + , Header 2 + ( "nowiki", [], [] ) + [ Str "nowiki" ] + , Para + [ Str "''not", Space, Str "emph''" ] + , Header 2 + ( "strikeout", [], [] ) + [ Str "strikeout" ] + , Para + [ Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "struck", Space, Str "out" ] + ] + ] + , Header 2 + ( "entities", [], [] ) + [ Str "entities" ] + , Para + [ Str "hi", Space, Str "&", Space, Str "low" ] + , Para + [ Str "hi", Space, Str "&", Space, Str "low" ] + , Para + [ Str "G\246del" ] + , Para + [ Str "\777\2730" ] + , Header 2 + ( "comments", [], [] ) + [ Str "comments" ] + , Para + [ Str "inline", Space, Str "comment" ] + , Para + [ Str "between", Space, Str "blocks" ] + , Header 2 + ( "linebreaks", [], [] ) + [ Str "linebreaks" ] + , Para + [ Str "hi", LineBreak, Str "there" ] + , Para + [ Str "hi", LineBreak, Str "there" ] + , Header 2 + ( "indents", [], [] ) + [ Str ":", Space, Str "indents" ] + , Para + [ Str "hi" ] + , DefinitionList + [ ( [], [ [ Plain [ Str "there" ] ] ] ) ] + , Para + [ Str "bud" ] + , Para + [ Str "hi" ] + , DefinitionList + [ + ( [] + , + [ [ DefinitionList [ ( [], [ [ Plain [ Str "there" ] ] ] ) ] ] ] + ) + ] + , Para + [ Str "bud" ] + , Header 2 + ( "p_tags", [], [] ) + [ Str "p", Space, Str "tags" ] + , Para + [ Str "hi", Space, Str "there" ] + , Para + [ Str "bud" ] + , Para + [ Str "another" ] + , Header 2 + ( "raw_html", [], [] ) + [ Str "raw", Space, Str "html" ] + , Para + [ Str "hi" + , Space + , RawInline + ( Format "html" ) "" + , Emph + [ Str "there" ] + , RawInline + ( Format "html" ) "" + , Str "." + ] + , Para + [ RawInline + ( Format "html" ) "" + , Str "inserted" + , RawInline + ( Format "html" ) "" + ] + , RawBlock + ( Format "html" ) "
" + , Para + [ Str "hi", Space, Emph [ Str "there" ] ] + , RawBlock + ( Format "html" ) "
" + , Header 2 + ( "sup_sub_del", [], [] ) + [ Str "sup,", Space, Str "sub,", Space, Str "del" ] + , Para + [ Str "H" + , Subscript + [ Str "2" ] + , Str "O" + , Space + , Str "base" + , Superscript + [ Emph [ Str "exponent" ] ] + , SoftBreak + , Strikeout + [ Str "hello" ] + ] + , Header 2 + ( "inline_code", [], [] ) + [ Str "inline", Space, Str "code" ] + , Para + [ Code + ( "", [], [] ) "*\8594*" + , Space + , Code + ( "", [], [] ) "typed" + , Space + , Code + ( "", [ "haskell" ], [] ) ">>=" + ] + , Header 2 + ( "code_blocks", [], [] ) + [ Str "code", Space, Str "blocks" ] + , CodeBlock + ( "" + , [] + , [] + ) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" + , CodeBlock + ( "" + , [ "haskell" ] + , [] + ) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" + , CodeBlock + ( "" + , + [ "ruby", "numberLines" ] + , + [ ( "startFrom", "100" ) ] + ) "widgets.each do |w|\n print w.price\nend" + , Header 2 + ( "block_quotes", [], [] ) + [ Str "block", Space, Str "quotes" ] + , Para + [ Str "Regular", Space, Str "paragraph" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + ] + , Para + [ Str "With", Space, Str "two", Space, Str "paragraphs." ] + ] + , Para + [ Str "Nother", Space, Str "paragraph." ] + , Header 2 + ( "external_links", [], [] ) + [ Str "external", Space, Str "links" ] + , Para + [ Link + ( "", [], [] ) + [ Emph + [ Str "Google" ] + , Space + , Str "search" + , Space + , Str "engine" + ] + ( "http://google.com", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "http://pandoc.org" ] + ( "http://pandoc.org", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "1" ] + ( "http://google.com", "" ) + , Space + , Link + ( "", [], [] ) + [ Str "2" ] + ( "http://yahoo.com", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "email", Space, Str "me" ] + ( "mailto:info@example.org", "" ) + ] + , Header 2 + ( "internal_links", [], [] ) + [ Str "internal", Space, Str "links" ] + , Para + [ Link ( "", [], [] ) [ Str "Help" ] ( "Help", "wikilink" ) ] + , Para + [ Link + ( "", [], [] ) + [ Str "the", Space, Str "help", Space, Str "page" ] + ( "Help", "wikilink" ) + ] + , Para + [ Link ( "", [], [] ) [ Str "Helpers" ] ( "Help", "wikilink" ) ] + , Para + [ Link + ( "", [], [] ) + [ Str "Help" ] + ( "Help", "wikilink" ) + , Str "ers" + ] + , Para + [ Link + ( "", [], [] ) + [ Str "Contents" ] + ( "Help:Contents", "wikilink" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "#My", Space, Str "anchor" ] + ( "#My_anchor", "wikilink" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "and", Space, Str "text" ] + ( "Page#with_anchor", "wikilink" ) + ] + , Header 2 + ( "images", [], [] ) + [ Str "images" ] + , Para + [ Image + ( "", [], [] ) + [ Str "caption" ] + ( "example.jpg", "fig:caption" ) + ] + , Para + [ Image + ( "", [], [] ) + [ Str "the" + , Space + , Emph + [ Str "caption" ] + , Space + , Str "with" + , Space + , Link + ( "", [], [] ) + [ Str "external", Space, Str "link" ] + ( "http://google.com", "" ) + ] + ( "example.jpg", "fig:the caption with external link" ) + ] + , Para + [ Image + ( "", [], [ ( "width", "30" ), ( "height", "40" ) ] ) + [ Str "caption" ] + ( "example.jpg", "fig:caption" ) + ] + , Para + [ Image + ( "", [], [ ( "width", "30" ) ] ) + [ Str "caption" ] + ( "example.jpg", "fig:caption" ) + ] + , Para + [ Image + ( "", [], [ ( "width", "30" ) ] ) + [ Str "caption" ] + ( "example.jpg", "fig:caption" ) + ] + , Para + [ Image + ( "", [], [] ) + [ Str "example.jpg" ] + ( "example.jpg", "fig:example.jpg" ) + ] + , Para + [ Image + ( "", [], [] ) + [ Str "example_es.jpg" ] + ( "example_es.jpg", "fig:example_es.jpg" ) + ] + , Header 2 + ( "lists", [], [] ) + [ Str "lists" ] + , BulletList + [ + [ 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" + ] + , BulletList + [ + [ 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." + ] + , BulletList + [ + [ BulletList + [ + [ Plain + [ Str "But" + , Space + , Str "jumping" + , Space + , Str "levels" + , Space + , Str "creates" + , Space + , Str "empty" + , Space + , Str "space." + ] + ] + ] + ] + ] + ] + ] + , Para + [ Str "Any" + , Space + , Str "other" + , Space + , Str "start" + , Space + , Str "ends" + , Space + , Str "the" + , Space + , Str "list." + ] + , BulletList + [ + [ BulletList [ [ Plain [ Str "two" ] ] ] ] + , + [ Plain [ Str "one" ] ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "Start", Space, Str "each", Space, Str "line" ] ] + , + [ Plain + [ Str "with" + , Space + , Str "a" + , Space + , Str "number" + , Space + , Str "sign" + , Space + , Str "(#)." + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ 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" ] ] + , + [ Plain [ Str "levels." ] ] + ] + ] + ] + ] + , + [ Plain + [ Str "Line" + , Space + , Str "breaks" + , LineBreak + , Str "don't" + , Space + , Str "break" + , Space + , Str "levels." + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "But" + , Space + , Str "jumping" + , Space + , Str "levels" + , Space + , Str "creates" + , Space + , Str "empty" + , Space + , Str "space." + ] + ] + ] + ] + ] + ] + , + [ 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." + ] + ] + ] + , Para + [ Str "Any" + , Space + , Str "other" + , Space + , Str "start" + , Space + , Str "also" + , SoftBreak + , Str "ends" + , Space + , Str "the" + , Space + , Str "list." + ] + , DefinitionList + [ + ( + [ Str "item", Space, Str "1" ] + , + [ [ Plain [ Str "definition", Space, Str "1" ] ] ] + ) + , + ( + [ Str "item", Space, Str "2" ] + , + [ + [ Plain [ Str "definition", Space, Str "2-1" ] ] + , + [ Plain [ Str "definition", Space, Str "2-2" ] ] + ] + ) + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "one" ] ] + , + [ Plain + [ Str "two" ] + , BulletList + [ + [ Plain [ Str "two", Space, Str "point", Space, Str "one" ] ] + , + [ Plain [ Str "two", Space, Str "point", Space, Str "two" ] ] + ] + ] + , + [ Plain + [ Str "three" ] + , DefinitionList + [ + ( + [ Str "three", Space, Str "item", Space, Str "one" ] + , + [ + [ Plain + [ Str "three", Space, Str "def", Space, Str "one" ] + ] + ] + ) + ] + ] + , + [ Plain + [ Str "four" ] + , DefinitionList + [ + ( [] + , + [ + [ Plain + [ Str "four", Space, Str "def", Space, Str "one" ] + ] + , + [ Plain + [ Str "this" + , Space + , Str "looks" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "continuation" + ] + ] + , + [ Plain + [ Str "and" + , Space + , Str "is" + , Space + , Str "often" + , Space + , Str "used" + ] + ] + , + [ Plain + [ Str "instead" + , LineBreak + , Str "of" + , Space + , Str "
" + ] + ] + ] + ) + ] + ] + , + [ Plain + [ RawInline + ( Format "mediawiki" ) "{{{template\n|author=John\n|title=My Book\n}}}" + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ 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" + ] + ] + ] + ] + , + [ Plain [ Str "five", Space, Str "sub", Space, Str "2" ] ] + ] + ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "list", Space, Str "item", Space, Emph [ Str "emph" ] ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "list", Space, Str "item", Space, Str "B1" ] ] + , + [ Plain [ Str "list", Space, Str "item", Space, Str "B2" ] ] + ] + , Para + [ Str "continuing" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "A1" + ] + ] + , + [ Plain [ Str "list", Space, Str "item", Space, Str "A2" ] ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "abc" ] ] + , + [ Plain [ Str "def" ] ] + , + [ Plain [ Str "ghi" ] ] + ] + , OrderedList + ( 9, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "Amsterdam" ] ] + , + [ Plain [ Str "Rotterdam" ] ] + , + [ Plain [ Str "The", Space, Str "Hague" ] ] + ] + , Header 2 + ( "math", [], [] ) + [ Str "math" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Math InlineMath "x=\\frac{y^\\pi}{z}" + , Str "." + ] + , Para + [ Str "With" + , Space + , Str "spaces:" + , Space + , Math InlineMath "x=\\frac{y^\\pi}{z}" + , Str "." + ] + , Header 2 + ( "preformatted_blocks", [], [] ) + [ Str "preformatted", Space, Str "blocks" ] + , Para + [ Code + ( "", [], [] ) "Start\160each\160line\160with\160a\160space." + , LineBreak + , Code + ( "", [], [] ) "Text\160is\160" + , Strong + [ Code ( "", [], [] ) "preformatted" ] + , Code + ( "", [], [] ) "\160and" + , LineBreak + , Emph + [ Code ( "", [], [] ) "markups" ] + , Code + ( "", [], [] ) "\160" + , Strong + [ Emph [ Code ( "", [], [] ) "can" ] ] + , Code + ( "", [], [] ) "\160be\160done." + ] + , Para + [ Code ( "", [], [] ) "\160hell\160\160\160\160\160\160yeah" ] + , Para + [ Code + ( "" + , [] + , [] + ) "Start\160with\160a\160space\160in\160the\160first\160column," + , LineBreak + , Code + ( "", [], [] ) "(before\160the\160)." + , LineBreak + , Code + ( "", [], [] ) "" + , LineBreak + , Code + ( "", [], [] ) "Then\160your\160block\160format\160will\160be" + , LineBreak + , Code + ( "", [], [] ) "\160\160\160\160maintained." + , LineBreak + , Code + ( "", [], [] ) "" + , LineBreak + , Code + ( "" + , [] + , [] + ) "This\160is\160good\160for\160copying\160in\160code\160blocks:" + , LineBreak + , Code + ( "", [], [] ) "" + , LineBreak + , Code + ( "", [], [] ) "def\160function():" + , LineBreak + , Code + ( "" + , [] + , [] + ) "\160\160\160\160\"\"\"documentation\160string\"\"\"" + , LineBreak + , Code + ( "", [], [] ) "" + , LineBreak + , Code + ( "", [], [] ) "\160\160\160\160if\160True:" + , LineBreak + , Code + ( "", [], [] ) "\160\160\160\160\160\160\160\160print\160True" + , LineBreak + , Code + ( "", [], [] ) "\160\160\160\160else:" + , LineBreak + , Code + ( "", [], [] ) "\160\160\160\160\160\160\160\160print\160False" + ] + , Para + [ Str "Not" ] + , RawBlock + ( Format "html" ) "
" + , Para + [ Str "preformatted" ] + , Para + [ Str "Don't", Space, Str "need" ] + , Para + [ Code ( "", [], [] ) "a\160blank\160line" ] + , Para + [ Str "around" + , Space + , Str "a" + , Space + , Str "preformatted" + , Space + , Str "block." + ] + , Header 2 + ( "templates", [], [] ) + [ Str "templates" ] + , RawBlock + ( Format "mediawiki" ) "{{Welcome}}" + , RawBlock + ( Format "mediawiki" ) "{{Foo:Bar}}" + , RawBlock + ( Format "mediawiki" ) "{{Thankyou|all your effort|Me}}" + , Para + [ Str "Written" + , Space + , RawInline + ( Format "mediawiki" ) "{{{date}}}" + , Space + , Str "by" + , Space + , RawInline + ( Format "mediawiki" ) "{{{name}}}" + , Str "." + ] + , Header 2 + ( "tables", [], [] ) + [ Str "tables" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Apple" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Bread" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Pie" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Butter" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Ice", Space, Str "cream" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing + [ Plain [ Str "Food", Space, Str "complements" ] ] + ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Apple" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Bread" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Pie" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Butter" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Ice", Space, Str "cream" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing + [ Plain [ Str "Food", Space, Str "complements" ] ] + ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Apple" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para + [ Str "Bread" ] + , Para + [ Str "and", Space, Str "cheese" ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para + [ Str "Pie" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ [ Plain [ Str "apple" ] ], [ Plain [ Str "carrot" ] ] ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Apple" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "more" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Bread" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Pie" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "more" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Butter" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Ice", Space, Str "cream" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "and", Space, Str "more" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignLeft, ColWidth 0.25 ) + , + ( AlignRight, ColWidth 0.125 ) + , + ( AlignCenter, ColWidth 0.125 ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Center" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "15.00" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "centered" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "more" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "2.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "more" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Apple" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Bread" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "fruit" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "topping" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "apple" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "ice", Space, Str "cream" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Butter" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Ice", Space, Str "cream" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignDefault, ColWidthDefault ) ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Orange" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Paragraph" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "table." + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "fruit" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "topping" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "apple" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "ice", Space, Str "cream" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Header 2 + ( "notes", [], [] ) + [ Str "notes" ] + , Para + [ Str "My", Space, Str "note!", Note [ Plain [ Str "This." ] ] ] + , Para + [ Str "URL" + , Space + , Str "note." + , Note + [ Plain + [ Link + ( "", [], [] ) + [ Str "http://docs.python.org/library/functions.html#range" ] + ( "http://docs.python.org/library/functions.html#range", "" ) + ] + ] + ] + ] diff --git a/test/opml-reader.native b/test/opml-reader.native index 0819116ab..bbb54e068 100644 --- a/test/opml-reader.native +++ b/test/opml-reader.native @@ -1,66 +1,232 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "Dave",Space,Str "Winer"]]),("date",MetaInlines [Str "Thu,",Space,Str "14",Space,Str "Jul",Space,Str "2005",Space,Str "23:41:05",Space,Str "GMT"]),("title",MetaInlines [Str "States"])]}) -[Header 1 ("",[],[]) [Str "United",Space,Str "States"] -,Header 2 ("",[],[]) [Str "Far",Space,Str "West"] -,Header 3 ("",[],[]) [Str "Alaska"] -,Header 3 ("",[],[]) [Str "California"] -,Header 3 ("",[],[]) [Str "Hawaii"] -,Header 3 ("",[],[]) [Strong [Str "Nevada"]] -,Para [Str "I",Space,Str "lived",Space,Str "here",Space,Emph [Str "once"],Str "."] -,Para [Str "Loved",Space,Str "it."] -,Header 4 ("",[],[]) [Link ("",[],[]) [Str "Reno"] ("http://www.reno.gov","")] -,Header 4 ("",[],[]) [Str "Las",Space,Str "Vegas"] -,Header 4 ("",[],[]) [Str "Ely"] -,Header 4 ("",[],[]) [Str "Gerlach"] -,Header 3 ("",[],[]) [Str "Oregon"] -,Header 3 ("",[],[]) [Str "Washington"] -,Header 2 ("",[],[]) [Str "Great",Space,Str "Plains"] -,Header 3 ("",[],[]) [Str "Kansas"] -,Header 3 ("",[],[]) [Str "Nebraska"] -,Header 3 ("",[],[]) [Str "North",Space,Str "Dakota"] -,Header 3 ("",[],[]) [Str "Oklahoma"] -,Header 3 ("",[],[]) [Str "South",Space,Str "Dakota"] -,Header 2 ("",[],[]) [Str "Mid-Atlantic"] -,Header 3 ("",[],[]) [Str "Delaware"] -,Header 3 ("",[],[]) [Str "Maryland"] -,Header 3 ("",[],[]) [Str "New",Space,Str "Jersey"] -,Header 3 ("",[],[]) [Str "New",Space,Str "York"] -,Header 3 ("",[],[]) [Str "Pennsylvania"] -,Header 2 ("",[],[]) [Str "Midwest"] -,Header 3 ("",[],[]) [Str "Illinois"] -,Header 3 ("",[],[]) [Str "Indiana"] -,Header 3 ("",[],[]) [Str "Iowa"] -,Header 3 ("",[],[]) [Str "Kentucky"] -,Header 3 ("",[],[]) [Str "Michigan"] -,Header 3 ("",[],[]) [Str "Minnesota"] -,Header 3 ("",[],[]) [Str "Missouri"] -,Header 3 ("",[],[]) [Str "Ohio"] -,Header 3 ("",[],[]) [Str "West",Space,Str "Virginia"] -,Header 3 ("",[],[]) [Str "Wisconsin"] -,Header 2 ("",[],[]) [Str "Mountains"] -,Header 3 ("",[],[]) [Str "Colorado"] -,Header 3 ("",[],[]) [Str "Idaho"] -,Header 3 ("",[],[]) [Str "Montana"] -,Header 3 ("",[],[]) [Str "Utah"] -,Header 3 ("",[],[]) [Str "Wyoming"] -,Header 2 ("",[],[]) [Str "New",Space,Str "England"] -,Header 3 ("",[],[]) [Str "Connecticut"] -,Header 3 ("",[],[]) [Str "Maine"] -,Header 3 ("",[],[]) [Str "Massachusetts"] -,Header 3 ("",[],[]) [Str "New",Space,Str "Hampshire"] -,Header 3 ("",[],[]) [Str "Rhode",Space,Str "Island"] -,Header 3 ("",[],[]) [Str "Vermont"] -,Header 2 ("",[],[]) [Str "South"] -,Header 3 ("",[],[]) [Str "Alabama"] -,Header 3 ("",[],[]) [Str "Arkansas"] -,Header 3 ("",[],[]) [Str "Florida"] -,Header 3 ("",[],[]) [Str "Georgia"] -,Header 3 ("",[],[]) [Str "Louisiana"] -,Header 3 ("",[],[]) [Str "Mississippi"] -,Header 3 ("",[],[]) [Str "North",Space,Str "Carolina"] -,Header 3 ("",[],[]) [Str "South",Space,Str "Carolina"] -,Header 3 ("",[],[]) [Str "Tennessee"] -,Header 3 ("",[],[]) [Str "Virginia"] -,Header 2 ("",[],[]) [Str "Southwest"] -,Header 3 ("",[],[]) [Str "Arizona"] -,Header 3 ("",[],[]) [Str "New",Space,Str "Mexico"] -,Header 3 ("",[],[]) [Str "Texas"]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "author" + , MetaList + [ MetaInlines [ Str "Dave", Space, Str "Winer" ] ] + ) + , + ( "date" + , MetaInlines + [ Str "Thu," + , Space + , Str "14" + , Space + , Str "Jul" + , Space + , Str "2005" + , Space + , Str "23:41:05" + , Space + , Str "GMT" + ] + ) + , + ( "title", MetaInlines [ Str "States" ] ) + ] + } + ) + [ Header 1 + ( "", [], [] ) + [ Str "United", Space, Str "States" ] + , Header 2 + ( "", [], [] ) + [ Str "Far", Space, Str "West" ] + , Header 3 + ( "", [], [] ) + [ Str "Alaska" ] + , Header 3 + ( "", [], [] ) + [ Str "California" ] + , Header 3 + ( "", [], [] ) + [ Str "Hawaii" ] + , Header 3 + ( "", [], [] ) + [ Strong [ Str "Nevada" ] ] + , Para + [ Str "I" + , Space + , Str "lived" + , Space + , Str "here" + , Space + , Emph + [ Str "once" ] + , Str "." + ] + , Para + [ Str "Loved", Space, Str "it." ] + , Header 4 + ( "", [], [] ) + [ Link ( "", [], [] ) [ Str "Reno" ] ( "http://www.reno.gov", "" ) ] + , Header 4 + ( "", [], [] ) + [ Str "Las", Space, Str "Vegas" ] + , Header 4 + ( "", [], [] ) + [ Str "Ely" ] + , Header 4 + ( "", [], [] ) + [ Str "Gerlach" ] + , Header 3 + ( "", [], [] ) + [ Str "Oregon" ] + , Header 3 + ( "", [], [] ) + [ Str "Washington" ] + , Header 2 + ( "", [], [] ) + [ Str "Great", Space, Str "Plains" ] + , Header 3 + ( "", [], [] ) + [ Str "Kansas" ] + , Header 3 + ( "", [], [] ) + [ Str "Nebraska" ] + , Header 3 + ( "", [], [] ) + [ Str "North", Space, Str "Dakota" ] + , Header 3 + ( "", [], [] ) + [ Str "Oklahoma" ] + , Header 3 + ( "", [], [] ) + [ Str "South", Space, Str "Dakota" ] + , Header 2 + ( "", [], [] ) + [ Str "Mid-Atlantic" ] + , Header 3 + ( "", [], [] ) + [ Str "Delaware" ] + , Header 3 + ( "", [], [] ) + [ Str "Maryland" ] + , Header 3 + ( "", [], [] ) + [ Str "New", Space, Str "Jersey" ] + , Header 3 + ( "", [], [] ) + [ Str "New", Space, Str "York" ] + , Header 3 + ( "", [], [] ) + [ Str "Pennsylvania" ] + , Header 2 + ( "", [], [] ) + [ Str "Midwest" ] + , Header 3 + ( "", [], [] ) + [ Str "Illinois" ] + , Header 3 + ( "", [], [] ) + [ Str "Indiana" ] + , Header 3 + ( "", [], [] ) + [ Str "Iowa" ] + , Header 3 + ( "", [], [] ) + [ Str "Kentucky" ] + , Header 3 + ( "", [], [] ) + [ Str "Michigan" ] + , Header 3 + ( "", [], [] ) + [ Str "Minnesota" ] + , Header 3 + ( "", [], [] ) + [ Str "Missouri" ] + , Header 3 + ( "", [], [] ) + [ Str "Ohio" ] + , Header 3 + ( "", [], [] ) + [ Str "West", Space, Str "Virginia" ] + , Header 3 + ( "", [], [] ) + [ Str "Wisconsin" ] + , Header 2 + ( "", [], [] ) + [ Str "Mountains" ] + , Header 3 + ( "", [], [] ) + [ Str "Colorado" ] + , Header 3 + ( "", [], [] ) + [ Str "Idaho" ] + , Header 3 + ( "", [], [] ) + [ Str "Montana" ] + , Header 3 + ( "", [], [] ) + [ Str "Utah" ] + , Header 3 + ( "", [], [] ) + [ Str "Wyoming" ] + , Header 2 + ( "", [], [] ) + [ Str "New", Space, Str "England" ] + , Header 3 + ( "", [], [] ) + [ Str "Connecticut" ] + , Header 3 + ( "", [], [] ) + [ Str "Maine" ] + , Header 3 + ( "", [], [] ) + [ Str "Massachusetts" ] + , Header 3 + ( "", [], [] ) + [ Str "New", Space, Str "Hampshire" ] + , Header 3 + ( "", [], [] ) + [ Str "Rhode", Space, Str "Island" ] + , Header 3 + ( "", [], [] ) + [ Str "Vermont" ] + , Header 2 + ( "", [], [] ) + [ Str "South" ] + , Header 3 + ( "", [], [] ) + [ Str "Alabama" ] + , Header 3 + ( "", [], [] ) + [ Str "Arkansas" ] + , Header 3 + ( "", [], [] ) + [ Str "Florida" ] + , Header 3 + ( "", [], [] ) + [ Str "Georgia" ] + , Header 3 + ( "", [], [] ) + [ Str "Louisiana" ] + , Header 3 + ( "", [], [] ) + [ Str "Mississippi" ] + , Header 3 + ( "", [], [] ) + [ Str "North", Space, Str "Carolina" ] + , Header 3 + ( "", [], [] ) + [ Str "South", Space, Str "Carolina" ] + , Header 3 + ( "", [], [] ) + [ Str "Tennessee" ] + , Header 3 + ( "", [], [] ) + [ Str "Virginia" ] + , Header 2 + ( "", [], [] ) + [ Str "Southwest" ] + , Header 3 + ( "", [], [] ) + [ Str "Arizona" ] + , Header 3 + ( "", [], [] ) + [ Str "New", Space, Str "Mexico" ] + , Header 3 + ( "", [], [] ) + [ Str "Texas" ] + ] diff --git a/test/org-select-tags.native b/test/org-select-tags.native index 5fbfd92d1..a94c70abe 100644 --- a/test/org-select-tags.native +++ b/test/org-select-tags.native @@ -1,7 +1,99 @@ -Pandoc (Meta {unMeta = fromList []}) -[Header 1 ("will-appear-because-it-is-the-ancestor-of-something-tagged-yes",[],[]) [Str "Will",Space,Str "appear",Space,Str "because",Space,Str "it",Space,Str "is",Space,Str "the",Space,Str "ancestor",Space,Str "of",Space,Str "something",Space,Str "tagged",Space,Str "\"yes\""] -,Header 2 ("will-appear",[],[]) [Str "Will",Space,Str "appear",Space,Span ("",["tag"],[("tag-name","yes")]) [SmallCaps [Str "yes"]]] -,Header 3 ("will-appear-since-the-entire-subtree-of-something-selected-will-appear",[],[]) [Str "Will",Space,Str "appear",Space,Str "since",Space,Str "the",Space,Str "entire",Space,Str "subtree",Space,Str "of",Space,Str "something",Space,Str "selected",Space,Str "will",Space,Str "appear"] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Para [Str "Will",Space,Str "appear"]]] -,Header 2 ("will-appear-because-it-is-the-ancestor-of-something-listed-in-select-tags",[],[]) [Str "Will",Space,Str "appear",Space,Str "because",Space,Str "it",Space,Str "is",Space,Str "the",Space,Str "ancestor",Space,Str "of",Space,Str "something",Space,Str "listed",Space,Str "in",Space,Str "SELECT-TAGS"]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Header 1 + ( "will-appear-because-it-is-the-ancestor-of-something-tagged-yes" + , [] + , [] + ) + [ Str "Will" + , Space + , Str "appear" + , Space + , Str "because" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "ancestor" + , Space + , Str "of" + , Space + , Str "something" + , Space + , Str "tagged" + , Space + , Str "\"yes\"" + ] + , Header 2 + ( "will-appear", [], [] ) + [ Str "Will" + , Space + , Str "appear" + , Space + , Span + ( "", [ "tag" ], [ ( "tag-name", "yes" ) ] ) + [ SmallCaps [ Str "yes" ] ] + ] + , Header 3 + ( "will-appear-since-the-entire-subtree-of-something-selected-will-appear" + , [] + , [] + ) + [ Str "Will" + , Space + , Str "appear" + , Space + , Str "since" + , Space + , Str "the" + , Space + , Str "entire" + , Space + , Str "subtree" + , Space + , Str "of" + , Space + , Str "something" + , Space + , Str "selected" + , Space + , Str "will" + , Space + , Str "appear" + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ [ Para [ Str "Will", Space, Str "appear" ] ] ] + , Header 2 + ( "will-appear-because-it-is-the-ancestor-of-something-listed-in-select-tags" + , [] + , [] + ) + [ Str "Will" + , Space + , Str "appear" + , Space + , Str "because" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "ancestor" + , Space + , Str "of" + , Space + , Str "something" + , Space + , Str "listed" + , Space + , Str "in" + , Space + , Str "SELECT-TAGS" + ] + ] diff --git a/test/pipe-tables.native b/test/pipe-tables.native index 249eec17e..e678053d2 100644 --- a/test/pipe-tables.native +++ b/test/pipe-tables.native @@ -1,326 +1,850 @@ -[Para [Str "Simplest",Space,Str "table",Space,Str "without",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default3"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Simple",Space,Str "table",Space,Str "with",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - [Plain [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."]]) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Simple",Space,Str "table",Space,Str "without",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Headerless",Space,Str "table",Space,Str "without",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Table",Space,Str "without",Space,Str "sides:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignRight,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Fruit"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Quantity"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "apple"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "17"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "pear"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "302"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "One-column:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "hi"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "lo"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Header-less",Space,Str "one-column:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "hi"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Indented",Space,Str "left",Space,Str "column:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Number",Space,Str "of",Space,Str "siblings"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Salary"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "3"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "33"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "44"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Long",Space,Str "pipe",Space,Str "table",Space,Str "with",Space,Str "relative",Space,Str "widths:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.15517241379310345) - ,(AlignDefault,ColWidth 0.1724137931034483) - ,(AlignDefault,ColWidth 0.6724137931034483)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default3"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "this",Space,Str "is",Space,Str "a",Space,Str "table",Space,Str "cell"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "and",Space,Str "this",Space,Str "is",Space,Str "a",Space,Str "really",Space,Str "long",Space,Str "table",Space,Str "cell",Space,Str "that",Space,Str "will",Space,Str "probably",Space,Str "need",Space,Str "wrapping"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Pipe",Space,Str "table",Space,Str "with",Space,Str "no",Space,Str "body:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Header"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [])] - (TableFoot ("",[],[]) - []) -,Para [Str "Pipe",Space,Str "table",Space,Str "with",Space,Str "tricky",Space,Str "cell",Space,Str "contents",Space,Str "(see",Space,Str "#2765):"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignLeft,ColWidthDefault) - ,(AlignRight,ColWidthDefault) - ,(AlignRight,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "IP_gene8-_1st"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "IP_gene8+_1st"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "IP_gene8-_1st"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1.0000000"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "0.4357325"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "IP_gene8+_1st"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "0.4357325"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1.0000000"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "foo",Code ("",[],[]) "bar|baz"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "and|escaped"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "3.0000000"]]]])] - (TableFoot ("",[],[]) - [])] +[ Para + [ Str "Simplest" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default3" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Simple", Space, Str "table", Space, Str "with", Space, Str "caption:" ] +, Table + ( "", [], [] ) + ( Caption Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ] + ) + [ + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Center" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Center" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Headerless" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Table", Space, Str "without", Space, Str "sides:" ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignDefault, ColWidthDefault ), ( AlignRight, ColWidthDefault ) ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Fruit" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Quantity" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "apple" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "17" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "pear" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "302" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "One-column:" ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignDefault, ColWidthDefault ) ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "hi" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "lo" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Header-less", Space, Str "one-column:" ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignCenter, ColWidthDefault ) ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "hi" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Indented", Space, Str "left", Space, Str "column:" ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignRight, ColWidthDefault ), ( AlignLeft, ColWidthDefault ) ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Number", Space, Str "of", Space, Str "siblings" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Salary" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "3" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "33" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "44" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Long" + , Space + , Str "pipe" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "relative" + , Space + , Str "widths:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.15517241379310345 ) + , + ( AlignDefault, ColWidth 0.1724137931034483 ) + , + ( AlignDefault, ColWidth 0.6724137931034483 ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default3" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "table" + , Space + , Str "cell" + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "and" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "really" + , Space + , Str "long" + , Space + , Str "table" + , Space + , Str "cell" + , Space + , Str "that" + , Space + , Str "will" + , Space + , Str "probably" + , Space + , Str "need" + , Space + , Str "wrapping" + ] + ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Pipe" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "no" + , Space + , Str "body:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignDefault, ColWidthDefault ) ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Header" ] ] + ] + ] + ) + [ TableBody ( "", [], [] ) ( RowHeadColumns 0 ) [] [] ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Pipe" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "tricky" + , Space + , Str "cell" + , Space + , Str "contents" + , Space + , Str "(see" + , Space + , Str "#2765):" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignLeft, ColWidthDefault ) + , + ( AlignRight, ColWidthDefault ) + , + ( AlignRight, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "IP_gene8-_1st" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "IP_gene8+_1st" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "IP_gene8-_1st" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1.0000000" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "0.4357325" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "IP_gene8+_1st" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "0.4357325" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1.0000000" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "foo", Code ( "", [], [] ) "bar|baz" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "and|escaped" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "3.0000000" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +] diff --git a/test/rst-reader.native b/test/rst-reader.native index 9f8d5ab3e..7a5c3d812 100644 --- a/test/rst-reader.native +++ b/test/rst-reader.native @@ -1,443 +1,1874 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("revision",MetaBlocks [Para [Str "3"]]),("subtitle",MetaInlines [Str "Subtitle"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]}) -[Header 1 ("level-one-header",[],[]) [Str "Level",Space,Str "one",Space,Str "header"] -,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 "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",SoftBreak,Str "John",Space,Str "Gruber\8217s",Space,Str "markdown",Space,Str "test",Space,Str "suite."] -,Header 2 ("level-two-header",[],[]) [Str "Level",Space,Str "two",Space,Str "header"] -,Header 3 ("level-three",[],[]) [Str "Level",Space,Str "three"] -,Header 4 ("level-four-with-emphasis",[],[]) [Str "Level",Space,Str "four",Space,Str "with",Space,Emph [Str "emphasis"]] -,Header 5 ("level-five",[],[]) [Str "Level",Space,Str "five"] -,Header 1 ("paragraphs",[],[]) [Str "Paragraphs"] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "regular",Space,Str "paragraph."] -,Para [Str "In",Space,Str "Markdown",Space,Str "1.0.0",Space,Str "and",Space,Str "earlier.",Space,Str "Version",SoftBreak,Str "8.",Space,Str "This",Space,Str "line",Space,Str "turns",Space,Str "into",Space,Str "a",Space,Str "list",Space,Str "item.",SoftBreak,Str "Because",Space,Str "a",Space,Str "hard-wrapped",Space,Str "line",Space,Str "in",Space,Str "the",SoftBreak,Str "middle",Space,Str "of",Space,Str "a",Space,Str "paragraph",Space,Str "looked",Space,Str "like",Space,Str "a",SoftBreak,Str "list",Space,Str "item."] -,Para [Str "Here\8217s",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet.",SoftBreak,Str "*",Space,Str "criminey."] -,Para [Str "Horizontal",Space,Str "rule:"] -,HorizontalRule -,Para [Str "Another:"] -,HorizontalRule -,Header 1 ("block-quotes",[],[]) [Str "Block",Space,Str "Quotes"] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "block",Space,Str "quote:"] -,BlockQuote - [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote.",SoftBreak,Str "It",Space,Str "is",Space,Str "pretty",Space,Str "short."]] -,Para [Str "Here\8217s",Space,Str "another,",Space,Str "differently",Space,Str "indented:"] -,BlockQuote - [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote.",SoftBreak,Str "It\8217s",Space,Str "indented",Space,Str "with",Space,Str "a",Space,Str "tab."] - ,Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"] - ,CodeBlock ("",[],[]) "sub status {\n print \"working\";\n}" - ,Para [Str "List",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"] - ,OrderedList (1,Decimal,Period) - [[Plain [Str "item",Space,Str "one"]] - ,[Plain [Str "item",Space,Str "two"]]] - ,Para [Str "Nested",Space,Str "block",Space,Str "quotes:"] - ,BlockQuote - [Para [Str "nested"] - ,BlockQuote - [Para [Str "nested"]]]] -,Header 1 ("code-blocks",[],[]) [Str "Code",Space,Str "Blocks"] -,Para [Str "Code:"] -,CodeBlock ("",[],[]) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}" -,CodeBlock ("",[],[]) "this code block is indented by one tab" -,Para [Str "And:"] -,CodeBlock ("",[],[]) "this block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" -,Para [Str "And:"] -,CodeBlock ("",["python"],[]) "def my_function(x):\n return x + 1" -,Para [Str "If",Space,Str "we",Space,Str "use",Space,Str "the",Space,Str "highlight",Space,Str "directive,",Space,Str "we",Space,Str "can",Space,Str "specify",Space,Str "a",Space,Str "default",Space,Str "language",SoftBreak,Str "for",Space,Str "literate",Space,Str "blocks."] -,CodeBlock ("",["haskell"],[]) "-- this code is in haskell\ndata Tree = Leaf | Node Tree Tree" -,CodeBlock ("",["haskell"],[]) "-- this code is in haskell too\ndata Nat = Zero | Succ Nat" -,CodeBlock ("",["javascript"],[]) "-- this code is in javascript\nlet f = (x, y) => x + y" -,Header 1 ("lists",[],[]) [Str "Lists"] -,Header 2 ("unordered",[],[]) [Str "Unordered"] -,Para [Str "Asterisks",Space,Str "tight:"] -,BulletList - [[Plain [Str "asterisk",Space,Str "1"]] - ,[Plain [Str "asterisk",Space,Str "2"]] - ,[Plain [Str "asterisk",Space,Str "3"]]] -,Para [Str "Asterisks",Space,Str "loose:"] -,BulletList - [[Plain [Str "asterisk",Space,Str "1"]] - ,[Plain [Str "asterisk",Space,Str "2"]] - ,[Plain [Str "asterisk",Space,Str "3"]]] -,Para [Str "Pluses",Space,Str "tight:"] -,BulletList - [[Plain [Str "Plus",Space,Str "1"]] - ,[Plain [Str "Plus",Space,Str "2"]] - ,[Plain [Str "Plus",Space,Str "3"]]] -,Para [Str "Pluses",Space,Str "loose:"] -,BulletList - [[Plain [Str "Plus",Space,Str "1"]] - ,[Plain [Str "Plus",Space,Str "2"]] - ,[Plain [Str "Plus",Space,Str "3"]]] -,Para [Str "Minuses",Space,Str "tight:"] -,BulletList - [[Plain [Str "Minus",Space,Str "1"]] - ,[Plain [Str "Minus",Space,Str "2"]] - ,[Plain [Str "Minus",Space,Str "3"]]] -,Para [Str "Minuses",Space,Str "loose:"] -,BulletList - [[Plain [Str "Minus",Space,Str "1"]] - ,[Plain [Str "Minus",Space,Str "2"]] - ,[Plain [Str "Minus",Space,Str "3"]]] -,Header 2 ("ordered",[],[]) [Str "Ordered"] -,Para [Str "Tight:"] -,OrderedList (1,Decimal,Period) - [[Plain [Str "First"]] - ,[Plain [Str "Second"]] - ,[Plain [Str "Third"]]] -,Para [Str "and:"] -,OrderedList (1,Decimal,Period) - [[Plain [Str "One"]] - ,[Plain [Str "Two"]] - ,[Plain [Str "Three"]]] -,Para [Str "Loose",Space,Str "using",Space,Str "tabs:"] -,OrderedList (1,Decimal,Period) - [[Plain [Str "First"]] - ,[Plain [Str "Second"]] - ,[Plain [Str "Third"]]] -,Para [Str "and",Space,Str "using",Space,Str "spaces:"] -,OrderedList (1,Decimal,Period) - [[Plain [Str "One"]] - ,[Plain [Str "Two"]] - ,[Plain [Str "Three"]]] -,Para [Str "Multiple",Space,Str "paragraphs:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "Item",Space,Str "1,",Space,Str "graf",Space,Str "one."] - ,Para [Str "Item",Space,Str "1.",Space,Str "graf",Space,Str "two.",Space,Str "The",Space,Str "quick",Space,Str "brown",Space,Str "fox",Space,Str "jumped",Space,Str "over",Space,Str "the",Space,Str "lazy",Space,Str "dog\8217s",SoftBreak,Str "back."]] - ,[Para [Str "Item",Space,Str "2."]] - ,[Para [Str "Item",Space,Str "3."]]] -,Para [Str "Nested:"] -,BulletList - [[Plain [Str "Tab"] - ,BulletList - [[Plain [Str "Tab"] - ,BulletList - [[Plain [Str "Tab"]]]]]]] -,Para [Str "Here\8217s",Space,Str "another:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "First"]] - ,[Para [Str "Second:"] - ,BlockQuote - [BulletList - [[Plain [Str "Fee"]] - ,[Plain [Str "Fie"]] - ,[Plain [Str "Foe"]]]]] - ,[Para [Str "Third"]]] -,Header 2 ("fancy-list-markers",[],[]) [Str "Fancy",Space,Str "list",Space,Str "markers"] -,OrderedList (2,Decimal,TwoParens) - [[Para [Str "begins",Space,Str "with",Space,Str "2"]] - ,[Para [Str "and",Space,Str "now",Space,Str "3"] - ,Para [Str "with",Space,Str "a",Space,Str "continuation"] - ,OrderedList (4,LowerRoman,Period) - [[Plain [Str "sublist",Space,Str "with",Space,Str "roman",Space,Str "numerals,",Space,Str "starting",Space,Str "with",Space,Str "4"]] - ,[Plain [Str "more",Space,Str "items"] - ,OrderedList (1,UpperAlpha,TwoParens) - [[Plain [Str "a",Space,Str "subsublist"]] - ,[Plain [Str "a",Space,Str "subsublist"]]]]]]] -,Para [Str "Nesting:"] -,OrderedList (1,UpperAlpha,Period) - [[Plain [Str "Upper",Space,Str "Alpha"] - ,OrderedList (1,UpperRoman,Period) - [[Plain [Str "Upper",Space,Str "Roman."] - ,OrderedList (6,Decimal,TwoParens) - [[Plain [Str "Decimal",Space,Str "start",Space,Str "with",Space,Str "6"] - ,OrderedList (3,LowerAlpha,OneParen) - [[Plain [Str "Lower",Space,Str "alpha",Space,Str "with",Space,Str "paren"]]]]]]]]] -,Para [Str "Autonumbering:"] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Autonumber."]] - ,[Plain [Str "More."] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Nested."]]]]] -,Para [Str "Autonumbering",Space,Str "with",Space,Str "explicit",Space,Str "start:"] -,OrderedList (4,LowerAlpha,TwoParens) - [[Plain [Str "item",Space,Str "1"]] - ,[Plain [Str "item",Space,Str "2"]]] -,Header 2 ("definition",[],[]) [Str "Definition"] -,DefinitionList - [([Str "term",Space,Str "1"], - [[Para [Str "Definition",Space,Str "1."]]]) - ,([Str "term",Space,Str "2"], - [[Para [Str "Definition",Space,Str "2,",Space,Str "paragraph",Space,Str "1."] - ,Para [Str "Definition",Space,Str "2,",Space,Str "paragraph",Space,Str "2."]]]) - ,([Str "term",Space,Str "with",Space,Emph [Str "emphasis"]], - [[Para [Str "Definition",Space,Str "3."]]])] -,Header 1 ("field-lists",[],[]) [Str "Field",Space,Str "Lists"] -,BlockQuote - [DefinitionList - [([Str "address"], - [[Para [Str "61",Space,Str "Main",Space,Str "St."]]]) - ,([Str "city"], - [[Para [Emph [Str "Nowhere"],Str ",",Space,Str "MA,",SoftBreak,Str "USA"]]]) - ,([Str "phone"], - [[Para [Str "123-4567"]]])]] -,DefinitionList - [([Str "address"], - [[Para [Str "61",Space,Str "Main",Space,Str "St."]]]) - ,([Str "city"], - [[Para [Emph [Str "Nowhere"],Str ",",Space,Str "MA,",SoftBreak,Str "USA"]]]) - ,([Str "phone"], - [[Para [Str "123-4567"]]])] -,Header 1 ("html-blocks",[],[]) [Str "HTML",Space,Str "Blocks"] -,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"] -,RawBlock (Format "html") "
foo
" -,Para [Str "Now,",Space,Str "nested:"] -,RawBlock (Format "html") "
\n
\n
\n foo\n
\n
\n
" -,Header 1 ("latex-block",[],[]) [Str "LaTeX",Space,Str "Block"] -,RawBlock (Format "latex") "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" -,Header 1 ("inline-markup",[],[]) [Str "Inline",Space,Str "Markup"] -,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ".",Space,Str "This",Space,Str "is",Space,Strong [Str "strong"],Str "."] -,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "",Str "."] -,Para [Str "This",Space,Str "is",Subscript [Str "subscripted"],Space,Str "and",Space,Str "this",Space,Str "is",Space,Superscript [Str "superscripted"],Str "."] -,Header 1 ("special-characters",[],[]) [Str "Special",Space,Str "Characters"] -,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode:"] -,BulletList - [[Plain [Str "I",Space,Str "hat:",Space,Str "\206"]] - ,[Plain [Str "o",Space,Str "umlaut:",Space,Str "\246"]] - ,[Plain [Str "section:",Space,Str "\167"]] - ,[Plain [Str "set",Space,Str "membership:",Space,Str "\8712"]] - ,[Plain [Str "copyright:",Space,Str "\169"]]] -,Para [Str "AT&T",Space,Str "has",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "their",Space,Str "name."] -,Para [Str "This",Space,Str "&",Space,Str "that."] -,Para [Str "4",Space,Str "<",Space,Str "5."] -,Para [Str "6",Space,Str ">",Space,Str "5."] -,Para [Str "Backslash:",Space,Str "\\"] -,Para [Str "Backtick:",Space,Str "`"] -,Para [Str "Asterisk:",Space,Str "*"] -,Para [Str "Underscore:",Space,Str "_"] -,Para [Str "Left",Space,Str "brace:",Space,Str "{"] -,Para [Str "Right",Space,Str "brace:",Space,Str "}"] -,Para [Str "Left",Space,Str "bracket:",Space,Str "["] -,Para [Str "Right",Space,Str "bracket:",Space,Str "]"] -,Para [Str "Left",Space,Str "paren:",Space,Str "("] -,Para [Str "Right",Space,Str "paren:",Space,Str ")"] -,Para [Str "Greater-than:",Space,Str ">"] -,Para [Str "Hash:",Space,Str "#"] -,Para [Str "Period:",Space,Str "."] -,Para [Str "Bang:",Space,Str "!"] -,Para [Str "Plus:",Space,Str "+"] -,Para [Str "Minus:",Space,Str "-"] -,Header 1 ("links",[],[]) [Str "Links"] -,Para [Str "Explicit:",Space,Str "a",Space,Link ("",[],[]) [Str "URL"] ("/url/",""),Str "."] -,Para [Str "Explicit",Space,Str "with",Space,Str "no",Space,Str "label:",Space,Link ("",[],[]) [Str "foo"] ("foo",""),Str "."] -,Para [Str "Two",Space,Str "anonymous",Space,Str "links:",Space,Link ("",[],[]) [Str "the",Space,Str "first"] ("/url1/",""),Space,Str "and",Space,Link ("",[],[]) [Str "the",Space,Str "second"] ("/url2/","")] -,Para [Str "Reference",Space,Str "links:",Space,Link ("",[],[]) [Str "link1"] ("/url1/",""),Space,Str "and",Space,Link ("",[],[]) [Str "link2"] ("/url2/",""),Space,Str "and",Space,Link ("",[],[]) [Str "link1"] ("/url1/",""),Space,Str "again."] -,Para [Str "Another",Space,Link ("",[],[]) [Str "style",Space,Str "of",Space,Str "reference",Space,Str "link"] ("/url1/",""),Str "."] -,Para [Str "Here\8217s",Space,Str "a",Space,Link ("",[],[]) [Str "link",Space,Str "with",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "the",Space,Str "URL"] ("http://example.com/?foo=1&bar=2",""),Str "."] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "link",Space,Str "with",Space,Str "an",Space,Str "amersand",Space,Str "in",Space,Str "the",Space,Str "link",Space,Str "text:",Space,Link ("",[],[]) [Str "AT&T"] ("/url/",""),Str "."] -,Para [Str "Autolinks:",Space,Link ("",[],[]) [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2",""),Space,Str "and",Space,Link ("",[],[]) [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net",""),Str "."] -,Para [Str "But",Space,Str "not",Space,Str "here:"] -,CodeBlock ("",[],[]) "http://example.com/" -,Header 1 ("images",[],[]) [Str "Images"] -,Para [Str "From",Space,Quoted DoubleQuote [Str "Voyage",Space,Str "dans",Space,Str "la",Space,Str "Lune"],Space,Str "by",Space,Str "Georges",Space,Str "Melies",Space,Str "(1902):"] -,Para [Image ("",[],[]) [Str "image"] ("lalune.jpg","")] -,Para [Image ("",[],[("height","2343px")]) [Str "Voyage dans la Lune"] ("lalune.jpg","")] -,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image ("",[],[]) [Str "movie"] ("movie.jpg",""),Space,Str "icon."] -,Para [Str "And",Space,Str "an",Space,Link ("",[],[]) [Image ("",[],[]) [Str "A movie"] ("movie.jpg","")] ("/url",""),Str "."] -,Header 1 ("comments",[],[]) [Str "Comments"] -,Para [Str "First",Space,Str "paragraph"] -,Para [Str "Another",Space,Str "paragraph"] -,Para [Str "A",Space,Str "third",Space,Str "paragraph"] -,Header 1 ("line-blocks",[],[]) [Str "Line",Space,Str "blocks"] -,LineBlock - [[Str "But",Space,Str "can",Space,Str "a",Space,Str "bee",Space,Str "be",Space,Str "said",Space,Str "to",Space,Str "be"] - ,[Str "\160\160\160\160or",Space,Str "not",Space,Str "to",Space,Str "be",Space,Str "an",Space,Str "entire",Space,Str "bee,"] - ,[Str "\160\160\160\160\160\160\160\160when",Space,Str "half",Space,Str "the",Space,Str "bee",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "bee,"] - ,[Str "\160\160\160\160\160\160\160\160\160\160\160\160due",Space,Str "to",Space,Str "some",Space,Str "ancient",Space,Str "injury?"] - ,[] - ,[Str "Continuation",Space,Str "line"] - ,[Str "\160\160and",Space,Str "another"]] -,Header 1 ("simple-tables",[],[]) [Str "Simple",Space,Str "Tables"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "3"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r1",Space,Str "a"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r2",Space,Str "d"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Headless"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r1",Space,Str "a"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r2",Space,Str "d"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Header 1 ("grid-tables",[],[]) [Str "Grid",Space,Str "Tables"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.2375) - ,(AlignDefault,ColWidth 0.15) - ,(AlignDefault,ColWidth 0.1625)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "col",Space,Str "3"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r1",Space,Str "a",SoftBreak,Str "r1",Space,Str "bis"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b",SoftBreak,Str "b",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c",SoftBreak,Str "c",Space,Str "2"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r2",Space,Str "d"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Headless"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.2375) - ,(AlignDefault,ColWidth 0.15) - ,(AlignDefault,ColWidth 0.1625)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r1",Space,Str "a",SoftBreak,Str "r1",Space,Str "bis"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b",SoftBreak,Str "b",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c",SoftBreak,Str "c",Space,Str "2"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r2",Space,Str "d"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Spaces",Space,Str "at",Space,Str "ends",Space,Str "of",Space,Str "lines"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.2375) - ,(AlignDefault,ColWidth 0.15) - ,(AlignDefault,ColWidth 0.1625)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r1",Space,Str "a",SoftBreak,Str "r1",Space,Str "bis"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b",SoftBreak,Str "b",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c",SoftBreak,Str "c",Space,Str "2"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "r2",Space,Str "d"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Multiple",Space,Str "blocks",Space,Str "in",Space,Str "a",Space,Str "cell"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.2375) - ,(AlignDefault,ColWidth 0.15) - ,(AlignDefault,ColWidth 0.1625)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "r1",Space,Str "a"] - ,Para [Str "r1",Space,Str "bis"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [BulletList - [[Plain [Str "b"]] - ,[Plain [Str "b",Space,Str "2"]] - ,[Plain [Str "b",Space,Str "2"]]]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c",SoftBreak,Str "c",Space,Str "2",SoftBreak,Str "c",Space,Str "2"]]]])] - (TableFoot ("",[],[]) - []) -,Header 1 ("footnotes",[],[]) [Str "Footnotes"] -,Para [Note [Para [Str "Note",Space,Str "with",Space,Str "one",Space,Str "line."]]] -,Para [Note [Para [Str "Note",Space,Str "with",SoftBreak,Str "continuation",Space,Str "line."]]] -,Para [Note [Para [Str "Note",Space,Str "with"],Para [Str "continuation",Space,Str "block."]]] -,Para [Note [Para [Str "Note",Space,Str "with",SoftBreak,Str "continuation",Space,Str "line"],Para [Str "and",Space,Str "a",Space,Str "second",Space,Str "para."]]] -,Para [Str "Not",Space,Str "in",Space,Str "note."] -,Header 1 ("math",[],[]) [Str "Math"] -,Para [Str "Some",Space,Str "inline",Space,Str "math",Space,Math InlineMath "E=mc^2",Str ".",Space,Str "Now",Space,Str "some",SoftBreak,Str "display",Space,Str "math:"] -,Para [Math DisplayMath "E=mc^2"] -,Para [Math DisplayMath "E = mc^2"] -,Para [Math DisplayMath "E = mc^2",Math DisplayMath "\\alpha = \\beta"] -,Para [Math DisplayMath "\\begin{aligned}\nE &= mc^2\\\\\nF &= \\pi E\n\\end{aligned}",Math DisplayMath "F &= \\gamma \\alpha^2"] -,Para [Str "All",Space,Str "done."] -,Header 1 ("default-role",[],[]) [Str "Default-Role"] -,Para [Str "Try",Space,Str "changing",Space,Str "the",Space,Str "default",Space,Str "role",Space,Str "to",Space,Str "a",Space,Str "few",Space,Str "different",Space,Str "things."] -,Header 2 ("doesnt-break-title-parsing",[],[]) [Str "Doesn\8217t",Space,Str "Break",Space,Str "Title",Space,Str "Parsing"] -,Para [Str "Inline",Space,Str "math:",Space,Math InlineMath "E=mc^2",Space,Str "or",Space,Math InlineMath "E=mc^2",Space,Str "or",Space,Math InlineMath "E=mc^2",Str ".",SoftBreak,Str "Other",Space,Str "roles:",Space,Superscript [Str "super"],Str ",",Space,Subscript [Str "sub"],Str "."] -,Para [Math DisplayMath "\\alpha = beta",Math DisplayMath "E = mc^2"] -,Para [Str "Some",Space,Superscript [Str "of"],Space,Str "these",Space,Superscript [Str "words"],Space,Str "are",Space,Str "in",Space,Superscript [Str "superscript"],Str "."] -,Para [Str "Reset",Space,Str "default-role",Space,Str "to",Space,Str "the",Space,Str "default",Space,Str "default."] -,Para [Str "And",Space,Str "now",Space,Span ("",["title-ref"],[]) [Str "some-invalid-string-3231231"],Space,Str "is",Space,Str "nonsense."] -,Para [Str "And",Space,Str "now",Space,Str "with",Space,RawInline (Format "html") "inline HTML",Str "."] -,Para [Str "And",Space,Str "some",Space,Str "inline",Space,Str "haskell",Space,Code ("",["haskell"],[]) "fmap id [1,2..10]",Str "."] -,Para [Str "Indirect",Space,Str "python",Space,Str "role",Space,Code ("",["py","python","indirect"],[]) "[x*x for x in [1,2,3,4,5]]",Str "."] -,Para [Str "Different",Space,Str "indirect",Space,Str "C",Space,Code ("",["c","different-indirect"],[]) "int x = 15;",Str "."] -,Header 2 ("literal-symbols",[],[]) [Str "Literal",Space,Str "symbols"] -,Para [Str "2*2",Space,Str "=",Space,Str "4*1"]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "author" + , MetaList + [ MetaInlines + [ Str "John", Space, Str "MacFarlane" ] + , MetaInlines + [ Str "Anonymous" ] + ] + ) + , + ( "date" + , MetaInlines + [ Str "July", Space, Str "17,", Space, Str "2006" ] + ) + , + ( "revision", MetaBlocks [ Para [ Str "3" ] ] ) + , + ( "subtitle", MetaInlines [ Str "Subtitle" ] ) + , + ( "title" + , MetaInlines + [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] + ) + ] + } + ) + [ Header 1 + ( "level-one-header", [], [] ) + [ Str "Level", Space, Str "one", Space, Str "header" ] + , 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 "Most" + , Space + , Str "of" + , Space + , Str "them" + , Space + , Str "are" + , Space + , Str "adapted" + , Space + , Str "from" + , SoftBreak + , Str "John" + , Space + , Str "Gruber\8217s" + , Space + , Str "markdown" + , Space + , Str "test" + , Space + , Str "suite." + ] + , Header 2 + ( "level-two-header", [], [] ) + [ Str "Level", Space, Str "two", Space, Str "header" ] + , Header 3 + ( "level-three", [], [] ) + [ Str "Level", Space, Str "three" ] + , Header 4 + ( "level-four-with-emphasis", [], [] ) + [ Str "Level" + , Space + , Str "four" + , Space + , Str "with" + , Space + , Emph + [ Str "emphasis" ] + ] + , Header 5 + ( "level-five", [], [] ) + [ Str "Level", Space, Str "five" ] + , Header 1 + ( "paragraphs", [], [] ) + [ Str "Paragraphs" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , SoftBreak + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + , SoftBreak + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" + , Space + , Str "in" + , Space + , Str "the" + , SoftBreak + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , SoftBreak + , Str "list" + , Space + , Str "item." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , SoftBreak + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "Horizontal", Space, Str "rule:" ] + , HorizontalRule + , Para + [ Str "Another:" ] + , HorizontalRule + , Header 1 + ( "block-quotes", [], [] ) + [ Str "Block", Space, Str "Quotes" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , SoftBreak + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] + ] + , Para + [ Str "Here\8217s" + , Space + , Str "another," + , Space + , Str "differently" + , Space + , Str "indented:" + ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , SoftBreak + , Str "It\8217s" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "tab." + ] + , Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , CodeBlock + ( "", [], [] ) "sub status {\n print \"working\";\n}" + , Para + [ Str "List" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "item", Space, Str "one" ] ] + , + [ Plain [ Str "item", Space, Str "two" ] ] + ] + , Para + [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] + , BlockQuote + [ Para [ Str "nested" ], BlockQuote [ Para [ Str "nested" ] ] ] + ] + , Header 1 + ( "code-blocks", [], [] ) + [ Str "Code", Space, Str "Blocks" ] + , Para + [ Str "Code:" ] + , CodeBlock + ( "" + , [] + , [] + ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}" + , CodeBlock + ( "", [], [] ) "this code block is indented by one tab" + , Para + [ Str "And:" ] + , CodeBlock + ( "" + , [] + , [] + ) "this block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + , Para + [ Str "And:" ] + , CodeBlock + ( "", [ "python" ], [] ) "def my_function(x):\n return x + 1" + , Para + [ Str "If" + , Space + , Str "we" + , Space + , Str "use" + , Space + , Str "the" + , Space + , Str "highlight" + , Space + , Str "directive," + , Space + , Str "we" + , Space + , Str "can" + , Space + , Str "specify" + , Space + , Str "a" + , Space + , Str "default" + , Space + , Str "language" + , SoftBreak + , Str "for" + , Space + , Str "literate" + , Space + , Str "blocks." + ] + , CodeBlock + ( "" + , [ "haskell" ] + , [] + ) "-- this code is in haskell\ndata Tree = Leaf | Node Tree Tree" + , CodeBlock + ( "" + , [ "haskell" ] + , [] + ) "-- this code is in haskell too\ndata Nat = Zero | Succ Nat" + , CodeBlock + ( "" + , [ "javascript" ] + , [] + ) "-- this code is in javascript\nlet f = (x, y) => x + y" + , Header 1 + ( "lists", [], [] ) + [ Str "Lists" ] + , Header 2 + ( "unordered", [], [] ) + [ Str "Unordered" ] + , Para + [ Str "Asterisks", Space, Str "tight:" ] + , BulletList + [ + [ Plain [ Str "asterisk", Space, Str "1" ] ] + , + [ Plain [ Str "asterisk", Space, Str "2" ] ] + , + [ Plain [ Str "asterisk", Space, Str "3" ] ] + ] + , Para + [ Str "Asterisks", Space, Str "loose:" ] + , BulletList + [ + [ Plain [ Str "asterisk", Space, Str "1" ] ] + , + [ Plain [ Str "asterisk", Space, Str "2" ] ] + , + [ Plain [ Str "asterisk", Space, Str "3" ] ] + ] + , Para + [ Str "Pluses", Space, Str "tight:" ] + , BulletList + [ + [ Plain [ Str "Plus", Space, Str "1" ] ] + , + [ Plain [ Str "Plus", Space, Str "2" ] ] + , + [ Plain [ Str "Plus", Space, Str "3" ] ] + ] + , Para + [ Str "Pluses", Space, Str "loose:" ] + , BulletList + [ + [ Plain [ Str "Plus", Space, Str "1" ] ] + , + [ Plain [ Str "Plus", Space, Str "2" ] ] + , + [ Plain [ Str "Plus", Space, Str "3" ] ] + ] + , Para + [ Str "Minuses", Space, Str "tight:" ] + , BulletList + [ + [ Plain [ Str "Minus", Space, Str "1" ] ] + , + [ Plain [ Str "Minus", Space, Str "2" ] ] + , + [ Plain [ Str "Minus", Space, Str "3" ] ] + ] + , Para + [ Str "Minuses", Space, Str "loose:" ] + , BulletList + [ + [ Plain [ Str "Minus", Space, Str "1" ] ] + , + [ Plain [ Str "Minus", Space, Str "2" ] ] + , + [ Plain [ Str "Minus", Space, Str "3" ] ] + ] + , Header 2 + ( "ordered", [], [] ) + [ Str "Ordered" ] + , Para + [ Str "Tight:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "First" ] ] + , + [ Plain [ Str "Second" ] ] + , + [ Plain [ Str "Third" ] ] + ] + , Para + [ Str "and:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "One" ] ] + , + [ Plain [ Str "Two" ] ] + , + [ Plain [ Str "Three" ] ] + ] + , Para + [ Str "Loose", Space, Str "using", Space, Str "tabs:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "First" ] ] + , + [ Plain [ Str "Second" ] ] + , + [ Plain [ Str "Third" ] ] + ] + , Para + [ Str "and", Space, Str "using", Space, Str "spaces:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "One" ] ] + , + [ Plain [ Str "Two" ] ] + , + [ Plain [ Str "Three" ] ] + ] + , Para + [ Str "Multiple", Space, Str "paragraphs:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para + [ Str "Item", Space, Str "1,", Space, Str "graf", Space, Str "one." ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , SoftBreak + , Str "back." + ] + ] + , + [ Para [ Str "Item", Space, Str "2." ] ] + , + [ Para [ Str "Item", Space, Str "3." ] ] + ] + , Para + [ Str "Nested:" ] + , BulletList + [ + [ Plain + [ Str "Tab" ] + , BulletList + [ [ Plain [ Str "Tab" ], BulletList [ [ Plain [ Str "Tab" ] ] ] ] ] + ] + ] + , Para + [ Str "Here\8217s", Space, Str "another:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para + [ Str "Second:" ] + , BlockQuote + [ BulletList + [ + [ Plain [ Str "Fee" ] ] + , + [ Plain [ Str "Fie" ] ] + , + [ Plain [ Str "Foe" ] ] + ] + ] + ] + , + [ Para [ Str "Third" ] ] + ] + , Header 2 + ( "fancy-list-markers", [], [] ) + [ Str "Fancy", Space, Str "list", Space, Str "markers" ] + , OrderedList + ( 2, Decimal, TwoParens ) + [ + [ Para [ Str "begins", Space, Str "with", Space, Str "2" ] ] + , + [ Para + [ Str "and", Space, Str "now", Space, Str "3" ] + , Para + [ Str "with", Space, Str "a", Space, Str "continuation" ] + , OrderedList + ( 4, LowerRoman, Period ) + [ + [ Plain + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , Space + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" + ] + ] + , + [ Plain + [ Str "more", Space, Str "items" ] + , OrderedList + ( 1, UpperAlpha, TwoParens ) + [ + [ Plain [ Str "a", Space, Str "subsublist" ] ] + , + [ Plain [ Str "a", Space, Str "subsublist" ] ] + ] + ] + ] + ] + ] + , Para + [ Str "Nesting:" ] + , OrderedList + ( 1, UpperAlpha, Period ) + [ + [ Plain + [ Str "Upper", Space, Str "Alpha" ] + , OrderedList + ( 1, UpperRoman, Period ) + [ + [ Plain + [ Str "Upper", Space, Str "Roman." ] + , OrderedList + ( 6, Decimal, TwoParens ) + [ + [ Plain + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3, LowerAlpha, OneParen ) + [ + [ Plain + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] + ] + ] + ] + ] + ] + ] + , Para + [ Str "Autonumbering:" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "Autonumber." ] ] + , + [ Plain + [ Str "More." ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ [ Plain [ Str "Nested." ] ] ] + ] + ] + , Para + [ Str "Autonumbering" + , Space + , Str "with" + , Space + , Str "explicit" + , Space + , Str "start:" + ] + , OrderedList + ( 4, LowerAlpha, TwoParens ) + [ + [ Plain [ Str "item", Space, Str "1" ] ] + , + [ Plain [ Str "item", Space, Str "2" ] ] + ] + , Header 2 + ( "definition", [], [] ) + [ Str "Definition" ] + , DefinitionList + [ + ( + [ Str "term", Space, Str "1" ] + , + [ [ Para [ Str "Definition", Space, Str "1." ] ] ] + ) + , + ( + [ Str "term", Space, Str "2" ] + , + [ + [ Para + [ Str "Definition" + , Space + , Str "2," + , Space + , Str "paragraph" + , Space + , Str "1." + ] + , Para + [ Str "Definition" + , Space + , Str "2," + , Space + , Str "paragraph" + , Space + , Str "2." + ] + ] + ] + ) + , + ( + [ Str "term", Space, Str "with", Space, Emph [ Str "emphasis" ] ] + , + [ [ Para [ Str "Definition", Space, Str "3." ] ] ] + ) + ] + , Header 1 + ( "field-lists", [], [] ) + [ Str "Field", Space, Str "Lists" ] + , BlockQuote + [ DefinitionList + [ + ( + [ Str "address" ] + , + [ [ Para [ Str "61", Space, Str "Main", Space, Str "St." ] ] ] + ) + , + ( + [ Str "city" ] + , + [ + [ Para + [ Emph + [ Str "Nowhere" ] + , Str "," + , Space + , Str "MA," + , SoftBreak + , Str "USA" + ] + ] + ] + ) + , + ( [ Str "phone" ], [ [ Para [ Str "123-4567" ] ] ] ) + ] + ] + , DefinitionList + [ + ( + [ Str "address" ] + , + [ [ Para [ Str "61", Space, Str "Main", Space, Str "St." ] ] ] + ) + , + ( + [ Str "city" ] + , + [ + [ Para + [ Emph + [ Str "Nowhere" ] + , Str "," + , Space + , Str "MA," + , SoftBreak + , Str "USA" + ] + ] + ] + ) + , + ( [ Str "phone" ], [ [ Para [ Str "123-4567" ] ] ] ) + ] + , Header 1 + ( "html-blocks", [], [] ) + [ Str "HTML", Space, Str "Blocks" ] + , Para + [ Str "Simple" + , Space + , Str "block" + , Space + , Str "on" + , Space + , Str "one" + , Space + , Str "line:" + ] + , RawBlock + ( Format "html" ) "
foo
" + , Para + [ Str "Now,", Space, Str "nested:" ] + , RawBlock + ( Format "html" ) "
\n
\n
\n foo\n
\n
\n
" + , Header 1 + ( "latex-block", [], [] ) + [ Str "LaTeX", Space, Str "Block" ] + , RawBlock + ( Format "latex" ) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" + , Header 1 + ( "inline-markup", [], [] ) + [ Str "Inline", Space, Str "Markup" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "emphasized" ] + , Str "." + , Space + , Str "This" + , Space + , Str "is" + , Space + , Strong + [ Str "strong" ] + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code + ( "", [], [] ) ">" + , Str "," + , Space + , Code + ( "", [], [] ) "$" + , Str "," + , Space + , Code + ( "", [], [] ) "\\" + , Str "," + , Space + , Code + ( "", [], [] ) "\\$" + , Str "," + , Space + , Code + ( "", [], [] ) "" + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Subscript + [ Str "subscripted" ] + , Space + , Str "and" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Superscript + [ Str "superscripted" ] + , Str "." + ] + , Header 1 + ( "special-characters", [], [] ) + [ Str "Special", Space, Str "Characters" ] + , Para + [ Str "Here", Space, Str "is", Space, Str "some", Space, Str "unicode:" ] + , BulletList + [ + [ Plain [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] + , + [ Plain [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] + , + [ Plain [ Str "section:", Space, Str "\167" ] ] + , + [ Plain [ Str "set", Space, Str "membership:", Space, Str "\8712" ] ] + , + [ Plain [ Str "copyright:", Space, Str "\169" ] ] + ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "This", Space, Str "&", Space, Str "that." ] + , Para + [ Str "4", Space, Str "<", Space, Str "5." ] + , Para + [ Str "6", Space, Str ">", Space, Str "5." ] + , Para + [ Str "Backslash:", Space, Str "\\" ] + , Para + [ Str "Backtick:", Space, Str "`" ] + , Para + [ Str "Asterisk:", Space, Str "*" ] + , Para + [ Str "Underscore:", Space, Str "_" ] + , Para + [ Str "Left", Space, Str "brace:", Space, Str "{" ] + , Para + [ Str "Right", Space, Str "brace:", Space, Str "}" ] + , Para + [ Str "Left", Space, Str "bracket:", Space, Str "[" ] + , Para + [ Str "Right", Space, Str "bracket:", Space, Str "]" ] + , Para + [ Str "Left", Space, Str "paren:", Space, Str "(" ] + , Para + [ Str "Right", Space, Str "paren:", Space, Str ")" ] + , Para + [ Str "Greater-than:", Space, Str ">" ] + , Para + [ Str "Hash:", Space, Str "#" ] + , Para + [ Str "Period:", Space, Str "." ] + , Para + [ Str "Bang:", Space, Str "!" ] + , Para + [ Str "Plus:", Space, Str "+" ] + , Para + [ Str "Minus:", Space, Str "-" ] + , Header 1 + ( "links", [], [] ) + [ Str "Links" ] + , Para + [ Str "Explicit:" + , Space + , Str "a" + , Space + , Link + ( "", [], [] ) + [ Str "URL" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Str "Explicit" + , Space + , Str "with" + , Space + , Str "no" + , Space + , Str "label:" + , Space + , Link + ( "", [], [] ) + [ Str "foo" ] + ( "foo", "" ) + , Str "." + ] + , Para + [ Str "Two" + , Space + , Str "anonymous" + , Space + , Str "links:" + , Space + , Link + ( "", [], [] ) + [ Str "the", Space, Str "first" ] + ( "/url1/", "" ) + , Space + , Str "and" + , Space + , Link + ( "", [], [] ) + [ Str "the", Space, Str "second" ] + ( "/url2/", "" ) + ] + , Para + [ Str "Reference" + , Space + , Str "links:" + , Space + , Link + ( "", [], [] ) + [ Str "link1" ] + ( "/url1/", "" ) + , Space + , Str "and" + , Space + , Link + ( "", [], [] ) + [ Str "link2" ] + ( "/url2/", "" ) + , Space + , Str "and" + , Space + , Link + ( "", [], [] ) + [ Str "link1" ] + ( "/url1/", "" ) + , Space + , Str "again." + ] + , Para + [ Str "Another" + , Space + , Link + ( "", [], [] ) + [ Str "style" + , Space + , Str "of" + , Space + , Str "reference" + , Space + , Str "link" + ] + ( "/url1/", "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Link + ( "", [], [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2", "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "amersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "link" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "AT&T" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Str "Autolinks:" + , Space + , Link + ( "", [], [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2", "" ) + , Space + , Str "and" + , Space + , Link + ( "", [], [] ) + [ Str "nobody@nowhere.net" ] + ( "mailto:nobody@nowhere.net", "" ) + , Str "." + ] + , Para + [ Str "But", Space, Str "not", Space, Str "here:" ] + , CodeBlock + ( "", [], [] ) "http://example.com/" + , Header 1 + ( "images", [], [] ) + [ Str "Images" ] + , Para + [ Str "From" + , Space + , Quoted DoubleQuote + [ Str "Voyage", Space, Str "dans", Space, Str "la", Space, Str "Lune" ] + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" + ] + , Para + [ Image ( "", [], [] ) [ Str "image" ] ( "lalune.jpg", "" ) ] + , Para + [ Image + ( "", [], [ ( "height", "2343px" ) ] ) + [ Str "Voyage dans la Lune" ] + ( "lalune.jpg", "" ) + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space + , Image + ( "", [], [] ) + [ Str "movie" ] + ( "movie.jpg", "" ) + , Space + , Str "icon." + ] + , Para + [ Str "And" + , Space + , Str "an" + , Space + , Link + ( "", [], [] ) + [ Image ( "", [], [] ) [ Str "A movie" ] ( "movie.jpg", "" ) ] + ( "/url", "" ) + , Str "." + ] + , Header 1 + ( "comments", [], [] ) + [ Str "Comments" ] + , Para + [ Str "First", Space, Str "paragraph" ] + , Para + [ Str "Another", Space, Str "paragraph" ] + , Para + [ Str "A", Space, Str "third", Space, Str "paragraph" ] + , Header 1 + ( "line-blocks", [], [] ) + [ Str "Line", Space, Str "blocks" ] + , LineBlock + [ + [ Str "But" + , Space + , Str "can" + , Space + , Str "a" + , Space + , Str "bee" + , Space + , Str "be" + , Space + , Str "said" + , Space + , Str "to" + , Space + , Str "be" + ] + , + [ Str "\160\160\160\160or" + , Space + , Str "not" + , Space + , Str "to" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "entire" + , Space + , Str "bee," + ] + , + [ Str "\160\160\160\160\160\160\160\160when" + , Space + , Str "half" + , Space + , Str "the" + , Space + , Str "bee" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "bee," + ] + , + [ Str "\160\160\160\160\160\160\160\160\160\160\160\160due" + , Space + , Str "to" + , Space + , Str "some" + , Space + , Str "ancient" + , Space + , Str "injury?" + ] + , [] + , + [ Str "Continuation", Space, Str "line" ] + , + [ Str "\160\160and", Space, Str "another" ] + ] + , Header 1 + ( "simple-tables", [], [] ) + [ Str "Simple", Space, Str "Tables" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "3" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r1", Space, Str "a" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r2", Space, Str "d" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Headless" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r1", Space, Str "a" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r2", Space, Str "d" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Header 1 + ( "grid-tables", [], [] ) + [ Str "Grid", Space, Str "Tables" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.2375 ) + , + ( AlignDefault, ColWidth 0.15 ) + , + ( AlignDefault, ColWidth 0.1625 ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "col", Space, Str "3" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "r1", Space, Str "a", SoftBreak, Str "r1", Space, Str "bis" ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r2", Space, Str "d" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Headless" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.2375 ) + , + ( AlignDefault, ColWidth 0.15 ) + , + ( AlignDefault, ColWidth 0.1625 ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "r1", Space, Str "a", SoftBreak, Str "r1", Space, Str "bis" ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r2", Space, Str "d" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Spaces" + , Space + , Str "at" + , Space + , Str "ends" + , Space + , Str "of" + , Space + , Str "lines" + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.2375 ) + , + ( AlignDefault, ColWidth 0.15 ) + , + ( AlignDefault, ColWidth 0.1625 ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "r1", Space, Str "a", SoftBreak, Str "r1", Space, Str "bis" ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "r2", Space, Str "d" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "cell" + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.2375 ) + , + ( AlignDefault, ColWidth 0.15 ) + , + ( AlignDefault, ColWidth 0.1625 ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para + [ Str "r1", Space, Str "a" ] + , Para + [ Str "r1", Space, Str "bis" ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ BulletList + [ + [ Plain [ Str "b" ] ] + , + [ Plain [ Str "b", Space, Str "2" ] ] + , + [ Plain [ Str "b", Space, Str "2" ] ] + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "c" + , SoftBreak + , Str "c" + , Space + , Str "2" + , SoftBreak + , Str "c" + , Space + , Str "2" + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Header 1 + ( "footnotes", [], [] ) + [ Str "Footnotes" ] + , Para + [ Note + [ Para + [ Str "Note", Space, Str "with", Space, Str "one", Space, Str "line." ] + ] + ] + , Para + [ Note + [ Para + [ Str "Note" + , Space + , Str "with" + , SoftBreak + , Str "continuation" + , Space + , Str "line." + ] + ] + ] + , Para + [ Note + [ Para + [ Str "Note", Space, Str "with" ] + , Para + [ Str "continuation", Space, Str "block." ] + ] + ] + , Para + [ Note + [ Para + [ Str "Note" + , Space + , Str "with" + , SoftBreak + , Str "continuation" + , Space + , Str "line" + ] + , Para + [ Str "and", Space, Str "a", Space, Str "second", Space, Str "para." ] + ] + ] + , Para + [ Str "Not", Space, Str "in", Space, Str "note." ] + , Header 1 + ( "math", [], [] ) + [ Str "Math" ] + , Para + [ Str "Some" + , Space + , Str "inline" + , Space + , Str "math" + , Space + , Math InlineMath "E=mc^2" + , Str "." + , Space + , Str "Now" + , Space + , Str "some" + , SoftBreak + , Str "display" + , Space + , Str "math:" + ] + , Para + [ Math DisplayMath "E=mc^2" ] + , Para + [ Math DisplayMath "E = mc^2" ] + , Para + [ Math DisplayMath "E = mc^2", Math DisplayMath "\\alpha = \\beta" ] + , Para + [ Math DisplayMath "\\begin{aligned}\nE &= mc^2\\\\\nF &= \\pi E\n\\end{aligned}" + , Math DisplayMath "F &= \\gamma \\alpha^2" + ] + , Para + [ Str "All", Space, Str "done." ] + , Header 1 + ( "default-role", [], [] ) + [ Str "Default-Role" ] + , Para + [ Str "Try" + , Space + , Str "changing" + , Space + , Str "the" + , Space + , Str "default" + , Space + , Str "role" + , Space + , Str "to" + , Space + , Str "a" + , Space + , Str "few" + , Space + , Str "different" + , Space + , Str "things." + ] + , Header 2 + ( "doesnt-break-title-parsing", [], [] ) + [ Str "Doesn\8217t" + , Space + , Str "Break" + , Space + , Str "Title" + , Space + , Str "Parsing" + ] + , Para + [ Str "Inline" + , Space + , Str "math:" + , Space + , Math InlineMath "E=mc^2" + , Space + , Str "or" + , Space + , Math InlineMath "E=mc^2" + , Space + , Str "or" + , Space + , Math InlineMath "E=mc^2" + , Str "." + , SoftBreak + , Str "Other" + , Space + , Str "roles:" + , Space + , Superscript + [ Str "super" ] + , Str "," + , Space + , Subscript + [ Str "sub" ] + , Str "." + ] + , Para + [ Math DisplayMath "\\alpha = beta", Math DisplayMath "E = mc^2" ] + , Para + [ Str "Some" + , Space + , Superscript + [ Str "of" ] + , Space + , Str "these" + , Space + , Superscript + [ Str "words" ] + , Space + , Str "are" + , Space + , Str "in" + , Space + , Superscript + [ Str "superscript" ] + , Str "." + ] + , Para + [ Str "Reset" + , Space + , Str "default-role" + , Space + , Str "to" + , Space + , Str "the" + , Space + , Str "default" + , Space + , Str "default." + ] + , Para + [ Str "And" + , Space + , Str "now" + , Space + , Span + ( "", [ "title-ref" ], [] ) + [ Str "some-invalid-string-3231231" ] + , Space + , Str "is" + , Space + , Str "nonsense." + ] + , Para + [ Str "And" + , Space + , Str "now" + , Space + , Str "with" + , Space + , RawInline + ( Format "html" ) "inline HTML" + , Str "." + ] + , Para + [ Str "And" + , Space + , Str "some" + , Space + , Str "inline" + , Space + , Str "haskell" + , Space + , Code + ( "", [ "haskell" ], [] ) "fmap id [1,2..10]" + , Str "." + ] + , Para + [ Str "Indirect" + , Space + , Str "python" + , Space + , Str "role" + , Space + , Code + ( "", [ "py", "python", "indirect" ], [] ) "[x*x for x in [1,2,3,4,5]]" + , Str "." + ] + , Para + [ Str "Different" + , Space + , Str "indirect" + , Space + , Str "C" + , Space + , Code + ( "", [ "c", "different-indirect" ], [] ) "int x = 15;" + , Str "." + ] + , Header 2 + ( "literal-symbols", [], [] ) + [ Str "Literal", Space, Str "symbols" ] + , Para + [ Str "2*2", Space, Str "=", Space, Str "4*1" ] + ] diff --git a/test/rtf/accent.native b/test/rtf/accent.native index bea6364de..67eb654fe 100644 --- a/test/rtf/accent.native +++ b/test/rtf/accent.native @@ -1,2 +1,18 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Str "le",Space,Str "caf\233",Space,Str "o\249",Space,Str "on",Space,Str "ne",Space,Str "fume",Space,Str "pas"]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Para + [ Str "le" + , Space + , Str "caf\233" + , Space + , Str "o\249" + , Space + , Str "on" + , Space + , Str "ne" + , Space + , Str "fume" + , Space + , Str "pas" + ] + ] diff --git a/test/rtf/bookmark.native b/test/rtf/bookmark.native index f142f1c5c..765bf29d0 100644 --- a/test/rtf/bookmark.native +++ b/test/rtf/bookmark.native @@ -1,3 +1,11 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Span ("bookmark_1",[],[]) [Str "Bookmark_1"]] -,Para [Link ("",[],[]) [Str "click",Space,Str "me"] ("#bookmark_1","")]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Para + [ Span ( "bookmark_1", [], [] ) [ Str "Bookmark_1" ] ] + , Para + [ Link + ( "", [], [] ) + [ Str "click", Space, Str "me" ] + ( "#bookmark_1", "" ) + ] + ] diff --git a/test/rtf/footnote.native b/test/rtf/footnote.native index f2893be7e..cfea5f4a1 100644 --- a/test/rtf/footnote.native +++ b/test/rtf/footnote.native @@ -1,2 +1,130 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Str "Mead's",Space,Str "landmark",Space,Str "study",Space,Str "has",Space,Str "been",Space,Str "amply",Space,Str "annotated.",Note [Para [Str "See",Space,Str "Sahlins,",Space,Str "Bateson,",Space,Str "and",Space,Str "Geertz",Space,Str "for",Space,Str "a",Space,Str "complete",Space,Str "bibliography."]],Space,Str "It",Space,Str "was",Space,Str "her",Space,Str "work",Space,Str "in",Space,Str "America",Space,Str "during",Space,Str "the",Space,Str "Second",Space,Str "World",Space,Str "War,",Space,Str "however,",Space,Str "that",Space,Str "forms",Space,Str "the",Space,Str "basis",Space,Str "for",Space,Str "the",Space,Str "paper.",Space,Str "As",Space,Str "others",Space,Str "have",Space,Str "noted,",Note [Para [Str "A",Space,Str "complete",Space,Str "bibliography",Space,Str "will",Space,Str "be",Space,Str "found",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "this",Space,Str "chapter."]],Space,Str "this",Space,Str "period",Space,Str "was",Space,Str "a",Space,Str "turning",Space,Str "point",Space,Str "for",Space,Str "Margaret",Space,Str "Mead."]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Para + [ Str "Mead's" + , Space + , Str "landmark" + , Space + , Str "study" + , Space + , Str "has" + , Space + , Str "been" + , Space + , Str "amply" + , Space + , Str "annotated." + , Note + [ Para + [ Str "See" + , Space + , Str "Sahlins," + , Space + , Str "Bateson," + , Space + , Str "and" + , Space + , Str "Geertz" + , Space + , Str "for" + , Space + , Str "a" + , Space + , Str "complete" + , Space + , Str "bibliography." + ] + ] + , Space + , Str "It" + , Space + , Str "was" + , Space + , Str "her" + , Space + , Str "work" + , Space + , Str "in" + , Space + , Str "America" + , Space + , Str "during" + , Space + , Str "the" + , Space + , Str "Second" + , Space + , Str "World" + , Space + , Str "War," + , Space + , Str "however," + , Space + , Str "that" + , Space + , Str "forms" + , Space + , Str "the" + , Space + , Str "basis" + , Space + , Str "for" + , Space + , Str "the" + , Space + , Str "paper." + , Space + , Str "As" + , Space + , Str "others" + , Space + , Str "have" + , Space + , Str "noted," + , Note + [ Para + [ Str "A" + , Space + , Str "complete" + , Space + , Str "bibliography" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "found" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "this" + , Space + , Str "chapter." + ] + ] + , Space + , Str "this" + , Space + , Str "period" + , Space + , Str "was" + , Space + , Str "a" + , Space + , Str "turning" + , Space + , Str "point" + , Space + , Str "for" + , Space + , Str "Margaret" + , Space + , Str "Mead." + ] + ] diff --git a/test/rtf/formatting.native b/test/rtf/formatting.native index 54e61bf97..6e5001de3 100644 --- a/test/rtf/formatting.native +++ b/test/rtf/formatting.native @@ -1,10 +1,51 @@ -Pandoc (Meta {unMeta = fromList [("operator",MetaInlines [Str "John",Space,Str "MacFarlane"])]}) -[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "test",Space,Str "of",Space,Str "FORMATTING.",Space,Str "This",Space,Str "is",Space,Str "hidden:",Space,Str "."] -,Para [SmallCaps [Str "Small",Space,Str "Caps"]] -,Para [Strong [Str "bold"]] -,Para [Emph [Str "italics"]] -,Para [Strong [Str "bold",Space,Emph [Str "and",Space,Str "italics"]]] -,Para [Underline [Str "underlined"]] -,Para [Strikeout [Str "strikeout"]] -,Para [Str "x",Superscript [Str "superscript"]] -,Para [Str "x",Subscript [Str "subscript"]]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "operator" + , MetaInlines + [ Str "John", Space, Str "MacFarlane" ] + ) + ] + } + ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "test" + , Space + , Str "of" + , Space + , Str "FORMATTING." + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "hidden:" + , Space + , Str "." + ] + , Para + [ SmallCaps [ Str "Small", Space, Str "Caps" ] ] + , Para + [ Strong [ Str "bold" ] ] + , Para + [ Emph [ Str "italics" ] ] + , Para + [ Strong + [ Str "bold", Space, Emph [ Str "and", Space, Str "italics" ] ] + ] + , Para + [ Underline [ Str "underlined" ] ] + , Para + [ Strikeout [ Str "strikeout" ] ] + , Para + [ Str "x", Superscript [ Str "superscript" ] ] + , Para + [ Str "x", Subscript [ Str "subscript" ] ] + ] diff --git a/test/rtf/heading.native b/test/rtf/heading.native index fbda9ef51..27d5d455e 100644 --- a/test/rtf/heading.native +++ b/test/rtf/heading.native @@ -1,5 +1,14 @@ -Pandoc (Meta {unMeta = fromList []}) -[Header 1 ("",[],[]) [Str "Heading",Space,Str "1"] -,Header 2 ("",[],[]) [Str "Heading",Space,Str "2"] -,Header 3 ("",[],[]) [Str "Heading",Space,Str "3"] -,Para [Str "Paragraph"]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Header 1 + ( "", [], [] ) + [ Str "Heading", Space, Str "1" ] + , Header 2 + ( "", [], [] ) + [ Str "Heading", Space, Str "2" ] + , Header 3 + ( "", [], [] ) + [ Str "Heading", Space, Str "3" ] + , Para + [ Str "Paragraph" ] + ] diff --git a/test/rtf/image.native b/test/rtf/image.native index e730859af..551a0f95c 100644 --- a/test/rtf/image.native +++ b/test/rtf/image.native @@ -1,2 +1,9 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Image ("",[],[("width","2.0in"),("height","2.0in")]) [Str "image"] ("f9d88c3dbe18f6a7f5670e994a947d51216cdf0e.jpg","")]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Para + [ Image + ( "", [], [ ( "width", "2.0in" ), ( "height", "2.0in" ) ] ) + [ Str "image" ] + ( "f9d88c3dbe18f6a7f5670e994a947d51216cdf0e.jpg", "" ) + ] + ] diff --git a/test/rtf/link.native b/test/rtf/link.native index e9e08dc86..9902760e1 100644 --- a/test/rtf/link.native +++ b/test/rtf/link.native @@ -1,2 +1,5 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Link ("",[],[]) [Str "pandoc"] ("http://pandoc.org","")]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Para + [ Link ( "", [], [] ) [ Str "pandoc" ] ( "http://pandoc.org", "" ) ] + ] diff --git a/test/rtf/list_complex.native b/test/rtf/list_complex.native index 53ffdf9bd..73e2e14f8 100644 --- a/test/rtf/list_complex.native +++ b/test/rtf/list_complex.native @@ -1,24 +1,84 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaInlines [Str "Cynthia",Space,Str "Johnson"]),("operator",MetaInlines [Str "John",Space,Str "MacFarlane"]),("title",MetaInlines [Str "Text",Space,Str "before",Space,Str "list"])]}) -[OrderedList (1,Decimal,Period) - [[Para [Str "One"]] - ,[Para [Str "Two"] - ,OrderedList (1,LowerAlpha,Period) - [[Para [Str "Three"]] - ,[Para [Str "Four"] - ,OrderedList (1,LowerRoman,Period) - [[Para [Str "Five"]] - ,[Para [Str "Six"] - ,OrderedList (1,UpperAlpha,Period) - [[Para [Str "Seven"]] - ,[Para [Str "Eight"] - ,OrderedList (1,UpperRoman,Period) - [[Para [Str "Nine"]] - ,[Para [Str "Ten"] - ,BulletList - [[Para [Str "Eleven"]] - ,[Para [Str "Twelve"]]]]]]]]]]]]] -,Para [Str "Out",Space,Str "of",Space,Str "list!"] -,Para [Str "Start",Space,Str "with"] -,OrderedList (7,Decimal,Period) - [[Para [Str "Seven",Space,Str "Start"]] - ,[Para [Str "Eight",Space,Str "Continue"]]]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "author" + , MetaInlines + [ Str "Cynthia", Space, Str "Johnson" ] + ) + , + ( "operator" + , MetaInlines + [ Str "John", Space, Str "MacFarlane" ] + ) + , + ( "title" + , MetaInlines + [ Str "Text", Space, Str "before", Space, Str "list" ] + ) + ] + } + ) + [ OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "One" ] ] + , + [ Para + [ Str "Two" ] + , OrderedList + ( 1, LowerAlpha, Period ) + [ + [ Para [ Str "Three" ] ] + , + [ Para + [ Str "Four" ] + , OrderedList + ( 1, LowerRoman, Period ) + [ + [ Para [ Str "Five" ] ] + , + [ Para + [ Str "Six" ] + , OrderedList + ( 1, UpperAlpha, Period ) + [ + [ Para [ Str "Seven" ] ] + , + [ Para + [ Str "Eight" ] + , OrderedList + ( 1, UpperRoman, Period ) + [ + [ Para [ Str "Nine" ] ] + , + [ Para + [ Str "Ten" ] + , BulletList + [ + [ Para [ Str "Eleven" ] ] + , + [ Para [ Str "Twelve" ] ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + ] + , Para + [ Str "Out", Space, Str "of", Space, Str "list!" ] + , Para + [ Str "Start", Space, Str "with" ] + , OrderedList + ( 7, Decimal, Period ) + [ + [ Para [ Str "Seven", Space, Str "Start" ] ] + , + [ Para [ Str "Eight", Space, Str "Continue" ] ] + ] + ] diff --git a/test/rtf/list_simple.native b/test/rtf/list_simple.native index 9281b285a..dc5b65b97 100644 --- a/test/rtf/list_simple.native +++ b/test/rtf/list_simple.native @@ -1,8 +1,11 @@ -Pandoc (Meta {unMeta = fromList []}) -[BulletList - [[Para [Str "one"]] - ,[Para [Str "two"] - ,BulletList - [[Para [Str "sub"]]]]] -,BulletList - [[Para [Str "new",Space,Str "list"]]]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ BulletList + [ + [ Para [ Str "one" ] ] + , + [ Para [ Str "two" ], BulletList [ [ Para [ Str "sub" ] ] ] ] + ] + , BulletList + [ [ Para [ Str "new", Space, Str "list" ] ] ] + ] diff --git a/test/rtf/table_error_codes.native b/test/rtf/table_error_codes.native index bc75d4f81..35d774065 100644 --- a/test/rtf/table_error_codes.native +++ b/test/rtf/table_error_codes.native @@ -1,146 +1,369 @@ -Pandoc (Meta {unMeta = fromList []}) -[Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Code"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "Error"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "3"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocFailOnWarningError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocAppError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "5"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocTemplateError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "6"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocOptionError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "21"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocUnknownReaderError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "22"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocUnknownWriterError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "23"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocUnsupportedExtensionError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "24"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocCiteprocError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "31"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocEpubSubdirectoryError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "43"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocPDFError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "44"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocXMLError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "47"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocPDFProgramNotFoundError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "61"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocHttpError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "62"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocShouldNeverHappenError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "63"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocSomeError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "64"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocParseError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "65"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocParsecError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "66"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocMakePDFError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "67"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocSyntaxMapError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "83"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocFilterError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "91"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocMacroLoop"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "92"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocUTF8DecodingError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "93"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocIpynbDecodingError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "94"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocUnsupportedCharsetError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "97"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocCouldNotFindDataFileError"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "99"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "PandocResourceNotFound"]]]])] - (TableFoot ("",[],[]) - [])] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Code" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "Error" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "3" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocFailOnWarningError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocAppError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "5" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocTemplateError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "6" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocOptionError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "21" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocUnknownReaderError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "22" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocUnknownWriterError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "23" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocUnsupportedExtensionError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "24" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocCiteprocError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "31" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocEpubSubdirectoryError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "43" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocPDFError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "44" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocXMLError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "47" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocPDFProgramNotFoundError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "61" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocHttpError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "62" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocShouldNeverHappenError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "63" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocSomeError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "64" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocParseError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "65" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocParsecError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "66" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocMakePDFError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "67" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocSyntaxMapError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "83" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocFilterError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "91" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocMacroLoop" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "92" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocUTF8DecodingError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "93" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocIpynbDecodingError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "94" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocUnsupportedCharsetError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "97" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocCouldNotFindDataFileError" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "99" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "PandocResourceNotFound" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + ] diff --git a/test/rtf/table_simple.native b/test/rtf/table_simple.native index 3cff9ac38..05e736829 100644 --- a/test/rtf/table_simple.native +++ b/test/rtf/table_simple.native @@ -1,31 +1,68 @@ -Pandoc (Meta {unMeta = fromList []}) -[Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "A"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "B"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "C"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "D"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "E"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "F"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "G"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Para [Str "H"]]]])] - (TableFoot ("",[],[]) - [])] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "A" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "B" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "C" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "D" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "E" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "F" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "G" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Para [ Str "H" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + ] diff --git a/test/rtf/unicode.native b/test/rtf/unicode.native index fc104491d..4e2340b84 100644 --- a/test/rtf/unicode.native +++ b/test/rtf/unicode.native @@ -1,2 +1,3 @@ -Pandoc (Meta {unMeta = fromList []}) -[Para [Str "\8220hi\8221\8216hi\8217\61623\945\228"]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Para [ Str "\8220hi\8221\8216hi\8217\61623\945\228" ] ] diff --git a/test/tables-rstsubset.native b/test/tables-rstsubset.native index 2536ff954..dce2c9406 100644 --- a/test/tables-rstsubset.native +++ b/test/tables-rstsubset.native @@ -1,301 +1,913 @@ -[Para [Str "Simple",Space,Str "table",Space,Str "with",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - [Plain [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."]]) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Simple",Space,Str "table",Space,Str "without",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Simple",Space,Str "table",Space,Str "indented",Space,Str "two",Space,Str "spaces:"] -,Table ("",[],[]) (Caption Nothing - [Plain [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."]]) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Multiline",Space,Str "table",Space,Str "with",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - [Plain [Str "Here\8217s",Space,Str "the",Space,Str "caption.",Space,Str "It",Space,Str "may",Space,Str "span",Space,Str "multiple",Space,Str "lines."]]) - [(AlignDefault,ColWidth 0.1375) - ,(AlignDefault,ColWidth 0.125) - ,(AlignDefault,ColWidth 0.15) - ,(AlignDefault,ColWidth 0.3375)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Centered",SoftBreak,Str "Header"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left",SoftBreak,Str "Aligned"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right",SoftBreak,Str "Aligned"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default",Space,Str "aligned"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "First"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Example",Space,Str "of",Space,Str "a",Space,Str "row",Space,Str "that",SoftBreak,Str "spans",Space,Str "multiple",Space,Str "lines."]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Second"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",SoftBreak,Str "rows."]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.1375) - ,(AlignDefault,ColWidth 0.125) - ,(AlignDefault,ColWidth 0.15) - ,(AlignDefault,ColWidth 0.3375)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Centered",SoftBreak,Str "Header"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left",SoftBreak,Str "Aligned"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right",SoftBreak,Str "Aligned"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default",Space,Str "aligned"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "First"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Example",Space,Str "of",Space,Str "a",Space,Str "row",Space,Str "that",SoftBreak,Str "spans",Space,Str "multiple",Space,Str "lines."]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Second"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",SoftBreak,Str "rows."]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Table",Space,Str "without",Space,Str "column",Space,Str "headers:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "column",Space,Str "headers:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidth 0.1375) - ,(AlignDefault,ColWidth 0.125) - ,(AlignDefault,ColWidth 0.15) - ,(AlignDefault,ColWidth 0.3375)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "First"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Example",Space,Str "of",Space,Str "a",Space,Str "row",Space,Str "that",SoftBreak,Str "spans",Space,Str "multiple",Space,Str "lines."]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Second"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",SoftBreak,Str "rows."]]]])] - (TableFoot ("",[],[]) - [])] +[ Para + [ Str "Simple", Space, Str "table", Space, Str "with", Space, Str "caption:" ] +, Table + ( "", [], [] ) + ( Caption Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ] + ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Center" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Center" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "indented" + , Space + , Str "two" + , Space + , Str "spaces:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ] + ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Center" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "caption:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing + [ Plain + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "caption." + , Space + , Str "It" + , Space + , Str "may" + , Space + , Str "span" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ) + [ + ( AlignDefault, ColWidth 0.15 ) + , + ( AlignDefault, ColWidth 0.1375 ) + , + ( AlignDefault, ColWidth 0.1625 ) + , + ( AlignDefault, ColWidth 0.35 ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Centered", SoftBreak, Str "Header" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left", SoftBreak, Str "Aligned" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right", SoftBreak, Str "Aligned" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default", Space, Str "aligned" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "First" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , SoftBreak + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Second" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , SoftBreak + , Str "rows." + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.15 ) + , + ( AlignDefault, ColWidth 0.1375 ) + , + ( AlignDefault, ColWidth 0.1625 ) + , + ( AlignDefault, ColWidth 0.35 ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Centered", SoftBreak, Str "Header" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left", SoftBreak, Str "Aligned" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right", SoftBreak, Str "Aligned" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default", Space, Str "aligned" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "First" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , SoftBreak + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Second" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , SoftBreak + , Str "rows." + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidth 0.15 ) + , + ( AlignDefault, ColWidth 0.1375 ) + , + ( AlignDefault, ColWidth 0.1625 ) + , + ( AlignDefault, ColWidth 0.35 ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "First" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , SoftBreak + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Second" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , SoftBreak + , Str "rows." + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +] diff --git a/test/tables.haddock b/test/tables.haddock index fcc26d27e..e6d5c8308 100644 --- a/test/tables.haddock +++ b/test/tables.haddock @@ -40,33 +40,33 @@ Demonstration of simple table syntax. Multiline table with caption: -+----------+---------+-----------+--------------------------+ -| Centered | Left | Right | Default aligned | -| Header | Aligned | Aligned | | -+==========+=========+===========+==========================+ -| First | row | 12.0 | Example of a row that | -| | | | spans multiple lines. | -+----------+---------+-----------+--------------------------+ -| Second | row | 5.0 | Here’s another one. Note | -| | | | the blank line between | -| | | | rows. | -+----------+---------+-----------+--------------------------+ ++-----------+----------+------------+---------------------------+ +| Centered | Left | Right | Default aligned | +| Header | Aligned | Aligned | | ++===========+==========+============+===========================+ +| First | row | 12.0 | Example of a row that | +| | | | spans multiple lines. | ++-----------+----------+------------+---------------------------+ +| Second | row | 5.0 | Here’s another one. Note | +| | | | the blank line between | +| | | | rows. | ++-----------+----------+------------+---------------------------+ Here’s the caption. It may span multiple lines. Multiline table without caption: -+----------+---------+-----------+--------------------------+ -| Centered | Left | Right | Default aligned | -| Header | Aligned | Aligned | | -+==========+=========+===========+==========================+ -| First | row | 12.0 | Example of a row that | -| | | | spans multiple lines. | -+----------+---------+-----------+--------------------------+ -| Second | row | 5.0 | Here’s another one. Note | -| | | | the blank line between | -| | | | rows. | -+----------+---------+-----------+--------------------------+ ++-----------+----------+------------+---------------------------+ +| Centered | Left | Right | Default aligned | +| Header | Aligned | Aligned | | ++===========+==========+============+===========================+ +| First | row | 12.0 | Example of a row that | +| | | | spans multiple lines. | ++-----------+----------+------------+---------------------------+ +| Second | row | 5.0 | Here’s another one. Note | +| | | | the blank line between | +| | | | rows. | ++-----------+----------+------------+---------------------------+ Table without column headers: @@ -80,11 +80,11 @@ Table without column headers: Multiline table without column headers: -+----------+---------+-----------+--------------------------+ -| First | row | 12.0 | Example of a row that | -| | | | spans multiple lines. | -+----------+---------+-----------+--------------------------+ -| Second | row | 5.0 | Here’s another one. Note | -| | | | the blank line between | -| | | | rows. | -+----------+---------+-----------+--------------------------+ ++-----------+----------+------------+---------------------------+ +| First | row | 12.0 | Example of a row that | +| | | | spans multiple lines. | ++-----------+----------+------------+---------------------------+ +| Second | row | 5.0 | Here’s another one. Note | +| | | | the blank line between | +| | | | rows. | ++-----------+----------+------------+---------------------------+ diff --git a/test/tables.markdown b/test/tables.markdown index 7f89bfc08..97ffd82d7 100644 --- a/test/tables.markdown +++ b/test/tables.markdown @@ -28,33 +28,33 @@ Simple table indented two spaces: Multiline table with caption: - -------------------------------------------------------------- + --------------------------------------------------------------- Centered Left Right Default aligned Header Aligned Aligned - ----------- ---------- ------------ -------------------------- - First row 12.0 Example of a row that - spans multiple lines. + ----------- ---------- ------------ --------------------------- + First row 12.0 Example of a row that spans + multiple lines. Second row 5.0 Here's another one. Note the blank line between rows. - -------------------------------------------------------------- + --------------------------------------------------------------- : Here's the caption. It may span multiple lines. Multiline table without caption: - -------------------------------------------------------------- + --------------------------------------------------------------- Centered Left Right Default aligned Header Aligned Aligned - ----------- ---------- ------------ -------------------------- - First row 12.0 Example of a row that - spans multiple lines. + ----------- ---------- ------------ --------------------------- + First row 12.0 Example of a row that spans + multiple lines. Second row 5.0 Here's another one. Note the blank line between rows. - -------------------------------------------------------------- + --------------------------------------------------------------- Table without column headers: @@ -66,11 +66,11 @@ Table without column headers: Multiline table without column headers: - ----------- ---------- ------------ -------------------------- - First row 12.0 Example of a row that - spans multiple lines. + ----------- ---------- ------------ --------------------------- + First row 12.0 Example of a row that spans + multiple lines. Second row 5.0 Here's another one. Note the blank line between rows. - ----------- ---------- ------------ -------------------------- + ----------- ---------- ------------ --------------------------- diff --git a/test/tables.muse b/test/tables.muse index 98e721cf0..6b3af561d 100644 --- a/test/tables.muse +++ b/test/tables.muse @@ -23,24 +23,24 @@ Simple table indented two spaces: Multiline table with caption: -+----------+---------+-----------+--------------------------+ -| First | row | 12.0 | Example of a row that | -| | | | spans multiple lines. | -+----------+---------+-----------+--------------------------+ -| Second | row | 5.0 | Here’s another one. Note | -| | | | the blank line between | -| | | | rows. | -+----------+---------+-----------+--------------------------+ ++-----------+----------+------------+---------------------------+ +| First | row | 12.0 | Example of a row that | +| | | | spans multiple lines. | ++-----------+----------+------------+---------------------------+ +| Second | row | 5.0 | Here’s another one. Note | +| | | | the blank line between | +| | | | rows. | ++-----------+----------+------------+---------------------------+ Multiline table without caption: -+----------+---------+-----------+--------------------------+ -| First | row | 12.0 | Example of a row that | -| | | | spans multiple lines. | -+----------+---------+-----------+--------------------------+ -| Second | row | 5.0 | Here’s another one. Note | -| | | | the blank line between | -| | | | rows. | -+----------+---------+-----------+--------------------------+ ++-----------+----------+------------+---------------------------+ +| First | row | 12.0 | Example of a row that | +| | | | spans multiple lines. | ++-----------+----------+------------+---------------------------+ +| Second | row | 5.0 | Here’s another one. Note | +| | | | the blank line between | +| | | | rows. | ++-----------+----------+------------+---------------------------+ Table without column headers: 12 | 12 | 12 | 12 @@ -49,11 +49,11 @@ Table without column headers: Multiline table without column headers: -+----------+---------+-----------+--------------------------+ -| First | row | 12.0 | Example of a row that | -| | | | spans multiple lines. | -+----------+---------+-----------+--------------------------+ -| Second | row | 5.0 | Here’s another one. Note | -| | | | the blank line between | -| | | | rows. | -+----------+---------+-----------+--------------------------+ ++-----------+----------+------------+---------------------------+ +| First | row | 12.0 | Example of a row that | +| | | | spans multiple lines. | ++-----------+----------+------------+---------------------------+ +| Second | row | 5.0 | Here’s another one. Note | +| | | | the blank line between | +| | | | rows. | ++-----------+----------+------------+---------------------------+ diff --git a/test/tables.native b/test/tables.native index dc74826e0..c3a2537cb 100644 --- a/test/tables.native +++ b/test/tables.native @@ -1,293 +1,891 @@ -[Para [Str "Simple",Space,Str "table",Space,Str "with",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - [Plain [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."]]) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Simple",Space,Str "table",Space,Str "without",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Simple",Space,Str "table",Space,Str "indented",Space,Str "two",Space,Str "spaces:"] -,Table ("",[],[]) (Caption Nothing - [Plain [Str "Demonstration",Space,Str "of",Space,Str "simple",Space,Str "table",Space,Str "syntax."]]) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Center"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Multiline",Space,Str "table",Space,Str "with",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - [Plain [Str "Here\8217s",Space,Str "the",Space,Str "caption.",SoftBreak,Str "It",Space,Str "may",Space,Str "span",Space,Str "multiple",Space,Str "lines."]]) - [(AlignCenter,ColWidth 0.15) - ,(AlignLeft,ColWidth 0.1375) - ,(AlignRight,ColWidth 0.1625) - ,(AlignLeft,ColWidth 0.35)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Centered",SoftBreak,Str "Header"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left",SoftBreak,Str "Aligned"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right",SoftBreak,Str "Aligned"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default",Space,Str "aligned"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "First"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Example",Space,Str "of",Space,Str "a",Space,Str "row",Space,Str "that",Space,Str "spans",SoftBreak,Str "multiple",Space,Str "lines."]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Second"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "rows."]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "caption:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidth 0.15) - ,(AlignLeft,ColWidth 0.1375) - ,(AlignRight,ColWidth 0.1625) - ,(AlignLeft,ColWidth 0.35)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Centered",SoftBreak,Str "Header"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Left",SoftBreak,Str "Aligned"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Right",SoftBreak,Str "Aligned"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Default",Space,Str "aligned"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "First"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Example",Space,Str "of",Space,Str "a",Space,Str "row",Space,Str "that",Space,Str "spans",SoftBreak,Str "multiple",Space,Str "lines."]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Second"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "rows."]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Table",Space,Str "without",Space,Str "column",Space,Str "headers:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault) - ,(AlignLeft,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignRight,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "123"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "column",Space,Str "headers:"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidth 0.15) - ,(AlignLeft,ColWidth 0.1375) - ,(AlignRight,ColWidth 0.1625) - ,(AlignDefault,ColWidth 0.35)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "First"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "12.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Example",Space,Str "of",Space,Str "a",Space,Str "row",Space,Str "that",Space,Str "spans",SoftBreak,Str "multiple",Space,Str "lines."]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Second"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "row"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5.0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "rows."]]]])] - (TableFoot ("",[],[]) - [])] +[ Para + [ Str "Simple", Space, Str "table", Space, Str "with", Space, Str "caption:" ] +, Table + ( "", [], [] ) + ( Caption Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ] + ) + [ + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Center" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Center" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "indented" + , Space + , Str "two" + , Space + , Str "spaces:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ] + ) + [ + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Center" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "caption:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing + [ Plain + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "caption." + , SoftBreak + , Str "It" + , Space + , Str "may" + , Space + , Str "span" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ) + [ + ( AlignCenter, ColWidth 0.15 ) + , + ( AlignLeft, ColWidth 0.1375 ) + , + ( AlignRight, ColWidth 0.1625 ) + , + ( AlignLeft, ColWidth 0.35 ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Centered", SoftBreak, Str "Header" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left", SoftBreak, Str "Aligned" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right", SoftBreak, Str "Aligned" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default", Space, Str "aligned" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "First" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , SoftBreak + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Second" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidth 0.15 ) + , + ( AlignLeft, ColWidth 0.1375 ) + , + ( AlignRight, ColWidth 0.1625 ) + , + ( AlignLeft, ColWidth 0.35 ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Centered", SoftBreak, Str "Header" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Left", SoftBreak, Str "Aligned" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Right", SoftBreak, Str "Aligned" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Default", Space, Str "aligned" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "First" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , SoftBreak + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Second" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignRight, ColWidthDefault ) + , + ( AlignLeft, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignRight, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "123" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +, Para + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] +, Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidth 0.15 ) + , + ( AlignLeft, ColWidth 0.1375 ) + , + ( AlignRight, ColWidth 0.1625 ) + , + ( AlignDefault, ColWidth 0.35 ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "First" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "12.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , SoftBreak + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Second" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "row" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5.0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) +] diff --git a/test/tables.opendocument b/test/tables.opendocument index cda121dd4..5216dc613 100644 --- a/test/tables.opendocument +++ b/test/tables.opendocument @@ -201,8 +201,8 @@ syntax. Multiline table with caption: -Here’s the caption. It may span -multiple lines. +Here’s the caption. It may span multiple +lines. diff --git a/test/tables.plain b/test/tables.plain index e46317a6f..f1d304cda 100644 --- a/test/tables.plain +++ b/test/tables.plain @@ -28,33 +28,33 @@ Simple table indented two spaces: Multiline table with caption: - -------------------------------------------------------------- + --------------------------------------------------------------- Centered Left Right Default aligned Header Aligned Aligned - ----------- ---------- ------------ -------------------------- - First row 12.0 Example of a row that - spans multiple lines. + ----------- ---------- ------------ --------------------------- + First row 12.0 Example of a row that spans + multiple lines. Second row 5.0 Here’s another one. Note the blank line between rows. - -------------------------------------------------------------- + --------------------------------------------------------------- : Here’s the caption. It may span multiple lines. Multiline table without caption: - -------------------------------------------------------------- + --------------------------------------------------------------- Centered Left Right Default aligned Header Aligned Aligned - ----------- ---------- ------------ -------------------------- - First row 12.0 Example of a row that - spans multiple lines. + ----------- ---------- ------------ --------------------------- + First row 12.0 Example of a row that spans + multiple lines. Second row 5.0 Here’s another one. Note the blank line between rows. - -------------------------------------------------------------- + --------------------------------------------------------------- Table without column headers: @@ -66,11 +66,11 @@ Table without column headers: Multiline table without column headers: - ----------- ---------- ------------ -------------------------- - First row 12.0 Example of a row that - spans multiple lines. + ----------- ---------- ------------ --------------------------- + First row 12.0 Example of a row that spans + multiple lines. Second row 5.0 Here’s another one. Note the blank line between rows. - ----------- ---------- ------------ -------------------------- + ----------- ---------- ------------ --------------------------- diff --git a/test/tables.rst b/test/tables.rst index 660df61d4..4b475c0b6 100644 --- a/test/tables.rst +++ b/test/tables.rst @@ -36,31 +36,31 @@ Multiline table with caption: .. table:: Here’s the caption. It may span multiple lines. - +----------+---------+-----------+--------------------------+ - | Centered | Left | Right | Default aligned | - | Header | Aligned | Aligned | | - +==========+=========+===========+==========================+ - | First | row | 12.0 | Example of a row that | - | | | | spans multiple lines. | - +----------+---------+-----------+--------------------------+ - | Second | row | 5.0 | Here’s another one. Note | - | | | | the blank line between | - | | | | rows. | - +----------+---------+-----------+--------------------------+ + +-----------+----------+------------+---------------------------+ + | Centered | Left | Right | Default aligned | + | Header | Aligned | Aligned | | + +===========+==========+============+===========================+ + | First | row | 12.0 | Example of a row that | + | | | | spans multiple lines. | + +-----------+----------+------------+---------------------------+ + | Second | row | 5.0 | Here’s another one. Note | + | | | | the blank line between | + | | | | rows. | + +-----------+----------+------------+---------------------------+ Multiline table without caption: -+----------+---------+-----------+--------------------------+ -| Centered | Left | Right | Default aligned | -| Header | Aligned | Aligned | | -+==========+=========+===========+==========================+ -| First | row | 12.0 | Example of a row that | -| | | | spans multiple lines. | -+----------+---------+-----------+--------------------------+ -| Second | row | 5.0 | Here’s another one. Note | -| | | | the blank line between | -| | | | rows. | -+----------+---------+-----------+--------------------------+ ++-----------+----------+------------+---------------------------+ +| Centered | Left | Right | Default aligned | +| Header | Aligned | Aligned | | ++===========+==========+============+===========================+ +| First | row | 12.0 | Example of a row that | +| | | | spans multiple lines. | ++-----------+----------+------------+---------------------------+ +| Second | row | 5.0 | Here’s another one. Note | +| | | | the blank line between | +| | | | rows. | ++-----------+----------+------------+---------------------------+ Table without column headers: @@ -72,11 +72,11 @@ Table without column headers: Multiline table without column headers: -+----------+---------+-----------+--------------------------+ -| First | row | 12.0 | Example of a row that | -| | | | spans multiple lines. | -+----------+---------+-----------+--------------------------+ -| Second | row | 5.0 | Here’s another one. Note | -| | | | the blank line between | -| | | | rows. | -+----------+---------+-----------+--------------------------+ ++-----------+----------+------------+---------------------------+ +| First | row | 12.0 | Example of a row that | +| | | | spans multiple lines. | ++-----------+----------+------------+---------------------------+ +| Second | row | 5.0 | Here’s another one. Note | +| | | | the blank line between | +| | | | rows. | ++-----------+----------+------------+---------------------------+ diff --git a/test/tables/planets.latex b/test/tables/planets.latex index b22c3adeb..1e703143d 100644 --- a/test/tables/planets.latex +++ b/test/tables/planets.latex @@ -18,13 +18,13 @@ & & Earth & 5.97 & 12,756 & 5514 & 9.8 & 24.0 & 149.6 & 15 & 1 & Our world \\ & & Mars & 0.642 & 6,792 & 3933 & 3.7 & 24.7 & 227.9 & -65 & 2 & The red planet \\ -\multirow{4}{*}{Jovian planets} & \multirow{2}{*}{Gas giants} & Jupiter & 1898 -& 142,984 & 1326 & 23.1 & 9.9 & 778.6 & -110 & 67 & The largest planet \\ +\multirow{4}{*}{Jovian planets} & \multirow{2}{*}{Gas giants} & Jupiter & 1898 & +142,984 & 1326 & 23.1 & 9.9 & 778.6 & -110 & 67 & The largest planet \\ & & Saturn & 568 & 120,536 & 687 & 9.0 & 10.7 & 1433.5 & -140 & 62 & \\ & \multirow{2}{*}{Ice giants} & Uranus & 86.8 & 51,118 & 1271 & 8.7 & 17.2 & 2872.5 & -195 & 27 & \\ & & Neptune & 102 & 49,528 & 1638 & 11.0 & 16.1 & 4495.1 & -200 & 14 & \\ -\multicolumn{2}{c}{Dwarf planets} & Pluto & 0.0146 & 2,370 & 2095 & 0.7 & -153.3 & 5906.4 & -225 & 5 & Declassified as a planet in 2006. \\ +\multicolumn{2}{c}{Dwarf planets} & Pluto & 0.0146 & 2,370 & 2095 & 0.7 & 153.3 +& 5906.4 & -225 & 5 & Declassified as a planet in 2006. \\ \bottomrule \end{longtable} diff --git a/test/testsuite.native b/test/testsuite.native index f9132c797..d6b91ca69 100644 --- a/test/testsuite.native +++ b/test/testsuite.native @@ -1,409 +1,2491 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]}) -[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 "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",SoftBreak,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-embedded-link",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link ("",[],[]) [Str "embedded",Space,Str "link"] ("/url","")] -,Header 3 ("level-3-with-emphasis",[],[]) [Str "Level",Space,Str "3",Space,Str "with",Space,Emph [Str "emphasis"]] -,Header 4 ("level-4",[],[]) [Str "Level",Space,Str "4"] -,Header 5 ("level-5",[],[]) [Str "Level",Space,Str "5"] -,Header 1 ("level-1",[],[]) [Str "Level",Space,Str "1"] -,Header 2 ("level-2-with-emphasis",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Emph [Str "emphasis"]] -,Header 3 ("level-3",[],[]) [Str "Level",Space,Str "3"] -,Para [Str "with",Space,Str "no",Space,Str "blank",Space,Str "line"] -,Header 2 ("level-2",[],[]) [Str "Level",Space,Str "2"] -,Para [Str "with",Space,Str "no",Space,Str "blank",Space,Str "line"] -,HorizontalRule -,Header 1 ("paragraphs",[],[]) [Str "Paragraphs"] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "regular",Space,Str "paragraph."] -,Para [Str "In",Space,Str "Markdown",Space,Str "1.0.0",Space,Str "and",Space,Str "earlier.",Space,Str "Version",SoftBreak,Str "8.",Space,Str "This",Space,Str "line",Space,Str "turns",Space,Str "into",Space,Str "a",Space,Str "list",Space,Str "item.",SoftBreak,Str "Because",Space,Str "a",Space,Str "hard-wrapped",Space,Str "line",Space,Str "in",Space,Str "the",SoftBreak,Str "middle",Space,Str "of",Space,Str "a",Space,Str "paragraph",Space,Str "looked",Space,Str "like",Space,Str "a",SoftBreak,Str "list",Space,Str "item."] -,Para [Str "Here\8217s",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet.",SoftBreak,Str "*",Space,Str "criminey."] -,Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "hard",Space,Str "line",Space,Str "break",LineBreak,Str "here."] -,HorizontalRule -,Header 1 ("block-quotes",[],[]) [Str "Block",Space,Str "Quotes"] -,Para [Str "E-mail",Space,Str "style:"] -,BlockQuote - [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote.",SoftBreak,Str "It",Space,Str "is",Space,Str "pretty",Space,Str "short."]] -,BlockQuote - [Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"] - ,CodeBlock ("",[],[]) "sub status {\n print \"working\";\n}" - ,Para [Str "A",Space,Str "list:"] - ,OrderedList (1,Decimal,Period) - [[Plain [Str "item",Space,Str "one"]] - ,[Plain [Str "item",Space,Str "two"]]] - ,Para [Str "Nested",Space,Str "block",Space,Str "quotes:"] - ,BlockQuote - [Para [Str "nested"]] - ,BlockQuote - [Para [Str "nested"]]] -,Para [Str "This",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "block",Space,Str "quote:",Space,Str "2",SoftBreak,Str ">",Space,Str "1."] -,Para [Str "And",Space,Str "a",Space,Str "following",Space,Str "paragraph."] -,HorizontalRule -,Header 1 ("code-blocks",[],[]) [Str "Code",Space,Str "Blocks"] -,Para [Str "Code:"] -,CodeBlock ("",[],[]) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" -,Para [Str "And:"] -,CodeBlock ("",[],[]) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" -,HorizontalRule -,Header 1 ("lists",[],[]) [Str "Lists"] -,Header 2 ("unordered",[],[]) [Str "Unordered"] -,Para [Str "Asterisks",Space,Str "tight:"] -,BulletList - [[Plain [Str "asterisk",Space,Str "1"]] - ,[Plain [Str "asterisk",Space,Str "2"]] - ,[Plain [Str "asterisk",Space,Str "3"]]] -,Para [Str "Asterisks",Space,Str "loose:"] -,BulletList - [[Para [Str "asterisk",Space,Str "1"]] - ,[Para [Str "asterisk",Space,Str "2"]] - ,[Para [Str "asterisk",Space,Str "3"]]] -,Para [Str "Pluses",Space,Str "tight:"] -,BulletList - [[Plain [Str "Plus",Space,Str "1"]] - ,[Plain [Str "Plus",Space,Str "2"]] - ,[Plain [Str "Plus",Space,Str "3"]]] -,Para [Str "Pluses",Space,Str "loose:"] -,BulletList - [[Para [Str "Plus",Space,Str "1"]] - ,[Para [Str "Plus",Space,Str "2"]] - ,[Para [Str "Plus",Space,Str "3"]]] -,Para [Str "Minuses",Space,Str "tight:"] -,BulletList - [[Plain [Str "Minus",Space,Str "1"]] - ,[Plain [Str "Minus",Space,Str "2"]] - ,[Plain [Str "Minus",Space,Str "3"]]] -,Para [Str "Minuses",Space,Str "loose:"] -,BulletList - [[Para [Str "Minus",Space,Str "1"]] - ,[Para [Str "Minus",Space,Str "2"]] - ,[Para [Str "Minus",Space,Str "3"]]] -,Header 2 ("ordered",[],[]) [Str "Ordered"] -,Para [Str "Tight:"] -,OrderedList (1,Decimal,Period) - [[Plain [Str "First"]] - ,[Plain [Str "Second"]] - ,[Plain [Str "Third"]]] -,Para [Str "and:"] -,OrderedList (1,Decimal,Period) - [[Plain [Str "One"]] - ,[Plain [Str "Two"]] - ,[Plain [Str "Three"]]] -,Para [Str "Loose",Space,Str "using",Space,Str "tabs:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "First"]] - ,[Para [Str "Second"]] - ,[Para [Str "Third"]]] -,Para [Str "and",Space,Str "using",Space,Str "spaces:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "One"]] - ,[Para [Str "Two"]] - ,[Para [Str "Three"]]] -,Para [Str "Multiple",Space,Str "paragraphs:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "Item",Space,Str "1,",Space,Str "graf",Space,Str "one."] - ,Para [Str "Item",Space,Str "1.",Space,Str "graf",Space,Str "two.",Space,Str "The",Space,Str "quick",Space,Str "brown",Space,Str "fox",Space,Str "jumped",Space,Str "over",Space,Str "the",Space,Str "lazy",Space,Str "dog\8217s",SoftBreak,Str "back."]] - ,[Para [Str "Item",Space,Str "2."]] - ,[Para [Str "Item",Space,Str "3."]]] -,Header 2 ("nested",[],[]) [Str "Nested"] -,BulletList - [[Plain [Str "Tab"] - ,BulletList - [[Plain [Str "Tab"] - ,BulletList - [[Plain [Str "Tab"]]]]]]] -,Para [Str "Here\8217s",Space,Str "another:"] -,OrderedList (1,Decimal,Period) - [[Plain [Str "First"]] - ,[Plain [Str "Second:"] - ,BulletList - [[Plain [Str "Fee"]] - ,[Plain [Str "Fie"]] - ,[Plain [Str "Foe"]]]] - ,[Plain [Str "Third"]]] -,Para [Str "Same",Space,Str "thing",Space,Str "but",Space,Str "with",Space,Str "paragraphs:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "First"]] - ,[Para [Str "Second:"] - ,BulletList - [[Plain [Str "Fee"]] - ,[Plain [Str "Fie"]] - ,[Plain [Str "Foe"]]]] - ,[Para [Str "Third"]]] -,Header 2 ("tabs-and-spaces",[],[]) [Str "Tabs",Space,Str "and",Space,Str "spaces"] -,BulletList - [[Para [Str "this",Space,Str "is",Space,Str "a",Space,Str "list",Space,Str "item",SoftBreak,Str "indented",Space,Str "with",Space,Str "tabs"]] - ,[Para [Str "this",Space,Str "is",Space,Str "a",Space,Str "list",Space,Str "item",SoftBreak,Str "indented",Space,Str "with",Space,Str "spaces"] - ,BulletList - [[Para [Str "this",Space,Str "is",Space,Str "an",Space,Str "example",Space,Str "list",Space,Str "item",SoftBreak,Str "indented",Space,Str "with",Space,Str "tabs"]] - ,[Para [Str "this",Space,Str "is",Space,Str "an",Space,Str "example",Space,Str "list",Space,Str "item",SoftBreak,Str "indented",Space,Str "with",Space,Str "spaces"]]]]] -,Header 2 ("fancy-list-markers",[],[]) [Str "Fancy",Space,Str "list",Space,Str "markers"] -,OrderedList (2,Decimal,TwoParens) - [[Para [Str "begins",Space,Str "with",Space,Str "2"]] - ,[Para [Str "and",Space,Str "now",Space,Str "3"] - ,Para [Str "with",Space,Str "a",Space,Str "continuation"] - ,OrderedList (4,LowerRoman,Period) - [[Plain [Str "sublist",Space,Str "with",Space,Str "roman",Space,Str "numerals,",SoftBreak,Str "starting",Space,Str "with",Space,Str "4"]] - ,[Plain [Str "more",Space,Str "items"] - ,OrderedList (1,UpperAlpha,TwoParens) - [[Plain [Str "a",Space,Str "subsublist"]] - ,[Plain [Str "a",Space,Str "subsublist"]]]]]]] -,Para [Str "Nesting:"] -,OrderedList (1,UpperAlpha,Period) - [[Plain [Str "Upper",Space,Str "Alpha"] - ,OrderedList (1,UpperRoman,Period) - [[Plain [Str "Upper",Space,Str "Roman."] - ,OrderedList (6,Decimal,TwoParens) - [[Plain [Str "Decimal",Space,Str "start",Space,Str "with",Space,Str "6"] - ,OrderedList (3,LowerAlpha,OneParen) - [[Plain [Str "Lower",Space,Str "alpha",Space,Str "with",Space,Str "paren"]]]]]]]]] -,Para [Str "Autonumbering:"] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Autonumber."]] - ,[Plain [Str "More."] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Nested."]]]]] -,Para [Str "Should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "list",Space,Str "item:"] -,Para [Str "M.A.\160\&2007"] -,Para [Str "B.",Space,Str "Williams"] -,HorizontalRule -,Header 1 ("definition-lists",[],[]) [Str "Definition",Space,Str "Lists"] -,Para [Str "Tight",Space,Str "using",Space,Str "spaces:"] -,DefinitionList - [([Str "apple"], - [[Plain [Str "red",Space,Str "fruit"]]]) - ,([Str "orange"], - [[Plain [Str "orange",Space,Str "fruit"]]]) - ,([Str "banana"], - [[Plain [Str "yellow",Space,Str "fruit"]]])] -,Para [Str "Tight",Space,Str "using",Space,Str "tabs:"] -,DefinitionList - [([Str "apple"], - [[Plain [Str "red",Space,Str "fruit"]]]) - ,([Str "orange"], - [[Plain [Str "orange",Space,Str "fruit"]]]) - ,([Str "banana"], - [[Plain [Str "yellow",Space,Str "fruit"]]])] -,Para [Str "Loose:"] -,DefinitionList - [([Str "apple"], - [[Para [Str "red",Space,Str "fruit"]]]) - ,([Str "orange"], - [[Para [Str "orange",Space,Str "fruit"]]]) - ,([Str "banana"], - [[Para [Str "yellow",Space,Str "fruit"]]])] -,Para [Str "Multiple",Space,Str "blocks",Space,Str "with",Space,Str "italics:"] -,DefinitionList - [([Emph [Str "apple"]], - [[Para [Str "red",Space,Str "fruit"] - ,Para [Str "contains",Space,Str "seeds,",SoftBreak,Str "crisp,",Space,Str "pleasant",Space,Str "to",Space,Str "taste"]]]) - ,([Emph [Str "orange"]], - [[Para [Str "orange",Space,Str "fruit"] - ,CodeBlock ("",[],[]) "{ orange code block }" - ,BlockQuote - [Para [Str "orange",Space,Str "block",Space,Str "quote"]]]])] -,Para [Str "Multiple",Space,Str "definitions,",Space,Str "tight:"] -,DefinitionList - [([Str "apple"], - [[Plain [Str "red",Space,Str "fruit"]] - ,[Plain [Str "computer"]]]) - ,([Str "orange"], - [[Plain [Str "orange",Space,Str "fruit"]] - ,[Plain [Str "bank"]]])] -,Para [Str "Multiple",Space,Str "definitions,",Space,Str "loose:"] -,DefinitionList - [([Str "apple"], - [[Para [Str "red",Space,Str "fruit"]] - ,[Para [Str "computer"]]]) - ,([Str "orange"], - [[Para [Str "orange",Space,Str "fruit"]] - ,[Para [Str "bank"]]])] -,Para [Str "Blank",Space,Str "line",Space,Str "after",Space,Str "term,",Space,Str "indented",Space,Str "marker,",Space,Str "alternate",Space,Str "markers:"] -,DefinitionList - [([Str "apple"], - [[Para [Str "red",Space,Str "fruit"]] - ,[Para [Str "computer"]]]) - ,([Str "orange"], - [[Para [Str "orange",Space,Str "fruit"] - ,OrderedList (1,Decimal,Period) - [[Plain [Str "sublist"]] - ,[Plain [Str "sublist"]]]]])] -,Header 1 ("html-blocks",[],[]) [Str "HTML",Space,Str "Blocks"] -,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"] -,Div ("",[],[]) - [Plain [Str "foo"]] -,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"] -,Div ("",[],[]) - [Div ("",[],[]) - [Div ("",[],[]) - [Para [Str "foo"]]] - ,Div ("",[],[]) - [Plain [Str "bar"]]] -,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table:"] -,RawBlock (Format "html") "" -,RawBlock (Format "html") "" -,RawBlock (Format "html") "" -,RawBlock (Format "html") "" -,RawBlock (Format "html") "" -,RawBlock (Format "html") "
" -,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]] -,RawBlock (Format "html") "" -,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]] -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "" -,Para [Str "Here\8217s",Space,Str "a",Space,Str "simple",Space,Str "block:"] -,Div ("",[],[]) - [Para [Str "foo"]] -,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block,",Space,Str "though:"] -,CodeBlock ("",[],[]) "
\n foo\n
" -,Para [Str "As",Space,Str "should",Space,Str "this:"] -,CodeBlock ("",[],[]) "
foo
" -,Para [Str "Now,",Space,Str "nested:"] -,Div ("",[],[]) - [Div ("",[],[]) - [Div ("",[],[]) - [Plain [Str "foo"]]]] -,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment:"] -,RawBlock (Format "html") "" -,Para [Str "Multiline:"] -,RawBlock (Format "html") "" -,RawBlock (Format "html") "" -,Para [Str "Code",Space,Str "block:"] -,CodeBlock ("",[],[]) "" -,Para [Str "Just",Space,Str "plain",Space,Str "comment,",Space,Str "with",Space,Str "trailing",Space,Str "spaces",Space,Str "on",Space,Str "the",Space,Str "line:"] -,RawBlock (Format "html") "" -,Para [Str "Code:"] -,CodeBlock ("",[],[]) "
" -,Para [Str "Hr\8217s:"] -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,HorizontalRule -,Header 1 ("inline-markup",[],[]) [Str "Inline",Space,Str "Markup"] -,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."] -,Para [Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str "."] -,Para [Str "An",Space,Emph [Link ("",[],[]) [Str "emphasized",Space,Str "link"] ("/url","")],Str "."] -,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]] -,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."] -,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]] -,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."] -,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "",Str "."] -,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "strikeout"],Str "."]] -,Para [Str "Superscripts:",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Superscript [Emph [Str "hello"]],Space,Str "a",Superscript [Str "hello\160there"],Str "."] -,Para [Str "Subscripts:",Space,Str "H",Subscript [Str "2"],Str "O,",Space,Str "H",Subscript [Str "23"],Str "O,",Space,Str "H",Subscript [Str "many\160of\160them"],Str "O."] -,Para [Str "These",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "superscripts",Space,Str "or",Space,Str "subscripts,",SoftBreak,Str "because",Space,Str "of",Space,Str "the",Space,Str "unescaped",Space,Str "spaces:",Space,Str "a^b",Space,Str "c^d,",Space,Str "a~b",Space,Str "c~d."] -,HorizontalRule -,Header 1 ("smart-quotes-ellipses-dashes",[],[]) [Str "Smart",Space,Str "quotes,",Space,Str "ellipses,",Space,Str "dashes"] -,Para [Quoted DoubleQuote [Str "Hello,"],Space,Str "said",Space,Str "the",Space,Str "spider.",Space,Quoted DoubleQuote [Quoted SingleQuote [Str "Shelob"],Space,Str "is",Space,Str "my",Space,Str "name."]] -,Para [Quoted SingleQuote [Str "A"],Str ",",Space,Quoted SingleQuote [Str "B"],Str ",",Space,Str "and",Space,Quoted SingleQuote [Str "C"],Space,Str "are",Space,Str "letters."] -,Para [Quoted SingleQuote [Str "Oak,"],Space,Quoted SingleQuote [Str "elm,"],Space,Str "and",Space,Quoted SingleQuote [Str "beech"],Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees.",SoftBreak,Str "So",Space,Str "is",Space,Quoted SingleQuote [Str "pine."]] -,Para [Quoted SingleQuote [Str "He",Space,Str "said,",Space,Quoted DoubleQuote [Str "I",Space,Str "want",Space,Str "to",Space,Str "go."]],Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",SoftBreak,Str "70\8217s?"] -,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code ("",[],[]) "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link ("",[],[]) [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."] -,Para [Str "Some",Space,Str "dashes:",Space,Str "one\8212two",Space,Str "\8212",Space,Str "three\8212four",Space,Str "\8212",Space,Str "five."] -,Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5\8211\&7,",Space,Str "255\8211\&66,",Space,Str "1987\8211\&1999."] -,Para [Str "Ellipses\8230and\8230and\8230."] -,HorizontalRule -,Header 1 ("latex",[],[]) [Str "LaTeX"] -,BulletList - [[Plain [RawInline (Format "tex") "\\cite[22-23]{smith.1899}"]] - ,[Plain [Math InlineMath "2+2=4"]] - ,[Plain [Math InlineMath "x \\in y"]] - ,[Plain [Math InlineMath "\\alpha \\wedge \\omega"]] - ,[Plain [Math InlineMath "223"]] - ,[Plain [Math InlineMath "p",Str "-Tree"]] - ,[Plain [Str "Here\8217s",Space,Str "some",Space,Str "display",Space,Str "math:",SoftBreak,Math DisplayMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"]] - ,[Plain [Str "Here\8217s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,Math InlineMath "\\alpha + \\omega \\times x^2",Str "."]]] -,Para [Str "These",Space,Str "shouldn\8217t",Space,Str "be",Space,Str "math:"] -,BulletList - [[Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code ("",[],[]) "$e = mc^2$",Str "."]] - ,[Plain [Str "$22,000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money.",Space,Str "So",Space,Str "is",Space,Str "$34,000.",SoftBreak,Str "(It",Space,Str "worked",Space,Str "if",Space,Quoted DoubleQuote [Str "lot"],Space,Str "is",Space,Str "emphasized.)"]] - ,[Plain [Str "Shoes",Space,Str "($20)",Space,Str "and",Space,Str "socks",Space,Str "($5)."]] - ,[Plain [Str "Escaped",Space,Code ("",[],[]) "$",Str ":",Space,Str "$73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23$."]]] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"] -,RawBlock (Format "tex") "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" -,HorizontalRule -,Header 1 ("special-characters",[],[]) [Str "Special",Space,Str "Characters"] -,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode:"] -,BulletList - [[Plain [Str "I",Space,Str "hat:",Space,Str "\206"]] - ,[Plain [Str "o",Space,Str "umlaut:",Space,Str "\246"]] - ,[Plain [Str "section:",Space,Str "\167"]] - ,[Plain [Str "set",Space,Str "membership:",Space,Str "\8712"]] - ,[Plain [Str "copyright:",Space,Str "\169"]]] -,Para [Str "AT&T",Space,Str "has",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "their",Space,Str "name."] -,Para [Str "AT&T",Space,Str "is",Space,Str "another",Space,Str "way",Space,Str "to",Space,Str "write",Space,Str "it."] -,Para [Str "This",Space,Str "&",Space,Str "that."] -,Para [Str "4",Space,Str "<",Space,Str "5."] -,Para [Str "6",Space,Str ">",Space,Str "5."] -,Para [Str "Backslash:",Space,Str "\\"] -,Para [Str "Backtick:",Space,Str "`"] -,Para [Str "Asterisk:",Space,Str "*"] -,Para [Str "Underscore:",Space,Str "_"] -,Para [Str "Left",Space,Str "brace:",Space,Str "{"] -,Para [Str "Right",Space,Str "brace:",Space,Str "}"] -,Para [Str "Left",Space,Str "bracket:",Space,Str "["] -,Para [Str "Right",Space,Str "bracket:",Space,Str "]"] -,Para [Str "Left",Space,Str "paren:",Space,Str "("] -,Para [Str "Right",Space,Str "paren:",Space,Str ")"] -,Para [Str "Greater-than:",Space,Str ">"] -,Para [Str "Hash:",Space,Str "#"] -,Para [Str "Period:",Space,Str "."] -,Para [Str "Bang:",Space,Str "!"] -,Para [Str "Plus:",Space,Str "+"] -,Para [Str "Minus:",Space,Str "-"] -,HorizontalRule -,Header 1 ("links",[],[]) [Str "Links"] -,Header 2 ("explicit",[],[]) [Str "Explicit"] -,Para [Str "Just",Space,Str "a",Space,Link ("",[],[]) [Str "URL"] ("/url/",""),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title"),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title preceded by two spaces"),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title preceded by a tab"),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title with \"quotes\" in it")] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title with single quotes")] -,Para [Link ("",[],[]) [Str "with_underscore"] ("/url/with_underscore","")] -,Para [Link ("",[],[]) [Str "Email",Space,Str "link"] ("mailto:nobody@nowhere.net","")] -,Para [Link ("",[],[]) [Str "Empty"] ("",""),Str "."] -,Header 2 ("reference",[],[]) [Str "Reference"] -,Para [Str "Foo",Space,Link ("",[],[]) [Str "bar"] ("/url/",""),Str "."] -,Para [Str "With",Space,Link ("",[],[]) [Str "embedded",Space,Str "[brackets]"] ("/url/",""),Str "."] -,Para [Link ("",[],[]) [Str "b"] ("/url/",""),Space,Str "by",Space,Str "itself",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "link."] -,Para [Str "Indented",Space,Link ("",[],[]) [Str "once"] ("/url",""),Str "."] -,Para [Str "Indented",Space,Link ("",[],[]) [Str "twice"] ("/url",""),Str "."] -,Para [Str "Indented",Space,Link ("",[],[]) [Str "thrice"] ("/url",""),Str "."] -,Para [Str "This",Space,Str "should",Space,Str "[not][]",Space,Str "be",Space,Str "a",Space,Str "link."] -,CodeBlock ("",[],[]) "[not]: /url" -,Para [Str "Foo",Space,Link ("",[],[]) [Str "bar"] ("/url/","Title with \"quotes\" inside"),Str "."] -,Para [Str "Foo",Space,Link ("",[],[]) [Str "biz"] ("/url/","Title with \"quote\" inside"),Str "."] -,Header 2 ("with-ampersands",[],[]) [Str "With",Space,Str "ampersands"] -,Para [Str "Here\8217s",Space,Str "a",Space,Link ("",[],[]) [Str "link",Space,Str "with",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "the",Space,Str "URL"] ("http://example.com/?foo=1&bar=2",""),Str "."] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "link",Space,Str "with",Space,Str "an",Space,Str "amersand",Space,Str "in",Space,Str "the",Space,Str "link",Space,Str "text:",Space,Link ("",[],[]) [Str "AT&T"] ("http://att.com/","AT&T"),Str "."] -,Para [Str "Here\8217s",Space,Str "an",Space,Link ("",[],[]) [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."] -,Para [Str "Here\8217s",Space,Str "an",Space,Link ("",[],[]) [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."] -,Header 2 ("autolinks",[],[]) [Str "Autolinks"] -,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link ("",["uri"],[]) [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] -,BulletList - [[Plain [Str "In",Space,Str "a",Space,Str "list?"]] - ,[Plain [Link ("",["uri"],[]) [Str "http://example.com/"] ("http://example.com/","")]] - ,[Plain [Str "It",Space,Str "should."]]] -,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link ("",["email"],[]) [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] -,BlockQuote - [Para [Str "Blockquoted:",Space,Link ("",["uri"],[]) [Str "http://example.com/"] ("http://example.com/","")]] -,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) ""] -,CodeBlock ("",[],[]) "or here: " -,HorizontalRule -,Header 1 ("images",[],[]) [Str "Images"] -,Para [Str "From",Space,Quoted DoubleQuote [Str "Voyage",Space,Str "dans",Space,Str "la",Space,Str "Lune"],Space,Str "by",Space,Str "Georges",Space,Str "Melies",Space,Str "(1902):"] -,Para [Image ("",[],[]) [Str "lalune"] ("lalune.jpg","fig:Voyage dans la Lune")] -,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image ("",[],[]) [Str "movie"] ("movie.jpg",""),Space,Str "icon."] -,HorizontalRule -,Header 1 ("footnotes",[],[]) [Str "Footnotes"] -,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote.",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",SoftBreak,Str "reference.",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document."]],Space,Str "and",Space,Str "another.",Note [Para [Str "Here\8217s",Space,Str "the",Space,Str "long",Space,Str "note.",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",SoftBreak,Str "blocks."],Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",SoftBreak,Str "footnote",Space,Str "(as",Space,Str "with",Space,Str "list",Space,Str "items)."],CodeBlock ("",[],[]) " { }",Para [Str "If",Space,Str "you",Space,Str "want,",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line,",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",SoftBreak,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block."]],SoftBreak,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Space,Str "because",Space,Str "it",SoftBreak,Str "contains",Space,Str "a",Space,Str "space.[^my",Space,Str "note]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note.",Note [Para [Str "This",SoftBreak,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type.",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",SoftBreak,Link ("",[],[]) [Str "links"] ("http://google.com",""),Space,Str "and",Space,Code ("",[],[]) "]",Space,Str "verbatim",Space,Str "characters,",SoftBreak,Str "as",Space,Str "well",Space,Str "as",Space,Str "[bracketed",Space,Str "text]."]]] -,BlockQuote - [Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes.",Note [Para [Str "In",Space,Str "quote."]]]] -,OrderedList (1,Decimal,Period) - [[Plain [Str "And",Space,Str "in",Space,Str "list",Space,Str "items.",Note [Para [Str "In",Space,Str "list."]]]]] -,Para [Str "This",Space,Str "paragraph",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "part",Space,Str "of",Space,Str "the",Space,Str "note,",Space,Str "as",Space,Str "it",Space,Str "is",Space,Str "not",Space,Str "indented."]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "author" + , MetaList + [ MetaInlines + [ Str "John", Space, Str "MacFarlane" ] + , MetaInlines + [ Str "Anonymous" ] + ] + ) + , + ( "date" + , MetaInlines + [ Str "July", Space, Str "17,", Space, Str "2006" ] + ) + , + ( "title" + , MetaInlines + [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] + ) + ] + } + ) + [ 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 "Most" + , Space + , Str "of" + , Space + , Str "them" + , Space + , Str "are" + , Space + , Str "adapted" + , Space + , Str "from" + , SoftBreak + , 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-embedded-link", [], [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Link + ( "", [], [] ) + [ Str "embedded", Space, Str "link" ] + ( "/url", "" ) + ] + , Header 3 + ( "level-3-with-emphasis", [], [] ) + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph + [ Str "emphasis" ] + ] + , Header 4 + ( "level-4", [], [] ) + [ Str "Level", Space, Str "4" ] + , Header 5 + ( "level-5", [], [] ) + [ Str "Level", Space, Str "5" ] + , Header 1 + ( "level-1", [], [] ) + [ Str "Level", Space, Str "1" ] + , Header 2 + ( "level-2-with-emphasis", [], [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph + [ Str "emphasis" ] + ] + , Header 3 + ( "level-3", [], [] ) + [ Str "Level", Space, Str "3" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Header 2 + ( "level-2", [], [] ) + [ Str "Level", Space, Str "2" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , HorizontalRule + , Header 1 + ( "paragraphs", [], [] ) + [ Str "Paragraphs" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , SoftBreak + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + , SoftBreak + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" + , Space + , Str "in" + , Space + , Str "the" + , SoftBreak + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , SoftBreak + , Str "list" + , Space + , Str "item." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , SoftBreak + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" + , LineBreak + , Str "here." + ] + , HorizontalRule + , Header 1 + ( "block-quotes", [], [] ) + [ Str "Block", Space, Str "Quotes" ] + , Para + [ Str "E-mail", Space, Str "style:" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , SoftBreak + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] + ] + , BlockQuote + [ Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , CodeBlock + ( "", [], [] ) "sub status {\n print \"working\";\n}" + , Para + [ Str "A", Space, Str "list:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "item", Space, Str "one" ] ] + , + [ Plain [ Str "item", Space, Str "two" ] ] + ] + , Para + [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] + , BlockQuote + [ Para [ Str "nested" ] ] + , BlockQuote + [ Para [ Str "nested" ] ] + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + , Space + , Str "2" + , SoftBreak + , Str ">" + , Space + , Str "1." + ] + , Para + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] + , HorizontalRule + , Header 1 + ( "code-blocks", [], [] ) + [ Str "Code", Space, Str "Blocks" ] + , Para + [ Str "Code:" ] + , CodeBlock + ( "" + , [] + , [] + ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + , Para + [ Str "And:" ] + , CodeBlock + ( "" + , [] + , [] + ) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + , HorizontalRule + , Header 1 + ( "lists", [], [] ) + [ Str "Lists" ] + , Header 2 + ( "unordered", [], [] ) + [ Str "Unordered" ] + , Para + [ Str "Asterisks", Space, Str "tight:" ] + , BulletList + [ + [ Plain [ Str "asterisk", Space, Str "1" ] ] + , + [ Plain [ Str "asterisk", Space, Str "2" ] ] + , + [ Plain [ Str "asterisk", Space, Str "3" ] ] + ] + , Para + [ Str "Asterisks", Space, Str "loose:" ] + , BulletList + [ + [ Para [ Str "asterisk", Space, Str "1" ] ] + , + [ Para [ Str "asterisk", Space, Str "2" ] ] + , + [ Para [ Str "asterisk", Space, Str "3" ] ] + ] + , Para + [ Str "Pluses", Space, Str "tight:" ] + , BulletList + [ + [ Plain [ Str "Plus", Space, Str "1" ] ] + , + [ Plain [ Str "Plus", Space, Str "2" ] ] + , + [ Plain [ Str "Plus", Space, Str "3" ] ] + ] + , Para + [ Str "Pluses", Space, Str "loose:" ] + , BulletList + [ + [ Para [ Str "Plus", Space, Str "1" ] ] + , + [ Para [ Str "Plus", Space, Str "2" ] ] + , + [ Para [ Str "Plus", Space, Str "3" ] ] + ] + , Para + [ Str "Minuses", Space, Str "tight:" ] + , BulletList + [ + [ Plain [ Str "Minus", Space, Str "1" ] ] + , + [ Plain [ Str "Minus", Space, Str "2" ] ] + , + [ Plain [ Str "Minus", Space, Str "3" ] ] + ] + , Para + [ Str "Minuses", Space, Str "loose:" ] + , BulletList + [ + [ Para [ Str "Minus", Space, Str "1" ] ] + , + [ Para [ Str "Minus", Space, Str "2" ] ] + , + [ Para [ Str "Minus", Space, Str "3" ] ] + ] + , Header 2 + ( "ordered", [], [] ) + [ Str "Ordered" ] + , Para + [ Str "Tight:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "First" ] ] + , + [ Plain [ Str "Second" ] ] + , + [ Plain [ Str "Third" ] ] + ] + , Para + [ Str "and:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "One" ] ] + , + [ Plain [ Str "Two" ] ] + , + [ Plain [ Str "Three" ] ] + ] + , Para + [ Str "Loose", Space, Str "using", Space, Str "tabs:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para [ Str "Second" ] ] + , + [ Para [ Str "Third" ] ] + ] + , Para + [ Str "and", Space, Str "using", Space, Str "spaces:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "One" ] ] + , + [ Para [ Str "Two" ] ] + , + [ Para [ Str "Three" ] ] + ] + , Para + [ Str "Multiple", Space, Str "paragraphs:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , SoftBreak + , Str "back." + ] + ] + , + [ Para [ Str "Item", Space, Str "2." ] ] + , + [ Para [ Str "Item", Space, Str "3." ] ] + ] + , Header 2 + ( "nested", [], [] ) + [ Str "Nested" ] + , BulletList + [ + [ Plain + [ Str "Tab" ] + , BulletList + [ + [ Plain + [ Str "Tab" ] + , BulletList + [ [ Plain [ Str "Tab" ] ] ] + ] + ] + ] + ] + , Para + [ Str "Here\8217s", Space, Str "another:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "First" ] ] + , + [ Plain + [ Str "Second:" ] + , BulletList + [ + [ Plain [ Str "Fee" ] ] + , + [ Plain [ Str "Fie" ] ] + , + [ Plain [ Str "Foe" ] ] + ] + ] + , + [ Plain [ Str "Third" ] ] + ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" + ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para + [ Str "Second:" ] + , BulletList + [ + [ Plain [ Str "Fee" ] ] + , + [ Plain [ Str "Fie" ] ] + , + [ Plain [ Str "Foe" ] ] + ] + ] + , + [ Para [ Str "Third" ] ] + ] + , Header 2 + ( "tabs-and-spaces", [], [] ) + [ Str "Tabs", Space, Str "and", Space, Str "spaces" ] + , BulletList + [ + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + , BulletList + [ + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + ] + ] + ] + ] + , Header 2 + ( "fancy-list-markers", [], [] ) + [ Str "Fancy", Space, Str "list", Space, Str "markers" ] + , OrderedList + ( 2, Decimal, TwoParens ) + [ + [ Para [ Str "begins", Space, Str "with", Space, Str "2" ] ] + , + [ Para + [ Str "and", Space, Str "now", Space, Str "3" ] + , Para + [ Str "with", Space, Str "a", Space, Str "continuation" ] + , OrderedList + ( 4, LowerRoman, Period ) + [ + [ Plain + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , SoftBreak + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" + ] + ] + , + [ Plain + [ Str "more", Space, Str "items" ] + , OrderedList + ( 1, UpperAlpha, TwoParens ) + [ + [ Plain [ Str "a", Space, Str "subsublist" ] ] + , + [ Plain [ Str "a", Space, Str "subsublist" ] ] + ] + ] + ] + ] + ] + , Para + [ Str "Nesting:" ] + , OrderedList + ( 1, UpperAlpha, Period ) + [ + [ Plain + [ Str "Upper", Space, Str "Alpha" ] + , OrderedList + ( 1, UpperRoman, Period ) + [ + [ Plain + [ Str "Upper", Space, Str "Roman." ] + , OrderedList + ( 6, Decimal, TwoParens ) + [ + [ Plain + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3, LowerAlpha, OneParen ) + [ + [ Plain + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] + ] + ] + ] + ] + ] + ] + , Para + [ Str "Autonumbering:" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "Autonumber." ] ] + , + [ Plain + [ Str "More." ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ [ Plain [ Str "Nested." ] ] ] + ] + ] + , Para + [ Str "Should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item:" + ] + , Para + [ Str "M.A.\160\&2007" ] + , Para + [ Str "B.", Space, Str "Williams" ] + , HorizontalRule + , Header 1 + ( "definition-lists", [], [] ) + [ Str "Definition", Space, Str "Lists" ] + , Para + [ Str "Tight", Space, Str "using", Space, Str "spaces:" ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ [ Plain [ Str "red", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "orange" ] + , + [ [ Plain [ Str "orange", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "banana" ] + , + [ [ Plain [ Str "yellow", Space, Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Tight", Space, Str "using", Space, Str "tabs:" ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ [ Plain [ Str "red", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "orange" ] + , + [ [ Plain [ Str "orange", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "banana" ] + , + [ [ Plain [ Str "yellow", Space, Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Loose:" ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ [ Para [ Str "red", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "orange" ] + , + [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] + ) + , + ( + [ Str "banana" ] + , + [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "with" + , Space + , Str "italics:" + ] + , DefinitionList + [ + ( + [ Emph [ Str "apple" ] ] + , + [ + [ Para + [ Str "red", Space, Str "fruit" ] + , Para + [ Str "contains" + , Space + , Str "seeds," + , SoftBreak + , Str "crisp," + , Space + , Str "pleasant" + , Space + , Str "to" + , Space + , Str "taste" + ] + ] + ] + ) + , + ( + [ Emph [ Str "orange" ] ] + , + [ + [ Para + [ Str "orange", Space, Str "fruit" ] + , CodeBlock + ( "", [], [] ) "{ orange code block }" + , BlockQuote + [ Para + [ Str "orange", Space, Str "block", Space, Str "quote" ] + ] + ] + ] + ) + ] + , Para + [ Str "Multiple", Space, Str "definitions,", Space, Str "tight:" ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ + [ Plain [ Str "red", Space, Str "fruit" ] ] + , + [ Plain [ Str "computer" ] ] + ] + ) + , + ( + [ Str "orange" ] + , + [ + [ Plain [ Str "orange", Space, Str "fruit" ] ] + , + [ Plain [ Str "bank" ] ] + ] + ) + ] + , Para + [ Str "Multiple", Space, Str "definitions,", Space, Str "loose:" ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ + [ Para [ Str "red", Space, Str "fruit" ] ] + , + [ Para [ Str "computer" ] ] + ] + ) + , + ( + [ Str "orange" ] + , + [ + [ Para [ Str "orange", Space, Str "fruit" ] ] + , + [ Para [ Str "bank" ] ] + ] + ) + ] + , Para + [ Str "Blank" + , Space + , Str "line" + , Space + , Str "after" + , Space + , Str "term," + , Space + , Str "indented" + , Space + , Str "marker," + , Space + , Str "alternate" + , Space + , Str "markers:" + ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ + [ Para [ Str "red", Space, Str "fruit" ] ] + , + [ Para [ Str "computer" ] ] + ] + ) + , + ( + [ Str "orange" ] + , + [ + [ Para + [ Str "orange", Space, Str "fruit" ] + , OrderedList + ( 1, Decimal, Period ) + [ [ Plain [ Str "sublist" ] ], [ Plain [ Str "sublist" ] ] ] + ] + ] + ) + ] + , Header 1 + ( "html-blocks", [], [] ) + [ Str "HTML", Space, Str "Blocks" ] + , Para + [ Str "Simple" + , Space + , Str "block" + , Space + , Str "on" + , Space + , Str "one" + , Space + , Str "line:" + ] + , Div + ( "", [], [] ) + [ Plain [ Str "foo" ] ] + , Para + [ Str "And" + , Space + , Str "nested" + , Space + , Str "without" + , Space + , Str "indentation:" + ] + , Div + ( "", [], [] ) + [ Div + ( "", [], [] ) + [ Div ( "", [], [] ) [ Para [ Str "foo" ] ] ] + , Div + ( "", [], [] ) + [ Plain [ Str "bar" ] ] + ] + , Para + [ Str "Interpreted" + , Space + , Str "markdown" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "table:" + ] + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "
" + , Plain + [ Str "This", Space, Str "is", Space, Emph [ Str "emphasized" ] ] + , RawBlock + ( Format "html" ) "" + , Plain + [ Str "And" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Strong + [ Str "strong" ] + ] + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "" + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "simple" + , Space + , Str "block:" + ] + , Div + ( "", [], [] ) + [ Para [ Str "foo" ] ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "code" + , Space + , Str "block," + , Space + , Str "though:" + ] + , CodeBlock + ( "", [], [] ) "
\n foo\n
" + , Para + [ Str "As", Space, Str "should", Space, Str "this:" ] + , CodeBlock + ( "", [], [] ) "
foo
" + , Para + [ Str "Now,", Space, Str "nested:" ] + , Div + ( "", [], [] ) + [ Div + ( "", [], [] ) + [ Div ( "", [], [] ) [ Plain [ Str "foo" ] ] ] + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "just" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "HTML" + , Space + , Str "comment:" + ] + , RawBlock + ( Format "html" ) "" + , Para + [ Str "Multiline:" ] + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "" + , Para + [ Str "Code", Space, Str "block:" ] + , CodeBlock + ( "", [], [] ) "" + , Para + [ Str "Just" + , Space + , Str "plain" + , Space + , Str "comment," + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "spaces" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "line:" + ] + , RawBlock + ( Format "html" ) "" + , Para + [ Str "Code:" ] + , CodeBlock + ( "", [], [] ) "
" + , Para + [ Str "Hr\8217s:" ] + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , HorizontalRule + , Header 1 + ( "inline-markup", [], [] ) + [ Str "Inline", Space, Str "Markup" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph + [ Str "is", Space, Str "this" ] + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Strong + [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Strong + [ Str "is", Space, Str "this" ] + , Str "." + ] + , Para + [ Str "An" + , Space + , Emph + [ Link + ( "", [], [] ) + [ Str "emphasized", Space, Str "link" ] + ( "/url", "" ) + ] + , Str "." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong + [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong + [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code + ( "", [], [] ) ">" + , Str "," + , Space + , Code + ( "", [], [] ) "$" + , Str "," + , Space + , Code + ( "", [], [] ) "\\" + , Str "," + , Space + , Code + ( "", [], [] ) "\\$" + , Str "," + , Space + , Code + ( "", [], [] ) "" + , Str "." + ] + , Para + [ Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "strikeout" ] + , Str "." + ] + ] + , Para + [ Str "Superscripts:" + , Space + , Str "a" + , Superscript + [ Str "bc" ] + , Str "d" + , Space + , Str "a" + , Superscript + [ Emph [ Str "hello" ] ] + , Space + , Str "a" + , Superscript + [ Str "hello\160there" ] + , Str "." + ] + , Para + [ Str "Subscripts:" + , Space + , Str "H" + , Subscript + [ Str "2" ] + , Str "O," + , Space + , Str "H" + , Subscript + [ Str "23" ] + , Str "O," + , Space + , Str "H" + , Subscript + [ Str "many\160of\160them" ] + , Str "O." + ] + , Para + [ Str "These" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "superscripts" + , Space + , Str "or" + , Space + , Str "subscripts," + , SoftBreak + , Str "because" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "unescaped" + , Space + , Str "spaces:" + , Space + , Str "a^b" + , Space + , Str "c^d," + , Space + , Str "a~b" + , Space + , Str "c~d." + ] + , HorizontalRule + , Header 1 + ( "smart-quotes-ellipses-dashes", [], [] ) + [ Str "Smart" + , Space + , Str "quotes," + , Space + , Str "ellipses," + , Space + , Str "dashes" + ] + , Para + [ Quoted DoubleQuote + [ Str "Hello," ] + , Space + , Str "said" + , Space + , Str "the" + , Space + , Str "spider." + , Space + , Quoted DoubleQuote + [ Quoted SingleQuote + [ Str "Shelob" ] + , Space + , Str "is" + , Space + , Str "my" + , Space + , Str "name." + ] + ] + , Para + [ Quoted SingleQuote + [ Str "A" ] + , Str "," + , Space + , Quoted SingleQuote + [ Str "B" ] + , Str "," + , Space + , Str "and" + , Space + , Quoted SingleQuote + [ Str "C" ] + , Space + , Str "are" + , Space + , Str "letters." + ] + , Para + [ Quoted SingleQuote + [ Str "Oak," ] + , Space + , Quoted SingleQuote + [ Str "elm," ] + , Space + , Str "and" + , Space + , Quoted SingleQuote + [ Str "beech" ] + , Space + , Str "are" + , Space + , Str "names" + , Space + , Str "of" + , Space + , Str "trees." + , SoftBreak + , Str "So" + , Space + , Str "is" + , Space + , Quoted SingleQuote + [ Str "pine." ] + ] + , Para + [ Quoted SingleQuote + [ Str "He" + , Space + , Str "said," + , Space + , Quoted DoubleQuote + [ Str "I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "go." + ] + ] + , Space + , Str "Were" + , Space + , Str "you" + , Space + , Str "alive" + , Space + , Str "in" + , Space + , Str "the" + , SoftBreak + , Str "70\8217s?" + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "quoted" + , Space + , Quoted SingleQuote + [ Code ( "", [], [] ) "code" ] + , Space + , Str "and" + , Space + , Str "a" + , Space + , Quoted DoubleQuote + [ Link + ( "", [], [] ) + [ Str "quoted", Space, Str "link" ] + ( "http://example.com/?foo=1&bar=2", "" ) + ] + , Str "." + ] + , Para + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one\8212two" + , Space + , Str "\8212" + , Space + , Str "three\8212four" + , Space + , Str "\8212" + , Space + , Str "five." + ] + , Para + [ Str "Dashes" + , Space + , Str "between" + , Space + , Str "numbers:" + , Space + , Str "5\8211\&7," + , Space + , Str "255\8211\&66," + , Space + , Str "1987\8211\&1999." + ] + , Para + [ Str "Ellipses\8230and\8230and\8230." ] + , HorizontalRule + , Header 1 + ( "latex", [], [] ) + [ Str "LaTeX" ] + , BulletList + [ + [ Plain + [ RawInline ( Format "tex" ) "\\cite[22-23]{smith.1899}" ] + ] + , + [ Plain [ Math InlineMath "2+2=4" ] ] + , + [ Plain [ Math InlineMath "x \\in y" ] ] + , + [ Plain [ Math InlineMath "\\alpha \\wedge \\omega" ] ] + , + [ Plain [ Math InlineMath "223" ] ] + , + [ Plain [ Math InlineMath "p", Str "-Tree" ] ] + , + [ Plain + [ Str "Here\8217s" + , Space + , Str "some" + , Space + , Str "display" + , Space + , Str "math:" + , SoftBreak + , Math DisplayMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}" + ] + ] + , + [ Plain + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "that" + , Space + , Str "has" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "break" + , Space + , Str "in" + , Space + , Str "it:" + , Space + , Math InlineMath "\\alpha + \\omega \\times x^2" + , Str "." + ] + ] + ] + , Para + [ Str "These" + , Space + , Str "shouldn\8217t" + , Space + , Str "be" + , Space + , Str "math:" + ] + , BulletList + [ + [ Plain + [ Str "To" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "famous" + , Space + , Str "equation," + , Space + , Str "write" + , Space + , Code + ( "", [], [] ) "$e = mc^2$" + , Str "." + ] + ] + , + [ Plain + [ Str "$22,000" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Emph + [ Str "lot" ] + , Space + , Str "of" + , Space + , Str "money." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "$34,000." + , SoftBreak + , Str "(It" + , Space + , Str "worked" + , Space + , Str "if" + , Space + , Quoted DoubleQuote + [ Str "lot" ] + , Space + , Str "is" + , Space + , Str "emphasized.)" + ] + ] + , + [ Plain + [ Str "Shoes" + , Space + , Str "($20)" + , Space + , Str "and" + , Space + , Str "socks" + , Space + , Str "($5)." + ] + ] + , + [ Plain + [ Str "Escaped" + , Space + , Code + ( "", [], [] ) "$" + , Str ":" + , Space + , Str "$73" + , Space + , Emph + [ Str "this" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "emphasized" + ] + , Space + , Str "23$." + ] + ] + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "LaTeX" + , Space + , Str "table:" + ] + , RawBlock + ( Format "tex" ) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" + , HorizontalRule + , Header 1 + ( "special-characters", [], [] ) + [ Str "Special", Space, Str "Characters" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "unicode:" + ] + , BulletList + [ + [ Plain [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] + , + [ Plain [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] + , + [ Plain [ Str "section:", Space, Str "\167" ] ] + , + [ Plain + [ Str "set", Space, Str "membership:", Space, Str "\8712" ] + ] + , + [ Plain [ Str "copyright:", Space, Str "\169" ] ] + ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] + , Para + [ Str "This", Space, Str "&", Space, Str "that." ] + , Para + [ Str "4", Space, Str "<", Space, Str "5." ] + , Para + [ Str "6", Space, Str ">", Space, Str "5." ] + , Para + [ Str "Backslash:", Space, Str "\\" ] + , Para + [ Str "Backtick:", Space, Str "`" ] + , Para + [ Str "Asterisk:", Space, Str "*" ] + , Para + [ Str "Underscore:", Space, Str "_" ] + , Para + [ Str "Left", Space, Str "brace:", Space, Str "{" ] + , Para + [ Str "Right", Space, Str "brace:", Space, Str "}" ] + , Para + [ Str "Left", Space, Str "bracket:", Space, Str "[" ] + , Para + [ Str "Right", Space, Str "bracket:", Space, Str "]" ] + , Para + [ Str "Left", Space, Str "paren:", Space, Str "(" ] + , Para + [ Str "Right", Space, Str "paren:", Space, Str ")" ] + , Para + [ Str "Greater-than:", Space, Str ">" ] + , Para + [ Str "Hash:", Space, Str "#" ] + , Para + [ Str "Period:", Space, Str "." ] + , Para + [ Str "Bang:", Space, Str "!" ] + , Para + [ Str "Plus:", Space, Str "+" ] + , Para + [ Str "Minus:", Space, Str "-" ] + , HorizontalRule + , Header 1 + ( "links", [], [] ) + [ Str "Links" ] + , Header 2 + ( "explicit", [], [] ) + [ Str "Explicit" ] + , Para + [ Str "Just" + , Space + , Str "a" + , Space + , Link + ( "", [], [] ) + [ Str "URL" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "title" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "title preceded by two spaces" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "title preceded by a tab" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "title with \"quotes\" in it" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "title with single quotes" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "with_underscore" ] + ( "/url/with_underscore", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "Email", Space, Str "link" ] + ( "mailto:nobody@nowhere.net", "" ) + ] + , Para + [ Link ( "", [], [] ) [ Str "Empty" ] ( "", "" ), Str "." ] + , Header 2 + ( "reference", [], [] ) + [ Str "Reference" ] + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "bar" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Str "With" + , Space + , Link + ( "", [], [] ) + [ Str "embedded", Space, Str "[brackets]" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "b" ] + ( "/url/", "" ) + , Space + , Str "by" + , Space + , Str "itself" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , Para + [ Str "Indented" + , Space + , Link + ( "", [], [] ) + [ Str "once" ] + ( "/url", "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link + ( "", [], [] ) + [ Str "twice" ] + ( "/url", "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link + ( "", [], [] ) + [ Str "thrice" ] + ( "/url", "" ) + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "[not][]" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , CodeBlock + ( "", [], [] ) "[not]: /url" + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "bar" ] + ( "/url/", "Title with \"quotes\" inside" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "biz" ] + ( "/url/", "Title with \"quote\" inside" ) + , Str "." + ] + , Header 2 + ( "with-ampersands", [], [] ) + [ Str "With", Space, Str "ampersands" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Link + ( "", [], [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2", "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "amersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "link" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "AT&T" ] + ( "http://att.com/", "AT&T" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "", [], [] ) + [ Str "inline", Space, Str "link" ] + ( "/script?foo=1&bar=2", "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "", [], [] ) + [ Str "inline" + , Space + , Str "link" + , Space + , Str "in" + , Space + , Str "pointy" + , Space + , Str "braces" + ] + ( "/script?foo=1&bar=2", "" ) + , Str "." + ] + , Header 2 + ( "autolinks", [], [] ) + [ Str "Autolinks" ] + , Para + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" + , Space + , Link + ( "", [ "uri" ], [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2", "" ) + ] + , BulletList + [ + [ Plain [ Str "In", Space, Str "a", Space, Str "list?" ] ] + , + [ Plain + [ Link + ( "", [ "uri" ], [] ) + [ Str "http://example.com/" ] + ( "http://example.com/", "" ) + ] + ] + , + [ Plain [ Str "It", Space, Str "should." ] ] + ] + , Para + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" + , Space + , Link + ( "", [ "email" ], [] ) + [ Str "nobody@nowhere.net" ] + ( "mailto:nobody@nowhere.net", "" ) + ] + , BlockQuote + [ Para + [ Str "Blockquoted:" + , Space + , Link + ( "", [ "uri" ], [] ) + [ Str "http://example.com/" ] + ( "http://example.com/", "" ) + ] + ] + , Para + [ Str "Auto-links" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "occur" + , Space + , Str "here:" + , Space + , Code + ( "", [], [] ) "" + ] + , CodeBlock + ( "", [], [] ) "or here: " + , HorizontalRule + , Header 1 + ( "images", [], [] ) + [ Str "Images" ] + , Para + [ Str "From" + , Space + , Quoted DoubleQuote + [ Str "Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune" + ] + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" + ] + , Para + [ Image + ( "", [], [] ) + [ Str "lalune" ] + ( "lalune.jpg", "fig:Voyage dans la Lune" ) + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space + , Image + ( "", [], [] ) + [ Str "movie" ] + ( "movie.jpg", "" ) + , Space + , Str "icon." + ] + , HorizontalRule + , Header 1 + ( "footnotes", [], [] ) + [ Str "Footnotes" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Note + [ Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "footnote." + , Space + , Str "It" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "anywhere" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "footnote" + , SoftBreak + , Str "reference." + , Space + , Str "It" + , Space + , Str "need" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "placed" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "document." + ] + ] + , Space + , Str "and" + , Space + , Str "another." + , Note + [ Para + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "long" + , Space + , Str "note." + , Space + , Str "This" + , Space + , Str "one" + , Space + , Str "contains" + , Space + , Str "multiple" + , SoftBreak + , Str "blocks." + ] + , Para + [ Str "Subsequent" + , Space + , Str "blocks" + , Space + , Str "are" + , Space + , Str "indented" + , Space + , Str "to" + , Space + , Str "show" + , Space + , Str "that" + , Space + , Str "they" + , Space + , Str "belong" + , Space + , Str "to" + , Space + , Str "the" + , SoftBreak + , Str "footnote" + , Space + , Str "(as" + , Space + , Str "with" + , Space + , Str "list" + , Space + , Str "items)." + ] + , CodeBlock + ( "", [], [] ) " { }" + , Para + [ Str "If" + , Space + , Str "you" + , Space + , Str "want," + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "indent" + , Space + , Str "every" + , Space + , Str "line," + , Space + , Str "but" + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "be" + , SoftBreak + , Str "lazy" + , Space + , Str "and" + , Space + , Str "just" + , Space + , Str "indent" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "line" + , Space + , Str "of" + , Space + , Str "each" + , Space + , Str "block." + ] + ] + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Emph + [ Str "not" ] + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Space + , Str "because" + , Space + , Str "it" + , SoftBreak + , Str "contains" + , Space + , Str "a" + , Space + , Str "space.[^my" + , Space + , Str "note]" + , Space + , Str "Here" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "inline" + , Space + , Str "note." + , Note + [ Para + [ Str "This" + , SoftBreak + , Str "is" + , Space + , Emph + [ Str "easier" ] + , Space + , Str "to" + , Space + , Str "type." + , Space + , Str "Inline" + , Space + , Str "notes" + , Space + , Str "may" + , Space + , Str "contain" + , SoftBreak + , Link + ( "", [], [] ) + [ Str "links" ] + ( "http://google.com", "" ) + , Space + , Str "and" + , Space + , Code + ( "", [], [] ) "]" + , Space + , Str "verbatim" + , Space + , Str "characters," + , SoftBreak + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str "[bracketed" + , Space + , Str "text]." + ] + ] + ] + , BlockQuote + [ Para + [ Str "Notes" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "in" + , Space + , Str "quotes." + , Note + [ Para [ Str "In", Space, Str "quote." ] ] + ] + ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain + [ Str "And" + , Space + , Str "in" + , Space + , Str "list" + , Space + , Str "items." + , Note + [ Para [ Str "In", Space, Str "list." ] ] + ] + ] + ] + , Para + [ Str "This" + , Space + , Str "paragraph" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "note," + , Space + , Str "as" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "indented." + ] + ] diff --git a/test/textile-reader.native b/test/textile-reader.native index e691e41fc..34dfa7ca3 100644 --- a/test/textile-reader.native +++ b/test/textile-reader.native @@ -1,243 +1,1317 @@ -Pandoc (Meta {unMeta = fromList []}) -[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-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"] -,Header 6 ("level-6",[],[]) [Str "Level",Space,Str "6"] -,Header 1 ("paragraphs",[],[]) [Str "Paragraphs"] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "regular",Space,Str "paragraph."] -,Para [Str "Line",Space,Str "breaks",Space,Str "are",Space,Str "preserved",Space,Str "in",Space,Str "textile,",Space,Str "so",Space,Str "you",Space,Str "can",Space,Str "not",Space,Str "wrap",Space,Str "your",Space,Str "very",LineBreak,Str "long",Space,Str "paragraph",Space,Str "with",Space,Str "your",Space,Str "favourite",Space,Str "text",Space,Str "editor",Space,Str "and",Space,Str "have",Space,Str "it",Space,Str "rendered",LineBreak,Str "with",Space,Str "no",Space,Str "break."] -,Para [Str "Here\8217s",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet."] -,BulletList - [[Plain [Str "criminey."]]] -,Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "paragraph",Space,Str "break",Space,Str "between",Space,Str "here"] -,Para [Str "and",Space,Str "here."] -,Para [Str "pandoc",Space,Str "converts",Space,Str "textile."] -,Header 1 ("block-quotes",[],[]) [Str "Block",Space,Str "Quotes"] -,BlockQuote - [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "famous",Space,Str "quote",Space,Str "from",Space,Str "somebody.",Space,Str "He",Space,Str "had",Space,Str "a",Space,Str "lot",Space,Str "of",Space,Str "things",Space,Str "to",LineBreak,Str "say,",Space,Str "so",Space,Str "the",Space,Str "text",Space,Str "is",Space,Str "really",Space,Str "really",Space,Str "long",Space,Str "and",Space,Str "spans",Space,Str "on",Space,Str "multiple",Space,Str "lines."]] -,Para [Str "And",Space,Str "a",Space,Str "following",Space,Str "paragraph."] -,Header 1 ("code-blocks",[],[]) [Str "Code",Space,Str "Blocks"] -,Para [Str "Code:"] -,CodeBlock ("",[],[]) " ---- (should be four hyphens)\n\n sub status {\n print \"working\";\n }\n\n this code block is indented by one tab" -,Para [Str "And:"] -,CodeBlock ("",[],[]) " this code block is indented by two tabs\n\n These should not be escaped: \\$ \\\\ \\> \\[ \\{" -,CodeBlock ("",[],[]) "Code block with .bc\n continued\n @",Str ",",Space,Code ("",[],[]) "@",Str "."] -,Header 1 ("notextile",[],[]) [Str "Notextile"] -,Para [Str "A",Space,Str "block",Space,Str "of",Space,Str "text",Space,Str "can",Space,Str "be",Space,Str "protected",Space,Str "with",Space,Str "notextile",Space,Str ":"] -,Para [Str "\nNo *bold* and\n* no bullet\n"] -,Para [Str "and",Space,Str "inlines",Space,Str "can",Space,Str "be",Space,Str "protected",Space,Str "with",Space,Str "double *equals (=)* markup."] -,Header 1 ("lists",[],[]) [Str "Lists"] -,Header 2 ("unordered",[],[]) [Str "Unordered"] -,Para [Str "Asterisks",Space,Str "tight:"] -,BulletList - [[Plain [Str "asterisk",Space,Str "1"]] - ,[Plain [Str "asterisk",Space,Str "2"]] - ,[Plain [Str "asterisk",Space,Str "3"]]] -,Para [Str "With",Space,Str "line",Space,Str "breaks:"] -,BulletList - [[Plain [Str "asterisk",Space,Str "1",LineBreak,Str "newline"]] - ,[Plain [Str "asterisk",Space,Str "2"]]] -,Header 2 ("ordered",[],[]) [Str "Ordered"] -,Para [Str "Tight:"] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "First"]] - ,[Plain [Str "Second"]] - ,[Plain [Str "Third"]]] -,Header 2 ("nested",[],[]) [Str "Nested"] -,BulletList - [[Plain [Str "ui",Space,Str "1"] - ,BulletList - [[Plain [Str "ui",Space,Str "1.1"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "oi",Space,Str "1.1.1"]] - ,[Plain [Str "oi",Space,Str "1.1.2"]]]] - ,[Plain [Str "ui",Space,Str "1.2"]]]] - ,[Plain [Str "ui",Space,Str "2"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "oi",Space,Str "2.1"] - ,BulletList - [[Plain [Str "ui",Space,Str "2.1.1"]] - ,[Plain [Str "ui",Space,Str "2.1.2"]]]]]]] -,Header 2 ("issue-1500",[],[]) [Str "Issue",Space,Str "#1500"] -,BulletList - [[Plain [Str "one"]] - ,[Plain [Str "two",LineBreak,Str "->",Space,Str "and",Space,Str "more"]]] -,Header 2 ("issue-1513",[],[]) [Str "Issue",Space,Str "#1513"] -,Para [Str "List:"] -,BulletList - [[Plain [Str "one"]] - ,[Plain [Str "two"]]] -,Header 2 ("definition-list",[],[]) [Str "Definition",Space,Str "List"] -,DefinitionList - [([Str "coffee"], - [[Plain [Str "Hot",Space,Str "and",Space,Str "black"]]]) - ,([Str "tea"], - [[Plain [Str "Also",Space,Str "hot,",Space,Str "but",Space,Str "a",Space,Str "little",Space,Str "less",Space,Str "black"]]]) - ,([Str "milk"], - [[Para [Str "Nourishing",Space,Str "beverage",Space,Str "for",Space,Str "baby",Space,Str "cows."] - ,Para [Str "Cold",Space,Str "drink",Space,Str "that",Space,Str "goes",Space,Str "great",Space,Str "with",Space,Str "cookies."]]]) - ,([Str "beer"], - [[Plain [Str "fresh",Space,Str "and",Space,Str "bitter"]]])] -,Header 1 ("inline-markup",[],[]) [Str "Inline",Space,Str "Markup"] -,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str ".",LineBreak,Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str ".",LineBreak,Str "This",Space,Str "is",Space,Underline [Str "inserted"],Str ",",Space,Str "and",Space,Str "this",Space,Str "is",Space,Strikeout [Str "deleted"],Str ".",LineBreak,Str "Hyphenated-words-are-ok,",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str "strange_underscore_notation.",LineBreak,Str "A",Space,Link ("",[],[]) [Strong [Str "strong",Space,Str "link"]] ("http://www.foobar.com",""),Str "."] -,Para [Emph [Strong [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]],LineBreak,Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Space,Str "and",Space,Emph [Strong [Str "that",Space,Str "one"]],Str ".",LineBreak,Strikeout [Str "This",Space,Str "is",Space,Str "strikeout",Space,Str "and",Space,Strong [Str "strong"]]] -,Para [Str "Superscripts:",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Space,Superscript [Strong [Str "hello"]],Space,Str "a",Superscript [Str "hello",Space,Str "there"],Str ".",LineBreak,Str "Subscripts:",Space,Subscript [Str "here"],Space,Str "H",Space,Subscript [Str "2"],Str "O,",Space,Str "H",Space,Subscript [Str "23"],Str "O,",Space,Str "H",Space,Subscript [Str "many",Space,Str "of",Space,Str "them"],Str "O."] -,Para [Str "Dashes",Space,Str ":",Space,Str "How",Space,Str "cool",Space,Str "\8212",Space,Str "automatic",Space,Str "dashes."] -,Para [Str "Ellipses",Space,Str ":",Space,Str "He",Space,Str "thought",Space,Str "and",Space,Str "thought",Space,Str "\8230",Space,Str "and",Space,Str "then",Space,Str "thought",Space,Str "some",Space,Str "more."] -,Para [Str "Quotes",Space,Str "and",Space,Str "apostrophes",Space,Str ":",Space,Quoted DoubleQuote [Str "I\8217d",Space,Str "like",Space,Str "to",Space,Str "thank",Space,Str "you"],Space,Str "for",Space,Str "example."] -,Header 1 ("links",[],[]) [Str "Links"] -,Header 2 ("explicit",[],[]) [Str "Explicit"] -,Para [Str "Just",Space,Str "a",Space,Link ("",[],[]) [Str "url"] ("http://www.url.com","")] -,Para [Link ("",[],[]) [Str "Email",Space,Str "link"] ("mailto:nobody@nowhere.net","")] -,Para [Quoted DoubleQuote [Str "not",Space,Str "a",Space,Str "link"],Str ":",Space,Str "foo"] -,Para [Str "Automatic",Space,Str "linking",Space,Str "to",Space,Link ("",[],[]) [Str "http://www.example.com"] ("http://www.example.com",""),Str "."] -,Para [Link ("",[],[]) [Str "Example"] ("http://www.example.com/",""),Str ":",Space,Str "Example",Space,Str "of",Space,Str "a",Space,Str "link",Space,Str "followed",Space,Str "by",Space,Str "a",Space,Str "colon."] -,Para [Str "A",Space,Str "link",Link ("",[],[]) [Str "with",Space,Str "brackets"] ("http://www.example.com",""),Str "and",Space,Str "no",Space,Str "spaces."] -,Header 1 ("tables",[],[]) [Str "Tables"] -,Para [Str "Textile",Space,Str "allows",Space,Str "tables",Space,Str "with",Space,Str "and",Space,Str "without",Space,Str "headers",Space,Str ":"] -,Header 2 ("without-headers",[],[]) [Str "Without",Space,Str "headers"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "name"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "age"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "sex"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "joan"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "24"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "archie"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "29"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "m"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "bella"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "45"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "and",Space,Str "some",Space,Str "text",Space,Str "following",Space,Str "\8230"] -,Header 2 ("with-headers",[],[]) [Str "With",Space,Str "headers"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "name"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "age"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "sex"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "joan"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "24"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "archie"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "29"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "m"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "bella"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "45"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Header 1 ("images",[],[]) [Str "Images"] -,Para [Str "Textile",Space,Str "inline",Space,Str "image",Space,Str "syntax,",Space,Str "like",LineBreak,Str "here",Space,Image ("",[],[]) [Str "this is the alt text"] ("this_is_an_image.png","this is the alt text"),LineBreak,Str "and",Space,Str "here",Space,Image ("",[],[]) [Str ""] ("this_is_an_image.png",""),Str "."] -,Header 1 ("attributes",[],[]) [Str "Attributes"] -,Header 2 ("ident",["bar","foo"],[("style","color:red;"),("lang","en")]) [Str "HTML",Space,Str "and",Space,Str "CSS",Space,Str "attributes",Space,Str "are",Space,Str "parsed",Space,Str "in",Space,Str "headers."] -,Header 2 ("centered",[],[("style","text-align:center;")]) [Str "Centered"] -,Header 2 ("right",[],[("style","text-align:right;")]) [Str "Right"] -,Header 2 ("justified",[],[("lang","en"),("style","color:blue;text-align:justify;")]) [Str "Justified"] -,Para [Str "as",Space,Str "well",Space,Str "as",Space,Strong [Span ("",["foo"],[]) [Str "inline",Space,Str "attributes"]],Space,Str "of",Space,Span ("",[],[("style","color:red;")]) [Str "all",Space,Str "kind"]] -,Para [Str "and",Space,Str "paragraph",Space,Str "attributes,",Space,Str "and",Space,Str "table",Space,Str "attributes."] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "name"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "age"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "sex"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "joan"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "24"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Emph [Str "(class#id)",Space,Str "emph"]] -,Para [Emph [Str "(no",Space,Str "class#id)",Space,Str "emph"]] -,Header 1 ("entities",[],[]) [Str "Entities"] -,Para [Str "*",LineBreak,Str "&"] -,Header 1 ("raw-html",[],[]) [Str "Raw",Space,Str "HTML"] -,Para [Str "However,",Space,RawInline (Format "html") "",Space,Str "raw",Space,Str "HTML",Space,Str "inlines",Space,RawInline (Format "html") "",Space,Str "are",Space,Str "accepted,",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str ":"] -,RawBlock (Format "html") "
" -,Para [Str "any",Space,Strong [Str "Raw",Space,Str "HTML",Space,Str "Block"],Space,Str "with",Space,Str "bold"] -,RawBlock (Format "html") "
" -,Para [Str "Html",Space,Str "blocks",Space,Str "can"] -,RawBlock (Format "html") "
" -,Para [Str "interrupt",Space,Str "paragraphs"] -,RawBlock (Format "html") "
" -,Para [Str "as",Space,Str "well."] -,Para [Str "Can",Space,Str "you",Space,Str "prove",Space,Str "that",Space,Str "2",Space,Str "<",Space,Str "3",Space,Str "?"] -,Header 1 ("acronyms-and-marks",[],[]) [Str "Acronyms",Space,Str "and",Space,Str "marks"] -,Para [Str "PBS (Public Broadcasting System)"] -,Para [Str "Hi\8482"] -,Para [Str "Hi",Space,Str "\8482"] -,Para [Str "\174",Space,Str "Hi\174"] -,Para [Str "Hi\169\&2008",Space,Str "\169",Space,Str "2008"] -,Header 1 ("footnotes",[],[]) [Str "Footnotes"] -,Para [Str "A",Space,Str "note.",Note [Para [Str "The",Space,Str "note",LineBreak,Str "is",Space,Str "here!"]],Space,Str "Another",Space,Str "note",Note [Para [Str "Other",Space,Str "note."]],Str "."] -,Header 1 ("comment-blocks",[],[]) [Str "Comment",Space,Str "blocks"] -,Para [Str "not",Space,Str "a",Space,Str "comment."]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ 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-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" ] + , Header 6 + ( "level-6", [], [] ) + [ Str "Level", Space, Str "6" ] + , Header 1 + ( "paragraphs", [], [] ) + [ Str "Paragraphs" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "Line" + , Space + , Str "breaks" + , Space + , Str "are" + , Space + , Str "preserved" + , Space + , Str "in" + , Space + , Str "textile," + , Space + , Str "so" + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "not" + , Space + , Str "wrap" + , Space + , Str "your" + , Space + , Str "very" + , LineBreak + , Str "long" + , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "your" + , Space + , Str "favourite" + , Space + , Str "text" + , Space + , Str "editor" + , Space + , Str "and" + , Space + , Str "have" + , Space + , Str "it" + , Space + , Str "rendered" + , LineBreak + , Str "with" + , Space + , Str "no" + , Space + , Str "break." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + ] + , BulletList + [ [ Plain [ Str "criminey." ] ] ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "break" + , Space + , Str "between" + , Space + , Str "here" + ] + , Para + [ Str "and", Space, Str "here." ] + , Para + [ Str "pandoc", Space, Str "converts", Space, Str "textile." ] + , Header 1 + ( "block-quotes", [], [] ) + [ Str "Block", Space, Str "Quotes" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "famous" + , Space + , Str "quote" + , Space + , Str "from" + , Space + , Str "somebody." + , Space + , Str "He" + , Space + , Str "had" + , Space + , Str "a" + , Space + , Str "lot" + , Space + , Str "of" + , Space + , Str "things" + , Space + , Str "to" + , LineBreak + , Str "say," + , Space + , Str "so" + , Space + , Str "the" + , Space + , Str "text" + , Space + , Str "is" + , Space + , Str "really" + , Space + , Str "really" + , Space + , Str "long" + , Space + , Str "and" + , Space + , Str "spans" + , Space + , Str "on" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + , Para + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] + , Header 1 + ( "code-blocks", [], [] ) + [ Str "Code", Space, Str "Blocks" ] + , Para + [ Str "Code:" ] + , CodeBlock + ( "" + , [] + , [] + ) " ---- (should be four hyphens)\n\n sub status {\n print \"working\";\n }\n\n this code block is indented by one tab" + , Para + [ Str "And:" ] + , CodeBlock + ( "" + , [] + , [] + ) " this code block is indented by two tabs\n\n These should not be escaped: \\$ \\\\ \\> \\[ \\{" + , CodeBlock + ( "", [], [] ) "Code block with .bc\n continued\n @" + , Str "," + , Space + , Code + ( "", [], [] ) "@" + , Str "." + ] + , Header 1 + ( "notextile", [], [] ) + [ Str "Notextile" ] + , Para + [ Str "A" + , Space + , Str "block" + , Space + , Str "of" + , Space + , Str "text" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "protected" + , Space + , Str "with" + , Space + , Str "notextile" + , Space + , Str ":" + ] + , Para + [ Str "\nNo *bold* and\n* no bullet\n" ] + , Para + [ Str "and" + , Space + , Str "inlines" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "protected" + , Space + , Str "with" + , Space + , Str "double *equals (=)* markup." + ] + , Header 1 + ( "lists", [], [] ) + [ Str "Lists" ] + , Header 2 + ( "unordered", [], [] ) + [ Str "Unordered" ] + , Para + [ Str "Asterisks", Space, Str "tight:" ] + , BulletList + [ + [ Plain [ Str "asterisk", Space, Str "1" ] ] + , + [ Plain [ Str "asterisk", Space, Str "2" ] ] + , + [ Plain [ Str "asterisk", Space, Str "3" ] ] + ] + , Para + [ Str "With", Space, Str "line", Space, Str "breaks:" ] + , BulletList + [ + [ Plain + [ Str "asterisk", Space, Str "1", LineBreak, Str "newline" ] + ] + , + [ Plain [ Str "asterisk", Space, Str "2" ] ] + ] + , Header 2 + ( "ordered", [], [] ) + [ Str "Ordered" ] + , Para + [ Str "Tight:" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "First" ] ] + , + [ Plain [ Str "Second" ] ] + , + [ Plain [ Str "Third" ] ] + ] + , Header 2 + ( "nested", [], [] ) + [ Str "Nested" ] + , BulletList + [ + [ Plain + [ Str "ui", Space, Str "1" ] + , BulletList + [ + [ Plain + [ Str "ui", Space, Str "1.1" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "oi", Space, Str "1.1.1" ] ] + , + [ Plain [ Str "oi", Space, Str "1.1.2" ] ] + ] + ] + , + [ Plain [ Str "ui", Space, Str "1.2" ] ] + ] + ] + , + [ Plain + [ Str "ui", Space, Str "2" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "oi", Space, Str "2.1" ] + , BulletList + [ + [ Plain [ Str "ui", Space, Str "2.1.1" ] ] + , + [ Plain [ Str "ui", Space, Str "2.1.2" ] ] + ] + ] + ] + ] + ] + , Header 2 + ( "issue-1500", [], [] ) + [ Str "Issue", Space, Str "#1500" ] + , BulletList + [ + [ Plain [ Str "one" ] ] + , + [ Plain + [ Str "two" + , LineBreak + , Str "->" + , Space + , Str "and" + , Space + , Str "more" + ] + ] + ] + , Header 2 + ( "issue-1513", [], [] ) + [ Str "Issue", Space, Str "#1513" ] + , Para + [ Str "List:" ] + , BulletList + [ [ Plain [ Str "one" ] ], [ Plain [ Str "two" ] ] ] + , Header 2 + ( "definition-list", [], [] ) + [ Str "Definition", Space, Str "List" ] + , DefinitionList + [ + ( + [ Str "coffee" ] + , + [ + [ Plain [ Str "Hot", Space, Str "and", Space, Str "black" ] ] + ] + ) + , + ( + [ Str "tea" ] + , + [ + [ Plain + [ Str "Also" + , Space + , Str "hot," + , Space + , Str "but" + , Space + , Str "a" + , Space + , Str "little" + , Space + , Str "less" + , Space + , Str "black" + ] + ] + ] + ) + , + ( + [ Str "milk" ] + , + [ + [ Para + [ Str "Nourishing" + , Space + , Str "beverage" + , Space + , Str "for" + , Space + , Str "baby" + , Space + , Str "cows." + ] + , Para + [ Str "Cold" + , Space + , Str "drink" + , Space + , Str "that" + , Space + , Str "goes" + , Space + , Str "great" + , Space + , Str "with" + , Space + , Str "cookies." + ] + ] + ] + ) + , + ( + [ Str "beer" ] + , + [ + [ Plain + [ Str "fresh", Space, Str "and", Space, Str "bitter" ] + ] + ] + ) + ] + , Header 1 + ( "inline-markup", [], [] ) + [ Str "Inline", Space, Str "Markup" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph + [ Str "is", Space, Str "this" ] + , Str "." + , LineBreak + , Str "This" + , Space + , Str "is" + , Space + , Strong + [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Strong + [ Str "is", Space, Str "this" ] + , Str "." + , LineBreak + , Str "This" + , Space + , Str "is" + , Space + , Underline + [ Str "inserted" ] + , Str "," + , Space + , Str "and" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Strikeout + [ Str "deleted" ] + , Str "." + , LineBreak + , Str "Hyphenated-words-are-ok," + , Space + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str "strange_underscore_notation." + , LineBreak + , Str "A" + , Space + , Link + ( "", [], [] ) + [ Strong [ Str "strong", Space, Str "link" ] ] + ( "http://www.foobar.com", "" ) + , Str "." + ] + , Para + [ Emph + [ Strong + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + , LineBreak + , Str "So" + , Space + , Str "is" + , Space + , Strong + [ Emph [ Str "this" ] ] + , Space + , Str "word" + , Space + , Str "and" + , Space + , Emph + [ Strong [ Str "that", Space, Str "one" ] ] + , Str "." + , LineBreak + , Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Str "strikeout" + , Space + , Str "and" + , Space + , Strong + [ Str "strong" ] + ] + ] + , Para + [ Str "Superscripts:" + , Space + , Str "a" + , Superscript + [ Str "bc" ] + , Str "d" + , Space + , Str "a" + , Space + , Superscript + [ Strong [ Str "hello" ] ] + , Space + , Str "a" + , Superscript + [ Str "hello", Space, Str "there" ] + , Str "." + , LineBreak + , Str "Subscripts:" + , Space + , Subscript + [ Str "here" ] + , Space + , Str "H" + , Space + , Subscript + [ Str "2" ] + , Str "O," + , Space + , Str "H" + , Space + , Subscript + [ Str "23" ] + , Str "O," + , Space + , Str "H" + , Space + , Subscript + [ Str "many", Space, Str "of", Space, Str "them" ] + , Str "O." + ] + , Para + [ Str "Dashes" + , Space + , Str ":" + , Space + , Str "How" + , Space + , Str "cool" + , Space + , Str "\8212" + , Space + , Str "automatic" + , Space + , Str "dashes." + ] + , Para + [ Str "Ellipses" + , Space + , Str ":" + , Space + , Str "He" + , Space + , Str "thought" + , Space + , Str "and" + , Space + , Str "thought" + , Space + , Str "\8230" + , Space + , Str "and" + , Space + , Str "then" + , Space + , Str "thought" + , Space + , Str "some" + , Space + , Str "more." + ] + , Para + [ Str "Quotes" + , Space + , Str "and" + , Space + , Str "apostrophes" + , Space + , Str ":" + , Space + , Quoted DoubleQuote + [ Str "I\8217d" + , Space + , Str "like" + , Space + , Str "to" + , Space + , Str "thank" + , Space + , Str "you" + ] + , Space + , Str "for" + , Space + , Str "example." + ] + , Header 1 + ( "links", [], [] ) + [ Str "Links" ] + , Header 2 + ( "explicit", [], [] ) + [ Str "Explicit" ] + , Para + [ Str "Just" + , Space + , Str "a" + , Space + , Link + ( "", [], [] ) + [ Str "url" ] + ( "http://www.url.com", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "Email", Space, Str "link" ] + ( "mailto:nobody@nowhere.net", "" ) + ] + , Para + [ Quoted DoubleQuote + [ Str "not", Space, Str "a", Space, Str "link" ] + , Str ":" + , Space + , Str "foo" + ] + , Para + [ Str "Automatic" + , Space + , Str "linking" + , Space + , Str "to" + , Space + , Link + ( "", [], [] ) + [ Str "http://www.example.com" ] + ( "http://www.example.com", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "Example" ] + ( "http://www.example.com/", "" ) + , Str ":" + , Space + , Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "followed" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "colon." + ] + , Para + [ Str "A" + , Space + , Str "link" + , Link + ( "", [], [] ) + [ Str "with", Space, Str "brackets" ] + ( "http://www.example.com", "" ) + , Str "and" + , Space + , Str "no" + , Space + , Str "spaces." + ] + , Header 1 + ( "tables", [], [] ) + [ Str "Tables" ] + , Para + [ Str "Textile" + , Space + , Str "allows" + , Space + , Str "tables" + , Space + , Str "with" + , Space + , Str "and" + , Space + , Str "without" + , Space + , Str "headers" + , Space + , Str ":" + ] + , Header 2 + ( "without-headers", [], [] ) + [ Str "Without", Space, Str "headers" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "name" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "age" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "sex" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "joan" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "24" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "archie" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "29" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "m" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "bella" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "45" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "and" + , Space + , Str "some" + , Space + , Str "text" + , Space + , Str "following" + , Space + , Str "\8230" + ] + , Header 2 + ( "with-headers", [], [] ) + [ Str "With", Space, Str "headers" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "name" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "age" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "sex" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "joan" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "24" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "archie" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "29" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "m" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "bella" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "45" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Header 1 + ( "images", [], [] ) + [ Str "Images" ] + , Para + [ Str "Textile" + , Space + , Str "inline" + , Space + , Str "image" + , Space + , Str "syntax," + , Space + , Str "like" + , LineBreak + , Str "here" + , Space + , Image + ( "", [], [] ) + [ Str "this is the alt text" ] + ( "this_is_an_image.png", "this is the alt text" ) + , LineBreak + , Str "and" + , Space + , Str "here" + , Space + , Image + ( "", [], [] ) + [ Str "" ] + ( "this_is_an_image.png", "" ) + , Str "." + ] + , Header 1 + ( "attributes", [], [] ) + [ Str "Attributes" ] + , Header 2 + ( "ident" + , + [ "bar", "foo" ] + , + [ ( "style", "color:red;" ), ( "lang", "en" ) ] + ) + [ Str "HTML" + , Space + , Str "and" + , Space + , Str "CSS" + , Space + , Str "attributes" + , Space + , Str "are" + , Space + , Str "parsed" + , Space + , Str "in" + , Space + , Str "headers." + ] + , Header 2 + ( "centered", [], [ ( "style", "text-align:center;" ) ] ) + [ Str "Centered" ] + , Header 2 + ( "right", [], [ ( "style", "text-align:right;" ) ] ) + [ Str "Right" ] + , Header 2 + ( "justified" + , [] + , + [ + ( "lang", "en" ) + , + ( "style", "color:blue;text-align:justify;" ) + ] + ) + [ Str "Justified" ] + , Para + [ Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Strong + [ Span + ( "", [ "foo" ], [] ) + [ Str "inline", Space, Str "attributes" ] + ] + , Space + , Str "of" + , Space + , Span + ( "", [], [ ( "style", "color:red;" ) ] ) + [ Str "all", Space, Str "kind" ] + ] + , Para + [ Str "and" + , Space + , Str "paragraph" + , Space + , Str "attributes," + , Space + , Str "and" + , Space + , Str "table" + , Space + , Str "attributes." + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "name" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "age" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "sex" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "joan" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "24" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Emph [ Str "(class#id)", Space, Str "emph" ] ] + , Para + [ Emph [ Str "(no", Space, Str "class#id)", Space, Str "emph" ] ] + , Header 1 + ( "entities", [], [] ) + [ Str "Entities" ] + , Para + [ Str "*", LineBreak, Str "&" ] + , Header 1 + ( "raw-html", [], [] ) + [ Str "Raw", Space, Str "HTML" ] + , Para + [ Str "However," + , Space + , RawInline + ( Format "html" ) "" + , Space + , Str "raw" + , Space + , Str "HTML" + , Space + , Str "inlines" + , Space + , RawInline + ( Format "html" ) "" + , Space + , Str "are" + , Space + , Str "accepted," + , Space + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str ":" + ] + , RawBlock + ( Format "html" ) "
" + , Para + [ Str "any" + , Space + , Strong + [ Str "Raw", Space, Str "HTML", Space, Str "Block" ] + , Space + , Str "with" + , Space + , Str "bold" + ] + , RawBlock + ( Format "html" ) "
" + , Para + [ Str "Html", Space, Str "blocks", Space, Str "can" ] + , RawBlock + ( Format "html" ) "
" + , Para + [ Str "interrupt", Space, Str "paragraphs" ] + , RawBlock + ( Format "html" ) "
" + , Para + [ Str "as", Space, Str "well." ] + , Para + [ Str "Can" + , Space + , Str "you" + , Space + , Str "prove" + , Space + , Str "that" + , Space + , Str "2" + , Space + , Str "<" + , Space + , Str "3" + , Space + , Str "?" + ] + , Header 1 + ( "acronyms-and-marks", [], [] ) + [ Str "Acronyms", Space, Str "and", Space, Str "marks" ] + , Para + [ Str "PBS (Public Broadcasting System)" ] + , Para + [ Str "Hi\8482" ] + , Para + [ Str "Hi", Space, Str "\8482" ] + , Para + [ Str "\174", Space, Str "Hi\174" ] + , Para + [ Str "Hi\169\&2008", Space, Str "\169", Space, Str "2008" ] + , Header 1 + ( "footnotes", [], [] ) + [ Str "Footnotes" ] + , Para + [ Str "A" + , Space + , Str "note." + , Note + [ Para + [ Str "The" + , Space + , Str "note" + , LineBreak + , Str "is" + , Space + , Str "here!" + ] + ] + , Space + , Str "Another" + , Space + , Str "note" + , Note + [ Para [ Str "Other", Space, Str "note." ] ] + , Str "." + ] + , Header 1 + ( "comment-blocks", [], [] ) + [ Str "Comment", Space, Str "blocks" ] + , Para + [ Str "not", Space, Str "a", Space, Str "comment." ] + ] diff --git a/test/tikiwiki-reader.native b/test/tikiwiki-reader.native index 0c34f60ce..eb10421da 100644 --- a/test/tikiwiki-reader.native +++ b/test/tikiwiki-reader.native @@ -1,212 +1,761 @@ -Pandoc (Meta {unMeta = fromList []}) -[Header 1 ("header",[],[]) [Str "header"] -,Header 2 ("header-level-two",[],[]) [Str "header",Space,Str "level",Space,Str "two"] -,Header 3 ("header-level-3",[],[]) [Str "header",Space,Str "level",Space,Str "3"] -,Header 4 ("header-_level_-four",[],[]) [Str "header",Space,Str "_level_",Space,Str "four"] -,Header 5 ("header-level-5",[],[]) [Str "header",Space,Str "level",Space,Str "5"] -,Header 6 ("header-level-6",[],[]) [Str "header",Space,Str "level",Space,Str "6"] -,Para [Str "!!!!!!!",Space,Str "not",Space,Str "a",Space,Str "header"] -,Para [Str "--++",Space,Str "not",Space,Str "a",Space,Str "header"] -,Header 1 ("emph-and-strong",[],[]) [Str "emph",Space,Str "and",Space,Str "strong"] -,Para [Emph [Str "emph"],Space,Strong [Str "strong"]] -,Para [Emph [Strong [Str "strong",Space,Str "and",Space,Str "emph",Space,Str "1"]]] -,Para [Strong [Emph [Str "strong",Space,Str "and",Space,Str "emph",Space,Str "2"]]] -,Para [Strong [Emph [Str "emph",Space,Str "inside"],Space,Str "strong"]] -,Para [Strong [Str "strong",Space,Str "with",Space,Emph [Str "emph"]]] -,Para [Emph [Strong [Str "strong",Space,Str "inside"],Space,Str "emph"]] -,Header 1 ("horizontal-rule",[],[]) [Str "horizontal",Space,Str "rule"] -,Para [Str "top"] -,HorizontalRule -,Para [Str "bottom"] -,HorizontalRule -,Header 1 ("nop",[],[]) [Str "nop"] -,Para [Str "__not emph__"] -,Header 1 ("entities",[],[]) [Str "entities"] -,Para [Str "hi",Space,Str "&",Space,Str "low"] -,Para [Str "hi",Space,Str "&",Space,Str "low"] -,Para [Str "G\246del"] -,Para [Str "\777\2730"] -,Header 1 ("linebreaks",[],[]) [Str "linebreaks"] -,Para [Str "hi",LineBreak,Str "there"] -,Para [Str "hi",LineBreak,Str "there"] -,Header 1 ("inline-code",[],[]) [Str "inline",Space,Str "code"] -,Para [Code ("",[],[]) "*\8594*",Space,Code ("",[],[]) "typed",Space,Code ("",[],[]) ">>="] -,Header 1 ("code-blocks",[],[]) [Str "code",Space,Str "blocks"] -,CodeBlock ("",[],[]) "\ncase xs of\n (_:_) -> reverse xs\n [] -> ['*']\n" -,CodeBlock ("",["haskell"],[("colors","haskell"),("ln","0")]) "\ncase xs of\n (_:_) -> reverse xs\n [] -> ['*']\n" -,Header 1 ("external-links",[],[]) [Str "external",Space,Str "links"] -,Para [Link ("",[],[]) [Emph [Str "Google"],Space,Str "search",Space,Str "engine"] ("http://google.com","")] -,Para [Link ("",[],[]) [Str "http://pandoc.org"] ("http://pandoc.org","")] -,Para [Link ("",[],[]) [Str "http://google.com"] ("http://google.com",""),Space,Link ("",[],[]) [Str "http://yahoo.com"] ("http://yahoo.com","")] -,Para [Link ("",[],[]) [Str "email",Space,Str "me"] ("mailto:info@example.org","")] -,Para [Str "http://google.com"] -,Para [Str "info@example.org"] -,Header 1 ("lists",[],[]) [Str "lists"] -,BulletList - [[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"] - ,BulletList - [[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"]]]] - ,[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"]] - ,[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"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[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."]]] -,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"]]]) - ,([Str "item",Space,Str "2"], - [[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"]]]])] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "one"]] - ,[Plain [Str "two"] - ,BulletList - [[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"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[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 ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ""]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ""]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Apple"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Bread"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Pie"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Butter"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Ice",Space,Str "cream"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ""]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ""]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Apple"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Bread"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Pie"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Strong [Str "Butter"]]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Ice",Space,Str "cream"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ""]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ""]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Apple"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Bread",LineBreak,LineBreak,Str "and",Space,Str "cheese"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Pie",LineBreak,LineBreak,Strong [Str "apple"],Space,Str "and",Space,Emph [Str "carrot"],Space]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ""]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ""]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ""]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Space,Str "Orange",Space]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Space,Str "Apple",Space]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Space,Str "more"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Space,Str "Bread",Space]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Space,Str "Pie",Space]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Space,Str "more"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Space,Str "Butter",Space]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Space,Str "Ice",Space,Str "cream",Space]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Space,Str "and",Space,Str "more",Space]]]])] - (TableFoot ("",[],[]) - [])] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Header 1 + ( "header", [], [] ) + [ Str "header" ] + , Header 2 + ( "header-level-two", [], [] ) + [ Str "header", Space, Str "level", Space, Str "two" ] + , Header 3 + ( "header-level-3", [], [] ) + [ Str "header", Space, Str "level", Space, Str "3" ] + , Header 4 + ( "header-_level_-four", [], [] ) + [ Str "header", Space, Str "_level_", Space, Str "four" ] + , Header 5 + ( "header-level-5", [], [] ) + [ Str "header", Space, Str "level", Space, Str "5" ] + , Header 6 + ( "header-level-6", [], [] ) + [ Str "header", Space, Str "level", Space, Str "6" ] + , Para + [ Str "!!!!!!!" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + ] + , Para + [ Str "--++" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + ] + , Header 1 + ( "emph-and-strong", [], [] ) + [ Str "emph", Space, Str "and", Space, Str "strong" ] + , Para + [ Emph [ Str "emph" ], Space, Strong [ Str "strong" ] ] + , Para + [ Emph + [ Strong + [ Str "strong" + , Space + , Str "and" + , Space + , Str "emph" + , Space + , Str "1" + ] + ] + ] + , Para + [ Strong + [ Emph + [ Str "strong" + , Space + , Str "and" + , Space + , Str "emph" + , Space + , Str "2" + ] + ] + ] + , Para + [ Strong + [ Emph [ Str "emph", Space, Str "inside" ], Space, Str "strong" ] + ] + , Para + [ Strong + [ Str "strong", Space, Str "with", Space, Emph [ Str "emph" ] ] + ] + , Para + [ Emph + [ Strong + [ Str "strong", Space, Str "inside" ] + , Space + , Str "emph" + ] + ] + , Header 1 + ( "horizontal-rule", [], [] ) + [ Str "horizontal", Space, Str "rule" ] + , Para + [ Str "top" ] + , HorizontalRule + , Para + [ Str "bottom" ] + , HorizontalRule + , Header 1 + ( "nop", [], [] ) + [ Str "nop" ] + , Para + [ Str "__not emph__" ] + , Header 1 + ( "entities", [], [] ) + [ Str "entities" ] + , Para + [ Str "hi", Space, Str "&", Space, Str "low" ] + , Para + [ Str "hi", Space, Str "&", Space, Str "low" ] + , Para + [ Str "G\246del" ] + , Para + [ Str "\777\2730" ] + , Header 1 + ( "linebreaks", [], [] ) + [ Str "linebreaks" ] + , Para + [ Str "hi", LineBreak, Str "there" ] + , Para + [ Str "hi", LineBreak, Str "there" ] + , Header 1 + ( "inline-code", [], [] ) + [ Str "inline", Space, Str "code" ] + , Para + [ Code + ( "", [], [] ) "*\8594*" + , Space + , Code + ( "", [], [] ) "typed" + , Space + , Code + ( "", [], [] ) ">>=" + ] + , Header 1 + ( "code-blocks", [], [] ) + [ Str "code", Space, Str "blocks" ] + , CodeBlock + ( "" + , [] + , [] + ) "\ncase xs of\n (_:_) -> reverse xs\n [] -> ['*']\n" + , CodeBlock + ( "" + , [ "haskell" ] + , + [ ( "colors", "haskell" ), ( "ln", "0" ) ] + ) "\ncase xs of\n (_:_) -> reverse xs\n [] -> ['*']\n" + , Header 1 + ( "external-links", [], [] ) + [ Str "external", Space, Str "links" ] + , Para + [ Link + ( "", [], [] ) + [ Emph + [ Str "Google" ] + , Space + , Str "search" + , Space + , Str "engine" + ] + ( "http://google.com", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "http://pandoc.org" ] + ( "http://pandoc.org", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "http://google.com" ] + ( "http://google.com", "" ) + , Space + , Link + ( "", [], [] ) + [ Str "http://yahoo.com" ] + ( "http://yahoo.com", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "email", Space, Str "me" ] + ( "mailto:info@example.org", "" ) + ] + , Para + [ Str "http://google.com" ] + , Para + [ Str "info@example.org" ] + , Header 1 + ( "lists", [], [] ) + [ Str "lists" ] + , BulletList + [ + [ 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" + ] + , BulletList + [ + [ 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" + ] + ] + ] + ] + , + [ 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" ] ] + , + [ 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" + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ 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." + ] + ] + ] + , 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" ] ] ] + ) + , + ( + [ Str "item", Space, Str "2" ] + , + [ + [ 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" ] ] ] ] + ) + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "one" ] ] + , + [ Plain + [ Str "two" ] + , BulletList + [ + [ 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" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ 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 + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Apple" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Bread" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Pie" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Butter" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Ice", Space, Str "cream" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Apple" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Bread" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Pie" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Strong [ Str "Butter" ] ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Ice", Space, Str "cream" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Apple" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Bread" + , LineBreak + , LineBreak + , Str "and" + , Space + , Str "cheese" + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Pie" + , LineBreak + , LineBreak + , Strong + [ Str "apple" ] + , Space + , Str "and" + , Space + , Emph + [ Str "carrot" ] + , Space + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Space, Str "Orange", Space ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Space, Str "Apple", Space ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Space, Str "more" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Space, Str "Bread", Space ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Space, Str "Pie", Space ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Space, Str "more" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Space, Str "Butter", Space ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Space, Str "Ice", Space, Str "cream", Space ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Space, Str "and", Space, Str "more", Space ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + ] diff --git a/test/twiki-reader.native b/test/twiki-reader.native index 704bcbd9a..d0a225712 100644 --- a/test/twiki-reader.native +++ b/test/twiki-reader.native @@ -1,250 +1,875 @@ -Pandoc (Meta {unMeta = fromList []}) -[Header 1 ("header",[],[]) [Str "header"] -,Header 2 ("header-level-two",[],[]) [Str "header",Space,Str "level",Space,Str "two"] -,Header 3 ("header-level-3",[],[]) [Str "header",Space,Str "level",Space,Str "3"] -,Header 4 ("header-level-four",[],[]) [Str "header",Space,Emph [Str "level"],Space,Str "four"] -,Header 5 ("header-level-5",[],[]) [Str "header",Space,Str "level",Space,Str "5"] -,Header 6 ("header-level-6",[],[]) [Str "header",Space,Str "level",Space,Str "6"] -,Para [Str "---+++++++",Space,Str "not",Space,Str "a",Space,Str "header"] -,Para [Str "--++",Space,Str "not",Space,Str "a",Space,Str "header"] -,Header 1 ("emph-and-strong",[],[]) [Str "emph",Space,Str "and",Space,Str "strong"] -,Para [Emph [Str "emph"],Space,Strong [Str "strong"]] -,Para [Emph [Strong [Str "strong",Space,Str "and",Space,Str "emph"]]] -,Para [Strong [Emph [Str "emph",Space,Str "inside"],Space,Str "strong"]] -,Para [Strong [Str "strong",Space,Str "with",Space,Emph [Str "emph"]]] -,Para [Emph [Strong [Str "strong",Space,Str "inside"],Space,Str "emph"]] -,Header 1 ("horizontal-rule",[],[]) [Str "horizontal",Space,Str "rule"] -,Para [Str "top"] -,HorizontalRule -,Para [Str "bottom"] -,HorizontalRule -,Header 1 ("nop",[],[]) [Str "nop"] -,Para [Str "_not",Space,Str "emph_"] -,Header 1 ("entities",[],[]) [Str "entities"] -,Para [Str "hi",Space,Str "&",Space,Str "low"] -,Para [Str "hi",Space,Str "&",Space,Str "low"] -,Para [Str "G\246del"] -,Para [Str "\777\2730"] -,Header 1 ("comments",[],[]) [Str "comments"] -,Para [Str "inline",Space,Str "comment"] -,Para [Str "between",Space,Str "blocks"] -,Header 1 ("linebreaks",[],[]) [Str "linebreaks"] -,Para [Str "hi",LineBreak,Str "there"] -,Para [Str "hi",LineBreak,Str "there"] -,Header 1 ("inline-code",[],[]) [Str "inline",Space,Str "code"] -,Para [Code ("",[],[]) "*\8594*",Space,Code ("",[],[]) "typed",Space,Code ("",["haskell"],[]) ">>="] -,Header 1 ("code-blocks",[],[]) [Str "code",Space,Str "blocks"] -,CodeBlock ("",[],[]) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" -,CodeBlock ("",["haskell"],[]) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" -,Header 1 ("block-quotes",[],[]) [Str "block",Space,Str "quotes"] -,Para [Str "Regular",Space,Str "paragraph"] -,BlockQuote - [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote."] - ,Para [Str "With",Space,Str "two",Space,Str "paragraphs."]] -,Para [Str "Nother",Space,Str "paragraph."] -,Header 1 ("external-links",[],[]) [Str "external",Space,Str "links"] -,Para [Link ("",[],[]) [Emph [Str "Google"],Space,Str "search",Space,Str "engine"] ("http://google.com","")] -,Para [Link ("",[],[]) [Str "http://pandoc.org"] ("http://pandoc.org","")] -,Para [Link ("",[],[]) [Str "http://google.com"] ("http://google.com",""),Space,Link ("",[],[]) [Str "http://yahoo.com"] ("http://yahoo.com","")] -,Para [Link ("",[],[]) [Str "email",Space,Str "me"] ("mailto:info@example.org","")] -,Para [Str "http://google.com"] -,Para [Str "http://google.com"] -,Para [Str "http://google.com"] -,Para [Str "info@example.org"] -,Para [Str "info@example.org"] -,Para [Str "info@example.org"] -,Header 1 ("lists",[],[]) [Str "lists"] -,BulletList - [[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"] - ,BulletList - [[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"]]]] - ,[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"]] - ,[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"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[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."]]] -,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"]]]) - ,([Str "item",Space,Str "2"], - [[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"]]]])] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "one"]] - ,[Plain [Str "two"] - ,BulletList - [[Plain [Str "two",Space,Str "point",Space,Str "one"]] - ,[Plain [Str "two",Space,Str "point",Space,Str "two"]]]] - ,[Plain [Str "three"] - ,DefinitionList - [([Str "three",Space,Str "item",Space,Str "one"], - [[Plain [Str "three",Space,Str "def",Space,Str "one"]]])]] - ,[Plain [Str "four"] - ,DefinitionList - [([Str "four",Space,Str "def",Space,Str "one"], - [[Plain [Str "this",Space,Str "is",Space,Str "a",Space,Str "continuation"]]])]] - ,[Plain [Str "five"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[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"]]]] - ,[Plain [Str "five",Space,Str "sub",Space,Str "2"]]]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "other"] - ,OrderedList (1,UpperRoman,DefaultDelim) - [[Plain [Str "list"]] - ,[Plain [Str "styles"]]]] - ,[Plain [Str "are"] - ,OrderedList (1,LowerRoman,DefaultDelim) - [[Plain [Str "also"]] - ,[Plain [Str "possible"]]]] - ,[Plain [Str "all"] - ,OrderedList (1,LowerAlpha,DefaultDelim) - [[Plain [Str "the"]] - ,[Plain [Str "different"]] - ,[Plain [Str "styles"]]]] - ,[Plain [Str "are"] - ,OrderedList (1,UpperAlpha,DefaultDelim) - [[Plain [Str "implemented"]] - ,[Plain [Str "and"]] - ,[Plain [Str "supported"]]]]] -,Header 1 ("tables",[],[]) [Str "tables"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Apple"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Bread"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Pie"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Butter"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Ice",Space,Str "cream"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignLeft,ColWidthDefault) - ,(AlignLeft,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Apple"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Bread"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Pie"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Strong [Str "Butter"]]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Ice",Space,Str "cream"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignLeft,ColWidthDefault) - ,(AlignLeft,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Apple"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Bread",LineBreak,LineBreak,Str "and",Space,Str "cheese"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Pie",LineBreak,LineBreak,Strong [Str "apple"],Space,Str "and",Space,Emph [Str "carrot"]]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Orange"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Apple"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "more"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Bread"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Pie"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "more"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Butter"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Ice",Space,Str "cream"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "and",Space,Str "more"]]]])] - (TableFoot ("",[],[]) - []) -,Header 1 ("macros",[],[]) [Str "macros"] -,Para [Span ("",["twiki-macro","TEST"],[]) []] -,Para [Span ("",["twiki-macro","TEST"],[]) [Str ""]] -,Para [Span ("",["twiki-macro","TEST"],[]) [Str "content with spaces"]] -,Para [Span ("",["twiki-macro","TEST"],[]) [Str "content with spaces"]] -,Para [Span ("",["twiki-macro","TEST"],[("ARG1","test")]) [Str "content with spaces"]] -,Para [Span ("",["twiki-macro","TEST"],[]) [Str "content with spaces ARG1=test"]] -,Para [Span ("",["twiki-macro","TEST"],[("ARG1","test")]) [Str "content with spaces"]] -,Para [Span ("",["twiki-macro","TEST"],[("ARG1","test"),("ARG2","test2")]) [Str ""]] -,Para [Span ("",["twiki-macro","TEST"],[("ARG1","test"),("ARG2","test2")]) [Str ""]] -,Para [Span ("",["twiki-macro","TEST"],[("ARG1","test"),("ARG2","test2")]) [Str "multiline\ndoes also work"]]] +Pandoc + ( Meta { unMeta = fromList [] } ) + [ Header 1 + ( "header", [], [] ) + [ Str "header" ] + , Header 2 + ( "header-level-two", [], [] ) + [ Str "header", Space, Str "level", Space, Str "two" ] + , Header 3 + ( "header-level-3", [], [] ) + [ Str "header", Space, Str "level", Space, Str "3" ] + , Header 4 + ( "header-level-four", [], [] ) + [ Str "header", Space, Emph [ Str "level" ], Space, Str "four" ] + , Header 5 + ( "header-level-5", [], [] ) + [ Str "header", Space, Str "level", Space, Str "5" ] + , Header 6 + ( "header-level-6", [], [] ) + [ Str "header", Space, Str "level", Space, Str "6" ] + , Para + [ Str "---+++++++" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + ] + , Para + [ Str "--++" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + ] + , Header 1 + ( "emph-and-strong", [], [] ) + [ Str "emph", Space, Str "and", Space, Str "strong" ] + , Para + [ Emph [ Str "emph" ], Space, Strong [ Str "strong" ] ] + , Para + [ Emph + [ Strong [ Str "strong", Space, Str "and", Space, Str "emph" ] ] + ] + , Para + [ Strong + [ Emph [ Str "emph", Space, Str "inside" ], Space, Str "strong" ] + ] + , Para + [ Strong + [ Str "strong", Space, Str "with", Space, Emph [ Str "emph" ] ] + ] + , Para + [ Emph + [ Strong + [ Str "strong", Space, Str "inside" ] + , Space + , Str "emph" + ] + ] + , Header 1 + ( "horizontal-rule", [], [] ) + [ Str "horizontal", Space, Str "rule" ] + , Para + [ Str "top" ] + , HorizontalRule + , Para + [ Str "bottom" ] + , HorizontalRule + , Header 1 + ( "nop", [], [] ) + [ Str "nop" ] + , Para + [ Str "_not", Space, Str "emph_" ] + , Header 1 + ( "entities", [], [] ) + [ Str "entities" ] + , Para + [ Str "hi", Space, Str "&", Space, Str "low" ] + , Para + [ Str "hi", Space, Str "&", Space, Str "low" ] + , Para + [ Str "G\246del" ] + , Para + [ Str "\777\2730" ] + , Header 1 + ( "comments", [], [] ) + [ Str "comments" ] + , Para + [ Str "inline", Space, Str "comment" ] + , Para + [ Str "between", Space, Str "blocks" ] + , Header 1 + ( "linebreaks", [], [] ) + [ Str "linebreaks" ] + , Para + [ Str "hi", LineBreak, Str "there" ] + , Para + [ Str "hi", LineBreak, Str "there" ] + , Header 1 + ( "inline-code", [], [] ) + [ Str "inline", Space, Str "code" ] + , Para + [ Code + ( "", [], [] ) "*\8594*" + , Space + , Code + ( "", [], [] ) "typed" + , Space + , Code + ( "", [ "haskell" ], [] ) ">>=" + ] + , Header 1 + ( "code-blocks", [], [] ) + [ Str "code", Space, Str "blocks" ] + , CodeBlock + ( "" + , [] + , [] + ) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" + , CodeBlock + ( "" + , [ "haskell" ] + , [] + ) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" + , Header 1 + ( "block-quotes", [], [] ) + [ Str "block", Space, Str "quotes" ] + , Para + [ Str "Regular", Space, Str "paragraph" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + ] + , Para + [ Str "With", Space, Str "two", Space, Str "paragraphs." ] + ] + , Para + [ Str "Nother", Space, Str "paragraph." ] + , Header 1 + ( "external-links", [], [] ) + [ Str "external", Space, Str "links" ] + , Para + [ Link + ( "", [], [] ) + [ Emph + [ Str "Google" ] + , Space + , Str "search" + , Space + , Str "engine" + ] + ( "http://google.com", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "http://pandoc.org" ] + ( "http://pandoc.org", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "http://google.com" ] + ( "http://google.com", "" ) + , Space + , Link + ( "", [], [] ) + [ Str "http://yahoo.com" ] + ( "http://yahoo.com", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "email", Space, Str "me" ] + ( "mailto:info@example.org", "" ) + ] + , Para + [ Str "http://google.com" ] + , Para + [ Str "http://google.com" ] + , Para + [ Str "http://google.com" ] + , Para + [ Str "info@example.org" ] + , Para + [ Str "info@example.org" ] + , Para + [ Str "info@example.org" ] + , Header 1 + ( "lists", [], [] ) + [ Str "lists" ] + , BulletList + [ + [ 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" + ] + , BulletList + [ + [ 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" + ] + ] + ] + ] + , + [ 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" ] ] + , + [ 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" + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ 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." + ] + ] + ] + , 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" ] ] ] + ) + , + ( + [ Str "item", Space, Str "2" ] + , + [ + [ 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" ] ] ] ] + ) + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "one" ] ] + , + [ Plain + [ Str "two" ] + , BulletList + [ + [ Plain [ Str "two", Space, Str "point", Space, Str "one" ] ] + , + [ Plain [ Str "two", Space, Str "point", Space, Str "two" ] ] + ] + ] + , + [ Plain + [ Str "three" ] + , DefinitionList + [ + ( + [ Str "three", Space, Str "item", Space, Str "one" ] + , + [ + [ Plain + [ Str "three", Space, Str "def", Space, Str "one" ] + ] + ] + ) + ] + ] + , + [ Plain + [ Str "four" ] + , DefinitionList + [ + ( + [ Str "four", Space, Str "def", Space, Str "one" ] + , + [ + [ Plain + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "continuation" + ] + ] + ] + ) + ] + ] + , + [ Plain + [ Str "five" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ 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" + ] + ] + ] + ] + , + [ Plain [ Str "five", Space, Str "sub", Space, Str "2" ] ] + ] + ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "other" ] + , OrderedList + ( 1, UpperRoman, DefaultDelim ) + [ [ Plain [ Str "list" ] ], [ Plain [ Str "styles" ] ] ] + ] + , + [ Plain + [ Str "are" ] + , OrderedList + ( 1, LowerRoman, DefaultDelim ) + [ [ Plain [ Str "also" ] ], [ Plain [ Str "possible" ] ] ] + ] + , + [ Plain + [ Str "all" ] + , OrderedList + ( 1, LowerAlpha, DefaultDelim ) + [ + [ Plain [ Str "the" ] ] + , + [ Plain [ Str "different" ] ] + , + [ Plain [ Str "styles" ] ] + ] + ] + , + [ Plain + [ Str "are" ] + , OrderedList + ( 1, UpperAlpha, DefaultDelim ) + [ + [ Plain [ Str "implemented" ] ] + , + [ Plain [ Str "and" ] ] + , + [ Plain [ Str "supported" ] ] + ] + ] + ] + , Header 1 + ( "tables", [], [] ) + [ Str "tables" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Apple" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Bread" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Pie" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Butter" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Ice", Space, Str "cream" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignLeft, ColWidthDefault ), ( AlignLeft, ColWidthDefault ) ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Apple" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Bread" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Pie" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Strong [ Str "Butter" ] ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Ice", Space, Str "cream" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignLeft, ColWidthDefault ), ( AlignLeft, ColWidthDefault ) ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Apple" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Bread" + , LineBreak + , LineBreak + , Str "and" + , Space + , Str "cheese" + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "Pie" + , LineBreak + , LineBreak + , Strong + [ Str "apple" ] + , Space + , Str "and" + , Space + , Emph + [ Str "carrot" ] + ] + ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Orange" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Apple" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "more" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Bread" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Pie" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "more" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Butter" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Ice", Space, Str "cream" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "and", Space, Str "more" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Header 1 + ( "macros", [], [] ) + [ Str "macros" ] + , Para + [ Span ( "", [ "twiki-macro", "TEST" ], [] ) [] ] + , Para + [ Span ( "", [ "twiki-macro", "TEST" ], [] ) [ Str "" ] ] + , Para + [ Span + ( "", [ "twiki-macro", "TEST" ], [] ) + [ Str "content with spaces" ] + ] + , Para + [ Span + ( "", [ "twiki-macro", "TEST" ], [] ) + [ Str "content with spaces" ] + ] + , Para + [ Span + ( "", [ "twiki-macro", "TEST" ], [ ( "ARG1", "test" ) ] ) + [ Str "content with spaces" ] + ] + , Para + [ Span + ( "", [ "twiki-macro", "TEST" ], [] ) + [ Str "content with spaces ARG1=test" ] + ] + , Para + [ Span + ( "", [ "twiki-macro", "TEST" ], [ ( "ARG1", "test" ) ] ) + [ Str "content with spaces" ] + ] + , Para + [ Span + ( "" + , + [ "twiki-macro", "TEST" ] + , + [ ( "ARG1", "test" ), ( "ARG2", "test2" ) ] + ) + [ Str "" ] + ] + , Para + [ Span + ( "" + , + [ "twiki-macro", "TEST" ] + , + [ ( "ARG1", "test" ), ( "ARG2", "test2" ) ] + ) + [ Str "" ] + ] + , Para + [ Span + ( "" + , + [ "twiki-macro", "TEST" ] + , + [ ( "ARG1", "test" ), ( "ARG2", "test2" ) ] + ) + [ Str "multiline\ndoes also work" ] + ] + ] diff --git a/test/txt2tags.native b/test/txt2tags.native index c52c5929a..ccc8dd36e 100644 --- a/test/txt2tags.native +++ b/test/txt2tags.native @@ -1,968 +1,5200 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "author"]]),("date",MetaInlines [Str "date"]),("includeconf",MetaString "rules.conf"),("title",MetaInlines [Str "Txt2tags",Space,Str "Markup",Space,Str "Rules"])]}) -[Para [Str "This",Space,Str "document",Space,Str "describes",Space,Str "all",Space,Str "the",Space,Str "details",Space,Str "about",Space,Str "each",Space,Str "txt2tags",Space,Str "mark.",SoftBreak,Str "The",Space,Str "target",Space,Str "audience",Space,Str "are",Space,Strong [Str "experienced"],Space,Str "users.",Space,Str "You",Space,Str "may",Space,Str "find",Space,Str "it",SoftBreak,Str "useful",Space,Str "if",Space,Str "you",Space,Str "want",Space,Str "to",Space,Str "master",Space,Str "the",Space,Str "marks",Space,Str "or",Space,Str "solve",Space,Str "a",Space,Str "specific",Space,Str "problem",SoftBreak,Str "about",Space,Str "a",Space,Str "mark."] -,Para [Str "If",Space,Str "you",Space,Str "are",Space,Str "new",Space,Str "to",Space,Str "txt2tags",Space,Str "or",Space,Str "just",Space,Str "want",Space,Str "to",Space,Str "know",Space,Str "which",Space,Str "are",Space,Str "the",SoftBreak,Str "available",Space,Str "marks,",Space,Str "please",Space,Str "read",Space,Str "the",Space,Link ("",[],[]) [Str "Markup",Space,Str "Demo"] ("MARKUPDEMO",""),Str "."] -,Para [Str "Note",Space,Str "1:",Space,Str "This",Space,Str "document",Space,Str "is",Space,Str "generated",Space,Str "directly",Space,Str "from",Space,Str "the",Space,Str "txt2tags",SoftBreak,Str "test-suite.",Space,Str "All",Space,Str "the",Space,Str "rules",Space,Str "mentioned",Space,Str "here",Space,Str "are",Space,Str "100%",Space,Str "in",Space,Str "sync",Space,Str "with",Space,Str "the",SoftBreak,Str "current",Space,Str "program",Space,Str "code."] -,Para [Str "Note",Space,Str "2:",Space,Str "A",Space,Str "good",Space,Str "practice",Space,Str "is",Space,Str "to",Space,Str "consult",Space,Link ("",[],[]) [Str "the",Space,Str "sources"] ("rules.t2t",""),Space,Str "when",SoftBreak,Str "reading,",Space,Str "to",Space,Str "see",Space,Str "how",Space,Str "the",Space,Str "texts",Space,Str "were",Space,Str "made."] -,Para [Str "Table",Space,Str "of",Space,Str "Contents:"] -,HorizontalRule -,Header 1 ("paragraph",[],[]) [Str "Paragraph"] -,Para [Str "A",Space,Str "paragraph",Space,Str "is",Space,Str "composed",Space,Str "by",Space,Str "one",Space,Str "or",Space,Str "more",Space,Str "lines.",SoftBreak,Str "A",Space,Str "blank",Space,Str "line",Space,Str "(or",Space,Str "a",Space,Str "table,",Space,Str "or",Space,Str "a",Space,Str "list)",Space,Str "ends",Space,Str "the",SoftBreak,Str "current",Space,Str "paragraph."] -,Para [Str "Leading",Space,Str "and",Space,Str "trailing",Space,Str "spaces",Space,Str "are",Space,Str "ignored."] -,Para [Str "A",Space,Str "comment",Space,Str "line",Space,Str "can",Space,Str "be",Space,Str "placed",Space,Str "inside",Space,Str "a",Space,Str "paragraph.",SoftBreak,Str "It",Space,Str "will",Space,Str "not",Space,Str "affect",Space,Str "it."] -,Para [Str "The",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "file",Space,Str "(EOF)",Space,Str "closes",Space,Str "the",SoftBreak,Str "currently",Space,Str "open",Space,Str "paragraph."] -,Header 1 ("comment",[],[]) [Str "Comment"] -,Para [Str "%",Space,Str "not",Space,Str "on",Space,Str "the",Space,Str "line",Space,Str "beginning",Space,Str "(at",Space,Str "column",Space,Str "2)"] -,Para [Str "some",Space,Str "text",Space,Str "%",Space,Str "half",Space,Str "line",Space,Str "comments",Space,Str "are",Space,Str "not",Space,Str "allowed"] -,Header 1 ("line",[],[]) [Str "Line"] -,HorizontalRule -,HorizontalRule -,HorizontalRule -,HorizontalRule -,HorizontalRule -,HorizontalRule -,HorizontalRule -,HorizontalRule -,HorizontalRule -,HorizontalRule -,HorizontalRule -,Para [Strikeout [Str "-----"],SoftBreak,Strikeout [Str "-------",Space,Str "--------"]] -,Para [Strikeout [Str "-------+--------"]] -,Para [Str "(",Space,Strikeout [Str "----------------"],Space,Str ")"] -,Header 1 ("inline",[],[]) [Str "Inline"] -,Para [Str "i)",Space,Strong [Str "b"],Space,Emph [Str "i"],Space,Underline [Str "u"],Space,Strikeout [Str "s"],Space,Code ("",[],[]) "m",Space,Str "r",Space,RawInline (Format "html") "t",SoftBreak,Str "i)",Space,Strong [Str "bo"],Space,Emph [Str "it"],Space,Underline [Str "un"],Space,Strikeout [Str "st"],Space,Code ("",[],[]) "mo",Space,Str "ra",Space,RawInline (Format "html") "tg",SoftBreak,Str "i)",Space,Strong [Str "bold"],Space,Emph [Str "ital"],Space,Underline [Str "undr"],Space,Strikeout [Str "strk"],Space,Code ("",[],[]) "mono",Space,Str "raw",Space,RawInline (Format "html") "tggd",SoftBreak,Str "i)",Space,Strong [Str "bo",Space,Str "ld"],Space,Emph [Str "it",Space,Str "al"],Space,Underline [Str "un",Space,Str "dr"],Space,Strikeout [Str "st",Space,Str "rk"],Space,Code ("",[],[]) "mo no",Space,Str "r",Space,Str "aw",Space,RawInline (Format "html") "tg gd",SoftBreak,Str "i)",Space,Strong [Str "bo",Space,Str "*",Space,Str "ld"],Space,Emph [Str "it",Space,Str "/",Space,Str "al"],Space,Underline [Str "un",Space,Str "_",Space,Str "dr"],Space,Strikeout [Str "st",Space,Str "-",Space,Str "rk"],Space,Code ("",[],[]) "mo ` no",Space,Str "r",Space,Str "\"",Space,Str "aw",Space,RawInline (Format "html") "tg ' gd",SoftBreak,Str "i)",Space,Strong [Str "bo",Space,Str "**ld"],Space,Emph [Str "it",Space,Str "//al"],Space,Underline [Str "un",Space,Str "__dr"],Space,Strikeout [Str "st",Space,Str "--rk"],Space,Code ("",[],[]) "mo ``no",Space,Str "r",Space,Str "\"\"aw",Space,RawInline (Format "html") "tg ''gd",SoftBreak,Str "i)",Space,Strong [Str "bo",Space,Str "**",Space,Str "ld"],Space,Emph [Str "it",Space,Str "//",Space,Str "al"],Space,Underline [Str "un",Space,Str "__",Space,Str "dr"],Space,Strikeout [Str "st",Space,Str "--",Space,Str "rk"],Space,Code ("",[],[]) "mo `` no",Space,Str "r",Space,Str "\"\"",Space,Str "aw",Space,RawInline (Format "html") "tg '' gd",SoftBreak,Str "i)",Space,Strong [Str "**bold**"],Space,Emph [Str "//ital//"],Space,Underline [Str "__undr__"],Space,Strikeout [Str "--strk--"],Space,Code ("",[],[]) "``mono``",Space,Str "\"\"raw\"\"",Space,RawInline (Format "html") "''tggd''",SoftBreak,Str "i)",Space,Strong [Str "*bold*"],Space,Emph [Str "/ital/"],Space,Underline [Str "_undr_"],Space,Strikeout [Str "-strk-"],Space,Code ("",[],[]) "`mono`",Space,Str "\"raw\"",Space,RawInline (Format "html") "'tggd'"] -,Para [Str "i)",Space,Strong [Str "*"],Space,Emph [Str "/"],Space,Underline [Str "_"],Space,Strikeout [Str "-"],Space,Code ("",[],[]) "`",Space,Str "\"",Space,RawInline (Format "html") "'",SoftBreak,Str "i)",Space,Strong [Str "**"],Space,Emph [Str "//"],Space,Underline [Str "__"],Space,Strikeout [Str "--"],Space,Code ("",[],[]) "``",Space,Str "\"\"",Space,RawInline (Format "html") "''",SoftBreak,Str "i)",Space,Strong [Str "***"],Space,Emph [Str "///"],Space,Underline [Str "___"],Space,Strikeout [Str "---"],Space,Code ("",[],[]) "```",Space,Str "\"\"\"",Space,RawInline (Format "html") "'''",SoftBreak,Str "i)",Space,Strong [Str "****"],Space,Emph [Str "////"],Space,Underline [Str "____"],Space,Strikeout [Str "----"],Space,Code ("",[],[]) "````",Space,Str "\"\"\"\"",Space,RawInline (Format "html") "''''",SoftBreak,Str "i)",Space,Strong [Str "*****"],Space,Emph [Str "/////"],Space,Underline [Str "_____"],Space,Strikeout [Str "-----"],Space,Code ("",[],[]) "`````",Space,Str "\"\"\"\"\"",Space,RawInline (Format "html") "'''''",SoftBreak,Str "i)",Space,Strong [Str "******"],Space,Emph [Str "//////"],Space,Underline [Str "______"],Space,Strikeout [Str "------"],Space,Code ("",[],[]) "``````",Space,Str "\"\"\"\"\"\"",Space,RawInline (Format "html") "''''''"] -,Para [Str "i)",Space,Str "****",Space,Str "////",Space,Str "____",Space,Str "----",Space,Str "````",Space,Str "\"\"\"\"",Space,Str "''''",SoftBreak,Str "i)",Space,Str "**",Space,Str "**",Space,Str "//",Space,Str "//",Space,Str "__",Space,Str "__",Space,Str "--",Space,Str "--",Space,Str "``",Space,Str "``",Space,Str "\"\"",Space,Str "\"\"",Space,Str "''",Space,Str "''"] -,Para [Str "i)",Space,Str "**",Space,Str "bold**",Space,Str "//",Space,Str "ital//",Space,Str "__",Space,Str "undr__",Space,Str "--",Space,Str "strk--",Space,Str "``",Space,Str "mono``",Space,Str "\"\"",Space,Str "raw\"\"",Space,Str "''",Space,Str "tggd''",SoftBreak,Str "i)",Space,Str "**bold",Space,Str "**",Space,Str "//ital",Space,Str "//",Space,Str "__undr",Space,Str "__",Space,Str "--strk",Space,Str "--",Space,Str "``mono",Space,Str "``",Space,Str "\"\"raw",Space,Str "\"\"",Space,Str "''tggd",Space,Str "''",SoftBreak,Str "i)",Space,Str "**",Space,Str "bold",Space,Str "**",Space,Str "//",Space,Str "ital",Space,Str "//",Space,Str "__",Space,Str "undr",Space,Str "__",Space,Str "--",Space,Str "strk",Space,Str "--",Space,Str "``",Space,Str "mono",Space,Str "``",Space,Str "\"\"",Space,Str "raw",Space,Str "\"\"",Space,Str "''",Space,Str "tggd",Space,Str "''"] -,Header 1 ("link",[],[]) [Str "Link"] -,Para [Link ("",[],[]) [Str "mailto:user@domain.com"] ("user@domain.com",""),SoftBreak,Link ("",[],[]) [Str "mailto:user@domain.com"] ("user@domain.com",""),Str ".",SoftBreak,Link ("",[],[]) [Str "mailto:user@domain.com"] ("user@domain.com",""),Str ".",Space,Str "any",Space,Str "text.",SoftBreak,Str "any",Space,Str "text:",Space,Link ("",[],[]) [Str "mailto:user@domain.com"] ("user@domain.com",""),Str ".",Space,Str "any",Space,Str "text.",SoftBreak,Link ("",[],[]) [Str "label"] ("user@domain.com",""),SoftBreak,Link ("",[],[]) [Str "mailto:user@domain.com?subject=bla"] ("user@domain.com?subject=bla",""),SoftBreak,Link ("",[],[]) [Str "mailto:user@domain.com?subject=bla"] ("user@domain.com?subject=bla",""),Str ".",SoftBreak,Link ("",[],[]) [Str "mailto:user@domain.com?subject=bla"] ("user@domain.com?subject=bla",""),Str ",",SoftBreak,Link ("",[],[]) [Str "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com"] ("user@domain.com?subject=bla&cc=otheruser@domain.com",""),SoftBreak,Link ("",[],[]) [Str "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com"] ("user@domain.com?subject=bla&cc=otheruser@domain.com",""),Str ".",SoftBreak,Link ("",[],[]) [Str "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com"] ("user@domain.com?subject=bla&cc=otheruser@domain.com",""),Str ",",SoftBreak,Link ("",[],[]) [Str "label"] ("user@domain.com?subject=bla&cc=otheruser@domain.com",""),Str ".",SoftBreak,Link ("",[],[]) [Str "label"] ("user@domain.com?subject=bla&cc=otheruser@domain.com.",""),Str ".",SoftBreak,Link ("",[],[]) [Str "http://www.domain.com"] ("http://www.domain.com",""),SoftBreak,Link ("",[],[]) [Str "http://www.domain.com/dir/"] ("http://www.domain.com/dir/",""),SoftBreak,Link ("",[],[]) [Str "http://www.domain.com/dir///"] ("http://www.domain.com/dir///",""),SoftBreak,Link ("",[],[]) [Str "http://www.domain.com."] ("http://www.domain.com.",""),SoftBreak,Link ("",[],[]) [Str "http://www.domain.com,"] ("http://www.domain.com,",""),SoftBreak,Link ("",[],[]) [Str "http://www.domain.com."] ("http://www.domain.com.",""),Space,Str "any",Space,Str "text.",SoftBreak,Link ("",[],[]) [Str "http://www.domain.com,"] ("http://www.domain.com,",""),Space,Str "any",Space,Str "text.",SoftBreak,Link ("",[],[]) [Str "http://www.domain.com/dir/."] ("http://www.domain.com/dir/.",""),Space,Str "any",Space,Str "text.",SoftBreak,Str "any",Space,Str "text:",Space,Link ("",[],[]) [Str "http://www.domain.com."] ("http://www.domain.com.",""),Space,Str "any",Space,Str "text.",SoftBreak,Str "any",Space,Str "text:",Space,Link ("",[],[]) [Str "http://www.domain.com/dir/."] ("http://www.domain.com/dir/.",""),Space,Str "any",Space,Str "text.",SoftBreak,Str "any",Space,Str "text:",Space,Link ("",[],[]) [Str "http://www.domain.com/dir/index.html."] ("http://www.domain.com/dir/index.html.",""),Space,Str "any",Space,Str "text.",SoftBreak,Str "any",Space,Str "text:",Space,Link ("",[],[]) [Str "http://www.domain.com/dir/index.html,"] ("http://www.domain.com/dir/index.html,",""),Space,Str "any",Space,Str "text.",SoftBreak,Link ("",[],[]) [Str "http://www.domain.com/dir/#anchor"] ("http://www.domain.com/dir/#anchor",""),SoftBreak,Link ("",[],[]) [Str "http://www.domain.com/dir/index.html#anchor"] ("http://www.domain.com/dir/index.html#anchor",""),SoftBreak,Link ("",[],[]) [Str "http://www.domain.com/dir/index.html#anchor."] ("http://www.domain.com/dir/index.html#anchor.",""),SoftBreak,Link ("",[],[]) [Str "http://www.domain.com/dir/#anchor."] ("http://www.domain.com/dir/#anchor.",""),Space,Str "any",Space,Str "text.",SoftBreak,Link ("",[],[]) [Str "http://www.domain.com/dir/index.html#anchor."] ("http://www.domain.com/dir/index.html#anchor.",""),Space,Str "any",Space,Str "text.",SoftBreak,Str "any",Space,Str "text:",Space,Link ("",[],[]) [Str "http://www.domain.com/dir/#anchor."] ("http://www.domain.com/dir/#anchor.",""),Space,Str "any",Space,Str "text.",SoftBreak,Str "any",Space,Str "text:",Space,Link ("",[],[]) [Str "http://www.domain.com/dir/index.html#anchor."] ("http://www.domain.com/dir/index.html#anchor.",""),Space,Str "any",Space,Str "text.",SoftBreak,Link ("",[],[]) [Str "http://domain.com?a=a@a.a&b=a+b+c."] ("http://domain.com?a=a@a.a&b=a+b+c.",""),SoftBreak,Link ("",[],[]) [Str "http://domain.com?a=a@a.a&b=a+b+c,"] ("http://domain.com?a=a@a.a&b=a+b+c,",""),SoftBreak,Link ("",[],[]) [Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c."] ("http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.",""),SoftBreak,Link ("",[],[]) [Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@."] ("http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.",""),SoftBreak,Link ("",[],[]) [Str "http://domain.com?a=a@a.a&b=a+b+c.#anchor"] ("http://domain.com?a=a@a.a&b=a+b+c.#anchor",""),SoftBreak,Link ("",[],[]) [Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor"] ("http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor",""),SoftBreak,Link ("",[],[]) [Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor"] ("http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor",""),SoftBreak,Link ("",[],[]) [Str "http://user:password@domain.com/bla.html."] ("http://user:password@domain.com/bla.html.",""),SoftBreak,Link ("",[],[]) [Str "http://user:password@domain.com/dir/."] ("http://user:password@domain.com/dir/.",""),SoftBreak,Link ("",[],[]) [Str "http://user:password@domain.com."] ("http://user:password@domain.com.",""),SoftBreak,Link ("",[],[]) [Str "http://user:@domain.com."] ("http://user:@domain.com.",""),SoftBreak,Link ("",[],[]) [Str "http://user@domain.com."] ("http://user@domain.com.",""),SoftBreak,Link ("",[],[]) [Str "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor"] ("http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor",""),SoftBreak,Link ("",[],[]) [Str "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor"] ("http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor",""),SoftBreak,Link ("",[],[]) [Str "label"] ("www.domain.com",""),SoftBreak,Str "[",Space,Str "label",Space,Link ("",[],[]) [Str "www.domain.com"] ("www.domain.com",""),Str "]",SoftBreak,Link ("",[],[]) [Str "label",Space] ("www.domain.com",""),SoftBreak,Link ("",[],[]) [Str "anchor",Space] ("http://www.domain.com/dir/index.html#anchor.",""),SoftBreak,Link ("",[],[]) [Str "login",Space] ("http://user:password@domain.com/bla.html",""),SoftBreak,Link ("",[],[]) [Str "form",Space] ("http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.",""),SoftBreak,Link ("",[],[]) [Str "form",Space,Str "&",Space,Str "anchor"] ("http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor",""),SoftBreak,Link ("",[],[]) [Str "login",Space,Str "&",Space,Str "form",Space] ("http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.",""),SoftBreak,Link ("",[],[]) [Str "local",Space,Str "link",Space,Str "up",Space] ("..",""),SoftBreak,Link ("",[],[]) [Str "local",Space,Str "link",Space,Str "file",Space] ("bla.html",""),SoftBreak,Link ("",[],[]) [Str "local",Space,Str "link",Space,Str "anchor",Space] ("#anchor",""),SoftBreak,Link ("",[],[]) [Str "local",Space,Str "link",Space,Str "file/anchor"] ("bla.html#anchor",""),SoftBreak,Link ("",[],[]) [Str "local",Space,Str "link",Space,Str "file/anchor"] ("bla.html#anchor.",""),SoftBreak,Link ("",[],[]) [Str "local",Space,Str "link",Space,Str "img",Space] ("abc.gif",""),SoftBreak,Link ("",[],[]) [Str "www.fake.com"] ("www.domain.com",""),SoftBreak,Link ("",[],[]) [Str "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm"] ("http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm",""),SoftBreak,Link ("",[],[]) [Str "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-"] ("http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-",""),SoftBreak,Link ("",[],[]) [Str "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_"] ("http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_",""),Str "-1%.",SoftBreak,Link ("",[],[]) [Str "http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_"] ("http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_",""),Str "-1%.",SoftBreak,Link ("",[],[]) [Str "http://L1.com"] ("http://L1.com",""),Space,Str "!",Space,Link ("",[],[]) [Str "mailto:L2@www.com"] ("L2@www.com",""),Space,Str "!",Space,Link ("",[],[]) [Str "L3"] ("www.com",""),Space,Str "!",Space,Link ("",[],[]) [Str "L4"] ("w@ww.com",""),Space,Str "!",Space,Link ("",[],[]) [Str "www.L5.com"] ("www.L5.com",""),SoftBreak,Link ("",[],[]) [Str "www.domain.com"] ("www.domain.com",""),SoftBreak,Link ("",[],[]) [Str "www2.domain.com"] ("www2.domain.com",""),SoftBreak,Link ("",[],[]) [Str "ftp.domain.com"] ("ftp.domain.com",""),SoftBreak,Link ("",[],[]) [Str "WWW.DOMAIN.COM"] ("WWW.DOMAIN.COM",""),SoftBreak,Link ("",[],[]) [Str "FTP.DOMAIN.COM"] ("FTP.DOMAIN.COM",""),SoftBreak,Link ("",[],[]) [Str "label"] ("www.domain.com",""),SoftBreak,Link ("",[],[]) [Str "label"] ("ftp.domain.com",""),SoftBreak,Link ("",[],[]) [Str "label"] ("WWW.DOMAIN.COM",""),SoftBreak,Link ("",[],[]) [Str "label"] ("FTP.DOMAIN.COM",""),SoftBreak,Str "[label",Space,Link ("",[],[]) [Str "www.domain.com"] ("www.domain.com",""),Space,Str "]",SoftBreak,Str "[label]",Space,Link ("",[],[]) [Str "www.domain.com"] ("www.domain.com",""),Str "]"] -,Header 1 ("image",[],[]) [Str "Image"] -,Para [Image ("",[],[]) [] ("img.png","")] -,Para [Link ("",[],[]) [Image ("",[],[]) [] ("img.png","")] ("https://txt2tags.org","")] -,Para [Image ("",[],[]) [] ("img.png",""),Space,Str "Image",Space,Str "at",Space,Str "the",Space,Str "line",Space,Str "beginning."] -,Para [Str "Image",Space,Str "in",Space,Str "the",Space,Str "middle",Space,Image ("",[],[]) [] ("img.png",""),Space,Str "of",Space,Str "the",Space,Str "line."] -,Para [Str "Image",Space,Str "at",Space,Str "the",Space,Str "line",Space,Str "end.",Space,Image ("",[],[]) [] ("img.png","")] -,Para [Image ("",[],[]) [] ("img.png",""),SoftBreak,Image ("",[],[]) [] ("img.png",""),SoftBreak,Image ("",[],[]) [] ("img.png","")] -,Para [Image ("",[],[]) [] ("img.png",""),Image ("",[],[]) [] ("img.png","")] -,Para [Str "Images",Space,Image ("",[],[]) [] ("img.png",""),Space,Str "mixed",Space,Image ("",[],[]) [] ("img.png",""),Space,Str "with",Space,Image ("",[],[]) [] ("img.png",""),Space,Str "text."] -,Para [Str "Images",Space,Str "glued",Space,Str "together:",Space,Image ("",[],[]) [] ("img.png",""),Image ("",[],[]) [] ("img.png",""),Image ("",[],[]) [] ("img.png",""),Str "."] -,Para [Str "[img.png",Space,Str "]"] -,Para [Str "[",Space,Str "img.png]"] -,Para [Str "[",Space,Str "img.png",Space,Str "]"] -,Header 1 ("numtitle",[],[]) [Str "Numbered",Space,Str "Title"] -,Header 1 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "1"] -,Header 2 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "2"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 4 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "4"] -,Header 5 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "5"] -,Header 1 ("lab_el-1",[],[]) [Str "Title",Space,Str "Level",Space,Str "1"] -,Header 2 ("lab_el-2",[],[]) [Str "Title",Space,Str "Level",Space,Str "2"] -,Header 3 ("lab_el-3",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 4 ("lab_el-4",[],[]) [Str "Title",Space,Str "Level",Space,Str "4"] -,Header 5 ("lab_el-5",[],[]) [Str "Title",Space,Str "Level",Space,Str "5"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 3 ("lab_el-9",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Para [Str "+Not",Space,Str "Title"] -,Para [Str "++Not",Space,Str "Title+"] -,Para [Str "+++Not",Space,Str "Title++++",SoftBreak,Str "++++++Not",Space,Str "Title",Space,Str "6++++++"] -,Para [Str "+++++++Not",Space,Str "Title",Space,Str "7+++++++",SoftBreak,Str "+Not",Space,Str "Title+",Space,Str "[label1]",SoftBreak,Str "+Not",Space,Str "Title+[",Space,Str "label",Space,Str "]",SoftBreak,Str "+Not",Space,Str "Title+[la/bel]"] -,Header 1 ("title",[],[]) [Str "Title"] -,Header 1 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "1"] -,Header 2 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "2"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 4 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "4"] -,Header 5 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "5"] -,Header 1 ("lab_el-1",[],[]) [Str "Title",Space,Str "Level",Space,Str "1"] -,Header 2 ("lab_el-2",[],[]) [Str "Title",Space,Str "Level",Space,Str "2"] -,Header 3 ("lab_el-3",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 4 ("lab_el-4",[],[]) [Str "Title",Space,Str "Level",Space,Str "4"] -,Header 5 ("lab_el-5",[],[]) [Str "Title",Space,Str "Level",Space,Str "5"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 3 ("",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Header 3 ("lab_el-9",[],[]) [Str "Title",Space,Str "Level",Space,Str "3"] -,Para [Str "=Not",Space,Str "Title"] -,Para [Str "==Not",Space,Str "Title="] -,Para [Str "===Not",Space,Str "Title====",SoftBreak,Str "======Not",Space,Str "Title",Space,Str "6======"] -,Para [Str "=======Not",Space,Str "Title",Space,Str "7=======",SoftBreak,Str "=Not",Space,Str "Title=",Space,Str "[label1]",SoftBreak,Str "=Not",Space,Str "Title=[",Space,Str "label",Space,Str "]",SoftBreak,Str "=Not",Space,Str "Title=[la/bel]"] -,Header 1 ("quote",[],[]) [Str "Quote"] -,BlockQuote - [Para [Str "To",Space,Str "quote",Space,Str "a",Space,Str "paragraph,",Space,Str "just",Space,Str "prefix",Space,Str "it",Space,Str "by",Space,Str "a",Space,Str "TAB",SoftBreak,Str "character.",Space,Str "All",Space,Str "the",Space,Str "lines",Space,Str "of",Space,Str "the",Space,Str "paragraph",Space,Str "must",SoftBreak,Str "begin",Space,Str "with",Space,Str "a",Space,Str "TAB."]] -,Para [Str "Any",Space,Str "non-tabbed",Space,Str "line",Space,Str "closes",Space,Str "the",Space,Str "quote",Space,Str "block."] -,BlockQuote - [Para [Str "The",Space,Str "number",Space,Str "of",Space,Str "leading",Space,Str "TABs",Space,Str "identifies",Space,Str "the",Space,Str "quote",SoftBreak,Str "block",Space,Str "depth.",Space,Str "This",Space,Str "is",Space,Str "quote",Space,Str "level",Space,Str "1."] - ,BlockQuote - [Para [Str "With",Space,Str "two",Space,Str "TABs,",Space,Str "we",Space,Str "are",Space,Str "on",Space,Str "the",Space,Str "quote",SoftBreak,Str "level",Space,Str "2."] - ,BlockQuote - [Para [Str "The",Space,Str "more",Space,Str "TABs,",Space,Str "more",Space,Str "deep",Space,Str "is",SoftBreak,Str "the",Space,Str "quote",Space,Str "level."] - ,BlockQuote - [Para [Str "There",Space,Str "isn't",Space,Str "a",Space,Str "limit."]]]]] -,BlockQuote - [BlockQuote - [BlockQuote - [BlockQuote - [Para [Str "This",Space,Str "quote",Space,Str "starts",Space,Str "at",SoftBreak,Str "level",Space,Str "4."]] - ,Para [Str "Then",Space,Str "its",Space,Str "depth",Space,Str "is",Space,Str "decreased."]] - ,Para [Str "Counting",Space,Str "down,",Space,Str "one",Space,Str "by",Space,Str "one."]] - ,Para [Str "Until",Space,Str "the",Space,Str "level",Space,Str "1."]] -,BlockQuote - [BlockQuote - [BlockQuote - [Para [Str "Unlike",Space,Str "lists,",Space,Str "any",Space,Str "quote",Space,Str "block",Space,Str "is",SoftBreak,Str "independent,",Space,Str "not",Space,Str "part",Space,Str "of",Space,Str "a",Space,Str "tree."]]] - ,Para [Str "The",Space,Str "TAB",Space,Str "count",Space,Str "don't",Space,Str "need",Space,Str "to",Space,Str "be",Space,Str "incremental",SoftBreak,Str "by",Space,Str "one."] - ,BlockQuote - [BlockQuote - [BlockQuote - [Para [Str "The",Space,Str "nesting",Space,Str "don't",Space,Str "need",SoftBreak,Str "to",Space,Str "follow",Space,Str "any",Space,Str "rule."]]] - ,Para [Str "Quotes",Space,Str "can",Space,Str "be",Space,Str "opened",Space,Str "and",Space,Str "closed",SoftBreak,Str "in",Space,Str "any",Space,Str "way."] - ,BlockQuote - [BlockQuote - [BlockQuote - [Para [Str "You",Space,Str "choose."]]]]]] -,BlockQuote - [Para [Str "Some",Space,Str "targets",Space,Str "(as",Space,Str "sgml)",Space,Str "don't",Space,Str "support",Space,Str "the",SoftBreak,Str "nesting",Space,Str "of",Space,Str "quotes.",Space,Str "There",Space,Str "is",Space,Str "only",Space,Str "one",Space,Str "quote",SoftBreak,Str "level."] - ,BlockQuote - [Para [Str "In",Space,Str "this",Space,Str "case,",Space,Str "no",Space,Str "matter",Space,Str "how",Space,Str "much",SoftBreak,Str "TABs",Space,Str "are",Space,Str "used",Space,Str "to",Space,Str "define",Space,Str "the",Space,Str "quote",SoftBreak,Str "block,",Space,Str "it",Space,Str "always",Space,Str "will",Space,Str "be",Space,Str "level",Space,Str "1."]]] -,BlockQuote - [Para [Str "Spaces",Space,Str "AFTER",Space,Str "the",Space,Str "TAB",Space,Str "character",Space,Str "are",Space,Str "allowed.",SoftBreak,Str "But",Space,Str "be",Space,Str "careful,",Space,Str "it",Space,Str "can",Space,Str "be",Space,Str "confusing."]] -,Para [Str "Spaces",Space,Str "BEFORE",Space,Str "the",Space,Str "TAB",Space,Str "character",SoftBreak,Str "invalidate",Space,Str "the",Space,Str "mark.",Space,Str "It's",Space,Str "not",Space,Str "quote."] -,BlockQuote - [Para [Str "Paragraph",Space,Str "breaks",Space,Str "inside",Space,Str "a",Space,Str "quote",Space,Str "aren't",SoftBreak,Str "possible."] - ,Para [Str "This",Space,Str "sample",Space,Str "are",Space,Str "two",Space,Str "separated",Space,Str "quoted",SoftBreak,Str "paragraphs,",Space,Str "not",Space,Str "a",Space,Str "quote",Space,Str "block",Space,Str "with",SoftBreak,Str "two",Space,Str "paragraphs",Space,Str "inside."]] -,BlockQuote - [Para [Str "The",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "file",Space,Str "(EOF)",Space,Str "closes",Space,Str "the",SoftBreak,Str "currently",Space,Str "open",Space,Str "quote",Space,Str "block."]] -,Header 1 ("raw",[],[]) [Str "Raw"] -,Para [Str "A raw line.\n"] -,Para [Str " Another raw line, with leading spaces.\n"] -,Para [Str "A raw area delimited\n by lines with marks.\n"] -,Para [Str "Trailing spaces and TABs after the area marks\nare allowed, but not encouraged nor documented.\n"] -,Para [Str "\"\"\"Not",Space,Str "a",Space,Str "raw",Space,Str "line,",Space,Str "need",Space,Str "one",Space,Str "space",Space,Str "after",Space,Str "mark."] -,Para [Str "\"\"\"",SoftBreak,Str "Not",Space,Str "a",Space,Str "raw",Space,Str "area.",SoftBreak,Str "The",Space,Str "marks",Space,Str "must",Space,Str "be",Space,Str "at",Space,Str "the",Space,Str "line",Space,Str "beginning,",SoftBreak,Str "no",Space,Str "leading",Space,Str "spaces.",SoftBreak,Str "\"\"\""] -,Para [Str "The end of the file (EOF) closes\nthe currently open raw area.\n"] -,Header 1 ("verbatim",[],[]) [Str "Verbatim"] -,CodeBlock ("",[],[]) "A verbatim line.\n" -,CodeBlock ("",[],[]) " Another verbatim line, with leading spaces.\n" -,CodeBlock ("",[],[]) "A verbatim area delimited\n by lines with marks.\n" -,CodeBlock ("",[],[]) "Trailing spaces and TABs after the area marks\nare allowed, but not encouraged nor documented.\n" -,Para [Str "```Not",Space,Str "a",Space,Str "verbatim",Space,Str "line,",Space,Str "need",Space,Str "one",Space,Str "space",Space,Str "after",Space,Str "mark."] -,Para [Str "```",SoftBreak,Str "Not",Space,Str "a",Space,Str "verbatim",Space,Str "area.",SoftBreak,Str "The",Space,Str "marks",Space,Str "must",Space,Str "be",Space,Str "at",Space,Str "the",Space,Str "line",Space,Str "beginning,",SoftBreak,Str "no",Space,Str "leading",Space,Str "spaces.",SoftBreak,Str "```"] -,CodeBlock ("",[],[]) "The end of the file (EOF) closes\nthe currently open verbatim area.\n" -,Header 1 ("deflist",[],[]) [Str "Definition",Space,Str "List"] -,DefinitionList - [([Str "Definition",Space,Str "list"], - [[Plain [Str "A",Space,Str "list",Space,Str "with",Space,Str "terms"]]]) - ,([Str "Start",Space,Str "term",Space,Str "with",Space,Str "colon"], - [[Plain [Str "And",Space,Str "its",Space,Str "definition",Space,Str "follows"]]])] -,Header 1 ("numlist",[],[]) [Str "Numbered",Space,Str "List"] -,Para [Str "See",Space,Link ("",[],[]) [Str "List"] ("#list",""),Str ",",Space,Str "the",Space,Str "same",Space,Str "rules",Space,Str "apply."] -,Header 1 ("list",[],[]) [Str "List"] -,BulletList - [[Plain [Str "Use",Space,Str "the",Space,Str "hyphen",Space,Str "to",Space,Str "prefix",Space,Str "list",Space,Str "items."]] - ,[Plain [Str "There",Space,Str "must",Space,Str "be",Space,Str "one",Space,Str "space",Space,Str "after",Space,Str "the",Space,Str "hyphen."]] - ,[Plain [Str "The",Space,Str "list",Space,Str "is",Space,Str "closed",Space,Str "by",Space,Str "two",Space,Str "consecutive",Space,Str "blank",Space,Str "lines."]]] -,BulletList - [[Plain [Str "The",Space,Str "list",Space,Str "can",Space,Str "be",Space,Str "indented",Space,Str "on",Space,Str "the",Space,Str "source",Space,Str "document."]] - ,[Plain [Str "You",Space,Str "can",Space,Str "use",Space,Str "any",Space,Str "number",Space,Str "of",Space,Str "spaces."]] - ,[Plain [Str "The",Space,Str "result",Space,Str "will",Space,Str "be",Space,Str "the",Space,Str "same."]]] -,BulletList - [[Para [Str "Let",Space,Str "one",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "the",Space,Str "list",Space,Str "items."]] - ,[Para [Str "It",Space,Str "will",Space,Str "be",Space,Str "maintained",Space,Str "on",Space,Str "the",Space,Str "conversion."]] - ,[Para [Str "Some",Space,Str "targets",Space,Str "don't",Space,Str "support",Space,Str "this",Space,Str "behavior."]] - ,[Para [Str "This",Space,Str "one",Space,Str "was",Space,Str "separated",Space,Str "by",Space,Str "a",Space,Str "line",Space,Str "with",Space,Str "blanks.",SoftBreak,Str "You",Space,Str "can",Space,Str "also",Space,Str "put",Space,Str "a",Space,Str "blank",Space,Str "line",Space,Str "inside"] - ,Para [Str "the",Space,Str "item",Space,Str "contents",Space,Str "and",Space,Str "it",Space,Str "will",Space,Str "be",Space,Str "preserved."]]] -,Para [Str "-This",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "list",Space,Str "(no",Space,Str "space)"] -,Para [Str "-",Space,Str "This",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "list",Space,Str "(more",Space,Str "than",Space,Str "one",Space,Str "space)"] -,Para [Str "-",Space,Str "This",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "list",Space,Str "(a",Space,Str "TAB",Space,Str "instead",Space,Str "the",Space,Str "space)"] -,BulletList - [[BulletList - [[Plain [Str "This",Space,Str "is",Space,Str "a",Space,Str "list"]]]] - ,[OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "This",Space,Str "is",Space,Str "a",Space,Str "list"]]]] - ,[DefinitionList - [([Str "This",Space,Str "is",Space,Str "a",Space,Str "list"], - [[]])]]] -,BulletList - [[Plain [Str "This",Space,Str "is",Space,Str "the",Space,Str "\"mother\"",Space,Str "list",Space,Str "first",Space,Str "item."]] - ,[Plain [Str "Here",Space,Str "is",Space,Str "the",Space,Str "second,",Space,Str "but",Space,Str "inside",Space,Str "this",Space,Str "item,"] - ,BulletList - [[Plain [Str "there",Space,Str "is",Space,Str "a",Space,Str "sublist,",Space,Str "with",Space,Str "its",Space,Str "own",Space,Str "items."]] - ,[Plain [Str "Note",Space,Str "that",Space,Str "the",Space,Str "items",Space,Str "of",Space,Str "the",Space,Str "same",Space,Str "sublist"]] - ,[Plain [Str "must",Space,Str "have",Space,Str "the",Space,Str "same",Space,Str "indentation."] - ,BulletList - [[Plain [Str "And",Space,Str "this",Space,Str "can",Space,Str "go",Space,Str "on,",Space,Str "opening",Space,Str "sublists."] - ,BulletList - [[Plain [Str "Just",Space,Str "add",Space,Str "leading",Space,Str "spaces",Space,Str "before",Space,Str "the"]] - ,[Plain [Str "hyphen",Space,Str "and",Space,Str "sublists",Space,Str "will",Space,Str "be",Space,Str "opened."]] - ,[Plain [Str "The",Space,Str "two",Space,Str "blank",Space,Str "lines",Space,Str "closes",Space,Str "them",Space,Str "all."]]]]]]]]] -,BulletList - [[Plain [Str "When",Space,Str "nesting",Space,Str "lists,",Space,Str "the",Space,Str "additional",Space,Str "spaces",Space,Str "are",Space,Str "free."]] - ,[Plain [Str "You",Space,Str "can",Space,Str "add",Space,Str "just",Space,Str "one,"] - ,BulletList - [[Plain [Str "or",Space,Str "many."] - ,BulletList - [[Plain [Str "What",Space,Str "matters",Space,Str "is",Space,Str "to",Space,Str "put",Space,Str "more",Space,Str "than",Space,Str "the",Space,Str "previous."]] - ,[Plain [Str "But",Space,Str "remember",Space,Str "that",Space,Str "the",Space,Str "other",Space,Str "items",Space,Str "of",Space,Str "the",Space,Str "same",Space,Str "list"]] - ,[Plain [Str "must",Space,Str "use",Space,Str "the",Space,Str "same",Space,Str "indentation."]]]]]]] -,BulletList - [[Plain [Str "There",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "depth",Space,Str "limit,"] - ,BulletList - [[Plain [Str "you",Space,Str "can",Space,Str "go",Space,Str "deeper",Space,Str "and",Space,Str "deeper."] - ,BulletList - [[Plain [Str "But",Space,Str "some",Space,Str "targets",Space,Str "may",Space,Str "have",Space,Str "restrictions."] - ,BulletList - [[Plain [Str "The",Space,Str "LaTeX",Space,Str "maximum",Space,Str "is",Space,Str "here,",Space,Str "4",Space,Str "levels."]]]]]]]]] -,BulletList - [[Plain [Str "Reverse",Space,Str "nesting",Space,Str "doesn't",Space,Str "work."]] - ,[Plain [Str "Because",Space,Str "a",Space,Str "sublist",Space,Str "*must*",Space,Str "have",Space,Str "a",Space,Str "mother",Space,Str "list."]] - ,[Plain [Str "It's",Space,Str "the",Space,Str "list",Space,Str "concept,",Space,Str "not",Space,Str "a",Space,Str "txt2tags",Space,Str "limitation."]] - ,[Plain [Str "All",Space,Str "this",Space,Str "sublists",Space,Str "will",Space,Str "be",Space,Str "bumped",Space,Str "to",Space,Str "mother",Space,Str "lists."]] - ,[Plain [Str "At",Space,Str "level",Space,Str "1,",Space,Str "like",Space,Str "this",Space,Str "one."]]] -,BulletList - [[Plain [Str "Level",Space,Str "1"] - ,BulletList - [[Plain [Str "Level",Space,Str "2"] - ,BulletList - [[Plain [Str "Level",Space,Str "3"] - ,BulletList - [[Plain [Str "Level",Space,Str "4"]]]] - ,[Plain [Str "Level",Space,Str "3",Space,Str "--",Space,Str "(closed",Space,Str "Level",Space,Str "4)"]]]] - ,[Plain [Str "Level",Space,Str "2",Space,Str "--",Space,Str "(closed",Space,Str "Level",Space,Str "3)"]]]] - ,[Plain [Str "Level",Space,Str "1",Space,Str "--",Space,Str "(closed",Space,Str "Level",Space,Str "2)"]]] -,BulletList - [[Plain [Str "Level",Space,Str "1"] - ,BulletList - [[Plain [Str "Level",Space,Str "2"] - ,BulletList - [[Plain [Str "Level",Space,Str "3"] - ,BulletList - [[Plain [Str "Level",Space,Str "4"]]]]]]]] - ,[Plain [Str "Level",Space,Str "1",Space,Str "--",Space,Str "(closed",Space,Str "Level",Space,Str "4,",Space,Str "Level",Space,Str "3",Space,Str "and",Space,Str "Level",Space,Str "2)"]]] -,BulletList - [[Para [Str "Level",Space,Str "1"] - ,BulletList - [[Para [Str "Level",Space,Str "2",Space,Str "--",Space,Str "blank",Space,Str "BEFORE",Space,Str "and",Space,Str "AFTER",Space,Str "(in)"] - ,BulletList - [[Plain [Str "Level",Space,Str "3"]]]]]]] -,BulletList - [[Plain [Str "Level",Space,Str "4"]]] -,BulletList - [[Para [Str "Level",Space,Str "3"]] - ,[Para [Str "Level",Space,Str "2",Space,Str "--",Space,Str "blank",Space,Str "BEFORE",Space,Str "and",Space,Str "AFTER",Space,Str "(out)"]] - ,[Para [Str "Level",Space,Str "1"] - ,BulletList - [[Para [Str "Level",Space,Str "2",Space,Str "--",Space,Str "blank",Space,Str "BEFORE",Space,Str "(spaces)",Space,Str "and",Space,Str "AFTER",Space,Str "(TAB)"] - ,BulletList - [[Plain [Str "Level",Space,Str "3"]]]]]]] -,BulletList - [[Plain [Str "Level",Space,Str "1"] - ,BulletList - [[Plain [Str "Level",Space,Str "2"] - ,BulletList - [[Plain [Str "Level",Space,Str "3"] - ,BulletList - [[Plain [Str "Level",Space,Str "4"]] - ,[Plain [Str "Level",Space,Str "3.5",Space,Str "???"]]]] - ,[Plain [Str "Level",Space,Str "3"]] - ,[Plain [Str "Level",Space,Str "2.5",Space,Str "???"]]]] - ,[Plain [Str "Level",Space,Str "2"]] - ,[Plain [Str "Level",Space,Str "1.5",Space,Str "???"]]]] - ,[Plain [Str "Level",Space,Str "1"]]] -,BulletList - [[Plain [Str "This",Space,Str "list",Space,Str "is",Space,Str "closed",Space,Str "by",Space,Str "a",Space,Str "line",Space,Str "with",Space,Str "spaces",Space,Str "and",Space,Str "other",Space,Str "with",Space,Str "TABs"]]] -,BulletList - [[Plain [Str "This",Space,Str "list",Space,Str "is",Space,Str "NOT",Space,Str "closed",Space,Str "by",Space,Str "two",Space,Str "comment",Space,Str "lines"]]] -,BulletList - [[Plain [Str "This",Space,Str "list",Space,Str "is",Space,Str "closed",Space,Str "by",Space,Str "a",Space,Str "line",Space,Str "with",Space,Str "spaces",Space,Str "and",Space,Str "TAB,"]] - ,[Plain [Str "then",Space,Str "a",Space,Str "comment",Space,Str "line,",Space,Str "then",Space,Str "an",Space,Str "empty",Space,Str "line."]]] -,BulletList - [[Plain [Str "Level",Space,Str "1"] - ,BulletList - [[Plain [Str "Level",Space,Str "2"] - ,BulletList - [[Plain [Str "Level",Space,Str "3"]]] - ,Plain [Str "-",SoftBreak,Str "Level",Space,Str "2"]]] - ,Plain [Str "-",SoftBreak,Str "Level",Space,Str "1"]]] -,Para [Str "-"] -,BulletList - [[Plain [Str "Empty",Space,Str "item",Space,Str "with",Space,Str "trailing",Space,Str "spaces."]]] -,Para [Str "-"] -,BulletList - [[Plain [Str "Empty",Space,Str "item",Space,Str "with",Space,Str "trailing",Space,Str "TAB."]]] -,Para [Str "-"] -,BulletList - [[Plain [Str "If",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "file",Space,Str "(EOF)",Space,Str "is",Space,Str "hit,"] - ,BulletList - [[Plain [Str "all",Space,Str "the",Space,Str "currently",Space,Str "opened",Space,Str "list",Space,Str "are",Space,Str "closed,"] - ,BulletList - [[Plain [Str "just",Space,Str "like",Space,Str "when",Space,Str "using",Space,Str "the",Space,Str "two",Space,Str "blank",Space,Str "lines."]]]]]]] -,Header 1 ("table",[],[]) [Str "Table"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignRight,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cell",Space,Str "1"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignRight,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cell",Space,Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cell",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cell",Space,Str "3"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cell",Space,Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cell",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cell",Space,Str "3"]]]])] - (TableFoot ("",[],[]) - []) -,Para [Str "||",Space,Str "Cell",Space,Str "1",Space,Str "|",Space,Str "Cell",Space,Str "2",Space,Str "|",Space,Str "Cell",Space,Str "3",Space,Str "|"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cell",Space,Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cell",Space,Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Cell",Space,Str "3"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Heading"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Heading"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Heading"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "<-"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "--"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "->"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "--"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "--"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "--"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "->"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "--"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "<-"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "3+4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "3"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "4"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1+2+3"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2+3"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1+2+3+4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "7"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "8"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "A"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "B"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "D"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "E"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "F"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "3"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "3"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "3"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Jan"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Fev"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Mar"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Apr"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "May"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "20%"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "40%"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "60%"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "80%"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "100%"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "/"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "/",Space,Str "/",Space,Str "/",Space,Str "/",Space,Str "/"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "/",Space,Str "/",Space,Str "/",Space,Str "/",Space,Str "/",Space,Str "/",Space,Str "/",Space,Str "/",Space,Str "/"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "o"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "o"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "."]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "=",Space,Str "=",Space,Str "=",Space,Str "="]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "01"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "02"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "05"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "07"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "11"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "13"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "16"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "17"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "19"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "20"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "23"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "25"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "26"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "29"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "30"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "32"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "35"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "37"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "39"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "40"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault) - ,(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "3"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "6"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "7"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "8"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "9"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "A"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "B"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "C"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "D"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "E"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "F"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "0"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "3"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "4"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "5"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "6"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "7"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "8"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "9"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "A"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "B"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "C"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "D"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "E"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "F"]]]])] - (TableFoot ("",[],[]) - []) -,Table ("",[],[]) (Caption Nothing - []) - [(AlignCenter,ColWidthDefault)] - (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]])] - (TableFoot ("",[],[]) - []) -,Para [Str "|this|is|not|a|table|"] -,Para [Str "|this|",Space,Str "is|",Space,Str "not|",Space,Str "a|",Space,Str "table|"] -,Para [Str "|this",Space,Str "|is",Space,Str "|not",Space,Str "|a",Space,Str "|table",Space,Str "|"] -,Para [Str "|",Space,Str "this\t|",Space,Str "is\t|",Space,Str "not\t|",Space,Str "a\t|",Space,Str "table\t|"] -,HorizontalRule -,Para [Str "The",Space,Str "End."]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "author", MetaList [ MetaInlines [ Str "author" ] ] ) + , + ( "date", MetaInlines [ Str "date" ] ) + , + ( "includeconf", MetaString "rules.conf" ) + , + ( "title" + , MetaInlines + [ Str "Txt2tags", Space, Str "Markup", Space, Str "Rules" ] + ) + ] + } + ) + [ Para + [ Str "This" + , Space + , Str "document" + , Space + , Str "describes" + , Space + , Str "all" + , Space + , Str "the" + , Space + , Str "details" + , Space + , Str "about" + , Space + , Str "each" + , Space + , Str "txt2tags" + , Space + , Str "mark." + , SoftBreak + , Str "The" + , Space + , Str "target" + , Space + , Str "audience" + , Space + , Str "are" + , Space + , Strong + [ Str "experienced" ] + , Space + , Str "users." + , Space + , Str "You" + , Space + , Str "may" + , Space + , Str "find" + , Space + , Str "it" + , SoftBreak + , Str "useful" + , Space + , Str "if" + , Space + , Str "you" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "master" + , Space + , Str "the" + , Space + , Str "marks" + , Space + , Str "or" + , Space + , Str "solve" + , Space + , Str "a" + , Space + , Str "specific" + , Space + , Str "problem" + , SoftBreak + , Str "about" + , Space + , Str "a" + , Space + , Str "mark." + ] + , Para + [ Str "If" + , Space + , Str "you" + , Space + , Str "are" + , Space + , Str "new" + , Space + , Str "to" + , Space + , Str "txt2tags" + , Space + , Str "or" + , Space + , Str "just" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "know" + , Space + , Str "which" + , Space + , Str "are" + , Space + , Str "the" + , SoftBreak + , Str "available" + , Space + , Str "marks," + , Space + , Str "please" + , Space + , Str "read" + , Space + , Str "the" + , Space + , Link + ( "", [], [] ) + [ Str "Markup", Space, Str "Demo" ] + ( "MARKUPDEMO", "" ) + , Str "." + ] + , Para + [ Str "Note" + , Space + , Str "1:" + , Space + , Str "This" + , Space + , Str "document" + , Space + , Str "is" + , Space + , Str "generated" + , Space + , Str "directly" + , Space + , Str "from" + , Space + , Str "the" + , Space + , Str "txt2tags" + , SoftBreak + , Str "test-suite." + , Space + , Str "All" + , Space + , Str "the" + , Space + , Str "rules" + , Space + , Str "mentioned" + , Space + , Str "here" + , Space + , Str "are" + , Space + , Str "100%" + , Space + , Str "in" + , Space + , Str "sync" + , Space + , Str "with" + , Space + , Str "the" + , SoftBreak + , Str "current" + , Space + , Str "program" + , Space + , Str "code." + ] + , Para + [ Str "Note" + , Space + , Str "2:" + , Space + , Str "A" + , Space + , Str "good" + , Space + , Str "practice" + , Space + , Str "is" + , Space + , Str "to" + , Space + , Str "consult" + , Space + , Link + ( "", [], [] ) + [ Str "the", Space, Str "sources" ] + ( "rules.t2t", "" ) + , Space + , Str "when" + , SoftBreak + , Str "reading," + , Space + , Str "to" + , Space + , Str "see" + , Space + , Str "how" + , Space + , Str "the" + , Space + , Str "texts" + , Space + , Str "were" + , Space + , Str "made." + ] + , Para + [ Str "Table", Space, Str "of", Space, Str "Contents:" ] + , HorizontalRule + , Header 1 + ( "paragraph", [], [] ) + [ Str "Paragraph" ] + , Para + [ Str "A" + , Space + , Str "paragraph" + , Space + , Str "is" + , Space + , Str "composed" + , Space + , Str "by" + , Space + , Str "one" + , Space + , Str "or" + , Space + , Str "more" + , Space + , Str "lines." + , SoftBreak + , Str "A" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "(or" + , Space + , Str "a" + , Space + , Str "table," + , Space + , Str "or" + , Space + , Str "a" + , Space + , Str "list)" + , Space + , Str "ends" + , Space + , Str "the" + , SoftBreak + , Str "current" + , Space + , Str "paragraph." + ] + , Para + [ Str "Leading" + , Space + , Str "and" + , Space + , Str "trailing" + , Space + , Str "spaces" + , Space + , Str "are" + , Space + , Str "ignored." + ] + , Para + [ Str "A" + , Space + , Str "comment" + , Space + , Str "line" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "placed" + , Space + , Str "inside" + , Space + , Str "a" + , Space + , Str "paragraph." + , SoftBreak + , Str "It" + , Space + , Str "will" + , Space + , Str "not" + , Space + , Str "affect" + , Space + , Str "it." + ] + , Para + [ Str "The" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "file" + , Space + , Str "(EOF)" + , Space + , Str "closes" + , Space + , Str "the" + , SoftBreak + , Str "currently" + , Space + , Str "open" + , Space + , Str "paragraph." + ] + , Header 1 + ( "comment", [], [] ) + [ Str "Comment" ] + , Para + [ Str "%" + , Space + , Str "not" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "line" + , Space + , Str "beginning" + , Space + , Str "(at" + , Space + , Str "column" + , Space + , Str "2)" + ] + , Para + [ Str "some" + , Space + , Str "text" + , Space + , Str "%" + , Space + , Str "half" + , Space + , Str "line" + , Space + , Str "comments" + , Space + , Str "are" + , Space + , Str "not" + , Space + , Str "allowed" + ] + , Header 1 + ( "line", [], [] ) + [ Str "Line" ] + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , Para + [ Strikeout + [ Str "-----" ] + , SoftBreak + , Strikeout + [ Str "-------", Space, Str "--------" ] + ] + , Para + [ Strikeout [ Str "-------+--------" ] ] + , Para + [ Str "(" + , Space + , Strikeout + [ Str "----------------" ] + , Space + , Str ")" + ] + , Header 1 + ( "inline", [], [] ) + [ Str "Inline" ] + , Para + [ Str "i)" + , Space + , Strong + [ Str "b" ] + , Space + , Emph + [ Str "i" ] + , Space + , Underline + [ Str "u" ] + , Space + , Strikeout + [ Str "s" ] + , Space + , Code + ( "", [], [] ) "m" + , Space + , Str "r" + , Space + , RawInline + ( Format "html" ) "t" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "bo" ] + , Space + , Emph + [ Str "it" ] + , Space + , Underline + [ Str "un" ] + , Space + , Strikeout + [ Str "st" ] + , Space + , Code + ( "", [], [] ) "mo" + , Space + , Str "ra" + , Space + , RawInline + ( Format "html" ) "tg" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "bold" ] + , Space + , Emph + [ Str "ital" ] + , Space + , Underline + [ Str "undr" ] + , Space + , Strikeout + [ Str "strk" ] + , Space + , Code + ( "", [], [] ) "mono" + , Space + , Str "raw" + , Space + , RawInline + ( Format "html" ) "tggd" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "bo", Space, Str "ld" ] + , Space + , Emph + [ Str "it", Space, Str "al" ] + , Space + , Underline + [ Str "un", Space, Str "dr" ] + , Space + , Strikeout + [ Str "st", Space, Str "rk" ] + , Space + , Code + ( "", [], [] ) "mo no" + , Space + , Str "r" + , Space + , Str "aw" + , Space + , RawInline + ( Format "html" ) "tg gd" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "bo", Space, Str "*", Space, Str "ld" ] + , Space + , Emph + [ Str "it", Space, Str "/", Space, Str "al" ] + , Space + , Underline + [ Str "un", Space, Str "_", Space, Str "dr" ] + , Space + , Strikeout + [ Str "st", Space, Str "-", Space, Str "rk" ] + , Space + , Code + ( "", [], [] ) "mo ` no" + , Space + , Str "r" + , Space + , Str "\"" + , Space + , Str "aw" + , Space + , RawInline + ( Format "html" ) "tg ' gd" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "bo", Space, Str "**ld" ] + , Space + , Emph + [ Str "it", Space, Str "//al" ] + , Space + , Underline + [ Str "un", Space, Str "__dr" ] + , Space + , Strikeout + [ Str "st", Space, Str "--rk" ] + , Space + , Code + ( "", [], [] ) "mo ``no" + , Space + , Str "r" + , Space + , Str "\"\"aw" + , Space + , RawInline + ( Format "html" ) "tg ''gd" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "bo", Space, Str "**", Space, Str "ld" ] + , Space + , Emph + [ Str "it", Space, Str "//", Space, Str "al" ] + , Space + , Underline + [ Str "un", Space, Str "__", Space, Str "dr" ] + , Space + , Strikeout + [ Str "st", Space, Str "--", Space, Str "rk" ] + , Space + , Code + ( "", [], [] ) "mo `` no" + , Space + , Str "r" + , Space + , Str "\"\"" + , Space + , Str "aw" + , Space + , RawInline + ( Format "html" ) "tg '' gd" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "**bold**" ] + , Space + , Emph + [ Str "//ital//" ] + , Space + , Underline + [ Str "__undr__" ] + , Space + , Strikeout + [ Str "--strk--" ] + , Space + , Code + ( "", [], [] ) "``mono``" + , Space + , Str "\"\"raw\"\"" + , Space + , RawInline + ( Format "html" ) "''tggd''" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "*bold*" ] + , Space + , Emph + [ Str "/ital/" ] + , Space + , Underline + [ Str "_undr_" ] + , Space + , Strikeout + [ Str "-strk-" ] + , Space + , Code + ( "", [], [] ) "`mono`" + , Space + , Str "\"raw\"" + , Space + , RawInline + ( Format "html" ) "'tggd'" + ] + , Para + [ Str "i)" + , Space + , Strong + [ Str "*" ] + , Space + , Emph + [ Str "/" ] + , Space + , Underline + [ Str "_" ] + , Space + , Strikeout + [ Str "-" ] + , Space + , Code + ( "", [], [] ) "`" + , Space + , Str "\"" + , Space + , RawInline + ( Format "html" ) "'" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "**" ] + , Space + , Emph + [ Str "//" ] + , Space + , Underline + [ Str "__" ] + , Space + , Strikeout + [ Str "--" ] + , Space + , Code + ( "", [], [] ) "``" + , Space + , Str "\"\"" + , Space + , RawInline + ( Format "html" ) "''" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "***" ] + , Space + , Emph + [ Str "///" ] + , Space + , Underline + [ Str "___" ] + , Space + , Strikeout + [ Str "---" ] + , Space + , Code + ( "", [], [] ) "```" + , Space + , Str "\"\"\"" + , Space + , RawInline + ( Format "html" ) "'''" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "****" ] + , Space + , Emph + [ Str "////" ] + , Space + , Underline + [ Str "____" ] + , Space + , Strikeout + [ Str "----" ] + , Space + , Code + ( "", [], [] ) "````" + , Space + , Str "\"\"\"\"" + , Space + , RawInline + ( Format "html" ) "''''" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "*****" ] + , Space + , Emph + [ Str "/////" ] + , Space + , Underline + [ Str "_____" ] + , Space + , Strikeout + [ Str "-----" ] + , Space + , Code + ( "", [], [] ) "`````" + , Space + , Str "\"\"\"\"\"" + , Space + , RawInline + ( Format "html" ) "'''''" + , SoftBreak + , Str "i)" + , Space + , Strong + [ Str "******" ] + , Space + , Emph + [ Str "//////" ] + , Space + , Underline + [ Str "______" ] + , Space + , Strikeout + [ Str "------" ] + , Space + , Code + ( "", [], [] ) "``````" + , Space + , Str "\"\"\"\"\"\"" + , Space + , RawInline + ( Format "html" ) "''''''" + ] + , Para + [ Str "i)" + , Space + , Str "****" + , Space + , Str "////" + , Space + , Str "____" + , Space + , Str "----" + , Space + , Str "````" + , Space + , Str "\"\"\"\"" + , Space + , Str "''''" + , SoftBreak + , Str "i)" + , Space + , Str "**" + , Space + , Str "**" + , Space + , Str "//" + , Space + , Str "//" + , Space + , Str "__" + , Space + , Str "__" + , Space + , Str "--" + , Space + , Str "--" + , Space + , Str "``" + , Space + , Str "``" + , Space + , Str "\"\"" + , Space + , Str "\"\"" + , Space + , Str "''" + , Space + , Str "''" + ] + , Para + [ Str "i)" + , Space + , Str "**" + , Space + , Str "bold**" + , Space + , Str "//" + , Space + , Str "ital//" + , Space + , Str "__" + , Space + , Str "undr__" + , Space + , Str "--" + , Space + , Str "strk--" + , Space + , Str "``" + , Space + , Str "mono``" + , Space + , Str "\"\"" + , Space + , Str "raw\"\"" + , Space + , Str "''" + , Space + , Str "tggd''" + , SoftBreak + , Str "i)" + , Space + , Str "**bold" + , Space + , Str "**" + , Space + , Str "//ital" + , Space + , Str "//" + , Space + , Str "__undr" + , Space + , Str "__" + , Space + , Str "--strk" + , Space + , Str "--" + , Space + , Str "``mono" + , Space + , Str "``" + , Space + , Str "\"\"raw" + , Space + , Str "\"\"" + , Space + , Str "''tggd" + , Space + , Str "''" + , SoftBreak + , Str "i)" + , Space + , Str "**" + , Space + , Str "bold" + , Space + , Str "**" + , Space + , Str "//" + , Space + , Str "ital" + , Space + , Str "//" + , Space + , Str "__" + , Space + , Str "undr" + , Space + , Str "__" + , Space + , Str "--" + , Space + , Str "strk" + , Space + , Str "--" + , Space + , Str "``" + , Space + , Str "mono" + , Space + , Str "``" + , Space + , Str "\"\"" + , Space + , Str "raw" + , Space + , Str "\"\"" + , Space + , Str "''" + , Space + , Str "tggd" + , Space + , Str "''" + ] + , Header 1 + ( "link", [], [] ) + [ Str "Link" ] + , Para + [ Link + ( "", [], [] ) + [ Str "mailto:user@domain.com" ] + ( "user@domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "mailto:user@domain.com" ] + ( "user@domain.com", "" ) + , Str "." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "mailto:user@domain.com" ] + ( "user@domain.com", "" ) + , Str "." + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "mailto:user@domain.com" ] + ( "user@domain.com", "" ) + , Str "." + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "label" ] + ( "user@domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "mailto:user@domain.com?subject=bla" ] + ( "user@domain.com?subject=bla", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "mailto:user@domain.com?subject=bla" ] + ( "user@domain.com?subject=bla", "" ) + , Str "." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "mailto:user@domain.com?subject=bla" ] + ( "user@domain.com?subject=bla", "" ) + , Str "," + , SoftBreak + , Link + ( "", [], [] ) + [ Str "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com" ] + ( "user@domain.com?subject=bla&cc=otheruser@domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com" ] + ( "user@domain.com?subject=bla&cc=otheruser@domain.com", "" ) + , Str "." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com" ] + ( "user@domain.com?subject=bla&cc=otheruser@domain.com", "" ) + , Str "," + , SoftBreak + , Link + ( "", [], [] ) + [ Str "label" ] + ( "user@domain.com?subject=bla&cc=otheruser@domain.com", "" ) + , Str "." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "label" ] + ( "user@domain.com?subject=bla&cc=otheruser@domain.com.", "" ) + , Str "." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com" ] + ( "http://www.domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/" ] + ( "http://www.domain.com/dir/", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir///" ] + ( "http://www.domain.com/dir///", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com." ] + ( "http://www.domain.com.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com," ] + ( "http://www.domain.com,", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com." ] + ( "http://www.domain.com.", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com," ] + ( "http://www.domain.com,", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/." ] + ( "http://www.domain.com/dir/.", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "http://www.domain.com." ] + ( "http://www.domain.com.", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/." ] + ( "http://www.domain.com/dir/.", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/index.html." ] + ( "http://www.domain.com/dir/index.html.", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/index.html," ] + ( "http://www.domain.com/dir/index.html,", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/#anchor" ] + ( "http://www.domain.com/dir/#anchor", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/index.html#anchor" ] + ( "http://www.domain.com/dir/index.html#anchor", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/index.html#anchor." ] + ( "http://www.domain.com/dir/index.html#anchor.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/#anchor." ] + ( "http://www.domain.com/dir/#anchor.", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/index.html#anchor." ] + ( "http://www.domain.com/dir/index.html#anchor.", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/#anchor." ] + ( "http://www.domain.com/dir/#anchor.", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "http://www.domain.com/dir/index.html#anchor." ] + ( "http://www.domain.com/dir/index.html#anchor.", "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://domain.com?a=a@a.a&b=a+b+c." ] + ( "http://domain.com?a=a@a.a&b=a+b+c.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://domain.com?a=a@a.a&b=a+b+c," ] + ( "http://domain.com?a=a@a.a&b=a+b+c,", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c." ] + ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@." ] + ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://domain.com?a=a@a.a&b=a+b+c.#anchor" ] + ( "http://domain.com?a=a@a.a&b=a+b+c.#anchor", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" ] + ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor" ] + ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://user:password@domain.com/bla.html." ] + ( "http://user:password@domain.com/bla.html.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://user:password@domain.com/dir/." ] + ( "http://user:password@domain.com/dir/.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://user:password@domain.com." ] + ( "http://user:password@domain.com.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://user:@domain.com." ] + ( "http://user:@domain.com.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://user@domain.com." ] + ( "http://user@domain.com.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" ] + ( "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" + , "" + ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor" ] + ( "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor" + , "" + ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "label" ] + ( "www.domain.com", "" ) + , SoftBreak + , Str "[" + , Space + , Str "label" + , Space + , Link + ( "", [], [] ) + [ Str "www.domain.com" ] + ( "www.domain.com", "" ) + , Str "]" + , SoftBreak + , Link + ( "", [], [] ) + [ Str "label", Space ] + ( "www.domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "anchor", Space ] + ( "http://www.domain.com/dir/index.html#anchor.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "login", Space ] + ( "http://user:password@domain.com/bla.html", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "form", Space ] + ( "http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "form", Space, Str "&", Space, Str "anchor" ] + ( "http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "login", Space, Str "&", Space, Str "form", Space ] + ( "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "local", Space, Str "link", Space, Str "up", Space ] + ( "..", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "local", Space, Str "link", Space, Str "file", Space ] + ( "bla.html", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "local", Space, Str "link", Space, Str "anchor", Space ] + ( "#anchor", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "local", Space, Str "link", Space, Str "file/anchor" ] + ( "bla.html#anchor", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "local", Space, Str "link", Space, Str "file/anchor" ] + ( "bla.html#anchor.", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "local", Space, Str "link", Space, Str "img", Space ] + ( "abc.gif", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "www.fake.com" ] + ( "www.domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm" ] + ( "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm" + , "" + ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-" ] + ( "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-" + , "" + ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" ] + ( "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" + , "" + ) + , Str "-1%." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" ] + ( "http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" + , "" + ) + , Str "-1%." + , SoftBreak + , Link + ( "", [], [] ) + [ Str "http://L1.com" ] + ( "http://L1.com", "" ) + , Space + , Str "!" + , Space + , Link + ( "", [], [] ) + [ Str "mailto:L2@www.com" ] + ( "L2@www.com", "" ) + , Space + , Str "!" + , Space + , Link + ( "", [], [] ) + [ Str "L3" ] + ( "www.com", "" ) + , Space + , Str "!" + , Space + , Link + ( "", [], [] ) + [ Str "L4" ] + ( "w@ww.com", "" ) + , Space + , Str "!" + , Space + , Link + ( "", [], [] ) + [ Str "www.L5.com" ] + ( "www.L5.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "www.domain.com" ] + ( "www.domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "www2.domain.com" ] + ( "www2.domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "ftp.domain.com" ] + ( "ftp.domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "WWW.DOMAIN.COM" ] + ( "WWW.DOMAIN.COM", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "FTP.DOMAIN.COM" ] + ( "FTP.DOMAIN.COM", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "label" ] + ( "www.domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "label" ] + ( "ftp.domain.com", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "label" ] + ( "WWW.DOMAIN.COM", "" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "label" ] + ( "FTP.DOMAIN.COM", "" ) + , SoftBreak + , Str "[label" + , Space + , Link + ( "", [], [] ) + [ Str "www.domain.com" ] + ( "www.domain.com", "" ) + , Space + , Str "]" + , SoftBreak + , Str "[label]" + , Space + , Link + ( "", [], [] ) + [ Str "www.domain.com" ] + ( "www.domain.com", "" ) + , Str "]" + ] + , Header 1 + ( "image", [], [] ) + [ Str "Image" ] + , Para + [ Image ( "", [], [] ) [] ( "img.png", "" ) ] + , Para + [ Link + ( "", [], [] ) + [ Image ( "", [], [] ) [] ( "img.png", "" ) ] + ( "https://txt2tags.org", "" ) + ] + , Para + [ Image + ( "", [], [] ) [] + ( "img.png", "" ) + , Space + , Str "Image" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "line" + , Space + , Str "beginning." + ] + , Para + [ Str "Image" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "middle" + , Space + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "line." + ] + , Para + [ Str "Image" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "line" + , Space + , Str "end." + , Space + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + ] + , Para + [ Image + ( "", [], [] ) [] + ( "img.png", "" ) + , SoftBreak + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + , SoftBreak + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + ] + , Para + [ Image + ( "", [], [] ) [] + ( "img.png", "" ) + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + ] + , Para + [ Str "Images" + , Space + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + , Space + , Str "mixed" + , Space + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + , Space + , Str "with" + , Space + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + , Space + , Str "text." + ] + , Para + [ Str "Images" + , Space + , Str "glued" + , Space + , Str "together:" + , Space + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + , Image + ( "", [], [] ) [] + ( "img.png", "" ) + , Str "." + ] + , Para + [ Str "[img.png", Space, Str "]" ] + , Para + [ Str "[", Space, Str "img.png]" ] + , Para + [ Str "[", Space, Str "img.png", Space, Str "]" ] + , Header 1 + ( "numtitle", [], [] ) + [ Str "Numbered", Space, Str "Title" ] + , Header 1 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "1" ] + , Header 2 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "2" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 4 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "4" ] + , Header 5 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "5" ] + , Header 1 + ( "lab_el-1", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "1" ] + , Header 2 + ( "lab_el-2", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "2" ] + , Header 3 + ( "lab_el-3", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 4 + ( "lab_el-4", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "4" ] + , Header 5 + ( "lab_el-5", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "5" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 3 + ( "lab_el-9", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Para + [ Str "+Not", Space, Str "Title" ] + , Para + [ Str "++Not", Space, Str "Title+" ] + , Para + [ Str "+++Not" + , Space + , Str "Title++++" + , SoftBreak + , Str "++++++Not" + , Space + , Str "Title" + , Space + , Str "6++++++" + ] + , Para + [ Str "+++++++Not" + , Space + , Str "Title" + , Space + , Str "7+++++++" + , SoftBreak + , Str "+Not" + , Space + , Str "Title+" + , Space + , Str "[label1]" + , SoftBreak + , Str "+Not" + , Space + , Str "Title+[" + , Space + , Str "label" + , Space + , Str "]" + , SoftBreak + , Str "+Not" + , Space + , Str "Title+[la/bel]" + ] + , Header 1 + ( "title", [], [] ) + [ Str "Title" ] + , Header 1 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "1" ] + , Header 2 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "2" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 4 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "4" ] + , Header 5 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "5" ] + , Header 1 + ( "lab_el-1", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "1" ] + , Header 2 + ( "lab_el-2", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "2" ] + , Header 3 + ( "lab_el-3", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 4 + ( "lab_el-4", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "4" ] + , Header 5 + ( "lab_el-5", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "5" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 3 + ( "", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Header 3 + ( "lab_el-9", [], [] ) + [ Str "Title", Space, Str "Level", Space, Str "3" ] + , Para + [ Str "=Not", Space, Str "Title" ] + , Para + [ Str "==Not", Space, Str "Title=" ] + , Para + [ Str "===Not" + , Space + , Str "Title====" + , SoftBreak + , Str "======Not" + , Space + , Str "Title" + , Space + , Str "6======" + ] + , Para + [ Str "=======Not" + , Space + , Str "Title" + , Space + , Str "7=======" + , SoftBreak + , Str "=Not" + , Space + , Str "Title=" + , Space + , Str "[label1]" + , SoftBreak + , Str "=Not" + , Space + , Str "Title=[" + , Space + , Str "label" + , Space + , Str "]" + , SoftBreak + , Str "=Not" + , Space + , Str "Title=[la/bel]" + ] + , Header 1 + ( "quote", [], [] ) + [ Str "Quote" ] + , BlockQuote + [ Para + [ Str "To" + , Space + , Str "quote" + , Space + , Str "a" + , Space + , Str "paragraph," + , Space + , Str "just" + , Space + , Str "prefix" + , Space + , Str "it" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "TAB" + , SoftBreak + , Str "character." + , Space + , Str "All" + , Space + , Str "the" + , Space + , Str "lines" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "paragraph" + , Space + , Str "must" + , SoftBreak + , Str "begin" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "TAB." + ] + ] + , Para + [ Str "Any" + , Space + , Str "non-tabbed" + , Space + , Str "line" + , Space + , Str "closes" + , Space + , Str "the" + , Space + , Str "quote" + , Space + , Str "block." + ] + , BlockQuote + [ Para + [ Str "The" + , Space + , Str "number" + , Space + , Str "of" + , Space + , Str "leading" + , Space + , Str "TABs" + , Space + , Str "identifies" + , Space + , Str "the" + , Space + , Str "quote" + , SoftBreak + , Str "block" + , Space + , Str "depth." + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "quote" + , Space + , Str "level" + , Space + , Str "1." + ] + , BlockQuote + [ Para + [ Str "With" + , Space + , Str "two" + , Space + , Str "TABs," + , Space + , Str "we" + , Space + , Str "are" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "quote" + , SoftBreak + , Str "level" + , Space + , Str "2." + ] + , BlockQuote + [ Para + [ Str "The" + , Space + , Str "more" + , Space + , Str "TABs," + , Space + , Str "more" + , Space + , Str "deep" + , Space + , Str "is" + , SoftBreak + , Str "the" + , Space + , Str "quote" + , Space + , Str "level." + ] + , BlockQuote + [ Para + [ Str "There" + , Space + , Str "isn't" + , Space + , Str "a" + , Space + , Str "limit." + ] + ] + ] + ] + ] + , BlockQuote + [ BlockQuote + [ BlockQuote + [ BlockQuote + [ Para + [ Str "This" + , Space + , Str "quote" + , Space + , Str "starts" + , Space + , Str "at" + , SoftBreak + , Str "level" + , Space + , Str "4." + ] + ] + , Para + [ Str "Then" + , Space + , Str "its" + , Space + , Str "depth" + , Space + , Str "is" + , Space + , Str "decreased." + ] + ] + , Para + [ Str "Counting" + , Space + , Str "down," + , Space + , Str "one" + , Space + , Str "by" + , Space + , Str "one." + ] + ] + , Para + [ Str "Until" + , Space + , Str "the" + , Space + , Str "level" + , Space + , Str "1." + ] + ] + , BlockQuote + [ BlockQuote + [ BlockQuote + [ Para + [ Str "Unlike" + , Space + , Str "lists," + , Space + , Str "any" + , Space + , Str "quote" + , Space + , Str "block" + , Space + , Str "is" + , SoftBreak + , Str "independent," + , Space + , Str "not" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "tree." + ] + ] + ] + , Para + [ Str "The" + , Space + , Str "TAB" + , Space + , Str "count" + , Space + , Str "don't" + , Space + , Str "need" + , Space + , Str "to" + , Space + , Str "be" + , Space + , Str "incremental" + , SoftBreak + , Str "by" + , Space + , Str "one." + ] + , BlockQuote + [ BlockQuote + [ BlockQuote + [ Para + [ Str "The" + , Space + , Str "nesting" + , Space + , Str "don't" + , Space + , Str "need" + , SoftBreak + , Str "to" + , Space + , Str "follow" + , Space + , Str "any" + , Space + , Str "rule." + ] + ] + ] + , Para + [ Str "Quotes" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "opened" + , Space + , Str "and" + , Space + , Str "closed" + , SoftBreak + , Str "in" + , Space + , Str "any" + , Space + , Str "way." + ] + , BlockQuote + [ BlockQuote + [ BlockQuote [ Para [ Str "You", Space, Str "choose." ] ] ] + ] + ] + ] + , BlockQuote + [ Para + [ Str "Some" + , Space + , Str "targets" + , Space + , Str "(as" + , Space + , Str "sgml)" + , Space + , Str "don't" + , Space + , Str "support" + , Space + , Str "the" + , SoftBreak + , Str "nesting" + , Space + , Str "of" + , Space + , Str "quotes." + , Space + , Str "There" + , Space + , Str "is" + , Space + , Str "only" + , Space + , Str "one" + , Space + , Str "quote" + , SoftBreak + , Str "level." + ] + , BlockQuote + [ Para + [ Str "In" + , Space + , Str "this" + , Space + , Str "case," + , Space + , Str "no" + , Space + , Str "matter" + , Space + , Str "how" + , Space + , Str "much" + , SoftBreak + , Str "TABs" + , Space + , Str "are" + , Space + , Str "used" + , Space + , Str "to" + , Space + , Str "define" + , Space + , Str "the" + , Space + , Str "quote" + , SoftBreak + , Str "block," + , Space + , Str "it" + , Space + , Str "always" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "level" + , Space + , Str "1." + ] + ] + ] + , BlockQuote + [ Para + [ Str "Spaces" + , Space + , Str "AFTER" + , Space + , Str "the" + , Space + , Str "TAB" + , Space + , Str "character" + , Space + , Str "are" + , Space + , Str "allowed." + , SoftBreak + , Str "But" + , Space + , Str "be" + , Space + , Str "careful," + , Space + , Str "it" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "confusing." + ] + ] + , Para + [ Str "Spaces" + , Space + , Str "BEFORE" + , Space + , Str "the" + , Space + , Str "TAB" + , Space + , Str "character" + , SoftBreak + , Str "invalidate" + , Space + , Str "the" + , Space + , Str "mark." + , Space + , Str "It's" + , Space + , Str "not" + , Space + , Str "quote." + ] + , BlockQuote + [ Para + [ Str "Paragraph" + , Space + , Str "breaks" + , Space + , Str "inside" + , Space + , Str "a" + , Space + , Str "quote" + , Space + , Str "aren't" + , SoftBreak + , Str "possible." + ] + , Para + [ Str "This" + , Space + , Str "sample" + , Space + , Str "are" + , Space + , Str "two" + , Space + , Str "separated" + , Space + , Str "quoted" + , SoftBreak + , Str "paragraphs," + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "quote" + , Space + , Str "block" + , Space + , Str "with" + , SoftBreak + , Str "two" + , Space + , Str "paragraphs" + , Space + , Str "inside." + ] + ] + , BlockQuote + [ Para + [ Str "The" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "file" + , Space + , Str "(EOF)" + , Space + , Str "closes" + , Space + , Str "the" + , SoftBreak + , Str "currently" + , Space + , Str "open" + , Space + , Str "quote" + , Space + , Str "block." + ] + ] + , Header 1 + ( "raw", [], [] ) + [ Str "Raw" ] + , Para + [ Str "A raw line.\n" ] + , Para + [ Str " Another raw line, with leading spaces.\n" ] + , Para + [ Str "A raw area delimited\n by lines with marks.\n" ] + , Para + [ Str "Trailing spaces and TABs after the area marks\nare allowed, but not encouraged nor documented.\n" ] + , Para + [ Str "\"\"\"Not" + , Space + , Str "a" + , Space + , Str "raw" + , Space + , Str "line," + , Space + , Str "need" + , Space + , Str "one" + , Space + , Str "space" + , Space + , Str "after" + , Space + , Str "mark." + ] + , Para + [ Str "\"\"\"" + , SoftBreak + , Str "Not" + , Space + , Str "a" + , Space + , Str "raw" + , Space + , Str "area." + , SoftBreak + , Str "The" + , Space + , Str "marks" + , Space + , Str "must" + , Space + , Str "be" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "line" + , Space + , Str "beginning," + , SoftBreak + , Str "no" + , Space + , Str "leading" + , Space + , Str "spaces." + , SoftBreak + , Str "\"\"\"" + ] + , Para + [ Str "The end of the file (EOF) closes\nthe currently open raw area.\n" ] + , Header 1 + ( "verbatim", [], [] ) + [ Str "Verbatim" ] + , CodeBlock + ( "", [], [] ) "A verbatim line.\n" + , CodeBlock + ( "", [], [] ) " Another verbatim line, with leading spaces.\n" + , CodeBlock + ( "" + , [] + , [] + ) "A verbatim area delimited\n by lines with marks.\n" + , CodeBlock + ( "" + , [] + , [] + ) "Trailing spaces and TABs after the area marks\nare allowed, but not encouraged nor documented.\n" + , Para + [ Str "```Not" + , Space + , Str "a" + , Space + , Str "verbatim" + , Space + , Str "line," + , Space + , Str "need" + , Space + , Str "one" + , Space + , Str "space" + , Space + , Str "after" + , Space + , Str "mark." + ] + , Para + [ Str "```" + , SoftBreak + , Str "Not" + , Space + , Str "a" + , Space + , Str "verbatim" + , Space + , Str "area." + , SoftBreak + , Str "The" + , Space + , Str "marks" + , Space + , Str "must" + , Space + , Str "be" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "line" + , Space + , Str "beginning," + , SoftBreak + , Str "no" + , Space + , Str "leading" + , Space + , Str "spaces." + , SoftBreak + , Str "```" + ] + , CodeBlock + ( "" + , [] + , [] + ) "The end of the file (EOF) closes\nthe currently open verbatim area.\n" + , Header 1 + ( "deflist", [], [] ) + [ Str "Definition", Space, Str "List" ] + , DefinitionList + [ + ( + [ Str "Definition", Space, Str "list" ] + , + [ + [ Plain + [ Str "A" + , Space + , Str "list" + , Space + , Str "with" + , Space + , Str "terms" + ] + ] + ] + ) + , + ( + [ Str "Start" + , Space + , Str "term" + , Space + , Str "with" + , Space + , Str "colon" + ] + , + [ + [ Plain + [ Str "And" + , Space + , Str "its" + , Space + , Str "definition" + , Space + , Str "follows" + ] + ] + ] + ) + ] + , Header 1 + ( "numlist", [], [] ) + [ Str "Numbered", Space, Str "List" ] + , Para + [ Str "See" + , Space + , Link + ( "", [], [] ) + [ Str "List" ] + ( "#list", "" ) + , Str "," + , Space + , Str "the" + , Space + , Str "same" + , Space + , Str "rules" + , Space + , Str "apply." + ] + , Header 1 + ( "list", [], [] ) + [ Str "List" ] + , BulletList + [ + [ Plain + [ Str "Use" + , Space + , Str "the" + , Space + , Str "hyphen" + , Space + , Str "to" + , Space + , Str "prefix" + , Space + , Str "list" + , Space + , Str "items." + ] + ] + , + [ Plain + [ Str "There" + , Space + , Str "must" + , Space + , Str "be" + , Space + , Str "one" + , Space + , Str "space" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "hyphen." + ] + ] + , + [ Plain + [ Str "The" + , Space + , Str "list" + , Space + , Str "is" + , Space + , Str "closed" + , Space + , Str "by" + , Space + , Str "two" + , Space + , Str "consecutive" + , Space + , Str "blank" + , Space + , Str "lines." + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "The" + , Space + , Str "list" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "indented" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "source" + , Space + , Str "document." + ] + ] + , + [ Plain + [ Str "You" + , Space + , Str "can" + , Space + , Str "use" + , Space + , Str "any" + , Space + , Str "number" + , Space + , Str "of" + , Space + , Str "spaces." + ] + ] + , + [ Plain + [ Str "The" + , Space + , Str "result" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "the" + , Space + , Str "same." + ] + ] + ] + , BulletList + [ + [ Para + [ Str "Let" + , Space + , Str "one" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "the" + , Space + , Str "list" + , Space + , Str "items." + ] + ] + , + [ Para + [ Str "It" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "maintained" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "conversion." + ] + ] + , + [ Para + [ Str "Some" + , Space + , Str "targets" + , Space + , Str "don't" + , Space + , Str "support" + , Space + , Str "this" + , Space + , Str "behavior." + ] + ] + , + [ Para + [ Str "This" + , Space + , Str "one" + , Space + , Str "was" + , Space + , Str "separated" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "with" + , Space + , Str "blanks." + , SoftBreak + , Str "You" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "put" + , Space + , Str "a" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "inside" + ] + , Para + [ Str "the" + , Space + , Str "item" + , Space + , Str "contents" + , Space + , Str "and" + , Space + , Str "it" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "preserved." + ] + ] + ] + , Para + [ Str "-This" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "(no" + , Space + , Str "space)" + ] + , Para + [ Str "-" + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "(more" + , Space + , Str "than" + , Space + , Str "one" + , Space + , Str "space)" + ] + , Para + [ Str "-" + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "(a" + , Space + , Str "TAB" + , Space + , Str "instead" + , Space + , Str "the" + , Space + , Str "space)" + ] + , BulletList + [ + [ BulletList + [ + [ Plain + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + ] + ] + ] + ] + , + [ OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + ] + ] + ] + ] + , + [ DefinitionList + [ + ( + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + ] + , [ [] ] + ) + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "This" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "\"mother\"" + , Space + , Str "list" + , Space + , Str "first" + , Space + , Str "item." + ] + ] + , + [ Plain + [ Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "second," + , Space + , Str "but" + , Space + , Str "inside" + , Space + , Str "this" + , Space + , Str "item," + ] + , BulletList + [ + [ Plain + [ Str "there" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "sublist," + , Space + , Str "with" + , Space + , Str "its" + , Space + , Str "own" + , Space + , Str "items." + ] + ] + , + [ Plain + [ Str "Note" + , Space + , Str "that" + , Space + , Str "the" + , Space + , Str "items" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "same" + , Space + , Str "sublist" + ] + ] + , + [ Plain + [ Str "must" + , Space + , Str "have" + , Space + , Str "the" + , Space + , Str "same" + , Space + , Str "indentation." + ] + , BulletList + [ + [ Plain + [ Str "And" + , Space + , Str "this" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "on," + , Space + , Str "opening" + , Space + , Str "sublists." + ] + , BulletList + [ + [ Plain + [ Str "Just" + , Space + , Str "add" + , Space + , Str "leading" + , Space + , Str "spaces" + , Space + , Str "before" + , Space + , Str "the" + ] + ] + , + [ Plain + [ Str "hyphen" + , Space + , Str "and" + , Space + , Str "sublists" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "opened." + ] + ] + , + [ Plain + [ Str "The" + , Space + , Str "two" + , Space + , Str "blank" + , Space + , Str "lines" + , Space + , Str "closes" + , Space + , Str "them" + , Space + , Str "all." + ] + ] + ] + ] + ] + ] + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "When" + , Space + , Str "nesting" + , Space + , Str "lists," + , Space + , Str "the" + , Space + , Str "additional" + , Space + , Str "spaces" + , Space + , Str "are" + , Space + , Str "free." + ] + ] + , + [ Plain + [ Str "You" + , Space + , Str "can" + , Space + , Str "add" + , Space + , Str "just" + , Space + , Str "one," + ] + , BulletList + [ + [ Plain + [ Str "or", Space, Str "many." ] + , BulletList + [ + [ Plain + [ Str "What" + , Space + , Str "matters" + , Space + , Str "is" + , Space + , Str "to" + , Space + , Str "put" + , Space + , Str "more" + , Space + , Str "than" + , Space + , Str "the" + , Space + , Str "previous." + ] + ] + , + [ Plain + [ Str "But" + , Space + , Str "remember" + , Space + , Str "that" + , Space + , Str "the" + , Space + , Str "other" + , Space + , Str "items" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "same" + , Space + , Str "list" + ] + ] + , + [ Plain + [ Str "must" + , Space + , Str "use" + , Space + , Str "the" + , Space + , Str "same" + , Space + , Str "indentation." + ] + ] + ] + ] + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "There" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "depth" + , Space + , Str "limit," + ] + , BulletList + [ + [ Plain + [ Str "you" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "deeper" + , Space + , Str "and" + , Space + , Str "deeper." + ] + , BulletList + [ + [ Plain + [ Str "But" + , Space + , Str "some" + , Space + , Str "targets" + , Space + , Str "may" + , Space + , Str "have" + , Space + , Str "restrictions." + ] + , BulletList + [ + [ Plain + [ Str "The" + , Space + , Str "LaTeX" + , Space + , Str "maximum" + , Space + , Str "is" + , Space + , Str "here," + , Space + , Str "4" + , Space + , Str "levels." + ] + ] + ] + ] + ] + ] + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "Reverse" + , Space + , Str "nesting" + , Space + , Str "doesn't" + , Space + , Str "work." + ] + ] + , + [ Plain + [ Str "Because" + , Space + , Str "a" + , Space + , Str "sublist" + , Space + , Str "*must*" + , Space + , Str "have" + , Space + , Str "a" + , Space + , Str "mother" + , Space + , Str "list." + ] + ] + , + [ Plain + [ Str "It's" + , Space + , Str "the" + , Space + , Str "list" + , Space + , Str "concept," + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "txt2tags" + , Space + , Str "limitation." + ] + ] + , + [ Plain + [ Str "All" + , Space + , Str "this" + , Space + , Str "sublists" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "bumped" + , Space + , Str "to" + , Space + , Str "mother" + , Space + , Str "lists." + ] + ] + , + [ Plain + [ Str "At" + , Space + , Str "level" + , Space + , Str "1," + , Space + , Str "like" + , Space + , Str "this" + , Space + , Str "one." + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "1" ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "2" ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "3" ] + , BulletList + [ [ Plain [ Str "Level", Space, Str "4" ] ] ] + ] + , + [ Plain + [ Str "Level" + , Space + , Str "3" + , Space + , Str "--" + , Space + , Str "(closed" + , Space + , Str "Level" + , Space + , Str "4)" + ] + ] + ] + ] + , + [ Plain + [ Str "Level" + , Space + , Str "2" + , Space + , Str "--" + , Space + , Str "(closed" + , Space + , Str "Level" + , Space + , Str "3)" + ] + ] + ] + ] + , + [ Plain + [ Str "Level" + , Space + , Str "1" + , Space + , Str "--" + , Space + , Str "(closed" + , Space + , Str "Level" + , Space + , Str "2)" + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "1" ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "2" ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "3" ] + , BulletList + [ [ Plain [ Str "Level", Space, Str "4" ] ] ] + ] + ] + ] + ] + ] + , + [ Plain + [ Str "Level" + , Space + , Str "1" + , Space + , Str "--" + , Space + , Str "(closed" + , Space + , Str "Level" + , Space + , Str "4," + , Space + , Str "Level" + , Space + , Str "3" + , Space + , Str "and" + , Space + , Str "Level" + , Space + , Str "2)" + ] + ] + ] + , BulletList + [ + [ Para + [ Str "Level", Space, Str "1" ] + , BulletList + [ + [ Para + [ Str "Level" + , Space + , Str "2" + , Space + , Str "--" + , Space + , Str "blank" + , Space + , Str "BEFORE" + , Space + , Str "and" + , Space + , Str "AFTER" + , Space + , Str "(in)" + ] + , BulletList + [ [ Plain [ Str "Level", Space, Str "3" ] ] ] + ] + ] + ] + ] + , BulletList + [ [ Plain [ Str "Level", Space, Str "4" ] ] ] + , BulletList + [ + [ Para [ Str "Level", Space, Str "3" ] ] + , + [ Para + [ Str "Level" + , Space + , Str "2" + , Space + , Str "--" + , Space + , Str "blank" + , Space + , Str "BEFORE" + , Space + , Str "and" + , Space + , Str "AFTER" + , Space + , Str "(out)" + ] + ] + , + [ Para + [ Str "Level", Space, Str "1" ] + , BulletList + [ + [ Para + [ Str "Level" + , Space + , Str "2" + , Space + , Str "--" + , Space + , Str "blank" + , Space + , Str "BEFORE" + , Space + , Str "(spaces)" + , Space + , Str "and" + , Space + , Str "AFTER" + , Space + , Str "(TAB)" + ] + , BulletList + [ [ Plain [ Str "Level", Space, Str "3" ] ] ] + ] + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "1" ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "2" ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "3" ] + , BulletList + [ + [ Plain [ Str "Level", Space, Str "4" ] ] + , + [ Plain + [ Str "Level", Space, Str "3.5", Space, Str "???" ] + ] + ] + ] + , + [ Plain [ Str "Level", Space, Str "3" ] ] + , + [ Plain + [ Str "Level", Space, Str "2.5", Space, Str "???" ] + ] + ] + ] + , + [ Plain [ Str "Level", Space, Str "2" ] ] + , + [ Plain [ Str "Level", Space, Str "1.5", Space, Str "???" ] ] + ] + ] + , + [ Plain [ Str "Level", Space, Str "1" ] ] + ] + , BulletList + [ + [ Plain + [ Str "This" + , Space + , Str "list" + , Space + , Str "is" + , Space + , Str "closed" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "with" + , Space + , Str "spaces" + , Space + , Str "and" + , Space + , Str "other" + , Space + , Str "with" + , Space + , Str "TABs" + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "This" + , Space + , Str "list" + , Space + , Str "is" + , Space + , Str "NOT" + , Space + , Str "closed" + , Space + , Str "by" + , Space + , Str "two" + , Space + , Str "comment" + , Space + , Str "lines" + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "This" + , Space + , Str "list" + , Space + , Str "is" + , Space + , Str "closed" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "with" + , Space + , Str "spaces" + , Space + , Str "and" + , Space + , Str "TAB," + ] + ] + , + [ Plain + [ Str "then" + , Space + , Str "a" + , Space + , Str "comment" + , Space + , Str "line," + , Space + , Str "then" + , Space + , Str "an" + , Space + , Str "empty" + , Space + , Str "line." + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "1" ] + , BulletList + [ + [ Plain + [ Str "Level", Space, Str "2" ] + , BulletList + [ [ Plain [ Str "Level", Space, Str "3" ] ] ] + , Plain + [ Str "-", SoftBreak, Str "Level", Space, Str "2" ] + ] + ] + , Plain + [ Str "-", SoftBreak, Str "Level", Space, Str "1" ] + ] + ] + , Para + [ Str "-" ] + , BulletList + [ + [ Plain + [ Str "Empty" + , Space + , Str "item" + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "spaces." + ] + ] + ] + , Para + [ Str "-" ] + , BulletList + [ + [ Plain + [ Str "Empty" + , Space + , Str "item" + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "TAB." + ] + ] + ] + , Para + [ Str "-" ] + , BulletList + [ + [ Plain + [ Str "If" + , Space + , Str "the" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "file" + , Space + , Str "(EOF)" + , Space + , Str "is" + , Space + , Str "hit," + ] + , BulletList + [ + [ Plain + [ Str "all" + , Space + , Str "the" + , Space + , Str "currently" + , Space + , Str "opened" + , Space + , Str "list" + , Space + , Str "are" + , Space + , Str "closed," + ] + , BulletList + [ + [ Plain + [ Str "just" + , Space + , Str "like" + , Space + , Str "when" + , Space + , Str "using" + , Space + , Str "the" + , Space + , Str "two" + , Space + , Str "blank" + , Space + , Str "lines." + ] + ] + ] + ] + ] + ] + ] + , Header 1 + ( "table", [], [] ) + [ Str "Table" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignRight, ColWidthDefault ) ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cell", Space, Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignRight, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cell", Space, Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cell", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cell", Space, Str "3" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cell", Space, Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cell", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cell", Space, Str "3" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "||" + , Space + , Str "Cell" + , Space + , Str "1" + , Space + , Str "|" + , Space + , Str "Cell" + , Space + , Str "2" + , Space + , Str "|" + , Space + , Str "Cell" + , Space + , Str "3" + , Space + , Str "|" + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cell", Space, Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cell", Space, Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Cell", Space, Str "3" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Heading" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Heading" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Heading" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "<-" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "--" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "->" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "--" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "--" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "--" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "->" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "--" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "<-" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "3+4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "3" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "4" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1+2+3" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2+3" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1+2+3+4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "7" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "8" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "A" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "B" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "D" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "E" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "F" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "3" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "3" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "3" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Jan" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Fev" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Mar" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Apr" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "May" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "20%" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "40%" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "60%" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "80%" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "100%" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "/" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "o" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "o" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "." ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "=", Space, Str "=", Space, Str "=", Space, Str "=" ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "01" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "02" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "05" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "07" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "11" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "13" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "16" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "17" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "19" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "20" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "23" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "25" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "26" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "29" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "30" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "32" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "35" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "37" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "39" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "40" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + , + ( AlignCenter, ColWidthDefault ) + ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "3" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "6" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "7" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "8" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "9" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "A" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "B" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "C" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "D" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "E" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "F" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "0" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "3" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "4" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "5" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "6" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "7" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "8" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "9" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "A" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "B" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "C" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "D" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "E" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "F" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ ( AlignCenter, ColWidthDefault ) ] + ( TableHead ( "", [], [] ) [] ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Para + [ Str "|this|is|not|a|table|" ] + , Para + [ Str "|this|" + , Space + , Str "is|" + , Space + , Str "not|" + , Space + , Str "a|" + , Space + , Str "table|" + ] + , Para + [ Str "|this" + , Space + , Str "|is" + , Space + , Str "|not" + , Space + , Str "|a" + , Space + , Str "|table" + , Space + , Str "|" + ] + , Para + [ Str "|" + , Space + , Str "this\t|" + , Space + , Str "is\t|" + , Space + , Str "not\t|" + , Space + , Str "a\t|" + , Space + , Str "table\t|" + ] + , HorizontalRule + , Para + [ Str "The", Space, Str "End." ] + ] diff --git a/test/vimwiki-reader.native b/test/vimwiki-reader.native index 9b09d4904..356d1b949 100644 --- a/test/vimwiki-reader.native +++ b/test/vimwiki-reader.native @@ -1,449 +1,2419 @@ -Pandoc (Meta {unMeta = fromList [("date",MetaInlines [Str "2017-05-01"]),("title",MetaInlines [Str "title"])]}) -[Header 1 ("implemented",[],[]) [Emph [Span ("implemented",[],[]) [],Strong [Str "implemented"]]] -,Header 1 ("header",[],[]) [Str "header"] -,Header 2 ("header level two",[],[]) [Str "header",Space,Str "level",Space,Str "two"] -,Header 3 ("header level 3",[],[]) [Str "header",Space,Code ("",[],[]) "level",Space,Str "3"] -,Header 4 ("header level four",[],[]) [Str "header",Space,Strikeout [Str "level"],Space,Str "four"] -,Header 5 ("header level 5",[],[]) [Str "header",Space,Emph [Span ("level",[],[]) [],Strong [Str "level"],Space,Str "5"]] -,Header 6 ("header level 6",[],[]) [Str "header",Space,Str "level",Space,Str "6"] -,Para [Str "=======",Space,Str "not",Space,Str "a",Space,Str "header",Space,Str "========"] -,Para [Str "hi==",Space,Str "not",Space,Str "a",Space,Str "header",Space,Str "=="] -,Para [Str "===",Space,Str "not",Space,Str "a",Space,Str "header",Space,Str "=="] -,Para [Str "===",Space,Str "not",Space,Str "a",Space,Str "header",Space,Str "===-"] -,Para [Str "not",Space,Str "a",Space,Str "header:"] -,Para [Str "=n="] -,Para [Str "===",Space,Str "not",Space,Str "a",Space,Str "header",Space,Str "===="] -,Header 2 ("centred header",["justcenter"],[]) [Str "centred",Space,Str "header"] -,Header 2 ("header with some == in between",[],[]) [Str "header",Space,Str "with",Space,Str "some",Space,Code ("",[],[]) "==",Space,Str "in",Space,Str "between"] -,Header 2 ("header with some == in between",[],[]) [Str "header",Space,Str "with",Space,Str "some",Space,Str "==",Space,Str "in",Space,Str "between"] -,Header 2 ("header with some ==in between",[],[]) [Str "header",Space,Str "with",Space,Str "some",Space,Str "==in",Space,Str "between"] -,Header 2 ("emph strong and strikeout",[],[]) [Str "emph",Space,Str "strong",Space,Str "and",Space,Str "strikeout"] -,Para [Emph [Str "emph"],Space,Span ("strong",[],[]) [],Strong [Str "strong"]] -,Para [Span ("strong and emph",[],[]) [],Strong [Emph [Str "strong",Space,Str "and",Space,Str "emph"]]] -,Para [Emph [Span ("emph and strong",[],[]) [],Strong [Str "emph",Space,Str "and",Space,Str "strong"]]] -,Para [Span ("emph inside strong",[],[]) [],Strong [Emph [Str "emph",Space,Str "inside"],Space,Str "strong"]] -,Para [Span ("strong with emph",[],[]) [],Strong [Str "strong",Space,Str "with",Space,Emph [Str "emph"]]] -,Para [Emph [Span ("strong inside",[],[]) [],Strong [Str "strong",Space,Str "inside"],Space,Str "emph"]] -,Para [Emph [Strikeout [Str "strikeout"],Space,Str "inside",Space,Str "emph"]] -,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "struck",Space,Str "out"],Space,Str "with",Space,Str "emph"]] -,Para [Str "*not",SoftBreak,Str "strong*"] -,Para [Str "just",Space,Str "two",Space,Str "stars:",Space,Str "**"] -,Para [Str "just",Space,Str "two",Space,Str "underscores:",Space,Str "__"] -,Para [Str "just",Space,Str "four",Space,Str "~s:",Space,Str "~~~~"] -,Para [Str "_not",SoftBreak,Str "emph_"] -,Para [Str "~~not",SoftBreak,Str "strikeout~~"] -,Header 2 ("horizontal rule",[],[]) [Str "horizontal",Space,Str "rule"] -,Para [Str "top"] -,HorizontalRule -,Para [Str "middle"] -,HorizontalRule -,Para [Str "not",Space,Str "a",Space,Str "rule-----"] -,Para [Str "not",Space,Str "a",Space,Str "rule",Space,Str "(trailing",Space,Str "spaces):",SoftBreak,Str "-----"] -,Para [Str "not",Space,Str "a",Space,Str "rule",Space,Str "(leading",Space,Str "spaces):",SoftBreak,Str "----"] -,Header 2 ("comments",[],[]) [Str "comments"] -,Para [Str "this",SoftBreak,Str "is",Space,Str "%%",Space,Str "not",Space,Str "secret"] -,Header 2 ("inline code",[],[]) [Str "inline",Space,Str "code"] -,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Code ("",[],[]) "inline code",Str "."] -,Para [Str "Just",Space,Str "two",Space,Str "backticks:",Space,Str "``"] -,Header 2 ("preformatted text",[],[]) [Str "preformatted",Space,Str "text"] -,CodeBlock ("",[],[]) " Tyger! Tyger! burning bright\n In the forests of the night,\n What immortal hand or eye\n Could frame thy fearful symmetry?\n In what distant deeps or skies\n Burnt the fire of thine eyes?\n On what wings dare he aspire?\n What the hand dare sieze the fire?" -,Header 3 ("preformatted text with attributes",[],[]) [Str "preformatted",Space,Str "text",Space,Str "with",Space,Str "attributes"] -,CodeBlock ("",[],[("class","python"),("style","color:blue")]) " for i in range(1, 5):\n print(i)" -,Header 3 ("preformatted text with nested syntax",[],[]) [Str "preformatted",Space,Str "text",Space,Str "with",Space,Str "nested",Space,Str "syntax"] -,CodeBlock ("",["sql"],[]) "SELECT * FROM table" -,Header 3 ("empty preformatted text",[],[]) [Str "empty",Space,Str "preformatted",Space,Str "text"] -,CodeBlock ("",[],[]) "" -,Header 2 ("block quotes",[],[]) [Str "block",Space,Str "quotes"] -,BlockQuote - [Plain [Str "(indentation",Space,Str "4",Space,Str "spaces)",Space,Str "This",Space,Str "would",Space,Str "be",Space,Str "a",Space,Str "blockquote",Space,Str "in",Space,Str "Vimwiki.",Space,Str "It",Space,Str "is",Space,Str "not",Space,Span ("highlighted",[],[]) [],Strong [Str "highlighted"],Space,Str "in",Space,Str "Vim",Space,Str "but",SoftBreak,Str "(indentation",Space,Str "1",Space,Str "space",Space,Str "followed",Space,Str "by",Space,Str "1",Space,Str "tab",Space,Str "of",Space,Str "width",Space,Str "4)",Space,Str "could",Space,Str "be",Space,Str "styled",Space,Str "by",Space,Str "CSS",Space,Str "in",Space,Str "HTML.",Space,Str "Blockquotes",Space,Str "are",Space,Str "usually",Space,Str "used",Space,Str "to",Space,Str "quote",Space,Str "a",SoftBreak,Str "(indentation",Space,Str "1",Space,Str "tab",Space,Str "of",Space,Str "width",Space,Str "4)",Space,Str "long",Space,Str "piece",Space,Str "of",Space,Str "text",Space,Str "from",Space,Str "another",Space,Str "source.",Space,Strikeout [Str "blah",Space,Str "blah"],Space,Span ("-blockquote",[],[]) [Str ""],Span ("blockquote",["tag"],[]) [Str "blockquote"]]] -,Header 2 ("external links",[],[]) [Str "external",Space,Str "links"] -,Para [Link ("",[],[]) [Emph [Str "Google"],Space,Str "search",Space,Str "engine"] ("http://google.com","")] -,Para [Link ("",[],[]) [Str "http://pandoc.org"] ("http://pandoc.org","")] -,Para [Link ("",[],[]) [Str "ftp://vim.org"] ("ftp://vim.org","")] -,Para [Link ("",[],[]) [Str "http://google.com"] ("http://google.com","")] -,Para [Link ("",[],[]) [Str "email",Space,Str "me"] ("mailto:info@example.org","")] -,Para [Link ("",[],[]) [Str "mailto:hello@bye.com"] ("mailto:hello@bye.com","")] -,Header 2 ("internal links",[],[]) [Str "internal",Space,Str "links"] -,Para [Link ("",[],[]) [Str "This is a link"] ("This is a link","wikilink")] -,Para [Link ("",[],[]) [Str "Description",Space,Str "of",Space,Str "the",Space,Str "link"] ("This is a link source","wikilink")] -,Para [Link ("",[],[]) [Str "projects/Important Project 1"] ("projects/Important Project 1","wikilink"),SoftBreak,Link ("",[],[]) [Str "../index"] ("../index","wikilink"),SoftBreak,Link ("",[],[]) [Str "Other",Space,Str "files"] ("a subdirectory/","wikilink")] -,Para [Link ("",[],[]) [Str "try",Space,Str "me",Space,Str "to",Space,Str "test",Space,Str "tag",Space,Str "anchors"] ("#tag-one","wikilink")] -,Para [Link ("",[],[]) [Str "try",Space,Str "me",Space,Str "to",Space,Str "test",Space,Str "header",Space,Str "anchors"] ("#block quotes","wikilink")] -,Para [Link ("",[],[]) [Str "try",Space,Str "me",Space,Str "to",Space,Str "test",Space,Str "strong",Space,Str "anchors"] ("#strong","wikilink")] -,Para [Link ("",[],[]) [Str "Tasks",Space,Str "for",Space,Str "tomorrow"] ("Todo List#Tomorrow","wikilink")] -,Para [Link ("",[],[]) [Str "diary:2017-05-01"] ("diary/2017-05-01","wikilink")] -,Para [Link ("",[],[]) [Str "Important",Space,Str "Data"] ("file:../assets/data.csv","")] -,Header 3 ("links with thumbnails",[],[]) [Str "links",Space,Str "with",Space,Str "thumbnails"] -,Para [Link ("",[],[]) [Image ("",[],[]) [Str ""] ("./movie.jpg","")] ("http://www.google.com","")] -,Header 2 ("images",[],[]) [Str "images"] -,Para [Image ("",[],[]) [Str ""] ("file:./lalune.jpg","")] -,Para [Image ("",[],[]) [Str "Vimwiki"] ("http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png",""),SoftBreak,Image ("",[],[]) [Str ""] ("file:./movie.jpg","")] -,Header 3 ("image with attributes",[],[]) [Str "image",Space,Str "with",Space,Str "attributes"] -,Para [Image ("",[],[("style","width:150px;height:120px;")]) [Emph [Str "cool",Space,Str "stuff"]] ("lalune.jpg","")] -,Para [Image ("",[],[("style","font-color:red")]) [Span ("Non-existing",[],[]) [],Strong [Str "Non-existing"],Space,Str "image"] ("nonexist.jpg","")] -,Para [Image ("",[],[("style","width:150px;height:120px;")]) [Emph [Str "cool",Space,Str "stuff"]] ("lalune.jpg","")] -,Header 2 ("lists",[],[]) [Str "lists"] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "ordered",Space,Str "list",Space,Str "item",Space,Str "1,",Space,Str "and",Space,Str "here",Space,Str "is",Space,Str "some",Space,Str "math",Space,Str "belonging",Space,Str "to",Space,Str "list",Space,Str "item",Space,Str "1"] - ,Para [Math DisplayMath "a^2 + b^2 = c^2"] - ,Plain [Str "and",Space,Str "some",Space,Str "preformatted",Space,Str "and",Space,Str "tables",Space,Str "belonging",Space,Str "to",Space,Str "item",Space,Str "1",Space,Str "as",Space,Str "well"] - ,CodeBlock ("",[],[]) "I'm part of item 1." - ,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "this",Space,Str "table"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "is"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "also",Space,Str "a",Space,Str "part"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "of",Space,Str "item",Space,Str "1"]]]])] - (TableFoot ("",[],[]) - []) - ,Plain [Str "and",Space,Str "some",Space,Str "more",Space,Str "text",Space,Str "belonging",Space,Str "to",Space,Str "item",Space,Str "1."]] - ,[Plain [Str "ordered",Space,Str "list",Space,Str "item",Space,Str "2"]]] -,BulletList - [[Plain [Str "Bulleted",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Bulleted",Space,Str "list",Space,Str "item",Space,Str "2"]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Bulleted",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "the",Space,Str "#",Space,Str "become",Space,Str "numbers",Space,Str "when",Space,Str "converted",Space,Str "to",Space,Str "HTML"]]] -,BulletList - [[Plain [Str "Bulleted",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Bulleted",Space,Str "list",Space,Str "item",Space,Str "2"]]] -,BulletList - [[Plain [Str "Item",Space,Str "1"]] - ,[Plain [Str "Item",Space,Str "2"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Sub",Space,Str "item",Space,Str "1",Space,Str "(indentation",Space,Str "4",Space,Str "spaces)",SoftBreak,Str "Sub",Space,Str "item",Space,Str "1",Space,Str "continued",Space,Str "line.",SoftBreak,Str "Sub",Space,Str "item",Space,Str "1",Space,Str "next",Space,Str "continued",Space,Str "line."]] - ,[Plain [Str "Sub",Space,Str "item",Space,Str "2,",Space,Str "as",Space,Str "an",Space,Str "ordered",Space,Str "list",Space,Str "item",Space,Str "even",Space,Str "though",Space,Str "the",Space,Str "identifier",Space,Str "is",Space,Code ("",[],[]) "*",Space,Str "(indentation",Space,Str "2",Space,Str "spaces",Space,Str "followed",Space,Str "by",Space,Str "one",Space,Str "tab",Space,Str "of",Space,Str "width",Space,Str "4)"]] - ,[Plain [Str "etc.",SoftBreak,Str "Continuation",Space,Str "of",Space,Str "Item",Space,Str "2",SoftBreak,Str "Next",Space,Str "continuation",Space,Str "of",Space,Str "Item",Space,Str "2"]]]]] -,Para [Str "But",Space,Str "this",Space,Str "is",Space,Str "a",Space,Str "new",Space,Str "paragraph."] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "1"] - ,BulletList - [[Plain [Code ("",[],[]) "1.1"]]]] - ,[Plain [Str "2"] - ,BulletList - [[Plain [Str "2.1"]]]]] -,BulletList - [[Plain [Str "3"]]] -,Header 3 ("ordered lists with non-# identifiers",[],[]) [Str "ordered",Space,Str "lists",Space,Str "with",Space,Str "non-#",Space,Str "identifiers"] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "2"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "3"]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "2"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "3"]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "2"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "3"]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "2"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "3"]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "2"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "3"]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "2"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "3"]]] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "2"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "item",Space,Str "3"]]] -,BulletList - [[Plain [Str "Bulleted",Space,Str "list",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Bulleted",Space,Str "list",Space,Str "item",Space,Str "2"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Numbered",Space,Str "list",Space,Str "sub",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "more",Space,Str "..."] - ,BulletList - [[Plain [Str "and",Space,Str "more",Space,Str "..."]] - ,[Plain [Str "..."]]]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "sub",Space,Str "item",Space,Str "3"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Numbered",Space,Str "list",Space,Str "sub",Space,Str "sub",Space,Str "item",Space,Str "1"]] - ,[Plain [Str "Numbered",Space,Str "list",Space,Str "sub",Space,Str "sub",Space,Str "item",Space,Str "2"]]]] - ,[Plain [Str "etc."]]]] - ,[Plain [Str "Bulleted",Space,Str "list",Space,Str "item",Space,Str "3"]]] -,Header 2 ("todo lists",[],[]) [Str "todo",Space,Str "lists"] -,BulletList - [[Plain [Span ("",["done0"],[]) [],Str "task",Space,Str "1"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Span ("",["done1"],[]) [],Str "5"]]]] - ,[Plain [Span ("",["done2"],[]) [],Str "3"]] - ,[Plain [Str "[]",Space,Str "not",Space,Str "a",Space,Str "todo",Space,Str "item"]] - ,[Plain [Str "[",Space,Str "]not",Space,Str "a",Space,Str "todo",Space,Str "item"]] - ,[Plain [Str "[r]",Space,Str "not",Space,Str "a",Space,Str "todo",Space,Str "item"]] - ,[Plain [Str "[",Space,Str "]",Space,Str "not",Space,Str "a",Space,Str "todo",Space,Str "item"]] - ,[Plain [Span ("",["done2"],[]) [],Str "a",Space,Str "tab",Space,Str "in",Space,Str "the",Space,Str "todo",Space,Str "list",Space,Str "marker",Space,Code ("",[],[]) "[ ]"] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Span ("",["done3"],[]) [],Str "4",SoftBreak,Str "5"]] - ,[Plain [Span ("",["done4"],[]) []] - ,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "a"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b"]]]])] - (TableFoot ("",[],[]) - [])]]] - ,[Plain [Span ("",["done4"],[]) [],Str "task",Space,Str "2"]]] -,Header 2 ("math",[],[]) [Str "math"] -,Para [Math InlineMath " \\sum_i a_i^2 = 1 "] -,Para [Math DisplayMath "\\sum_i a_i^2\n=\n1"] -,Para [Math DisplayMath "\\begin{aligned}\n\\sum_i a_i^2 &= 1 + 1 \\\\\n&= 2.\n\\end{aligned}"] -,Para [Str "edge",Space,Str "case",Space,Str "(the",Space,Code ("",[],[]) "c^2 + ",Space,Str "after",Space,Str "the",Space,Str "multline",Space,Str "tag",Space,Str "is",Space,Str "in",Space,Str "the",Space,Str "equation):"] -,Para [Math DisplayMath "\\begin{gathered}\nc^2 + \na^2 + b^2\n\\end{gathered}"] -,Para [Str "edge",Space,Str "case",Space,Str "(the",Space,Str "tag",Space,Str "is",Space,Code ("",[],[]) "hello%bye",Str ")"] -,Para [Math DisplayMath "\\begin{hello%bye}\n\\int_a^b f(x) dx\n\\end{hello%bye}"] -,Para [Str "Just",Space,Str "two",Space,Str "dollar",Space,Str "signs:",Space,Str "$$"] -,Para [Str "[not",Space,Str "math]",Space,Str "You",Space,Str "have",Space,Str "$1",SoftBreak,Str "and",Space,Str "I",Space,Str "have",Space,Str "$1."] -,Header 2 ("tags",[],[]) [Str "tags"] -,Para [Span ("-tag-one",[],[]) [Str ""],Span ("tag-one",["tag"],[]) [Str "tag-one"],Space,Span ("-tag-two",[],[]) [Str ""],Span ("tag-two",["tag"],[]) [Str "tag-two"]] -,Header 2 ("tables",[],[]) [Str "tables"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Year"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Temperature",Space,Str "(low)"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "Temperature",Space,Str "(high)"]]]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1900"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "-10"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "25"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1910"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "-15"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "30"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1920"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "-10"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "32"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1930"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Emph [Str "N/A"]]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Emph [Str "N/A"]]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "1940"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "-2"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "40"]]]])] - (TableFoot ("",[],[]) - []) -,Header 3 ("centered headerless tables",[],[]) [Str "centered",Space,Str "headerless",Space,Str "tables"] -,Div ("",["center"],[]) - [Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "a"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "d"]]]])] - (TableFoot ("",[],[]) - [])] -,Header 2 ("paragraphs",[],[]) [Str "paragraphs"] -,Para [Str "This",Space,Str "is",Space,Str "first",Space,Str "paragraph",SoftBreak,Str "with",Space,Str "two",Space,Str "lines."] -,Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "second",Space,Str "paragraph",Space,Str "with",SoftBreak,Str "two",Space,Str "lines",Space,Str "after",Space,Str "many",Space,Str "blank",Space,Str "lines."] -,Header 2 ("definition list",[],[]) [Str "definition",Space,Str "list"] -,DefinitionList - [([Str "Term",Space,Str "1"], - [[Plain [Str "Definition",Space,Str "1"]]]) - ,([Str "Term",Space,Str "2"], - [[Plain [Str "Definition",Space,Str "2"]] - ,[Plain [Str "Definition",Space,Str "3"]]]) - ,([Str "Term",Space,Str "::",Space,Span ("separated",[],[]) [],Strong [Str "separated"],Space,Str "by",Space,Str "::",Space,Emph [Str "double",Space,Str "colons"]], - [[Plain [Str "Def1"]] - ,[Plain [Str "Def2"]]]) - ,([Str "Term",Space,Str "with",Space,Str "lots",Space,Str "of",Space,Str "trailing",Space,Str "colons:::::::"], - [[Plain [Str "Definition"]]]) - ,([Str "::",Space,Str "This",Space,Str "is",Space,Str "::",Space,Str "A",Space,Str "term",Space,Str "(rather",Space,Str "than",Space,Str "a",Space,Str "definition)"], - [[Plain [Str "and",Space,Str "this",Space,Str "is",Space,Str "a",Space,Str "definition"]]]) - ,([Str "Term",Space,Str "Without",Space,Str "definitions"], - [[]]) - ,([Str "Part",Space,Str "::",Space,Str "of",Space,Str "::",Space,Str "dt"], - [[Plain [Str "part",Space,Str "of",Space,Str "::dd"]]])] -,DefinitionList - [([], - [[Plain [Str "Definition",Space,Str "1",Space,Str "without",Space,Str "a",Space,Str "term"]] - ,[Plain [Str "Definition",Space,Str "2",Space,Str "without",Space,Str "a",Space,Str "term"]]])] -,DefinitionList - [([Str "T1"], - [[Plain [Str "D1"]]])] -,Para [Str "new",Space,Str "paragraph"] -,DefinitionList - [([Str "T1"], - [[Plain [Str "D1"]]])] -,Para [Str "Not::Definition"] -,Para [Str "Not",Space,Str "::Definition"] -,Para [Str "::Not",Space,Str "definition"] -,BlockQuote - [Plain [Str "::",Space,Str "blockquote"]] -,BlockQuote - [Plain [Str "block",Space,Str "::",Space,Str "quote"]] -,Header 2 ("metadata placeholders",[],[]) [Str "metadata",Space,Str "placeholders"] -,Para [Str "%this",Space,Str "is",Space,Str "not",Space,Str "a",Space,Str "placeholder"] -,Para [Str "placeholders",SoftBreak,Str "serves",Space,Str "as",Space,Str "space",Space,Str "/",Space,Str "softbreak",Space,Str "in",Space,Str "paragraphs"] -,Header 2 ("sup, sub",[],[]) [Str "sup,",Space,Str "sub"] -,Para [Str "super",Superscript [Str "script"]] -,Para [Str "sub",Subscript [Str "script"]] -,Header 2 ("the todo mark",[],[]) [Str "the",Space,Str "todo",Space,Str "mark"] -,Para [Span ("",["todo"],[]) [Str "TODO:"]] -,Header 1 ("not implemented yet",[],[]) [Emph [Span ("not implemented yet",[],[]) [],Strong [Str "not",Space,Str "implemented",Space,Str "yet"]]] -,Header 2 ("tables with spans",[],[]) [Str "tables",Space,Str "with",Space,Str "spans"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "a"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "d"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "\\/"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "e"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ">"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "f"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "\\/"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "\\/"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ">"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "g"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "h"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ">"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ">"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str ">"]]]])] - (TableFoot ("",[],[]) - []) -,Header 2 ("tables with multiple lines of headers",[],[]) [Str "tables",Space,Str "with",Space,Str "multiple",Space,Str "lines",Space,Str "of",Space,Str "headers"] -,Table ("",[],[]) (Caption Nothing - []) - [(AlignDefault,ColWidthDefault) - ,(AlignDefault,ColWidthDefault)] - (TableHead ("",[],[]) - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - []]]) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "a"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "b"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "c"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "d"]]] - ,Row ("",[],[]) - [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "---"]] - ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Str "---"]]]])] - (TableFoot ("",[],[]) - []) -,Header 2 ("some other placeholders",[],[]) [Str "some",Space,Str "other",Space,Str "placeholders"] -,Para [Code ("",[],[]) "template",Space,Str "placeholder",Space,Str "is",Space,Str "ignored."] -,Para [Code ("",[],[]) "nohtml",Space,Str "placeholder",Space,Str "is",Space,Str "ignored."]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "date", MetaInlines [ Str "2017-05-01" ] ) + , + ( "title", MetaInlines [ Str "title" ] ) + ] + } + ) + [ Header 1 + ( "implemented", [], [] ) + [ Emph + [ Span + ( "implemented", [], [] ) [] + , Strong + [ Str "implemented" ] + ] + ] + , Header 1 + ( "header", [], [] ) + [ Str "header" ] + , Header 2 + ( "header level two", [], [] ) + [ Str "header", Space, Str "level", Space, Str "two" ] + , Header 3 + ( "header level 3", [], [] ) + [ Str "header", Space, Code ( "", [], [] ) "level", Space, Str "3" ] + , Header 4 + ( "header level four", [], [] ) + [ Str "header" + , Space + , Strikeout + [ Str "level" ] + , Space + , Str "four" + ] + , Header 5 + ( "header level 5", [], [] ) + [ Str "header" + , Space + , Emph + [ Span + ( "level", [], [] ) [] + , Strong + [ Str "level" ] + , Space + , Str "5" + ] + ] + , Header 6 + ( "header level 6", [], [] ) + [ Str "header", Space, Str "level", Space, Str "6" ] + , Para + [ Str "=======" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + , Space + , Str "========" + ] + , Para + [ Str "hi==" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + , Space + , Str "==" + ] + , Para + [ Str "===" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + , Space + , Str "==" + ] + , Para + [ Str "===" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + , Space + , Str "===-" + ] + , Para + [ Str "not", Space, Str "a", Space, Str "header:" ] + , Para + [ Str "=n=" ] + , Para + [ Str "===" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + , Space + , Str "====" + ] + , Header 2 + ( "centred header", [ "justcenter" ], [] ) + [ Str "centred", Space, Str "header" ] + , Header 2 + ( "header with some == in between", [], [] ) + [ Str "header" + , Space + , Str "with" + , Space + , Str "some" + , Space + , Code + ( "", [], [] ) "==" + , Space + , Str "in" + , Space + , Str "between" + ] + , Header 2 + ( "header with some == in between", [], [] ) + [ Str "header" + , Space + , Str "with" + , Space + , Str "some" + , Space + , Str "==" + , Space + , Str "in" + , Space + , Str "between" + ] + , Header 2 + ( "header with some ==in between", [], [] ) + [ Str "header" + , Space + , Str "with" + , Space + , Str "some" + , Space + , Str "==in" + , Space + , Str "between" + ] + , Header 2 + ( "emph strong and strikeout", [], [] ) + [ Str "emph" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "strikeout" + ] + , Para + [ Emph + [ Str "emph" ] + , Space + , Span + ( "strong", [], [] ) [] + , Strong + [ Str "strong" ] + ] + , Para + [ Span + ( "strong and emph", [], [] ) [] + , Strong + [ Emph [ Str "strong", Space, Str "and", Space, Str "emph" ] ] + ] + , Para + [ Emph + [ Span + ( "emph and strong", [], [] ) [] + , Strong + [ Str "emph", Space, Str "and", Space, Str "strong" ] + ] + ] + , Para + [ Span + ( "emph inside strong", [], [] ) [] + , Strong + [ Emph [ Str "emph", Space, Str "inside" ], Space, Str "strong" ] + ] + , Para + [ Span + ( "strong with emph", [], [] ) [] + , Strong + [ Str "strong", Space, Str "with", Space, Emph [ Str "emph" ] ] + ] + , Para + [ Emph + [ Span + ( "strong inside", [], [] ) [] + , Strong + [ Str "strong", Space, Str "inside" ] + , Space + , Str "emph" + ] + ] + , Para + [ Emph + [ Strikeout + [ Str "strikeout" ] + , Space + , Str "inside" + , Space + , Str "emph" + ] + ] + , Para + [ Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "struck", Space, Str "out" ] + , Space + , Str "with" + , Space + , Str "emph" + ] + ] + , Para + [ Str "*not", SoftBreak, Str "strong*" ] + , Para + [ Str "just" + , Space + , Str "two" + , Space + , Str "stars:" + , Space + , Str "**" + ] + , Para + [ Str "just" + , Space + , Str "two" + , Space + , Str "underscores:" + , Space + , Str "__" + ] + , Para + [ Str "just" + , Space + , Str "four" + , Space + , Str "~s:" + , Space + , Str "~~~~" + ] + , Para + [ Str "_not", SoftBreak, Str "emph_" ] + , Para + [ Str "~~not", SoftBreak, Str "strikeout~~" ] + , Header 2 + ( "horizontal rule", [], [] ) + [ Str "horizontal", Space, Str "rule" ] + , Para + [ Str "top" ] + , HorizontalRule + , Para + [ Str "middle" ] + , HorizontalRule + , Para + [ Str "not", Space, Str "a", Space, Str "rule-----" ] + , Para + [ Str "not" + , Space + , Str "a" + , Space + , Str "rule" + , Space + , Str "(trailing" + , Space + , Str "spaces):" + , SoftBreak + , Str "-----" + ] + , Para + [ Str "not" + , Space + , Str "a" + , Space + , Str "rule" + , Space + , Str "(leading" + , Space + , Str "spaces):" + , SoftBreak + , Str "----" + ] + , Header 2 + ( "comments", [], [] ) + [ Str "comments" ] + , Para + [ Str "this" + , SoftBreak + , Str "is" + , Space + , Str "%%" + , Space + , Str "not" + , Space + , Str "secret" + ] + , Header 2 + ( "inline code", [], [] ) + [ Str "inline", Space, Str "code" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Code + ( "", [], [] ) "inline code" + , Str "." + ] + , Para + [ Str "Just" + , Space + , Str "two" + , Space + , Str "backticks:" + , Space + , Str "``" + ] + , Header 2 + ( "preformatted text", [], [] ) + [ Str "preformatted", Space, Str "text" ] + , CodeBlock + ( "" + , [] + , [] + ) " Tyger! Tyger! burning bright\n In the forests of the night,\n What immortal hand or eye\n Could frame thy fearful symmetry?\n In what distant deeps or skies\n Burnt the fire of thine eyes?\n On what wings dare he aspire?\n What the hand dare sieze the fire?" + , Header 3 + ( "preformatted text with attributes", [], [] ) + [ Str "preformatted" + , Space + , Str "text" + , Space + , Str "with" + , Space + , Str "attributes" + ] + , CodeBlock + ( "" + , [] + , + [ ( "class", "python" ), ( "style", "color:blue" ) ] + ) " for i in range(1, 5):\n print(i)" + , Header 3 + ( "preformatted text with nested syntax", [], [] ) + [ Str "preformatted" + , Space + , Str "text" + , Space + , Str "with" + , Space + , Str "nested" + , Space + , Str "syntax" + ] + , CodeBlock + ( "", [ "sql" ], [] ) "SELECT * FROM table" + , Header 3 + ( "empty preformatted text", [], [] ) + [ Str "empty", Space, Str "preformatted", Space, Str "text" ] + , CodeBlock + ( "", [], [] ) "" + , Header 2 + ( "block quotes", [], [] ) + [ Str "block", Space, Str "quotes" ] + , BlockQuote + [ Plain + [ Str "(indentation" + , Space + , Str "4" + , Space + , Str "spaces)" + , Space + , Str "This" + , Space + , Str "would" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "blockquote" + , Space + , Str "in" + , Space + , Str "Vimwiki." + , Space + , Str "It" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Span + ( "highlighted", [], [] ) [] + , Strong + [ Str "highlighted" ] + , Space + , Str "in" + , Space + , Str "Vim" + , Space + , Str "but" + , SoftBreak + , Str "(indentation" + , Space + , Str "1" + , Space + , Str "space" + , Space + , Str "followed" + , Space + , Str "by" + , Space + , Str "1" + , Space + , Str "tab" + , Space + , Str "of" + , Space + , Str "width" + , Space + , Str "4)" + , Space + , Str "could" + , Space + , Str "be" + , Space + , Str "styled" + , Space + , Str "by" + , Space + , Str "CSS" + , Space + , Str "in" + , Space + , Str "HTML." + , Space + , Str "Blockquotes" + , Space + , Str "are" + , Space + , Str "usually" + , Space + , Str "used" + , Space + , Str "to" + , Space + , Str "quote" + , Space + , Str "a" + , SoftBreak + , Str "(indentation" + , Space + , Str "1" + , Space + , Str "tab" + , Space + , Str "of" + , Space + , Str "width" + , Space + , Str "4)" + , Space + , Str "long" + , Space + , Str "piece" + , Space + , Str "of" + , Space + , Str "text" + , Space + , Str "from" + , Space + , Str "another" + , Space + , Str "source." + , Space + , Strikeout + [ Str "blah", Space, Str "blah" ] + , Space + , Span + ( "-blockquote", [], [] ) + [ Str "" ] + , Span + ( "blockquote", [ "tag" ], [] ) + [ Str "blockquote" ] + ] + ] + , Header 2 + ( "external links", [], [] ) + [ Str "external", Space, Str "links" ] + , Para + [ Link + ( "", [], [] ) + [ Emph + [ Str "Google" ] + , Space + , Str "search" + , Space + , Str "engine" + ] + ( "http://google.com", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "http://pandoc.org" ] + ( "http://pandoc.org", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "ftp://vim.org" ] + ( "ftp://vim.org", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "http://google.com" ] + ( "http://google.com", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "email", Space, Str "me" ] + ( "mailto:info@example.org", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "mailto:hello@bye.com" ] + ( "mailto:hello@bye.com", "" ) + ] + , Header 2 + ( "internal links", [], [] ) + [ Str "internal", Space, Str "links" ] + , Para + [ Link + ( "", [], [] ) + [ Str "This is a link" ] + ( "This is a link", "wikilink" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "Description" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "link" + ] + ( "This is a link source", "wikilink" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "projects/Important Project 1" ] + ( "projects/Important Project 1", "wikilink" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "../index" ] + ( "../index", "wikilink" ) + , SoftBreak + , Link + ( "", [], [] ) + [ Str "Other", Space, Str "files" ] + ( "a subdirectory/", "wikilink" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "try" + , Space + , Str "me" + , Space + , Str "to" + , Space + , Str "test" + , Space + , Str "tag" + , Space + , Str "anchors" + ] + ( "#tag-one", "wikilink" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "try" + , Space + , Str "me" + , Space + , Str "to" + , Space + , Str "test" + , Space + , Str "header" + , Space + , Str "anchors" + ] + ( "#block quotes", "wikilink" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "try" + , Space + , Str "me" + , Space + , Str "to" + , Space + , Str "test" + , Space + , Str "strong" + , Space + , Str "anchors" + ] + ( "#strong", "wikilink" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "Tasks", Space, Str "for", Space, Str "tomorrow" ] + ( "Todo List#Tomorrow", "wikilink" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "diary:2017-05-01" ] + ( "diary/2017-05-01", "wikilink" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "Important", Space, Str "Data" ] + ( "file:../assets/data.csv", "" ) + ] + , Header 3 + ( "links with thumbnails", [], [] ) + [ Str "links", Space, Str "with", Space, Str "thumbnails" ] + , Para + [ Link + ( "", [], [] ) + [ Image ( "", [], [] ) [ Str "" ] ( "./movie.jpg", "" ) ] + ( "http://www.google.com", "" ) + ] + , Header 2 + ( "images", [], [] ) + [ Str "images" ] + , Para + [ Image ( "", [], [] ) [ Str "" ] ( "file:./lalune.jpg", "" ) ] + , Para + [ Image + ( "", [], [] ) + [ Str "Vimwiki" ] + ( "http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png", "" ) + , SoftBreak + , Image + ( "", [], [] ) + [ Str "" ] + ( "file:./movie.jpg", "" ) + ] + , Header 3 + ( "image with attributes", [], [] ) + [ Str "image", Space, Str "with", Space, Str "attributes" ] + , Para + [ Image + ( "", [], [ ( "style", "width:150px;height:120px;" ) ] ) + [ Emph [ Str "cool", Space, Str "stuff" ] ] + ( "lalune.jpg", "" ) + ] + , Para + [ Image + ( "", [], [ ( "style", "font-color:red" ) ] ) + [ Span + ( "Non-existing", [], [] ) [] + , Strong + [ Str "Non-existing" ] + , Space + , Str "image" + ] + ( "nonexist.jpg", "" ) + ] + , Para + [ Image + ( "", [], [ ( "style", "width:150px;height:120px;" ) ] ) + [ Emph [ Str "cool", Space, Str "stuff" ] ] + ( "lalune.jpg", "" ) + ] + , Header 2 + ( "lists", [], [] ) + [ Str "lists" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "ordered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1," + , Space + , Str "and" + , Space + , Str "here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "math" + , Space + , Str "belonging" + , Space + , Str "to" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + , Para + [ Math DisplayMath "a^2 + b^2 = c^2" ] + , Plain + [ Str "and" + , Space + , Str "some" + , Space + , Str "preformatted" + , Space + , Str "and" + , Space + , Str "tables" + , Space + , Str "belonging" + , Space + , Str "to" + , Space + , Str "item" + , Space + , Str "1" + , Space + , Str "as" + , Space + , Str "well" + ] + , CodeBlock + ( "", [], [] ) "I'm part of item 1." + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "this", Space, Str "table" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "is" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain + [ Str "also", Space, Str "a", Space, Str "part" ] + ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "of", Space, Str "item", Space, Str "1" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Plain + [ Str "and" + , Space + , Str "some" + , Space + , Str "more" + , Space + , Str "text" + , Space + , Str "belonging" + , Space + , Str "to" + , Space + , Str "item" + , Space + , Str "1." + ] + ] + , + [ Plain + [ Str "ordered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "the" + , Space + , Str "#" + , Space + , Str "become" + , Space + , Str "numbers" + , Space + , Str "when" + , Space + , Str "converted" + , Space + , Str "to" + , Space + , Str "HTML" + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + ] + , BulletList + [ + [ Plain [ Str "Item", Space, Str "1" ] ] + , + [ Plain + [ Str "Item", Space, Str "2" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Sub" + , Space + , Str "item" + , Space + , Str "1" + , Space + , Str "(indentation" + , Space + , Str "4" + , Space + , Str "spaces)" + , SoftBreak + , Str "Sub" + , Space + , Str "item" + , Space + , Str "1" + , Space + , Str "continued" + , Space + , Str "line." + , SoftBreak + , Str "Sub" + , Space + , Str "item" + , Space + , Str "1" + , Space + , Str "next" + , Space + , Str "continued" + , Space + , Str "line." + ] + ] + , + [ Plain + [ Str "Sub" + , Space + , Str "item" + , Space + , Str "2," + , Space + , Str "as" + , Space + , Str "an" + , Space + , Str "ordered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "even" + , Space + , Str "though" + , Space + , Str "the" + , Space + , Str "identifier" + , Space + , Str "is" + , Space + , Code + ( "", [], [] ) "*" + , Space + , Str "(indentation" + , Space + , Str "2" + , Space + , Str "spaces" + , Space + , Str "followed" + , Space + , Str "by" + , Space + , Str "one" + , Space + , Str "tab" + , Space + , Str "of" + , Space + , Str "width" + , Space + , Str "4)" + ] + ] + , + [ Plain + [ Str "etc." + , SoftBreak + , Str "Continuation" + , Space + , Str "of" + , Space + , Str "Item" + , Space + , Str "2" + , SoftBreak + , Str "Next" + , Space + , Str "continuation" + , Space + , Str "of" + , Space + , Str "Item" + , Space + , Str "2" + ] + ] + ] + ] + ] + , Para + [ Str "But" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "new" + , Space + , Str "paragraph." + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "1" ] + , BulletList + [ [ Plain [ Code ( "", [], [] ) "1.1" ] ] ] + ] + , + [ Plain [ Str "2" ], BulletList [ [ Plain [ Str "2.1" ] ] ] ] + ] + , BulletList + [ [ Plain [ Str "3" ] ] ] + , Header 3 + ( "ordered lists with non-# identifiers", [], [] ) + [ Str "ordered" + , Space + , Str "lists" + , Space + , Str "with" + , Space + , Str "non-#" + , Space + , Str "identifiers" + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] + ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] + ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] + ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] + ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] + ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] + ] + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] + ] + ] + , BulletList + [ + [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "sub" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "more", Space, Str "..." ] + , BulletList + [ + [ Plain + [ Str "and", Space, Str "more", Space, Str "..." ] + ] + , + [ Plain [ Str "..." ] ] + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "sub" + , Space + , Str "item" + , Space + , Str "3" + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "sub" + , Space + , Str "sub" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , + [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "sub" + , Space + , Str "sub" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + ] + ] + , + [ Plain [ Str "etc." ] ] + ] + ] + , + [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] + ] + ] + , Header 2 + ( "todo lists", [], [] ) + [ Str "todo", Space, Str "lists" ] + , BulletList + [ + [ Plain + [ Span ( "", [ "done0" ], [] ) [], Str "task", Space, Str "1" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ [ Plain [ Span ( "", [ "done1" ], [] ) [], Str "5" ] ] ] + ] + , + [ Plain [ Span ( "", [ "done2" ], [] ) [], Str "3" ] ] + , + [ Plain + [ Str "[]" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "todo" + , Space + , Str "item" + ] + ] + , + [ Plain + [ Str "[" + , Space + , Str "]not" + , Space + , Str "a" + , Space + , Str "todo" + , Space + , Str "item" + ] + ] + , + [ Plain + [ Str "[r]" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "todo" + , Space + , Str "item" + ] + ] + , + [ Plain + [ Str "[" + , Space + , Str "]" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "todo" + , Space + , Str "item" + ] + ] + , + [ Plain + [ Span + ( "", [ "done2" ], [] ) [] + , Str "a" + , Space + , Str "tab" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "todo" + , Space + , Str "list" + , Space + , Str "marker" + , Space + , Code + ( "", [], [] ) "[ ]" + ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain + [ Span + ( "", [ "done3" ], [] ) [] + , Str "4" + , SoftBreak + , Str "5" + ] + ] + , + [ Plain + [ Span ( "", [ "done4" ], [] ) [] ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "a" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + ] + ] + ] + , + [ Plain + [ Span ( "", [ "done4" ], [] ) [], Str "task", Space, Str "2" ] + ] + ] + , Header 2 + ( "math", [], [] ) + [ Str "math" ] + , Para + [ Math InlineMath " \\sum_i a_i^2 = 1 " ] + , Para + [ Math DisplayMath "\\sum_i a_i^2\n=\n1" ] + , Para + [ Math DisplayMath "\\begin{aligned}\n\\sum_i a_i^2 &= 1 + 1 \\\\\n&= 2.\n\\end{aligned}" ] + , Para + [ Str "edge" + , Space + , Str "case" + , Space + , Str "(the" + , Space + , Code + ( "", [], [] ) "c^2 + " + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "multline" + , Space + , Str "tag" + , Space + , Str "is" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "equation):" + ] + , Para + [ Math DisplayMath "\\begin{gathered}\nc^2 + \na^2 + b^2\n\\end{gathered}" ] + , Para + [ Str "edge" + , Space + , Str "case" + , Space + , Str "(the" + , Space + , Str "tag" + , Space + , Str "is" + , Space + , Code + ( "", [], [] ) "hello%bye" + , Str ")" + ] + , Para + [ Math DisplayMath "\\begin{hello%bye}\n\\int_a^b f(x) dx\n\\end{hello%bye}" ] + , Para + [ Str "Just" + , Space + , Str "two" + , Space + , Str "dollar" + , Space + , Str "signs:" + , Space + , Str "$$" + ] + , Para + [ Str "[not" + , Space + , Str "math]" + , Space + , Str "You" + , Space + , Str "have" + , Space + , Str "$1" + , SoftBreak + , Str "and" + , Space + , Str "I" + , Space + , Str "have" + , Space + , Str "$1." + ] + , Header 2 + ( "tags", [], [] ) + [ Str "tags" ] + , Para + [ Span + ( "-tag-one", [], [] ) + [ Str "" ] + , Span + ( "tag-one", [ "tag" ], [] ) + [ Str "tag-one" ] + , Space + , Span + ( "-tag-two", [], [] ) + [ Str "" ] + , Span + ( "tag-two", [ "tag" ], [] ) + [ Str "tag-two" ] + ] + , Header 2 + ( "tables", [], [] ) + [ Str "tables" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Year" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Temperature", Space, Str "(low)" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "Temperature", Space, Str "(high)" ] ] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1900" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "-10" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "25" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1910" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "-15" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "30" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1920" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "-10" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "32" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1930" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Emph [ Str "N/A" ] ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Emph [ Str "N/A" ] ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "1940" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "-2" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "40" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Header 3 + ( "centered headerless tables", [], [] ) + [ Str "centered", Space, Str "headerless", Space, Str "tables" ] + , Div + ( "", [ "center" ], [] ) + [ Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "a" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "d" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + ] + , Header 2 + ( "paragraphs", [], [] ) + [ Str "paragraphs" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "first" + , Space + , Str "paragraph" + , SoftBreak + , Str "with" + , Space + , Str "two" + , Space + , Str "lines." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "second" + , Space + , Str "paragraph" + , Space + , Str "with" + , SoftBreak + , Str "two" + , Space + , Str "lines" + , Space + , Str "after" + , Space + , Str "many" + , Space + , Str "blank" + , Space + , Str "lines." + ] + , Header 2 + ( "definition list", [], [] ) + [ Str "definition", Space, Str "list" ] + , DefinitionList + [ + ( + [ Str "Term", Space, Str "1" ] + , + [ [ Plain [ Str "Definition", Space, Str "1" ] ] ] + ) + , + ( + [ Str "Term", Space, Str "2" ] + , + [ + [ Plain [ Str "Definition", Space, Str "2" ] ] + , + [ Plain [ Str "Definition", Space, Str "3" ] ] + ] + ) + , + ( + [ Str "Term" + , Space + , Str "::" + , Space + , Span + ( "separated", [], [] ) [] + , Strong + [ Str "separated" ] + , Space + , Str "by" + , Space + , Str "::" + , Space + , Emph + [ Str "double", Space, Str "colons" ] + ] + , + [ [ Plain [ Str "Def1" ] ], [ Plain [ Str "Def2" ] ] ] + ) + , + ( + [ Str "Term" + , Space + , Str "with" + , Space + , Str "lots" + , Space + , Str "of" + , Space + , Str "trailing" + , Space + , Str "colons:::::::" + ] + , + [ [ Plain [ Str "Definition" ] ] ] + ) + , + ( + [ Str "::" + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "::" + , Space + , Str "A" + , Space + , Str "term" + , Space + , Str "(rather" + , Space + , Str "than" + , Space + , Str "a" + , Space + , Str "definition)" + ] + , + [ + [ Plain + [ Str "and" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "definition" + ] + ] + ] + ) + , + ( + [ Str "Term", Space, Str "Without", Space, Str "definitions" ] + , [ [] ] + ) + , + ( + [ Str "Part" + , Space + , Str "::" + , Space + , Str "of" + , Space + , Str "::" + , Space + , Str "dt" + ] + , + [ [ Plain [ Str "part", Space, Str "of", Space, Str "::dd" ] ] ] + ) + ] + , DefinitionList + [ + ( [] + , + [ + [ Plain + [ Str "Definition" + , Space + , Str "1" + , Space + , Str "without" + , Space + , Str "a" + , Space + , Str "term" + ] + ] + , + [ Plain + [ Str "Definition" + , Space + , Str "2" + , Space + , Str "without" + , Space + , Str "a" + , Space + , Str "term" + ] + ] + ] + ) + ] + , DefinitionList + [ ( [ Str "T1" ], [ [ Plain [ Str "D1" ] ] ] ) ] + , Para + [ Str "new", Space, Str "paragraph" ] + , DefinitionList + [ ( [ Str "T1" ], [ [ Plain [ Str "D1" ] ] ] ) ] + , Para + [ Str "Not::Definition" ] + , Para + [ Str "Not", Space, Str "::Definition" ] + , Para + [ Str "::Not", Space, Str "definition" ] + , BlockQuote + [ Plain [ Str "::", Space, Str "blockquote" ] ] + , BlockQuote + [ Plain [ Str "block", Space, Str "::", Space, Str "quote" ] ] + , Header 2 + ( "metadata placeholders", [], [] ) + [ Str "metadata", Space, Str "placeholders" ] + , Para + [ Str "%this" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "placeholder" + ] + , Para + [ Str "placeholders" + , SoftBreak + , Str "serves" + , Space + , Str "as" + , Space + , Str "space" + , Space + , Str "/" + , Space + , Str "softbreak" + , Space + , Str "in" + , Space + , Str "paragraphs" + ] + , Header 2 + ( "sup, sub", [], [] ) + [ Str "sup,", Space, Str "sub" ] + , Para + [ Str "super", Superscript [ Str "script" ] ] + , Para + [ Str "sub", Subscript [ Str "script" ] ] + , Header 2 + ( "the todo mark", [], [] ) + [ Str "the", Space, Str "todo", Space, Str "mark" ] + , Para + [ Span ( "", [ "todo" ], [] ) [ Str "TODO:" ] ] + , Header 1 + ( "not implemented yet", [], [] ) + [ Emph + [ Span + ( "not implemented yet", [], [] ) [] + , Strong + [ Str "not", Space, Str "implemented", Space, Str "yet" ] + ] + ] + , Header 2 + ( "tables with spans", [], [] ) + [ Str "tables", Space, Str "with", Space, Str "spans" ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "a" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "d" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "\\/" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "e" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str ">" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "f" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "\\/" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "\\/" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str ">" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "g" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "h" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str ">" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str ">" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str ">" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Header 2 + ( "tables with multiple lines of headers", [], [] ) + [ Str "tables" + , Space + , Str "with" + , Space + , Str "multiple" + , Space + , Str "lines" + , Space + , Str "of" + , Space + , Str "headers" + ] + , Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) [] + ] + ] + ) + [ TableBody + ( "", [], [] ) + ( RowHeadColumns 0 ) [] + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "a" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "b" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "c" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "d" ] ] + ] + , Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "---" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "---" ] ] + ] + ] + ] + ( TableFoot ( "", [], [] ) [] ) + , Header 2 + ( "some other placeholders", [], [] ) + [ Str "some", Space, Str "other", Space, Str "placeholders" ] + , Para + [ Code + ( "", [], [] ) "template" + , Space + , Str "placeholder" + , Space + , Str "is" + , Space + , Str "ignored." + ] + , Para + [ Code + ( "", [], [] ) "nohtml" + , Space + , Str "placeholder" + , Space + , Str "is" + , Space + , Str "ignored." + ] + ] diff --git a/test/writer.asciidoc b/test/writer.asciidoc index 61014ed69..f5fce08f7 100644 --- a/test/writer.asciidoc +++ b/test/writer.asciidoc @@ -431,8 +431,8 @@ Superscripts: a^bc^d a^_hello_^ a^hello there^. Subscripts: H~2~O, H~23~O, H~many of them~O. -These should not be superscripts or subscripts, because of the unescaped -spaces: a^b c^d, a~b c~d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a^b c^d, a~b c~d. ''''' @@ -630,10 +630,10 @@ Here is a movie image:movie.jpg[movie] icon. == Footnotes -Here is a footnote reference,footnote:[Here is the footnote. It can go -anywhere after the footnote reference. It need not be placed at the end of the -document.] and another.[multiblock footnote omitted] This should _not_ be a -footnote reference, because it contains a space.[^my note] Here is an inline +Here is a footnote reference,footnote:[Here is the footnote. It can go anywhere +after the footnote reference. It need not be placed at the end of the document.] +and another.[multiblock footnote omitted] This should _not_ be a footnote +reference, because it contains a space.[^my note] Here is an inline note.footnote:[This is _easier_ to type. Inline notes may contain http://google.com[links] and `]` verbatim characters, as well as [bracketed text].] diff --git a/test/writer.asciidoctor b/test/writer.asciidoctor index 6e920990e..21ec18ec6 100644 --- a/test/writer.asciidoctor +++ b/test/writer.asciidoctor @@ -432,8 +432,8 @@ Superscripts: a^bc^d a^_hello_^ a^hello there^. Subscripts: H~2~O, H~23~O, H~many of them~O. -These should not be superscripts or subscripts, because of the unescaped -spaces: a^b c^d, a~b c~d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a^b c^d, a~b c~d. ''''' @@ -447,8 +447,8 @@ spaces: a^b c^d, a~b c~d. '`He said, "`I want to go.`"`' Were you alive in the 70’s? -Here is some quoted '``+code+``' and a -"`http://example.com/?foo=1&bar=2[quoted link]`". +Here is some quoted '``+code+``' and a "`http://example.com/?foo=1&bar=2[quoted +link]`". Some dashes: one—two — three—four — five. @@ -631,10 +631,10 @@ Here is a movie image:movie.jpg[movie] icon. == Footnotes -Here is a footnote reference,footnote:[Here is the footnote. It can go -anywhere after the footnote reference. It need not be placed at the end of the -document.] and another.[multiblock footnote omitted] This should _not_ be a -footnote reference, because it contains a space.[^my note] Here is an inline +Here is a footnote reference,footnote:[Here is the footnote. It can go anywhere +after the footnote reference. It need not be placed at the end of the document.] +and another.[multiblock footnote omitted] This should _not_ be a footnote +reference, because it contains a space.[^my note] Here is an inline note.footnote:[This is _easier_ to type. Inline notes may contain http://google.com[links] and `+]+` verbatim characters, as well as [bracketed text].] diff --git a/test/writer.context b/test/writer.context index 78667813b..ae45d1580 100644 --- a/test/writer.context +++ b/test/writer.context @@ -643,8 +643,8 @@ Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}. Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O. -These should not be superscripts or subscripts, because of the unescaped -spaces: a^b c^d, a\lettertilde{}b c\lettertilde{}d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a^b c^d, a\lettertilde{}b c\lettertilde{}d. \thinrule @@ -878,10 +878,10 @@ Here is a movie {\externalfigure[movie.jpg]} icon. \section[title={Footnotes},reference={footnotes}] -Here is a footnote reference,\footnote{Here is the footnote. It can go - anywhere after the footnote reference. It need not be placed at the end of - the document.} and another.\startbuffer Here's the long note. This one - contains multiple blocks. +Here is a footnote reference,\footnote{Here is the footnote. It can go anywhere + after the footnote reference. It need not be placed at the end of the + document.} and another.\startbuffer Here's the long note. This one contains + multiple blocks. Subsequent blocks are indented to show that they belong to the footnote (as with list items). diff --git a/test/writer.docbook4 b/test/writer.docbook4 index 27d91a2f0..baf1937b5 100644 --- a/test/writer.docbook4 +++ b/test/writer.docbook4 @@ -66,8 +66,8 @@
In Markdown 1.0.0 and earlier. Version 8. This line turns into a list - item. Because a hard-wrapped line in the middle of a paragraph looked - like a list item. + item. Because a hard-wrapped line in the middle of a paragraph looked like + a list item. Here’s one with a bullet. * criminey. @@ -1014,19 +1014,19 @@ These should not be escaped: \$ \\ \> \[ \{ Smart quotes, ellipses, dashes - Hello, said the spider. Shelob is - my name. + Hello, said the spider. Shelob is my + name. A, B, and C are letters. - Oak, elm, and beech are - names of trees. So is pine. + Oak, elm, and beech are names + of trees. So is pine. - He said, I want to go. Were you alive in - the 70’s? + He said, I want to go. Were you alive in the + 70’s? Here is some quoted code and a @@ -1366,8 +1366,8 @@ or here: <http://example.com/> Here is a footnote reference, - Here is the footnote. It can go anywhere after the footnote - reference. It need not be placed at the end of the document. + Here is the footnote. It can go anywhere after the footnote reference. + It need not be placed at the end of the document. and another. @@ -1384,14 +1384,12 @@ or here: <http://example.com/> If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. - This should not be a footnote - reference, because it contains a space.[^my note] Here is an inline - note. + This should not be a footnote reference, + because it contains a space.[^my note] Here is an inline note. - This is easier to type. Inline notes may - contain links and - ] verbatim characters, as well as [bracketed - text]. + This is easier to type. Inline notes may contain + links and ] + verbatim characters, as well as [bracketed text]. diff --git a/test/writer.docbook5 b/test/writer.docbook5 index afee571fa..dd73803aa 100644 --- a/test/writer.docbook5 +++ b/test/writer.docbook5 @@ -68,8 +68,8 @@ In Markdown 1.0.0 and earlier. Version 8. This line turns into a list - item. Because a hard-wrapped line in the middle of a paragraph looked - like a list item. + item. Because a hard-wrapped line in the middle of a paragraph looked like + a list item. Here’s one with a bullet. * criminey. @@ -989,19 +989,19 @@ These should not be escaped: \$ \\ \> \[ \{
Smart quotes, ellipses, dashes - Hello, said the spider. Shelob is - my name. + Hello, said the spider. Shelob is my + name. A, B, and C are letters. - Oak, elm, and beech are - names of trees. So is pine. + Oak, elm, and beech are names + of trees. So is pine. - He said, I want to go. Were you alive in - the 70’s? + He said, I want to go. Were you alive in the + 70’s? Here is some quoted code and a @@ -1266,8 +1266,7 @@ These should not be escaped: \$ \\ \> \[ \{ AT&T. - Here’s an inline - link. + Here’s an inline link. Here’s an inline link in @@ -1342,8 +1341,8 @@ or here: <http://example.com/> Here is a footnote reference, - Here is the footnote. It can go anywhere after the footnote - reference. It need not be placed at the end of the document. + Here is the footnote. It can go anywhere after the footnote reference. + It need not be placed at the end of the document. and another. @@ -1360,14 +1359,12 @@ or here: <http://example.com/> If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. - This should not be a footnote - reference, because it contains a space.[^my note] Here is an inline - note. + This should not be a footnote reference, + because it contains a space.[^my note] Here is an inline note. - This is easier to type. Inline notes may - contain links and - ] verbatim characters, as well as [bracketed - text]. + This is easier to type. Inline notes may contain + links and + ] verbatim characters, as well as [bracketed text]. diff --git a/test/writer.haddock b/test/writer.haddock index fbe6c257b..82c45f358 100644 --- a/test/writer.haddock +++ b/test/writer.haddock @@ -1,7 +1,7 @@ This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite. -______________________________________________________________________________ +________________________________________________________________________________ = Headers #headers# @@ -34,7 +34,7 @@ with no blank line with no blank line -______________________________________________________________________________ +________________________________________________________________________________ = Paragraphs #paragraphs# @@ -50,7 +50,7 @@ Here’s one with a bullet. * criminey. There should be a hard line break here. -______________________________________________________________________________ +________________________________________________________________________________ = Block Quotes #block-quotes# @@ -80,7 +80,7 @@ This should not be a block quote: 2 > 1. And a following paragraph. -______________________________________________________________________________ +________________________________________________________________________________ = Code Blocks #code-blocks# @@ -101,7 +101,7 @@ And: > > These should not be escaped: \$ \\ \> \[ \{ -______________________________________________________________________________ +________________________________________________________________________________ = Lists #lists# @@ -265,7 +265,7 @@ M.A. 2007 B. Williams -______________________________________________________________________________ +________________________________________________________________________________ = Definition Lists #definition-lists# @@ -398,7 +398,7 @@ Code: Hr’s: -______________________________________________________________________________ +________________________________________________________________________________ = Inline Markup #inline-markup# @@ -425,10 +425,10 @@ Superscripts: abcd a/hello/ ahello there. Subscripts: H2O, H23O, Hmany of themO. -These should not be superscripts or subscripts, because of the unescaped -spaces: a^b c^d, a~b c~d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a^b c^d, a~b c~d. -______________________________________________________________________________ +________________________________________________________________________________ = Smart quotes, ellipses, dashes #smart-quotes-ellipses-dashes# @@ -450,7 +450,7 @@ Dashes between numbers: 5–7, 255–66, 1987–1999. Ellipses…and…and…. -______________________________________________________________________________ +________________________________________________________________________________ = LaTeX #latex# @@ -475,7 +475,7 @@ These shouldn’t be math: Here’s a LaTeX table: -______________________________________________________________________________ +________________________________________________________________________________ = Special Characters #special-characters# @@ -530,7 +530,7 @@ Plus: + Minus: - -______________________________________________________________________________ +________________________________________________________________________________ = Links #links# @@ -607,7 +607,7 @@ Auto-links should not occur here: @\@ > or here: -______________________________________________________________________________ +________________________________________________________________________________ = Images #images# @@ -618,14 +618,14 @@ From “Voyage dans la Lune” by Georges Melies (1902): Here is a movie <> icon. -______________________________________________________________________________ +________________________________________________________________________________ = Footnotes #footnotes# Here is a footnote reference,<#notes [1]> and another.<#notes [2]> This should -/not/ be a footnote reference, because it contains a space.[^my note] Here is -an inline note.<#notes [3]> +/not/ be a footnote reference, because it contains a space.[^my note] Here is an +inline note.<#notes [3]> Notes can go in quotes.<#notes [4]> @@ -640,17 +640,16 @@ This paragraph should not be part of the note, as it is not indented. 2. Here’s the long note. This one contains multiple blocks. - Subsequent blocks are indented to show that they belong to the footnote - (as with list items). + Subsequent blocks are indented to show that they belong to the footnote (as + with list items). > { } If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. -3. This is /easier/ to type. Inline notes may contain - and @]@ verbatim characters, as well as - [bracketed text]. +3. This is /easier/ to type. Inline notes may contain + and @]@ verbatim characters, as well as [bracketed text]. 4. In quote. diff --git a/test/writer.jats_archiving b/test/writer.jats_archiving index 70e15b6b8..cc9cdb323 100644 --- a/test/writer.jats_archiving +++ b/test/writer.jats_archiving @@ -68,9 +68,9 @@ Gruber’s markdown test suite.

Paragraphs

Here’s a regular paragraph.

-

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list - item. Because a hard-wrapped line in the middle of a paragraph looked like a - list item.

+

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. + Because a hard-wrapped line in the middle of a paragraph looked like a list + item.

Here’s one with a bullet. * criminey.

There should be a hard line break here.

@@ -634,8 +634,7 @@ These should not be escaped: \$ \\ \> \[ \{

This is strikeout.

Superscripts: abcd ahello ahello there.

-

Subscripts: H2O, H23O, - Hmany of themO.

+

Subscripts: H2O, H23O, Hmany of themO.

These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.

@@ -689,8 +688,7 @@ These should not be escaped: \$ \\ \> \[ \{ ddxf(x)=limh0f(x+h)f(x)h

-

Here’s one that has a line break in it: - +

Here’s one that has a line break in it: α+ω×x2.

@@ -780,8 +778,7 @@ These should not be escaped: \$ \\ \> \[ \{ Reference -

Foo - bar.

+

Foo bar.

With embedded [brackets].

b by itself @@ -853,9 +850,8 @@ These should not be escaped: \$ \\ \> \[ \{ Footnotes

Here is a footnote reference,1 and another.2 This should - not be a footnote reference, because it contains a - space.[^my note] Here is an inline - note.3

+ not be a footnote reference, because it contains a space.[^my + note] Here is an inline note.3

Notes can go in quotes.4

@@ -881,12 +877,12 @@ These should not be escaped: \$ \\ \> \[ \{

{ <code> }

-

If you want, you can indent every line, but you can also be lazy and - just indent the first line of each block.

+

If you want, you can indent every line, but you can also be lazy and just + indent the first line of each block.

-

This is easier to type. Inline notes - may contain +

This is easier to type. Inline notes may + contain links and ] verbatim characters, as well as [bracketed text].

diff --git a/test/writer.jats_articleauthoring b/test/writer.jats_articleauthoring index 59485a114..c2bddccb6 100644 --- a/test/writer.jats_articleauthoring +++ b/test/writer.jats_articleauthoring @@ -57,9 +57,9 @@ Gruber’s markdown test suite.

Paragraphs

Here’s a regular paragraph.

-

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list - item. Because a hard-wrapped line in the middle of a paragraph looked like a - list item.

+

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. + Because a hard-wrapped line in the middle of a paragraph looked like a list + item.

Here’s one with a bullet. * criminey.

There should be a hard line break here.

@@ -631,8 +631,7 @@ These should not be escaped: \$ \\ \> \[ \{

This is strikeout.

Superscripts: abcd ahello ahello there.

-

Subscripts: H2O, H23O, - Hmany of themO.

+

Subscripts: H2O, H23O, Hmany of themO.

These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.

@@ -764,8 +763,7 @@ These should not be escaped: \$ \\ \> \[ \{
Reference -

Foo - bar.

+

Foo bar.

With embedded [brackets].

b by itself @@ -836,8 +834,8 @@ These should not be escaped: \$ \\ \> \[ \{ Footnotes

Here is a footnote reference, -

Here is the footnote. It can go anywhere after the footnote reference. - It need not be placed at the end of the document.

+

Here is the footnote. It can go anywhere after the footnote reference. It + need not be placed at the end of the document.

and another.

Here’s the long note. This one contains multiple blocks.

Subsequent blocks are indented to show that they belong to the footnote @@ -845,8 +843,8 @@ These should not be escaped: \$ \\ \> \[ \{

{ <code> }

-

If you want, you can indent every line, but you can also be lazy and - just indent the first line of each block.

+

If you want, you can indent every line, but you can also be lazy and just + indent the first line of each block.

This should not be a footnote reference, because it contains a space.[^my note] Here is an inline note.

This is easier to type. Inline notes may contain diff --git a/test/writer.jats_publishing b/test/writer.jats_publishing index e6db4172a..3d4f8ddb3 100644 --- a/test/writer.jats_publishing +++ b/test/writer.jats_publishing @@ -68,9 +68,9 @@ Gruber’s markdown test suite.

Paragraphs

Here’s a regular paragraph.

-

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list - item. Because a hard-wrapped line in the middle of a paragraph looked like a - list item.

+

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. + Because a hard-wrapped line in the middle of a paragraph looked like a list + item.

Here’s one with a bullet. * criminey.

There should be a hard line break here.

@@ -634,8 +634,7 @@ These should not be escaped: \$ \\ \> \[ \{

This is strikeout.

Superscripts: abcd ahello ahello there.

-

Subscripts: H2O, H23O, - Hmany of themO.

+

Subscripts: H2O, H23O, Hmany of themO.

These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.

@@ -689,8 +688,7 @@ These should not be escaped: \$ \\ \> \[ \{ ddxf(x)=limh0f(x+h)f(x)h

-

Here’s one that has a line break in it: - +

Here’s one that has a line break in it: α+ω×x2.

@@ -780,8 +778,7 @@ These should not be escaped: \$ \\ \> \[ \{
Reference -

Foo - bar.

+

Foo bar.

With embedded [brackets].

b by itself @@ -853,9 +850,8 @@ These should not be escaped: \$ \\ \> \[ \{ Footnotes

Here is a footnote reference,1 and another.2 This should - not be a footnote reference, because it contains a - space.[^my note] Here is an inline - note.3

+ not be a footnote reference, because it contains a space.[^my + note] Here is an inline note.3

Notes can go in quotes.4

@@ -881,12 +877,12 @@ These should not be escaped: \$ \\ \> \[ \{

{ <code> }

-

If you want, you can indent every line, but you can also be lazy and - just indent the first line of each block.

+

If you want, you can indent every line, but you can also be lazy and just + indent the first line of each block.

-

This is easier to type. Inline notes - may contain +

This is easier to type. Inline notes may + contain links and ] verbatim characters, as well as [bracketed text].

diff --git a/test/writer.latex b/test/writer.latex index abf772df4..a89078b31 100644 --- a/test/writer.latex +++ b/test/writer.latex @@ -711,8 +711,8 @@ a\textsuperscript{hello~there}. Subscripts: H\textsubscript{2}O, H\textsubscript{23}O, H\textsubscript{many~of~them}O. -These should not be superscripts or subscripts, because of the unescaped -spaces: a\^{}b c\^{}d, a\textasciitilde b c\textasciitilde d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a\^{}b c\^{}d, a\textasciitilde b c\textasciitilde d. \begin{center}\rule{0.5\linewidth}{0.5pt}\end{center} @@ -905,8 +905,7 @@ Foo \href{/url/}{biz}. Here's a \href{http://example.com/?foo=1\&bar=2}{link with an ampersand in the URL}. -Here's a link with an amersand in the link text: -\href{http://att.com/}{AT\&T}. +Here's a link with an amersand in the link text: \href{http://att.com/}{AT\&T}. Here's an \href{/script?foo=1\&bar=2}{inline link}. @@ -961,9 +960,9 @@ Here is a movie \includegraphics{movie.jpg} icon. \hypertarget{footnotes}{% \section{Footnotes}\label{footnotes}} -Here is a footnote reference,\footnote{Here is the footnote. It can go - anywhere after the footnote reference. It need not be placed at the end of - the document.} and another.\footnote{Here's the long note. This one contains +Here is a footnote reference,\footnote{Here is the footnote. It can go anywhere + after the footnote reference. It need not be placed at the end of the + document.} and another.\footnote{Here's the long note. This one contains multiple blocks. Subsequent blocks are indented to show that they belong to the footnote (as @@ -977,8 +976,8 @@ Here is a footnote reference,\footnote{Here is the footnote. It can go indent the first line of each block.} This should \emph{not} be a footnote reference, because it contains a space.{[}\^{}my note{]} Here is an inline note.\footnote{This is \emph{easier} to type. Inline notes may contain - \href{http://google.com}{links} and \texttt{{]}} verbatim characters, as - well as {[}bracketed text{]}.} + \href{http://google.com}{links} and \texttt{{]}} verbatim characters, as well + as {[}bracketed text{]}.} \begin{quote} Notes can go in quotes.\footnote{In quote.} diff --git a/test/writer.man b/test/writer.man index d3f1dfe14..d1d3cfd33 100644 --- a/test/writer.man +++ b/test/writer.man @@ -496,8 +496,8 @@ Superscripts: a^bc^d a^\f[I]hello\f[R]^ a^hello\ there^. .PP Subscripts: H~2~O, H~23~O, H~many\ of\ them~O. .PP -These should not be superscripts or subscripts, because of the unescaped -spaces: a\[ha]b c\[ha]d, a\[ti]b c\[ti]d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a\[ha]b c\[ha]d, a\[ti]b c\[ti]d. .PP * * * * * .SH Smart quotes, ellipses, dashes @@ -706,9 +706,9 @@ Here is a movie [IMAGE: movie] icon. * * * * * .SH Footnotes .PP -Here is a footnote reference,[1] and another.[2] This should \f[I]not\f[R] be -a footnote reference, because it contains a space.[\[ha]my note] Here is an -inline note.[3] +Here is a footnote reference,[1] and another.[2] This should \f[I]not\f[R] be a +footnote reference, because it contains a space.[\[ha]my note] Here is an inline +note.[3] .RS .PP Notes can go in quotes.[4] @@ -728,8 +728,8 @@ It need not be placed at the end of the document. Here\[cq]s the long note. This one contains multiple blocks. .PP -Subsequent blocks are indented to show that they belong to the footnote (as -with list items). +Subsequent blocks are indented to show that they belong to the footnote (as with +list items). .IP .nf \f[C] @@ -737,8 +737,8 @@ with list items). \f[R] .fi .PP -If you want, you can indent every line, but you can also be lazy and just -indent the first line of each block. +If you want, you can indent every line, but you can also be lazy and just indent +the first line of each block. .SS [3] .PP This is \f[I]easier\f[R] to type. diff --git a/test/writer.markdown b/test/writer.markdown index 6a149882c..375e1b864 100644 --- a/test/writer.markdown +++ b/test/writer.markdown @@ -9,7 +9,7 @@ title: Pandoc Test Suite This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Headers @@ -33,7 +33,7 @@ with no blank line with no blank line ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Paragraphs @@ -48,7 +48,7 @@ Here's one with a bullet. \* criminey. There should be a hard line break\ here. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Block Quotes @@ -77,7 +77,7 @@ This should not be a block quote: 2 \> 1. And a following paragraph. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Code Blocks @@ -97,7 +97,7 @@ And: These should not be escaped: \$ \\ \> \[ \{ ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Lists @@ -254,7 +254,7 @@ M.A. 2007 B. Williams ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Definition Lists @@ -507,7 +507,7 @@ Hr's:
``` ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Inline Markup @@ -533,10 +533,10 @@ Superscripts: a^bc^d a^*hello*^ a^hello there^. Subscripts: H~2~O, H~23~O, H~many of them~O. -These should not be superscripts or subscripts, because of the unescaped -spaces: a\^b c\^d, a\~b c\~d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a\^b c\^d, a\~b c\~d. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Smart quotes, ellipses, dashes @@ -557,7 +557,7 @@ Dashes between numbers: 5--7, 255--66, 1987--1999. Ellipses...and...and.... ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # LaTeX @@ -589,7 +589,7 @@ Cat & 1 \\ \hline \end{tabular} ``` ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Special Characters @@ -643,7 +643,7 @@ Plus: + Minus: - ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Links @@ -693,8 +693,7 @@ Foo [biz](/url/ "Title with "quote" inside"). Here's a [link with an ampersand in the URL](http://example.com/?foo=1&bar=2). -Here's a link with an amersand in the link text: -[AT&T](http://att.com/ "AT&T"). +Here's a link with an amersand in the link text: [AT&T](http://att.com/ "AT&T"). Here's an [inline link](/script?foo=1&bar=2). @@ -716,7 +715,7 @@ Auto-links should not occur here: `` or here: ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Images @@ -726,13 +725,13 @@ From "Voyage dans la Lune" by Georges Melies (1902): Here is a movie ![movie](movie.jpg) icon. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- # Footnotes Here is a footnote reference,[^1] and another.[^2] This should *not* be a -footnote reference, because it contains a space.\[\^my note\] Here is an -inline note.[^3] +footnote reference, because it contains a space.\[\^my note\] Here is an inline +note.[^3] > Notes can go in quotes.[^4] @@ -740,13 +739,13 @@ inline note.[^3] This paragraph should not be part of the note, as it is not indented. -[^1]: Here is the footnote. It can go anywhere after the footnote reference. - It need not be placed at the end of the document. +[^1]: Here is the footnote. It can go anywhere after the footnote reference. It + need not be placed at the end of the document. [^2]: Here's the long note. This one contains multiple blocks. - Subsequent blocks are indented to show that they belong to the footnote - (as with list items). + Subsequent blocks are indented to show that they belong to the footnote (as + with list items). { } diff --git a/test/writer.ms b/test/writer.ms index 329c959fc..fc2e66a34 100644 --- a/test/writer.ms +++ b/test/writer.ms @@ -653,8 +653,8 @@ Superscripts: a\*{bc\*}d a\*{\f[I]hello\f[R]\*} a\*{hello\ there\*}. .PP Subscripts: H\*<2\*>O, H\*<23\*>O, H\*O. .PP -These should not be superscripts or subscripts, because of the unescaped -spaces: a\[ha]b c\[ha]d, a\[ti]b c\[ti]d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a\[ha]b c\[ha]d, a\[ti]b c\[ti]d. .HLINE .SH 1 Smart quotes, ellipses, dashes @@ -973,8 +973,8 @@ and another.\** Here\[cq]s the long note. This one contains multiple blocks. .PP -Subsequent blocks are indented to show that they belong to the footnote (as -with list items). +Subsequent blocks are indented to show that they belong to the footnote (as with +list items). .IP .nf \f[C] @@ -982,8 +982,8 @@ with list items). \f[] .fi .LP -If you want, you can indent every line, but you can also be lazy and just -indent the first line of each block. +If you want, you can indent every line, but you can also be lazy and just indent +the first line of each block. .FE This should \f[I]not\f[R] be a footnote reference, because it contains a space.[\[ha]my note] Here is an inline note.\** diff --git a/test/writer.muse b/test/writer.muse index d9efdddd5..2c96f6bf2 100644 --- a/test/writer.muse +++ b/test/writer.muse @@ -483,8 +483,8 @@ Superscripts: abcd a*hello* ahello there. Subscripts: H2O, H23O, Hmany of themO. -These should not be superscripts or subscripts, because of the unescaped -spaces: a^b c^d, a~b c~d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a^b c^d, a~b c~d. ---- @@ -643,8 +643,7 @@ Foo [[/url/][biz]]. ** With ampersands -Here’s a [[http://example.com/?foo=1&bar=2][link with an ampersand in the -URL]]. +Here’s a [[http://example.com/?foo=1&bar=2][link with an ampersand in the URL]]. Here’s a link with an amersand in the link text: [[http://att.com/][AT&T]]. @@ -686,9 +685,8 @@ Here is a movie [[movie.jpg][movie]] icon. * Footnotes -Here is a footnote reference,[1] and another.[2] This should *not* be a -footnote reference, because it contains a space.[^my note] Here is an inline -note.[3] +Here is a footnote reference,[1] and another.[2] This should *not* be a footnote +reference, because it contains a space.[^my note] Here is an inline note.[3] Notes can go in quotes.[4] @@ -703,8 +701,8 @@ This paragraph should not be part of the note, as it is not indented. [2] Here’s the long note. This one contains multiple blocks. - Subsequent blocks are indented to show that they belong to the footnote - (as with list items). + Subsequent blocks are indented to show that they belong to the footnote (as + with list items). { } diff --git a/test/writer.native b/test/writer.native index f9132c797..e86464f3e 100644 --- a/test/writer.native +++ b/test/writer.native @@ -1,409 +1,2385 @@ -Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Space,Str "MacFarlane"],MetaInlines [Str "Anonymous"]]),("date",MetaInlines [Str "July",Space,Str "17,",Space,Str "2006"]),("title",MetaInlines [Str "Pandoc",Space,Str "Test",Space,Str "Suite"])]}) -[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 "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",SoftBreak,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-embedded-link",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link ("",[],[]) [Str "embedded",Space,Str "link"] ("/url","")] -,Header 3 ("level-3-with-emphasis",[],[]) [Str "Level",Space,Str "3",Space,Str "with",Space,Emph [Str "emphasis"]] -,Header 4 ("level-4",[],[]) [Str "Level",Space,Str "4"] -,Header 5 ("level-5",[],[]) [Str "Level",Space,Str "5"] -,Header 1 ("level-1",[],[]) [Str "Level",Space,Str "1"] -,Header 2 ("level-2-with-emphasis",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Emph [Str "emphasis"]] -,Header 3 ("level-3",[],[]) [Str "Level",Space,Str "3"] -,Para [Str "with",Space,Str "no",Space,Str "blank",Space,Str "line"] -,Header 2 ("level-2",[],[]) [Str "Level",Space,Str "2"] -,Para [Str "with",Space,Str "no",Space,Str "blank",Space,Str "line"] -,HorizontalRule -,Header 1 ("paragraphs",[],[]) [Str "Paragraphs"] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "regular",Space,Str "paragraph."] -,Para [Str "In",Space,Str "Markdown",Space,Str "1.0.0",Space,Str "and",Space,Str "earlier.",Space,Str "Version",SoftBreak,Str "8.",Space,Str "This",Space,Str "line",Space,Str "turns",Space,Str "into",Space,Str "a",Space,Str "list",Space,Str "item.",SoftBreak,Str "Because",Space,Str "a",Space,Str "hard-wrapped",Space,Str "line",Space,Str "in",Space,Str "the",SoftBreak,Str "middle",Space,Str "of",Space,Str "a",Space,Str "paragraph",Space,Str "looked",Space,Str "like",Space,Str "a",SoftBreak,Str "list",Space,Str "item."] -,Para [Str "Here\8217s",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet.",SoftBreak,Str "*",Space,Str "criminey."] -,Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "hard",Space,Str "line",Space,Str "break",LineBreak,Str "here."] -,HorizontalRule -,Header 1 ("block-quotes",[],[]) [Str "Block",Space,Str "Quotes"] -,Para [Str "E-mail",Space,Str "style:"] -,BlockQuote - [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote.",SoftBreak,Str "It",Space,Str "is",Space,Str "pretty",Space,Str "short."]] -,BlockQuote - [Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"] - ,CodeBlock ("",[],[]) "sub status {\n print \"working\";\n}" - ,Para [Str "A",Space,Str "list:"] - ,OrderedList (1,Decimal,Period) - [[Plain [Str "item",Space,Str "one"]] - ,[Plain [Str "item",Space,Str "two"]]] - ,Para [Str "Nested",Space,Str "block",Space,Str "quotes:"] - ,BlockQuote - [Para [Str "nested"]] - ,BlockQuote - [Para [Str "nested"]]] -,Para [Str "This",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "block",Space,Str "quote:",Space,Str "2",SoftBreak,Str ">",Space,Str "1."] -,Para [Str "And",Space,Str "a",Space,Str "following",Space,Str "paragraph."] -,HorizontalRule -,Header 1 ("code-blocks",[],[]) [Str "Code",Space,Str "Blocks"] -,Para [Str "Code:"] -,CodeBlock ("",[],[]) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" -,Para [Str "And:"] -,CodeBlock ("",[],[]) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" -,HorizontalRule -,Header 1 ("lists",[],[]) [Str "Lists"] -,Header 2 ("unordered",[],[]) [Str "Unordered"] -,Para [Str "Asterisks",Space,Str "tight:"] -,BulletList - [[Plain [Str "asterisk",Space,Str "1"]] - ,[Plain [Str "asterisk",Space,Str "2"]] - ,[Plain [Str "asterisk",Space,Str "3"]]] -,Para [Str "Asterisks",Space,Str "loose:"] -,BulletList - [[Para [Str "asterisk",Space,Str "1"]] - ,[Para [Str "asterisk",Space,Str "2"]] - ,[Para [Str "asterisk",Space,Str "3"]]] -,Para [Str "Pluses",Space,Str "tight:"] -,BulletList - [[Plain [Str "Plus",Space,Str "1"]] - ,[Plain [Str "Plus",Space,Str "2"]] - ,[Plain [Str "Plus",Space,Str "3"]]] -,Para [Str "Pluses",Space,Str "loose:"] -,BulletList - [[Para [Str "Plus",Space,Str "1"]] - ,[Para [Str "Plus",Space,Str "2"]] - ,[Para [Str "Plus",Space,Str "3"]]] -,Para [Str "Minuses",Space,Str "tight:"] -,BulletList - [[Plain [Str "Minus",Space,Str "1"]] - ,[Plain [Str "Minus",Space,Str "2"]] - ,[Plain [Str "Minus",Space,Str "3"]]] -,Para [Str "Minuses",Space,Str "loose:"] -,BulletList - [[Para [Str "Minus",Space,Str "1"]] - ,[Para [Str "Minus",Space,Str "2"]] - ,[Para [Str "Minus",Space,Str "3"]]] -,Header 2 ("ordered",[],[]) [Str "Ordered"] -,Para [Str "Tight:"] -,OrderedList (1,Decimal,Period) - [[Plain [Str "First"]] - ,[Plain [Str "Second"]] - ,[Plain [Str "Third"]]] -,Para [Str "and:"] -,OrderedList (1,Decimal,Period) - [[Plain [Str "One"]] - ,[Plain [Str "Two"]] - ,[Plain [Str "Three"]]] -,Para [Str "Loose",Space,Str "using",Space,Str "tabs:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "First"]] - ,[Para [Str "Second"]] - ,[Para [Str "Third"]]] -,Para [Str "and",Space,Str "using",Space,Str "spaces:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "One"]] - ,[Para [Str "Two"]] - ,[Para [Str "Three"]]] -,Para [Str "Multiple",Space,Str "paragraphs:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "Item",Space,Str "1,",Space,Str "graf",Space,Str "one."] - ,Para [Str "Item",Space,Str "1.",Space,Str "graf",Space,Str "two.",Space,Str "The",Space,Str "quick",Space,Str "brown",Space,Str "fox",Space,Str "jumped",Space,Str "over",Space,Str "the",Space,Str "lazy",Space,Str "dog\8217s",SoftBreak,Str "back."]] - ,[Para [Str "Item",Space,Str "2."]] - ,[Para [Str "Item",Space,Str "3."]]] -,Header 2 ("nested",[],[]) [Str "Nested"] -,BulletList - [[Plain [Str "Tab"] - ,BulletList - [[Plain [Str "Tab"] - ,BulletList - [[Plain [Str "Tab"]]]]]]] -,Para [Str "Here\8217s",Space,Str "another:"] -,OrderedList (1,Decimal,Period) - [[Plain [Str "First"]] - ,[Plain [Str "Second:"] - ,BulletList - [[Plain [Str "Fee"]] - ,[Plain [Str "Fie"]] - ,[Plain [Str "Foe"]]]] - ,[Plain [Str "Third"]]] -,Para [Str "Same",Space,Str "thing",Space,Str "but",Space,Str "with",Space,Str "paragraphs:"] -,OrderedList (1,Decimal,Period) - [[Para [Str "First"]] - ,[Para [Str "Second:"] - ,BulletList - [[Plain [Str "Fee"]] - ,[Plain [Str "Fie"]] - ,[Plain [Str "Foe"]]]] - ,[Para [Str "Third"]]] -,Header 2 ("tabs-and-spaces",[],[]) [Str "Tabs",Space,Str "and",Space,Str "spaces"] -,BulletList - [[Para [Str "this",Space,Str "is",Space,Str "a",Space,Str "list",Space,Str "item",SoftBreak,Str "indented",Space,Str "with",Space,Str "tabs"]] - ,[Para [Str "this",Space,Str "is",Space,Str "a",Space,Str "list",Space,Str "item",SoftBreak,Str "indented",Space,Str "with",Space,Str "spaces"] - ,BulletList - [[Para [Str "this",Space,Str "is",Space,Str "an",Space,Str "example",Space,Str "list",Space,Str "item",SoftBreak,Str "indented",Space,Str "with",Space,Str "tabs"]] - ,[Para [Str "this",Space,Str "is",Space,Str "an",Space,Str "example",Space,Str "list",Space,Str "item",SoftBreak,Str "indented",Space,Str "with",Space,Str "spaces"]]]]] -,Header 2 ("fancy-list-markers",[],[]) [Str "Fancy",Space,Str "list",Space,Str "markers"] -,OrderedList (2,Decimal,TwoParens) - [[Para [Str "begins",Space,Str "with",Space,Str "2"]] - ,[Para [Str "and",Space,Str "now",Space,Str "3"] - ,Para [Str "with",Space,Str "a",Space,Str "continuation"] - ,OrderedList (4,LowerRoman,Period) - [[Plain [Str "sublist",Space,Str "with",Space,Str "roman",Space,Str "numerals,",SoftBreak,Str "starting",Space,Str "with",Space,Str "4"]] - ,[Plain [Str "more",Space,Str "items"] - ,OrderedList (1,UpperAlpha,TwoParens) - [[Plain [Str "a",Space,Str "subsublist"]] - ,[Plain [Str "a",Space,Str "subsublist"]]]]]]] -,Para [Str "Nesting:"] -,OrderedList (1,UpperAlpha,Period) - [[Plain [Str "Upper",Space,Str "Alpha"] - ,OrderedList (1,UpperRoman,Period) - [[Plain [Str "Upper",Space,Str "Roman."] - ,OrderedList (6,Decimal,TwoParens) - [[Plain [Str "Decimal",Space,Str "start",Space,Str "with",Space,Str "6"] - ,OrderedList (3,LowerAlpha,OneParen) - [[Plain [Str "Lower",Space,Str "alpha",Space,Str "with",Space,Str "paren"]]]]]]]]] -,Para [Str "Autonumbering:"] -,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Autonumber."]] - ,[Plain [Str "More."] - ,OrderedList (1,DefaultStyle,DefaultDelim) - [[Plain [Str "Nested."]]]]] -,Para [Str "Should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "list",Space,Str "item:"] -,Para [Str "M.A.\160\&2007"] -,Para [Str "B.",Space,Str "Williams"] -,HorizontalRule -,Header 1 ("definition-lists",[],[]) [Str "Definition",Space,Str "Lists"] -,Para [Str "Tight",Space,Str "using",Space,Str "spaces:"] -,DefinitionList - [([Str "apple"], - [[Plain [Str "red",Space,Str "fruit"]]]) - ,([Str "orange"], - [[Plain [Str "orange",Space,Str "fruit"]]]) - ,([Str "banana"], - [[Plain [Str "yellow",Space,Str "fruit"]]])] -,Para [Str "Tight",Space,Str "using",Space,Str "tabs:"] -,DefinitionList - [([Str "apple"], - [[Plain [Str "red",Space,Str "fruit"]]]) - ,([Str "orange"], - [[Plain [Str "orange",Space,Str "fruit"]]]) - ,([Str "banana"], - [[Plain [Str "yellow",Space,Str "fruit"]]])] -,Para [Str "Loose:"] -,DefinitionList - [([Str "apple"], - [[Para [Str "red",Space,Str "fruit"]]]) - ,([Str "orange"], - [[Para [Str "orange",Space,Str "fruit"]]]) - ,([Str "banana"], - [[Para [Str "yellow",Space,Str "fruit"]]])] -,Para [Str "Multiple",Space,Str "blocks",Space,Str "with",Space,Str "italics:"] -,DefinitionList - [([Emph [Str "apple"]], - [[Para [Str "red",Space,Str "fruit"] - ,Para [Str "contains",Space,Str "seeds,",SoftBreak,Str "crisp,",Space,Str "pleasant",Space,Str "to",Space,Str "taste"]]]) - ,([Emph [Str "orange"]], - [[Para [Str "orange",Space,Str "fruit"] - ,CodeBlock ("",[],[]) "{ orange code block }" - ,BlockQuote - [Para [Str "orange",Space,Str "block",Space,Str "quote"]]]])] -,Para [Str "Multiple",Space,Str "definitions,",Space,Str "tight:"] -,DefinitionList - [([Str "apple"], - [[Plain [Str "red",Space,Str "fruit"]] - ,[Plain [Str "computer"]]]) - ,([Str "orange"], - [[Plain [Str "orange",Space,Str "fruit"]] - ,[Plain [Str "bank"]]])] -,Para [Str "Multiple",Space,Str "definitions,",Space,Str "loose:"] -,DefinitionList - [([Str "apple"], - [[Para [Str "red",Space,Str "fruit"]] - ,[Para [Str "computer"]]]) - ,([Str "orange"], - [[Para [Str "orange",Space,Str "fruit"]] - ,[Para [Str "bank"]]])] -,Para [Str "Blank",Space,Str "line",Space,Str "after",Space,Str "term,",Space,Str "indented",Space,Str "marker,",Space,Str "alternate",Space,Str "markers:"] -,DefinitionList - [([Str "apple"], - [[Para [Str "red",Space,Str "fruit"]] - ,[Para [Str "computer"]]]) - ,([Str "orange"], - [[Para [Str "orange",Space,Str "fruit"] - ,OrderedList (1,Decimal,Period) - [[Plain [Str "sublist"]] - ,[Plain [Str "sublist"]]]]])] -,Header 1 ("html-blocks",[],[]) [Str "HTML",Space,Str "Blocks"] -,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"] -,Div ("",[],[]) - [Plain [Str "foo"]] -,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"] -,Div ("",[],[]) - [Div ("",[],[]) - [Div ("",[],[]) - [Para [Str "foo"]]] - ,Div ("",[],[]) - [Plain [Str "bar"]]] -,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table:"] -,RawBlock (Format "html") "" -,RawBlock (Format "html") "" -,RawBlock (Format "html") "" -,RawBlock (Format "html") "" -,RawBlock (Format "html") "" -,RawBlock (Format "html") "
" -,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]] -,RawBlock (Format "html") "" -,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]] -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "" -,Para [Str "Here\8217s",Space,Str "a",Space,Str "simple",Space,Str "block:"] -,Div ("",[],[]) - [Para [Str "foo"]] -,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block,",Space,Str "though:"] -,CodeBlock ("",[],[]) "
\n foo\n
" -,Para [Str "As",Space,Str "should",Space,Str "this:"] -,CodeBlock ("",[],[]) "
foo
" -,Para [Str "Now,",Space,Str "nested:"] -,Div ("",[],[]) - [Div ("",[],[]) - [Div ("",[],[]) - [Plain [Str "foo"]]]] -,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment:"] -,RawBlock (Format "html") "" -,Para [Str "Multiline:"] -,RawBlock (Format "html") "" -,RawBlock (Format "html") "" -,Para [Str "Code",Space,Str "block:"] -,CodeBlock ("",[],[]) "" -,Para [Str "Just",Space,Str "plain",Space,Str "comment,",Space,Str "with",Space,Str "trailing",Space,Str "spaces",Space,Str "on",Space,Str "the",Space,Str "line:"] -,RawBlock (Format "html") "" -,Para [Str "Code:"] -,CodeBlock ("",[],[]) "
" -,Para [Str "Hr\8217s:"] -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,RawBlock (Format "html") "
" -,HorizontalRule -,Header 1 ("inline-markup",[],[]) [Str "Inline",Space,Str "Markup"] -,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."] -,Para [Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str "."] -,Para [Str "An",Space,Emph [Link ("",[],[]) [Str "emphasized",Space,Str "link"] ("/url","")],Str "."] -,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]] -,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."] -,Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]] -,Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."] -,Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ("",[],[]) ">",Str ",",Space,Code ("",[],[]) "$",Str ",",Space,Code ("",[],[]) "\\",Str ",",Space,Code ("",[],[]) "\\$",Str ",",Space,Code ("",[],[]) "",Str "."] -,Para [Strikeout [Str "This",Space,Str "is",Space,Emph [Str "strikeout"],Str "."]] -,Para [Str "Superscripts:",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Superscript [Emph [Str "hello"]],Space,Str "a",Superscript [Str "hello\160there"],Str "."] -,Para [Str "Subscripts:",Space,Str "H",Subscript [Str "2"],Str "O,",Space,Str "H",Subscript [Str "23"],Str "O,",Space,Str "H",Subscript [Str "many\160of\160them"],Str "O."] -,Para [Str "These",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "superscripts",Space,Str "or",Space,Str "subscripts,",SoftBreak,Str "because",Space,Str "of",Space,Str "the",Space,Str "unescaped",Space,Str "spaces:",Space,Str "a^b",Space,Str "c^d,",Space,Str "a~b",Space,Str "c~d."] -,HorizontalRule -,Header 1 ("smart-quotes-ellipses-dashes",[],[]) [Str "Smart",Space,Str "quotes,",Space,Str "ellipses,",Space,Str "dashes"] -,Para [Quoted DoubleQuote [Str "Hello,"],Space,Str "said",Space,Str "the",Space,Str "spider.",Space,Quoted DoubleQuote [Quoted SingleQuote [Str "Shelob"],Space,Str "is",Space,Str "my",Space,Str "name."]] -,Para [Quoted SingleQuote [Str "A"],Str ",",Space,Quoted SingleQuote [Str "B"],Str ",",Space,Str "and",Space,Quoted SingleQuote [Str "C"],Space,Str "are",Space,Str "letters."] -,Para [Quoted SingleQuote [Str "Oak,"],Space,Quoted SingleQuote [Str "elm,"],Space,Str "and",Space,Quoted SingleQuote [Str "beech"],Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees.",SoftBreak,Str "So",Space,Str "is",Space,Quoted SingleQuote [Str "pine."]] -,Para [Quoted SingleQuote [Str "He",Space,Str "said,",Space,Quoted DoubleQuote [Str "I",Space,Str "want",Space,Str "to",Space,Str "go."]],Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",SoftBreak,Str "70\8217s?"] -,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code ("",[],[]) "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link ("",[],[]) [Str "quoted",Space,Str "link"] ("http://example.com/?foo=1&bar=2","")],Str "."] -,Para [Str "Some",Space,Str "dashes:",Space,Str "one\8212two",Space,Str "\8212",Space,Str "three\8212four",Space,Str "\8212",Space,Str "five."] -,Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5\8211\&7,",Space,Str "255\8211\&66,",Space,Str "1987\8211\&1999."] -,Para [Str "Ellipses\8230and\8230and\8230."] -,HorizontalRule -,Header 1 ("latex",[],[]) [Str "LaTeX"] -,BulletList - [[Plain [RawInline (Format "tex") "\\cite[22-23]{smith.1899}"]] - ,[Plain [Math InlineMath "2+2=4"]] - ,[Plain [Math InlineMath "x \\in y"]] - ,[Plain [Math InlineMath "\\alpha \\wedge \\omega"]] - ,[Plain [Math InlineMath "223"]] - ,[Plain [Math InlineMath "p",Str "-Tree"]] - ,[Plain [Str "Here\8217s",Space,Str "some",Space,Str "display",Space,Str "math:",SoftBreak,Math DisplayMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"]] - ,[Plain [Str "Here\8217s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,Math InlineMath "\\alpha + \\omega \\times x^2",Str "."]]] -,Para [Str "These",Space,Str "shouldn\8217t",Space,Str "be",Space,Str "math:"] -,BulletList - [[Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code ("",[],[]) "$e = mc^2$",Str "."]] - ,[Plain [Str "$22,000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money.",Space,Str "So",Space,Str "is",Space,Str "$34,000.",SoftBreak,Str "(It",Space,Str "worked",Space,Str "if",Space,Quoted DoubleQuote [Str "lot"],Space,Str "is",Space,Str "emphasized.)"]] - ,[Plain [Str "Shoes",Space,Str "($20)",Space,Str "and",Space,Str "socks",Space,Str "($5)."]] - ,[Plain [Str "Escaped",Space,Code ("",[],[]) "$",Str ":",Space,Str "$73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23$."]]] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"] -,RawBlock (Format "tex") "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" -,HorizontalRule -,Header 1 ("special-characters",[],[]) [Str "Special",Space,Str "Characters"] -,Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "unicode:"] -,BulletList - [[Plain [Str "I",Space,Str "hat:",Space,Str "\206"]] - ,[Plain [Str "o",Space,Str "umlaut:",Space,Str "\246"]] - ,[Plain [Str "section:",Space,Str "\167"]] - ,[Plain [Str "set",Space,Str "membership:",Space,Str "\8712"]] - ,[Plain [Str "copyright:",Space,Str "\169"]]] -,Para [Str "AT&T",Space,Str "has",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "their",Space,Str "name."] -,Para [Str "AT&T",Space,Str "is",Space,Str "another",Space,Str "way",Space,Str "to",Space,Str "write",Space,Str "it."] -,Para [Str "This",Space,Str "&",Space,Str "that."] -,Para [Str "4",Space,Str "<",Space,Str "5."] -,Para [Str "6",Space,Str ">",Space,Str "5."] -,Para [Str "Backslash:",Space,Str "\\"] -,Para [Str "Backtick:",Space,Str "`"] -,Para [Str "Asterisk:",Space,Str "*"] -,Para [Str "Underscore:",Space,Str "_"] -,Para [Str "Left",Space,Str "brace:",Space,Str "{"] -,Para [Str "Right",Space,Str "brace:",Space,Str "}"] -,Para [Str "Left",Space,Str "bracket:",Space,Str "["] -,Para [Str "Right",Space,Str "bracket:",Space,Str "]"] -,Para [Str "Left",Space,Str "paren:",Space,Str "("] -,Para [Str "Right",Space,Str "paren:",Space,Str ")"] -,Para [Str "Greater-than:",Space,Str ">"] -,Para [Str "Hash:",Space,Str "#"] -,Para [Str "Period:",Space,Str "."] -,Para [Str "Bang:",Space,Str "!"] -,Para [Str "Plus:",Space,Str "+"] -,Para [Str "Minus:",Space,Str "-"] -,HorizontalRule -,Header 1 ("links",[],[]) [Str "Links"] -,Header 2 ("explicit",[],[]) [Str "Explicit"] -,Para [Str "Just",Space,Str "a",Space,Link ("",[],[]) [Str "URL"] ("/url/",""),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title"),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title preceded by two spaces"),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title preceded by a tab"),Str "."] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title with \"quotes\" in it")] -,Para [Link ("",[],[]) [Str "URL",Space,Str "and",Space,Str "title"] ("/url/","title with single quotes")] -,Para [Link ("",[],[]) [Str "with_underscore"] ("/url/with_underscore","")] -,Para [Link ("",[],[]) [Str "Email",Space,Str "link"] ("mailto:nobody@nowhere.net","")] -,Para [Link ("",[],[]) [Str "Empty"] ("",""),Str "."] -,Header 2 ("reference",[],[]) [Str "Reference"] -,Para [Str "Foo",Space,Link ("",[],[]) [Str "bar"] ("/url/",""),Str "."] -,Para [Str "With",Space,Link ("",[],[]) [Str "embedded",Space,Str "[brackets]"] ("/url/",""),Str "."] -,Para [Link ("",[],[]) [Str "b"] ("/url/",""),Space,Str "by",Space,Str "itself",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "link."] -,Para [Str "Indented",Space,Link ("",[],[]) [Str "once"] ("/url",""),Str "."] -,Para [Str "Indented",Space,Link ("",[],[]) [Str "twice"] ("/url",""),Str "."] -,Para [Str "Indented",Space,Link ("",[],[]) [Str "thrice"] ("/url",""),Str "."] -,Para [Str "This",Space,Str "should",Space,Str "[not][]",Space,Str "be",Space,Str "a",Space,Str "link."] -,CodeBlock ("",[],[]) "[not]: /url" -,Para [Str "Foo",Space,Link ("",[],[]) [Str "bar"] ("/url/","Title with \"quotes\" inside"),Str "."] -,Para [Str "Foo",Space,Link ("",[],[]) [Str "biz"] ("/url/","Title with \"quote\" inside"),Str "."] -,Header 2 ("with-ampersands",[],[]) [Str "With",Space,Str "ampersands"] -,Para [Str "Here\8217s",Space,Str "a",Space,Link ("",[],[]) [Str "link",Space,Str "with",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "the",Space,Str "URL"] ("http://example.com/?foo=1&bar=2",""),Str "."] -,Para [Str "Here\8217s",Space,Str "a",Space,Str "link",Space,Str "with",Space,Str "an",Space,Str "amersand",Space,Str "in",Space,Str "the",Space,Str "link",Space,Str "text:",Space,Link ("",[],[]) [Str "AT&T"] ("http://att.com/","AT&T"),Str "."] -,Para [Str "Here\8217s",Space,Str "an",Space,Link ("",[],[]) [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."] -,Para [Str "Here\8217s",Space,Str "an",Space,Link ("",[],[]) [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."] -,Header 2 ("autolinks",[],[]) [Str "Autolinks"] -,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link ("",["uri"],[]) [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] -,BulletList - [[Plain [Str "In",Space,Str "a",Space,Str "list?"]] - ,[Plain [Link ("",["uri"],[]) [Str "http://example.com/"] ("http://example.com/","")]] - ,[Plain [Str "It",Space,Str "should."]]] -,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link ("",["email"],[]) [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] -,BlockQuote - [Para [Str "Blockquoted:",Space,Link ("",["uri"],[]) [Str "http://example.com/"] ("http://example.com/","")]] -,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) ""] -,CodeBlock ("",[],[]) "or here: " -,HorizontalRule -,Header 1 ("images",[],[]) [Str "Images"] -,Para [Str "From",Space,Quoted DoubleQuote [Str "Voyage",Space,Str "dans",Space,Str "la",Space,Str "Lune"],Space,Str "by",Space,Str "Georges",Space,Str "Melies",Space,Str "(1902):"] -,Para [Image ("",[],[]) [Str "lalune"] ("lalune.jpg","fig:Voyage dans la Lune")] -,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image ("",[],[]) [Str "movie"] ("movie.jpg",""),Space,Str "icon."] -,HorizontalRule -,Header 1 ("footnotes",[],[]) [Str "Footnotes"] -,Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Note [Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote.",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",SoftBreak,Str "reference.",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document."]],Space,Str "and",Space,Str "another.",Note [Para [Str "Here\8217s",Space,Str "the",Space,Str "long",Space,Str "note.",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",SoftBreak,Str "blocks."],Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",SoftBreak,Str "footnote",Space,Str "(as",Space,Str "with",Space,Str "list",Space,Str "items)."],CodeBlock ("",[],[]) " { }",Para [Str "If",Space,Str "you",Space,Str "want,",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line,",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",SoftBreak,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block."]],SoftBreak,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Space,Str "because",Space,Str "it",SoftBreak,Str "contains",Space,Str "a",Space,Str "space.[^my",Space,Str "note]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note.",Note [Para [Str "This",SoftBreak,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type.",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",SoftBreak,Link ("",[],[]) [Str "links"] ("http://google.com",""),Space,Str "and",Space,Code ("",[],[]) "]",Space,Str "verbatim",Space,Str "characters,",SoftBreak,Str "as",Space,Str "well",Space,Str "as",Space,Str "[bracketed",Space,Str "text]."]]] -,BlockQuote - [Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes.",Note [Para [Str "In",Space,Str "quote."]]]] -,OrderedList (1,Decimal,Period) - [[Plain [Str "And",Space,Str "in",Space,Str "list",Space,Str "items.",Note [Para [Str "In",Space,Str "list."]]]]] -,Para [Str "This",Space,Str "paragraph",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "part",Space,Str "of",Space,Str "the",Space,Str "note,",Space,Str "as",Space,Str "it",Space,Str "is",Space,Str "not",Space,Str "indented."]] +Pandoc + ( Meta + { unMeta = fromList + [ + ( "author" + , MetaList + [ MetaInlines + [ Str "John", Space, Str "MacFarlane" ] + , MetaInlines + [ Str "Anonymous" ] + ] + ) + , + ( "date" + , MetaInlines + [ Str "July", Space, Str "17,", Space, Str "2006" ] + ) + , + ( "title" + , MetaInlines + [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] + ) + ] + } + ) + [ 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 "Most" + , Space + , Str "of" + , Space + , Str "them" + , Space + , Str "are" + , Space + , Str "adapted" + , Space + , Str "from" + , SoftBreak + , 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-embedded-link", [], [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Link + ( "", [], [] ) + [ Str "embedded", Space, Str "link" ] + ( "/url", "" ) + ] + , Header 3 + ( "level-3-with-emphasis", [], [] ) + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph + [ Str "emphasis" ] + ] + , Header 4 + ( "level-4", [], [] ) + [ Str "Level", Space, Str "4" ] + , Header 5 + ( "level-5", [], [] ) + [ Str "Level", Space, Str "5" ] + , Header 1 + ( "level-1", [], [] ) + [ Str "Level", Space, Str "1" ] + , Header 2 + ( "level-2-with-emphasis", [], [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph + [ Str "emphasis" ] + ] + , Header 3 + ( "level-3", [], [] ) + [ Str "Level", Space, Str "3" ] + , Para + [ Str "with", Space, Str "no", Space, Str "blank", Space, Str "line" ] + , Header 2 + ( "level-2", [], [] ) + [ Str "Level", Space, Str "2" ] + , Para + [ Str "with", Space, Str "no", Space, Str "blank", Space, Str "line" ] + , HorizontalRule + , Header 1 + ( "paragraphs", [], [] ) + [ Str "Paragraphs" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , SoftBreak + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + , SoftBreak + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" + , Space + , Str "in" + , Space + , Str "the" + , SoftBreak + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , SoftBreak + , Str "list" + , Space + , Str "item." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , SoftBreak + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" + , LineBreak + , Str "here." + ] + , HorizontalRule + , Header 1 + ( "block-quotes", [], [] ) + [ Str "Block", Space, Str "Quotes" ] + , Para + [ Str "E-mail", Space, Str "style:" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , SoftBreak + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] + ] + , BlockQuote + [ Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , CodeBlock + ( "", [], [] ) "sub status {\n print \"working\";\n}" + , Para + [ Str "A", Space, Str "list:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "item", Space, Str "one" ] ] + , + [ Plain [ Str "item", Space, Str "two" ] ] + ] + , Para + [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] + , BlockQuote + [ Para [ Str "nested" ] ] + , BlockQuote + [ Para [ Str "nested" ] ] + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + , Space + , Str "2" + , SoftBreak + , Str ">" + , Space + , Str "1." + ] + , Para + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] + , HorizontalRule + , Header 1 + ( "code-blocks", [], [] ) + [ Str "Code", Space, Str "Blocks" ] + , Para + [ Str "Code:" ] + , CodeBlock + ( "" + , [] + , [] + ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + , Para + [ Str "And:" ] + , CodeBlock + ( "" + , [] + , [] + ) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + , HorizontalRule + , Header 1 + ( "lists", [], [] ) + [ Str "Lists" ] + , Header 2 + ( "unordered", [], [] ) + [ Str "Unordered" ] + , Para + [ Str "Asterisks", Space, Str "tight:" ] + , BulletList + [ + [ Plain [ Str "asterisk", Space, Str "1" ] ] + , + [ Plain [ Str "asterisk", Space, Str "2" ] ] + , + [ Plain [ Str "asterisk", Space, Str "3" ] ] + ] + , Para + [ Str "Asterisks", Space, Str "loose:" ] + , BulletList + [ + [ Para [ Str "asterisk", Space, Str "1" ] ] + , + [ Para [ Str "asterisk", Space, Str "2" ] ] + , + [ Para [ Str "asterisk", Space, Str "3" ] ] + ] + , Para + [ Str "Pluses", Space, Str "tight:" ] + , BulletList + [ + [ Plain [ Str "Plus", Space, Str "1" ] ] + , + [ Plain [ Str "Plus", Space, Str "2" ] ] + , + [ Plain [ Str "Plus", Space, Str "3" ] ] + ] + , Para + [ Str "Pluses", Space, Str "loose:" ] + , BulletList + [ + [ Para [ Str "Plus", Space, Str "1" ] ] + , + [ Para [ Str "Plus", Space, Str "2" ] ] + , + [ Para [ Str "Plus", Space, Str "3" ] ] + ] + , Para + [ Str "Minuses", Space, Str "tight:" ] + , BulletList + [ + [ Plain [ Str "Minus", Space, Str "1" ] ] + , + [ Plain [ Str "Minus", Space, Str "2" ] ] + , + [ Plain [ Str "Minus", Space, Str "3" ] ] + ] + , Para + [ Str "Minuses", Space, Str "loose:" ] + , BulletList + [ + [ Para [ Str "Minus", Space, Str "1" ] ] + , + [ Para [ Str "Minus", Space, Str "2" ] ] + , + [ Para [ Str "Minus", Space, Str "3" ] ] + ] + , Header 2 + ( "ordered", [], [] ) + [ Str "Ordered" ] + , Para + [ Str "Tight:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "First" ] ] + , + [ Plain [ Str "Second" ] ] + , + [ Plain [ Str "Third" ] ] + ] + , Para + [ Str "and:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "One" ] ] + , + [ Plain [ Str "Two" ] ] + , + [ Plain [ Str "Three" ] ] + ] + , Para + [ Str "Loose", Space, Str "using", Space, Str "tabs:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para [ Str "Second" ] ] + , + [ Para [ Str "Third" ] ] + ] + , Para + [ Str "and", Space, Str "using", Space, Str "spaces:" ] + , OrderedList + ( 1, Decimal, Period ) + [ [ Para [ Str "One" ] ], [ Para [ Str "Two" ] ], [ Para [ Str "Three" ] ] ] + , Para + [ Str "Multiple", Space, Str "paragraphs:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para + [ Str "Item", Space, Str "1,", Space, Str "graf", Space, Str "one." ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , SoftBreak + , Str "back." + ] + ] + , + [ Para [ Str "Item", Space, Str "2." ] ] + , + [ Para [ Str "Item", Space, Str "3." ] ] + ] + , Header 2 + ( "nested", [], [] ) + [ Str "Nested" ] + , BulletList + [ + [ Plain + [ Str "Tab" ] + , BulletList + [ [ Plain [ Str "Tab" ], BulletList [ [ Plain [ Str "Tab" ] ] ] ] ] + ] + ] + , Para + [ Str "Here\8217s", Space, Str "another:" ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain [ Str "First" ] ] + , + [ Plain + [ Str "Second:" ] + , BulletList + [ + [ Plain [ Str "Fee" ] ] + , + [ Plain [ Str "Fie" ] ] + , + [ Plain [ Str "Foe" ] ] + ] + ] + , + [ Plain [ Str "Third" ] ] + ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" + ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Para [ Str "First" ] ] + , + [ Para + [ Str "Second:" ] + , BulletList + [ + [ Plain [ Str "Fee" ] ] + , + [ Plain [ Str "Fie" ] ] + , + [ Plain [ Str "Foe" ] ] + ] + ] + , + [ Para [ Str "Third" ] ] + ] + , Header 2 + ( "tabs-and-spaces", [], [] ) + [ Str "Tabs", Space, Str "and", Space, Str "spaces" ] + , BulletList + [ + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + , BulletList + [ + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , + [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + ] + ] + ] + ] + , Header 2 + ( "fancy-list-markers", [], [] ) + [ Str "Fancy", Space, Str "list", Space, Str "markers" ] + , OrderedList + ( 2, Decimal, TwoParens ) + [ + [ Para [ Str "begins", Space, Str "with", Space, Str "2" ] ] + , + [ Para + [ Str "and", Space, Str "now", Space, Str "3" ] + , Para + [ Str "with", Space, Str "a", Space, Str "continuation" ] + , OrderedList + ( 4, LowerRoman, Period ) + [ + [ Plain + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , SoftBreak + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" + ] + ] + , + [ Plain + [ Str "more", Space, Str "items" ] + , OrderedList + ( 1, UpperAlpha, TwoParens ) + [ + [ Plain [ Str "a", Space, Str "subsublist" ] ] + , + [ Plain [ Str "a", Space, Str "subsublist" ] ] + ] + ] + ] + ] + ] + , Para + [ Str "Nesting:" ] + , OrderedList + ( 1, UpperAlpha, Period ) + [ + [ Plain + [ Str "Upper", Space, Str "Alpha" ] + , OrderedList + ( 1, UpperRoman, Period ) + [ + [ Plain + [ Str "Upper", Space, Str "Roman." ] + , OrderedList + ( 6, Decimal, TwoParens ) + [ + [ Plain + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3, LowerAlpha, OneParen ) + [ + [ Plain + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] + ] + ] + ] + ] + ] + ] + , Para + [ Str "Autonumbering:" ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ + [ Plain [ Str "Autonumber." ] ] + , + [ Plain + [ Str "More." ] + , OrderedList + ( 1, DefaultStyle, DefaultDelim ) + [ [ Plain [ Str "Nested." ] ] ] + ] + ] + , Para + [ Str "Should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item:" + ] + , Para + [ Str "M.A.\160\&2007" ] + , Para + [ Str "B.", Space, Str "Williams" ] + , HorizontalRule + , Header 1 + ( "definition-lists", [], [] ) + [ Str "Definition", Space, Str "Lists" ] + , Para + [ Str "Tight", Space, Str "using", Space, Str "spaces:" ] + , DefinitionList + [ + ( [ Str "apple" ], [ [ Plain [ Str "red", Space, Str "fruit" ] ] ] ) + , + ( [ Str "orange" ], [ [ Plain [ Str "orange", Space, Str "fruit" ] ] ] ) + , + ( [ Str "banana" ], [ [ Plain [ Str "yellow", Space, Str "fruit" ] ] ] ) + ] + , Para + [ Str "Tight", Space, Str "using", Space, Str "tabs:" ] + , DefinitionList + [ + ( [ Str "apple" ], [ [ Plain [ Str "red", Space, Str "fruit" ] ] ] ) + , + ( [ Str "orange" ], [ [ Plain [ Str "orange", Space, Str "fruit" ] ] ] ) + , + ( [ Str "banana" ], [ [ Plain [ Str "yellow", Space, Str "fruit" ] ] ] ) + ] + , Para + [ Str "Loose:" ] + , DefinitionList + [ + ( [ Str "apple" ], [ [ Para [ Str "red", Space, Str "fruit" ] ] ] ) + , + ( [ Str "orange" ], [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] ) + , + ( [ Str "banana" ], [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] ) + ] + , Para + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "with" + , Space + , Str "italics:" + ] + , DefinitionList + [ + ( + [ Emph [ Str "apple" ] ] + , + [ + [ Para + [ Str "red", Space, Str "fruit" ] + , Para + [ Str "contains" + , Space + , Str "seeds," + , SoftBreak + , Str "crisp," + , Space + , Str "pleasant" + , Space + , Str "to" + , Space + , Str "taste" + ] + ] + ] + ) + , + ( + [ Emph [ Str "orange" ] ] + , + [ + [ Para + [ Str "orange", Space, Str "fruit" ] + , CodeBlock + ( "", [], [] ) "{ orange code block }" + , BlockQuote + [ Para [ Str "orange", Space, Str "block", Space, Str "quote" ] ] + ] + ] + ) + ] + , Para + [ Str "Multiple", Space, Str "definitions,", Space, Str "tight:" ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ + [ Plain [ Str "red", Space, Str "fruit" ] ] + , + [ Plain [ Str "computer" ] ] + ] + ) + , + ( + [ Str "orange" ] + , + [ + [ Plain [ Str "orange", Space, Str "fruit" ] ] + , + [ Plain [ Str "bank" ] ] + ] + ) + ] + , Para + [ Str "Multiple", Space, Str "definitions,", Space, Str "loose:" ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ + [ Para [ Str "red", Space, Str "fruit" ] ] + , + [ Para [ Str "computer" ] ] + ] + ) + , + ( + [ Str "orange" ] + , + [ + [ Para [ Str "orange", Space, Str "fruit" ] ] + , + [ Para [ Str "bank" ] ] + ] + ) + ] + , Para + [ Str "Blank" + , Space + , Str "line" + , Space + , Str "after" + , Space + , Str "term," + , Space + , Str "indented" + , Space + , Str "marker," + , Space + , Str "alternate" + , Space + , Str "markers:" + ] + , DefinitionList + [ + ( + [ Str "apple" ] + , + [ + [ Para [ Str "red", Space, Str "fruit" ] ] + , + [ Para [ Str "computer" ] ] + ] + ) + , + ( + [ Str "orange" ] + , + [ + [ Para + [ Str "orange", Space, Str "fruit" ] + , OrderedList + ( 1, Decimal, Period ) + [ [ Plain [ Str "sublist" ] ], [ Plain [ Str "sublist" ] ] ] + ] + ] + ) + ] + , Header 1 + ( "html-blocks", [], [] ) + [ Str "HTML", Space, Str "Blocks" ] + , Para + [ Str "Simple" + , Space + , Str "block" + , Space + , Str "on" + , Space + , Str "one" + , Space + , Str "line:" + ] + , Div + ( "", [], [] ) + [ Plain [ Str "foo" ] ] + , Para + [ Str "And" + , Space + , Str "nested" + , Space + , Str "without" + , Space + , Str "indentation:" + ] + , Div + ( "", [], [] ) + [ Div + ( "", [], [] ) + [ Div ( "", [], [] ) [ Para [ Str "foo" ] ] ] + , Div + ( "", [], [] ) + [ Plain [ Str "bar" ] ] + ] + , Para + [ Str "Interpreted" + , Space + , Str "markdown" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "table:" + ] + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "
" + , Plain + [ Str "This", Space, Str "is", Space, Emph [ Str "emphasized" ] ] + , RawBlock + ( Format "html" ) "" + , Plain + [ Str "And" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Strong + [ Str "strong" ] + ] + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "" + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "simple" + , Space + , Str "block:" + ] + , Div + ( "", [], [] ) + [ Para [ Str "foo" ] ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "code" + , Space + , Str "block," + , Space + , Str "though:" + ] + , CodeBlock + ( "", [], [] ) "
\n foo\n
" + , Para + [ Str "As", Space, Str "should", Space, Str "this:" ] + , CodeBlock + ( "", [], [] ) "
foo
" + , Para + [ Str "Now,", Space, Str "nested:" ] + , Div + ( "", [], [] ) + [ Div ( "", [], [] ) [ Div ( "", [], [] ) [ Plain [ Str "foo" ] ] ] ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "just" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "HTML" + , Space + , Str "comment:" + ] + , RawBlock + ( Format "html" ) "" + , Para + [ Str "Multiline:" ] + , RawBlock + ( Format "html" ) "" + , RawBlock + ( Format "html" ) "" + , Para + [ Str "Code", Space, Str "block:" ] + , CodeBlock + ( "", [], [] ) "" + , Para + [ Str "Just" + , Space + , Str "plain" + , Space + , Str "comment," + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "spaces" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "line:" + ] + , RawBlock + ( Format "html" ) "" + , Para + [ Str "Code:" ] + , CodeBlock + ( "", [], [] ) "
" + , Para + [ Str "Hr\8217s:" ] + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , RawBlock + ( Format "html" ) "
" + , HorizontalRule + , Header 1 + ( "inline-markup", [], [] ) + [ Str "Inline", Space, Str "Markup" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph + [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph + [ Str "is", Space, Str "this" ] + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Strong + [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Strong + [ Str "is", Space, Str "this" ] + , Str "." + ] + , Para + [ Str "An" + , Space + , Emph + [ Link + ( "", [], [] ) + [ Str "emphasized", Space, Str "link" ] + ( "/url", "" ) + ] + , Str "." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong + [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong + [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code + ( "", [], [] ) ">" + , Str "," + , Space + , Code + ( "", [], [] ) "$" + , Str "," + , Space + , Code + ( "", [], [] ) "\\" + , Str "," + , Space + , Code + ( "", [], [] ) "\\$" + , Str "," + , Space + , Code + ( "", [], [] ) "" + , Str "." + ] + , Para + [ Strikeout + [ Str "This", Space, Str "is", Space, Emph [ Str "strikeout" ], Str "." ] + ] + , Para + [ Str "Superscripts:" + , Space + , Str "a" + , Superscript + [ Str "bc" ] + , Str "d" + , Space + , Str "a" + , Superscript + [ Emph [ Str "hello" ] ] + , Space + , Str "a" + , Superscript + [ Str "hello\160there" ] + , Str "." + ] + , Para + [ Str "Subscripts:" + , Space + , Str "H" + , Subscript + [ Str "2" ] + , Str "O," + , Space + , Str "H" + , Subscript + [ Str "23" ] + , Str "O," + , Space + , Str "H" + , Subscript + [ Str "many\160of\160them" ] + , Str "O." + ] + , Para + [ Str "These" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "superscripts" + , Space + , Str "or" + , Space + , Str "subscripts," + , SoftBreak + , Str "because" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "unescaped" + , Space + , Str "spaces:" + , Space + , Str "a^b" + , Space + , Str "c^d," + , Space + , Str "a~b" + , Space + , Str "c~d." + ] + , HorizontalRule + , Header 1 + ( "smart-quotes-ellipses-dashes", [], [] ) + [ Str "Smart" + , Space + , Str "quotes," + , Space + , Str "ellipses," + , Space + , Str "dashes" + ] + , Para + [ Quoted DoubleQuote + [ Str "Hello," ] + , Space + , Str "said" + , Space + , Str "the" + , Space + , Str "spider." + , Space + , Quoted DoubleQuote + [ Quoted SingleQuote + [ Str "Shelob" ] + , Space + , Str "is" + , Space + , Str "my" + , Space + , Str "name." + ] + ] + , Para + [ Quoted SingleQuote + [ Str "A" ] + , Str "," + , Space + , Quoted SingleQuote + [ Str "B" ] + , Str "," + , Space + , Str "and" + , Space + , Quoted SingleQuote + [ Str "C" ] + , Space + , Str "are" + , Space + , Str "letters." + ] + , Para + [ Quoted SingleQuote + [ Str "Oak," ] + , Space + , Quoted SingleQuote + [ Str "elm," ] + , Space + , Str "and" + , Space + , Quoted SingleQuote + [ Str "beech" ] + , Space + , Str "are" + , Space + , Str "names" + , Space + , Str "of" + , Space + , Str "trees." + , SoftBreak + , Str "So" + , Space + , Str "is" + , Space + , Quoted SingleQuote + [ Str "pine." ] + ] + , Para + [ Quoted SingleQuote + [ Str "He" + , Space + , Str "said," + , Space + , Quoted DoubleQuote + [ Str "I", Space, Str "want", Space, Str "to", Space, Str "go." ] + ] + , Space + , Str "Were" + , Space + , Str "you" + , Space + , Str "alive" + , Space + , Str "in" + , Space + , Str "the" + , SoftBreak + , Str "70\8217s?" + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "quoted" + , Space + , Quoted SingleQuote + [ Code ( "", [], [] ) "code" ] + , Space + , Str "and" + , Space + , Str "a" + , Space + , Quoted DoubleQuote + [ Link + ( "", [], [] ) + [ Str "quoted", Space, Str "link" ] + ( "http://example.com/?foo=1&bar=2", "" ) + ] + , Str "." + ] + , Para + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one\8212two" + , Space + , Str "\8212" + , Space + , Str "three\8212four" + , Space + , Str "\8212" + , Space + , Str "five." + ] + , Para + [ Str "Dashes" + , Space + , Str "between" + , Space + , Str "numbers:" + , Space + , Str "5\8211\&7," + , Space + , Str "255\8211\&66," + , Space + , Str "1987\8211\&1999." + ] + , Para + [ Str "Ellipses\8230and\8230and\8230." ] + , HorizontalRule + , Header 1 + ( "latex", [], [] ) + [ Str "LaTeX" ] + , BulletList + [ + [ Plain [ RawInline ( Format "tex" ) "\\cite[22-23]{smith.1899}" ] ] + , + [ Plain [ Math InlineMath "2+2=4" ] ] + , + [ Plain [ Math InlineMath "x \\in y" ] ] + , + [ Plain [ Math InlineMath "\\alpha \\wedge \\omega" ] ] + , + [ Plain [ Math InlineMath "223" ] ] + , + [ Plain [ Math InlineMath "p", Str "-Tree" ] ] + , + [ Plain + [ Str "Here\8217s" + , Space + , Str "some" + , Space + , Str "display" + , Space + , Str "math:" + , SoftBreak + , Math DisplayMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}" + ] + ] + , + [ Plain + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "that" + , Space + , Str "has" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "break" + , Space + , Str "in" + , Space + , Str "it:" + , Space + , Math InlineMath "\\alpha + \\omega \\times x^2" + , Str "." + ] + ] + ] + , Para + [ Str "These" + , Space + , Str "shouldn\8217t" + , Space + , Str "be" + , Space + , Str "math:" + ] + , BulletList + [ + [ Plain + [ Str "To" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "famous" + , Space + , Str "equation," + , Space + , Str "write" + , Space + , Code + ( "", [], [] ) "$e = mc^2$" + , Str "." + ] + ] + , + [ Plain + [ Str "$22,000" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Emph + [ Str "lot" ] + , Space + , Str "of" + , Space + , Str "money." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "$34,000." + , SoftBreak + , Str "(It" + , Space + , Str "worked" + , Space + , Str "if" + , Space + , Quoted DoubleQuote + [ Str "lot" ] + , Space + , Str "is" + , Space + , Str "emphasized.)" + ] + ] + , + [ Plain + [ Str "Shoes" + , Space + , Str "($20)" + , Space + , Str "and" + , Space + , Str "socks" + , Space + , Str "($5)." + ] + ] + , + [ Plain + [ Str "Escaped" + , Space + , Code + ( "", [], [] ) "$" + , Str ":" + , Space + , Str "$73" + , Space + , Emph + [ Str "this" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "emphasized" + ] + , Space + , Str "23$." + ] + ] + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "LaTeX" + , Space + , Str "table:" + ] + , RawBlock + ( Format "tex" ) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" + , HorizontalRule + , Header 1 + ( "special-characters", [], [] ) + [ Str "Special", Space, Str "Characters" ] + , Para + [ Str "Here", Space, Str "is", Space, Str "some", Space, Str "unicode:" ] + , BulletList + [ + [ Plain [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] + , + [ Plain [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] + , + [ Plain [ Str "section:", Space, Str "\167" ] ] + , + [ Plain [ Str "set", Space, Str "membership:", Space, Str "\8712" ] ] + , + [ Plain [ Str "copyright:", Space, Str "\169" ] ] + ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] + , Para + [ Str "This", Space, Str "&", Space, Str "that." ] + , Para + [ Str "4", Space, Str "<", Space, Str "5." ] + , Para + [ Str "6", Space, Str ">", Space, Str "5." ] + , Para + [ Str "Backslash:", Space, Str "\\" ] + , Para + [ Str "Backtick:", Space, Str "`" ] + , Para + [ Str "Asterisk:", Space, Str "*" ] + , Para + [ Str "Underscore:", Space, Str "_" ] + , Para + [ Str "Left", Space, Str "brace:", Space, Str "{" ] + , Para + [ Str "Right", Space, Str "brace:", Space, Str "}" ] + , Para + [ Str "Left", Space, Str "bracket:", Space, Str "[" ] + , Para + [ Str "Right", Space, Str "bracket:", Space, Str "]" ] + , Para + [ Str "Left", Space, Str "paren:", Space, Str "(" ] + , Para + [ Str "Right", Space, Str "paren:", Space, Str ")" ] + , Para + [ Str "Greater-than:", Space, Str ">" ] + , Para + [ Str "Hash:", Space, Str "#" ] + , Para + [ Str "Period:", Space, Str "." ] + , Para + [ Str "Bang:", Space, Str "!" ] + , Para + [ Str "Plus:", Space, Str "+" ] + , Para + [ Str "Minus:", Space, Str "-" ] + , HorizontalRule + , Header 1 + ( "links", [], [] ) + [ Str "Links" ] + , Header 2 + ( "explicit", [], [] ) + [ Str "Explicit" ] + , Para + [ Str "Just" + , Space + , Str "a" + , Space + , Link + ( "", [], [] ) + [ Str "URL" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "title" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "title preceded by two spaces" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "title preceded by a tab" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "title with \"quotes\" in it" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "URL", Space, Str "and", Space, Str "title" ] + ( "/url/", "title with single quotes" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "with_underscore" ] + ( "/url/with_underscore", "" ) + ] + , Para + [ Link + ( "", [], [] ) + [ Str "Email", Space, Str "link" ] + ( "mailto:nobody@nowhere.net", "" ) + ] + , Para + [ Link ( "", [], [] ) [ Str "Empty" ] ( "", "" ), Str "." ] + , Header 2 + ( "reference", [], [] ) + [ Str "Reference" ] + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "bar" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Str "With" + , Space + , Link + ( "", [], [] ) + [ Str "embedded", Space, Str "[brackets]" ] + ( "/url/", "" ) + , Str "." + ] + , Para + [ Link + ( "", [], [] ) + [ Str "b" ] + ( "/url/", "" ) + , Space + , Str "by" + , Space + , Str "itself" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , Para + [ Str "Indented" + , Space + , Link + ( "", [], [] ) + [ Str "once" ] + ( "/url", "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link + ( "", [], [] ) + [ Str "twice" ] + ( "/url", "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link + ( "", [], [] ) + [ Str "thrice" ] + ( "/url", "" ) + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "[not][]" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , CodeBlock + ( "", [], [] ) "[not]: /url" + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "bar" ] + ( "/url/", "Title with \"quotes\" inside" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link + ( "", [], [] ) + [ Str "biz" ] + ( "/url/", "Title with \"quote\" inside" ) + , Str "." + ] + , Header 2 + ( "with-ampersands", [], [] ) + [ Str "With", Space, Str "ampersands" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Link + ( "", [], [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2", "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "amersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "link" + , Space + , Str "text:" + , Space + , Link + ( "", [], [] ) + [ Str "AT&T" ] + ( "http://att.com/", "AT&T" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "", [], [] ) + [ Str "inline", Space, Str "link" ] + ( "/script?foo=1&bar=2", "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "", [], [] ) + [ Str "inline" + , Space + , Str "link" + , Space + , Str "in" + , Space + , Str "pointy" + , Space + , Str "braces" + ] + ( "/script?foo=1&bar=2", "" ) + , Str "." + ] + , Header 2 + ( "autolinks", [], [] ) + [ Str "Autolinks" ] + , Para + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" + , Space + , Link + ( "", [ "uri" ], [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2", "" ) + ] + , BulletList + [ + [ Plain [ Str "In", Space, Str "a", Space, Str "list?" ] ] + , + [ Plain + [ Link + ( "", [ "uri" ], [] ) + [ Str "http://example.com/" ] + ( "http://example.com/", "" ) + ] + ] + , + [ Plain [ Str "It", Space, Str "should." ] ] + ] + , Para + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" + , Space + , Link + ( "", [ "email" ], [] ) + [ Str "nobody@nowhere.net" ] + ( "mailto:nobody@nowhere.net", "" ) + ] + , BlockQuote + [ Para + [ Str "Blockquoted:" + , Space + , Link + ( "", [ "uri" ], [] ) + [ Str "http://example.com/" ] + ( "http://example.com/", "" ) + ] + ] + , Para + [ Str "Auto-links" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "occur" + , Space + , Str "here:" + , Space + , Code + ( "", [], [] ) "" + ] + , CodeBlock + ( "", [], [] ) "or here: " + , HorizontalRule + , Header 1 + ( "images", [], [] ) + [ Str "Images" ] + , Para + [ Str "From" + , Space + , Quoted DoubleQuote + [ Str "Voyage", Space, Str "dans", Space, Str "la", Space, Str "Lune" ] + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" + ] + , Para + [ Image + ( "", [], [] ) + [ Str "lalune" ] + ( "lalune.jpg", "fig:Voyage dans la Lune" ) + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space + , Image + ( "", [], [] ) + [ Str "movie" ] + ( "movie.jpg", "" ) + , Space + , Str "icon." + ] + , HorizontalRule + , Header 1 + ( "footnotes", [], [] ) + [ Str "Footnotes" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Note + [ Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "footnote." + , Space + , Str "It" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "anywhere" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "footnote" + , SoftBreak + , Str "reference." + , Space + , Str "It" + , Space + , Str "need" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "placed" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "document." + ] + ] + , Space + , Str "and" + , Space + , Str "another." + , Note + [ Para + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "long" + , Space + , Str "note." + , Space + , Str "This" + , Space + , Str "one" + , Space + , Str "contains" + , Space + , Str "multiple" + , SoftBreak + , Str "blocks." + ] + , Para + [ Str "Subsequent" + , Space + , Str "blocks" + , Space + , Str "are" + , Space + , Str "indented" + , Space + , Str "to" + , Space + , Str "show" + , Space + , Str "that" + , Space + , Str "they" + , Space + , Str "belong" + , Space + , Str "to" + , Space + , Str "the" + , SoftBreak + , Str "footnote" + , Space + , Str "(as" + , Space + , Str "with" + , Space + , Str "list" + , Space + , Str "items)." + ] + , CodeBlock + ( "", [], [] ) " { }" + , Para + [ Str "If" + , Space + , Str "you" + , Space + , Str "want," + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "indent" + , Space + , Str "every" + , Space + , Str "line," + , Space + , Str "but" + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "be" + , SoftBreak + , Str "lazy" + , Space + , Str "and" + , Space + , Str "just" + , Space + , Str "indent" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "line" + , Space + , Str "of" + , Space + , Str "each" + , Space + , Str "block." + ] + ] + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Emph + [ Str "not" ] + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Space + , Str "because" + , Space + , Str "it" + , SoftBreak + , Str "contains" + , Space + , Str "a" + , Space + , Str "space.[^my" + , Space + , Str "note]" + , Space + , Str "Here" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "inline" + , Space + , Str "note." + , Note + [ Para + [ Str "This" + , SoftBreak + , Str "is" + , Space + , Emph + [ Str "easier" ] + , Space + , Str "to" + , Space + , Str "type." + , Space + , Str "Inline" + , Space + , Str "notes" + , Space + , Str "may" + , Space + , Str "contain" + , SoftBreak + , Link + ( "", [], [] ) + [ Str "links" ] + ( "http://google.com", "" ) + , Space + , Str "and" + , Space + , Code + ( "", [], [] ) "]" + , Space + , Str "verbatim" + , Space + , Str "characters," + , SoftBreak + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str "[bracketed" + , Space + , Str "text]." + ] + ] + ] + , BlockQuote + [ Para + [ Str "Notes" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "in" + , Space + , Str "quotes." + , Note + [ Para [ Str "In", Space, Str "quote." ] ] + ] + ] + , OrderedList + ( 1, Decimal, Period ) + [ + [ Plain + [ Str "And" + , Space + , Str "in" + , Space + , Str "list" + , Space + , Str "items." + , Note + [ Para [ Str "In", Space, Str "list." ] ] + ] + ] + ] + , Para + [ Str "This" + , Space + , Str "paragraph" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "note," + , Space + , Str "as" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "indented." + ] + ] diff --git a/test/writer.opendocument b/test/writer.opendocument index fa524eb26..9e6ef336e 100644 --- a/test/writer.opendocument +++ b/test/writer.opendocument @@ -1207,9 +1207,9 @@ linkParagraphs Here’s a regular paragraph. -In Markdown 1.0.0 and earlier. Version -8. This line turns into a list item. Because a hard-wrapped line in the middle -of a paragraph looked like a list item. +In Markdown 1.0.0 and earlier. Version 8. +This line turns into a list item. Because a hard-wrapped line in the middle of a +paragraph looked like a list item. Here’s one with a bullet. * criminey. There should be a hard line @@ -1218,8 +1218,7 @@ breakhere. Block Quotes E-mail style: -This is a block quote. It is pretty -short. +This is a block quote. It is pretty short. Code in a block quote: sub status { print "working"; @@ -1236,8 +1235,8 @@ short. Nested block quotes: nested nested -This should not be a block quote: -2 > 1. +This should not be a block quote: 2 +> 1. And a following paragraph. Code @@ -1464,12 +1463,12 @@ and spaces this is a list item indented with spaces - this is an example list item indented - with tabs + this is an example list item indented with + tabs - this is an example list item indented - with spaces + this is an example list item indented with + spaces @@ -1485,8 +1484,8 @@ list markers with a continuation - sublist with roman numerals, starting - with 4 + sublist with roman numerals, starting with + 4 more items @@ -1537,8 +1536,7 @@ list markers -Should not be a list -item: +Should not be a list item: M.A. 2007 B. Williams @@ -1573,8 +1571,8 @@ fruit italics: apple red -fruitcontains -seeds, crisp, pleasant to taste +fruitcontains seeds, +crisp, pleasant to taste orange orange fruit{ orange code block }orange @@ -1613,15 +1611,12 @@ fruit HTML Blocks -Simple block on one -line: +Simple block on one line: foo -And nested without -indentation: +And nested without indentation: foo bar -Interpreted markdown in a -table: +Interpreted markdown in a table: This is emphasized And this is @@ -1689,13 +1684,13 @@ subscripts, because of the unescaped spaces: a^b c^d, a~b c~d. Smart quotes, ellipses, dashes -“Hello,” said the spider. -“‘Shelob’ is my name.” +“Hello,” said the spider. “‘Shelob’ +is my name.” ‘A’, ‘B’, and ‘C’ are letters. ‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’ -‘He said, “I want to go.”’ Were you -alive in the 70’s? +‘He said, “I want to go.”’ Were you alive +in the 70’s? Here is some quoted ‘code’ and a “quoted @@ -1743,8 +1738,8 @@ five. $22,000 is a - lot of money. So is $34,000. - (It worked if “lot” is emphasized.) + lot of money. So is $34,000. (It + worked if “lot” is emphasized.) Shoes ($20) and socks ($5). @@ -1778,8 +1773,8 @@ Characters copyright: © -AT&T has an ampersand in -their name. +AT&T has an ampersand in their +name. AT&T is another way to write it. This & that. @@ -1888,25 +1883,23 @@ icon. Footnotes Here is a footnote reference,1Here -is the footnote. It can go anywhere after the footnote reference. It need not -be placed at the end of the document. -and +is the footnote. It can go anywhere after the footnote reference. It need not be +placed at the end of the document. and another.2Here’s the long note. This one contains multiple blocks.Subsequent blocks are indented to show that they belong to the footnote (as with list items).{ <code> }If you want, you can indent every line, but you can also be lazy and just indent -the first line of each block. This -should not be a footnote -reference, because it contains a space.[^my note] Here is an inline +the first line of each block. This should +not be a footnote reference, because +it contains a space.[^my note] Here is an inline note.3This -is easier to type. Inline notes -may contain +is easier to type. Inline notes may +contain links -and ] verbatim -characters, as well as [bracketed -text]. +and ] verbatim characters, +as well as [bracketed text]. Notes can go in quotes.4In quote. diff --git a/test/writer.org b/test/writer.org index 38ec35a3e..604aca21d 100644 --- a/test/writer.org +++ b/test/writer.org @@ -566,8 +566,8 @@ Superscripts: a^{bc}d a^{/hello/} a^{hello there}. Subscripts: H_{2}O, H_{23}O, H_{many of them}O. -These should not be superscripts or subscripts, because of the unescaped -spaces: a^b c^d, a~b c~d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a^b c^d, a~b c~d. -------------- @@ -739,8 +739,7 @@ Foo [[/url/][biz]]. :PROPERTIES: :CUSTOM_ID: with-ampersands :END: -Here's a [[http://example.com/?foo=1&bar=2][link with an ampersand in the -URL]]. +Here's a [[http://example.com/?foo=1&bar=2][link with an ampersand in the URL]]. Here's a link with an amersand in the link text: [[http://att.com/][AT&T]]. @@ -801,8 +800,8 @@ note.[fn:3] This paragraph should not be part of the note, as it is not indented. -[fn:1] Here is the footnote. It can go anywhere after the footnote reference. - It need not be placed at the end of the document. +[fn:1] Here is the footnote. It can go anywhere after the footnote reference. It + need not be placed at the end of the document. [fn:2] Here's the long note. This one contains multiple blocks. @@ -813,8 +812,8 @@ This paragraph should not be part of the note, as it is not indented. { } #+end_example - If you want, you can indent every line, but you can also be lazy and - just indent the first line of each block. + If you want, you can indent every line, but you can also be lazy and just + indent the first line of each block. [fn:3] This is /easier/ to type. Inline notes may contain [[http://google.com][links]] and =]= verbatim characters, as well as diff --git a/test/writer.plain b/test/writer.plain index b8767957f..b9425f9c0 100644 --- a/test/writer.plain +++ b/test/writer.plain @@ -5,7 +5,7 @@ July 17, 2006 This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Headers @@ -29,7 +29,7 @@ Level 2 with no blank line ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Paragraphs @@ -44,7 +44,7 @@ Here’s one with a bullet. * criminey. There should be a hard line break here. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Block Quotes @@ -73,7 +73,7 @@ This should not be a block quote: 2 > 1. And a following paragraph. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Code Blocks @@ -93,7 +93,7 @@ And: These should not be escaped: \$ \\ \> \[ \{ ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Lists @@ -250,7 +250,7 @@ M.A. 2007 B. Williams ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Definition Lists @@ -395,7 +395,7 @@ Code: Hr’s: ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Inline Markup @@ -421,10 +421,10 @@ Superscripts: a^(bc)d a^(hello) a^(hello there). Subscripts: H₂O, H₂₃O, H_(many of them)O. -These should not be superscripts or subscripts, because of the unescaped -spaces: a^b c^d, a~b c~d. +These should not be superscripts or subscripts, because of the unescaped spaces: +a^b c^d, a~b c~d. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Smart quotes, ellipses, dashes @@ -444,7 +444,7 @@ Dashes between numbers: 5–7, 255–66, 1987–1999. Ellipses…and…and…. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- LaTeX @@ -468,7 +468,7 @@ These shouldn’t be math: Here’s a LaTeX table: ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Special Characters @@ -522,7 +522,7 @@ Plus: + Minus: - ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Links @@ -594,7 +594,7 @@ Auto-links should not occur here: or here: ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Images @@ -604,7 +604,7 @@ From “Voyage dans la Lune” by Georges Melies (1902): Here is a movie [movie] icon. ------------------------------------------------------------------------------- +-------------------------------------------------------------------------------- Footnotes @@ -622,13 +622,13 @@ need not be placed at the end of the document. [2] Here’s the long note. This one contains multiple blocks. -Subsequent blocks are indented to show that they belong to the footnote (as -with list items). +Subsequent blocks are indented to show that they belong to the footnote (as with +list items). { } -If you want, you can indent every line, but you can also be lazy and just -indent the first line of each block. +If you want, you can indent every line, but you can also be lazy and just indent +the first line of each block. [3] This is easier to type. Inline notes may contain links and ] verbatim characters, as well as [bracketed text]. diff --git a/test/writer.rst b/test/writer.rst index 8d68f7ed5..0baaa670c 100644 --- a/test/writer.rst +++ b/test/writer.rst @@ -580,8 +580,8 @@ Superscripts: a\ :sup:`bc`\ d a\ :sup:`hello` a\ :sup:`hello there`. 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. +These should not be superscripts or subscripts, because of the unescaped spaces: +a^b c^d, a~b c~d. -------------- diff --git a/test/writer.tei b/test/writer.tei index 587a6fcca..1ded37956 100644 --- a/test/writer.tei +++ b/test/writer.tei @@ -54,9 +54,9 @@ Gruber’s markdown test suite.

Paragraphs

Here’s a regular paragraph.

-

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list - item. Because a hard-wrapped line in the middle of a paragraph looked like a - list item.

+

In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. + Because a hard-wrapped line in the middle of a paragraph looked like a list + item.

Here’s one with a bullet. * criminey.

There should be a hard line breakhere.

@@ -630,10 +630,10 @@ These should not be escaped: \$ \\ \> \[ \{

Hello, said the spider. Shelob is my name.

A, B, and C are letters.

-

Oak, elm, and beech are - names of trees. So is pine.

-

He said, I want to go. Were you alive in - the 70’s?

+

Oak, elm, and beech are names + of trees. So is pine.

+

He said, I want to go. Were you alive in the + 70’s?

Here is some quoted code and a quoted link.

@@ -821,8 +821,8 @@ or here: <http://example.com/>
Footnotes

Here is a footnote reference, -

Here is the footnote. It can go anywhere after the footnote reference. - It need not be placed at the end of the document.

+

Here is the footnote. It can go anywhere after the footnote reference. It + need not be placed at the end of the document.

and another.

Here’s the long note. This one contains multiple blocks.

Subsequent blocks are indented to show that they belong to the footnote @@ -830,8 +830,8 @@ or here: <http://example.com/> { <code> } -

If you want, you can indent every line, but you can also be lazy and - just indent the first line of each block.

+

If you want, you can indent every line, but you can also be lazy and just + indent the first line of each block.

This should not be a footnote reference, because it contains a space.[^my note] Here is an inline note. diff --git a/test/writer.texinfo b/test/writer.texinfo index 53a25d515..ca80f3245 100644 --- a/test/writer.texinfo +++ b/test/writer.texinfo @@ -732,8 +732,8 @@ Superscripts: a@sup{bc}d a@sup{@emph{hello}} a@sup{hello@ there}. 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. +These should not be superscripts or subscripts, because of the unescaped spaces: +a^b c^d, a~b c~d. @iftex @bigskip@hrule@bigskip @@ -1014,24 +1014,22 @@ Here is a movie @image{movie,,,movie,jpg} icon. @node Footnotes @chapter Footnotes @anchor{#footnotes} -Here is a footnote reference,@footnote{Here is the footnote. It can go -anywhere after the footnote reference. It need not be placed at the end of the -document.} and another.@footnote{Here's the long note. This one contains -multiple blocks. +Here is a footnote reference,@footnote{Here is the footnote. It can go anywhere +after the footnote reference. It need not be placed at the end of the document.} +and another.@footnote{Here's the long note. This one contains multiple blocks. -Subsequent blocks are indented to show that they belong to the footnote (as -with list items). +Subsequent blocks are indented to show that they belong to the footnote (as with +list items). @verbatim { } @end verbatim -If you want, you can indent every line, but you can also be lazy and just -indent the first line of each block.} This should @emph{not} be a footnote -reference, because it contains a space.[^my note] Here is an inline -note.@footnote{This is @emph{easier} to type. Inline notes may contain -@uref{http://google.com,links} and @code{]} verbatim characters, as well as -[bracketed text].} +If you want, you can indent every line, but you can also be lazy and just indent +the first line of each block.} This should @emph{not} be a footnote reference, +because it contains a space.[^my note] Here is an inline note.@footnote{This is +@emph{easier} to type. Inline notes may contain @uref{http://google.com,links} +and @code{]} verbatim characters, as well as [bracketed text].} @quotation Notes can go in quotes.@footnote{In quote.} -- cgit v1.2.3 From 83ebb85b640c9dffbc931a6aa84ecb0574c5693d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Sep 2021 16:42:33 -0700 Subject: Remove unused epub test file features.epub. --- test/epub/features.epub | Bin 66371 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test/epub/features.epub diff --git a/test/epub/features.epub b/test/epub/features.epub deleted file mode 100644 index 0d50380ac..000000000 Binary files a/test/epub/features.epub and /dev/null differ -- cgit v1.2.3 From a88b0098d6c92b7a37116a114a5c0b86fb888e91 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Sep 2021 16:49:58 -0700 Subject: Make test/epub/wasteland.epub valid. --- test/epub/wasteland.epub | Bin 35496 -> 34926 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/test/epub/wasteland.epub b/test/epub/wasteland.epub index c958c5fc2..f6a849b47 100644 Binary files a/test/epub/wasteland.epub and b/test/epub/wasteland.epub differ -- cgit v1.2.3 From c6fa0bc2711c9febc04e14b6006a69e224b6c920 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Sep 2021 17:03:25 -0700 Subject: Revert "Remove unused epub test file features.epub." This reverts commit 83ebb85b640c9dffbc931a6aa84ecb0574c5693d. --- test/epub/features.epub | Bin 0 -> 66371 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/epub/features.epub diff --git a/test/epub/features.epub b/test/epub/features.epub new file mode 100644 index 000000000..0d50380ac Binary files /dev/null and b/test/epub/features.epub differ -- cgit v1.2.3 From 3de0d5a9778e5be02d47e1de607c642948cb02e9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Sep 2021 18:54:42 -0700 Subject: test/epub: an excerpt from The Wasteland is enough! Saves over 100K. --- test/epub/wasteland.epub | Bin 34926 -> 24352 bytes test/epub/wasteland.native | 7940 +------------------------------------------- 2 files changed, 20 insertions(+), 7920 deletions(-) diff --git a/test/epub/wasteland.epub b/test/epub/wasteland.epub index f6a849b47..5eec66454 100644 Binary files a/test/epub/wasteland.epub and b/test/epub/wasteland.epub differ diff --git a/test/epub/wasteland.native b/test/epub/wasteland.native index fe4980e5d..17b2a875e 100644 --- a/test/epub/wasteland.native +++ b/test/epub/wasteland.native @@ -414,20 +414,7 @@ , Str "of" , Space , Str "man," - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "Line", Space, Str "20." ] - ( "#wasteland-content.xhtml#ln20", "" ) - , Space - , Str "Cf." - , Space - , Str "Ezekiel" - , Space - , Str "2:1." - ] - ] + , Str "" , Span ( "", [ "lnum" ], [] ) [ Str "20" ] @@ -501,20 +488,7 @@ , Str "no" , Space , Str "relief," - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "23." ] - ( "#wasteland-content.xhtml#ln23", "" ) - , Space - , Str "Cf." - , Space - , Str "Ecclesiastes" - , Space - , Str "12:5." - ] - ] + , Str "" ] ] , Div @@ -681,28 +655,7 @@ , Str "der" , Space , Str "Wind" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "31." ] - ( "#wasteland-content.xhtml#ln31", "" ) - , Space - , Str "V." - , Space - , Str "Tristan" - , Space - , Str "und" - , Space - , Str "Isolde," - , Space - , Str "i," - , Space - , Str "verses" - , Space - , Str "5-8." - ] - ] + , Str "" ] ] , Div @@ -882,22 +835,7 @@ , Str "Meer" ] , Str "." - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "42." ] - ( "#wasteland-content.xhtml#ln42", "" ) - , Space - , Str "Id." - , Space - , Str "iii," - , Space - , Str "verse" - , Space - , Str "24." - ] - ] + , Str "" ] ] ] @@ -971,246 +909,7 @@ , Str "said" , Space , Str "she," - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "46." ] - ( "#wasteland-content.xhtml#ln46", "" ) - , Space - , Str "I" - , Space - , Str "am" - , Space - , Str "not" - , Space - , Str "familiar" - , Space - , Str "with" - , Space - , Str "the" - , Space - , Str "exact" - , Space - , Str "constitution" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "Tarot" - , Space - , Str "pack" - , Space - , Str "of" - , SoftBreak - , Str "cards," - , Space - , Str "from" - , Space - , Str "which" - , Space - , Str "I" - , Space - , Str "have" - , Space - , Str "obviously" - , Space - , Str "departed" - , Space - , Str "to" - , Space - , Str "suit" - , Space - , Str "my" - , Space - , Str "own" - , Space - , Str "convenience." - , SoftBreak - , Str "The" - , Space - , Str "Hanged" - , Space - , Str "Man," - , Space - , Str "a" - , Space - , Str "member" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "traditional" - , Space - , Str "pack," - , Space - , Str "fits" - , Space - , Str "my" - , Space - , Str "purpose" - , Space - , Str "in" - , Space - , Str "two" - , SoftBreak - , Str "ways:" - , Space - , Str "because" - , Space - , Str "he" - , Space - , Str "is" - , Space - , Str "associated" - , Space - , Str "in" - , Space - , Str "my" - , Space - , Str "mind" - , Space - , Str "with" - , Space - , Str "the" - , Space - , Str "Hanged" - , Space - , Str "God" - , Space - , Str "of" - , Space - , Str "Frazer," - , SoftBreak - , Str "and" - , Space - , Str "because" - , Space - , Str "I" - , Space - , Str "associate" - , Space - , Str "him" - , Space - , Str "with" - , Space - , Str "the" - , Space - , Str "hooded" - , Space - , Str "figure" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "passage" - , Space - , Str "of" - , Space - , Str "the" - , SoftBreak - , Str "disciples" - , Space - , Str "to" - , Space - , Str "Emmaus" - , Space - , Str "in" - , Space - , Str "Part" - , Space - , Str "V." - , Space - , Str "The" - , Space - , Str "Phoenician" - , Space - , Str "Sailor" - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "Merchant" - , SoftBreak - , Str "appear" - , Space - , Str "later;" - , Space - , Str "also" - , Space - , Str "the" - , Space - , Str "\"crowds" - , Space - , Str "of" - , Space - , Str "people,\"" - , Space - , Str "and" - , Space - , Str "Death" - , Space - , Str "by" - , Space - , Str "Water" - , Space - , Str "is" - , SoftBreak - , Str "executed" - , Space - , Str "in" - , Space - , Str "Part" - , Space - , Str "IV." - , Space - , Str "The" - , Space - , Str "Man" - , Space - , Str "with" - , Space - , Str "Three" - , Space - , Str "Staves" - , Space - , Str "(an" - , Space - , Str "authentic" - , Space - , Str "member" - , Space - , Str "of" - , SoftBreak - , Str "the" - , Space - , Str "Tarot" - , Space - , Str "pack)" - , Space - , Str "I" - , Space - , Str "associate," - , Space - , Str "quite" - , Space - , Str "arbitrarily," - , Space - , Str "with" - , Space - , Str "the" - , Space - , Str "Fisher" - , Space - , Str "King" - , SoftBreak - , Str "himself." - ] - ] + , Str "" ] ] , Div @@ -1489,51 +1188,7 @@ [ Str "Unreal" , Space , Str "City," - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "60." ] - ( "#wasteland-content.xhtml#ln60", "" ) - , Space - , Str "Cf." - , Space - , Str "Baudelaire:" - ] - , BlockQuote - [ Para - [ Str "\"Fourmillante" - , Space - , Str "cite;," - , Space - , Str "cite;" - , Space - , Str "pleine" - , Space - , Str "de" - , Space - , Str "reves," - , LineBreak - , Str "Ou" - , Space - , Str "le" - , Space - , Str "spectre" - , Space - , Str "en" - , SoftBreak - , Str "plein" - , Space - , Str "jour" - , Space - , Str "raccroche" - , Space - , Str "le" - , Space - , Str "passant.\"" - ] - ] - ] + , Str "" , Span ( "", [ "lnum" ], [] ) [ Str "60" ] @@ -1599,55 +1254,7 @@ , Str "so" , Space , Str "many." - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "63." ] - ( "#wasteland-content.xhtml#ln63", "" ) - , Space - , Str "Cf." - , Space - , Str "Inferno," - , Space - , Str "iii." - , Space - , Str "55-7." - ] - , BlockQuote - [ Para - [ Str "\"si" - , Space - , Str "lunga" - , Space - , Str "tratta" - , LineBreak - , Str "di" - , Space - , Str "gente," - , Space - , Str "ch'io" - , Space - , Str "non" - , Space - , Str "avrei" - , Space - , Str "mai" - , Space - , Str "creduto" - , LineBreak - , Str "che" - , SoftBreak - , Str "morte" - , Space - , Str "tanta" - , Space - , Str "n'avesse" - , Space - , Str "disfatta.\"" - ] - ] - ] + , Str "" ] ] , Div @@ -1664,59 +1271,7 @@ , Str "were" , Space , Str "exhaled," - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "64." ] - ( "#wasteland-content.xhtml#ln64", "" ) - , Space - , Str "Cf." - , Space - , Str "Inferno," - , Space - , Str "iv." - , Space - , Str "25-7:" - ] - , BlockQuote - [ Para - [ Str "\"Quivi," - , Space - , Str "secondo" - , Space - , Str "che" - , Space - , Str "per" - , Space - , Str "ascoltahre," - , LineBreak - , Str "\"non" - , Space - , Str "avea" - , Space - , Str "pianto," - , Space - , Str "ma'" - , Space - , Str "che" - , Space - , Str "di" - , SoftBreak - , Str "sospiri," - , LineBreak - , Str "\"che" - , Space - , Str "l'aura" - , Space - , Str "eterna" - , Space - , Str "facevan" - , Space - , Str "tremare.\"" - ] - ] - ] + , Str "" ] ] , Div @@ -1805,28 +1360,7 @@ , Str "of" , Space , Str "nine." - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "68." ] - ( "#wasteland-content.xhtml#ln68", "" ) - , Space - , Str "A" - , Space - , Str "phenomenon" - , Space - , Str "which" - , Space - , Str "I" - , Space - , Str "have" - , Space - , Str "often" - , Space - , Str "noticed." - ] - ] + , Str "" ] ] , Div @@ -1973,30 +1507,7 @@ , Str "to" , Space , Str "men," - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "74." ] - ( "#wasteland-content.xhtml#ln74", "" ) - , Space - , Str "Cf." - , Space - , Str "the" - , Space - , Str "Dirge" - , Space - , Str "in" - , Space - , Str "Webster's" - , Space - , Str "White" - , Space - , Str "Devil" - , Space - , Str "." - ] - ] + , Str "" ] ] , Div @@ -2046,28 +1557,7 @@ ] , Space , Str "!\"" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "76." ] - ( "#wasteland-content.xhtml#ln76", "" ) - , Space - , Str "V." - , Space - , Str "Baudelaire," - , Space - , Str "Preface" - , Space - , Str "to" - , Space - , Str "Fleurs" - , Space - , Str "du" - , Space - , Str "Mal." - ] - ] + , Str "" ] ] ] @@ -2108,30 +1598,7 @@ , Str "burnished" , Space , Str "throne," - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "77." ] - ( "#wasteland-content.xhtml#ln77", "" ) - , Space - , Str "Cf." - , Space - , Str "Antony" - , Space - , Str "and" - , Space - , Str "Cleopatra," - , Space - , Str "II." - , Space - , Str "ii.," - , Space - , Str "l." - , Space - , Str "190." - ] - ] + , Str "" ] ] , Div @@ -2408,47 +1875,7 @@ , Str "the" , Space , Str "laquearia," - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "92." ] - ( "#wasteland-content.xhtml#ln92", "" ) - , Space - , Str "Laquearia." - , Space - , Str "V." - , Space - , Str "Aeneid," - , Space - , Str "I." - , Space - , Str "726:" - ] - , BlockQuote - [ Para - [ Str "dependent" - , Space - , Str "lychni" - , Space - , Str "laquearibus" - , Space - , Str "aureis" - , Space - , Str "incensi," - , Space - , Str "et" - , Space - , Str "noctem" - , SoftBreak - , Str "flammis" - , LineBreak - , Str "funalia" - , Space - , Str "vincunt." - ] - ] - ] + , Str "" ] ] , Div @@ -2561,30 +1988,7 @@ , Str "sylvan" , Space , Str "scene" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "98." ] - ( "#wasteland-content.xhtml#ln98", "" ) - , Space - , Str "Sylvan" - , Space - , Str "scene." - , Space - , Str "V." - , Space - , Str "Milton," - , Space - , Str "Paradise" - , Space - , Str "Lost," - , Space - , Str "iv." - , Space - , Str "140." - ] - ] + , Str "" ] ] , Div @@ -2605,24 +2009,7 @@ , Str "barbarous" , Space , Str "king" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "99." ] - ( "#wasteland-content.xhtml#ln99", "" ) - , Space - , Str "V." - , Space - , Str "Ovid," - , Space - , Str "Metamorphoses," - , Space - , Str "vi," - , Space - , Str "Philomela." - ] - ] + , Str "" ] ] , Div @@ -2641,24 +2028,7 @@ , Str "the" , Space , Str "nightingale" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "100." ] - ( "#wasteland-content.xhtml#ln100", "" ) - , Space - , Str "Cf." - , Space - , Str "Part" - , Space - , Str "III," - , Space - , Str "l." - , Space - , Str "204." - ] - ] + , Str "" , SoftBreak , Span ( "", [ "lnum" ], [] ) @@ -2952,24 +2322,7 @@ , Str "rats'" , Space , Str "alley" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "115." ] - ( "#wasteland-content.xhtml#ln115", "" ) - , Space - , Str "Cf." - , Space - , Str "Part" - , Space - , Str "III," - , Space - , Str "l." - , Space - , Str "195." - ] - ] + , Str "" ] ] , Div @@ -3018,35 +2371,7 @@ , Str "the" , Space , Str "door." - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "118." ] - ( "#wasteland-content.xhtml#ln118", "" ) - , Space - , Str "Cf." - , Space - , Str "Webster:" - ] - , BlockQuote - [ Para - [ Str "\"Is" - , Space - , Str "the" - , Space - , Str "wind" - , Space - , Str "in" - , Space - , Str "that" - , Space - , Str "door" - , Space - , Str "still?\"" - ] - ] - ] + , Str "" ] ] , Div @@ -3167,26 +2492,7 @@ , Str "your" , Space , Str "head?\"" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "126." ] - ( "#wasteland-content.xhtml#ln126", "" ) - , Space - , Str "Cf." - , Space - , Str "Part" - , Space - , Str "I," - , Space - , Str "l." - , Space - , Str "37," - , Space - , Str "48." - ] - ] + , Str "" ] ] , Div @@ -3390,34 +2696,7 @@ , Str "the" , Space , Str "door." - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "138." ] - ( "#wasteland-content.xhtml#ln138", "" ) - , Space - , Str "Cf." - , Space - , Str "the" - , Space - , Str "game" - , Space - , Str "of" - , Space - , Str "chess" - , Space - , Str "in" - , Space - , Str "Middleton's" - , Space - , Str "Women" - , Space - , Str "beware" - , Space - , Str "Women." - ] - ] + , Str "" ] ] ] @@ -4226,7184 +3505,5 @@ ] ] ] - , Div - ( "wasteland-content.xhtml#ch3", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "III." - , Space - , Str "THE" - , Space - , Str "FIRE" - , Space - , Str "SERMON" - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "river's" - , Space - , Str "tent" - , Space - , Str "is" - , Space - , Str "broken:" - , Space - , Str "the" - , Space - , Str "last" - , Space - , Str "fingers" - , Space - , Str "of" - , Space - , Str "leaf" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Clutch" - , Space - , Str "and" - , Space - , Str "sink" - , Space - , Str "into" - , Space - , Str "the" - , Space - , Str "wet" - , Space - , Str "bank." - , Space - , Str "The" - , Space - , Str "wind" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Crosses" - , Space - , Str "the" - , Space - , Str "brown" - , Space - , Str "land," - , Space - , Str "unheard." - , Space - , Str "The" - , Space - , Str "nymphs" - , Space - , Str "are" - , SoftBreak - , Str "departed." - ] - ] - , Div - ( "wasteland-content.xhtml#ln176", [], [] ) - [ Plain - [ Str "Sweet" - , Space - , Str "Thames," - , Space - , Str "run" - , Space - , Str "softly," - , Space - , Str "till" - , Space - , Str "I" - , Space - , Str "end" - , Space - , Str "my" - , Space - , Str "song." - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "176." ] - ( "#wasteland-content.xhtml#ln176", "" ) - , Space - , Str "V." - , Space - , Str "Spenser," - , Space - , Str "Prothalamion." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "river" - , Space - , Str "bears" - , Space - , Str "no" - , Space - , Str "empty" - , Space - , Str "bottles," - , Space - , Str "sandwich" - , Space - , Str "papers," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Silk" - , Space - , Str "handkerchiefs," - , Space - , Str "cardboard" - , Space - , Str "boxes," - , Space - , Str "cigarette" - , Space - , Str "ends" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Or" - , Space - , Str "other" - , Space - , Str "testimony" - , Space - , Str "of" - , Space - , Str "summer" - , Space - , Str "nights." - , Space - , Str "The" - , Space - , Str "nymphs" - , Space - , Str "are" - , SoftBreak - , Str "departed." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "their" - , Space - , Str "friends," - , Space - , Str "the" - , Space - , Str "loitering" - , Space - , Str "heirs" - , Space - , Str "of" - , Space - , Str "city" - , Space - , Str "directors;" - , Span - ( "", [ "lnum" ], [] ) - [ Str "180" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Departed," - , Space - , Str "have" - , Space - , Str "left" - , Space - , Str "no" - , Space - , Str "addresses." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "By" - , Space - , Str "the" - , Space - , Str "waters" - , Space - , Str "of" - , Space - , Str "Leman" - , Space - , Str "I" - , Space - , Str "sat" - , Space - , Str "down" - , Space - , Str "and" - , Space - , Str "wept" - , Space - , Str "." - , Space - , Str "." - , Space - , Str "." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Sweet" - , Space - , Str "Thames," - , Space - , Str "run" - , Space - , Str "softly" - , Space - , Str "till" - , Space - , Str "I" - , Space - , Str "end" - , Space - , Str "my" - , Space - , Str "song," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Sweet" - , Space - , Str "Thames," - , Space - , Str "run" - , Space - , Str "softly," - , Space - , Str "for" - , Space - , Str "I" - , Space - , Str "speak" - , Space - , Str "not" - , Space - , Str "loud" - , Space - , Str "or" - , Space - , Str "long." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "But" - , Space - , Str "at" - , Space - , Str "my" - , Space - , Str "back" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "cold" - , Space - , Str "blast" - , Space - , Str "I" - , Space - , Str "hear" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "rattle" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "bones," - , Space - , Str "and" - , Space - , Str "chuckle" - , Space - , Str "spread" - , Space - , Str "from" - , Space - , Str "ear" - , Space - , Str "to" - , SoftBreak - , Str "ear." - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "A" - , Space - , Str "rat" - , Space - , Str "crept" - , Space - , Str "softly" - , Space - , Str "through" - , Space - , Str "the" - , Space - , Str "vegetation" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Dragging" - , Space - , Str "its" - , Space - , Str "slimy" - , Space - , Str "belly" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "bank" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "While" - , Space - , Str "I" - , Space - , Str "was" - , Space - , Str "fishing" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "dull" - , Space - , Str "canal" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "On" - , Space - , Str "a" - , Space - , Str "winter" - , Space - , Str "evening" - , Space - , Str "round" - , Space - , Str "behind" - , Space - , Str "the" - , Space - , Str "gashouse" - , Span - ( "", [ "lnum" ], [] ) - [ Str "190" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Musing" - , Space - , Str "upon" - , Space - , Str "the" - , Space - , Str "king" - , Space - , Str "my" - , Space - , Str "brother's" - , Space - , Str "wreck" - ] - ] - , Div - ( "wasteland-content.xhtml#ln192", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "king" - , Space - , Str "my" - , Space - , Str "father's" - , Space - , Str "death" - , Space - , Str "before" - , Space - , Str "him." - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "192." ] - ( "#wasteland-content.xhtml#ln192", "" ) - , Space - , Str "Cf." - , Space - , Str "The" - , Space - , Str "Tempest," - , Space - , Str "I." - , Space - , Str "ii." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "White" - , Space - , Str "bodies" - , Space - , Str "naked" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "low" - , Space - , Str "damp" - , Space - , Str "ground" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "bones" - , Space - , Str "cast" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "little" - , Space - , Str "low" - , Space - , Str "dry" - , Space - , Str "garret," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Rattled" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "rat's" - , Space - , Str "foot" - , Space - , Str "only," - , Space - , Str "year" - , Space - , Str "to" - , Space - , Str "year." - ] - ] - , Div - ( "wasteland-content.xhtml#ln196", [], [] ) - [ Plain - [ Str "But" - , Space - , Str "at" - , Space - , Str "my" - , Space - , Str "back" - , Space - , Str "from" - , Space - , Str "time" - , Space - , Str "to" - , Space - , Str "time" - , Space - , Str "I" - , Space - , Str "hear" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "196." ] - ( "#wasteland-content.xhtml#ln196", "" ) - , Space - , Str "Cf." - , Space - , Str "Marvell," - , Space - , Str "To" - , Space - , Str "His" - , Space - , Str "Coy" - , Space - , Str "Mistress." - ] - ] - ] - ] - , Div - ( "wasteland-content.xhtml#ln197", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "sound" - , Space - , Str "of" - , Space - , Str "horns" - , Space - , Str "and" - , Space - , Str "motors," - , Space - , Str "which" - , Space - , Str "shall" - , Space - , Str "bring" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "197." ] - ( "#wasteland-content.xhtml#ln197", "" ) - , Space - , Str "Cf." - , Space - , Str "Day," - , Space - , Str "Parliament" - , Space - , Str "of" - , Space - , Str "Bees:" - ] - , BlockQuote - [ Div - ( "", [], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "\"When" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "sudden," - , Space - , Str "listening," - , Space - , Str "you" - , Space - , Str "shall" - , SoftBreak - , Str "hear," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"A" - , Space - , Str "noise" - , Space - , Str "of" - , Space - , Str "horns" - , Space - , Str "and" - , Space - , Str "hunting," - , Space - , Str "which" - , Space - , Str "shall" - , SoftBreak - , Str "bring" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"Actaeon" - , Space - , Str "to" - , Space - , Str "Diana" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "spring," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"Where" - , Space - , Str "all" - , Space - , Str "shall" - , Space - , Str "see" - , Space - , Str "her" - , Space - , Str "naked" - , Space - , Str "skin" - , Space - , Str "." - , Space - , Str "." - , Space - , Str ".\"" - ] - ] - ] - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Sweeney" - , Space - , Str "to" - , Space - , Str "Mrs." - , Space - , Str "Porter" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "spring." - ] - ] - , Div - ( "wasteland-content.xhtml#ln199", [], [] ) - [ Plain - [ Str "O" - , Space - , Str "the" - , Space - , Str "moon" - , Space - , Str "shone" - , Space - , Str "bright" - , Space - , Str "on" - , Space - , Str "Mrs." - , Space - , Str "Porter" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "199." ] - ( "#wasteland-content.xhtml#ln199", "" ) - , Space - , Str "I" - , Space - , Str "do" - , Space - , Str "not" - , Space - , Str "know" - , Space - , Str "the" - , Space - , Str "origin" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "ballad" - , Space - , Str "from" - , Space - , Str "which" - , Space - , Str "these" - , Space - , Str "lines" - , Space - , Str "are" - , SoftBreak - , Str "taken:" - , Space - , Str "it" - , Space - , Str "was" - , Space - , Str "reported" - , Space - , Str "to" - , Space - , Str "me" - , Space - , Str "from" - , Space - , Str "Sydney," - , Space - , Str "Australia." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "on" - , Space - , Str "her" - , Space - , Str "daughter" - , Span - ( "", [ "lnum" ], [] ) - [ Str "200" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "They" - , Space - , Str "wash" - , Space - , Str "their" - , Space - , Str "feet" - , Space - , Str "in" - , Space - , Str "soda" - , Space - , Str "water" - ] - ] - , Div - ( "wasteland-content.xhtml#ln202", [], [ ( "lang", "fr" ) ] ) - [ Plain - [ Emph - [ Str "Et" - , Space - , Str "O" - , Space - , Str "ces" - , Space - , Str "voix" - , Space - , Str "d'enfants," - , Space - , Str "chantant" - , Space - , Str "dans" - , Space - , Str "la" - , Space - , Str "coupole" - ] - , Str "!" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "202." ] - ( "#wasteland-content.xhtml#ln202", "" ) - , Space - , Str "V." - , Space - , Str "Verlaine," - , Space - , Str "Parsifal." - ] - ] - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain [ Str "Twit", Space, Str "twit", Space, Str "twit" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Jug" - , Space - , Str "jug" - , Space - , Str "jug" - , Space - , Str "jug" - , Space - , Str "jug" - , Space - , Str "jug" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "So", Space, Str "rudely", Space, Str "forc'd." ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "Tereu" ] ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain [ Str "Unreal", Space, Str "City" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Under" - , Space - , Str "the" - , Space - , Str "brown" - , Space - , Str "fog" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "winter" - , Space - , Str "noon" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Mr." - , Space - , Str "Eugenides," - , Space - , Str "the" - , Space - , Str "Smyrna" - , Space - , Str "merchant" - ] - ] - , Div - ( "wasteland-content.xhtml#ln210", [], [] ) - [ Plain - [ Str "Unshaven," - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "pocket" - , Space - , Str "full" - , Space - , Str "of" - , Space - , Str "currants" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "210." ] - ( "#wasteland-content.xhtml#ln210", "" ) - , Space - , Str "The" - , Space - , Str "currants" - , Space - , Str "were" - , Space - , Str "quoted" - , Space - , Str "at" - , Space - , Str "a" - , Space - , Str "price" - , Space - , Str "\"cost" - , Space - , Str "insurance" - , Space - , Str "and" - , Space - , Str "freight" - , Space - , Str "to" - , SoftBreak - , Str "London\";" - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "Bill" - , Space - , Str "of" - , Space - , Str "Lading" - , Space - , Str "etc." - , Space - , Str "were" - , Space - , Str "to" - , Space - , Str "be" - , Space - , Str "handed" - , Space - , Str "to" - , Space - , Str "the" - , Space - , Str "buyer" - , Space - , Str "upon" - , SoftBreak - , Str "payment" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "sight" - , Space - , Str "draft." - ] - ] - , SoftBreak - , Span - ( "", [ "lnum" ], [] ) - [ Str "210" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "C.i.f." - , Space - , Str "London:" - , Space - , Str "documents" - , Space - , Str "at" - , Space - , Str "sight," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Asked" - , Space - , Str "me" - , Space - , Str "in" - , Space - , Str "demotic" - , Space - , Str "French" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "To" - , Space - , Str "luncheon" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "Cannon" - , Space - , Str "Street" - , Space - , Str "Hotel" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Followed" - , Space - , Str "by" - , Space - , Str "a" - , Space - , Str "weekend" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "Metropole." - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "At" - , Space - , Str "the" - , Space - , Str "violet" - , Space - , Str "hour," - , Space - , Str "when" - , Space - , Str "the" - , Space - , Str "eyes" - , Space - , Str "and" - , Space - , Str "back" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Turn" - , Space - , Str "upward" - , Space - , Str "from" - , Space - , Str "the" - , Space - , Str "desk," - , Space - , Str "when" - , Space - , Str "the" - , Space - , Str "human" - , Space - , Str "engine" - , Space - , Str "waits" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Like" - , Space - , Str "a" - , Space - , Str "taxi" - , Space - , Str "throbbing" - , Space - , Str "waiting," - ] - ] - , Div - ( "wasteland-content.xhtml#ln218", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "Tiresias," - , Space - , Str "though" - , Space - , Str "blind," - , Space - , Str "throbbing" - , Space - , Str "between" - , Space - , Str "two" - , Space - , Str "lives," - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "218." ] - ( "#wasteland-content.xhtml#ln218", "" ) - , Space - , Str "Tiresias," - , Space - , Str "although" - , Space - , Str "a" - , Space - , Str "mere" - , Space - , Str "spectator" - , Space - , Str "and" - , Space - , Str "not" - , Space - , Str "indeed" - , Space - , Str "a" - , Space - , Str "\"character,\"" - , Space - , Str "is" - , SoftBreak - , Str "yet" - , Space - , Str "the" - , Space - , Str "most" - , Space - , Str "important" - , Space - , Str "personage" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "poem," - , Space - , Str "uniting" - , Space - , Str "all" - , Space - , Str "the" - , Space - , Str "rest." - , Space - , Str "Just" - , SoftBreak - , Str "as" - , Space - , Str "the" - , Space - , Str "one-eyed" - , Space - , Str "merchant," - , Space - , Str "seller" - , Space - , Str "of" - , Space - , Str "currants," - , Space - , Str "melts" - , Space - , Str "into" - , Space - , Str "the" - , Space - , Str "Phoenician" - , SoftBreak - , Str "Sailor," - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "latter" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "wholly" - , Space - , Str "distinct" - , Space - , Str "from" - , Space - , Str "Ferdinand" - , Space - , Str "Prince" - , Space - , Str "of" - , SoftBreak - , Str "Naples," - , Space - , Str "so" - , Space - , Str "all" - , Space - , Str "the" - , Space - , Str "women" - , Space - , Str "are" - , Space - , Str "one" - , Space - , Str "woman," - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "two" - , Space - , Str "sexes" - , Space - , Str "meet" - , Space - , Str "in" - , SoftBreak - , Str "Tiresias." - , Space - , Str "What" - , Space - , Str "Tiresias" - , Space - , Str "sees," - , Space - , Str "in" - , Space - , Str "fact," - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "substance" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "poem." - , Space - , Str "The" - , SoftBreak - , Str "whole" - , Space - , Str "passage" - , Space - , Str "from" - , Space - , Str "Ovid" - , Space - , Str "is" - , Space - , Str "of" - , Space - , Str "great" - , Space - , Str "anthropological" - , Space - , Str "interest:" - ] - , BlockQuote - [ Para - [ Str "'." - , Space - , Str "." - , Space - , Str "." - , Space - , Str "Cum" - , Space - , Str "Iunone" - , Space - , Str "iocos" - , Space - , Str "et" - , Space - , Str "maior" - , Space - , Str "vestra" - , Space - , Str "profecto" - , Space - , Str "est" - , LineBreak - , Str "Quam," - , Space - , Str "quae" - , SoftBreak - , Str "contingit" - , Space - , Str "maribus,'" - , Space - , Str "dixisse," - , Space - , Str "'voluptas.'" - , LineBreak - , Str "Illa" - , Space - , Str "negat;" - , Space - , Str "placuit" - , SoftBreak - , Str "quae" - , Space - , Str "sit" - , Space - , Str "sententia" - , Space - , Str "docti" - , LineBreak - , Str "Quaerere" - , Space - , Str "Tiresiae:" - , Space - , Str "venus" - , Space - , Str "huic" - , Space - , Str "erat" - , SoftBreak - , Str "utraque" - , Space - , Str "nota." - , LineBreak - , Str "Nam" - , Space - , Str "duo" - , Space - , Str "magnorum" - , Space - , Str "viridi" - , Space - , Str "coeuntia" - , Space - , Str "silva" - , LineBreak - , Str "Corpora" - , Space - , Str "serpentum" - , Space - , Str "baculi" - , Space - , Str "violaverat" - , Space - , Str "ictu" - , LineBreak - , Str "Deque" - , Space - , Str "viro" - , Space - , Str "factus," - , SoftBreak - , Str "mirabile," - , Space - , Str "femina" - , Space - , Str "septem" - , LineBreak - , Str "Egerat" - , Space - , Str "autumnos;" - , Space - , Str "octavo" - , Space - , Str "rursus" - , SoftBreak - , Str "eosdem" - , LineBreak - , Str "Vidit" - , Space - , Str "et" - , Space - , Str "'est" - , Space - , Str "vestrae" - , Space - , Str "si" - , Space - , Str "tanta" - , Space - , Str "potentia" - , Space - , Str "plagae,'" - , LineBreak - , Str "Dixit" - , Space - , Str "'ut" - , Space - , Str "auctoris" - , Space - , Str "sortem" - , Space - , Str "in" - , Space - , Str "contraria" - , Space - , Str "mutet," - , LineBreak - , Str "Nunc" - , Space - , Str "quoque" - , Space - , Str "vos" - , SoftBreak - , Str "feriam!'" - , Space - , Str "percussis" - , Space - , Str "anguibus" - , Space - , Str "isdem" - , LineBreak - , Str "Forma" - , Space - , Str "prior" - , Space - , Str "rediit" - , SoftBreak - , Str "genetivaque" - , Space - , Str "venit" - , Space - , Str "imago." - , LineBreak - , Str "Arbiter" - , Space - , Str "hic" - , Space - , Str "igitur" - , Space - , Str "sumptus" - , Space - , Str "de" - , Space - , Str "lite" - , SoftBreak - , Str "iocosa" - , LineBreak - , Str "Dicta" - , Space - , Str "Iovis" - , Space - , Str "firmat;" - , Space - , Str "gravius" - , Space - , Str "Saturnia" - , Space - , Str "iusto" - , LineBreak - , Str "Nec" - , SoftBreak - , Str "pro" - , Space - , Str "materia" - , Space - , Str "fertur" - , Space - , Str "doluisse" - , Space - , Str "suique" - , LineBreak - , Str "Iudicis" - , Space - , Str "aeterna" - , Space - , Str "damnavit" - , SoftBreak - , Str "lumina" - , Space - , Str "nocte," - , LineBreak - , Str "At" - , Space - , Str "pater" - , Space - , Str "omnipotens" - , Space - , Str "(neque" - , Space - , Str "enim" - , Space - , Str "licet" - , Space - , Str "inrita" - , SoftBreak - , Str "cuiquam" - , LineBreak - , Str "Facta" - , Space - , Str "dei" - , Space - , Str "fecisse" - , Space - , Str "deo)" - , Space - , Str "pro" - , Space - , Str "lumine" - , Space - , Str "adempto" - , LineBreak - , Str "Scire" - , SoftBreak - , Str "futura" - , Space - , Str "dedit" - , Space - , Str "poenamque" - , Space - , Str "levavit" - , Space - , Str "honore." - , LineBreak - ] - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Old" - , Space - , Str "man" - , Space - , Str "with" - , Space - , Str "wrinkled" - , Space - , Str "female" - , Space - , Str "breasts," - , Space - , Str "can" - , Space - , Str "see" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "At" - , Space - , Str "the" - , Space - , Str "violet" - , Space - , Str "hour," - , Space - , Str "the" - , Space - , Str "evening" - , Space - , Str "hour" - , Space - , Str "that" - , Space - , Str "strives" - , Span - ( "", [ "lnum" ], [] ) - [ Str "220" ] - ] - ] - , Div - ( "wasteland-content.xhtml#ln221", [], [] ) - [ Plain - [ Str "Homeward," - , Space - , Str "and" - , Space - , Str "brings" - , Space - , Str "the" - , Space - , Str "sailor" - , Space - , Str "home" - , Space - , Str "from" - , Space - , Str "sea," - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "221." ] - ( "#wasteland-content.xhtml#ln221", "" ) - , Space - , Str "This" - , Space - , Str "may" - , Space - , Str "not" - , Space - , Str "appear" - , Space - , Str "as" - , Space - , Str "exact" - , Space - , Str "as" - , Space - , Str "Sappho's" - , Space - , Str "lines," - , Space - , Str "but" - , Space - , Str "I" - , Space - , Str "had" - , Space - , Str "in" - , Space - , Str "mind" - , SoftBreak - , Str "the" - , Space - , Str "\"longshore\"" - , Space - , Str "or" - , Space - , Str "\"dory\"" - , Space - , Str "fisherman," - , Space - , Str "who" - , Space - , Str "returns" - , Space - , Str "at" - , Space - , Str "nightfall." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "typist" - , Space - , Str "home" - , Space - , Str "at" - , Space - , Str "teatime," - , Space - , Str "clears" - , Space - , Str "her" - , Space - , Str "breakfast," - , Space - , Str "lights" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Her" - , Space - , Str "stove," - , Space - , Str "and" - , Space - , Str "lays" - , Space - , Str "out" - , Space - , Str "food" - , Space - , Str "in" - , Space - , Str "tins." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Out" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "window" - , Space - , Str "perilously" - , Space - , Str "spread" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Her" - , Space - , Str "drying" - , Space - , Str "combinations" - , Space - , Str "touched" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "sun's" - , Space - , Str "last" - , Space - , Str "rays," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "On" - , Space - , Str "the" - , Space - , Str "divan" - , Space - , Str "are" - , Space - , Str "piled" - , Space - , Str "(at" - , Space - , Str "night" - , Space - , Str "her" - , Space - , Str "bed)" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Stockings," - , Space - , Str "slippers," - , Space - , Str "camisoles," - , Space - , Str "and" - , Space - , Str "stays." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "Tiresias," - , Space - , Str "old" - , Space - , Str "man" - , Space - , Str "with" - , Space - , Str "wrinkled" - , Space - , Str "dugs" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Perceived" - , Space - , Str "the" - , Space - , Str "scene," - , Space - , Str "and" - , Space - , Str "foretold" - , Space - , Str "the" - , Space - , Str "rest" - , Space - , Str "-" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "too" - , Space - , Str "awaited" - , Space - , Str "the" - , Space - , Str "expected" - , Space - , Str "guest." - , Span - ( "", [ "lnum" ], [] ) - [ Str "230" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "He," - , Space - , Str "the" - , Space - , Str "young" - , Space - , Str "man" - , Space - , Str "carbuncular," - , Space - , Str "arrives," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "A" - , Space - , Str "small" - , Space - , Str "house" - , Space - , Str "agent's" - , Space - , Str "clerk," - , Space - , Str "with" - , Space - , Str "one" - , Space - , Str "bold" - , Space - , Str "stare," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "One" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "low" - , Space - , Str "on" - , Space - , Str "whom" - , Space - , Str "assurance" - , Space - , Str "sits" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "As" - , Space - , Str "a" - , Space - , Str "silk" - , Space - , Str "hat" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Str "Bradford" - , Space - , Str "millionaire." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "time" - , Space - , Str "is" - , Space - , Str "now" - , Space - , Str "propitious," - , Space - , Str "as" - , Space - , Str "he" - , Space - , Str "guesses," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "meal" - , Space - , Str "is" - , Space - , Str "ended," - , Space - , Str "she" - , Space - , Str "is" - , Space - , Str "bored" - , Space - , Str "and" - , Space - , Str "tired," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Endeavours" - , Space - , Str "to" - , Space - , Str "engage" - , Space - , Str "her" - , Space - , Str "in" - , Space - , Str "caresses" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Which" - , Space - , Str "still" - , Space - , Str "are" - , Space - , Str "unreproved," - , Space - , Str "if" - , Space - , Str "undesired." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Flushed" - , Space - , Str "and" - , Space - , Str "decided," - , Space - , Str "he" - , Space - , Str "assaults" - , Space - , Str "at" - , Space - , Str "once;" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Exploring" - , Space - , Str "hands" - , Space - , Str "encounter" - , Space - , Str "no" - , Space - , Str "defence;" - , Span - ( "", [ "lnum" ], [] ) - [ Str "240" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "His" - , Space - , Str "vanity" - , Space - , Str "requires" - , Space - , Str "no" - , Space - , Str "response," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "makes" - , Space - , Str "a" - , Space - , Str "welcome" - , Space - , Str "of" - , Space - , Str "indifference." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "(And" - , Space - , Str "I" - , Space - , Str "Tiresias" - , Space - , Str "have" - , Space - , Str "foresuffered" - , Space - , Str "all" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Enacted" - , Space - , Str "on" - , Space - , Str "this" - , Space - , Str "same" - , Space - , Str "divan" - , Space - , Str "or" - , Space - , Str "bed;" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "who" - , Space - , Str "have" - , Space - , Str "sat" - , Space - , Str "by" - , Space - , Str "Thebes" - , Space - , Str "below" - , Space - , Str "the" - , Space - , Str "wall" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "walked" - , Space - , Str "among" - , Space - , Str "the" - , Space - , Str "lowest" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "dead.)" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Bestows" - , Space - , Str "one" - , Space - , Str "final" - , Space - , Str "patronising" - , Space - , Str "kiss," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "gropes" - , Space - , Str "his" - , Space - , Str "way," - , Space - , Str "finding" - , Space - , Str "the" - , Space - , Str "stairs" - , Space - , Str "unlit" - , Space - , Str "." - , Space - , Str "." - , Space - , Str "." - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "She" - , Space - , Str "turns" - , Space - , Str "and" - , Space - , Str "looks" - , Space - , Str "a" - , Space - , Str "moment" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "glass," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Hardly" - , Space - , Str "aware" - , Space - , Str "of" - , Space - , Str "her" - , Space - , Str "departed" - , Space - , Str "lover;" - , Span - ( "", [ "lnum" ], [] ) - [ Str "250" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Her" - , Space - , Str "brain" - , Space - , Str "allows" - , Space - , Str "one" - , Space - , Str "half-formed" - , Space - , Str "thought" - , Space - , Str "to" - , Space - , Str "pass:" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"Well" - , Space - , Str "now" - , Space - , Str "that's" - , Space - , Str "done:" - , Space - , Str "and" - , Space - , Str "I'm" - , Space - , Str "glad" - , Space - , Str "it's" - , Space - , Str "over.\"" - ] - ] - , Div - ( "wasteland-content.xhtml#ln253", [], [] ) - [ Plain - [ Str "When" - , Space - , Str "lovely" - , Space - , Str "woman" - , Space - , Str "stoops" - , Space - , Str "to" - , Space - , Str "folly" - , Space - , Str "and" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "253." ] - ( "#wasteland-content.xhtml#ln253", "" ) - , Space - , Str "V." - , Space - , Str "Goldsmith," - , Space - , Str "the" - , Space - , Str "song" - , Space - , Str "in" - , Space - , Str "The" - , Space - , Str "Vicar" - , Space - , Str "of" - , Space - , Str "Wakefield." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Paces" - , Space - , Str "about" - , Space - , Str "her" - , Space - , Str "room" - , Space - , Str "again," - , Space - , Str "alone," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "She" - , Space - , Str "smoothes" - , Space - , Str "her" - , Space - , Str "hair" - , Space - , Str "with" - , Space - , Str "automatic" - , Space - , Str "hand," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "puts" - , Space - , Str "a" - , Space - , Str "record" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "gramophone." - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "wasteland-content.xhtml#ln257", [], [] ) - [ Plain - [ Str "\"This" - , Space - , Str "music" - , Space - , Str "crept" - , Space - , Str "by" - , Space - , Str "me" - , Space - , Str "upon" - , Space - , Str "the" - , Space - , Str "waters\"" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "257." ] - ( "#wasteland-content.xhtml#ln257", "" ) - , Space - , Str "V." - , Space - , Str "The" - , Space - , Str "Tempest," - , Space - , Str "as" - , Space - , Str "above." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "along" - , Space - , Str "the" - , Space - , Str "Strand," - , Space - , Str "up" - , Space - , Str "Queen" - , Space - , Str "Victoria" - , Space - , Str "Street." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "O" - , Space - , Str "City" - , Space - , Str "city," - , Space - , Str "I" - , Space - , Str "can" - , Space - , Str "sometimes" - , Space - , Str "hear" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Beside" - , Space - , Str "a" - , Space - , Str "public" - , Space - , Str "bar" - , Space - , Str "in" - , Space - , Str "Lower" - , Space - , Str "Thames" - , Space - , Str "Street," - , Span - ( "", [ "lnum" ], [] ) - [ Str "260" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "pleasant" - , Space - , Str "whining" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "mandoline" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "a" - , Space - , Str "clatter" - , Space - , Str "and" - , Space - , Str "a" - , Space - , Str "chatter" - , Space - , Str "from" - , Space - , Str "within" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Where" - , Space - , Str "fishmen" - , Space - , Str "lounge" - , Space - , Str "at" - , Space - , Str "noon:" - , Space - , Str "where" - , Space - , Str "the" - , Space - , Str "walls" - ] - ] - , Div - ( "wasteland-content.xhtml#ln264", [], [] ) - [ Plain - [ Str "Of" - , Space - , Str "Magnus" - , Space - , Str "Martyr" - , Space - , Str "hold" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "264." ] - ( "#wasteland-content.xhtml#ln264", "" ) - , Space - , Str "The" - , Space - , Str "interior" - , Space - , Str "of" - , Space - , Str "St." - , Space - , Str "Magnus" - , Space - , Str "Martyr" - , Space - , Str "is" - , Space - , Str "to" - , Space - , Str "my" - , Space - , Str "mind" - , Space - , Str "one" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "finest" - , SoftBreak - , Str "among" - , Space - , Str "Wren's" - , Space - , Str "interiors." - , Space - , Str "See" - , Space - , Str "The" - , Space - , Str "Proposed" - , Space - , Str "Demolition" - , Space - , Str "of" - , Space - , Str "Nineteen" - , Space - , Str "City" - , SoftBreak - , Str "Churches" - , Space - , Str "(P." - , Space - , Str "S." - , Space - , Str "King" - , Space - , Str "&" - , Space - , Str "Son," - , Space - , Str "Ltd.)." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Inexplicable" - , Space - , Str "splendour" - , Space - , Str "of" - , Space - , Str "Ionian" - , Space - , Str "white" - , Space - , Str "and" - , Space - , Str "gold." - ] - ] - ] - , Div - ( "", [ "linegroup", "indent" ], [] ) - [ Div - ( "wasteland-content.xhtml#ln266", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "river" - , Space - , Str "sweats" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "266." ] - ( "#wasteland-content.xhtml#ln266", "" ) - , Space - , Str "The" - , Space - , Str "Song" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "(three)" - , Space - , Str "Thames-daughters" - , Space - , Str "begins" - , Space - , Str "here." - , Space - , Str "From" - , Space - , Str "line" - , Space - , Str "292" - , SoftBreak - , Str "to" - , Space - , Str "306" - , Space - , Str "inclusive" - , Space - , Str "they" - , Space - , Str "speak" - , Space - , Str "in" - , Space - , Str "turn." - , Space - , Str "V." - , Space - , Str "Gutterdsammerung," - , Space - , Str "III." - , Space - , Str "i:" - , Space - , Str "the" - , SoftBreak - , Str "Rhine-daughters." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "Oil", Space, Str "and", Space, Str "tar" ] ] - , Div - ( "", [], [] ) - [ Plain [ Str "The", Space, Str "barges", Space, Str "drift" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "With" - , Space - , Str "the" - , Space - , Str "turning" - , Space - , Str "tide" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Red" - , Space - , Str "sails" - , Span - ( "", [ "lnum" ], [] ) - [ Str "270" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "Wide" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "To" - , Space - , Str "leeward," - , Space - , Str "swing" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "heavy" - , Space - , Str "spar." - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "The", Space, Str "barges", Space, Str "wash" ] ] - , Div - ( "", [], [] ) - [ Plain [ Str "Drifting", Space, Str "logs" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Down", Space, Str "Greenwich", Space, Str "reach" ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Past" - , Space - , Str "the" - , Space - , Str "Isle" - , Space - , Str "of" - , Space - , Str "Dogs." - ] - ] - , Div - ( "", [ "indent" ], [] ) - [ Plain [ Str "Weialala", Space, Str "leia" ] ] - , Div - ( "", [ "indent" ], [] ) - [ Plain [ Str "Wallala", Space, Str "leialala" ] ] - ] - , Div - ( "", [ "linegroup", "indent" ], [] ) - [ Div - ( "wasteland-content.xhtml#ln279", [], [] ) - [ Plain - [ Str "Elizabeth" - , Space - , Str "and" - , Space - , Str "Leicester" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "279." ] - ( "#wasteland-content.xhtml#ln279", "" ) - , Space - , Str "V." - , Space - , Str "Froude," - , Space - , Str "Elizabeth," - , Space - , Str "Vol." - , Space - , Str "I," - , Space - , Str "ch." - , Space - , Str "iv," - , Space - , Str "letter" - , Space - , Str "of" - , Space - , Str "De" - , Space - , Str "Quadra" - , Space - , Str "to" - , Space - , Str "Philip" - , SoftBreak - , Str "of" - , Space - , Str "Spain:" - ] - , BlockQuote - [ Div - ( "", [], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "\"In" - , Space - , Str "the" - , Space - , Str "afternoon" - , Space - , Str "we" - , Space - , Str "were" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "barge," - , Space - , Str "watching" - , Space - , Str "the" - , SoftBreak - , Str "games" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "river." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "(The" - , Space - , Str "queen)" - , Space - , Str "was" - , Space - , Str "alone" - , Space - , Str "with" - , Space - , Str "Lord" - , Space - , Str "Robert" - , Space - , Str "and" - , Space - , Str "myself" - , SoftBreak - , Str "on" - , Space - , Str "the" - , Space - , Str "poop," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "when" - , Space - , Str "they" - , Space - , Str "began" - , Space - , Str "to" - , Space - , Str "talk" - , Space - , Str "nonsense," - , Space - , Str "and" - , Space - , Str "went" - , Space - , Str "so" - , Space - , Str "far" - , SoftBreak - , Str "that" - , Space - , Str "Lord" - , Space - , Str "Robert" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "at" - , Space - , Str "last" - , Space - , Str "said," - , Space - , Str "as" - , Space - , Str "I" - , Space - , Str "was" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "spot" - , Space - , Str "there" - , Space - , Str "was" - , Space - , Str "no" - , SoftBreak - , Str "reason" - , Space - , Str "why" - , Space - , Str "they" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "married" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "queen" - , Space - , Str "pleased.\"" - ] - ] - ] - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Beating" - , Space - , Str "oars" - , Span - ( "", [ "lnum" ], [] ) - [ Str "280" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "stern" - , Space - , Str "was" - , Space - , Str "formed" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "A", Space, Str "gilded", Space, Str "shell" ] ] - , Div - ( "", [], [] ) - [ Plain [ Str "Red", Space, Str "and", Space, Str "gold" ] ] - , Div - ( "", [], [] ) - [ Plain [ Str "The", Space, Str "brisk", Space, Str "swell" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Rippled", Space, Str "both", Space, Str "shores" ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "Southwest", Space, Str "wind" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Carried", Space, Str "down", Space, Str "stream" ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "peal" - , Space - , Str "of" - , Space - , Str "bells" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "White", Space, Str "towers" ] ] - , Div - ( "", [ "indent" ], [] ) - [ Plain - [ Str "Weialala" - , Space - , Str "leia" - , Span - ( "", [ "lnum" ], [] ) - [ Str "290" ] - ] - ] - , Div - ( "", [ "indent" ], [] ) - [ Plain [ Str "Wallala", Space, Str "leialala" ] ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "\"Trams" - , Space - , Str "and" - , Space - , Str "dusty" - , Space - , Str "trees." - ] - ] - , Div - ( "wasteland-content.xhtml#ln293", [], [] ) - [ Plain - [ Str "Highbury" - , Space - , Str "bore" - , Space - , Str "me." - , Space - , Str "Richmond" - , Space - , Str "and" - , Space - , Str "Kew" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "293." ] - ( "#wasteland-content.xhtml#ln293", "" ) - , Space - , Str "Cf." - , Space - , Str "Purgatorio," - , Space - , Str "v." - , Space - , Str "133:" - ] - , BlockQuote - [ Para - [ Str "\"Ricorditi" - , Space - , Str "di" - , Space - , Str "me," - , Space - , Str "che" - , Space - , Str "son" - , Space - , Str "la" - , Space - , Str "Pia;" - , LineBreak - , Str "Siena" - , Space - , Str "mi" - , Space - , Str "fe'," - , Space - , Str "disfecemi" - , SoftBreak - , Str "Maremma.\"" - ] - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Undid" - , Space - , Str "me." - , Space - , Str "By" - , Space - , Str "Richmond" - , Space - , Str "I" - , Space - , Str "raised" - , Space - , Str "my" - , Space - , Str "knees" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Supine" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "floor" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "narrow" - , Space - , Str "canoe.\"" - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "\"My" - , Space - , Str "feet" - , Space - , Str "are" - , Space - , Str "at" - , Space - , Str "Moorgate," - , Space - , Str "and" - , Space - , Str "my" - , Space - , Str "heart" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Under" - , Space - , Str "my" - , Space - , Str "feet." - , Space - , Str "After" - , Space - , Str "the" - , Space - , Str "event" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "He" - , Space - , Str "wept." - , Space - , Str "He" - , Space - , Str "promised" - , Space - , Str "'a" - , Space - , Str "new" - , Space - , Str "start'." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "made" - , Space - , Str "no" - , Space - , Str "comment." - , Space - , Str "What" - , Space - , Str "should" - , Space - , Str "I" - , Space - , Str "resent?\"" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"On" - , Space - , Str "Margate" - , Space - , Str "Sands." - , Span - ( "", [ "lnum" ], [] ) - [ Str "300" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "I", Space, Str "can", Space, Str "connect" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Nothing", Space, Str "with", Space, Str "nothing." ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "broken" - , Space - , Str "fingernails" - , Space - , Str "of" - , Space - , Str "dirty" - , Space - , Str "hands." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "My" - , Space - , Str "people" - , Space - , Str "humble" - , Space - , Str "people" - , Space - , Str "who" - , Space - , Str "expect" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "Nothing.\"" ] ] - , Div - ( "", [ "indent" ], [] ) - [ Plain [ Str "la", Space, Str "la" ] ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "wasteland-content.xhtml#ln307", [], [] ) - [ Plain - [ Str "To" - , Space - , Str "Carthage" - , Space - , Str "then" - , Space - , Str "I" - , Space - , Str "came" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "307." ] - ( "#wasteland-content.xhtml#ln307", "" ) - , Space - , Str "V." - , Space - , Str "St." - , Space - , Str "Augustine's" - , Space - , Str "Confessions:" - , Space - , Str "\"to" - , Space - , Str "Carthage" - , Space - , Str "then" - , Space - , Str "I" - , Space - , Str "came," - , Space - , Str "where" - , Space - , Str "a" - , SoftBreak - , Str "cauldron" - , Space - , Str "of" - , Space - , Str "unholy" - , Space - , Str "loves" - , Space - , Str "sang" - , Space - , Str "all" - , Space - , Str "about" - , Space - , Str "mine" - , Space - , Str "ears.\"" - ] - ] - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "wasteland-content.xhtml#ln308", [], [] ) - [ Plain - [ Str "Burning" - , Space - , Str "burning" - , Space - , Str "burning" - , Space - , Str "burning" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "308." ] - ( "#wasteland-content.xhtml#ln308", "" ) - , Space - , Str "The" - , Space - , Str "complete" - , Space - , Str "text" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "Buddha's" - , Space - , Str "Fire" - , Space - , Str "Sermon" - , Space - , Str "(which" - , Space - , Str "corresponds" - , Space - , Str "in" - , SoftBreak - , Str "importance" - , Space - , Str "to" - , Space - , Str "the" - , Space - , Str "Sermon" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "Mount)" - , Space - , Str "from" - , Space - , Str "which" - , Space - , Str "these" - , Space - , Str "words" - , Space - , Str "are" - , Space - , Str "taken," - , SoftBreak - , Str "will" - , Space - , Str "be" - , Space - , Str "found" - , Space - , Str "translated" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "late" - , Space - , Str "Henry" - , Space - , Str "Clarke" - , Space - , Str "Warren's" - , Space - , Str "Buddhism" - , Space - , Str "in" - , SoftBreak - , Str "Translation" - , Space - , Str "(Harvard" - , Space - , Str "Oriental" - , Space - , Str "Series)." - , Space - , Str "Mr." - , Space - , Str "Warren" - , Space - , Str "was" - , Space - , Str "one" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "great" - , SoftBreak - , Str "pioneers" - , Space - , Str "of" - , Space - , Str "Buddhist" - , Space - , Str "studies" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "Occident." - ] - ] - ] - ] - , Div - ( "wasteland-content.xhtml#ln309", [], [] ) - [ Plain - [ Str "O" - , Space - , Str "Lord" - , Space - , Str "Thou" - , Space - , Str "pluckest" - , Space - , Str "me" - , Space - , Str "out" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "309." ] - ( "#wasteland-content.xhtml#ln309", "" ) - , Space - , Str "From" - , Space - , Str "St." - , Space - , Str "Augustine's" - , Space - , Str "Confessions" - , Space - , Str "again." - , Space - , Str "The" - , Space - , Str "collocation" - , Space - , Str "of" - , Space - , Str "these" - , Space - , Str "two" - , SoftBreak - , Str "representatives" - , Space - , Str "of" - , Space - , Str "eastern" - , Space - , Str "and" - , Space - , Str "western" - , Space - , Str "asceticism," - , Space - , Str "as" - , Space - , Str "the" - , Space - , Str "culmination" - , Space - , Str "of" - , SoftBreak - , Str "this" - , Space - , Str "part" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "poem," - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "an" - , Space - , Str "accident." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "O" - , Space - , Str "Lord" - , Space - , Str "Thou" - , Space - , Str "pluckest" - , Span - ( "", [ "lnum" ], [] ) - [ Str "310" ] - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div ( "", [], [] ) [ Plain [ Str "burning" ] ] ] - ] - , Div - ( "wasteland-content.xhtml#ch4", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "IV." - , Space - , Str "DEATH" - , Space - , Str "BY" - , Space - , Str "WATER" - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "Phlebas" - , Space - , Str "the" - , Space - , Str "Phoenician," - , Space - , Str "a" - , Space - , Str "fortnight" - , Space - , Str "dead," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Forgot" - , Space - , Str "the" - , Space - , Str "cry" - , Space - , Str "of" - , Space - , Str "gulls," - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "deep" - , Space - , Str "sea" - , Space - , Str "swell" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "the" - , Space - , Str "profit" - , Space - , Str "and" - , Space - , Str "loss." - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [ "indent2" ], [] ) - [ Plain - [ Str "A" - , Space - , Str "current" - , Space - , Str "under" - , Space - , Str "sea" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Picked" - , Space - , Str "his" - , Space - , Str "bones" - , Space - , Str "in" - , Space - , Str "whispers." - , Space - , Str "As" - , Space - , Str "he" - , Space - , Str "rose" - , Space - , Str "and" - , Space - , Str "fell" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "He" - , Space - , Str "passed" - , Space - , Str "the" - , Space - , Str "stages" - , Space - , Str "of" - , Space - , Str "his" - , Space - , Str "age" - , Space - , Str "and" - , Space - , Str "youth" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Entering", Space, Str "the", Space, Str "whirlpool." ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [ "indent2" ], [] ) - [ Plain [ Str "Gentile", Space, Str "or", Space, Str "Jew" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "O" - , Space - , Str "you" - , Space - , Str "who" - , Space - , Str "turn" - , Space - , Str "the" - , Space - , Str "wheel" - , Space - , Str "and" - , Space - , Str "look" - , Space - , Str "to" - , Space - , Str "windward," - , Span - ( "", [ "lnum" ], [] ) - [ Str "320" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Consider" - , Space - , Str "Phlebas," - , Space - , Str "who" - , Space - , Str "was" - , Space - , Str "once" - , Space - , Str "handsome" - , Space - , Str "and" - , Space - , Str "tall" - , Space - , Str "as" - , Space - , Str "you." - ] - ] - ] - ] - , Div - ( "wasteland-content.xhtml#ch5", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "V." - , Space - , Str "WHAT" - , Space - , Str "THE" - , Space - , Str "THUNDER" - , Space - , Str "SAID" - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "After" - , Space - , Str "the" - , Space - , Str "torchlight" - , Space - , Str "red" - , Space - , Str "on" - , Space - , Str "sweaty" - , Space - , Str "faces" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "After" - , Space - , Str "the" - , Space - , Str "frosty" - , Space - , Str "silence" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "gardens" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "After" - , Space - , Str "the" - , Space - , Str "agony" - , Space - , Str "in" - , Space - , Str "stony" - , Space - , Str "places" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "shouting" - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "crying" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Prison" - , Space - , Str "and" - , Space - , Str "palace" - , Space - , Str "and" - , Space - , Str "reverberation" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Of" - , Space - , Str "thunder" - , Space - , Str "of" - , Space - , Str "spring" - , Space - , Str "over" - , Space - , Str "distant" - , Space - , Str "mountains" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "He" - , Space - , Str "who" - , Space - , Str "was" - , Space - , Str "living" - , Space - , Str "is" - , Space - , Str "now" - , Space - , Str "dead" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "We" - , Space - , Str "who" - , Space - , Str "were" - , Space - , Str "living" - , Space - , Str "are" - , Space - , Str "now" - , Space - , Str "dying" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "With" - , Space - , Str "a" - , Space - , Str "little" - , Space - , Str "patience" - , Span - ( "", [ "lnum" ], [] ) - [ Str "330" ] - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "Here" - , Space - , Str "is" - , Space - , Str "no" - , Space - , Str "water" - , Space - , Str "but" - , Space - , Str "only" - , Space - , Str "rock" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Rock" - , Space - , Str "and" - , Space - , Str "no" - , Space - , Str "water" - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "sandy" - , Space - , Str "road" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "road" - , Space - , Str "winding" - , Space - , Str "above" - , Space - , Str "among" - , Space - , Str "the" - , Space - , Str "mountains" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Which" - , Space - , Str "are" - , Space - , Str "mountains" - , Space - , Str "of" - , Space - , Str "rock" - , Space - , Str "without" - , Space - , Str "water" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "If" - , Space - , Str "there" - , Space - , Str "were" - , Space - , Str "water" - , Space - , Str "we" - , Space - , Str "should" - , Space - , Str "stop" - , Space - , Str "and" - , Space - , Str "drink" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Amongst" - , Space - , Str "the" - , Space - , Str "rock" - , Space - , Str "one" - , Space - , Str "cannot" - , Space - , Str "stop" - , Space - , Str "or" - , Space - , Str "think" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Sweat" - , Space - , Str "is" - , Space - , Str "dry" - , Space - , Str "and" - , Space - , Str "feet" - , Space - , Str "are" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "sand" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "If" - , Space - , Str "there" - , Space - , Str "were" - , Space - , Str "only" - , Space - , Str "water" - , Space - , Str "amongst" - , Space - , Str "the" - , Space - , Str "rock" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Dead" - , Space - , Str "mountain" - , Space - , Str "mouth" - , Space - , Str "of" - , Space - , Str "carious" - , Space - , Str "teeth" - , Space - , Str "that" - , Space - , Str "cannot" - , Space - , Str "spit" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Here" - , Space - , Str "one" - , Space - , Str "can" - , Space - , Str "neither" - , Space - , Str "stand" - , Space - , Str "nor" - , Space - , Str "lie" - , Space - , Str "nor" - , Space - , Str "sit" - , Span - ( "", [ "lnum" ], [] ) - [ Str "340" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "There" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "even" - , Space - , Str "silence" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "mountains" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "But" - , Space - , Str "dry" - , Space - , Str "sterile" - , Space - , Str "thunder" - , Space - , Str "without" - , Space - , Str "rain" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "There" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "even" - , Space - , Str "solitude" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "mountains" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "But" - , Space - , Str "red" - , Space - , Str "sullen" - , Space - , Str "faces" - , Space - , Str "sneer" - , Space - , Str "and" - , Space - , Str "snarl" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "From" - , Space - , Str "doors" - , Space - , Str "of" - , Space - , Str "mudcracked" - , Space - , Str "houses" - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [ "indent2" ], [] ) - [ Plain - [ Str "If" - , Space - , Str "there" - , Space - , Str "were" - , Space - , Str "water" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "And", Space, Str "no", Space, Str "rock" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "If" - , Space - , Str "there" - , Space - , Str "were" - , Space - , Str "rock" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "And", Space, Str "also", Space, Str "water" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "water" - , Span - ( "", [ "lnum" ], [] ) - [ Str "350" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "A", Space, Str "spring" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "A" - , Space - , Str "pool" - , Space - , Str "among" - , Space - , Str "the" - , Space - , Str "rock" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "If" - , Space - , Str "there" - , Space - , Str "were" - , Space - , Str "the" - , Space - , Str "sound" - , Space - , Str "of" - , Space - , Str "water" - , Space - , Str "only" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "Not", Space, Str "the", Space, Str "cicada" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "dry" - , Space - , Str "grass" - , Space - , Str "singing" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "But" - , Space - , Str "sound" - , Space - , Str "of" - , Space - , Str "water" - , Space - , Str "over" - , Space - , Str "a" - , Space - , Str "rock" - ] - ] - , Div - ( "wasteland-content.xhtml#ln357", [], [] ) - [ Plain - [ Str "Where" - , Space - , Str "the" - , Space - , Str "hermit-thrush" - , Space - , Str "sings" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "pine" - , Space - , Str "trees" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "357." ] - ( "#wasteland-content.xhtml#ln357", "" ) - , Space - , Str "This" - , Space - , Str "is" - , Space - , Str "Turdus" - , Space - , Str "aonalaschkae" - , Space - , Str "pallasii," - , Space - , Str "the" - , Space - , Str "hermit-thrush" - , Space - , Str "which" - , Space - , Str "I" - , Space - , Str "have" - , SoftBreak - , Str "heard" - , Space - , Str "in" - , Space - , Str "Quebec" - , Space - , Str "County." - , Space - , Str "Chapman" - , Space - , Str "says" - , Space - , Str "(Handbook" - , Space - , Str "of" - , Space - , Str "Birds" - , Space - , Str "of" - , Space - , Str "Eastern" - , Space - , Str "North" - , SoftBreak - , Str "America)" - , Space - , Str "\"it" - , Space - , Str "is" - , Space - , Str "most" - , Space - , Str "at" - , Space - , Str "home" - , Space - , Str "in" - , Space - , Str "secluded" - , Space - , Str "woodland" - , Space - , Str "and" - , Space - , Str "thickety" - , Space - , Str "retreats." - , SoftBreak - , Str "." - , Space - , Str "." - , Space - , Str "." - , Space - , Str "Its" - , Space - , Str "notes" - , Space - , Str "are" - , Space - , Str "not" - , Space - , Str "remarkable" - , Space - , Str "for" - , Space - , Str "variety" - , Space - , Str "or" - , Space - , Str "volume," - , Space - , Str "but" - , Space - , Str "in" - , Space - , Str "purity" - , SoftBreak - , Str "and" - , Space - , Str "sweetness" - , Space - , Str "of" - , Space - , Str "tone" - , Space - , Str "and" - , Space - , Str "exquisite" - , Space - , Str "modulation" - , Space - , Str "they" - , Space - , Str "are" - , Space - , Str "unequalled.\"" - , Space - , Str "Its" - , SoftBreak - , Str "\"water-dripping" - , Space - , Str "song\"" - , Space - , Str "is" - , Space - , Str "justly" - , Space - , Str "celebrated." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Drip" - , Space - , Str "drop" - , Space - , Str "drip" - , Space - , Str "drop" - , Space - , Str "drop" - , Space - , Str "drop" - , Space - , Str "drop" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "But" - , Space - , Str "there" - , Space - , Str "is" - , Space - , Str "no" - , Space - , Str "water" - ] - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "wasteland-content.xhtml#ln360", [], [] ) - [ Plain - [ Str "Who" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "third" - , Space - , Str "who" - , Space - , Str "walks" - , Space - , Str "always" - , Space - , Str "beside" - , Space - , Str "you?" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "360." ] - ( "#wasteland-content.xhtml#ln360", "" ) - , Space - , Str "The" - , Space - , Str "following" - , Space - , Str "lines" - , Space - , Str "were" - , Space - , Str "stimulated" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "account" - , Space - , Str "of" - , Space - , Str "one" - , Space - , Str "of" - , Space - , Str "the" - , SoftBreak - , Str "Antarctic" - , Space - , Str "expeditions" - , Space - , Str "(I" - , Space - , Str "forget" - , Space - , Str "which," - , Space - , Str "but" - , Space - , Str "I" - , Space - , Str "think" - , Space - , Str "one" - , Space - , Str "of" - , Space - , Str "Shackleton's):" - , SoftBreak - , Str "it" - , Space - , Str "was" - , Space - , Str "related" - , Space - , Str "that" - , Space - , Str "the" - , Space - , Str "party" - , Space - , Str "of" - , Space - , Str "explorers," - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "extremity" - , Space - , Str "of" - , Space - , Str "their" - , SoftBreak - , Str "strength," - , Space - , Str "had" - , Space - , Str "the" - , Space - , Str "constant" - , Space - , Str "delusion" - , Space - , Str "that" - , Space - , Str "there" - , Space - , Str "was" - , Space - , Str "one" - , Space - , Str "more" - , Space - , Str "member" - , Space - , Str "than" - , SoftBreak - , Str "could" - , Space - , Str "actually" - , Space - , Str "be" - , Space - , Str "counted." - ] - ] - , SoftBreak - , Span - ( "", [ "lnum" ], [] ) - [ Str "360" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "When" - , Space - , Str "I" - , Space - , Str "count," - , Space - , Str "there" - , Space - , Str "are" - , Space - , Str "only" - , Space - , Str "you" - , Space - , Str "and" - , Space - , Str "I" - , Space - , Str "together" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "But" - , Space - , Str "when" - , Space - , Str "I" - , Space - , Str "look" - , Space - , Str "ahead" - , Space - , Str "up" - , Space - , Str "the" - , Space - , Str "white" - , Space - , Str "road" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "There" - , Space - , Str "is" - , Space - , Str "always" - , Space - , Str "another" - , Space - , Str "one" - , Space - , Str "walking" - , Space - , Str "beside" - , Space - , Str "you" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Gliding" - , Space - , Str "wrapt" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "brown" - , Space - , Str "mantle," - , Space - , Str "hooded" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "do" - , Space - , Str "not" - , Space - , Str "know" - , Space - , Str "whether" - , Space - , Str "a" - , Space - , Str "man" - , Space - , Str "or" - , Space - , Str "a" - , Space - , Str "woman" - ] - ] - , Div - ( "wasteland-content.xhtml#ln367", [], [] ) - [ Plain - [ Str "\8213But" - , Space - , Str "who" - , Space - , Str "is" - , Space - , Str "that" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "other" - , Space - , Str "side" - , Space - , Str "of" - , Space - , Str "you?" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "367-77." ] - ( "#wasteland-content.xhtml#ln367", "" ) - , Space - , Str "Cf." - , Space - , Str "Hermann" - , Space - , Str "Hesse," - , Space - , Str "Blick" - , Space - , Str "ins" - , Space - , Str "Chaos:" - ] - , BlockQuote - [ Para - [ Str "\"Schon" - , Space - , Str "ist" - , Space - , Str "halb" - , Space - , Str "Europa," - , Space - , Str "schon" - , Space - , Str "ist" - , Space - , Str "zumindest" - , Space - , Str "der" - , Space - , Str "halbe" - , Space - , Str "Osten" - , Space - , Str "Europas" - , SoftBreak - , Str "auf" - , Space - , Str "dem" - , LineBreak - , Str "Wege" - , Space - , Str "zum" - , Space - , Str "Chaos," - , Space - , Str "fhrt" - , Space - , Str "betrunken" - , Space - , Str "im" - , Space - , Str "heiligem" - , Space - , Str "Wahn" - , Space - , Str "am" - , SoftBreak - , Str "Abgrund" - , Space - , Str "entlang" - , LineBreak - , Str "und" - , Space - , Str "singt" - , Space - , Str "dazu," - , Space - , Str "singt" - , Space - , Str "betrunken" - , Space - , Str "und" - , Space - , Str "hymnisch" - , SoftBreak - , Str "wie" - , Space - , Str "Dmitri" - , Space - , Str "Karamasoff" - , Space - , Str "sang." - , LineBreak - , Str "Ueber" - , Space - , Str "diese" - , Space - , Str "Lieder" - , Space - , Str "lacht" - , Space - , Str "der" - , SoftBreak - , Str "Bsrger" - , Space - , Str "beleidigt," - , Space - , Str "der" - , Space - , Str "Heilige" - , LineBreak - , Str "und" - , Space - , Str "Seher" - , Space - , Str "hrt" - , Space - , Str "sie" - , Space - , Str "mit" - , SoftBreak - , Str "Trvnen.\"" - ] - ] - ] - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "What" - , Space - , Str "is" - , Space - , Str "that" - , Space - , Str "sound" - , Space - , Str "high" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "air" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Murmur" - , Space - , Str "of" - , Space - , Str "maternal" - , Space - , Str "lamentation" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Who" - , Space - , Str "are" - , Space - , Str "those" - , Space - , Str "hooded" - , Space - , Str "hordes" - , Space - , Str "swarming" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Over" - , Space - , Str "endless" - , Space - , Str "plains," - , Space - , Str "stumbling" - , Space - , Str "in" - , Space - , Str "cracked" - , Space - , Str "earth" - , Span - ( "", [ "lnum" ], [] ) - [ Str "370" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Ringed" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "flat" - , Space - , Str "horizon" - , Space - , Str "only" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "What" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "city" - , Space - , Str "over" - , Space - , Str "the" - , Space - , Str "mountains" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Cracks" - , Space - , Str "and" - , Space - , Str "reforms" - , Space - , Str "and" - , Space - , Str "bursts" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "violet" - , Space - , Str "air" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "Falling", Space, Str "towers" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Jerusalem" - , Space - , Str "Athens" - , Space - , Str "Alexandria" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "Vienna", Space, Str "London" ] ] - , Div - ( "", [], [] ) - [ Plain [ Str "Unreal" ] ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "A" - , Space - , Str "woman" - , Space - , Str "drew" - , Space - , Str "her" - , Space - , Str "long" - , Space - , Str "black" - , Space - , Str "hair" - , Space - , Str "out" - , Space - , Str "tight" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "fiddled" - , Space - , Str "whisper" - , Space - , Str "music" - , Space - , Str "on" - , Space - , Str "those" - , Space - , Str "strings" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "bats" - , Space - , Str "with" - , Space - , Str "baby" - , Space - , Str "faces" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "violet" - , Space - , Str "light" - , Span - ( "", [ "lnum" ], [] ) - [ Str "380" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Whistled," - , Space - , Str "and" - , Space - , Str "beat" - , Space - , Str "their" - , Space - , Str "wings" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "crawled" - , Space - , Str "head" - , Space - , Str "downward" - , Space - , Str "down" - , Space - , Str "a" - , Space - , Str "blackened" - , Space - , Str "wall" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "upside" - , Space - , Str "down" - , Space - , Str "in" - , Space - , Str "air" - , Space - , Str "were" - , Space - , Str "towers" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Tolling" - , Space - , Str "reminiscent" - , Space - , Str "bells," - , Space - , Str "that" - , Space - , Str "kept" - , Space - , Str "the" - , Space - , Str "hours" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "voices" - , Space - , Str "singing" - , Space - , Str "out" - , Space - , Str "of" - , Space - , Str "empty" - , Space - , Str "cisterns" - , Space - , Str "and" - , Space - , Str "exhausted" - , SoftBreak - , Str "wells." - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "In" - , Space - , Str "this" - , Space - , Str "decayed" - , Space - , Str "hole" - , Space - , Str "among" - , Space - , Str "the" - , Space - , Str "mountains" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "In" - , Space - , Str "the" - , Space - , Str "faint" - , Space - , Str "moonlight," - , Space - , Str "the" - , Space - , Str "grass" - , Space - , Str "is" - , Space - , Str "singing" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Over" - , Space - , Str "the" - , Space - , Str "tumbled" - , Space - , Str "graves," - , Space - , Str "about" - , Space - , Str "the" - , Space - , Str "chapel" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "There" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "empty" - , Space - , Str "chapel," - , Space - , Str "only" - , Space - , Str "the" - , Space - , Str "wind's" - , Space - , Str "home." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "It" - , Space - , Str "has" - , Space - , Str "no" - , Space - , Str "windows," - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "door" - , Space - , Str "swings," - , Span - ( "", [ "lnum" ], [] ) - [ Str "390" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Dry" - , Space - , Str "bones" - , Space - , Str "can" - , Space - , Str "harm" - , Space - , Str "no" - , Space - , Str "one." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Only" - , Space - , Str "a" - , Space - , Str "cock" - , Space - , Str "stood" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "rooftree" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Co" - , Space - , Str "co" - , Space - , Str "rico" - , Space - , Str "co" - , Space - , Str "co" - , Space - , Str "rico" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "In" - , Space - , Str "a" - , Space - , Str "flash" - , Space - , Str "of" - , Space - , Str "lightning." - , Space - , Str "Then" - , Space - , Str "a" - , Space - , Str "damp" - , Space - , Str "gust" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "Bringing", Space, Str "rain" ] ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "Ganga" - , Space - , Str "was" - , Space - , Str "sunken," - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "limp" - , Space - , Str "leaves" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Waited" - , Space - , Str "for" - , Space - , Str "rain," - , Space - , Str "while" - , Space - , Str "the" - , Space - , Str "black" - , Space - , Str "clouds" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Gathered" - , Space - , Str "far" - , Space - , Str "distant," - , Space - , Str "over" - , Space - , Str "Himavant." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "jungle" - , Space - , Str "crouched," - , Space - , Str "humped" - , Space - , Str "in" - , Space - , Str "silence." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Then" - , Space - , Str "spoke" - , Space - , Str "the" - , Space - , Str "thunder" - , Span - ( "", [ "lnum" ], [] ) - [ Str "400" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "DA" ] ] - , Div - ( "wasteland-content.xhtml#ln402", [], [] ) - [ Plain - [ Span - ( "", [], [ ( "lang", "sa" ) ] ) - [ Str "Datta" ] - , Str ":" - , Space - , Str "what" - , Space - , Str "have" - , Space - , Str "we" - , Space - , Str "given?" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "402." ] - ( "#wasteland-content.xhtml#ln402", "" ) - , Space - , Quoted DoubleQuote - [ Str "\"Datta," - , Space - , Str "dayadhvam," - , Space - , Str "damyata\"" - ] - , Space - , Str "(Give," - , Space - , Str "sympathize," - , SoftBreak - , Str "control)." - , Space - , Str "The" - , Space - , Str "fable" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "meaning" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "Thunder" - , Space - , Str "is" - , Space - , Str "found" - , Space - , Str "in" - , Space - , Str "the" - , SoftBreak - , Str "Brihadaranyaka-Upanishad," - , Space - , Str "5," - , Space - , Str "1." - , Space - , Str "A" - , Space - , Str "translation" - , Space - , Str "is" - , Space - , Str "found" - , Space - , Str "in" - , Space - , Str "Deussen's" - , SoftBreak - , Str "Sechzig" - , Space - , Str "Upanishads" - , Space - , Str "des" - , Space - , Str "Veda," - , Space - , Str "p." - , Space - , Str "489." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "My" - , Space - , Str "friend," - , Space - , Str "blood" - , Space - , Str "shaking" - , Space - , Str "my" - , Space - , Str "heart" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "awful" - , Space - , Str "daring" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "moment's" - , Space - , Str "surrender" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Which" - , Space - , Str "an" - , Space - , Str "age" - , Space - , Str "of" - , Space - , Str "prudence" - , Space - , Str "can" - , Space - , Str "never" - , Space - , Str "retract" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "By" - , Space - , Str "this," - , Space - , Str "and" - , Space - , Str "this" - , Space - , Str "only," - , Space - , Str "we" - , Space - , Str "have" - , Space - , Str "existed" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Which" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "to" - , Space - , Str "be" - , Space - , Str "found" - , Space - , Str "in" - , Space - , Str "our" - , Space - , Str "obituaries" - ] - ] - , Div - ( "wasteland-content.xhtml#ln408", [], [] ) - [ Plain - [ Str "Or" - , Space - , Str "in" - , Space - , Str "memories" - , Space - , Str "draped" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "beneficent" - , Space - , Str "spider" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "408." ] - ( "#wasteland-content.xhtml#ln408", "" ) - , Space - , Str "Cf." - , Space - , Str "Webster," - , Space - , Str "The" - , Space - , Str "White" - , Space - , Str "Devil," - , Space - , Str "v." - , Space - , Str "vi:" - ] - , BlockQuote - [ Para - [ Str "\"." - , Space - , Str "." - , Space - , Str "." - , Space - , Str "they'll" - , Space - , Str "remarry" - , LineBreak - , Str "Ere" - , Space - , Str "the" - , Space - , Str "worm" - , Space - , Str "pierce" - , Space - , Str "your" - , Space - , Str "winding-sheet," - , SoftBreak - , Str "ere" - , Space - , Str "the" - , Space - , Str "spider" - , LineBreak - , Str "Make" - , Space - , Str "a" - , Space - , Str "thin" - , Space - , Str "curtain" - , Space - , Str "for" - , Space - , Str "your" - , Space - , Str "epitaphs.\"" - ] - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Or" - , Space - , Str "under" - , Space - , Str "seals" - , Space - , Str "broken" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "lean" - , Space - , Str "solicitor" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "In" - , Space - , Str "our" - , Space - , Str "empty" - , Space - , Str "rooms" - , Span - ( "", [ "lnum" ], [] ) - [ Str "410" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "DA" ] ] - , Div - ( "wasteland-content.xhtml#ln412", [], [] ) - [ Plain - [ Span - ( "", [], [ ( "lang", "sa" ) ] ) - [ Str "Dayadhvam" ] - , Str ":" - , Space - , Str "I" - , Space - , Str "have" - , Space - , Str "heard" - , Space - , Str "the" - , Space - , Str "key" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "412." ] - ( "#wasteland-content.xhtml#ln412", "" ) - , Space - , Str "Cf." - , Space - , Str "Inferno," - , Space - , Str "xxxiii." - , Space - , Str "46:" - ] - , BlockQuote - [ Para - [ Str "\"ed" - , Space - , Str "io" - , Space - , Str "sentii" - , Space - , Str "chiavar" - , Space - , Str "l'uscio" - , Space - , Str "di" - , Space - , Str "sotto" - , LineBreak - , Str "all'orribile" - , Space - , Str "torre.\"" - ] - ] - , Para - [ Str "Also" - , Space - , Str "F." - , Space - , Str "H." - , Space - , Str "Bradley," - , Space - , Str "Appearance" - , Space - , Str "and" - , Space - , Str "Reality," - , Space - , Str "p." - , Space - , Str "346:" - ] - , BlockQuote - [ Para - [ Str "\"My" - , Space - , Str "external" - , Space - , Str "sensations" - , Space - , Str "are" - , Space - , Str "no" - , Space - , Str "less" - , Space - , Str "private" - , Space - , Str "to" - , Space - , Str "myself" - , Space - , Str "than" - , Space - , Str "are" - , Space - , Str "my" - , SoftBreak - , Str "thoughts" - , Space - , Str "or" - , Space - , Str "my" - , Space - , Str "feelings." - , Space - , Str "In" - , Space - , Str "either" - , Space - , Str "case" - , Space - , Str "my" - , Space - , Str "experience" - , Space - , Str "falls" - , Space - , Str "within" - , SoftBreak - , Str "my" - , Space - , Str "own" - , Space - , Str "circle," - , Space - , Str "a" - , Space - , Str "circle" - , Space - , Str "closed" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "outside;" - , Space - , Str "and," - , Space - , Str "with" - , Space - , Str "all" - , Space - , Str "its" - , SoftBreak - , Str "elements" - , Space - , Str "alike," - , Space - , Str "every" - , Space - , Str "sphere" - , Space - , Str "is" - , Space - , Str "opaque" - , Space - , Str "to" - , Space - , Str "the" - , Space - , Str "others" - , Space - , Str "which" - , Space - , Str "surround" - , SoftBreak - , Str "it." - , Space - , Str "." - , Space - , Str "." - , Space - , Str "." - , Space - , Str "In" - , Space - , Str "brief," - , Space - , Str "regarded" - , Space - , Str "as" - , Space - , Str "an" - , Space - , Str "existence" - , Space - , Str "which" - , Space - , Str "appears" - , Space - , Str "in" - , Space - , Str "a" - , SoftBreak - , Str "soul," - , Space - , Str "the" - , Space - , Str "whole" - , Space - , Str "world" - , Space - , Str "for" - , Space - , Str "each" - , Space - , Str "is" - , Space - , Str "peculiar" - , Space - , Str "and" - , Space - , Str "private" - , Space - , Str "to" - , Space - , Str "that" - , SoftBreak - , Str "soul.\"" - ] - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Turn" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "door" - , Space - , Str "once" - , Space - , Str "and" - , Space - , Str "turn" - , Space - , Str "once" - , Space - , Str "only" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "We" - , Space - , Str "think" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "key," - , Space - , Str "each" - , Space - , Str "in" - , Space - , Str "his" - , Space - , Str "prison" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Thinking" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "key," - , Space - , Str "each" - , Space - , Str "confirms" - , Space - , Str "a" - , Space - , Str "prison" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Only" - , Space - , Str "at" - , Space - , Str "nightfall," - , Space - , Str "aetherial" - , Space - , Str "rumours" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Revive" - , Space - , Str "for" - , Space - , Str "a" - , Space - , Str "moment" - , Space - , Str "a" - , Space - , Str "broken" - , Space - , Str "Coriolanus" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "DA" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Span - ( "", [], [ ( "lang", "sa" ) ] ) - [ Str "Damyata" ] - , Str ":" - , Space - , Str "The" - , Space - , Str "boat" - , Space - , Str "responded" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Gaily," - , Space - , Str "to" - , Space - , Str "the" - , Space - , Str "hand" - , Space - , Str "expert" - , Space - , Str "with" - , Space - , Str "sail" - , Space - , Str "and" - , Space - , Str "oar" - , Span - ( "", [ "lnum" ], [] ) - [ Str "420" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "sea" - , Space - , Str "was" - , Space - , Str "calm," - , Space - , Str "your" - , Space - , Str "heart" - , Space - , Str "would" - , Space - , Str "have" - , Space - , Str "responded" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Gaily," - , Space - , Str "when" - , Space - , Str "invited," - , Space - , Str "beating" - , Space - , Str "obedient" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "To", Space, Str "controlling", Space, Str "hands" ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [ "indent" ], [] ) - [ Plain - [ Str "I" - , Space - , Str "sat" - , Space - , Str "upon" - , Space - , Str "the" - , Space - , Str "shore" - ] - ] - , Div - ( "wasteland-content.xhtml#ln425", [], [] ) - [ Plain - [ Str "Fishing," - , Space - , Str "with" - , Space - , Str "the" - , Space - , Str "arid" - , Space - , Str "plain" - , Space - , Str "behind" - , Space - , Str "me" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "425." ] - ( "#wasteland-content.xhtml#ln425", "" ) - , Space - , Str "V." - , Space - , Str "Weston," - , Space - , Str "From" - , Space - , Str "Ritual" - , Space - , Str "to" - , Space - , Str "Romance;" - , Space - , Str "chapter" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "Fisher" - , Space - , Str "King." - ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Shall" - , Space - , Str "I" - , Space - , Str "at" - , Space - , Str "least" - , Space - , Str "set" - , Space - , Str "my" - , Space - , Str "lands" - , Space - , Str "in" - , Space - , Str "order?" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "London" - , Space - , Str "Bridge" - , Space - , Str "is" - , Space - , Str "falling" - , Space - , Str "down" - , Space - , Str "falling" - , Space - , Str "down" - , Space - , Str "falling" - , Space - , Str "down" - ] - ] - , Div - ( "wasteland-content.xhtml#ln428", [], [ ( "lang", "it" ) ] ) - [ Plain - [ Emph - [ Str "Poi" - , Space - , Str "s'ascose" - , Space - , Str "nel" - , Space - , Str "foco" - , Space - , Str "che" - , Space - , Str "gli" - , Space - , Str "affina" - ] - , SoftBreak - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "428." ] - ( "#wasteland-content.xhtml#ln428", "" ) - , Space - , Str "V." - , Space - , Str "Purgatorio," - , Space - , Str "xxvi." - , Space - , Str "148." - ] - , BlockQuote - [ Para - [ Str "\"'Ara" - , Space - , Str "vos" - , Space - , Str "prec" - , Space - , Str "per" - , Space - , Str "aquella" - , Space - , Str "valor" - , LineBreak - , Str "'que" - , Space - , Str "vos" - , Space - , Str "guida" - , Space - , Str "al" - , Space - , Str "som" - , Space - , Str "de" - , SoftBreak - , Str "l'escalina," - , LineBreak - , Str "'sovegna" - , Space - , Str "vos" - , Space - , Str "a" - , Space - , Str "temps" - , Space - , Str "de" - , Space - , Str "ma" - , Space - , Str "dolor.'" - , LineBreak - , Str "Poi" - , SoftBreak - , Str "s'ascose" - , Space - , Str "nel" - , Space - , Str "foco" - , Space - , Str "che" - , Space - , Str "gli" - , Space - , Str "affina.\"" - ] - ] - ] - ] - ] - , Div - ( "wasteland-content.xhtml#ln429", [], [] ) - [ Plain - [ Span - ( "", [], [ ( "lang", "it" ) ] ) - [ SoftBreak - , Emph - [ Str "Quando" - , Space - , Str "fiam" - , Space - , Str "ceu" - , Space - , Str "chelidon" - ] - , SoftBreak - ] - , Space - , Str "-" - , Space - , Str "O" - , Space - , Str "swallow" - , Space - , Str "swallow" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "429." ] - ( "#wasteland-content.xhtml#ln429", "" ) - , Space - , Str "V." - , Space - , Str "Pervigilium" - , Space - , Str "Veneris." - , Space - , Str "Cf." - , Space - , Str "Philomela" - , Space - , Str "in" - , Space - , Str "Parts" - , Space - , Str "II" - , Space - , Str "and" - , Space - , Str "III." - ] - ] - ] - ] - , Div - ( "wasteland-content.xhtml#ln430", [], [ ( "lang", "fr" ) ] ) - [ Plain - [ Emph - [ Str "Le" - , Space - , Str "Prince" - , Space - , Str "d'Aquitaine" - , Space - , Str "a" - , Space - , Str "la" - , Space - , Str "tour" - , Space - , Str "abolie" - ] - , SoftBreak - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "430." ] - ( "#wasteland-content.xhtml#ln430", "" ) - , Space - , Str "V." - , Space - , Str "Gerard" - , Space - , Str "de" - , Space - , Str "Nerval," - , Space - , Str "Sonnet" - , Space - , Str "El" - , Space - , Str "Desdichado." - ] - ] - , SoftBreak - , Span - ( "", [ "lnum" ], [] ) - [ Str "430" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "These" - , Space - , Str "fragments" - , Space - , Str "I" - , Space - , Str "have" - , Space - , Str "shored" - , Space - , Str "against" - , Space - , Str "my" - , Space - , Str "ruins" - ] - ] - , Div - ( "wasteland-content.xhtml#ln432", [], [] ) - [ Plain - [ Str "Why" - , Space - , Str "then" - , Space - , Str "Ile" - , Space - , Str "fit" - , Space - , Str "you." - , Space - , Str "Hieronymo's" - , Space - , Str "mad" - , Space - , Str "againe." - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "432." ] - ( "#wasteland-content.xhtml#ln432", "" ) - , Space - , Str "V." - , Space - , Str "Kyd's" - , Space - , Str "Spanish" - , Space - , Str "Tragedy." - ] - ] - ] - ] - , Div - ( "", [], [ ( "lang", "sa" ) ] ) - [ Plain - [ Str "Datta." - , Space - , Str "Dayadhvam." - , Space - , Str "Damyata." - ] - ] - , Div - ( "wasteland-content.xhtml#ln434" - , - [ "linegroup", "indent" ] - , [] - ) - [ Plain - [ Span - ( "", [], [ ( "lang", "sa" ) ] ) - [ Str "Shantih" - , Space - , Str "shantih" - , Space - , Str "shantih" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "434." ] - ( "#wasteland-content.xhtml#ln434", "" ) - , Space - , Str "Shantih." - , Space - , Str "Repeated" - , Space - , Str "as" - , Space - , Str "here," - , Space - , Str "a" - , Space - , Str "formal" - , Space - , Str "ending" - , Space - , Str "to" - , Space - , Str "an" - , Space - , Str "Upanishad." - , Space - , Str "'The" - , SoftBreak - , Str "Peace" - , Space - , Str "which" - , Space - , Str "passeth" - , Space - , Str "understanding'" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "feeble" - , Space - , Str "translation" - , Space - , Str "of" - , Space - , Str "the" - , SoftBreak - , Str "content" - , Space - , Str "of" - , Space - , Str "this" - , Space - , Str "word." - ] - ] - , SoftBreak - ] - ] - ] - ] - ] - ] -, Div - ( "wasteland-content.xhtml#backmatter" - , - [ "section", "backmatter" ] - , [] - ) - [ Div - ( "wasteland-content.xhtml#rearnotes" - , - [ "section", "rearnotes" ] - , [] - ) - [ Header 2 - ( "", [], [] ) - [ Str "NOTES" - , Space - , Str "ON" - , Space - , Str "\"THE" - , Space - , Str "WASTE" - , Space - , Str "LAND\"" - ] - , Para - [ Str "Not" - , Space - , Str "only" - , Space - , Str "the" - , Space - , Str "title," - , Space - , Str "but" - , Space - , Str "the" - , Space - , Str "plan" - , Space - , Str "and" - , Space - , Str "a" - , Space - , Str "good" - , Space - , Str "deal" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "incidental" - , Space - , Str "symbolism" - , Space - , Str "of" - , SoftBreak - , Str "the" - , Space - , Str "poem" - , Space - , Str "were" - , Space - , Str "suggested" - , Space - , Str "by" - , Space - , Str "Miss" - , Space - , Str "Jessie" - , Space - , Str "L." - , Space - , Str "Weston's" - , Space - , Str "book" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "Grail" - , Space - , Str "legend:" - , SoftBreak - , Str "From" - , Space - , Str "Ritual" - , Space - , Str "to" - , Space - , Str "Romance" - ] - , Para - [ Str "Indeed," - , Space - , Str "so" - , Space - , Str "deeply" - , Space - , Str "am" - , Space - , Str "I" - , Space - , Str "indebted," - , Space - , Str "Miss" - , Space - , Str "Weston's" - , Space - , Str "book" - , Space - , Str "will" - , Space - , Str "elucidate" - , Space - , Str "the" - , SoftBreak - , Str "difficulties" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "poem" - , Space - , Str "much" - , Space - , Str "better" - , Space - , Str "than" - , Space - , Str "my" - , Space - , Str "notes" - , Space - , Str "can" - , Space - , Str "do;" - , Space - , Str "and" - , Space - , Str "I" - , Space - , Str "recommend" - , Space - , Str "it" - , SoftBreak - , Str "(apart" - , Space - , Str "from" - , Space - , Str "the" - , Space - , Str "great" - , Space - , Str "interest" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "book" - , Space - , Str "itself)" - , Space - , Str "to" - , Space - , Str "any" - , Space - , Str "who" - , Space - , Str "think" - , Space - , Str "such" - , SoftBreak - , Str "elucidation" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "poem" - , Space - , Str "worth" - , Space - , Str "the" - , Space - , Str "trouble." - , Space - , Str "To" - , Space - , Str "another" - , Space - , Str "work" - , Space - , Str "of" - , Space - , Str "anthropology" - , Space - , Str "I" - , Space - , Str "am" - , SoftBreak - , Str "indebted" - , Space - , Str "in" - , Space - , Str "general," - , Space - , Str "one" - , Space - , Str "which" - , Space - , Str "has" - , Space - , Str "influenced" - , Space - , Str "our" - , Space - , Str "generation" - , Space - , Str "profoundly;" - , Space - , Str "I" - , Space - , Str "mean" - , SoftBreak - , Str "The" - , Space - , Str "Golden" - , Space - , Str "Bough;" - , Space - , Str "I" - , Space - , Str "have" - , Space - , Str "used" - , Space - , Str "especially" - , Space - , Str "the" - , Space - , Str "two" - , Space - , Str "volumes" - , Space - , Str "Adonis," - , Space - , Str "Attis," - , Space - , Str "Osiris." - , SoftBreak - , Str "Anyone" - , Space - , Str "who" - , Space - , Str "is" - , Space - , Str "acquainted" - , Space - , Str "with" - , Space - , Str "these" - , Space - , Str "works" - , Space - , Str "will" - , Space - , Str "immediately" - , Space - , Str "recognise" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "poem" - , SoftBreak - , Str "certain" - , Space - , Str "references" - , Space - , Str "to" - , Space - , Str "vegetation" - , Space - , Str "ceremonies." - ] - , Div - ( "", [ "section" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Str "I." - , Space - , Str "THE" - , Space - , Str "BURIAL" - , Space - , Str "OF" - , Space - , Str "THE" - , Space - , Str "DEAD" - ] - ] - , Div - ( "", [ "section" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Str "II." - , Space - , Str "A" - , Space - , Str "GAME" - , Space - , Str "OF" - , Space - , Str "CHESS" - ] - ] - , Div - ( "", [ "section" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Str "III." - , Space - , Str "THE" - , Space - , Str "FIRE" - , Space - , Str "SERMON" - ] - ] - , Div - ( "", [ "section" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Str "V." - , Space - , Str "WHAT" - , Space - , Str "THE" - , Space - , Str "THUNDER" - , Space - , Str "SAID" - ] - , Para - [ Str "In" - , Space - , Str "the" - , Space - , Str "first" - , Space - , Str "part" - , Space - , Str "of" - , Space - , Str "Part" - , Space - , Str "V" - , Space - , Str "three" - , Space - , Str "themes" - , Space - , Str "are" - , Space - , Str "employed:" - , Space - , Str "the" - , Space - , Str "journey" - , Space - , Str "to" - , Space - , Str "Emmaus," - , SoftBreak - , Str "the" - , Space - , Str "approach" - , Space - , Str "to" - , Space - , Str "the" - , Space - , Str "Chapel" - , Space - , Str "Perilous" - , Space - , Str "(see" - , Space - , Str "Miss" - , Space - , Str "Weston's" - , Space - , Str "book)" - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "present" - , SoftBreak - , Str "decay" - , Space - , Str "of" - , Space - , Str "eastern" - , Space - , Str "Europe." - ] - ] - ] ] ] -- cgit v1.2.3 From d6dbbb89d071b5e3b377467c924bde61879589f2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 22 Sep 2021 13:21:56 -0700 Subject: Use latest citeproc. --- stack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.yaml b/stack.yaml index 5343c52be..40704814b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -13,7 +13,7 @@ extra-deps: - git: https://github.com/jgm/texmath.git commit: 19700530733707284bb41f24add757f19ca23430 - git: https://github.com/jgm/citeproc.git - commit: b27201c3ac48ffd2853f77152df19b6e2cf36987 + commit: 4a7b98afabebd7a074489ba500d68ee6aa75d3a8 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From 7ab2f4a61d43928f597cad4916d25a94a5bde0e8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 22 Sep 2021 22:18:38 -0700 Subject: HTML writer: pass through inline math environments with KaTeX. --- src/Text/Pandoc/Writers/HTML.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 3592bd2d4..03d182f5e 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -1636,6 +1636,7 @@ isMathEnvironment s = "\\begin{" `T.isPrefixOf` s && allowsMathEnvironments :: HTMLMathMethod -> Bool allowsMathEnvironments (MathJax _) = True +allowsMathEnvironments (KaTeX _) = True allowsMathEnvironments MathML = True allowsMathEnvironments (WebTeX _) = True allowsMathEnvironments _ = False -- cgit v1.2.3 From 0afb48cd384ea1663f88bda32d0d149dc9a6f6c5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 22 Sep 2021 22:33:00 -0700 Subject: HTML writer: pass through `\ref` and `\eqref`... if MathJax is used. Closes #7587. --- src/Text/Pandoc/Writers/HTML.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 03d182f5e..f883bd6d8 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -1469,8 +1469,9 @@ inlineToHtml opts inline = do if ishtml then return $ preEscapedText str else if (f == Format "latex" || f == Format "tex") && - allowsMathEnvironments (writerHTMLMathMethod opts) && - isMathEnvironment str + ((allowsMathEnvironments (writerHTMLMathMethod opts) && + isMathEnvironment str) || + (allowsRef (writerHTMLMathMethod opts) && isRef str)) then inlineToHtml opts $ Math DisplayMath str else do report $ InlineNotRendered inline @@ -1602,6 +1603,9 @@ inDiv cls x = do (if html5 then H5.div else H.div) x ! A.class_ (toValue cls) +isRef :: Text -> Bool +isRef t = "\\ref{" `T.isPrefixOf` t || "\\eqref{" `T.isPrefixOf` t + isMathEnvironment :: Text -> Bool isMathEnvironment s = "\\begin{" `T.isPrefixOf` s && envName `elem` mathmlenvs @@ -1641,6 +1645,10 @@ allowsMathEnvironments MathML = True allowsMathEnvironments (WebTeX _) = True allowsMathEnvironments _ = False +allowsRef :: HTMLMathMethod -> Bool +allowsRef (MathJax _) = True +allowsRef _ = False + -- | List of intrinsic event attributes allowed on all elements in HTML4. intrinsicEventsHTML4 :: [Text] intrinsicEventsHTML4 = -- cgit v1.2.3 From f0a6eb913d7ace9de720539efb8984ea00ac82db Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 23 Sep 2021 08:49:52 -0700 Subject: HTML writer: render `\ref` and `\eqref` as inline math... not display. See #7589. --- src/Text/Pandoc/Writers/HTML.hs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index f883bd6d8..8fc81ed24 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -1468,14 +1468,17 @@ inlineToHtml opts inline = do ishtml <- isRawHtml f if ishtml then return $ preEscapedText str - else if (f == Format "latex" || f == Format "tex") && - ((allowsMathEnvironments (writerHTMLMathMethod opts) && - isMathEnvironment str) || - (allowsRef (writerHTMLMathMethod opts) && isRef str)) - then inlineToHtml opts $ Math DisplayMath str - else do - report $ InlineNotRendered inline - return mempty + else do + let istex = f == Format "latex" || f == Format "tex" + let mm = writerHTMLMathMethod opts + case istex of + True + | allowsMathEnvironments mm && isMathEnvironment str + -> inlineToHtml opts $ Math DisplayMath str + | allowsRef mm && isRef str + -> inlineToHtml opts $ Math InlineMath str + _ -> do report $ InlineNotRendered inline + return mempty (Link attr txt (s,_)) | "mailto:" `T.isPrefixOf` s -> do linkText <- inlineListToHtml opts txt obfuscateLink opts attr linkText s -- cgit v1.2.3 From aa89f6be186e2a442920860e5bf53149aabdac55 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 23 Sep 2021 09:25:37 -0700 Subject: HTML reader: handle empty tbody element in table. Closes #7589. --- src/Text/Pandoc/Readers/HTML/Table.hs | 13 ++++--- test/command/7589.md | 73 +++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 test/command/7589.md diff --git a/src/Text/Pandoc/Readers/HTML/Table.hs b/src/Text/Pandoc/Readers/HTML/Table.hs index 6e62e12f5..b23a2abc8 100644 --- a/src/Text/Pandoc/Readers/HTML/Table.hs +++ b/src/Text/Pandoc/Readers/HTML/Table.hs @@ -16,7 +16,7 @@ HTML table parser. module Text.Pandoc.Readers.HTML.Table (pTable) where import Control.Applicative ((<|>)) -import Data.Maybe (fromMaybe) +import Data.Maybe (fromMaybe, isJust) import Data.Either (lefts, rights) import Data.List.NonEmpty (nonEmpty) import Data.Text (Text) @@ -27,12 +27,13 @@ import Text.Pandoc.Definition import Text.Pandoc.Class.PandocMonad (PandocMonad (..)) import Text.Pandoc.Parsing ( eof, lookAhead, many, many1, manyTill, option, optional - , optionMaybe, skipMany, try) + , optionMaybe, skipMany, try ) import Text.Pandoc.Readers.HTML.Parsing import Text.Pandoc.Readers.HTML.Types (TagParser) import Text.Pandoc.Shared (onlySimpleTableCells, safeRead) import qualified Data.Text as T import qualified Text.Pandoc.Builder as B +import Control.Monad (guard) -- | Parses a @
+ + + + + + + + + + + +
experienceexpertiseparadigmshaskellnameimage
+^D +[ Table + ( "", [], [] ) + ( Caption Nothing [] ) + [ + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + , + ( AlignDefault, ColWidthDefault ) + ] + ( TableHead + ( "", [], [] ) + [ Row + ( "", [], [] ) + [ Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "experience" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "expertise" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "paradigms" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "haskell" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "name" ] ] + , Cell + ( "", [], [] ) AlignDefault + ( RowSpan 1 ) + ( ColSpan 1 ) + [ Plain [ Str "image" ] ] + ] + ] + ) + [ TableBody ( "", [], [] ) ( RowHeadColumns 0 ) [] [] ] + ( TableFoot ( "", [], [] ) [] ) +] +``` -- cgit v1.2.3 From 665e6d3d9438dabf2634aa6bdd694555122903d3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 23 Sep 2021 22:21:05 -0700 Subject: BibTeX parser: fix expansion of special strings in series... e.g. `newseries` or `library`. Expansion should not happen when these strings are protected in braces, or when they're capitalized. Closes #7591. --- src/Text/Pandoc/Citeproc/BibTeX.hs | 17 ++++++++++------- test/command/biblatex-article.md | 2 +- test/command/biblatex-gillies.md | 2 +- test/command/biblatex-shore.md | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs index c178de6e9..13baabccb 100644 --- a/src/Text/Pandoc/Citeproc/BibTeX.hs +++ b/src/Text/Pandoc/Citeproc/BibTeX.hs @@ -54,7 +54,6 @@ import Safe (readMay) import Text.Printf (printf) import Text.DocLayout (literal, hsep, nest, hang, Doc(..), braces, ($$), cr) - data Variant = Bibtex | Biblatex deriving (Show, Eq, Ord) @@ -527,9 +526,9 @@ itemToReference locale variant item = do let fixSeriesTitle [Str xs] | isNumber xs = [Str (ordinalize locale xs), Space, Str (resolveKey' lang "jourser")] fixSeriesTitle xs = xs - seriesTitle' <- (Just . B.fromList . fixSeriesTitle . - B.toList . resolveKey lang <$> - getTitle "series") <|> + + seriesTitle' <- (Just . B.fromList . fixSeriesTitle . B.toList + <$> getTitle "series") <|> return Nothing shortTitle' <- (Just <$> (guard (not hasMaintitle || isChapterlike) >> getTitle "shorttitle")) @@ -984,8 +983,12 @@ getTitle f = do ils <- getField f utc <- gets untitlecase lang <- gets localeLang + let ils' = + if f == "series" + then resolveKey lang $ ils + else ils let processTitle = if utc then unTitlecase (Just lang) else id - return $ processTitle ils + return $ processTitle ils' getShortTitle :: Bool -> Text -> Bib (Maybe Inlines) getShortTitle requireColon f = do @@ -1460,14 +1463,14 @@ bookTrans z = _ -> [z] resolveKey :: Lang -> Inlines -> Inlines -resolveKey lang ils = Walk.walk go ils +resolveKey lang (Many ils) = Many $ fmap go ils where go (Str s) = Str $ resolveKey' lang s go x = x resolveKey' :: Lang -> Text -> Text resolveKey' lang k = case Map.lookup (langLanguage lang) biblatexStringMap >>= - Map.lookup (T.toLower k) of + Map.lookup k of Nothing -> k Just (x, _) -> either (const k) stringify $ parseLaTeX lang x diff --git a/test/command/biblatex-article.md b/test/command/biblatex-article.md index 705369f78..68d467526 100644 --- a/test/command/biblatex-article.md +++ b/test/command/biblatex-article.md @@ -97,7 +97,7 @@ references: - family: Author given: Ann A. suffix: Jr. - collection-title: new series + collection-title: New series container-title: "The Journaltitle: The Journalsubtitle" doi: 10.1086/520976 editor: diff --git a/test/command/biblatex-gillies.md b/test/command/biblatex-gillies.md index e1a64af23..a63c1311d 100644 --- a/test/command/biblatex-gillies.md +++ b/test/command/biblatex-gillies.md @@ -54,7 +54,7 @@ references: author: - family: Gillies given: Alexander - collection-title: new series + collection-title: New series container-title: Publications of the English Goethe Society id: gillies issued: 1933 diff --git a/test/command/biblatex-shore.md b/test/command/biblatex-shore.md index cc9c079e1..efe97ef7a 100644 --- a/test/command/biblatex-shore.md +++ b/test/command/biblatex-shore.md @@ -49,7 +49,7 @@ references: author: - family: Shore given: Bradd - collection-title: new series + collection-title: New series container-title: American Anthropologist id: shore issue: 1 -- cgit v1.2.3 From 9b23b738cb28df357868fc0febff18e9c7c86b95 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 26 Sep 2021 21:20:27 -0700 Subject: Update documentation for definition_list extension. In 2015, we relaxed indentation requirements for the first line of a definition (see commit d3544dc and issue #2087), but the documnentation wasn't updated to reflect the change. Closes #7594. --- MANUAL.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 3551b2a32..7793b509c 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -3749,8 +3749,8 @@ or two spaces. A term may have multiple definitions, and each definition may consist of one or more block elements (paragraph, code block, list, etc.), each indented four spaces or one tab stop. The -body of the definition (including the first line, aside from the -colon or tilde) should be indented four spaces. However, as with +body of the definition (not including the first line) +should be indented four spaces. However, as with other Markdown lists, you can "lazily" omit indentation except at the beginning of a paragraph or other block element: -- cgit v1.2.3 From df57d0930bf4c6b369b1cd35a98bd8b7238da0d1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 26 Sep 2021 21:48:08 -0700 Subject: RST writer: properly handle anchors to ids... with spaces or leading underscore. In this cases we need the quoted form, e.g. ``` .. _`foo bar`: .. _`_foo`: ``` Side note: rST will "normalize" these identifiers anyway, ignoring the underscore: https://docutils.sourceforge.io/docs/ref/rst/directives.html#identifier-normalization Closes #7593. --- src/Text/Pandoc/Writers/RST.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 983ef412a..8b2002851 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -270,7 +270,12 @@ blockToRST (Header level (name,classes,_) inlines) = do let headerChar = if level > 5 then ' ' else "=-~^'" !! (level - 1) let border = literal $ T.replicate (offset contents) $ T.singleton headerChar let anchor | T.null name || name == autoId = empty - | otherwise = ".. _" <> literal name <> ":" $$ blankline + | otherwise = ".. _" <> + (if T.any (==':') name || + T.take 1 name == "_" + then "`" <> literal name <> "`" + else literal name) <> + ":" $$ blankline return $ nowrap $ anchor $$ contents $$ border $$ blankline else do let rub = "rubric:: " <> contents -- cgit v1.2.3 From 8018179b3df34cd7fdbd77c7a08b21fd8d5b5b31 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 27 Sep 2021 16:43:13 -0700 Subject: Better implementation of splitStrWhen --- src/Text/Pandoc/Citeproc/BibTeX.hs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs index 13baabccb..5c7bdd9b5 100644 --- a/src/Text/Pandoc/Citeproc/BibTeX.hs +++ b/src/Text/Pandoc/Citeproc/BibTeX.hs @@ -1256,19 +1256,14 @@ toName opts ils = do , nameStaticOrdering = False } +-- Split Str elements so that characters satisfying the +-- predicate each have their own Str. splitStrWhen :: (Char -> Bool) -> [Inline] -> [Inline] -splitStrWhen _ [] = [] -splitStrWhen p (Str xs : ys) = map Str (go xs) ++ splitStrWhen p ys - where go s = - let (w,z) = T.break p s - in if T.null z - then if T.null w - then [] - else [w] - else if T.null w - then (T.take 1 z : go (T.drop 1 z)) - else (w : T.take 1 z : go (T.drop 1 z)) -splitStrWhen p (x : ys) = x : splitStrWhen p ys +splitStrWhen p = foldr go [] + where + go (Str t) = (map Str (T.groupBy goesTogether t) ++) + go x = (x :) + goesTogether c d = not (p c || p d) ordinalize :: Locale -> Text -> Text ordinalize locale n = -- cgit v1.2.3 From 0bdcf415e4eff83ad8e35c1d41c8a28e0bbd5da1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 28 Sep 2021 21:17:53 -0700 Subject: Switch from pretty-simple to pretty-show for native output. Update tests. Reason: it turns out that the native output generated by pretty-simple isn't always readable by the native reader. According to https://github.com/cdepillabout/pretty-simple/issues/99 it is not a design goal of the library that the rendered values be readable using 'read'. This makes it unsuitable for our purposes. pretty-show is a bit slower and it uses 4-space indents (non-configurable), but it doesn't have this serious drawback. --- pandoc.cabal | 3 +- src/Text/Pandoc/Writers/Native.hs | 20 +- test/command/1390.md | 6 +- test/command/1592.md | 50 +- test/command/1608.md | 331 +- test/command/168.md | 64 +- test/command/1718.md | 12 +- test/command/1773.md | 4 +- test/command/1881.md | 241 +- test/command/2118.md | 10 +- test/command/2549.md | 21 +- test/command/256.md | 56 +- test/command/3113.md | 5 +- test/command/3123.md | 4 +- test/command/3236.md | 22 +- test/command/3257.md | 2 +- test/command/3348.md | 109 +- test/command/3401.md | 2 +- test/command/3407.md | 5 +- test/command/3510.md | 21 +- test/command/3511.md | 39 +- test/command/3516.md | 71 +- test/command/3530.md | 94 +- test/command/3533-rst-csv-tables.md | 403 +- test/command/3534.md | 70 +- test/command/3537.md | 4 +- test/command/3539.md | 432 +- test/command/3558.md | 9 +- test/command/3585.md | 41 +- test/command/3587.md | 90 +- test/command/3681.md | 80 +- test/command/3706.md | 144 +- test/command/3708.md | 77 +- test/command/3733.md | 5 +- test/command/3755.md | 52 +- test/command/3779.md | 54 +- test/command/3794.md | 2 +- test/command/3804.md | 3 +- test/command/3853.md | 8 +- test/command/3916.md | 14 +- test/command/3947.md | 5 +- test/command/3958.md | 6 +- test/command/3971.md | 2 +- test/command/3983.md | 8 +- test/command/3989.md | 30 +- test/command/4054.md | 13 +- test/command/4056.md | 70 +- test/command/4063.md | 49 +- test/command/4068.md | 41 +- test/command/4119.md | 90 +- test/command/4134.md | 2 +- test/command/4159.md | 6 +- test/command/4162.md | 2 +- test/command/4183.md | 8 +- test/command/4186.md | 6 +- test/command/4193.md | 4 +- test/command/4199.md | 5 +- test/command/4240.md | 33 +- test/command/4280.md | 2 +- test/command/4281.md | 17 +- test/command/4284.md | 152 +- test/command/4306.md | 23 +- test/command/4374.md | 22 +- test/command/4382.md | 2 +- test/command/4454.md | 4 +- test/command/4499.md | 4 +- test/command/4513.md | 49 +- test/command/4553.md | 11 +- test/command/4579.md | 84 +- test/command/4624.md | 13 +- test/command/4635.md | 12 +- test/command/4669.md | 22 +- test/command/4715.md | 33 +- test/command/4722.md | 53 +- test/command/4742.md | 42 +- test/command/4743.md | 36 +- test/command/4781.md | 28 +- test/command/4811.md | 26 +- test/command/4817.md | 20 +- test/command/4819.md | 18 +- test/command/4832.md | 30 +- test/command/4845.md | 23 +- test/command/4848.md | 40 +- test/command/4860.md | 20 +- test/command/4877.md | 4 +- test/command/4919.md | 6 +- test/command/4928.md | 274 +- test/command/4933.md | 6 +- test/command/5014.md | 58 +- test/command/5079.md | 36 +- test/command/5099.md | 28 +- test/command/5178.md | 22 +- test/command/5182.md | 3 +- test/command/5271.md | 56 +- test/command/5285.md | 19 +- test/command/5321.md | 14 +- test/command/5360.md | 25 +- test/command/5368.md | 41 +- test/command/5540.md | 10 +- test/command/5549.md | 2 +- test/command/5619.md | 50 +- test/command/5686.md | 42 +- test/command/5700.md | 65 +- test/command/5708.md | 53 +- test/command/5711.md | 36 +- test/command/5714.md | 16 +- test/command/5753.md | 7 +- test/command/5795.md | 8 +- test/command/5797.md | 2 +- test/command/5805.md | 2 +- test/command/5845.md | 23 +- test/command/5878.md | 16 +- test/command/6009.md | 18 +- test/command/6026.md | 46 +- test/command/6034.md | 3 +- test/command/6114.md | 10 +- test/command/6137.md | 244 +- test/command/6288.md | 4 +- test/command/6324.md | 17 +- test/command/6699.md | 8 +- test/command/6709.md | 4 +- test/command/6719.md | 4 +- test/command/6791.md | 49 +- test/command/6802.md | 3 +- test/command/6836.md | 50 +- test/command/6869.md | 23 +- test/command/6873.md | 49 +- test/command/6890.md | 183 +- test/command/6993.md | 18 +- test/command/7003.md | 36 +- test/command/7080.md | 12 +- test/command/7092.md | 4 +- test/command/7129.md | 80 +- test/command/7134.md | 58 +- test/command/7145.md | 119 +- test/command/7155.md | 32 +- test/command/7339.md | 7 +- test/command/7400.md | 3 +- test/command/7434.md | 16 +- test/command/7436.md | 34 +- test/command/7557.md | 23 +- test/command/7589.md | 105 +- test/command/934.md | 57 +- test/command/adjacent_latex_blocks.md | 6 +- test/command/cite-in-inline-note.md | 34 +- test/command/citeproc-author-in-text-suffix.md | 46 +- test/command/csv.md | 177 +- test/command/docbook-bibliography.md | 52 +- test/command/dots.md | 5 +- test/command/empty_paragraphs.md | 20 +- test/command/gfm.md | 161 +- test/command/hspace.md | 20 +- test/command/html-read-figure.md | 22 +- test/command/html-trim-definition-list-terms.md | 16 +- test/command/hyphenat.md | 18 +- test/command/ifstrequal.md | 7 +- test/command/indented-fences.md | 6 +- test/command/input-with-endinput.md | 9 +- test/command/latex-center.md | 2 +- test/command/latex-color.md | 124 +- test/command/latex-fontawesome.md | 4 +- test/command/latex-tabular-column-specs.md | 148 +- test/command/lettrine.md | 26 +- test/command/lstlisting.md | 41 +- test/command/macro-defs-in-preamble.md | 11 +- test/command/md-abbrevs.md | 3 +- test/command/multiple-metadata-blocks.md | 8 +- test/command/refs.md | 321 +- test/command/setext-fenced-div.md | 2 +- test/command/shift-heading-level-by.md | 44 +- test/command/sloppypar.md | 408 +- test/command/table-with-cell-align.md | 81 +- test/command/table-with-column-span.md | 325 +- test/command/tabularx.md | 624 +- test/command/translations.md | 2 +- test/command/write18.md | 4 +- test/command/yaml-metadata-blocks.md | 134 +- test/command/yaml-with-chomp.md | 17 +- test/creole-reader.native | 1802 ++-- test/docbook-chapter.native | 320 +- test/docbook-reader.native | 5645 ++++++----- test/docbook-xref.native | 333 +- test/epub/features.native | 3358 +++---- test/epub/formatting.native | 11535 +++++++++++----------- test/epub/wasteland.native | 6946 +++++++------ test/fb2/reader/emphasis.native | 65 +- test/fb2/reader/epigraph.native | 24 +- test/fb2/reader/meta.native | 85 +- test/fb2/reader/notes.native | 44 +- test/fb2/reader/poem.native | 45 +- test/fb2/reader/titles.native | 63 +- test/haddock-reader.native | 777 +- test/html-reader.native | 6217 ++++++------ test/ipynb/simple.out.native | 183 +- test/jats-reader.native | 5389 +++++----- test/jira-reader.native | 1711 ++-- test/latex-reader.native | 4486 ++++----- test/lhs-test-markdown.native | 244 +- test/lhs-test.native | 244 +- test/man-reader.native | 1805 ++-- test/markdown-citations.native | 971 +- test/markdown-reader-more.native | 2353 ++--- test/mediawiki-reader.native | 2613 +++-- test/opml-reader.native | 345 +- test/org-select-tags.native | 196 +- test/pipe-tables.native | 1699 ++-- test/rst-reader.native | 3209 +++--- test/rtf/accent.native | 30 +- test/rtf/bookmark.native | 14 +- test/rtf/footnote.native | 252 +- test/rtf/formatting.native | 88 +- test/rtf/heading.native | 20 +- test/rtf/image.native | 15 +- test/rtf/link.native | 8 +- test/rtf/list_complex.native | 120 +- test/rtf/list_simple.native | 15 +- test/rtf/table_error_codes.native | 783 +- test/rtf/table_simple.native | 133 +- test/rtf/unicode.native | 2 +- test/tables-rstsubset.native | 1824 ++-- test/tables.native | 1795 ++-- test/testsuite.native | 4357 ++++---- test/textile-reader.native | 2345 +++-- test/tikiwiki-reader.native | 1374 +-- test/twiki-reader.native | 1546 ++- test/txt2tags.native | 9873 +++++++++--------- test/vimwiki-reader.native | 4304 ++++---- test/writer.native | 4161 ++++---- 228 files changed, 51712 insertions(+), 53071 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 7003abe2c..f317c3302 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -584,7 +584,8 @@ library unicode-collation >= 0.1.1 && < 0.2, zip-archive >= 0.2.3.4 && < 0.5, zlib >= 0.5 && < 0.7, - pretty-simple >= 4.0 && < 4.1 + pretty-show >= 1.10 && < 1.11, + pretty >= 1.1 && < 1.2 if os(windows) && arch(i386) build-depends: basement >= 0.0.10, foundation >= 0.0.23 diff --git a/src/Text/Pandoc/Writers/Native.hs b/src/Text/Pandoc/Writers/Native.hs index 67af39a31..264b9c498 100644 --- a/src/Text/Pandoc/Writers/Native.hs +++ b/src/Text/Pandoc/Writers/Native.hs @@ -13,23 +13,19 @@ Conversion of a 'Pandoc' document to a string representation. module Text.Pandoc.Writers.Native ( writeNative ) where import Data.Text (Text) -import qualified Data.Text.Lazy as TL +import qualified Data.Text as T import Text.Pandoc.Class.PandocMonad (PandocMonad) import Text.Pandoc.Definition import Text.Pandoc.Options (WriterOptions (..)) -import Text.Pretty.Simple (pShowOpt, defaultOutputOptionsNoColor, - OutputOptions(..), StringOutputStyle(..)) +import Text.Show.Pretty (ppDoc) +import Text.PrettyPrint (renderStyle, Style(..), style, char) -- | Prettyprint Pandoc document. writeNative :: PandocMonad m => WriterOptions -> Pandoc -> m Text writeNative opts (Pandoc meta blocks) = do - let popts = defaultOutputOptionsNoColor{ - outputOptionsIndentAmount = 2, - outputOptionsPageWidth = writerColumns opts, - outputOptionsCompact = True, - outputOptionsCompactParens = False, - outputOptionsStringStyle = Literal } - return $ + let style' = style{ lineLength = writerColumns opts, + ribbonsPerLine = 1.2 } + return $ T.pack $ renderStyle style' $ case writerTemplate opts of - Just _ -> TL.toStrict $ pShowOpt popts (Pandoc meta blocks) <> "\n" - Nothing -> TL.toStrict $ pShowOpt popts blocks + Just _ -> ppDoc (Pandoc meta blocks) <> char '\n' + Nothing -> ppDoc blocks diff --git a/test/command/1390.md b/test/command/1390.md index 1d479dc94..4fea32290 100644 --- a/test/command/1390.md +++ b/test/command/1390.md @@ -4,7 +4,11 @@ Testing: $\mu\foo\eta$. ^D [ Para - [ Str "Testing:", Space, Math InlineMath "\\mu+\\eta", Str "." ] + [ Str "Testing:" + , Space + , Math InlineMath "\\mu+\\eta" + , Str "." + ] ] ``` diff --git a/test/command/1592.md b/test/command/1592.md index 8df5907d4..c3dc933a8 100644 --- a/test/command/1592.md +++ b/test/command/1592.md @@ -51,7 +51,9 @@ % pandoc -f html -t native foo ^D -[ Plain [ Span ( "", [], [ ( "dir", "ltr" ) ] ) [ Str "foo" ] ] ] +[ Plain + [ Span ( "" , [] , [ ( "dir" , "ltr" ) ] ) [ Str "foo" ] ] +] ``` ``` @@ -59,15 +61,13 @@ foobarbaz ^D [ Plain - [ Span - ( "", [], [ ( "dir", "rtl" ) ] ) - [ Str "foo" - , Span - ( "", [], [ ( "dir", "ltr" ) ] ) - [ Str "bar" ] - , Str "baz" + [ Span + ( "" , [] , [ ( "dir" , "rtl" ) ] ) + [ Str "foo" + , Span ( "" , [] , [ ( "dir" , "ltr" ) ] ) [ Str "bar" ] + , Str "baz" + ] ] - ] ] ``` @@ -77,22 +77,22 @@ to left.

^D [ Para - [ Span - ( "", [], [ ( "dir", "rtl" ) ] ) - [ Str "This" - , Space - , Str "text" - , Space - , Str "will" - , Space - , Str "go" - , Space - , Str "right" - , SoftBreak - , Str "to" - , Space - , Str "left." + [ Span + ( "" , [] , [ ( "dir" , "rtl" ) ] ) + [ Str "This" + , Space + , Str "text" + , Space + , Str "will" + , Space + , Str "go" + , Space + , Str "right" + , SoftBreak + , Str "to" + , Space + , Str "left." + ] ] - ] ] ``` diff --git a/test/command/1608.md b/test/command/1608.md index bc77117ac..59bd54ab4 100644 --- a/test/command/1608.md +++ b/test/command/1608.md @@ -29,182 +29,177 @@ These are all pretty interesting facts. \end{remark} ^D [ Div - ( "def:tri", [ "definition" ], [] ) - [ Para - [ Strong - [ Str "Definition", Space, Str "1" ] - , Space - , Str "(right-angled" - , Space - , Str "triangles)." - , Space - , Space - , Str "A" - , Space - , Emph - [ Str "right-angled", Space, Str "triangle" ] - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "triangle" - , Space - , Str "whose" - , Space - , Str "sides" - , Space - , Str "of" - , Space - , Str "length\160" - , Math InlineMath "a" - , Str "," - , Space - , Math InlineMath "b" - , Space - , Str "and\160" - , Math InlineMath "c" - , Str "," - , Space - , Str "in" - , Space - , Str "some" - , Space - , Str "permutation" - , Space - , Str "of" - , Space - , Str "order," - , Space - , Str "satisfies" - , Space - , Math InlineMath "a^2+b^2=c^2" - , Str "." + ( "def:tri" , [ "definition" ] , [] ) + [ Para + [ Strong [ Str "Definition" , Space , Str "1" ] + , Space + , Str "(right-angled" + , Space + , Str "triangles)." + , Space + , Space + , Str "A" + , Space + , Emph [ Str "right-angled" , Space , Str "triangle" ] + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "triangle" + , Space + , Str "whose" + , Space + , Str "sides" + , Space + , Str "of" + , Space + , Str "length\160" + , Math InlineMath "a" + , Str "," + , Space + , Math InlineMath "b" + , Space + , Str "and\160" + , Math InlineMath "c" + , Str "," + , Space + , Str "in" + , Space + , Str "some" + , Space + , Str "permutation" + , Space + , Str "of" + , Space + , Str "order," + , Space + , Str "satisfies" + , Space + , Math InlineMath "a^2+b^2=c^2" + , Str "." + ] ] - ] , Div - ( "", [ "lemma" ], [] ) - [ Para - [ Strong - [ Str "Lemma", Space, Str "2" ] - , Str "." - , Space - , Space - , Emph - [ Str "The" - , Space - , Str "triangle" - , Space - , Str "with" - , Space - , Str "sides" - , Space - , Str "of" - , Space - , Str "length\160" - , Math InlineMath "3" - , Str "," - , Space - , Math InlineMath "4" - , Space - , Str "and\160" - , Math InlineMath "5" - , Space - , Str "is" - , Space - , Str "right-angled." - ] + ( "" , [ "lemma" ] , [] ) + [ Para + [ Strong [ Str "Lemma" , Space , Str "2" ] + , Str "." + , Space + , Space + , Emph + [ Str "The" + , Space + , Str "triangle" + , Space + , Str "with" + , Space + , Str "sides" + , Space + , Str "of" + , Space + , Str "length\160" + , Math InlineMath "3" + , Str "," + , Space + , Math InlineMath "4" + , Space + , Str "and\160" + , Math InlineMath "5" + , Space + , Str "is" + , Space + , Str "right-angled." + ] + ] ] - ] , Div - ( "", [ "proof" ], [] ) - [ Para - [ Emph - [ Str "Proof." ] - , Space - , Str "This" - , Space - , Str "lemma" - , Space - , Str "follows" - , Space - , Str "from" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref" ), ( "reference", "def:tri" ) ] - ) - [ Str "Definition\160\&1" ] - ( "#def:tri", "" ) - , Space - , Str "since" - , Space - , Math InlineMath "3^2+4^2=9+16=25=5^2" - , Str "." - , Str "\160\9723" + ( "" , [ "proof" ] , [] ) + [ Para + [ Emph [ Str "Proof." ] + , Space + , Str "This" + , Space + , Str "lemma" + , Space + , Str "follows" + , Space + , Str "from" + , Space + , Link + ( "" + , [] + , [ ( "reference-type" , "ref" ) + , ( "reference" , "def:tri" ) + ] + ) + [ Str "Definition\160\&1" ] + ( "#def:tri" , "" ) + , Space + , Str "since" + , Space + , Math InlineMath "3^2+4^2=9+16=25=5^2" + , Str "." + , Str "\160\9723" + ] ] - ] , Div - ( "thm:py", [ "theorem" ], [] ) - [ Para - [ Strong - [ Str "Theorem", Space, Str "3" ] - , Space - , Str "(Pythagorean" - , Space - , Str "triplets)." - , Space - , Space - , Emph - [ Str "Triangles" - , Space - , Str "with" - , Space - , Str "sides" - , Space - , Str "of" - , Space - , Str "length" - , Space - , Math InlineMath "a=p^2-q^2" - , Str "," - , Space - , Math InlineMath "b=2pq" - , Space - , Str "and" - , Space - , Math InlineMath "c=p^2+q^2" - , Space - , Str "are" - , Space - , Str "right-angled" - , Space - , Str "triangles." - ] + ( "thm:py" , [ "theorem" ] , [] ) + [ Para + [ Strong [ Str "Theorem" , Space , Str "3" ] + , Space + , Str "(Pythagorean" + , Space + , Str "triplets)." + , Space + , Space + , Emph + [ Str "Triangles" + , Space + , Str "with" + , Space + , Str "sides" + , Space + , Str "of" + , Space + , Str "length" + , Space + , Math InlineMath "a=p^2-q^2" + , Str "," + , Space + , Math InlineMath "b=2pq" + , Space + , Str "and" + , Space + , Math InlineMath "c=p^2+q^2" + , Space + , Str "are" + , Space + , Str "right-angled" + , Space + , Str "triangles." + ] + ] ] - ] , Div - ( "", [ "remark" ], [] ) - [ Para - [ Emph - [ Str "Remark", Space, Str "1" ] - , Str "." - , Space - , Space - , Str "These" - , Space - , Str "are" - , Space - , Str "all" - , Space - , Str "pretty" - , Space - , Str "interesting" - , Space - , Str "facts." + ( "" , [ "remark" ] , [] ) + [ Para + [ Emph [ Str "Remark" , Space , Str "1" ] + , Str "." + , Space + , Space + , Str "These" + , Space + , Str "are" + , Space + , Str "all" + , Space + , Str "pretty" + , Space + , Str "interesting" + , Space + , Str "facts." + ] ] - ] ] ``` diff --git a/test/command/168.md b/test/command/168.md index 02b426089..acd42b97d 100644 --- a/test/command/168.md +++ b/test/command/168.md @@ -12,23 +12,23 @@ nested div ::::::::::::::::::::::::::::::: ^D [ Div - ( "", [ "warning" ], [] ) - [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "warning!" + ( "" , [ "warning" ] , [] ) + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "warning!" + ] + , OrderedList + ( 1 , Decimal , Period ) + [ [ Plain [ Str "list" ] ] , [ Plain [ Str "another" ] ] ] + , Div + ( "myid" , [ "class" ] , [ ( "key" , "val" ) ] ) + [ Para [ Str "nested" , Space , Str "div" ] ] ] - , OrderedList - ( 1, Decimal, Period ) - [ [ Plain [ Str "list" ] ], [ Plain [ Str "another" ] ] ] - , Div - ( "myid", [ "class" ], [ ( "key", "val" ) ] ) - [ Para [ Str "nested", Space, Str "div" ] ] - ] ] ``` @@ -38,7 +38,14 @@ foo ::: bar ^D -[ Para [ Str "foo", SoftBreak, Str ":::", SoftBreak, Str "bar" ] ] +[ Para + [ Str "foo" + , SoftBreak + , Str ":::" + , SoftBreak + , Str "bar" + ] +] ``` ``` @@ -50,18 +57,17 @@ And another. ::::: ^D [ Div - ( "", [ "Warning" ], [] ) - [ Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "paragraph." + ( "" , [ "Warning" ] , [] ) + [ Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph." + ] + , Para [ Str "And" , Space , Str "another." ] ] - , Para - [ Str "And", Space, Str "another." ] - ] ] ``` diff --git a/test/command/1718.md b/test/command/1718.md index 132c5ba6a..c93067869 100644 --- a/test/command/1718.md +++ b/test/command/1718.md @@ -8,10 +8,12 @@ Note[^1]. ^D [WARNING] Note with key '2' defined at line 5 column 1 but not used. [ Para - [ Str "Note" - , Note - [ Para [ Str "the", Space, Str "first", Space, Str "note." ] ] - , Str "." - ] + [ Str "Note" + , Note + [ Para + [ Str "the" , Space , Str "first" , Space , Str "note." ] + ] + , Str "." + ] ] ``` diff --git a/test/command/1773.md b/test/command/1773.md index ee52ac867..c529ec972 100644 --- a/test/command/1773.md +++ b/test/command/1773.md @@ -2,5 +2,7 @@ % pandoc -f latex+raw_tex -t native \noindent hi ^D -[ Para [ RawInline ( Format "latex" ) "\\noindent ", Str "hi" ] ] +[ Para + [ RawInline (Format "latex") "\\noindent " , Str "hi" ] +] ``` diff --git a/test/command/1881.md b/test/command/1881.md index 92d0317ba..7a2468c1b 100644 --- a/test/command/1881.md +++ b/test/command/1881.md @@ -21,86 +21,90 @@ ^D [ Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Demonstration" - , Space - , Str "of" - , Space - , Str "simple" - , Space - , Str "table" - , Space - , Str "syntax." - ] + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ]) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [ "header" ], [] ) - [ Cell - ( "", [], [] ) AlignRight - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignLeft - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [ "header" ] , [] ) + [ Cell + ( "" , [] , [] ) + AlignRight + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignLeft + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [ "odd" ] , [] ) + [ Cell + ( "" , [] , [] ) + AlignRight + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignLeft + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [ "odd" ], [] ) - [ Cell - ( "", [], [] ) AlignRight - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignLeft - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` @@ -116,47 +120,48 @@ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [ "odd" ], [] ) - [ Cell - ( "", [], [] ) AlignRight - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignLeft - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignRight - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [ "odd" ] , [] ) + [ Cell + ( "" , [] , [] ) + AlignRight + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignLeft + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignRight + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/2118.md b/test/command/2118.md index 54eaa2653..8be5c4886 100644 --- a/test/command/2118.md +++ b/test/command/2118.md @@ -8,10 +8,10 @@ \end{figure} ^D [ Para - [ Image - ( "fig:setminus", [], [ ( "width", "80%" ) ] ) - [ Str "Set", Space, Str "subtraction" ] - ( "setminus.png", "fig:" ) - ] + [ Image + ( "fig:setminus" , [] , [ ( "width" , "80%" ) ] ) + [ Str "Set" , Space , Str "subtraction" ] + ( "setminus.png" , "fig:" ) + ] ] ``` diff --git a/test/command/2549.md b/test/command/2549.md index 4f2e4ff88..12b21d0a1 100644 --- a/test/command/2549.md +++ b/test/command/2549.md @@ -4,7 +4,9 @@ \section{A section}\label{foo} } ^D -[ Header 1 ( "foo", [], [] ) [ Str "A", Space, Str "section" ] ] +[ Header + 1 ( "foo" , [] , [] ) [ Str "A" , Space , Str "section" ] +] ``` ``` @@ -14,8 +16,10 @@ } ^D [ Div - ( "bar", [], [] ) - [ Header 1 ( "foo", [], [] ) [ Str "A", Space, Str "section" ] ] + ( "bar" , [] , [] ) + [ Header + 1 ( "foo" , [] , [] ) [ Str "A" , Space , Str "section" ] + ] ] ``` @@ -23,7 +27,12 @@ % pandoc -f latex -t native Bar \hypertarget{foo}{Foo} ^D -[ Para [ Str "Bar", Space, Span ( "foo", [], [] ) [ Str "Foo" ] ] ] +[ Para + [ Str "Bar" + , Space + , Span ( "foo" , [] , [] ) [ Str "Foo" ] + ] +] ``` ``` @@ -34,6 +43,8 @@ bar \end{verbatim} } ^D -[ Div ( "foo", [], [] ) [ CodeBlock ( "", [], [] ) "bar" ] ] +[ Div + ( "foo" , [] , [] ) [ CodeBlock ( "" , [] , [] ) "bar" ] +] ``` diff --git a/test/command/256.md b/test/command/256.md index 81c3dc95b..7e3f34dbd 100644 --- a/test/command/256.md +++ b/test/command/256.md @@ -3,20 +3,20 @@ Foo. bar baz h.k. and e.g. and Mr. Brown. ^D [ Para - [ Str "Foo.\160bar" - , Space - , Str "baz" - , Space - , Str "h.k.\160and" - , Space - , Str "e.g." - , Space - , Str "and" - , Space - , Str "Mr." - , Space - , Str "Brown." - ] + [ Str "Foo.\160bar" + , Space + , Str "baz" + , Space + , Str "h.k.\160and" + , Space + , Str "e.g." + , Space + , Str "and" + , Space + , Str "Mr." + , Space + , Str "Brown." + ] ] ``` ``` @@ -24,19 +24,19 @@ Foo. bar baz h.k. and e.g. and Mr. Brown. Foo. bar baz h.k. and e.g. and Mr. Brown. ^D [ Para - [ Str "Foo." - , Space - , Str "bar" - , Space - , Str "baz" - , Space - , Str "h.k." - , Space - , Str "and" - , Space - , Str "e.g.\160and" - , Space - , Str "Mr.\160Brown." - ] + [ Str "Foo." + , Space + , Str "bar" + , Space + , Str "baz" + , Space + , Str "h.k." + , Space + , Str "and" + , Space + , Str "e.g.\160and" + , Space + , Str "Mr.\160Brown." + ] ] ``` diff --git a/test/command/3113.md b/test/command/3113.md index 034f1542b..7452995b5 100644 --- a/test/command/3113.md +++ b/test/command/3113.md @@ -9,7 +9,10 @@ E&=&F \end{eqnarray} ^D [ Para - [ Math DisplayMath "\\begin{aligned}\nA&=&B,\\\\\nC&=&D,\\\\\n%\\end{eqnarray}\n%\\begin{eqnarray}\nE&=&F\\end{aligned}" ] + [ Math + DisplayMath + "\\begin{aligned}\nA&=&B,\\\\\nC&=&D,\\\\\n%\\end{eqnarray}\n%\\begin{eqnarray}\nE&=&F\\end{aligned}" + ] ] ``` diff --git a/test/command/3123.md b/test/command/3123.md index a420d27c5..14f207e39 100644 --- a/test/command/3123.md +++ b/test/command/3123.md @@ -10,6 +10,8 @@ a ^D [ Para - [ Str "a", RawInline ( Format "html" ) "" ] + [ Str "a" + , RawInline (Format "html") "" + ] ] ``` diff --git a/test/command/3236.md b/test/command/3236.md index 856e5f78c..b9a98f160 100644 --- a/test/command/3236.md +++ b/test/command/3236.md @@ -6,16 +6,16 @@ Magnificent \mycolor{} header. ^D [ Para - [ Image - ( "", [], [ ( "width", "17cm" ) ] ) - [ Str "image" ] - ( "red/header", "" ) - , SoftBreak - , Str "Magnificent" - , Space - , Str "red" - , Space - , Str "header." - ] + [ Image + ( "" , [] , [ ( "width" , "17cm" ) ] ) + [ Str "image" ] + ( "red/header" , "" ) + , SoftBreak + , Str "Magnificent" + , Space + , Str "red" + , Space + , Str "header." + ] ] ``` diff --git a/test/command/3257.md b/test/command/3257.md index 5faabadf8..ef2419481 100644 --- a/test/command/3257.md +++ b/test/command/3257.md @@ -9,5 +9,5 @@ % pandoc -t native ik ^D -[ Para [ Str "ik" ] ] +[ Para [ Str "ik" ] ] ``` diff --git a/test/command/3348.md b/test/command/3348.md index 6f9e18bed..964136086 100644 --- a/test/command/3348.md +++ b/test/command/3348.md @@ -8,60 +8,63 @@ ----- ------------------------------------------------ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidth 8.333333333333333 e- 2 ) - , - ( AlignLeft, ColWidth 0.6805555555555556 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "foo" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "bar" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "foo" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "long" - , SoftBreak - , Str "line" - , Space - , Str "of" - , Space - , Str "text" - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidth 8.333333333333333e-2 ) + , ( AlignLeft , ColWidth 0.6805555555555556 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "foo" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "bar" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "foo" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "long" + , SoftBreak + , Str "line" + , Space + , Str "of" + , Space + , Str "text" + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/3401.md b/test/command/3401.md index 0f1e5f18f..3b16e84a4 100644 --- a/test/command/3401.md +++ b/test/command/3401.md @@ -5,7 +5,7 @@ See #3401 and #+MACRO: HELLO /Hello, $1/ {{{HELLO(World)}}} ^D -[ Para [ Emph [ Str "Hello,", Space, Str "World" ] ] ] +[ Para [ Emph [ Str "Hello," , Space , Str "World" ] ] ] ``` Inverted argument order diff --git a/test/command/3407.md b/test/command/3407.md index 551cefd1d..edc1bcb2b 100644 --- a/test/command/3407.md +++ b/test/command/3407.md @@ -10,6 +10,9 @@ :foo:`text` ^D [ Para - [ Code ( "", [ "interpreted-text" ], [ ( "role", "foo" ) ] ) "text" ] + [ Code + ( "" , [ "interpreted-text" ] , [ ( "role" , "foo" ) ] ) + "text" + ] ] ``` diff --git a/test/command/3510.md b/test/command/3510.md index ce4d59e79..48522f7e1 100644 --- a/test/command/3510.md +++ b/test/command/3510.md @@ -10,20 +10,13 @@ Text More text ^D -[ Para - [ Str "Text" ] -, Header 1 - ( "subsection", [], [] ) - [ Str "Subsection" ] -, Para - [ Str "Included", Space, Str "text" ] -, Plain - [ Str "Lorem", Space, Str "ipsum." ] +[ Para [ Str "Text" ] +, Header 1 ( "subsection" , [] , [] ) [ Str "Subsection" ] +, Para [ Str "Included" , Space , Str "text" ] +, Plain [ Str "Lorem" , Space , Str "ipsum." ] , CodeBlock - ( "", [ "haskell" ], [] ) "putStrLn outString\n" -, RawBlock - ( Format "latex" ) "\\emph{Hello}" -, Para - [ Str "More", Space, Str "text" ] + ( "" , [ "haskell" ] , [] ) "putStrLn outString\n" +, RawBlock (Format "latex") "\\emph{Hello}" +, Para [ Str "More" , Space , Str "text" ] ] ``` diff --git a/test/command/3511.md b/test/command/3511.md index 18a5f1641..0fede7a0e 100644 --- a/test/command/3511.md +++ b/test/command/3511.md @@ -11,20 +11,18 @@ not continuation ^D [ BulletList - [ - [ Plain - [ Str "a" ] - , BulletList - [ [ Plain [ Str "b" ], BulletList [ [ Plain [ Str "c" ] ] ] ] ] + [ [ Plain [ Str "a" ] + , BulletList + [ [ Plain [ Str "b" ] + , BulletList [ [ Plain [ Str "c" ] ] ] + ] + ] + ] + , [ CodeBlock ( "" , [] , [] ) "code" ] ] - , - [ CodeBlock ( "", [], [] ) "code" ] - ] , OrderedList - ( 1000, Decimal, Period ) - [ [ Plain [ Str "one" ] ] ] -, CodeBlock - ( "", [], [] ) "not continuation" + ( 1000 , Decimal , Period ) [ [ Plain [ Str "one" ] ] ] +, CodeBlock ( "" , [] , [] ) "not continuation" ] ``` @@ -41,15 +39,14 @@ continuation ^D [ BulletList - [ - [ Plain [ Str "a" ] ] - , - [ Plain [ Str "b" ], BulletList [ [ Plain [ Str "c" ] ] ] ] - , - [ CodeBlock ( "", [], [] ) "not code" ] - ] + [ [ Plain [ Str "a" ] ] + , [ Plain [ Str "b" ] + , BulletList [ [ Plain [ Str "c" ] ] ] + ] + , [ CodeBlock ( "" , [] , [] ) "not code" ] + ] , OrderedList - ( 1000, Decimal, Period ) - [ [ Para [ Str "one" ], Para [ Str "continuation" ] ] ] + ( 1000 , Decimal , Period ) + [ [ Para [ Str "one" ] , Para [ Str "continuation" ] ] ] ] ``` diff --git a/test/command/3516.md b/test/command/3516.md index 83e4cee95..615befb3e 100644 --- a/test/command/3516.md +++ b/test/command/3516.md @@ -25,44 +25,41 @@ on Windows builds. +---+---+ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 5.555555555555555 e- 2 ) - , - ( AlignDefault, ColWidth 5.555555555555555 e- 2 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 5.555555555555555e-2 ) + , ( AlignDefault , ColWidth 5.555555555555555e-2 ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + , Cell + ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/3530.md b/test/command/3530.md index 525c691f8..168cb7067 100644 --- a/test/command/3530.md +++ b/test/command/3530.md @@ -3,52 +3,54 @@ \subfile{command/sub-file-chapter-1} \subfile{command/sub-file-chapter-2} ^D -[ Header 1 - ( "chapter-1", [], [] ) - [ Str "Chapter", Space, Str "1" ] +[ Header + 1 + ( "chapter-1" , [] , [] ) + [ Str "Chapter" , Space , Str "1" ] , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "Chapter" - , Space - , Str "1," - , Space - , Str "provided" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "sub" - , Space - , Str "file." - ] -, Header 1 - ( "chapter-2", [], [] ) - [ Str "Chapter", Space, Str "2" ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "Chapter" + , Space + , Str "1," + , Space + , Str "provided" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "sub" + , Space + , Str "file." + ] +, Header + 1 + ( "chapter-2" , [] , [] ) + [ Str "Chapter" , Space , Str "2" ] , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "Chapter" - , Space - , Str "2," - , Space - , Str "provided" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "second" - , Space - , Str "sub" - , Space - , Str "file." - ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "Chapter" + , Space + , Str "2," + , Space + , Str "provided" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "second" + , Space + , Str "sub" + , Space + , Str "file." + ] ] ``` @@ -58,8 +60,8 @@ \subfile{command/sub-file-chapter-2} ^D [ RawBlock - ( Format "latex" ) "\\subfile{command/sub-file-chapter-1}" + (Format "latex") "\\subfile{command/sub-file-chapter-1}" , RawBlock - ( Format "latex" ) "\\subfile{command/sub-file-chapter-2}" + (Format "latex") "\\subfile{command/sub-file-chapter-2}" ] ``` diff --git a/test/command/3533-rst-csv-tables.md b/test/command/3533-rst-csv-tables.md index 471bd827e..ed69ca860 100644 --- a/test/command/3533-rst-csv-tables.md +++ b/test/command/3533-rst-csv-tables.md @@ -6,106 +6,119 @@ :file: command/3533-rst-csv-tables.csv ^D [ Table - ( "", [], [] ) - ( Caption Nothing [ Plain [ Str "Test" ] ] ) - [ - ( AlignDefault, ColWidth 0.4 ) - , - ( AlignDefault, ColWidth 0.2 ) - , - ( AlignDefault, ColWidth 0.4 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Flavor" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Price" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Slogan" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing [ Plain [ Str "Test" ] ]) + [ ( AlignDefault , ColWidth 0.4 ) + , ( AlignDefault , ColWidth 0.2 ) + , ( AlignDefault , ColWidth 0.4 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Albatross" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2.99" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "On", Space, Str "a", Space, Str "stick!" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Crunchy", Space, Str "Frog" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1.49" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "If" - , Space - , Str "we" - , Space - , Str "took" - , Space - , Str "the" - , Space - , Str "bones" - , Space - , Str "out," - , Space - , Str "it" - , Space - , Str "wouldn't" - , Space - , Str "be" - , SoftBreak - , Str "crunchy," - , Space - , Str "now" - , Space - , Str "would" - , Space - , Str "it?" - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Flavor" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Price" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Slogan" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Albatross" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2.99" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "On" + , Space + , Str "a" + , Space + , Str "stick!" + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Crunchy" , Space , Str "Frog" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1.49" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "If" + , Space + , Str "we" + , Space + , Str "took" + , Space + , Str "the" + , Space + , Str "bones" + , Space + , Str "out," + , Space + , Str "it" + , Space + , Str "wouldn't" + , Space + , Str "be" + , SoftBreak + , Str "crunchy," + , Space + , Str "now" + , Space + , Str "would" + , Space + , Str "it?" + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` @@ -121,78 +134,81 @@ 'dog''s' 2 3 ^D [ Table - ( "", [], [] ) - ( Caption Nothing [ Plain [ Str "Test" ] ] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "a" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing [ Plain [ Str "Test" ] ]) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "cat's" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "dog's" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "a" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "cat's" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "dog's" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` @@ -204,33 +220,34 @@ "1","\"" ^D [ Table - ( "", [], [] ) - ( Caption Nothing [ Plain [ Str "Test" ] ] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\"" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing [ Plain [ Str "Test" ] ]) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\"" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/3534.md b/test/command/3534.md index 1be10cf62..8692007d2 100644 --- a/test/command/3534.md +++ b/test/command/3534.md @@ -19,24 +19,23 @@ I want to explain the interface of \lstinline{public class MyClass}. I want to explain the interface of \lstinline[language=Java]{public class MyClass}. ^D [ Para - [ Str "I" - , Space - , Str "want" - , Space - , Str "to" - , Space - , Str "explain" - , Space - , Str "the" - , Space - , Str "interface" - , Space - , Str "of" - , Space - , Code - ( "", [ "java" ], [] ) "public class MyClass" - , Str "." - ] + [ Str "I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "explain" + , Space + , Str "the" + , Space + , Str "interface" + , Space + , Str "of" + , Space + , Code ( "" , [ "java" ] , [] ) "public class MyClass" + , Str "." + ] ] ``` @@ -61,23 +60,22 @@ I want to explain the interface of \mintinline{java}|public class MyClass|. I want to explain the interface of \mintinline[linenos]{java}{public class MyClass}. ^D [ Para - [ Str "I" - , Space - , Str "want" - , Space - , Str "to" - , Space - , Str "explain" - , Space - , Str "the" - , Space - , Str "interface" - , Space - , Str "of" - , Space - , Code - ( "", [ "java" ], [] ) "public class MyClass" - , Str "." - ] + [ Str "I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "explain" + , Space + , Str "the" + , Space + , Str "interface" + , Space + , Str "of" + , Space + , Code ( "" , [ "java" ] , [] ) "public class MyClass" + , Str "." + ] ] ``` diff --git a/test/command/3537.md b/test/command/3537.md index 934e35836..98704c930 100644 --- a/test/command/3537.md +++ b/test/command/3537.md @@ -7,7 +7,7 @@ Generalized raw attributes. foo bar ``` ^D -[ RawBlock ( Format "ms" ) ".MACRO\nfoo bar" ] +[ RawBlock (Format "ms") ".MACRO\nfoo bar" ] ```` ```` @@ -24,5 +24,5 @@ Hi `there`{=ms}. foo bar ~~~ ^D -[ RawBlock ( Format "ms" ) ".MACRO\nfoo bar" ] +[ RawBlock (Format "ms") ".MACRO\nfoo bar" ] ```` diff --git a/test/command/3539.md b/test/command/3539.md index 464df7c91..b2ce5455f 100644 --- a/test/command/3539.md +++ b/test/command/3539.md @@ -5,45 +5,43 @@ Many programming languages provide \glspl{API}. Each \gls{API} should provide a documentation. ^D [ Para - [ Str "Many" - , Space - , Str "programming" - , Space - , Str "languages" - , Space - , Str "provide" - , Space - , Span - ( "" - , [] - , - [ ( "acronym-label", "API" ), ( "acronym-form", "plural+short" ) ] - ) - [ Str "APIs" ] - , Str "." - , Space - , Str "Each" - , Space - , Span - ( "" - , [] - , - [ - ( "acronym-label", "API" ) - , - ( "acronym-form", "singular+short" ) - ] - ) - [ Str "API" ] - , Space - , Str "should" - , Space - , Str "provide" - , Space - , Str "a" - , Space - , Str "documentation." - ] + [ Str "Many" + , Space + , Str "programming" + , Space + , Str "languages" + , Space + , Str "provide" + , Space + , Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "plural+short" ) + ] + ) + [ Str "APIs" ] + , Str "." + , Space + , Str "Each" + , Space + , Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "singular+short" ) + ] + ) + [ Str "API" ] + , Space + , Str "should" + , Space + , Str "provide" + , Space + , Str "a" + , Space + , Str "documentation." + ] ] ``` @@ -52,44 +50,38 @@ Many programming languages provide \glspl{API}. Each \gls{API} should provide a \Glsdesc{API} XYZ ist not as performant as \glsdesc{API} ZXY. ^D [ Para - [ Span - ( "" - , [] - , - [ - ( "acronym-label", "API" ) - , - ( "acronym-form", "singular+long" ) - ] - ) - [ Str "API" ] - , Space - , Str "XYZ" - , Space - , Str "ist" - , Space - , Str "not" - , Space - , Str "as" - , Space - , Str "performant" - , Space - , Str "as" - , Space - , Span - ( "" - , [] - , - [ - ( "acronym-label", "API" ) - , - ( "acronym-form", "singular+long" ) - ] - ) - [ Str "API" ] - , Space - , Str "ZXY." - ] + [ Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "singular+long" ) + ] + ) + [ Str "API" ] + , Space + , Str "XYZ" + , Space + , Str "ist" + , Space + , Str "not" + , Space + , Str "as" + , Space + , Str "performant" + , Space + , Str "as" + , Space + , Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "singular+long" ) + ] + ) + [ Str "API" ] + , Space + , Str "ZXY." + ] ] ``` @@ -98,44 +90,38 @@ Many programming languages provide \glspl{API}. Each \gls{API} should provide a \Acrlong{API} XYZ ist not as performant as \acrlong{API} ZXY. ^D [ Para - [ Span - ( "" - , [] - , - [ - ( "acronym-label", "API" ) - , - ( "acronym-form", "singular+long" ) - ] - ) - [ Str "API" ] - , Space - , Str "XYZ" - , Space - , Str "ist" - , Space - , Str "not" - , Space - , Str "as" - , Space - , Str "performant" - , Space - , Str "as" - , Space - , Span - ( "" - , [] - , - [ - ( "acronym-label", "API" ) - , - ( "acronym-form", "singular+long" ) - ] - ) - [ Str "API" ] - , Space - , Str "ZXY." - ] + [ Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "singular+long" ) + ] + ) + [ Str "API" ] + , Space + , Str "XYZ" + , Space + , Str "ist" + , Space + , Str "not" + , Space + , Str "as" + , Space + , Str "performant" + , Space + , Str "as" + , Space + , Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "singular+long" ) + ] + ) + [ Str "API" ] + , Space + , Str "ZXY." + ] ] ``` @@ -144,44 +130,38 @@ Many programming languages provide \glspl{API}. Each \gls{API} should provide a \Acrfull{API} XYZ ist not as performant as \acrfull{API} ZXY. ^D [ Para - [ Span - ( "" - , [] - , - [ - ( "acronym-label", "API" ) - , - ( "acronym-form", "singular+full" ) - ] - ) - [ Str "API" ] - , Space - , Str "XYZ" - , Space - , Str "ist" - , Space - , Str "not" - , Space - , Str "as" - , Space - , Str "performant" - , Space - , Str "as" - , Space - , Span - ( "" - , [] - , - [ - ( "acronym-label", "API" ) - , - ( "acronym-form", "singular+full" ) - ] - ) - [ Str "API" ] - , Space - , Str "ZXY." - ] + [ Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "singular+full" ) + ] + ) + [ Str "API" ] + , Space + , Str "XYZ" + , Space + , Str "ist" + , Space + , Str "not" + , Space + , Str "as" + , Space + , Str "performant" + , Space + , Str "as" + , Space + , Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "singular+full" ) + ] + ) + [ Str "API" ] + , Space + , Str "ZXY." + ] ] ``` @@ -190,44 +170,38 @@ Many programming languages provide \glspl{API}. Each \gls{API} should provide a \Acrshort{API} XYZ ist not as performant as \acrshort{API} ZXY. ^D [ Para - [ Span - ( "" - , [] - , - [ - ( "acronym-label", "API" ) - , - ( "acronym-form", "singular+abbrv" ) - ] - ) - [ Str "API" ] - , Space - , Str "XYZ" - , Space - , Str "ist" - , Space - , Str "not" - , Space - , Str "as" - , Space - , Str "performant" - , Space - , Str "as" - , Space - , Span - ( "" - , [] - , - [ - ( "acronym-label", "API" ) - , - ( "acronym-form", "singular+abbrv" ) - ] - ) - [ Str "API" ] - , Space - , Str "ZXY." - ] + [ Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "singular+abbrv" ) + ] + ) + [ Str "API" ] + , Space + , Str "XYZ" + , Space + , Str "ist" + , Space + , Str "not" + , Space + , Str "as" + , Space + , Str "performant" + , Space + , Str "as" + , Space + , Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "singular+abbrv" ) + ] + ) + [ Str "API" ] + , Space + , Str "ZXY." + ] ] ``` @@ -238,44 +212,42 @@ Many programming languages provide \glspl{API}. Each \gls{API} should provide a Many programming languages provide \acp{API}. Each \ac{API} should provide a documentation. ^D [ Para - [ Str "Many" - , Space - , Str "programming" - , Space - , Str "languages" - , Space - , Str "provide" - , Space - , Span - ( "" - , [] - , - [ ( "acronym-label", "API" ), ( "acronym-form", "plural+short" ) ] - ) - [ Str "APIs" ] - , Str "." - , Space - , Str "Each" - , Space - , Span - ( "" - , [] - , - [ - ( "acronym-label", "API" ) - , - ( "acronym-form", "singular+short" ) - ] - ) - [ Str "API" ] - , Space - , Str "should" - , Space - , Str "provide" - , Space - , Str "a" - , Space - , Str "documentation." - ] + [ Str "Many" + , Space + , Str "programming" + , Space + , Str "languages" + , Space + , Str "provide" + , Space + , Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "plural+short" ) + ] + ) + [ Str "APIs" ] + , Str "." + , Space + , Str "Each" + , Space + , Span + ( "" + , [] + , [ ( "acronym-label" , "API" ) + , ( "acronym-form" , "singular+short" ) + ] + ) + [ Str "API" ] + , Space + , Str "should" + , Space + , Str "provide" + , Space + , Str "a" + , Space + , Str "documentation." + ] ] ``` diff --git a/test/command/3558.md b/test/command/3558.md index 0da806b1f..c9c782c16 100644 --- a/test/command/3558.md +++ b/test/command/3558.md @@ -6,11 +6,8 @@ hello \endmulti ^D -[ RawBlock - ( Format "tex" ) "\\multi" -, Para - [ Str "hello" ] -, RawBlock - ( Format "tex" ) "\\endmulti" +[ RawBlock (Format "tex") "\\multi" +, Para [ Str "hello" ] +, RawBlock (Format "tex") "\\endmulti" ] ``` diff --git a/test/command/3585.md b/test/command/3585.md index 2cda46993..3f014db94 100644 --- a/test/command/3585.md +++ b/test/command/3585.md @@ -4,29 +4,26 @@ Same but bzip2 it and nice it zfs send tank/storage/data/svn@daily-2014-03-20_00.00.00--2w | nice -15 bzip2 | ssh user@hyper.somewhere.org "> /storage/c-3po/tank-storage-data-svn.dmp.bz2" ^D -[ Para - [ Quoted DoubleQuote [ Str "Hello" ] ] +[ Para [ Quoted DoubleQuote [ Str "Hello" ] ] , Para - [ Str "Same" - , Space - , Str "but" - , Space - , Str "bzip2" - , Space - , Str "it" - , Space - , Str "and" - , Space - , Str "nice" - , Space - , Str "it" - , Space - , Code - ( "" - , [] - , [] - ) "zfs send tank/storage/data/svn@daily-2014-03-20_00.00.00--2w | nice -15 bzip2 | ssh user@hyper.somewhere.org \"> /storage/c-3po/tank-storage-data-svn.dmp.bz2\"" - ] + [ Str "Same" + , Space + , Str "but" + , Space + , Str "bzip2" + , Space + , Str "it" + , Space + , Str "and" + , Space + , Str "nice" + , Space + , Str "it" + , Space + , Code + ( "" , [] , [] ) + "zfs send tank/storage/data/svn@daily-2014-03-20_00.00.00--2w | nice -15 bzip2 | ssh user@hyper.somewhere.org \"> /storage/c-3po/tank-storage-data-svn.dmp.bz2\"" + ] ] ``` diff --git a/test/command/3587.md b/test/command/3587.md index 402ad7d9f..88f009900 100644 --- a/test/command/3587.md +++ b/test/command/3587.md @@ -3,16 +3,16 @@ \SI[round-precision=2]{1}{m} is equal to \SI{1000}{mm} ^D [ Para - [ Str "1\160m" - , Space - , Str "is" - , Space - , Str "equal" - , Space - , Str "to" - , Space - , Str "1000\160mm" - ] + [ Str "1\160m" + , Space + , Str "is" + , Space + , Str "equal" + , Space + , Str "to" + , Space + , Str "1000\160mm" + ] ] ``` @@ -21,16 +21,16 @@ \SI[round-precision=2]{1}[\$]{} is equal to \SI{0.938094}{\euro} ^D [ Para - [ Str "$\160\&1" - , Space - , Str "is" - , Space - , Str "equal" - , Space - , Str "to" - , Space - , Str "0.938094\160\8364" - ] + [ Str "$\160\&1" + , Space + , Str "is" + , Space + , Str "equal" + , Space + , Str "to" + , Space + , Str "0.938094\160\8364" + ] ] ``` @@ -53,7 +53,7 @@ % pandoc -f latex -t native \SI{25}{\square\meter} ^D -[ Para [ Str "25\160m", Superscript [ Str "2" ] ] ] +[ Para [ Str "25\160m" , Superscript [ Str "2" ] ] ] ``` ``` @@ -109,13 +109,11 @@ \SIrange{10}{20}{\square\meter} ^D [ Para - [ Str "10\160m" - , Superscript - [ Str "2" ] - , Str "\8211\&20\160m" - , Superscript - [ Str "2" ] - ] + [ Str "10\160m" + , Superscript [ Str "2" ] + , Str "\8211\&20\160m" + , Superscript [ Str "2" ] + ] ] ``` @@ -139,13 +137,11 @@ \SIrange{10}{20}{\raisetothe{4}\meter} ^D [ Para - [ Str "10\160m" - , Superscript - [ Str "4" ] - , Str "\8211\&20\160m" - , Superscript - [ Str "4" ] - ] + [ Str "10\160m" + , Superscript [ Str "4" ] + , Str "\8211\&20\160m" + , Superscript [ Str "4" ] + ] ] ``` @@ -155,13 +151,11 @@ \SIrange{10}{20}{\meter\squared} ^D [ Para - [ Str "10\160m" - , Superscript - [ Str "2" ] - , Str "\8211\&20\160m" - , Superscript - [ Str "2" ] - ] + [ Str "10\160m" + , Superscript [ Str "2" ] + , Str "\8211\&20\160m" + , Superscript [ Str "2" ] + ] ] ``` @@ -185,13 +179,11 @@ \SIrange{10}{20}{\meter\tothe{4}} ^D [ Para - [ Str "10\160m" - , Superscript - [ Str "4" ] - , Str "\8211\&20\160m" - , Superscript - [ Str "4" ] - ] + [ Str "10\160m" + , Superscript [ Str "4" ] + , Str "\8211\&20\160m" + , Superscript [ Str "4" ] + ] ] ``` diff --git a/test/command/3681.md b/test/command/3681.md index e374f1c35..3e6c71a47 100644 --- a/test/command/3681.md +++ b/test/command/3681.md @@ -5,32 +5,32 @@ Software developers create \cicd pipelines to… Following issue can be resolved by \cicd: ^D [ Para - [ Str "Software" - , Space - , Str "developers" - , Space - , Str "create" - , Space - , Str "CI/CD" - , Space - , Str "pipelines" - , Space - , Str "to\8230" - , Space - , Str "Following" - , Space - , Str "issue" - , Space - , Str "can" - , Space - , Str "be" - , Space - , Str "resolved" - , Space - , Str "by" - , Space - , Str "CI/CD:" - ] + [ Str "Software" + , Space + , Str "developers" + , Space + , Str "create" + , Space + , Str "CI/CD" + , Space + , Str "pipelines" + , Space + , Str "to\8230" + , Space + , Str "Following" + , Space + , Str "issue" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "resolved" + , Space + , Str "by" + , Space + , Str "CI/CD:" + ] ] ``` @@ -41,20 +41,20 @@ Software developers create \cicd pipelines to… Following issue can be resolved \cicd\footnote{\url{https://en.wikipedia.org/wiki/CI/CD}} is awesome. ^D [ Para - [ Str "CI/CD" - , Note - [ Para - [ Link - ( "", [], [] ) - [ Str "https://en.wikipedia.org/wiki/CI/CD" ] - ( "https://en.wikipedia.org/wiki/CI/CD", "" ) - ] + [ Str "CI/CD" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "https://en.wikipedia.org/wiki/CI/CD" ] + ( "https://en.wikipedia.org/wiki/CI/CD" , "" ) + ] + ] + , Space + , Str "is" + , Space + , Str "awesome." ] - , Space - , Str "is" - , Space - , Str "awesome." - ] ] ``` @@ -65,5 +65,5 @@ Software developers create \cicd pipelines to… Following issue can be resolved \cicd\pipeline. ^D -[ Para [ Str "CI/CD", Space, Str "pipeline." ] ] +[ Para [ Str "CI/CD" , Space , Str "pipeline." ] ] ``` diff --git a/test/command/3706.md b/test/command/3706.md index 52e1eacbf..fcd95dfdd 100644 --- a/test/command/3706.md +++ b/test/command/3706.md @@ -16,78 +16,84 @@ Results marker can be hidden in block attributes (#3706) | 3 | La | ^D [ Div - ( "tab", [], [] ) - [ Table - ( "", [], [] ) - ( Caption Nothing [ Plain [ Str "Lalelu." ] ] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Id" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Desc" ] ] - ] - ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "La" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "La" ] ] + ( "tab" , [] , [] ) + [ Table + ( "" , [] , [] ) + (Caption Nothing [ Plain [ Str "Lalelu." ] ]) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "La" ] ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Id" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Desc" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "La" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "La" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "La" ] ] + ] + ] ] - ] + (TableFoot ( "" , [] , [] ) []) ] - ( TableFoot ( "", [], [] ) [] ) - ] ] ``` diff --git a/test/command/3708.md b/test/command/3708.md index 435d6940c..e456617de 100644 --- a/test/command/3708.md +++ b/test/command/3708.md @@ -6,41 +6,48 @@ \end{tabular} ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignCenter, ColWidthDefault ), ( AlignCenter, ColWidthDefault ) ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "A" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "B&1" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "C" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "D" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "A" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "B&1" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "C" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "D" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/3733.md b/test/command/3733.md index 90cdcff6c..0b24d0c1b 100644 --- a/test/command/3733.md +++ b/test/command/3733.md @@ -7,8 +7,7 @@ some: code ``` ^D [ BulletList - [ [ Plain [ Str "Item1" ] ], [ Plain [ Str "Item2" ] ] ] -, CodeBlock - ( "", [ "yaml" ], [] ) "some: code" + [ [ Plain [ Str "Item1" ] ] , [ Plain [ Str "Item2" ] ] ] +, CodeBlock ( "" , [ "yaml" ] , [] ) "some: code" ] ```` diff --git a/test/command/3755.md b/test/command/3755.md index b9f38d441..e89eaec35 100644 --- a/test/command/3755.md +++ b/test/command/3755.md @@ -6,18 +6,17 @@ date: '22. Juni 2017' --- ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "date" - , MetaInlines - [ Str "22.", Space, Str "Juni", Space, Str "2017" ] - ) - , - ( "title", MetaInlines [ Str "Titel" ] ) - ] + Meta + { unMeta = + fromList + [ ( "date" + , MetaInlines + [ Str "22." , Space , Str "Juni" , Space , Str "2017" ] + ) + , ( "title" , MetaInlines [ Str "Titel" ] ) + ] } - ) [] + [] ``` ``` @@ -29,23 +28,22 @@ date: | --- ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "date" - , MetaBlocks - [ OrderedList - ( 22, Decimal, Period ) - [ [ Plain [ Str "Juni", Space, Str "2017" ] ] ] + Meta + { unMeta = + fromList + [ ( "date" + , MetaBlocks + [ OrderedList + ( 22 , Decimal , Period ) + [ [ Plain [ Str "Juni" , Space , Str "2017" ] ] ] + ] + ) + , ( "title" + , MetaBlocks + [ Div ( "" , [] , [] ) [ Plain [ Str "foo" ] ] ] + ) ] - ) - , - ( "title" - , MetaBlocks - [ Div ( "", [], [] ) [ Plain [ Str "foo" ] ] ] - ) - ] } - ) [] + [] ``` diff --git a/test/command/3779.md b/test/command/3779.md index 45c91a92c..04111c2a6 100644 --- a/test/command/3779.md +++ b/test/command/3779.md @@ -21,39 +21,37 @@ } ^D [ BulletList - [ - [ Para - [ Str "Pandoc" - , Space - , Str "is" - , Space - , Str "100%" - , Space - , Str "awesome." + [ [ Para + [ Str "Pandoc" + , Space + , Str "is" + , Space + , Str "100%" + , Space + , Str "awesome." + ] ] ] - ] , BulletList - [ - [ Para - [ Str "Pandoc" - , Space - , Str "is" - , Space - , Str "200%" - , Space - , Str "awesome." + [ [ Para + [ Str "Pandoc" + , Space + , Str "is" + , Space + , Str "200%" + , Space + , Str "awesome." + ] ] ] - ] , Para - [ Str "Pandoc" - , Space - , Str "is" - , Space - , Str "300%" - , Space - , Str "awesome." - ] + [ Str "Pandoc" + , Space + , Str "is" + , Space + , Str "300%" + , Space + , Str "awesome." + ] ] ``` diff --git a/test/command/3794.md b/test/command/3794.md index 571fb848d..974b7dbe4 100644 --- a/test/command/3794.md +++ b/test/command/3794.md @@ -2,5 +2,5 @@ % pandoc -f html -t native

hello

^D -[ Div ( "", [], [] ) [ Para [ Str "hello" ] ] ] +[ Div ( "" , [] , [] ) [ Para [ Str "hello" ] ] ] ``` diff --git a/test/command/3804.md b/test/command/3804.md index b80b1ce5a..6637b23c7 100644 --- a/test/command/3804.md +++ b/test/command/3804.md @@ -3,6 +3,7 @@ \titleformat{\chapter}[display]{\normalfont\large\bfseries}{第\thechapter{}章}{20pt}{\Huge} ^D [ RawBlock - ( Format "tex" ) "\\titleformat{\\chapter}[display]{\\normalfont\\large\\bfseries}{\31532\\thechapter{}\31456}{20pt}{\\Huge}" + (Format "tex") + "\\titleformat{\\chapter}[display]{\\normalfont\\large\\bfseries}{\31532\\thechapter{}\31456}{20pt}{\\Huge}" ] ``` diff --git a/test/command/3853.md b/test/command/3853.md index 6b8be15c5..caf21ed54 100644 --- a/test/command/3853.md +++ b/test/command/3853.md @@ -20,11 +20,9 @@ more hello \iftoggle{ebook}{ebook}{noebook} ^D -[ Para - [ Str "ebook", SoftBreak, Str "more" ] +[ Para [ Str "ebook" , SoftBreak , Str "more" ] , Para - [ Str "not", Space, Str "ebook", SoftBreak, Str "more" ] -, Para - [ Str "hello", Space, Str "noebook" ] + [ Str "not" , Space , Str "ebook" , SoftBreak , Str "more" ] +, Para [ Str "hello" , Space , Str "noebook" ] ] ``` diff --git a/test/command/3916.md b/test/command/3916.md index 47cd72861..8775ae7f6 100644 --- a/test/command/3916.md +++ b/test/command/3916.md @@ -5,15 +5,11 @@ # more ^D [ OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "text", Space, Str "text" ] - , CodeBlock - ( "", [], [] ) "blabla" + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "text" , Space , Str "text" ] + , CodeBlock ( "" , [] , [] ) "blabla" + ] + , [ Plain [ Str "more" ] ] ] - , - [ Plain [ Str "more" ] ] - ] ] ``` diff --git a/test/command/3947.md b/test/command/3947.md index 095b26767..68118a9da 100644 --- a/test/command/3947.md +++ b/test/command/3947.md @@ -6,9 +6,8 @@ Another Code block ^D -[ RawBlock - ( Format "tex" ) "\\newpage" +[ RawBlock (Format "tex") "\\newpage" , CodeBlock - ( "", [], [] ) "Code block\n\nAnother Code block" + ( "" , [] , [] ) "Code block\n\nAnother Code block" ] ``` diff --git a/test/command/3958.md b/test/command/3958.md index cf93d0f74..eccf632c4 100644 --- a/test/command/3958.md +++ b/test/command/3958.md @@ -2,19 +2,19 @@ % pandoc -f latex -t native \texttt{"hi"} ^D -[ Para [ Code ( "", [], [] ) "\"hi\"" ] ] +[ Para [ Code ( "" , [] , [] ) "\"hi\"" ] ] ``` ``` % pandoc -f latex -t native \texttt{``hi''} ^D -[ Para [ Code ( "", [], [] ) "\8220hi\8221" ] ] +[ Para [ Code ( "" , [] , [] ) "\8220hi\8221" ] ] ``` ``` % pandoc -f latex -t native \texttt{`hi'} ^D -[ Para [ Code ( "", [], [] ) "\8216hi\8217" ] ] +[ Para [ Code ( "" , [] , [] ) "\8216hi\8217" ] ] ``` diff --git a/test/command/3971.md b/test/command/3971.md index 013125444..b051caed3 100644 --- a/test/command/3971.md +++ b/test/command/3971.md @@ -5,5 +5,5 @@ \code{f} \end{document} ^D -[ Para [ Code ( "", [], [] ) "f" ] ] +[ Para [ Code ( "" , [] , [] ) "f" ] ] ``` diff --git a/test/command/3983.md b/test/command/3983.md index 4af4bc3eb..c13aea850 100644 --- a/test/command/3983.md +++ b/test/command/3983.md @@ -19,10 +19,8 @@ \DeclareRobustCommand{\urlfootnote}{\hyper@normalise\urlfootnote@} \makeatother ^D -[ RawBlock - ( Format "latex" ) "\\makeatletter" -, RawBlock - ( Format "latex" ) "\\makeatother" +[ RawBlock (Format "latex") "\\makeatletter" +, RawBlock (Format "latex") "\\makeatother" ] ``` @@ -31,5 +29,5 @@ \def\foo{bar} \expandafter\bam\foo ^D -[ RawBlock ( Format "latex" ) "\\bambar" ] +[ RawBlock (Format "latex") "\\bambar" ] ``` diff --git a/test/command/3989.md b/test/command/3989.md index 75872a102..647aa355a 100644 --- a/test/command/3989.md +++ b/test/command/3989.md @@ -4,21 +4,19 @@ foo ^D [ Para - [ Span - ( "" - , [] - , - [ ( "title", "1st line of text
2nd line of text" ) ] - ) - [ Str "foo" ] - , SoftBreak - , Span - ( "" - , [] - , - [ ( "title", "1st line of text
2nd line of text" ) ] - ) - [ Str "foo" ] - ] + [ Span + ( "" + , [] + , [ ( "title" , "1st line of text
2nd line of text" ) ] + ) + [ Str "foo" ] + , SoftBreak + , Span + ( "" + , [] + , [ ( "title" , "1st line of text
2nd line of text" ) ] + ) + [ Str "foo" ] + ] ] ``` diff --git a/test/command/4054.md b/test/command/4054.md index 9afef48b5..81c6e4012 100644 --- a/test/command/4054.md +++ b/test/command/4054.md @@ -3,16 +3,19 @@ % Old ^D Pandoc - ( Meta { unMeta = fromList [ ( "title", MetaString "New" ) ] } ) [] + Meta + { unMeta = fromList [ ( "title" , MetaString "New" ) ] } + [] ``` ``` % pandoc -t native -s -M foo=1 -M foo=2 ^D Pandoc - ( Meta - { unMeta = fromList - [ ( "foo", MetaList [ MetaString "1", MetaString "2" ] ) ] + Meta + { unMeta = + fromList + [ ( "foo" , MetaList [ MetaString "1" , MetaString "2" ] ) ] } - ) [] + [] ``` diff --git a/test/command/4056.md b/test/command/4056.md index 3b2341644..c270d25ca 100644 --- a/test/command/4056.md +++ b/test/command/4056.md @@ -6,7 +6,8 @@ } ^D [ RawBlock - ( Format "tex" ) "\\parbox[t]{0.4\\textwidth}{\n\\begin{shaded}\n\\end{shaded}\n}" + (Format "tex") + "\\parbox[t]{0.4\\textwidth}{\n\\begin{shaded}\n\\end{shaded}\n}" ] ``` @@ -17,39 +18,40 @@ Blah & Foo & Bar \\ \end{tabular} ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Blah" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Foo" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Bar" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Blah" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Foo" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Bar" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/4063.md b/test/command/4063.md index ca7b3007e..29aeae854 100644 --- a/test/command/4063.md +++ b/test/command/4063.md @@ -12,28 +12,33 @@ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignDefault, ColWidth 0.3 ), ( AlignDefault, ColWidth 0.7 ) ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.3 ) + , ( AlignDefault , ColWidth 0.7 ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/4068.md b/test/command/4068.md index 53fb660d0..83527a6fd 100644 --- a/test/command/4068.md +++ b/test/command/4068.md @@ -5,24 +5,29 @@ [http://domain.com?a=. open productname bugs] ^D [ Para - [ Link - ( "", [], [] ) - [ Str "open", Space, Str "productname", Space, Str "bugs" ] - ( "https://domain.com/script.php?a=1&b=2&c=&d=4", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "open" + , Space + , Str "productname" + , Space + , Str "bugs" + ] + ( "https://domain.com/script.php?a=1&b=2&c=&d=4" , "" ) + ] , Para - [ Str "[" - , Link - ( "", [], [] ) - [ Str "http://domain.com?a=" ] - ( "http://domain.com?a=", "" ) - , Str "." - , Space - , Str "open" - , Space - , Str "productname" - , Space - , Str "bugs]" - ] + [ Str "[" + , Link + ( "" , [] , [] ) + [ Str "http://domain.com?a=" ] + ( "http://domain.com?a=" , "" ) + , Str "." + , Space + , Str "open" + , Space + , Str "productname" + , Space + , Str "bugs]" + ] ] ``` diff --git a/test/command/4119.md b/test/command/4119.md index e41991874..fcbf79386 100644 --- a/test/command/4119.md +++ b/test/command/4119.md @@ -9,51 +9,55 @@ not a caption! :::::::::::::::: ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col2" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col2" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Div - ( "", [ "notes" ], [] ) - [ Para [ Str "not", Space, Str "a", Space, Str "caption!" ] ] + ( "" , [ "notes" ] , [] ) + [ Para + [ Str "not" , Space , Str "a" , Space , Str "caption!" ] + ] ] ``` diff --git a/test/command/4134.md b/test/command/4134.md index d850e5740..195d85129 100644 --- a/test/command/4134.md +++ b/test/command/4134.md @@ -20,5 +20,5 @@ Hello.\ World. ^D -[ Para [ Str "Hello.\160" ], Para [ Str "World." ] ] +[ Para [ Str "Hello.\160" ] , Para [ Str "World." ] ] ``` diff --git a/test/command/4159.md b/test/command/4159.md index 1451a03df..bea4632c9 100644 --- a/test/command/4159.md +++ b/test/command/4159.md @@ -3,9 +3,7 @@ \newcommand{\gen}{a\ Gen\ b} abc ^D -[ RawBlock - ( Format "tex" ) "\\newcommand{\\gen}{a\\ Gen\\ b}" -, Para - [ Str "abc" ] +[ RawBlock (Format "tex") "\\newcommand{\\gen}{a\\ Gen\\ b}" +, Para [ Str "abc" ] ] ``` diff --git a/test/command/4162.md b/test/command/4162.md index ca54cf953..85b48dbdf 100644 --- a/test/command/4162.md +++ b/test/command/4162.md @@ -3,5 +3,5 @@
hi

 there
^D -[ LineBlock [ [ Str "hi" ], [], [ Str "\160there" ] ] ] +[ LineBlock [ [ Str "hi" ] , [] , [ Str "\160there" ] ] ] ``` diff --git a/test/command/4183.md b/test/command/4183.md index cf889af73..0fa940a63 100644 --- a/test/command/4183.md +++ b/test/command/4183.md @@ -18,7 +18,9 @@ ^D -[ Para [ Image ( "", [], [] ) [ Str "baz" ] ( "foo", "fig:" ) ] ] +[ Para + [ Image ( "" , [] , [] ) [ Str "baz" ] ( "foo" , "fig:" ) ] +] ``` ``` @@ -29,6 +31,8 @@ ^D [ Para - [ Image ( "", [], [] ) [ Emph [ Str "baz" ] ] ( "foo", "fig:" ) ] + [ Image + ( "" , [] , [] ) [ Emph [ Str "baz" ] ] ( "foo" , "fig:" ) + ] ] ``` diff --git a/test/command/4186.md b/test/command/4186.md index 9ac457748..90ac1271b 100644 --- a/test/command/4186.md +++ b/test/command/4186.md @@ -5,10 +5,8 @@ #+end_example ^D [ CodeBlock - ( "" - , [ "example" ] - , [] - ) " This should retain the four leading spaces\n" + ( "" , [ "example" ] , [] ) + " This should retain the four leading spaces\n" ] ``` diff --git a/test/command/4193.md b/test/command/4193.md index f659349fd..67ca5a4f7 100644 --- a/test/command/4193.md +++ b/test/command/4193.md @@ -4,5 +4,7 @@ a - b ^D -[ BulletList [ [ Plain [ Str "a" ] ], [ Plain [ Str "b" ] ] ] ] +[ BulletList + [ [ Plain [ Str "a" ] ] , [ Plain [ Str "b" ] ] ] +] ``` diff --git a/test/command/4199.md b/test/command/4199.md index 953917f58..36385bc2a 100644 --- a/test/command/4199.md +++ b/test/command/4199.md @@ -2,5 +2,8 @@ % pandoc -f latex -t native \foreignlanguage{ngerman}{foo} ^D -[ Para [ Span ( "", [], [ ( "lang", "de-DE" ) ] ) [ Str "foo" ] ] ] +[ Para + [ Span ( "" , [] , [ ( "lang" , "de-DE" ) ] ) [ Str "foo" ] + ] +] ``` diff --git a/test/command/4240.md b/test/command/4240.md index 861184728..49585438a 100644 --- a/test/command/4240.md +++ b/test/command/4240.md @@ -26,26 +26,19 @@ header4 ~~~~~~~ ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "subtitle", MetaInlines [ Str "Subtitle" ] ) - , - ( "title", MetaInlines [ Str "Title" ] ) - ] + Meta + { unMeta = + fromList + [ ( "subtitle" , MetaInlines [ Str "Subtitle" ] ) + , ( "title" , MetaInlines [ Str "Title" ] ) + ] } - ) - [ Header 1 - ( "header1", [], [] ) - [ Str "header1" ] - , Header 2 - ( "header2", [], [] ) - [ Str "header2" ] - , Header 3 - ( "id", [], [] ) - [ Str "header3" ] - , Header 3 - ( "id3", [], [] ) - [ Str "header4", Span ( "id2", [], [] ) [] ] + [ Header 1 ( "header1" , [] , [] ) [ Str "header1" ] + , Header 2 ( "header2" , [] , [] ) [ Str "header2" ] + , Header 3 ( "id" , [] , [] ) [ Str "header3" ] + , Header + 3 + ( "id3" , [] , [] ) + [ Str "header4" , Span ( "id2" , [] , [] ) [] ] ] ``` diff --git a/test/command/4280.md b/test/command/4280.md index 5a198682b..343a2ab07 100644 --- a/test/command/4280.md +++ b/test/command/4280.md @@ -3,5 +3,5 @@ Driver ------ ^D -[ Header 1 ( "driver", [], [] ) [ Str "Driver" ] ] +[ Header 1 ( "driver" , [] , [] ) [ Str "Driver" ] ] ``` diff --git a/test/command/4281.md b/test/command/4281.md index db5119a5c..53943e503 100644 --- a/test/command/4281.md +++ b/test/command/4281.md @@ -10,17 +10,12 @@ :::: ^D [ Div - ( "", [ "a" ], [] ) - [ BulletList - [ - [ Div - ( "", [ "b" ], [] ) - [ Para [ Str "text" ] ] - , Div - ( "", [ "c" ], [] ) - [ Para [ Str "text" ] ] - ] + ( "" , [ "a" ] , [] ) + [ BulletList + [ [ Div ( "" , [ "b" ] , [] ) [ Para [ Str "text" ] ] + , Div ( "" , [ "c" ] , [] ) [ Para [ Str "text" ] ] + ] + ] ] - ] ] ``` diff --git a/test/command/4284.md b/test/command/4284.md index 5c2ad9620..0308f521f 100644 --- a/test/command/4284.md +++ b/test/command/4284.md @@ -8,30 +8,33 @@ ** Children of headers with excluded tags should not appear :xylophone: * This should not appear :%: ^D -[ Header 1 - ( "noexport-should-appear-if-not-specified-in-excludetags", [], [] ) - [ Str "NOEXPORT" - , Space - , Str "should" - , Space - , Str "appear" - , Space - , Str "if" - , Space - , Str "not" - , Space - , Str "specified" - , Space - , Str "in" - , Space - , Str "EXCLUDE" - , Subscript - [ Str "TAGS" ] - , Space - , Span - ( "", [ "tag" ], [ ( "tag-name", "noexport" ) ] ) - [ SmallCaps [ Str "noexport" ] ] - ] +[ Header + 1 + ( "noexport-should-appear-if-not-specified-in-excludetags" + , [] + , [] + ) + [ Str "NOEXPORT" + , Space + , Str "should" + , Space + , Str "appear" + , Space + , Str "if" + , Space + , Str "not" + , Space + , Str "specified" + , Space + , Str "in" + , Space + , Str "EXCLUDE" + , Subscript [ Str "TAGS" ] + , Space + , Span + ( "" , [ "tag" ] , [ ( "tag-name" , "noexport" ) ] ) + [ SmallCaps [ Str "noexport" ] ] + ] ] ``` @@ -41,18 +44,19 @@ * This should not appear :elephant: * This should appear :fawn: ^D -[ Header 1 - ( "this-should-appear", [], [] ) - [ Str "This" - , Space - , Str "should" - , Space - , Str "appear" - , Space - , Span - ( "", [ "tag" ], [ ( "tag-name", "fawn" ) ] ) - [ SmallCaps [ Str "fawn" ] ] - ] +[ Header + 1 + ( "this-should-appear" , [] , [] ) + [ Str "This" + , Space + , Str "should" + , Space + , Str "appear" + , Space + , Span + ( "" , [ "tag" ] , [ ( "tag-name" , "fawn" ) ] ) + [ SmallCaps [ Str "fawn" ] ] + ] ] ``` @@ -64,18 +68,19 @@ * This should not appear :hippo: * This should appear :noexport: ^D -[ Header 1 - ( "this-should-appear", [], [] ) - [ Str "This" - , Space - , Str "should" - , Space - , Str "appear" - , Space - , Span - ( "", [ "tag" ], [ ( "tag-name", "noexport" ) ] ) - [ SmallCaps [ Str "noexport" ] ] - ] +[ Header + 1 + ( "this-should-appear" , [] , [] ) + [ Str "This" + , Space + , Str "should" + , Space + , Str "appear" + , Space + , Span + ( "" , [ "tag" ] , [ ( "tag-name" , "noexport" ) ] ) + [ SmallCaps [ Str "noexport" ] ] + ] ] ``` @@ -84,29 +89,32 @@ #+EXCLUDE_TAGS: * NOEXPORT should appear if not specified in EXCLUDE_TAGS :noexport: ^D -[ Header 1 - ( "noexport-should-appear-if-not-specified-in-excludetags", [], [] ) - [ Str "NOEXPORT" - , Space - , Str "should" - , Space - , Str "appear" - , Space - , Str "if" - , Space - , Str "not" - , Space - , Str "specified" - , Space - , Str "in" - , Space - , Str "EXCLUDE" - , Subscript - [ Str "TAGS" ] - , Space - , Span - ( "", [ "tag" ], [ ( "tag-name", "noexport" ) ] ) - [ SmallCaps [ Str "noexport" ] ] - ] +[ Header + 1 + ( "noexport-should-appear-if-not-specified-in-excludetags" + , [] + , [] + ) + [ Str "NOEXPORT" + , Space + , Str "should" + , Space + , Str "appear" + , Space + , Str "if" + , Space + , Str "not" + , Space + , Str "specified" + , Space + , Str "in" + , Space + , Str "EXCLUDE" + , Subscript [ Str "TAGS" ] + , Space + , Span + ( "" , [ "tag" ] , [ ( "tag-name" , "noexport" ) ] ) + [ SmallCaps [ Str "noexport" ] ] + ] ] ``` diff --git a/test/command/4306.md b/test/command/4306.md index 3f5caa8fc..dcb90e312 100644 --- a/test/command/4306.md +++ b/test/command/4306.md @@ -7,17 +7,16 @@ The file id is \nolinkurl{ESP_123_5235}. \end{document} ^D [ Para - [ Str "The" - , Space - , Str "file" - , Space - , Str "id" - , Space - , Str "is" - , Space - , Code - ( "", [], [] ) "ESP_123_5235" - , Str "." - ] + [ Str "The" + , Space + , Str "file" + , Space + , Str "id" + , Space + , Str "is" + , Space + , Code ( "" , [] , [] ) "ESP_123_5235" + , Str "." + ] ] ``` diff --git a/test/command/4374.md b/test/command/4374.md index f7587999e..4a0990fff 100644 --- a/test/command/4374.md +++ b/test/command/4374.md @@ -4,17 +4,17 @@ } ^D [ Para - [ Cite - [ Citation - { citationId = "a" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } + [ Cite + [ Citation + { citationId = "a" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline (Format "latex") "\\cite{a%\n}" ] ] - [ RawInline ( Format "latex" ) "\\cite{a%\n}" ] - ] ] ``` diff --git a/test/command/4382.md b/test/command/4382.md index 1eb9c3b64..847f4732e 100644 --- a/test/command/4382.md +++ b/test/command/4382.md @@ -4,5 +4,5 @@ ===== ^D -[ BulletList [ [] ], HorizontalRule ] +[ BulletList [ [] ] , HorizontalRule ] ``` diff --git a/test/command/4454.md b/test/command/4454.md index 8781b914c..aeb62aabb 100644 --- a/test/command/4454.md +++ b/test/command/4454.md @@ -3,5 +3,7 @@ • a • b ^D -[ BulletList [ [ Plain [ Str "a" ] ], [ Plain [ Str "b" ] ] ] ] +[ BulletList + [ [ Plain [ Str "a" ] ] , [ Plain [ Str "b" ] ] ] +] ``` diff --git a/test/command/4499.md b/test/command/4499.md index 7a78860ea..5e86d6ee4 100644 --- a/test/command/4499.md +++ b/test/command/4499.md @@ -9,7 +9,7 @@ % pandoc -f latex+raw_tex -t native \mbox{abc def} ^D -[ Para [ RawInline ( Format "latex" ) "\\mbox{abc def}" ] ] +[ Para [ RawInline (Format "latex") "\\mbox{abc def}" ] ] ``` ``` @@ -53,7 +53,7 @@ mno} pqr % pandoc -f latex+raw_tex -t native \hbox{abc def} ^D -[ Para [ RawInline ( Format "latex" ) "\\hbox{abc def}" ] ] +[ Para [ RawInline (Format "latex") "\\hbox{abc def}" ] ] ``` ``` diff --git a/test/command/4513.md b/test/command/4513.md index a149a699f..1f36d1958 100644 --- a/test/command/4513.md +++ b/test/command/4513.md @@ -3,31 +3,30 @@ |_. heading 1 |_. heading 2| ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "heading", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "heading", Space, Str "2" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody ( "", [], [] ) ( RowHeadColumns 0 ) [] [] ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "heading" , Space , Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "heading" , Space , Str "2" ] ] + ] + ]) + [ TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [] ] + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/4553.md b/test/command/4553.md index 1d7a71cca..0104a08a8 100644 --- a/test/command/4553.md +++ b/test/command/4553.md @@ -2,13 +2,20 @@ % pandoc -f latex -t native foo \include{command/bar} ^D -[ Para [ Str "foo" ], Para [ Emph [ Str "hi", Space, Str "there" ] ] ] +[ 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" ] ] ] +[ Para + [ Str "foo" + , Space + , Emph [ Str "hi" , Space , Str "there" ] + ] +] ``` diff --git a/test/command/4579.md b/test/command/4579.md index f22494e16..353a4a514 100644 --- a/test/command/4579.md +++ b/test/command/4579.md @@ -9,48 +9,50 @@ - ham ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Foo" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Bar" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "spam" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "ham" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Foo" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Bar" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "spam" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "ham" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/4624.md b/test/command/4624.md index dd46a564b..abbdf61f4 100644 --- a/test/command/4624.md +++ b/test/command/4624.md @@ -23,14 +23,11 @@ code4 code5\end{verbatim} ^D [ CodeBlock - ( "", [], [ ( "key1", "value1" ) ] ) "code1\n" + ( "" , [] , [ ( "key1" , "value1" ) ] ) "code1\n" , CodeBlock - ( "", [], [ ( "key2", "value2" ) ] ) "code2\n " -, CodeBlock - ( "", [], [] ) "code3" -, CodeBlock - ( "", [], [] ) "code4" -, CodeBlock - ( "", [], [] ) "code5" + ( "" , [] , [ ( "key2" , "value2" ) ] ) "code2\n " +, CodeBlock ( "" , [] , [] ) "code3" +, CodeBlock ( "" , [] , [] ) "code4" +, CodeBlock ( "" , [] , [] ) "code5" ] ``` diff --git a/test/command/4635.md b/test/command/4635.md index 4b029604b..7acb08539 100644 --- a/test/command/4635.md +++ b/test/command/4635.md @@ -3,7 +3,7 @@ (cf. foo) ^D -[ Para [ Str "(cf.", SoftBreak, Str "foo)" ] ] +[ Para [ Str "(cf." , SoftBreak , Str "foo)" ] ] ``` ``` @@ -11,7 +11,9 @@ foo) a (cf. foo) ^D -[ Para [ Str "a", Space, Str "(cf.", SoftBreak, Str "foo)" ] ] +[ Para + [ Str "a" , Space , Str "(cf." , SoftBreak , Str "foo)" ] +] ``` ``` @@ -19,7 +21,7 @@ foo) cf. foo ^D -[ Para [ Str "cf.", SoftBreak, Str "foo" ] ] +[ Para [ Str "cf." , SoftBreak , Str "foo" ] ] ``` ``` @@ -27,5 +29,7 @@ foo a cf. foo ^D -[ Para [ Str "a", Space, Str "cf.", SoftBreak, Str "foo" ] ] +[ Para + [ Str "a" , Space , Str "cf." , SoftBreak , Str "foo" ] +] ``` diff --git a/test/command/4669.md b/test/command/4669.md index 20aaaca7e..41f6ae327 100644 --- a/test/command/4669.md +++ b/test/command/4669.md @@ -7,9 +7,8 @@ \end{verbatim} ^D [ Para - [ Span ( "", [], [] ) [ Code ( "", [], [] ) "<-" ] ] -, CodeBlock - ( "", [], [] ) " while (n > 0) {" + [ Span ( "" , [] , [] ) [ Code ( "" , [] , [] ) "<-" ] ] +, CodeBlock ( "" , [] , [] ) " while (n > 0) {" ] ``` @@ -24,16 +23,11 @@ \end{itemize} ^D [ BulletList - [ - [ Para [ Str "one" ] ] - , - [ Para [ Str "two" ] ] - , - [ Para [ Str "three" ] ] - , - [ Para [ Str "four" ] ] - , - [ Para [ Str "five" ] ] - ] + [ [ Para [ Str "one" ] ] + , [ Para [ Str "two" ] ] + , [ Para [ Str "three" ] ] + , [ Para [ Str "four" ] ] + , [ Para [ Str "five" ] ] + ] ] ``` diff --git a/test/command/4715.md b/test/command/4715.md index 58ba70544..f6bf8736d 100644 --- a/test/command/4715.md +++ b/test/command/4715.md @@ -12,25 +12,20 @@ riuso-software.rst ^D [ Div - ( "tree1" - , - [ "toctree", "foo", "bar" ] - , - [ - ( "caption", "Indice dei contenuti" ) - , - ( "numbered", "" ) - , - ( "maxdepth", "3" ) + ( "tree1" + , [ "toctree" , "foo" , "bar" ] + , [ ( "caption" , "Indice dei contenuti" ) + , ( "numbered" , "" ) + , ( "maxdepth" , "3" ) + ] + ) + [ Para + [ Str "premessa.rst" + , SoftBreak + , Str "acquisizione-software.rst" + , SoftBreak + , Str "riuso-software.rst" + ] ] - ) - [ Para - [ Str "premessa.rst" - , SoftBreak - , Str "acquisizione-software.rst" - , SoftBreak - , Str "riuso-software.rst" - ] - ] ] ``` diff --git a/test/command/4722.md b/test/command/4722.md index 2a0ef086d..2b2ceb640 100644 --- a/test/command/4722.md +++ b/test/command/4722.md @@ -7,23 +7,16 @@ *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" ] ] + , [ 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" ] ] ] - , - [ Plain [ Str "Level", Space, Str "1" ] ] - ] ] ``` ``` @@ -35,25 +28,19 @@ #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" ] ] ] - ] + ( 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" ] ] ] - , - [ Plain [ Str "Level", Space, Str "1" ] ] - ] ] ``` diff --git a/test/command/4742.md b/test/command/4742.md index 45f42db5a..f3f4bf7ae 100644 --- a/test/command/4742.md +++ b/test/command/4742.md @@ -26,16 +26,17 @@ so it survives... % 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" - ] +[ Header + 1 + ( "non-ascii-\65039-r\228ksm\246rg\229s" , [] , [] ) + [ Str "non" + , Space + , Str "ascii" + , Space + , Str "\9888\65039" + , Space + , Str "r\228ksm\246rg\229s" + ] ] ``` @@ -45,15 +46,16 @@ so it survives... % pandoc -f gfm -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" - ] +[ Header + 1 + ( "non-ascii-\65039-r\228ksm\246rg\229s" , [] , [] ) + [ Str "non" + , Space + , Str "ascii" + , Space + , Str "\9888\65039" + , Space + , Str "r\228ksm\246rg\229s" + ] ] ``` diff --git a/test/command/4743.md b/test/command/4743.md index 08c807c9f..582540736 100644 --- a/test/command/4743.md +++ b/test/command/4743.md @@ -5,15 +5,15 @@ Test that emojis are wrapped in Span 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" ] - ] + [ Str "My" + , Span + ( "" , [ "emoji" ] , [ ( "data-emoji" , "thumbsup" ) ] ) + [ Str "\128077" ] + , Str "emoji" + , Span + ( "" , [ "emoji" ] , [ ( "data-emoji" , "heart" ) ] ) + [ Str "\10084\65039" ] + ] ] ``` @@ -22,15 +22,15 @@ My:thumbsup:emoji:heart: 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" ] - ] + [ Str "My" + , Span + ( "" , [ "emoji" ] , [ ( "data-emoji" , "thumbsup" ) ] ) + [ Str "\128077" ] + , Str "emoji" + , Span + ( "" , [ "emoji" ] , [ ( "data-emoji" , "heart" ) ] ) + [ Str "\10084\65039" ] + ] ] ``` diff --git a/test/command/4781.md b/test/command/4781.md index 59740373c..e240facf3 100644 --- a/test/command/4781.md +++ b/test/command/4781.md @@ -7,11 +7,17 @@ Markdown parsed *here* *But not here* ^D [ Para - [ Str "Markdown", Space, Str "parsed", Space, Emph [ Str "here" ] ] -, RawBlock - ( Format "tex" ) "\\include{command/bar}" + [ Str "Markdown" + , Space + , Str "parsed" + , Space + , Emph [ Str "here" ] + ] +, RawBlock (Format "tex") "\\include{command/bar}" , Para - [ Emph [ Str "But", Space, Str "not", Space, Str "here" ] ] + [ Emph + [ Str "But" , Space , Str "not" , Space , Str "here" ] + ] ] ``` @@ -22,13 +28,13 @@ Markdown parsed *here* *But not here* ^D [ Para - [ Emph - [ Str "here" ] - , Space - , RawInline - ( Format "tex" ) "\\input{command/bar}" - ] + [ Emph [ Str "here" ] + , Space + , RawInline (Format "tex") "\\input{command/bar}" + ] , Para - [ Emph [ Str "But", Space, Str "not", Space, Str "here" ] ] + [ Emph + [ Str "But" , Space , Str "not" , Space , Str "here" ] + ] ] ``` diff --git a/test/command/4811.md b/test/command/4811.md index 33d49f8c8..4c0b0faa9 100644 --- a/test/command/4811.md +++ b/test/command/4811.md @@ -6,7 +6,7 @@ No blank lines in inline interpreted roles: blank`:myrole: ^D -[ Para [ Str "`no" ], Para [ Str "blank`:myrole:" ] ] +[ Para [ Str "`no" ] , Para [ Str "blank`:myrole:" ] ] ``` Backslash escape behaves properly in interpreted roles: @@ -17,10 +17,8 @@ Backslash escape behaves properly in interpreted roles: `hi\ there`:code: ^D -[ Para - [ Superscript [ Str "hithere" ] ] -, Para - [ Code ( "", [], [] ) "hi\\ there" ] +[ Para [ Superscript [ Str "hithere" ] ] +, Para [ Code ( "" , [] , [] ) "hi\\ there" ] ] ``` @@ -30,9 +28,10 @@ Backtick followed by alphanumeric doesn't end the span: `hi`there`:myrole: ^D [ Para - [ Code - ( "", [ "interpreted-text" ], [ ( "role", "myrole" ) ] ) "hi`there" - ] + [ Code + ( "" , [ "interpreted-text" ] , [ ( "role" , "myrole" ) ] ) + "hi`there" + ] ] ``` @@ -43,9 +42,10 @@ Newline is okay, as long as not blank: there`:myrole: ^D [ Para - [ Code - ( "", [ "interpreted-text" ], [ ( "role", "myrole" ) ] ) "hi\nthere" - ] + [ Code + ( "" , [ "interpreted-text" ] , [ ( "role" , "myrole" ) ] ) + "hi\nthere" + ] ] ``` @@ -54,5 +54,7 @@ Use span for title-reference: % pandoc -f rst -t native `default` ^D -[ Para [ Span ( "", [ "title-ref" ], [] ) [ Str "default" ] ] ] +[ Para + [ Span ( "" , [ "title-ref" ] , [] ) [ Str "default" ] ] +] ``` diff --git a/test/command/4817.md b/test/command/4817.md index 600266771..84db64b5f 100644 --- a/test/command/4817.md +++ b/test/command/4817.md @@ -6,16 +6,16 @@ foo: ... ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "foo" - , MetaList - [ MetaMap - ( fromList [ ( "bar", MetaInlines [ Str "bam" ] ) ] ) + Meta + { unMeta = + fromList + [ ( "foo" + , MetaList + [ MetaMap + (fromList [ ( "bar" , MetaInlines [ Str "bam" ] ) ]) + ] + ) ] - ) - ] } - ) [] + [] ``` diff --git a/test/command/4819.md b/test/command/4819.md index 5966b14f3..eb964efba 100644 --- a/test/command/4819.md +++ b/test/command/4819.md @@ -5,9 +5,10 @@ foo: 42 ... ^D Pandoc - ( Meta - { unMeta = fromList [ ( "foo", MetaInlines [ Str "42" ] ) ] } - ) [] + Meta + { unMeta = fromList [ ( "foo" , MetaInlines [ Str "42" ] ) ] + } + [] ``` ``` @@ -17,7 +18,7 @@ foo: true ... ^D Pandoc - ( Meta { unMeta = fromList [ ( "foo", MetaBool True ) ] } ) [] + Meta { unMeta = fromList [ ( "foo" , MetaBool True ) ] } [] ``` ``` @@ -27,7 +28,7 @@ foo: True ... ^D Pandoc - ( Meta { unMeta = fromList [ ( "foo", MetaBool True ) ] } ) [] + Meta { unMeta = fromList [ ( "foo" , MetaBool True ) ] } [] ``` ``` @@ -47,8 +48,9 @@ foo: no ... ^D Pandoc - ( Meta - { unMeta = fromList [ ( "foo", MetaInlines [ Str "no" ] ) ] } - ) [] + Meta + { unMeta = fromList [ ( "foo" , MetaInlines [ Str "no" ] ) ] + } + [] ``` diff --git a/test/command/4832.md b/test/command/4832.md index 6e8f9401e..5e9f2ac77 100644 --- a/test/command/4832.md +++ b/test/command/4832.md @@ -3,11 +3,11 @@ \url{http://example.com/foo%20bar.htm} ^D [ Para - [ Link - ( "", [], [] ) - [ Str "http://example.com/foo%20bar.htm" ] - ( "http://example.com/foo%20bar.htm", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "http://example.com/foo%20bar.htm" ] + ( "http://example.com/foo%20bar.htm" , "" ) + ] ] ``` @@ -16,11 +16,11 @@ \url{http://example.com/foo{bar}.htm} ^D [ Para - [ Link - ( "", [], [] ) - [ Str "http://example.com/foo{bar}.htm" ] - ( "http://example.com/foo{bar}.htm", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "http://example.com/foo{bar}.htm" ] + ( "http://example.com/foo{bar}.htm" , "" ) + ] ] ``` @@ -29,11 +29,11 @@ \href{http://example.com/foo%20bar}{Foobar} ^D [ Para - [ Link - ( "", [], [] ) - [ Str "Foobar" ] - ( "http://example.com/foo%20bar", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "Foobar" ] + ( "http://example.com/foo%20bar" , "" ) + ] ] ``` diff --git a/test/command/4845.md b/test/command/4845.md index 092c48181..10d11127b 100644 --- a/test/command/4845.md +++ b/test/command/4845.md @@ -3,14 +3,19 @@ x leading trailing space x ^D [ Plain - [ Str "x" - , Space - , Link - ( "", [], [] ) - [ Str "leading", Space, Str "trailing", Space, Str "space" ] - ( "/foo", "" ) - , Space - , Str "x" - ] + [ Str "x" + , Space + , Link + ( "" , [] , [] ) + [ Str "leading" + , Space + , Str "trailing" + , Space + , Str "space" + ] + ( "/foo" , "" ) + , Space + , Str "x" + ] ] ``` diff --git a/test/command/4848.md b/test/command/4848.md index 3110b90cc..54692ff09 100644 --- a/test/command/4848.md +++ b/test/command/4848.md @@ -10,9 +10,10 @@ \foreignquote{italian}{hi} ^D [ Para - [ Quoted DoubleQuote - [ Span ( "", [], [ ( "lang", "it" ) ] ) [ Str "hi" ] ] - ] + [ Quoted + DoubleQuote + [ Span ( "" , [] , [ ( "lang" , "it" ) ] ) [ Str "hi" ] ] + ] ] ``` @@ -21,9 +22,10 @@ \hyphenquote*{italian}{hi} ^D [ Para - [ Quoted SingleQuote - [ Span ( "", [], [ ( "lang", "it" ) ] ) [ Str "hi" ] ] - ] + [ Quoted + SingleQuote + [ Span ( "" , [] , [ ( "lang" , "it" ) ] ) [ Str "hi" ] ] + ] ] ``` @@ -33,12 +35,12 @@ Lorem ipsum \blockquote{dolor sit amet} consectetuer. ^D -[ Para - [ Str "Lorem", Space, Str "ipsum" ] +[ Para [ Str "Lorem" , Space , Str "ipsum" ] , BlockQuote - [ Para [ Str "dolor", Space, Str "sit", Space, Str "amet" ] ] -, Para - [ Str "consectetuer." ] + [ Para + [ Str "dolor" , Space , Str "sit" , Space , Str "amet" ] + ] +, Para [ Str "consectetuer." ] ] ``` @@ -78,15 +80,15 @@ Lorem ipsum \foreignblockquote{italian}{dolor sit amet} consectetuer. ^D -[ Para - [ Str "Lorem", Space, Str "ipsum" ] +[ Para [ Str "Lorem" , Space , Str "ipsum" ] , BlockQuote - [ Div - ( "", [], [ ( "lang", "it" ) ] ) - [ Para [ Str "dolor", Space, Str "sit", Space, Str "amet" ] ] - ] -, Para - [ Str "consectetuer." ] + [ Div + ( "" , [] , [ ( "lang" , "it" ) ] ) + [ Para + [ Str "dolor" , Space , Str "sit" , Space , Str "amet" ] + ] + ] +, Para [ Str "consectetuer." ] ] ``` diff --git a/test/command/4860.md b/test/command/4860.md index 4fb0c9212..65b6bf65f 100644 --- a/test/command/4860.md +++ b/test/command/4860.md @@ -6,15 +6,15 @@ This is broken_. .. _broken: http://google.com ^D [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Link - ( "", [], [] ) - [ Str "broken" ] - ( "http://google.com", "" ) - , Str "." - ] + [ Str "This" + , Space + , Str "is" + , Space + , Link + ( "" , [] , [] ) + [ Str "broken" ] + ( "http://google.com" , "" ) + , Str "." + ] ] ``` diff --git a/test/command/4877.md b/test/command/4877.md index d442de3b4..ba8acd122 100644 --- a/test/command/4877.md +++ b/test/command/4877.md @@ -2,7 +2,9 @@ % pandoc -f html -t native My ^D -[ Plain [ Str "My", Space, Math InlineMath "\\mathcal{D}" ] ] +[ Plain + [ Str "My" , Space , Math InlineMath "\\mathcal{D}" ] +] ``` ``` diff --git a/test/command/4919.md b/test/command/4919.md index 165f427bb..b8f153848 100644 --- a/test/command/4919.md +++ b/test/command/4919.md @@ -8,8 +8,10 @@ V = \frac{K}{r^2} ^D [ Div - ( "tgtmath", [], [] ) - [ BlockQuote [ Para [ Math DisplayMath "V = \\frac{K}{r^2}" ] ] ] + ( "tgtmath" , [] , [] ) + [ BlockQuote + [ Para [ Math DisplayMath "V = \\frac{K}{r^2}" ] ] + ] ] ``` diff --git a/test/command/4928.md b/test/command/4928.md index c779fb0a4..b35e17d4f 100644 --- a/test/command/4928.md +++ b/test/command/4928.md @@ -3,31 +3,30 @@ \cites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72} ^D [ Para - [ Cite - [ Citation - { citationId = "Knu86" - , citationPrefix = - [ Str "Multiprenote", Space, Str "23" ] - , citationSuffix = - [ Str "42" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - , Citation - { citationId = "Nie72" - , citationPrefix = [] - , citationSuffix = - [ Str "65", Str ",", Space, Str "multipostnote" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - ] - [ RawInline - ( Format "latex" ) "\\cites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72}" + [ Cite + [ Citation + { citationId = "Knu86" + , citationPrefix = [ Str "Multiprenote" , Space , Str "23" ] + , citationSuffix = [ Str "42" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + , Citation + { citationId = "Nie72" + , citationPrefix = [] + , citationSuffix = + [ Str "65" , Str "," , Space , Str "multipostnote" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline + (Format "latex") + "\\cites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72}" + ] ] - ] ] ``` @@ -36,31 +35,29 @@ \cites(Multiprenote)()[23][42]{Knu86}[65]{Nie72} ^D [ Para - [ Cite - [ Citation - { citationId = "Knu86" - , citationPrefix = - [ Str "Multiprenote", Space, Str "23" ] - , citationSuffix = - [ Str "42" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - , Citation - { citationId = "Nie72" - , citationPrefix = [] - , citationSuffix = - [ Str "65" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - ] - [ RawInline - ( Format "latex" ) "\\cites(Multiprenote)()[23][42]{Knu86}[65]{Nie72}" + [ Cite + [ Citation + { citationId = "Knu86" + , citationPrefix = [ Str "Multiprenote" , Space , Str "23" ] + , citationSuffix = [ Str "42" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + , Citation + { citationId = "Nie72" + , citationPrefix = [] + , citationSuffix = [ Str "65" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline + (Format "latex") + "\\cites(Multiprenote)()[23][42]{Knu86}[65]{Nie72}" + ] ] - ] ] ``` @@ -69,31 +66,30 @@ \cites()(multipostnote)[23][42]{Knu86}[65]{Nie72} ^D [ Para - [ Cite - [ Citation - { citationId = "Knu86" - , citationPrefix = - [ Str "23" ] - , citationSuffix = - [ Str "42" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - , Citation - { citationId = "Nie72" - , citationPrefix = [] - , citationSuffix = - [ Str "65", Str ",", Space, Str "multipostnote" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - ] - [ RawInline - ( Format "latex" ) "\\cites()(multipostnote)[23][42]{Knu86}[65]{Nie72}" + [ Cite + [ Citation + { citationId = "Knu86" + , citationPrefix = [ Str "23" ] + , citationSuffix = [ Str "42" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + , Citation + { citationId = "Nie72" + , citationPrefix = [] + , citationSuffix = + [ Str "65" , Str "," , Space , Str "multipostnote" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline + (Format "latex") + "\\cites()(multipostnote)[23][42]{Knu86}[65]{Nie72}" + ] ] - ] ] ``` @@ -102,31 +98,28 @@ \cites()()[23][42]{Knu86}[65]{Nie72} ^D [ Para - [ Cite - [ Citation - { citationId = "Knu86" - , citationPrefix = - [ Str "23" ] - , citationSuffix = - [ Str "42" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - , Citation - { citationId = "Nie72" - , citationPrefix = [] - , citationSuffix = - [ Str "65" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - ] - [ RawInline - ( Format "latex" ) "\\cites()()[23][42]{Knu86}[65]{Nie72}" + [ Cite + [ Citation + { citationId = "Knu86" + , citationPrefix = [ Str "23" ] + , citationSuffix = [ Str "42" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + , Citation + { citationId = "Nie72" + , citationPrefix = [] + , citationSuffix = [ Str "65" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline + (Format "latex") "\\cites()()[23][42]{Knu86}[65]{Nie72}" + ] ] - ] ] ``` @@ -168,22 +161,21 @@ \cites(Multiprenote)(multipostnote){Knu86} ^D [ Para - [ Cite - [ Citation - { citationId = "Knu86" - , citationPrefix = - [ Str "Multiprenote" ] - , citationSuffix = - [ Str ",", Space, Str "multipostnote" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - ] - [ RawInline - ( Format "latex" ) "\\cites(Multiprenote)(multipostnote){Knu86}" + [ Cite + [ Citation + { citationId = "Knu86" + , citationPrefix = [ Str "Multiprenote" ] + , citationSuffix = [ Str "," , Space , Str "multipostnote" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline + (Format "latex") + "\\cites(Multiprenote)(multipostnote){Knu86}" + ] ] - ] ] ``` @@ -192,35 +184,39 @@ \footcites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72} ^D [ Para - [ Note - [ Para - [ Cite - [ Citation - { citationId = "Knu86" - , citationPrefix = - [ Str "Multiprenote", Space, Str "23" ] - , citationSuffix = - [ Str "42" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - , Citation - { citationId = "Nie72" - , citationPrefix = [] - , citationSuffix = - [ Str "65", Str ",", Space, Str "multipostnote" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - ] - [ RawInline - ( Format "latex" ) "\\footcites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72}" + [ Note + [ Para + [ Cite + [ Citation + { citationId = "Knu86" + , citationPrefix = + [ Str "Multiprenote" , Space , Str "23" ] + , citationSuffix = [ Str "42" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + , Citation + { citationId = "Nie72" + , citationPrefix = [] + , citationSuffix = + [ Str "65" + , Str "," + , Space + , Str "multipostnote" + ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline + (Format "latex") + "\\footcites(Multiprenote)(multipostnote)[23][42]{Knu86}[65]{Nie72}" + ] + , Str "." + ] ] - , Str "." - ] ] - ] ] ``` diff --git a/test/command/4933.md b/test/command/4933.md index 763b49ca3..b8dedfa20 100644 --- a/test/command/4933.md +++ b/test/command/4933.md @@ -2,5 +2,9 @@ % pandoc -f latex -t native \includegraphics{lalune} ^D -[ Para [ Image ( "", [], [] ) [ Str "image" ] ( "lalune.jpg", "" ) ] ] +[ Para + [ Image + ( "" , [] , [] ) [ Str "image" ] ( "lalune.jpg" , "" ) + ] +] ``` diff --git a/test/command/5014.md b/test/command/5014.md index 47965830c..8acc55750 100644 --- a/test/command/5014.md +++ b/test/command/5014.md @@ -14,34 +14,36 @@ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignDefault, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Name" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Name" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Accounts" ] ] + ] + ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Accounts" ] ] - ] - ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/5079.md b/test/command/5079.md index 28bdf64d0..3eb0628c5 100644 --- a/test/command/5079.md +++ b/test/command/5079.md @@ -11,23 +11,25 @@ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignDefault, ColWidthDefault ) ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/5099.md b/test/command/5099.md index 316d021d9..d464f9c8a 100644 --- a/test/command/5099.md +++ b/test/command/5099.md @@ -3,19 +3,19 @@ (@citation ^D [ Para - [ Str "(" - , Cite - [ Citation - { citationId = "citation" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = AuthorInText - , citationNoteNum = 1 - , citationHash = 0 - } + [ Str "(" + , Cite + [ Citation + { citationId = "citation" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "@citation" ] ] - [ Str "@citation" ] - ] ] ``` @@ -23,5 +23,7 @@ % pandoc -t native ('asd') ^D -[ Para [ Str "(", Quoted SingleQuote [ Str "asd" ], Str ")" ] ] +[ Para + [ Str "(" , Quoted SingleQuote [ Str "asd" ] , Str ")" ] +] ``` diff --git a/test/command/5178.md b/test/command/5178.md index d74830b17..1c39b5071 100644 --- a/test/command/5178.md +++ b/test/command/5178.md @@ -23,19 +23,17 @@ unsafePerformIO main #+end_src ^D [ CodeBlock - ( "" - , - [ "commonlisp", "numberLines" ] - , - [ ( "org-language", "lisp" ), ( "startFrom", "20" ) ] - ) "(+ 1 1)\n" + ( "" + , [ "commonlisp" , "numberLines" ] + , [ ( "org-language" , "lisp" ) , ( "startFrom" , "20" ) ] + ) + "(+ 1 1)\n" , CodeBlock - ( "" - , - [ "commonlisp", "numberLines", "continuedSourceBlock" ] - , - [ ( "org-language", "lisp" ), ( "startFrom", "10" ) ] - ) "(+ 2 2)\n" + ( "" + , [ "commonlisp" , "numberLines" , "continuedSourceBlock" ] + , [ ( "org-language" , "lisp" ) , ( "startFrom" , "10" ) ] + ) + "(+ 2 2)\n" ] ``` diff --git a/test/command/5182.md b/test/command/5182.md index a26056a0e..5898f9edf 100644 --- a/test/command/5182.md +++ b/test/command/5182.md @@ -3,6 +3,7 @@ .. include:: command/5182.txt ^D [ CodeBlock - ( "", [ "python", "numberLines" ], [] ) "def func(x):\n return y" + ( "" , [ "python" , "numberLines" ] , [] ) + "def func(x):\n return y" ] ``` diff --git a/test/command/5271.md b/test/command/5271.md index e80bc3468..5df3958ef 100644 --- a/test/command/5271.md +++ b/test/command/5271.md @@ -8,34 +8,34 @@ abstract: | ... ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "abstract" - , MetaBlocks - [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "abstract." - ] - , Para - [ Str "It" - , Space - , Str "consists" - , Space - , Str "of" - , Space - , Str "two" - , Space - , Str "paragraphs." - ] + Meta + { unMeta = + fromList + [ ( "abstract" + , MetaBlocks + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "abstract." + ] + , Para + [ Str "It" + , Space + , Str "consists" + , Space + , Str "of" + , Space + , Str "two" + , Space + , Str "paragraphs." + ] + ] + ) ] - ) - ] } - ) [] + [] ``` diff --git a/test/command/5285.md b/test/command/5285.md index ebad9374e..6c5b7f987 100644 --- a/test/command/5285.md +++ b/test/command/5285.md @@ -8,13 +8,10 @@ - b ^D [ BulletList - [ - [ Para [ Str "a" ], Para [ Str "b" ] ] - , - [ Para [ Str "a" ] ] - , - [ Para [ Str "b" ] ] - ] + [ [ Para [ Str "a" ] , Para [ Str "b" ] ] + , [ Para [ Str "a" ] ] + , [ Para [ Str "b" ] ] + ] ] ``` @@ -28,10 +25,8 @@ > foo ^D [ BulletList - [ - [ Para [ Str "foo" ], Para [ Str "foo" ] ] - , - [ Para [ Str "foo" ], BlockQuote [ Para [ Str "foo" ] ] ] - ] + [ [ Para [ Str "foo" ] , Para [ Str "foo" ] ] + , [ Para [ Str "foo" ] , BlockQuote [ Para [ Str "foo" ] ] ] + ] ] ``` diff --git a/test/command/5321.md b/test/command/5321.md index b0cfdb1b8..975852482 100644 --- a/test/command/5321.md +++ b/test/command/5321.md @@ -8,7 +8,9 @@ ^D [ Para - [ Image ( "fig-1", [], [] ) [ Str "bar" ] ( "foo.png", "fig:" ) ] + [ Image + ( "fig-1" , [] , [] ) [ Str "bar" ] ( "foo.png" , "fig:" ) + ] ] ``` @@ -23,10 +25,10 @@ ^D [ Para - [ Image - ( "fig-1", [], [] ) - [ Str "foo", LineBreak, Str "bar" ] - ( "foo.png", "fig:" ) - ] + [ Image + ( "fig-1" , [] , [] ) + [ Str "foo" , LineBreak , Str "bar" ] + ( "foo.png" , "fig:" ) + ] ] ``` diff --git a/test/command/5360.md b/test/command/5360.md index 7aa8adfa3..2250ba9f9 100644 --- a/test/command/5360.md +++ b/test/command/5360.md @@ -9,21 +9,14 @@ ::: ^D [ Div - ( "", [ "foo" ], [] ) - [ RawBlock - ( Format "html" ) "" - , RawBlock - ( Format "html" ) "" - , RawBlock - ( Format "html" ) "" - , RawBlock - ( Format "html" ) "" - , RawBlock - ( Format "html" ) "
" - , Plain - [ Str "hi" ] - , RawBlock - ( Format "html" ) "
" - ] + ( "" , [ "foo" ] , [] ) + [ RawBlock (Format "html") "" + , RawBlock (Format "html") "" + , RawBlock (Format "html") "" + , RawBlock (Format "html") "" + , RawBlock (Format "html") "
" + , Plain [ Str "hi" ] + , RawBlock (Format "html") "
" + ] ] ``` diff --git a/test/command/5368.md b/test/command/5368.md index 16cc4352c..e8b54bf7b 100644 --- a/test/command/5368.md +++ b/test/command/5368.md @@ -13,27 +13,26 @@ Quux. ^D [ OrderedList - ( 1, Decimal, Period ) - [ - [ Para - [ Str "foo" ] - , Para - [ Image ( "", [], [] ) [ Str "bar" ] ( "bar.png", "fig:" ) ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "foo" ] + , Para + [ Image + ( "" , [] , [] ) [ Str "bar" ] ( "bar.png" , "fig:" ) + ] + ] + , [ Para [ Str "foo2" ] + , Para + [ Image + ( "" , [] , [] ) [ Str "bar2" ] ( "bar2.png" , "fig:" ) + ] + ] + , [ Para [ Str "foo3" ] + , Para + [ Image + ( "" , [] , [] ) [ Str "foo3" ] ( "foo3.png" , "fig:" ) + ] + ] ] - , - [ Para - [ Str "foo2" ] - , Para - [ Image ( "", [], [] ) [ Str "bar2" ] ( "bar2.png", "fig:" ) ] - ] - , - [ Para - [ Str "foo3" ] - , Para - [ Image ( "", [], [] ) [ Str "foo3" ] ( "foo3.png", "fig:" ) ] - ] - ] -, Para - [ Str "Quux." ] +, Para [ Str "Quux." ] ] ``` diff --git a/test/command/5540.md b/test/command/5540.md index c5157e611..41239020e 100644 --- a/test/command/5540.md +++ b/test/command/5540.md @@ -5,10 +5,10 @@ Stay pure! \end{lstlisting} ^D [ CodeBlock - ( "" - , [ "myfunnylanguage" ] - , - [ ( "language", "myfunnylanguage" ) ] - ) "Stay pure!" + ( "" + , [ "myfunnylanguage" ] + , [ ( "language" , "myfunnylanguage" ) ] + ) + "Stay pure!" ] ``` diff --git a/test/command/5549.md b/test/command/5549.md index 4a17226ef..49d6f168f 100644 --- a/test/command/5549.md +++ b/test/command/5549.md @@ -4,5 +4,5 @@ [] ^D -[ Header 2 ( "section", [], [] ) [], Para [ Str "[]" ] ] +[ Header 2 ( "section" , [] , [] ) [] , Para [ Str "[]" ] ] ``` diff --git a/test/command/5619.md b/test/command/5619.md index dbf82c822..0f612ea67 100644 --- a/test/command/5619.md +++ b/test/command/5619.md @@ -7,31 +7,31 @@ The caption. Here's what piggybacking on caption would look like {#fig:1} ^D [ Para - [ Image - ( "test", [], [ ( "width", "1in" ) ] ) - [ Str "The" - , Space - , Str "caption." - , Space - , Str "Here's" - , Space - , Str "what" - , Space - , Str "piggybacking" - , Space - , Str "on" - , Space - , Str "caption" - , Space - , Str "would" - , Space - , Str "look" - , Space - , Str "like" - , Space - , Str "{#fig:1}" + [ Image + ( "test" , [] , [ ( "width" , "1in" ) ] ) + [ Str "The" + , Space + , Str "caption." + , Space + , Str "Here's" + , Space + , Str "what" + , Space + , Str "piggybacking" + , Space + , Str "on" + , Space + , Str "caption" + , Space + , Str "would" + , Space + , Str "look" + , Space + , Str "like" + , Space + , Str "{#fig:1}" + ] + ( "img1.jpg" , "fig:" ) ] - ( "img1.jpg", "fig:" ) - ] ] ``` diff --git a/test/command/5686.md b/test/command/5686.md index 445b732ed..d669ae49b 100644 --- a/test/command/5686.md +++ b/test/command/5686.md @@ -5,27 +5,27 @@ FOO\t0BAR This part does not make it to the html output. ^D [ Para - [ Str "FOO", RawInline ( Format "tex" ) "\\t0", Str "BAR" ] + [ Str "FOO" , RawInline (Format "tex") "\\t0" , Str "BAR" ] , Para - [ Str "This" - , Space - , Str "part" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "make" - , Space - , Str "it" - , Space - , Str "to" - , Space - , Str "the" - , Space - , Str "html" - , Space - , Str "output." - ] + [ Str "This" + , Space + , Str "part" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "make" + , Space + , Str "it" + , Space + , Str "to" + , Space + , Str "the" + , Space + , Str "html" + , Space + , Str "output." + ] ] ``` diff --git a/test/command/5700.md b/test/command/5700.md index ca8ab19fd..eae3663e5 100644 --- a/test/command/5700.md +++ b/test/command/5700.md @@ -2,39 +2,38 @@ % pandoc -t native -s --metadata-file command/5700-metadata-file-1.yml --metadata-file command/5700-metadata-file-2.yml ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "desc" - , MetaInlines - [ Str "Both" - , Space - , Str "of" - , Space - , Str "these" - , Space - , Str "files" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "loaded." + Meta + { unMeta = + fromList + [ ( "desc" + , MetaInlines + [ Str "Both" + , Space + , Str "of" + , Space + , Str "these" + , Space + , Str "files" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "loaded." + ] + ) + , ( "title" + , MetaInlines + [ Str "Multiple" + , Space + , Str "metadata" + , Space + , Str "files" + , Space + , Str "test" + ] + ) ] - ) - , - ( "title" - , MetaInlines - [ Str "Multiple" - , Space - , Str "metadata" - , Space - , Str "files" - , Space - , Str "test" - ] - ) - ] } - ) [] + [] ``` diff --git a/test/command/5708.md b/test/command/5708.md index bb471a734..e97edcf30 100644 --- a/test/command/5708.md +++ b/test/command/5708.md @@ -5,32 +5,33 @@ +--------+----------------+ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.125 ) - , - ( AlignDefault, ColWidth 0.2361111111111111 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123456" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Math InlineMath "a + b" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.125 ) + , ( AlignDefault , ColWidth 0.2361111111111111 ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123456" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Math InlineMath "a + b" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/5711.md b/test/command/5711.md index b7039dc91..131173079 100644 --- a/test/command/5711.md +++ b/test/command/5711.md @@ -8,23 +8,25 @@ \end{document} ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignCenter, ColWidthDefault ) ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "d", LineBreak, Str "e" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "d" , LineBreak , Str "e" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/5714.md b/test/command/5714.md index a38ec2384..c874f1af7 100644 --- a/test/command/5714.md +++ b/test/command/5714.md @@ -6,15 +6,11 @@ b_ # hi _c c ^D -[ Header 1 - ( "hi-_a", [], [] ) - [ Str "hi", Space, Str "_a" ] -, Para - [ Str "b_" ] -, Header 1 - ( "hi-_c", [], [] ) - [ Str "hi", Space, Str "_c" ] -, Para - [ Str "c" ] +[ Header + 1 ( "hi-_a" , [] , [] ) [ Str "hi" , Space , Str "_a" ] +, Para [ Str "b_" ] +, Header + 1 ( "hi-_c" , [] , [] ) [ Str "hi" , Space , Str "_c" ] +, Para [ Str "c" ] ] ``` diff --git a/test/command/5753.md b/test/command/5753.md index d40eb8a41..686c8f495 100644 --- a/test/command/5753.md +++ b/test/command/5753.md @@ -11,8 +11,9 @@ end ^D [ Para - [ Math DisplayMath "q_3\n+ 4", Math DisplayMath "- 5 +\nq_5" ] -, Para - [ Str "end" ] + [ Math DisplayMath "q_3\n+ 4" + , Math DisplayMath "- 5 +\nq_5" + ] +, Para [ Str "end" ] ] ``` diff --git a/test/command/5795.md b/test/command/5795.md index d62588d6d..8271e1232 100644 --- a/test/command/5795.md +++ b/test/command/5795.md @@ -10,10 +10,10 @@ foo ^D [ Plain - [ Span - ( "foo", [ "dfn", "dfn" ], [ ( "title", "bax" ) ] ) - [ Span ( "", [], [] ) [ Str "foo" ] ] - ] + [ Span + ( "foo" , [ "dfn" , "dfn" ] , [ ( "title" , "bax" ) ] ) + [ Span ( "" , [] , [] ) [ Str "foo" ] ] + ] ] ``` diff --git a/test/command/5797.md b/test/command/5797.md index c85c76aaf..4be51c629 100644 --- a/test/command/5797.md +++ b/test/command/5797.md @@ -9,7 +9,7 @@ % pandoc -f html -t native Ctrl-C ^D -[ Plain [ Span ( "", [ "mark" ], [] ) [ Str "Ctrl-C" ] ] ] +[ Plain [ Span ( "" , [ "mark" ] , [] ) [ Str "Ctrl-C" ] ] ] ``` ``` diff --git a/test/command/5805.md b/test/command/5805.md index f08dca96b..03c72bd75 100644 --- a/test/command/5805.md +++ b/test/command/5805.md @@ -9,7 +9,7 @@ % pandoc -f html -t native Ctrl-C ^D -[ Plain [ Span ( "", [ "kbd" ], [] ) [ Str "Ctrl-C" ] ] ] +[ Plain [ Span ( "" , [ "kbd" ] , [] ) [ Str "Ctrl-C" ] ] ] ``` ``` diff --git a/test/command/5845.md b/test/command/5845.md index d551740b1..aac73cf47 100644 --- a/test/command/5845.md +++ b/test/command/5845.md @@ -12,19 +12,14 @@ Hello World ^D [ Para - [ Str "\\newcommand{" - , RawInline - ( Format "tex" ) "\\highlight" - , Str "}[1]{\\colorbox{yellow}{\\parbox{" - , RawInline - ( Format "tex" ) "\\dimexpr" - , RawInline - ( Format "tex" ) "\\linewidth-2" - , RawInline - ( Format "tex" ) "\\fboxsep" - , Str "}{#1}}" - ] -, Para - [ Str "Hello", Space, Str "World" ] + [ Str "\\newcommand{" + , RawInline (Format "tex") "\\highlight" + , Str "}[1]{\\colorbox{yellow}{\\parbox{" + , RawInline (Format "tex") "\\dimexpr" + , RawInline (Format "tex") "\\linewidth-2" + , RawInline (Format "tex") "\\fboxsep" + , Str "}{#1}}" + ] +, Para [ Str "Hello" , Space , Str "World" ] ] ``` diff --git a/test/command/5878.md b/test/command/5878.md index f3259d8fa..06ff29b76 100644 --- a/test/command/5878.md +++ b/test/command/5878.md @@ -4,14 +4,12 @@ Zozime^[], Synésius^[] ^D [ Para - [ Str "Zozime" - , Note - [ Para [] ] - , Str "," - , SoftBreak - , Str "Syn\233sius" - , Note - [ Para [] ] - ] + [ Str "Zozime" + , Note [ Para [] ] + , Str "," + , SoftBreak + , Str "Syn\233sius" + , Note [ Para [] ] + ] ] ``` diff --git a/test/command/6009.md b/test/command/6009.md index c3000af47..b2785dd36 100644 --- a/test/command/6009.md +++ b/test/command/6009.md @@ -9,17 +9,11 @@ x y ^D -[ RawBlock - ( Format "html" ) "" -, RawBlock - ( Format "html" ) "" -, RawBlock - ( Format "html" ) "" -, RawBlock - ( Format "html" ) "" -, Para - [ Str "x" ] -, CodeBlock - ( "", [], [] ) "y" +[ RawBlock (Format "html") "" +, RawBlock (Format "html") "" +, RawBlock (Format "html") "" +, RawBlock (Format "html") "" +, Para [ Str "x" ] +, CodeBlock ( "" , [] , [] ) "y" ] ``` diff --git a/test/command/6026.md b/test/command/6026.md index f900a5295..ae3bfb45c 100644 --- a/test/command/6026.md +++ b/test/command/6026.md @@ -5,32 +5,32 @@ @https://openreview.net/forum?id=HkwoSDPgg ^D [ Para - [ Cite - [ Citation - { citationId = "https://openreview.net/forum?id=HkwoSDPgg" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = AuthorInText - , citationNoteNum = 1 - , citationHash = 0 - } + [ Cite + [ Citation + { citationId = "https://openreview.net/forum?id=HkwoSDPgg" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "@https://openreview.net/forum?id=HkwoSDPgg" ] ] - [ Str "@https://openreview.net/forum?id=HkwoSDPgg" ] - ] , Para - [ Cite - [ Citation - { citationId = "https://openreview.net/forum?id" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = AuthorInText - , citationNoteNum = 2 - , citationHash = 0 - } + [ Cite + [ Citation + { citationId = "https://openreview.net/forum?id" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 2 + , citationHash = 0 + } + ] + [ Str "@https://openreview.net/forum?id" ] + , Str "=HkwoSDPgg" ] - [ Str "@https://openreview.net/forum?id" ] - , Str "=HkwoSDPgg" - ] ] ``` ``` diff --git a/test/command/6034.md b/test/command/6034.md index 3abf85455..eb8999d11 100644 --- a/test/command/6034.md +++ b/test/command/6034.md @@ -8,6 +8,7 @@ \end{figure*} ^D [ RawBlock - ( Format "latex" ) "\\begin{figure*}\n \\centering\n \\begin{overpic}{test_pic}\n \\put (70,80) {Caption}\n \\end{overpic}\n\\end{figure*}" + (Format "latex") + "\\begin{figure*}\n \\centering\n \\begin{overpic}{test_pic}\n \\put (70,80) {Caption}\n \\end{overpic}\n\\end{figure*}" ] ``` diff --git a/test/command/6114.md b/test/command/6114.md index 9af798b6b..83d2869bb 100644 --- a/test/command/6114.md +++ b/test/command/6114.md @@ -4,10 +4,10 @@ {pic_M87star.pdf} ^D [ Para - [ Image - ( "", [], [ ( "width", ".85\\textwidth" ) ] ) - [ Str "image" ] - ( "pic_M87star.pdf", "" ) - ] + [ Image + ( "" , [] , [ ( "width" , ".85\\textwidth" ) ] ) + [ Str "image" ] + ( "pic_M87star.pdf" , "" ) + ] ] ``` diff --git a/test/command/6137.md b/test/command/6137.md index d6cd34b92..a58b4876f 100644 --- a/test/command/6137.md +++ b/test/command/6137.md @@ -16,136 +16,142 @@ This reference to Figure \ref{fig:label} works fine. \end{figure} ^D [ Para - [ Str "This" - , Space - , Str "reference" - , Space - , Str "to" - , Space - , Str "Table" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref" ), ( "reference", "tbl:label" ) ] - ) - [ Str "1" ] - ( "#tbl:label", "" ) - , Space - , Str "doesn\8217t" - , Space - , Str "work." - ] -, Div - ( "tbl:label", [], [] ) - [ Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "This" - , Space - , Str "caption" - , Space - , Str "has" - , Space - , Str "no" - , Space - , Str "number." - ] - ] - ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) + [ Str "This" + , Space + , Str "reference" + , Space + , Str "to" + , Space + , Str "Table" + , Space + , Link + ( "" + , [] + , [ ( "reference-type" , "ref" ) + , ( "reference" , "tbl:label" ) + ] + ) + [ Str "1" ] + ( "#tbl:label" , "" ) + , Space + , Str "doesn\8217t" + , Space + , Str "work." ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\8212\8212\8211" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\8212\8212\8211" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\8212\8212\8211" ] ] +, Div + ( "tbl:label" , [] , [] ) + [ Table + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "This" + , Space + , Str "caption" + , Space + , Str "has" + , Space + , Str "no" + , Space + , Str "number." + ] + ]) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\8212\8212\8211" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\8212\8212\8211" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\8212\8212\8211" ] ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\8212\8212\8211" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\8212\8212\8211" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\8212\8212\8211" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\8212\8212\8211" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\8212\8212\8211" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\8212\8212\8211" ] ] + ] + ] ] - ] + (TableFoot ( "" , [] , [] ) []) ] - ( TableFoot ( "", [], [] ) [] ) - ] -, Para - [ Str "This" - , Space - , Str "reference" - , Space - , Str "to" - , Space - , Str "Figure" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref" ), ( "reference", "fig:label" ) ] - ) - [ Str "1" ] - ( "#fig:label", "" ) - , Space - , Str "works" - , Space - , Str "fine." - ] , Para - [ Image - ( "fig:label", [], [ ( "width", "\\textwidth" ) ] ) - [ Str "A" + [ Str "This" , Space - , Str "numbered" + , Str "reference" , Space - , Str "caption," + , Str "to" , Space - , Str "if" + , Str "Figure" , Space - , Str "I" + , Link + ( "" + , [] + , [ ( "reference-type" , "ref" ) + , ( "reference" , "fig:label" ) + ] + ) + [ Str "1" ] + ( "#fig:label" , "" ) , Space - , Str "use" + , Str "works" , Space - , Str "pandoc-crossref." + , Str "fine." + ] +, Para + [ Image + ( "fig:label" , [] , [ ( "width" , "\\textwidth" ) ] ) + [ Str "A" + , Space + , Str "numbered" + , Space + , Str "caption," + , Space + , Str "if" + , Space + , Str "I" + , Space + , Str "use" + , Space + , Str "pandoc-crossref." + ] + ( "example.png" , "fig:" ) ] - ( "example.png", "fig:" ) - ] ] ``` diff --git a/test/command/6288.md b/test/command/6288.md index 5314499e0..042e0a72e 100644 --- a/test/command/6288.md +++ b/test/command/6288.md @@ -4,5 +4,7 @@ Introduction ^D -[ Header 1 ( "", [], [] ) [ Str "I.", Space, Str "Introduction" ] ] +[ Header + 1 ( "" , [] , [] ) [ Str "I." , Space , Str "Introduction" ] +] ``` diff --git a/test/command/6324.md b/test/command/6324.md index 758312766..51a22480c 100644 --- a/test/command/6324.md +++ b/test/command/6324.md @@ -13,13 +13,14 @@ Me \end{document} ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "author", MetaList [ MetaInlines [ Str "Me" ] ] ) - , - ( "title", MetaInlines [ Str "Document", Space, Str "title" ] ) - ] + Meta + { unMeta = + fromList + [ ( "author" , MetaList [ MetaInlines [ Str "Me" ] ] ) + , ( "title" + , MetaInlines [ Str "Document" , Space , Str "title" ] + ) + ] } - ) [] + [] ``` diff --git a/test/command/6699.md b/test/command/6699.md index 3f0f129e4..6dfea4ded 100644 --- a/test/command/6699.md +++ b/test/command/6699.md @@ -7,11 +7,9 @@ title text ^D -[ Header 1 - ( "title", [ "allowframebreaks" ], [] ) - [ Str "title" ] -, Para - [ Str "text" ] +[ Header + 1 ( "title" , [ "allowframebreaks" ] , [] ) [ Str "title" ] +, Para [ Str "text" ] ] ``` diff --git a/test/command/6709.md b/test/command/6709.md index 7ed5225ab..419895000 100644 --- a/test/command/6709.md +++ b/test/command/6709.md @@ -7,5 +7,7 @@ if true; then fi ``` ^D -[ CodeBlock ( "", [], [] ) "if true; then\n echo \"yup\"\nfi" ] +[ CodeBlock + ( "" , [] , [] ) "if true; then\n echo \"yup\"\nfi" +] ```` diff --git a/test/command/6719.md b/test/command/6719.md index 1f9e29cf5..23701c066 100644 --- a/test/command/6719.md +++ b/test/command/6719.md @@ -4,7 +4,7 @@ emphasized text ^D -[ Para [ Emph [ Str "emphasized" ], Space, Str "text" ] ] +[ Para [ Emph [ Str "emphasized" ] , Space , Str "text" ] ] ``` ``` @@ -13,6 +13,6 @@ hi there

^D -[ Para [ Emph [ Str "hi" ], Space, Str "there" ] ] +[ Para [ Emph [ Str "hi" ] , Space , Str "there" ] ] ``` diff --git a/test/command/6791.md b/test/command/6791.md index a515007a1..c35c04eb3 100644 --- a/test/command/6791.md +++ b/test/command/6791.md @@ -15,28 +15,33 @@ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignDefault, ColWidth 0.25 ), ( AlignDefault, ColWidth 0.25 ) ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.25 ) + , ( AlignDefault , ColWidth 0.25 ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/6802.md b/test/command/6802.md index 342d173a6..5e66c1d1b 100644 --- a/test/command/6802.md +++ b/test/command/6802.md @@ -2,6 +2,7 @@ % pandoc -f latex -t native \blockquote[test][]{quote} ^D -[ BlockQuote [ Para [ Str "quote" ], Para [ Str "test" ] ] ] +[ BlockQuote [ Para [ Str "quote" ] , Para [ Str "test" ] ] +] ``` diff --git a/test/command/6836.md b/test/command/6836.md index 8c89ee0d2..b8e668a62 100644 --- a/test/command/6836.md +++ b/test/command/6836.md @@ -9,35 +9,33 @@ See @foo. [@buchanan] ^D [ Para - [ Cite - [ Citation - { citationId = "buchanan" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 1 - , citationHash = 0 - } + [ Cite + [ Citation + { citationId = "buchanan" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "[@buchanan]" ] ] - [ Str "[@buchanan]" ] - ] -, OrderedList - ( 1, Example, TwoParens ) [ [] ] +, OrderedList ( 1 , Example , TwoParens ) [ [] ] +, Para [ Str "See" , Space , Str "1." ] , Para - [ Str "See", Space, Str "1." ] -, Para - [ Cite - [ Citation - { citationId = "buchanan" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 2 - , citationHash = 0 - } + [ Cite + [ Citation + { citationId = "buchanan" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 2 + , citationHash = 0 + } + ] + [ Str "[@buchanan]" ] ] - [ Str "[@buchanan]" ] - ] ] ``` diff --git a/test/command/6869.md b/test/command/6869.md index 6e195e944..cbef00f68 100644 --- a/test/command/6869.md +++ b/test/command/6869.md @@ -3,18 +3,17 @@ \cite[„Aber“]{key} ^D [ Para - [ Cite - [ Citation - { citationId = "key" - , citationPrefix = [] - , citationSuffix = - [ Str "\8222Aber\8220" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } + [ Cite + [ Citation + { citationId = "key" + , citationPrefix = [] + , citationSuffix = [ Str "\8222Aber\8220" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline (Format "latex") "\\cite[\8222Aber\8220]{key}" ] ] - [ RawInline ( Format "latex" ) "\\cite[\8222Aber\8220]{key}" ] - ] ] ``` diff --git a/test/command/6873.md b/test/command/6873.md index f2d47b5ad..20667d64c 100644 --- a/test/command/6873.md +++ b/test/command/6873.md @@ -4,37 +4,32 @@ ^D [WARNING] Citeproc: citation key not found [ Para - [ Cite - [ Citation - { citationId = "key" - , citationPrefix = [] - , citationSuffix = - [ Str "\8222Etwas" + [ Cite + [ Citation + { citationId = "key" + , citationPrefix = [] + , citationSuffix = + [ Str "\8222Etwas" + , Space + , Str "[\8230" + , Span ( "" , [] , [] ) [ Str "]" ] + , Space + , Str "auslassen\8220" + ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ Str "(" + , Strong [ Str "key?" ] + , Str "\8222Etwas" , Space , Str "[\8230" - , Span - ( "", [], [] ) - [ Str "]" ] + , Span ( "" , [] , [] ) [ Str "]" ] , Space - , Str "auslassen\8220" + , Str "auslassen\8220)" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - ] - [ Str "(" - , Strong - [ Str "key?" ] - , Str "\8222Etwas" - , Space - , Str "[\8230" - , Span - ( "", [], [] ) - [ Str "]" ] - , Space - , Str "auslassen\8220)" ] - ] ] ``` diff --git a/test/command/6890.md b/test/command/6890.md index 71f53bb13..579342980 100644 --- a/test/command/6890.md +++ b/test/command/6890.md @@ -28,42 +28,15 @@ Some text.[^1] [^1]: @fruchtel-sozialer-2013a ^D [ Para - [ Cite - [ Citation - { citationId = "fruchtel-sozialer-2013a" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = AuthorInText - , citationNoteNum = 1 - , citationHash = 0 - } - ] - [ Str "Fr\252chtel," - , Space - , Str "Budde," - , Space - , Str "and" - , Space - , Str "Cyprian" - , Space - , Str "(2013)" - ] - ] -, Para - [ Str "Some" - , Space - , Str "text." - , Note - [ Para - [ Cite + [ Cite [ Citation - { citationId = "fruchtel-sozialer-2013a" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = AuthorInText - , citationNoteNum = 2 - , citationHash = 0 - } + { citationId = "fruchtel-sozialer-2013a" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 1 + , citationHash = 0 + } ] [ Str "Fr\252chtel," , Space @@ -75,65 +48,95 @@ Some text.[^1] , Space , Str "(2013)" ] - ] ] - ] +, Para + [ Str "Some" + , Space + , Str "text." + , Note + [ Para + [ Cite + [ Citation + { citationId = "fruchtel-sozialer-2013a" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 2 + , citationHash = 0 + } + ] + [ Str "Fr\252chtel," + , Space + , Str "Budde," + , Space + , Str "and" + , Space + , Str "Cyprian" + , Space + , Str "(2013)" + ] + ] + ] + ] , Div - ( "refs", [ "references", "csl-bib-body", "hanging-indent" ], [] ) - [ Div - ( "ref-fruchtel-sozialer-2013a", [ "csl-entry" ], [] ) - [ Para - [ Str "Fr\252chtel," - , Space - , Str "Frank," - , Space - , Str "Wolfgang" - , Space - , Str "Budde," - , Space - , Str "and" - , Space - , Str "Gudrun" - , Space - , Str "Cyprian." - , Space - , Str "2013." - , Space - , Emph - [ Str "Sozialer" - , Space - , Str "Raum" - , Space - , Str "und" - , Space - , Str "Soziale" - , Space - , Str "Arbeit" - , Space - , Str "Fieldbook:" - , Space - , Str "Methoden" - , Space - , Str "und" - , Space - , Str "Techniken" + ( "refs" + , [ "references" , "csl-bib-body" , "hanging-indent" ] + , [] + ) + [ Div + ( "ref-fruchtel-sozialer-2013a" , [ "csl-entry" ] , [] ) + [ Para + [ Str "Fr\252chtel," + , Space + , Str "Frank," + , Space + , Str "Wolfgang" + , Space + , Str "Budde," + , Space + , Str "and" + , Space + , Str "Gudrun" + , Space + , Str "Cyprian." + , Space + , Str "2013." + , Space + , Emph + [ Str "Sozialer" + , Space + , Str "Raum" + , Space + , Str "und" + , Space + , Str "Soziale" + , Space + , Str "Arbeit" + , Space + , Str "Fieldbook:" + , Space + , Str "Methoden" + , Space + , Str "und" + , Space + , Str "Techniken" + ] + , Str "." + , Space + , Str "3rd" + , Space + , Str "ed." + , Space + , Str "Wiesbaden," + , Space + , Str "Germany:" + , Space + , Str "Springer" + , Space + , Str "VS." + ] ] - , Str "." - , Space - , Str "3rd" - , Space - , Str "ed." - , Space - , Str "Wiesbaden," - , Space - , Str "Germany:" - , Space - , Str "Springer" - , Space - , Str "VS." - ] ] - ] ] ``` diff --git a/test/command/6993.md b/test/command/6993.md index 17a7056e2..d2baa2748 100644 --- a/test/command/6993.md +++ b/test/command/6993.md @@ -2,20 +2,32 @@ % pandoc -f mediawiki -t native '''Should be bold ''' ^D -[ Para [ Strong [ Str "Should", Space, Str "be", Space, Str "bold" ] ] ] +[ Para + [ Strong + [ Str "Should" , Space , Str "be" , Space , Str "bold" ] + ] +] ``` ``` % pandoc -f mediawiki -t native ''' Should be bold''' ^D -[ Para [ Strong [ Str "Should", Space, Str "be", Space, Str "bold" ] ] ] +[ Para + [ Strong + [ Str "Should" , Space , Str "be" , Space , Str "bold" ] + ] +] ``` ``` % pandoc -f mediawiki -t native '' Should be emph '' ^D -[ Para [ Emph [ Str "Should", Space, Str "be", Space, Str "emph" ] ] ] +[ Para + [ Emph + [ Str "Should" , Space , Str "be" , Space , Str "emph" ] + ] +] ``` diff --git a/test/command/7003.md b/test/command/7003.md index 4f5e18c70..5f88a58a6 100644 --- a/test/command/7003.md +++ b/test/command/7003.md @@ -30,21 +30,29 @@ This a Foo section \lstinputlisting{example.tex} \end{document} ^D -[ Header 1 - ( "with-lstlisting-environment", [], [] ) - [ Str "With", Space, Str "lstlisting", Space, Str "environment" ] +[ Header + 1 + ( "with-lstlisting-environment" , [] , [] ) + [ Str "With" + , Space + , Str "lstlisting" + , Space + , Str "environment" + ] , CodeBlock - ( "" - , [] - , [] - ) "\\documentclass{article}\n\\begin{document}\n\\section{Foo}\nThis a Foo section\n\\end{document}" -, Header 1 - ( "with-lstinputlisting-command", [], [] ) - [ Str "With", Space, Str "lstinputlisting", Space, Str "command" ] + ( "" , [] , [] ) + "\\documentclass{article}\n\\begin{document}\n\\section{Foo}\nThis a Foo section\n\\end{document}" +, Header + 1 + ( "with-lstinputlisting-command" , [] , [] ) + [ Str "With" + , Space + , Str "lstinputlisting" + , Space + , Str "command" + ] , CodeBlock - ( "" - , [ "latex" ] - , [] - ) "\\documentclass{article}\n\\begin{document}\n\\section{Bar}\nThis a Bar section\n\\end{document}" + ( "" , [ "latex" ] , [] ) + "\\documentclass{article}\n\\begin{document}\n\\section{Bar}\nThis a Bar section\n\\end{document}" ] ``` diff --git a/test/command/7080.md b/test/command/7080.md index 3f17c6d46..565a6544d 100644 --- a/test/command/7080.md +++ b/test/command/7080.md @@ -5,9 +5,13 @@ [image]: image.png width=100px height=150px ^D [ Para - [ Image - ( "", [], [ ( "width", "100px" ), ( "height", "150px" ) ] ) [] - ( "image.png", "" ) - ] + [ Image + ( "" + , [] + , [ ( "width" , "100px" ) , ( "height" , "150px" ) ] + ) + [] + ( "image.png" , "" ) + ] ] ``` diff --git a/test/command/7092.md b/test/command/7092.md index 0c1d1ae8c..d6a526392 100644 --- a/test/command/7092.md +++ b/test/command/7092.md @@ -4,5 +4,7 @@ \em{\parseMe{foo}} ^D -[ Para [ Emph [ RawInline ( Format "latex" ) "\\parseMe{foo}" ] ] ] +[ Para + [ Emph [ RawInline (Format "latex") "\\parseMe{foo}" ] ] +] ``` diff --git a/test/command/7129.md b/test/command/7129.md index caabc99a3..14005f0d1 100644 --- a/test/command/7129.md +++ b/test/command/7129.md @@ -6,44 +6,50 @@ \end{tabular} ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignLeft, ColWidthDefault ), ( AlignLeft, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "FOO" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "BAR" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "foo" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Code ( "", [], [] ) "b&r" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "FOO" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "BAR" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "foo" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Code ( "" , [] , [] ) "b&r" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/7134.md b/test/command/7134.md index 24980fabb..041d7ea24 100644 --- a/test/command/7134.md +++ b/test/command/7134.md @@ -9,43 +9,43 @@ This is a paragraph. This should be a second block quote. ^D [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "paragraph." - ] -, BlockQuote - [ Para [ Str "This" , Space , Str "is" , Space , Str "a" , Space - , Str "block" - , Space - , Str "quote." + , Str "paragraph." ] - ] , BlockQuote - [ Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "second" - , Space - , Str "block" - , Space - , Str "quote." + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + ] + ] +, BlockQuote + [ Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "second" + , Space + , Str "block" + , Space + , Str "quote." + ] ] - ] ] ``` diff --git a/test/command/7145.md b/test/command/7145.md index 21310ccdf..623f40880 100644 --- a/test/command/7145.md +++ b/test/command/7145.md @@ -9,67 +9,64 @@ empty linebreaks Nulla ut massa eget ex venenatis lobortis id in eros. ^D [ Para - [ Str "Maecenas" - , Space - , Str "at" - , Space - , Str "sapien" - , Space - , Str "tempor," - , Space - , Str "pretium" - , Space - , Str "turpis" - , Space - , Str "ut," - , Space - , Str "imperdiet" - , Space - , Str "augue." - , Note - [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "multiline" - ] - , Para - [ Str "reference" - , SoftBreak - , RawInline - ( Format "html" ) "" - , Str "with" - , RawInline - ( Format "html" ) "" - , SoftBreak - , Str "empty" - ] - , Para - [ Str "linebreaks" ] + [ Str "Maecenas" + , Space + , Str "at" + , Space + , Str "sapien" + , Space + , Str "tempor," + , Space + , Str "pretium" + , Space + , Str "turpis" + , Space + , Str "ut," + , Space + , Str "imperdiet" + , Space + , Str "augue." + , Note + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "multiline" + ] + , Para + [ Str "reference" + , SoftBreak + , RawInline (Format "html") "" + , Str "with" + , RawInline (Format "html") "" + , SoftBreak + , Str "empty" + ] + , Para [ Str "linebreaks" ] + ] + , Space + , Str "Nulla" + , Space + , Str "ut" + , Space + , Str "massa" + , Space + , Str "eget" + , Space + , Str "ex" + , Space + , Str "venenatis" + , Space + , Str "lobortis" + , Space + , Str "id" + , Space + , Str "in" + , Space + , Str "eros." ] - , Space - , Str "Nulla" - , Space - , Str "ut" - , Space - , Str "massa" - , Space - , Str "eget" - , Space - , Str "ex" - , Space - , Str "venenatis" - , Space - , Str "lobortis" - , Space - , Str "id" - , Space - , Str "in" - , Space - , Str "eros." - ] ] ``` diff --git a/test/command/7155.md b/test/command/7155.md index 5e26e4469..454c387d5 100644 --- a/test/command/7155.md +++ b/test/command/7155.md @@ -4,14 +4,14 @@ \\(x\\) \\[x\\] ^D [ Para - [ Math InlineMath "x" - , Space - , Math DisplayMath "x" - , SoftBreak - , Str "\\(x\\)" - , Space - , Str "\\[x\\]" - ] + [ Math InlineMath "x" + , Space + , Math DisplayMath "x" + , SoftBreak + , Str "\\(x\\)" + , Space + , Str "\\[x\\]" + ] ] ``` @@ -21,13 +21,13 @@ \\(x\\) \\[x\\] ^D [ Para - [ Str "(x)" - , Space - , Str "[x]" - , SoftBreak - , Math InlineMath "x" - , Space - , Math DisplayMath "x" - ] + [ Str "(x)" + , Space + , Str "[x]" + , SoftBreak + , Math InlineMath "x" + , Space + , Math DisplayMath "x" + ] ] ``` diff --git a/test/command/7339.md b/test/command/7339.md index 31bfc7f1c..f8d004f68 100644 --- a/test/command/7339.md +++ b/test/command/7339.md @@ -7,8 +7,9 @@ title: Test Hi ^D Pandoc - ( Meta - { unMeta = fromList [ ( "title", MetaInlines [ Str "Test" ] ) ] } - ) + Meta + { unMeta = + fromList [ ( "title" , MetaInlines [ Str "Test" ] ) ] + } [ Para [ Str "Hi" ] ] ``` diff --git a/test/command/7400.md b/test/command/7400.md index d93c203b2..785ded88d 100644 --- a/test/command/7400.md +++ b/test/command/7400.md @@ -4,6 +4,5 @@ # Comment only ... ^D -Pandoc - ( Meta { unMeta = fromList [] } ) [] +Pandoc Meta { unMeta = fromList [] } [] ``` diff --git a/test/command/7434.md b/test/command/7434.md index 61740f8fe..e4f2743a1 100644 --- a/test/command/7434.md +++ b/test/command/7434.md @@ -10,14 +10,14 @@ [\*\a](x) ^D [ RawBlock - ( Format "tex" ) "\\begin{proof}\n\\newcommand{\\x}{\\left.\\right.}\n\\left.\\right.\n\\end{proof}" + (Format "tex") + "\\begin{proof}\n\\newcommand{\\x}{\\left.\\right.}\n\\left.\\right.\n\\end{proof}" +, Para [ Str "1234567890abcdefghi" ] , Para - [ Str "1234567890abcdefghi" ] -, Para - [ Link - ( "", [], [] ) - [ Str "*", RawInline ( Format "tex" ) "\\a" ] - ( "x", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "*" , RawInline (Format "tex") "\\a" ] + ( "x" , "" ) + ] ] ``` diff --git a/test/command/7436.md b/test/command/7436.md index 3e1829ca8..c2d434d60 100644 --- a/test/command/7436.md +++ b/test/command/7436.md @@ -9,25 +9,23 @@ .. include:: command/three.txt ^D [ CodeBlock - ( "", [ "" ], [ ( "code", "" ) ] ) "1st line.\n2nd line.\n3rd line.\n" + ( "" , [ "" ] , [ ( "code" , "" ) ] ) + "1st line.\n2nd line.\n3rd line.\n" , CodeBlock - ( "" - , [ "" ] - , - [ ( "literal", "" ) ] - ) "1st line.\n2nd line.\n3rd line.\n" + ( "" , [ "" ] , [ ( "literal" , "" ) ] ) + "1st line.\n2nd line.\n3rd line.\n" , Para - [ Str "1st" - , Space - , Str "line." - , SoftBreak - , Str "2nd" - , Space - , Str "line." - , SoftBreak - , Str "3rd" - , Space - , Str "line." - ] + [ Str "1st" + , Space + , Str "line." + , SoftBreak + , Str "2nd" + , Space + , Str "line." + , SoftBreak + , Str "3rd" + , Space + , Str "line." + ] ] ``` diff --git a/test/command/7557.md b/test/command/7557.md index 910761c7e..c837d0b3c 100644 --- a/test/command/7557.md +++ b/test/command/7557.md @@ -3,19 +3,18 @@ - 11. and 12. 09. meeting ^D [ BulletList - [ - [ Plain - [ Str "11." - , Space - , Str "and" - , Space - , Str "12." - , Space - , Str "09." - , Space - , Str "meeting" + [ [ Plain + [ Str "11." + , Space + , Str "and" + , Space + , Str "12." + , Space + , Str "09." + , Space + , Str "meeting" + ] ] ] - ] ] ``` diff --git a/test/command/7589.md b/test/command/7589.md index f9e8fb14f..aff21dad8 100644 --- a/test/command/7589.md +++ b/test/command/7589.md @@ -15,59 +15,58 @@ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "experience" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "expertise" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "paradigms" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "haskell" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "name" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "image" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody ( "", [], [] ) ( RowHeadColumns 0 ) [] [] ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "experience" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "expertise" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "paradigms" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "haskell" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "name" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "image" ] ] + ] + ]) + [ TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [] ] + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/934.md b/test/command/934.md index 195d5602e..3c86a1f26 100644 --- a/test/command/934.md +++ b/test/command/934.md @@ -8,36 +8,37 @@ \ddb{This should be italic and in quotes}{And this is the attribution} ^D [ Para - [ Emph - [ Quoted DoubleQuote - [ Str "This" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "italic" - , Space - , Str "and" - , Space - , Str "in" - , Space - , Str "quotes" - ] + [ Emph + [ Quoted + DoubleQuote + [ Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "italic" + , Space + , Str "and" + , Space + , Str "in" + , Space + , Str "quotes" + ] + ] ] - ] , Para - [ Strong - [ Str "And" - , Space - , Str "this" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "attribution" + [ Strong + [ Str "And" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "attribution" + ] ] - ] ] ``` diff --git a/test/command/adjacent_latex_blocks.md b/test/command/adjacent_latex_blocks.md index 3d3334424..4483d6e3f 100644 --- a/test/command/adjacent_latex_blocks.md +++ b/test/command/adjacent_latex_blocks.md @@ -4,9 +4,7 @@ \listoftables ^D -[ RawBlock - ( Format "tex" ) "\\listoffigures" -, RawBlock - ( Format "tex" ) "\\listoftables" +[ RawBlock (Format "tex") "\\listoffigures" +, RawBlock (Format "tex") "\\listoftables" ] ``` diff --git a/test/command/cite-in-inline-note.md b/test/command/cite-in-inline-note.md index 409e389b9..aa61b93e8 100644 --- a/test/command/cite-in-inline-note.md +++ b/test/command/cite-in-inline-note.md @@ -3,24 +3,24 @@ foo^[bar [@doe]] ^D [ Para - [ Str "foo" - , Note - [ Para - [ Str "bar" - , Space - , Cite - [ Citation - { citationId = "doe" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 1 - , citationHash = 0 - } + [ Str "foo" + , Note + [ Para + [ Str "bar" + , Space + , Cite + [ Citation + { citationId = "doe" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "[@doe]" ] + ] ] - [ Str "[@doe]" ] - ] ] - ] ] ``` diff --git a/test/command/citeproc-author-in-text-suffix.md b/test/command/citeproc-author-in-text-suffix.md index 4e511fd1b..df3184aa8 100644 --- a/test/command/citeproc-author-in-text-suffix.md +++ b/test/command/citeproc-author-in-text-suffix.md @@ -3,26 +3,32 @@ @a [p. 33; @b] ^D [ Para - [ Cite - [ Citation - { citationId = "a" - , citationPrefix = [] - , citationSuffix = - [ Str "p.\160\&33" ] - , citationMode = AuthorInText - , citationNoteNum = 1 - , citationHash = 0 - } - , Citation - { citationId = "b" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 1 - , citationHash = 0 - } + [ Cite + [ Citation + { citationId = "a" + , citationPrefix = [] + , citationSuffix = [ Str "p.\160\&33" ] + , citationMode = AuthorInText + , citationNoteNum = 1 + , citationHash = 0 + } + , Citation + { citationId = "b" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "@a" + , Space + , Str "[p." + , Space + , Str "33;" + , Space + , Str "@b]" + ] ] - [ Str "@a", Space, Str "[p.", Space, Str "33;", Space, Str "@b]" ] - ] ] ``` diff --git a/test/command/csv.md b/test/command/csv.md index d1d92d43e..353512553 100644 --- a/test/command/csv.md +++ b/test/command/csv.md @@ -6,94 +6,97 @@ Apple,25 cents,33 ,,45 ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Fruit" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Price" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Quantity" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Apple" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "25", Space, Str "cents" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "33" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\"Navel\"", Space, Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "35", Space, Str "cents" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "22" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "45" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Fruit" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Price" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Quantity" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Apple" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "25" , Space , Str "cents" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "33" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\"Navel\"" , Space , Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "35" , Space , Str "cents" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "22" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + , Cell + ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "45" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/docbook-bibliography.md b/test/command/docbook-bibliography.md index 2709bddd3..6e42732ad 100644 --- a/test/command/docbook-bibliography.md +++ b/test/command/docbook-bibliography.md @@ -13,35 +13,33 @@ ^D -[ Header 1 - ( "", [], [] ) - [ Str "Document", Space, Str "References" ] +[ Header + 1 + ( "" , [] , [] ) + [ Str "Document" , Space , Str "References" ] , Para - [ Span - ( "refTheFirst", [], [] ) [] - , Str "[1]" - , Space - , Str "First" - , Space - , Str "reference" - ] + [ Span ( "refTheFirst" , [] , [] ) [] + , Str "[1]" + , Space + , Str "First" + , Space + , Str "reference" + ] , Para - [ Span - ( "refTheSecond", [], [] ) [] - , Str "[2]" - , Space - , Str "Second" - , Space - , Str "reference" - ] + [ Span ( "refTheSecond" , [] , [] ) [] + , Str "[2]" + , Space + , Str "Second" + , Space + , Str "reference" + ] , Para - [ Span - ( "refTheThird", [], [] ) [] - , Str "[3]" - , Space - , Str "Third" - , Space - , Str "reference" - ] + [ Span ( "refTheThird" , [] , [] ) [] + , Str "[3]" + , Space + , Str "Third" + , Space + , Str "reference" + ] ] ``` diff --git a/test/command/dots.md b/test/command/dots.md index c98a67026..cd9a978cf 100644 --- a/test/command/dots.md +++ b/test/command/dots.md @@ -6,5 +6,8 @@ \vdots ^D -[ Para [ Str "\8230" ], Para [ Str "\8230" ], Para [ Str "\8942" ] ] +[ Para [ Str "\8230" ] +, Para [ Str "\8230" ] +, Para [ Str "\8942" ] +] ``` diff --git a/test/command/empty_paragraphs.md b/test/command/empty_paragraphs.md index 1f7c73fae..6efbab9cd 100644 --- a/test/command/empty_paragraphs.md +++ b/test/command/empty_paragraphs.md @@ -2,28 +2,32 @@ % pandoc -f native -t docx -o - | pandoc -f docx -t native [Para [Str "hi"], Para [], Para [], Para [Str "lo"]] ^D -[ Para [ Str "hi" ], Para [ Str "lo" ] ] +[ Para [ Str "hi" ] , Para [ Str "lo" ] ] ``` ``` % pandoc -f native -t docx+empty_paragraphs -o - | pandoc -f docx -t native [Para [Str "hi"], Para [], Para [], Para [Str "lo"]] ^D -[ Para [ Str "hi" ], Para [ Str "lo" ] ] +[ Para [ Str "hi" ] , Para [ Str "lo" ] ] ``` ``` % pandoc -f native -t docx -o - | pandoc -f docx+empty_paragraphs -t native [Para [Str "hi"], Para [], Para [], Para [Str "lo"]] ^D -[ Para [ Str "hi" ], Para [ Str "lo" ] ] +[ Para [ Str "hi" ] , Para [ Str "lo" ] ] ``` ``` % pandoc -f native -t docx+empty_paragraphs -o - | pandoc -f docx+empty_paragraphs -t native [Para [Str "hi"], Para [], Para [], Para [Str "lo"]] ^D -[ Para [ Str "hi" ], Para [], Para [], Para [ Str "lo" ] ] +[ Para [ Str "hi" ] +, Para [] +, Para [] +, Para [ Str "lo" ] +] ``` ``` @@ -51,7 +55,11 @@

lo

^D -[ Para [ Str "hi" ], Para [], Para [], Para [ Str "lo" ] ] +[ Para [ Str "hi" ] +, Para [] +, Para [] +, Para [ Str "lo" ] +] ``` ``` @@ -61,7 +69,7 @@

lo

^D -[ Para [ Str "hi" ], Para [ Str "lo" ] ] +[ Para [ Str "hi" ] , Para [ Str "lo" ] ] ``` ``` diff --git a/test/command/gfm.md b/test/command/gfm.md index 9822b993d..78736b2d6 100644 --- a/test/command/gfm.md +++ b/test/command/gfm.md @@ -8,58 +8,66 @@ gfm tests: | orange|1.12| ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignDefault, ColWidthDefault ), ( AlignRight, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Fruit" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Price" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "apple" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "0.13" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1.12" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Fruit" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Price" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "apple" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "0.13" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1.12" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` @@ -67,7 +75,8 @@ gfm tests: % pandoc -f gfm -t native ~~stricken out~~ ^D -[ Para [ Strikeout [ Str "stricken", Space, Str "out" ] ] ] +[ Para [ Strikeout [ Str "stricken" , Space , Str "out" ] ] +] ``` ``` @@ -76,15 +85,10 @@ gfm tests: ## Header # -foo-bar_baz ^D -[ Header 1 - ( "header", [], [] ) - [ Str "Header" ] -, Header 2 - ( "header-1", [], [] ) - [ Str "Header" ] -, Header 1 - ( "-foo-bar_baz", [], [] ) - [ Str "-foo-bar_baz" ] +[ Header 1 ( "header" , [] , [] ) [ Str "Header" ] +, Header 2 ( "header-1" , [] , [] ) [ Str "Header" ] +, Header + 1 ( "-foo-bar_baz" , [] , [] ) [ Str "-foo-bar_baz" ] ] ``` @@ -93,15 +97,15 @@ gfm tests: 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" ] - ] + [ Str "My" + , Span + ( "" , [ "emoji" ] , [ ( "data-emoji" , "thumbsup" ) ] ) + [ Str "\128077" ] + , Str "emoji" + , Span + ( "" , [ "emoji" ] , [ ( "data-emoji" , "heart" ) ] ) + [ Str "\10084\65039" ] + ] ] ``` @@ -180,7 +184,7 @@ The caption. hi hi ^D -[ Para [ Str "hi", LineBreak, Str "hi" ] ] +[ Para [ Str "hi" , LineBreak , Str "hi" ] ] ``` ``` @@ -189,11 +193,9 @@ hi - [x] bar ^D [ BulletList - [ - [ Plain [ Str "\9744", Space, Str "foo" ] ] - , - [ Plain [ Str "\9746", Space, Str "bar" ] ] - ] + [ [ Plain [ Str "\9744" , Space , Str "foo" ] ] + , [ Plain [ Str "\9746" , Space , Str "bar" ] ] + ] ] ``` @@ -203,11 +205,10 @@ hi - [x] bar ^D [ BulletList - [ - [ Plain [ Str "[", Space, Str "]", Space, Str "foo" ] ] - , - [ Plain [ Str "[x]", Space, Str "bar" ] ] - ] + [ [ Plain [ Str "[" , Space , Str "]" , Space , Str "foo" ] + ] + , [ Plain [ Str "[x]" , Space , Str "bar" ] ] + ] ] ``` diff --git a/test/command/hspace.md b/test/command/hspace.md index 8e2d19d8b..c011f17fc 100644 --- a/test/command/hspace.md +++ b/test/command/hspace.md @@ -9,7 +9,8 @@ Here they need to be inline: \end{figure} ^D [ RawBlock - ( Format "tex" ) "\\begin{figure}\n\\includegraphics{lalune.jpg}\n\\caption{lalune \\hspace{2em} \\vspace{1em} bloo}\n\\end{figure}" + (Format "tex") + "\\begin{figure}\n\\includegraphics{lalune.jpg}\n\\caption{lalune \\hspace{2em} \\vspace{1em} bloo}\n\\end{figure}" ] ``` @@ -35,7 +36,8 @@ F & F &\\ \end{tabular} ^D [ RawBlock - ( Format "tex" ) "\\begin{tabular}[t]{cc|c}\n\\(P\\) & \\(Q\\) & \\(P\\wedge Q\\)\\\\\n\\hline\nT & T &\\\\\nT & F &\\\\\nF & T &\\\\\nF & F &\\\\\n\\end{tabular}\n\\hspace{1em}\n\\begin{tabular}[t]{cc|c}\n\\(P\\) & \\(Q\\) & \\(P\\vee Q\\)\\\\\n\\hline\nT & T &\\\\\nT & F &\\\\\nF & T &\\\\\nF & F &\\\\\n\\end{tabular}" + (Format "tex") + "\\begin{tabular}[t]{cc|c}\n\\(P\\) & \\(Q\\) & \\(P\\wedge Q\\)\\\\\n\\hline\nT & T &\\\\\nT & F &\\\\\nF & T &\\\\\nF & F &\\\\\n\\end{tabular}\n\\hspace{1em}\n\\begin{tabular}[t]{cc|c}\n\\(P\\) & \\(Q\\) & \\(P\\vee Q\\)\\\\\n\\hline\nT & T &\\\\\nT & F &\\\\\nF & T &\\\\\nF & F &\\\\\n\\end{tabular}" ] ``` @@ -44,7 +46,10 @@ F & F &\\ hi\hspace{1em}there ^D [ Para - [ Str "hi", RawInline ( Format "tex" ) "\\hspace{1em}", Str "there" ] + [ Str "hi" + , RawInline (Format "tex") "\\hspace{1em}" + , Str "there" + ] ] ``` @@ -56,11 +61,8 @@ hi there ^D -[ Para - [ Str "hi" ] -, RawBlock - ( Format "tex" ) "\\hspace{1em}" -, Para - [ Str "there" ] +[ Para [ Str "hi" ] +, RawBlock (Format "tex") "\\hspace{1em}" +, Para [ Str "there" ] ] ``` diff --git a/test/command/html-read-figure.md b/test/command/html-read-figure.md index 5b40c8b0d..dd9c8d9d9 100644 --- a/test/command/html-read-figure.md +++ b/test/command/html-read-figure.md @@ -6,7 +6,9 @@ ^D [ Para - [ Image ( "", [], [] ) [ Str "bar" ] ( "foo.png", "fig:voyage" ) ] + [ Image + ( "" , [] , [] ) [ Str "bar" ] ( "foo.png" , "fig:voyage" ) + ] ] ``` @@ -28,7 +30,9 @@ ^D -[ Para [ Image ( "", [], [] ) [] ( "foo.png", "fig:voyage" ) ] ] +[ Para + [ Image ( "" , [] , [] ) [] ( "foo.png" , "fig:voyage" ) ] +] ``` ``` @@ -39,7 +43,9 @@ ^D [ Para - [ Image ( "", [], [] ) [ Str "bar" ] ( "foo.png", "fig:voyage" ) ] + [ Image + ( "" , [] , [] ) [ Str "bar" ] ( "foo.png" , "fig:voyage" ) + ] ] ``` @@ -48,10 +54,10 @@
this is ignored
bar baz
^D [ Para - [ Image - ( "", [], [] ) - [ Str "bar", Space, Strong [ Str "baz" ] ] - ( "foo.png", "fig:voyage" ) - ] + [ Image + ( "" , [] , [] ) + [ Str "bar" , Space , Strong [ Str "baz" ] ] + ( "foo.png" , "fig:voyage" ) + ] ] ``` diff --git a/test/command/html-trim-definition-list-terms.md b/test/command/html-trim-definition-list-terms.md index 6733cdd77..d2b019996 100644 --- a/test/command/html-trim-definition-list-terms.md +++ b/test/command/html-trim-definition-list-terms.md @@ -12,12 +12,14 @@ ^D [ DefinitionList - [ - ( - [ Str "foo", SoftBreak, Str "bar", LineBreak, Str "baz" ] - , - [ [ Plain [ Str "test" ] ] ] - ) - ] + [ ( [ Str "foo" + , SoftBreak + , Str "bar" + , LineBreak + , Str "baz" + ] + , [ [ Plain [ Str "test" ] ] ] + ) + ] ] ``` diff --git a/test/command/hyphenat.md b/test/command/hyphenat.md index e584e1608..ca418c111 100644 --- a/test/command/hyphenat.md +++ b/test/command/hyphenat.md @@ -30,7 +30,9 @@ C\colonhyp\bshyp{}Windows\bshyp % pandoc -f latex -t native \nohyphens{Pneumonoultramicroscopicsilicovolcanoconiosis} ^D -[ Para [ Str "Pneumonoultramicroscopicsilicovolcanoconiosis" ] ] +[ Para + [ Str "Pneumonoultramicroscopicsilicovolcanoconiosis" ] +] ``` ``` @@ -38,9 +40,10 @@ C\colonhyp\bshyp{}Windows\bshyp \textnhtt{Pneumonoultramicroscopicsilicovolcanoconiosis} ^D [ Para - [ Code - ( "", [], [] ) "Pneumonoultramicroscopicsilicovolcanoconiosis" - ] + [ Code + ( "" , [] , [] ) + "Pneumonoultramicroscopicsilicovolcanoconiosis" + ] ] ``` @@ -49,9 +52,10 @@ C\colonhyp\bshyp{}Windows\bshyp \nhttfamily{Pneumonoultramicroscopicsilicovolcanoconiosis} ^D [ Para - [ Code - ( "", [], [] ) "Pneumonoultramicroscopicsilicovolcanoconiosis" - ] + [ Code + ( "" , [] , [] ) + "Pneumonoultramicroscopicsilicovolcanoconiosis" + ] ] ``` diff --git a/test/command/ifstrequal.md b/test/command/ifstrequal.md index 6ced0f016..92fe6bf95 100644 --- a/test/command/ifstrequal.md +++ b/test/command/ifstrequal.md @@ -6,6 +6,11 @@ \h{b} ^D [ Para - [ Emph [ Str "no" ], SoftBreak, Str "\225", SoftBreak, Str "b" ] + [ Emph [ Str "no" ] + , SoftBreak + , Str "\225" + , SoftBreak + , Str "b" + ] ] ``` diff --git a/test/command/indented-fences.md b/test/command/indented-fences.md index 302c54621..12aade1a7 100644 --- a/test/command/indented-fences.md +++ b/test/command/indented-fences.md @@ -5,7 +5,7 @@ in y ``` ^D -[ CodeBlock ( "", [ "haskell" ], [] ) "let x = y\nin y" ] +[ CodeBlock ( "" , [ "haskell" ] , [] ) "let x = y\nin y" ] ````` ````` % pandoc -t native @@ -16,5 +16,7 @@ y + y ~~~ ^D -[ CodeBlock ( "", [ "haskell" ], [] ) " let x = y\nin y +\ny +\ny" ] +[ CodeBlock + ( "" , [ "haskell" ] , [] ) " let x = y\nin y +\ny +\ny" +] ````` diff --git a/test/command/input-with-endinput.md b/test/command/input-with-endinput.md index b97950d31..55d298bc4 100644 --- a/test/command/input-with-endinput.md +++ b/test/command/input-with-endinput.md @@ -8,11 +8,8 @@ Visible Visible \end{document} ^D -[ Para - [ Str "Visible" ] -, Para - [ Emph [ Str "hi", Space, Str "there" ] ] -, Para - [ Str "Visible" ] +[ Para [ Str "Visible" ] +, Para [ Emph [ Str "hi" , Space , Str "there" ] ] +, Para [ Str "Visible" ] ] ``` diff --git a/test/command/latex-center.md b/test/command/latex-center.md index 71e4fbabc..078a58068 100644 --- a/test/command/latex-center.md +++ b/test/command/latex-center.md @@ -7,6 +7,6 @@ Hello \end{center} ^D -[ Div ( "", [ "center" ], [] ) [ Para [ Str "Hello" ] ] ] +[ Div ( "" , [ "center" ] , [] ) [ Para [ Str "Hello" ] ] ] ``` diff --git a/test/command/latex-color.md b/test/command/latex-color.md index ad24528ec..a1f2c3f2a 100644 --- a/test/command/latex-color.md +++ b/test/command/latex-color.md @@ -5,12 +5,11 @@ Hello \textcolor{red}{World} ^D [ Para - [ Str "Hello" - , Space - , Span - ( "", [], [ ( "style", "color: red" ) ] ) - [ Str "World" ] - ] + [ Str "Hello" + , Space + , Span + ( "" , [] , [ ( "style" , "color: red" ) ] ) [ Str "World" ] + ] ] ``` @@ -19,12 +18,11 @@ Hello \textcolor{red}{World} \textcolor{red}{Hello} World ^D [ Para - [ Span - ( "", [], [ ( "style", "color: red" ) ] ) - [ Str "Hello" ] - , Space - , Str "World" - ] + [ Span + ( "" , [] , [ ( "style" , "color: red" ) ] ) [ Str "Hello" ] + , Space + , Str "World" + ] ] ``` @@ -33,12 +31,12 @@ Hello \textcolor{red}{World} Hello \textcolor{blue}{\textbf{World}} ^D [ Para - [ Str "Hello" - , Space - , Span - ( "", [], [ ( "style", "color: blue" ) ] ) - [ Strong [ Str "World" ] ] - ] + [ Str "Hello" + , Space + , Span + ( "" , [] , [ ( "style" , "color: blue" ) ] ) + [ Strong [ Str "World" ] ] + ] ] ``` @@ -48,13 +46,13 @@ Hello \textcolor{blue}{\textbf{World}} Hello \textcolor{blue}{\textbf{World}}. ^D [ Para - [ Str "Hello" - , Space - , Span - ( "", [], [ ( "style", "color: blue" ) ] ) - [ Strong [ Str "World" ] ] - , Str "." - ] + [ Str "Hello" + , Space + , Span + ( "" , [] , [ ( "style" , "color: blue" ) ] ) + [ Strong [ Str "World" ] ] + , Str "." + ] ] ``` @@ -68,14 +66,12 @@ Hello \textcolor{blue}{\textbf{World}}. } ^D [ Div - ( "", [], [ ( "style", "color: orange" ) ] ) - [ BulletList - [ - [ Para [ Str "Item", Space, Str "1" ] ] - , - [ Para [ Str "Item", Space, Str "2" ] ] + ( "" , [] , [ ( "style" , "color: orange" ) ] ) + [ BulletList + [ [ Para [ Str "Item" , Space , Str "1" ] ] + , [ Para [ Str "Item" , Space , Str "2" ] ] + ] ] - ] ] ``` @@ -110,12 +106,12 @@ Hello \textcolor{blue}{\textbf{World}}. Hello \colorbox{red}{World} ^D [ Para - [ Str "Hello" - , Space - , Span - ( "", [], [ ( "style", "background-color: red" ) ] ) - [ Str "World" ] - ] + [ Str "Hello" + , Space + , Span + ( "" , [] , [ ( "style" , "background-color: red" ) ] ) + [ Str "World" ] + ] ] ``` @@ -138,12 +134,12 @@ Hello \colorbox{red}{World} Hello \colorbox{blue}{\textbf{World}} ^D [ Para - [ Str "Hello" - , Space - , Span - ( "", [], [ ( "style", "background-color: blue" ) ] ) - [ Strong [ Str "World" ] ] - ] + [ Str "Hello" + , Space + , Span + ( "" , [] , [ ( "style" , "background-color: blue" ) ] ) + [ Strong [ Str "World" ] ] + ] ] ``` @@ -152,13 +148,13 @@ Hello \colorbox{blue}{\textbf{World}} Hello \colorbox{blue}{\textbf{World}}. ^D [ Para - [ Str "Hello" - , Space - , Span - ( "", [], [ ( "style", "background-color: blue" ) ] ) - [ Strong [ Str "World" ] ] - , Str "." - ] + [ Str "Hello" + , Space + , Span + ( "" , [] , [ ( "style" , "background-color: blue" ) ] ) + [ Strong [ Str "World" ] ] + , Str "." + ] ] ``` @@ -174,14 +170,12 @@ Hello \colorbox{blue}{\textbf{World}}. } ^D [ Div - ( "", [], [ ( "style", "background-color: orange" ) ] ) - [ BulletList - [ - [ Para [ Str "Item", Space, Str "1" ] ] - , - [ Para [ Str "Item", Space, Str "2" ] ] + ( "" , [] , [ ( "style" , "background-color: orange" ) ] ) + [ BulletList + [ [ Para [ Str "Item" , Space , Str "1" ] ] + , [ Para [ Str "Item" , Space , Str "2" ] ] + ] ] - ] ] ``` @@ -197,15 +191,13 @@ Hello \colorbox{blue}{\textbf{World}}. } some more text ^D [ Div - ( "", [], [ ( "style", "background-color: blue" ) ] ) - [ BulletList - [ - [ Para [ Str "Item", Space, Str "1" ] ] - , - [ Para [ Str "Item", Space, Str "2" ] ] + ( "" , [] , [ ( "style" , "background-color: blue" ) ] ) + [ BulletList + [ [ Para [ Str "Item" , Space , Str "1" ] ] + , [ Para [ Str "Item" , Space , Str "2" ] ] + ] ] - ] , Para - [ Str "some", Space, Str "more", Space, Str "text" ] + [ Str "some" , Space , Str "more" , Space , Str "text" ] ] ``` diff --git a/test/command/latex-fontawesome.md b/test/command/latex-fontawesome.md index e67ed1792..18512ac72 100644 --- a/test/command/latex-fontawesome.md +++ b/test/command/latex-fontawesome.md @@ -2,12 +2,12 @@ % pandoc -f latex -t native Check: \faCheck ^D -[ Para [ Str "Check:", Space, Str "\10003" ] ] +[ Para [ Str "Check:" , Space , Str "\10003" ] ] ``` ``` % pandoc -f latex -t native Close: \faClose ^D -[ Para [ Str "Close:", Space, Str "\10007" ] ] +[ Para [ Str "Close:" , Space , Str "\10007" ] ] ``` diff --git a/test/command/latex-tabular-column-specs.md b/test/command/latex-tabular-column-specs.md index a6b820262..586fed3d1 100644 --- a/test/command/latex-tabular-column-specs.md +++ b/test/command/latex-tabular-column-specs.md @@ -12,78 +12,84 @@ f & 0.5 & 5,5 \\ \end{tabular} ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Math InlineMath "" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Math InlineMath "f1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Math InlineMath "f2" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Math InlineMath "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Math InlineMath "0.5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Math InlineMath "4" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Math InlineMath "f" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Math InlineMath "0.5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Math InlineMath "5,5" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Math InlineMath "" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Math InlineMath "f1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Math InlineMath "f2" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Math InlineMath "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Math InlineMath "0.5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Math InlineMath "4" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Math InlineMath "f" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Math InlineMath "0.5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Math InlineMath "5,5" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/lettrine.md b/test/command/lettrine.md index 522e9b2ca..b4a2794d2 100644 --- a/test/command/lettrine.md +++ b/test/command/lettrine.md @@ -5,22 +5,16 @@ \lettrine[lhang=0.17]{A}{category} is ^D [ Para - [ Span - ( "", [ "lettrine" ], [] ) - [ Str "A" ] - , SmallCaps - [ Str "category" ] - , Space - , Str "is" - ] + [ Span ( "" , [ "lettrine" ] , [] ) [ Str "A" ] + , SmallCaps [ Str "category" ] + , Space + , Str "is" + ] , Para - [ Span - ( "", [ "lettrine" ], [] ) - [ Str "A" ] - , SmallCaps - [ Str "category" ] - , Space - , Str "is" - ] + [ Span ( "" , [ "lettrine" ] , [] ) [ Str "A" ] + , SmallCaps [ Str "category" ] + , Space + , Str "is" + ] ] ``` diff --git a/test/command/lstlisting.md b/test/command/lstlisting.md index 202a9d524..2ea8b4ba7 100644 --- a/test/command/lstlisting.md +++ b/test/command/lstlisting.md @@ -9,17 +9,14 @@ public class World { \end{lstlisting} ^D [ CodeBlock - ( "lst:Hello-World" - , [ "java" ] - , - [ - ( "language", "Java" ) - , - ( "caption", "Java Example" ) - , - ( "label", "lst:Hello-World" ) - ] - ) "public class World {\n public static void main(String[] args) {\n System.out.println(\"Hello World\");\n }\n}" + ( "lst:Hello-World" + , [ "java" ] + , [ ( "language" , "Java" ) + , ( "caption" , "Java Example" ) + , ( "label" , "lst:Hello-World" ) + ] + ) + "public class World {\n public static void main(String[] args) {\n System.out.println(\"Hello World\");\n }\n}" ] ``` @@ -34,18 +31,14 @@ public class World { \end{lstlisting} ^D [ CodeBlock - ( "lst:Hello-World" - , [ "java" ] - , - [ - ( "language", "Java" ) - , - ( "escapechar", "|" ) - , - ( "caption", "Java Example" ) - , - ( "label", "lst:Hello-World" ) - ] - ) "public class World {\n public static void main(String[] args) {\n System.out.println(\"Hello World\");\n }\n}" + ( "lst:Hello-World" + , [ "java" ] + , [ ( "language" , "Java" ) + , ( "escapechar" , "|" ) + , ( "caption" , "Java Example" ) + , ( "label" , "lst:Hello-World" ) + ] + ) + "public class World {\n public static void main(String[] args) {\n System.out.println(\"Hello World\");\n }\n}" ] ``` diff --git a/test/command/macro-defs-in-preamble.md b/test/command/macro-defs-in-preamble.md index 57aa2cb04..7bd72d140 100644 --- a/test/command/macro-defs-in-preamble.md +++ b/test/command/macro-defs-in-preamble.md @@ -10,12 +10,9 @@ $\vara \varb$ \end{document} ^D Pandoc - ( Meta { unMeta = fromList [] } ) - [ RawBlock - ( Format "latex" ) "\\newcommand{\\vara}{\\alpha}" - , RawBlock - ( Format "latex" ) "\\newcommand{\\varb}{b}" - , Para - [ Math InlineMath "\\vara \\varb" ] + Meta { unMeta = fromList [] } + [ RawBlock (Format "latex") "\\newcommand{\\vara}{\\alpha}" + , RawBlock (Format "latex") "\\newcommand{\\varb}{b}" + , Para [ Math InlineMath "\\vara \\varb" ] ] ``` diff --git a/test/command/md-abbrevs.md b/test/command/md-abbrevs.md index 75b34c08d..a3ee6af30 100644 --- a/test/command/md-abbrevs.md +++ b/test/command/md-abbrevs.md @@ -15,6 +15,7 @@ If you don't want this to happen you can escape the period: % pandoc -t native Hi Mr\. Bob ^D -[ Para [ Str "Hi", Space, Str "Mr.", Space, Str "Bob" ] ] +[ Para [ Str "Hi" , Space , Str "Mr." , Space , Str "Bob" ] +] ``` diff --git a/test/command/multiple-metadata-blocks.md b/test/command/multiple-metadata-blocks.md index d20eecc1f..e117f3784 100644 --- a/test/command/multiple-metadata-blocks.md +++ b/test/command/multiple-metadata-blocks.md @@ -11,7 +11,9 @@ foo: bim ... ^D Pandoc - ( Meta - { unMeta = fromList [ ( "foo", MetaInlines [ Str "bim" ] ) ] } - ) [] + Meta + { unMeta = + fromList [ ( "foo" , MetaInlines [ Str "bim" ] ) ] + } + [] ``` diff --git a/test/command/refs.md b/test/command/refs.md index 165177175..d89e745ff 100644 --- a/test/command/refs.md +++ b/test/command/refs.md @@ -3,17 +3,18 @@ Figure \ref{fig:1} ^D [ Para - [ Str "Figure" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref" ), ( "reference", "fig:1" ) ] - ) - [ Str "[fig:1]" ] - ( "#fig:1", "" ) - ] + [ Str "Figure" + , Space + , Link + ( "" + , [] + , [ ( "reference-type" , "ref" ) + , ( "reference" , "fig:1" ) + ] + ) + [ Str "[fig:1]" ] + ( "#fig:1" , "" ) + ] ] ``` @@ -22,17 +23,18 @@ Figure \ref{fig:1} Figure \cref{fig:1} ^D [ Para - [ Str "Figure" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref" ), ( "reference", "fig:1" ) ] - ) - [ Str "[fig:1]" ] - ( "#fig:1", "" ) - ] + [ Str "Figure" + , Space + , Link + ( "" + , [] + , [ ( "reference-type" , "ref" ) + , ( "reference" , "fig:1" ) + ] + ) + [ Str "[fig:1]" ] + ( "#fig:1" , "" ) + ] ] ``` @@ -41,17 +43,18 @@ Figure \cref{fig:1} Figure \vref{fig:1} ^D [ Para - [ Str "Figure" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref+page" ), ( "reference", "fig:1" ) ] - ) - [ Str "[fig:1]" ] - ( "#fig:1", "" ) - ] + [ Str "Figure" + , Space + , Link + ( "" + , [] + , [ ( "reference-type" , "ref+page" ) + , ( "reference" , "fig:1" ) + ] + ) + [ Str "[fig:1]" ] + ( "#fig:1" , "" ) + ] ] ``` @@ -65,36 +68,40 @@ Accuracy~\eqref{eq:Accuracy} is the proportion, measuring true results among all \end{equation} ^D [ Para - [ Str "Accuracy\160" - , Link - ( "" - , [] - , - [ ( "reference-type", "eqref" ), ( "reference", "eq:Accuracy" ) ] - ) - [ Str "[eq:Accuracy]" ] - ( "#eq:Accuracy", "" ) - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "proportion," - , Space - , Str "measuring" - , Space - , Str "true" - , Space - , Str "results" - , Space - , Str "among" - , Space - , Str "all" - , Space - , Str "results." - ] + [ Str "Accuracy\160" + , Link + ( "" + , [] + , [ ( "reference-type" , "eqref" ) + , ( "reference" , "eq:Accuracy" ) + ] + ) + [ Str "[eq:Accuracy]" ] + ( "#eq:Accuracy" , "" ) + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "proportion," + , Space + , Str "measuring" + , Space + , Str "true" + , Space + , Str "results" + , Space + , Str "among" + , Space + , Str "all" + , Space + , Str "results." + ] , Para - [ Math DisplayMath "\\label{eq:Accuracy}\n Accuracy = \\frac{t_p + t_n}{t_p + f_p + f_n + t_n}" ] + [ Math + DisplayMath + "\\label{eq:Accuracy}\n Accuracy = \\frac{t_p + t_n}{t_p + f_p + f_n + t_n}" + ] ] ``` @@ -168,93 +175,90 @@ Figure \ref{fig:Logo2} illustrated the SVG logo Figure \ref{fig:Logo3} illustrated the SVG logo ^D -[ Header 1 - ( "one", [], [] ) - [ Str "One" ] +[ Header 1 ( "one" , [] , [] ) [ Str "One" ] , Para - [ Image - ( "fig:Logo", [], [] ) - [ Str "Logo" ] - ( "command/SVG_logo.svg", "fig:" ) - ] + [ Image + ( "fig:Logo" , [] , [] ) + [ Str "Logo" ] + ( "command/SVG_logo.svg" , "fig:" ) + ] , Para - [ Image - ( "fig:Logo2", [], [] ) - [ Str "Logo2" ] - ( "command/SVG_logo2.svg", "fig:" ) - ] -, Header 1 - ( "two", [], [] ) - [ Str "Two" ] -, Header 2 - ( "subone", [], [] ) - [ Str "Subone" ] + [ Image + ( "fig:Logo2" , [] , [] ) + [ Str "Logo2" ] + ( "command/SVG_logo2.svg" , "fig:" ) + ] +, Header 1 ( "two" , [] , [] ) [ Str "Two" ] +, Header 2 ( "subone" , [] , [] ) [ Str "Subone" ] , Para - [ Image - ( "fig:Logo3", [], [] ) - [ Str "Logo3" ] - ( "command/SVG_logo3.svg", "fig:" ) - ] + [ Image + ( "fig:Logo3" , [] , [] ) + [ Str "Logo3" ] + ( "command/SVG_logo3.svg" , "fig:" ) + ] , Para - [ Str "Figure" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref" ), ( "reference", "fig:Logo" ) ] - ) - [ Str "1.1" ] - ( "#fig:Logo", "" ) - , Space - , Str "illustrated" - , Space - , Str "the" - , Space - , Str "SVG" - , Space - , Str "logo" - ] + [ Str "Figure" + , Space + , Link + ( "" + , [] + , [ ( "reference-type" , "ref" ) + , ( "reference" , "fig:Logo" ) + ] + ) + [ Str "1.1" ] + ( "#fig:Logo" , "" ) + , Space + , Str "illustrated" + , Space + , Str "the" + , Space + , Str "SVG" + , Space + , Str "logo" + ] , Para - [ Str "Figure" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref" ), ( "reference", "fig:Logo2" ) ] - ) - [ Str "1.2" ] - ( "#fig:Logo2", "" ) - , Space - , Str "illustrated" - , Space - , Str "the" - , Space - , Str "SVG" - , Space - , Str "logo" - ] + [ Str "Figure" + , Space + , Link + ( "" + , [] + , [ ( "reference-type" , "ref" ) + , ( "reference" , "fig:Logo2" ) + ] + ) + [ Str "1.2" ] + ( "#fig:Logo2" , "" ) + , Space + , Str "illustrated" + , Space + , Str "the" + , Space + , Str "SVG" + , Space + , Str "logo" + ] , Para - [ Str "Figure" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref" ), ( "reference", "fig:Logo3" ) ] - ) - [ Str "2.1" ] - ( "#fig:Logo3", "" ) - , Space - , Str "illustrated" - , Space - , Str "the" - , Space - , Str "SVG" - , Space - , Str "logo" - ] + [ Str "Figure" + , Space + , Link + ( "" + , [] + , [ ( "reference-type" , "ref" ) + , ( "reference" , "fig:Logo3" ) + ] + ) + [ Str "2.1" ] + ( "#fig:Logo3" , "" ) + , Space + , Str "illustrated" + , Space + , Str "the" + , Space + , Str "SVG" + , Space + , Str "logo" + ] ] ``` @@ -264,20 +268,21 @@ Figure \ref{fig:Logo3} illustrated the SVG logo \label{section} Section \ref{section} ^D [ Para - [ Span - ( "section", [], [ ( "label", "section" ) ] ) - [ Str "[section]" ] - , Space - , Str "Section" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref" ), ( "reference", "section" ) ] - ) - [ Str "[section]" ] - ( "#section", "" ) - ] + [ Span + ( "section" , [] , [ ( "label" , "section" ) ] ) + [ Str "[section]" ] + , Space + , Str "Section" + , Space + , Link + ( "" + , [] + , [ ( "reference-type" , "ref" ) + , ( "reference" , "section" ) + ] + ) + [ Str "[section]" ] + ( "#section" , "" ) + ] ] ``` diff --git a/test/command/setext-fenced-div.md b/test/command/setext-fenced-div.md index 7be49e4a7..3494cbf70 100644 --- a/test/command/setext-fenced-div.md +++ b/test/command/setext-fenced-div.md @@ -4,5 +4,5 @@ --- ::: ^D -[ Div ( "", [ "cell" ], [] ) [ HorizontalRule ] ] +[ Div ( "" , [ "cell" ] , [] ) [ HorizontalRule ] ] ``` diff --git a/test/command/shift-heading-level-by.md b/test/command/shift-heading-level-by.md index 8397e7092..1ce966989 100644 --- a/test/command/shift-heading-level-by.md +++ b/test/command/shift-heading-level-by.md @@ -9,17 +9,19 @@ title: My title ## Second ^D Pandoc - ( Meta - { unMeta = fromList - [ ( "title", MetaInlines [ Str "My", Space, Str "title" ] ) ] + Meta + { unMeta = + fromList + [ ( "title" + , MetaInlines [ Str "My" , Space , Str "title" ] + ) + ] } - ) - [ Header 2 - ( "first-heading", [], [] ) - [ Str "First", Space, Str "heading" ] - , Header 3 - ( "second", [], [] ) - [ Str "Second" ] + [ Header + 2 + ( "first-heading" , [] , [] ) + [ Str "First" , Space , Str "heading" ] + , Header 3 ( "second" , [] , [] ) [ Str "Second" ] ] ``` @@ -36,16 +38,22 @@ title: Old title # Another top-level heading ^D Pandoc - ( Meta - { unMeta = fromList - [ ( "title", MetaInlines [ Str "First", Space, Str "heading" ] ) ] + Meta + { unMeta = + fromList + [ ( "title" + , MetaInlines [ Str "First" , Space , Str "heading" ] + ) + ] } - ) - [ Header 1 - ( "second", [], [] ) - [ Str "Second" ] + [ Header 1 ( "second" , [] , [] ) [ Str "Second" ] , Para - [ Str "Another", Space, Str "top-level", Space, Str "heading" ] + [ Str "Another" + , Space + , Str "top-level" + , Space + , Str "heading" + ] ] ``` diff --git a/test/command/sloppypar.md b/test/command/sloppypar.md index 3ac62bf79..44ec93af3 100644 --- a/test/command/sloppypar.md +++ b/test/command/sloppypar.md @@ -7,109 +7,109 @@ Qui et temporibus explicabo. Esse ab ut quidem. Vel qui perspiciatis quae odio c \end{sloppypar} ^D [ Para - [ Str "Sequi" - , Space - , Str "id" - , Space - , Str "qui" - , Space - , Str "facere" - , Space - , Str "et" - , Space - , Str "incidunt" - , Space - , Str "ut." - , Space - , Str "Et" - , Space - , Str "fuga" - , Space - , Str "ut" - , Space - , Str "voluptate" - , Space - , Str "enim" - , Space - , Str "qui." - , Space - , Str "Odit" - , Space - , Str "unde" - , Space - , Str "magni" - , Space - , Str "ipsam" - , Space - , Str "dicta" - , Space - , Str "modi." - , Space - , Str "Modi" - , Space - , Str "soluta" - , Space - , Str "velit" - , Space - , Str "est" - , Space - , Str "aut" - , Space - , Str "aut" - , Space - , Str "possimus." - ] + [ Str "Sequi" + , Space + , Str "id" + , Space + , Str "qui" + , Space + , Str "facere" + , Space + , Str "et" + , Space + , Str "incidunt" + , Space + , Str "ut." + , Space + , Str "Et" + , Space + , Str "fuga" + , Space + , Str "ut" + , Space + , Str "voluptate" + , Space + , Str "enim" + , Space + , Str "qui." + , Space + , Str "Odit" + , Space + , Str "unde" + , Space + , Str "magni" + , Space + , Str "ipsam" + , Space + , Str "dicta" + , Space + , Str "modi." + , Space + , Str "Modi" + , Space + , Str "soluta" + , Space + , Str "velit" + , Space + , Str "est" + , Space + , Str "aut" + , Space + , Str "aut" + , Space + , Str "possimus." + ] , Para - [ Str "Qui" - , Space - , Str "et" - , Space - , Str "temporibus" - , Space - , Str "explicabo." - , Space - , Str "Esse" - , Space - , Str "ab" - , Space - , Str "ut" - , Space - , Str "quidem." - , Space - , Str "Vel" - , Space - , Str "qui" - , Space - , Str "perspiciatis" - , Space - , Str "quae" - , Space - , Str "odio" - , Space - , Str "consectetur" - , Space - , Str "alias" - , Space - , Str "non" - , Space - , Str "sed." - , Space - , Str "Quo" - , Space - , Str "consectetur" - , Space - , Str "libero" - , Space - , Str "omnis" - , Space - , Str "quos" - , Space - , Str "eius" - , Space - , Str "ad" - , Space - , Str "vel." - ] + [ Str "Qui" + , Space + , Str "et" + , Space + , Str "temporibus" + , Space + , Str "explicabo." + , Space + , Str "Esse" + , Space + , Str "ab" + , Space + , Str "ut" + , Space + , Str "quidem." + , Space + , Str "Vel" + , Space + , Str "qui" + , Space + , Str "perspiciatis" + , Space + , Str "quae" + , Space + , Str "odio" + , Space + , Str "consectetur" + , Space + , Str "alias" + , Space + , Str "non" + , Space + , Str "sed." + , Space + , Str "Quo" + , Space + , Str "consectetur" + , Space + , Str "libero" + , Space + , Str "omnis" + , Space + , Str "quos" + , Space + , Str "eius" + , Space + , Str "ad" + , Space + , Str "vel." + ] ] ``` @@ -122,108 +122,108 @@ Qui et temporibus explicabo. Esse ab ut quidem. Vel qui perspiciatis quae odio c \end{sloppypar} ^D [ Para - [ Str "Sequi" - , Space - , Str "id" - , Space - , Str "qui" - , Space - , Str "facere" - , Space - , Str "et" - , Space - , Str "incidunt" - , Space - , Str "ut." - , Space - , Str "Et" - , Space - , Str "fuga" - , Space - , Str "ut" - , Space - , Str "voluptate" - , Space - , Str "enim" - , Space - , Str "qui." - , Space - , Str "Odit" - , Space - , Str "unde" - , Space - , Str "magni" - , Space - , Str "ipsam" - , Space - , Str "dicta" - , Space - , Str "modi." - , Space - , Str "Modi" - , Space - , Str "soluta" - , Space - , Str "velit" - , Space - , Str "est" - , Space - , Str "aut" - , Space - , Str "aut" - , Space - , Str "possimus." - ] + [ Str "Sequi" + , Space + , Str "id" + , Space + , Str "qui" + , Space + , Str "facere" + , Space + , Str "et" + , Space + , Str "incidunt" + , Space + , Str "ut." + , Space + , Str "Et" + , Space + , Str "fuga" + , Space + , Str "ut" + , Space + , Str "voluptate" + , Space + , Str "enim" + , Space + , Str "qui." + , Space + , Str "Odit" + , Space + , Str "unde" + , Space + , Str "magni" + , Space + , Str "ipsam" + , Space + , Str "dicta" + , Space + , Str "modi." + , Space + , Str "Modi" + , Space + , Str "soluta" + , Space + , Str "velit" + , Space + , Str "est" + , Space + , Str "aut" + , Space + , Str "aut" + , Space + , Str "possimus." + ] , Para - [ Str "Qui" - , Space - , Str "et" - , Space - , Str "temporibus" - , Space - , Str "explicabo." - , Space - , Str "Esse" - , Space - , Str "ab" - , Space - , Str "ut" - , Space - , Str "quidem." - , Space - , Str "Vel" - , Space - , Str "qui" - , Space - , Str "perspiciatis" - , Space - , Str "quae" - , Space - , Str "odio" - , Space - , Str "consectetur" - , Space - , Str "alias" - , Space - , Str "non" - , Space - , Str "sed." - , Space - , Str "Quo" - , Space - , Str "consectetur" - , Space - , Str "libero" - , Space - , Str "omnis" - , Space - , Str "quos" - , Space - , Str "eius" - , Space - , Str "ad" - , Space - , Str "vel." - ] + [ Str "Qui" + , Space + , Str "et" + , Space + , Str "temporibus" + , Space + , Str "explicabo." + , Space + , Str "Esse" + , Space + , Str "ab" + , Space + , Str "ut" + , Space + , Str "quidem." + , Space + , Str "Vel" + , Space + , Str "qui" + , Space + , Str "perspiciatis" + , Space + , Str "quae" + , Space + , Str "odio" + , Space + , Str "consectetur" + , Space + , Str "alias" + , Space + , Str "non" + , Space + , Str "sed." + , Space + , Str "Quo" + , Space + , Str "consectetur" + , Space + , Str "libero" + , Space + , Str "omnis" + , Space + , Str "quos" + , Space + , Str "eius" + , Space + , Str "ad" + , Space + , Str "vel." + ] ] ``` diff --git a/test/command/table-with-cell-align.md b/test/command/table-with-cell-align.md index 9b6e311bd..ccf119cbd 100644 --- a/test/command/table-with-cell-align.md +++ b/test/command/table-with-cell-align.md @@ -14,47 +14,48 @@ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignLeft - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignRight - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignLeft + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignRight + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) ] ``` ``` diff --git a/test/command/table-with-column-span.md b/test/command/table-with-column-span.md index 592e6d3da..d4e8bebd4 100644 --- a/test/command/table-with-column-span.md +++ b/test/command/table-with-column-span.md @@ -50,161 +50,180 @@ ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - , - ( AlignDefault, ColWidth 6.25 e- 2 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 8 ) - [ Para - [ Strong [ Str "Octet", Space, Str "no.", Space, Str "1" ] ] - ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 8 ) - [ Para - [ Strong [ Str "Octet", Space, Str "no.", Space, Str "2" ] ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + , ( AlignDefault , ColWidth 6.25e-2 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 8) + [ Para + [ Strong + [ Str "Octet" + , Space + , Str "no." + , Space + , Str "1" + ] + ] + ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 8) + [ Para + [ Strong + [ Str "Octet" + , Space + , Str "no." + , Space + , Str "2" + ] + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "16" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "15" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "14" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "13" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "11" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "10" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "9" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "8" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "7" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 8) + [ Para [ Str "Code" , Space , Str "A" ] ] + , Cell + ( "" , [] , [] ) + AlignCenter + (RowSpan 1) + (ColSpan 8) + [ Para [ Str "Code" , Space , Str "B" ] ] + ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "16" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "15" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "14" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "13" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "11" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "10" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "9" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "8" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "7" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 8 ) - [ Para [ Str "Code", Space, Str "A" ] ] - , Cell - ( "", [], [] ) AlignCenter - ( RowSpan 1 ) - ( ColSpan 8 ) - [ Para [ Str "Code", Space, Str "B" ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` ``` diff --git a/test/command/tabularx.md b/test/command/tabularx.md index a5056f518..399741732 100644 --- a/test/command/tabularx.md +++ b/test/command/tabularx.md @@ -21,97 +21,127 @@ \end{tabularx} ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Column", Space, Str "Heading", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Column", Space, Str "Heading", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Column", Space, Str "Heading", Space, Str "3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1.1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1.2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1.3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2.1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2.2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2.3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3.1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3.2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3.3" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Column" + , Space + , Str "Heading" + , Space + , Str "1" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Column" + , Space + , Str "Heading" + , Space + , Str "2" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Column" + , Space + , Str "Heading" + , Space + , Str "3" + ] + ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1.1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1.2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1.3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2.1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2.2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2.3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3.1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3.2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3.3" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` @@ -138,97 +168,127 @@ \end{tabularx} ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignLeft, ColWidth 0.25 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Column", Space, Str "Heading", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Column", Space, Str "Heading", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Column", Space, Str "Heading", Space, Str "3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignLeft , ColWidth 0.25 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1.1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1.2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1.3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2.1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2.2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2.3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3.1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3.2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3.3" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Column" + , Space + , Str "Heading" + , Space + , Str "1" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Column" + , Space + , Str "Heading" + , Space + , Str "2" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Column" + , Space + , Str "Heading" + , Space + , Str "3" + ] + ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1.1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1.2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1.3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2.1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2.2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2.3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3.1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3.2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3.3" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` @@ -255,96 +315,126 @@ \end{tabularx} ^D [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidth 0.25 ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignLeft, ColWidth 0.25 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Column", Space, Str "Heading", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Column", Space, Str "Heading", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Column", Space, Str "Heading", Space, Str "3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidth 0.25 ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignLeft , ColWidth 0.25 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1.1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1.2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1.3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2.1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2.2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2.3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3.1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3.2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3.3" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Column" + , Space + , Str "Heading" + , Space + , Str "1" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Column" + , Space + , Str "Heading" + , Space + , Str "2" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Column" + , Space + , Str "Heading" + , Space + , Str "3" + ] + ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1.1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1.2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1.3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2.1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2.2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2.3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3.1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3.2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3.3" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] ``` diff --git a/test/command/translations.md b/test/command/translations.md index 26d683860..8d1890467 100644 --- a/test/command/translations.md +++ b/test/command/translations.md @@ -25,5 +25,5 @@ \figurename~2 \figurename. ^D -[ Para [ Str "Slika\160\&2", SoftBreak, Str "Slika." ] ] +[ Para [ Str "Slika\160\&2" , SoftBreak , Str "Slika." ] ] ``` diff --git a/test/command/write18.md b/test/command/write18.md index 45c7e0dd3..4a3f10b85 100644 --- a/test/command/write18.md +++ b/test/command/write18.md @@ -3,12 +3,12 @@ Handle \write18{..} as raw tex: % pandoc -t native \write18{git --version} ^D -[ RawBlock ( Format "tex" ) "\\write18{git --version}" ] +[ RawBlock (Format "tex") "\\write18{git --version}" ] ``` ``` % pandoc -f latex+raw_tex -t native \write18{git --version} ^D -[ RawBlock ( Format "latex" ) "\\write18{git --version}" ] +[ RawBlock (Format "latex") "\\write18{git --version}" ] ``` diff --git a/test/command/yaml-metadata-blocks.md b/test/command/yaml-metadata-blocks.md index f782ffe59..d483618d3 100644 --- a/test/command/yaml-metadata-blocks.md +++ b/test/command/yaml-metadata-blocks.md @@ -7,9 +7,9 @@ foo: --- ^D Pandoc - ( Meta - { unMeta = fromList [ ( "foo", MetaMap ( fromList [] ) ) ] } - ) [] + Meta + { unMeta = fromList [ ( "foo" , MetaMap (fromList []) ) ] } + [] ``` ``` % pandoc -s -t native @@ -35,46 +35,31 @@ nested: --- ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "bool", MetaBool True ) - , - ( "empty", MetaList [] ) - , - ( "float", MetaInlines [ Str "1.5" ] ) - , - ( "int", MetaInlines [ Str "7" ] ) - , - ( "more", MetaBool False ) - , - ( "nested" - , MetaMap - ( fromList - [ - ( "bool", MetaBool True ) - , - ( "empty", MetaList [] ) - , - ( "float", MetaInlines [ Str "2.5" ] ) - , - ( "int", MetaInlines [ Str "8" ] ) - , - ( "more", MetaBool False ) - , - ( "nothing", MetaInlines [ Str "null" ] ) - , - ( "scientific", MetaInlines [ Str "3.7e-5" ] ) - ] - ) - ) - , - ( "nothing", MetaInlines [ Str "null" ] ) - , - ( "scientific", MetaInlines [ Str "3.7e-5" ] ) - ] + Meta + { unMeta = + fromList + [ ( "bool" , MetaBool True ) + , ( "empty" , MetaList [] ) + , ( "float" , MetaInlines [ Str "1.5" ] ) + , ( "int" , MetaInlines [ Str "7" ] ) + , ( "more" , MetaBool False ) + , ( "nested" + , MetaMap + (fromList + [ ( "bool" , MetaBool True ) + , ( "empty" , MetaList [] ) + , ( "float" , MetaInlines [ Str "2.5" ] ) + , ( "int" , MetaInlines [ Str "8" ] ) + , ( "more" , MetaBool False ) + , ( "nothing" , MetaInlines [ Str "null" ] ) + , ( "scientific" , MetaInlines [ Str "3.7e-5" ] ) + ]) + ) + , ( "nothing" , MetaInlines [ Str "null" ] ) + , ( "scientific" , MetaInlines [ Str "3.7e-5" ] ) + ] } - ) [] + [] ``` ``` % pandoc -s -t native @@ -85,20 +70,19 @@ array: --- ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "array" - , MetaList - [ MetaMap - ( fromList [ ( "foo", MetaInlines [ Str "bar" ] ) ] ) - , MetaMap - ( fromList [ ( "bool", MetaBool True ) ] ) + Meta + { unMeta = + fromList + [ ( "array" + , MetaList + [ MetaMap + (fromList [ ( "foo" , MetaInlines [ Str "bar" ] ) ]) + , MetaMap (fromList [ ( "bool" , MetaBool True ) ]) + ] + ) ] - ) - ] } - ) [] + [] ``` ``` % pandoc -s -t native --metadata-file command/yaml-metadata.yaml @@ -107,33 +91,31 @@ title: document --- ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "other" - , MetaInlines - [ Emph [ Str "markdown" ], Space, Str "value" ] - ) - , - ( "title", MetaInlines [ Str "document" ] ) - ] + Meta + { unMeta = + fromList + [ ( "other" + , MetaInlines + [ Emph [ Str "markdown" ] , Space , Str "value" ] + ) + , ( "title" , MetaInlines [ Str "document" ] ) + ] } - ) [] + [] ``` ``` % pandoc -s -t native --metadata-file command/yaml-metadata.yaml -M title=cmdline ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "other" - , MetaInlines - [ Emph [ Str "markdown" ], Space, Str "value" ] - ) - , - ( "title", MetaString "cmdline" ) - ] + Meta + { unMeta = + fromList + [ ( "other" + , MetaInlines + [ Emph [ Str "markdown" ] , Space , Str "value" ] + ) + , ( "title" , MetaString "cmdline" ) + ] } - ) [] + [] ``` diff --git a/test/command/yaml-with-chomp.md b/test/command/yaml-with-chomp.md index 94a736ab5..98cc76e18 100644 --- a/test/command/yaml-with-chomp.md +++ b/test/command/yaml-with-chomp.md @@ -8,14 +8,13 @@ ml: |- ... ^D Pandoc - ( Meta - { unMeta = fromList - [ - ( "ml" - , MetaBlocks - [ Para [ Str "TEST" ], Plain [ Str "BLOCK" ] ] - ) - ] + Meta + { unMeta = + fromList + [ ( "ml" + , MetaBlocks [ Para [ Str "TEST" ] , Plain [ Str "BLOCK" ] ] + ) + ] } - ) [] + [] ``` diff --git a/test/creole-reader.native b/test/creole-reader.native index 0c8fc3677..5590a14d1 100644 --- a/test/creole-reader.native +++ b/test/creole-reader.native @@ -1,992 +1,970 @@ Pandoc - ( Meta { unMeta = fromList [] } ) - [ Header 1 - ( "", [], [] ) - [ Str "Top-level heading (1)" ] - , Header 2 - ( "", [], [] ) - [ Str "This a test for creole 0.1 (2)" ] - , Header 3 - ( "", [], [] ) - [ Str "This is a Subheading (3)" ] - , Header 4 - ( "", [], [] ) - [ Str "Subsub (4)" ] - , Header 5 - ( "", [], [] ) - [ Str "Subsubsub (5)" ] + Meta { unMeta = fromList [] } + [ Header 1 ( "" , [] , [] ) [ Str "Top-level heading (1)" ] + , Header + 2 ( "" , [] , [] ) [ Str "This a test for creole 0.1 (2)" ] + , Header + 3 ( "" , [] , [] ) [ Str "This is a Subheading (3)" ] + , Header 4 ( "" , [] , [] ) [ Str "Subsub (4)" ] + , Header 5 ( "" , [] , [] ) [ Str "Subsubsub (5)" ] , Para - [ Str "The" - , Space - , Str "ending" - , Space - , Str "equal" - , Space - , Str "signs" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "displayed:" - ] - , Header 1 - ( "", [], [] ) - [ Str "Top-level heading (1)" ] - , Header 2 - ( "", [], [] ) - [ Str "This a test for creole 0.1 (2)" ] - , Header 3 - ( "", [], [] ) - [ Str "This is a Subheading (3)" ] - , Header 4 - ( "", [], [] ) - [ Str "Subsub (4)" ] - , Header 5 - ( "", [], [] ) - [ Str "Subsubsub (5)" ] - , Para - [ Str "You" - , Space - , Str "can" - , Space - , Str "make" - , Space - , Str "things" - , Space - , Strong - [ Str "bold" ] - , Space - , Str "or" - , Space - , Emph - [ Str "italic" ] - , Space - , Str "or" - , Space - , Strong - [ Emph [ Str "both" ] ] - , Space - , Str "or" - , Space - , Emph - [ Strong [ Str "both" ] ] - , Str "." - ] + [ Str "The" + , Space + , Str "ending" + , Space + , Str "equal" + , Space + , Str "signs" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "displayed:" + ] + , Header 1 ( "" , [] , [] ) [ Str "Top-level heading (1)" ] + , Header + 2 ( "" , [] , [] ) [ Str "This a test for creole 0.1 (2)" ] + , Header + 3 ( "" , [] , [] ) [ Str "This is a Subheading (3)" ] + , Header 4 ( "" , [] , [] ) [ Str "Subsub (4)" ] + , Header 5 ( "" , [] , [] ) [ Str "Subsubsub (5)" ] , Para - [ Str "Character" - , Space - , Str "formatting" - , Space - , Str "extends" - , Space - , Str "across" - , Space - , Str "line" - , Space - , Str "breaks:" - , Space - , Strong - [ Str "bold," + [ Str "You" , Space - , Str "this" + , Str "can" , Space - , Str "is" + , Str "make" , Space - , Str "still" + , Str "things" , Space - , Str "bold." + , Strong [ Str "bold" ] , Space - , Str "This" + , Str "or" + , Space + , Emph [ Str "italic" ] + , Space + , Str "or" + , Space + , Strong [ Emph [ Str "both" ] ] + , Space + , Str "or" + , Space + , Emph [ Strong [ Str "both" ] ] + , Str "." + ] + , Para + [ Str "Character" + , Space + , Str "formatting" + , Space + , Str "extends" + , Space + , Str "across" , Space , Str "line" , Space - , Str "deliberately" + , Str "breaks:" + , Space + , Strong + [ Str "bold," + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "still" + , Space + , Str "bold." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "deliberately" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "end" + , Space + , Str "in" + , Space + , Str "star-star." + ] + ] + , Para + [ Str "Not" + , Space + , Str "bold." + , Space + , Str "Character" + , Space + , Str "formatting" , Space , Str "does" , Space , Str "not" , Space - , Str "end" + , Str "cross" , Space - , Str "in" + , Str "paragraph" , Space - , Str "star-star." + , Str "boundaries." ] - ] - , Para - [ Str "Not" - , Space - , Str "bold." - , Space - , Str "Character" - , Space - , Str "formatting" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "cross" - , Space - , Str "paragraph" - , Space - , Str "boundaries." - ] , Para - [ Str "You" - , Space - , Str "can" - , Space - , Str "use" - , Space - , Link - ( "", [], [] ) - [ Str "internal links" ] - ( "internal links", "" ) - , Space - , Str "or" - , Space - , Link - ( "", [], [] ) - [ Str "external links" ] - ( "http://www.wikicreole.org", "" ) - , Str "," - , Space - , Str "give" - , Space - , Str "the" - , Space - , Str "link" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "different" ] - ( "internal links", "" ) - , Space - , Str "name." - ] + [ Str "You" + , Space + , Str "can" + , Space + , Str "use" + , Space + , Link + ( "" , [] , [] ) + [ Str "internal links" ] + ( "internal links" , "" ) + , Space + , Str "or" + , Space + , Link + ( "" , [] , [] ) + [ Str "external links" ] + ( "http://www.wikicreole.org" , "" ) + , Str "," + , Space + , Str "give" + , Space + , Str "the" + , Space + , Str "link" + , Space + , Str "a" + , Space + , Link + ( "" , [] , [] ) + [ Str "different" ] + ( "internal links" , "" ) + , Space + , Str "name." + ] , Para - [ Str "Here's" - , Space - , Str "another" - , Space - , Str "sentence:" - , Space - , Str "This" - , Space - , Str "wisdom" - , Space - , Str "is" - , Space - , Str "taken" - , Space - , Str "from" - , Space - , Link - ( "", [], [] ) - [ Str "Ward Cunningham's" ] - ( "Ward Cunningham's", "" ) - , Space - , Link - ( "", [], [] ) - [ Str "Presentation at the Wikisym 06" ] - ( "http://www.c2.com/doc/wikisym/WikiSym2006.pdf", "" ) - , Str "." - ] + [ Str "Here's" + , Space + , Str "another" + , Space + , Str "sentence:" + , Space + , Str "This" + , Space + , Str "wisdom" + , Space + , Str "is" + , Space + , Str "taken" + , Space + , Str "from" + , Space + , Link + ( "" , [] , [] ) + [ Str "Ward Cunningham's" ] + ( "Ward Cunningham's" , "" ) + , Space + , Link + ( "" , [] , [] ) + [ Str "Presentation at the Wikisym 06" ] + ( "http://www.c2.com/doc/wikisym/WikiSym2006.pdf" , "" ) + , Str "." + ] , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Str "external" - , Space - , Str "link" - , Space - , Str "without" - , Space - , Str "a" - , Space - , Str "description:" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.wikicreole.org" ] - ( "http://www.wikicreole.org", "" ) - ] + [ Str "Here's" + , Space + , Str "a" + , Space + , Str "external" + , Space + , Str "link" + , Space + , Str "without" + , Space + , Str "a" + , Space + , Str "description:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.wikicreole.org" ] + ( "http://www.wikicreole.org" , "" ) + ] , Para - [ Str "Be" - , Space - , Str "careful" - , Space - , Str "that" - , Space - , Str "italic" - , Space - , Str "links" - , Space - , Str "are" - , Space - , Str "rendered" - , Space - , Str "properly:" - , Space - , Emph - [ Link - ( "", [], [] ) - [ Str "My Book Title" ] - ( "http://my.book.example/", "" ) - ] - ] + [ Str "Be" + , Space + , Str "careful" + , Space + , Str "that" + , Space + , Str "italic" + , Space + , Str "links" + , Space + , Str "are" + , Space + , Str "rendered" + , Space + , Str "properly:" + , Space + , Emph + [ Link + ( "" , [] , [] ) + [ Str "My Book Title" ] + ( "http://my.book.example/" , "" ) + ] + ] , Para - [ Str "Free" - , Space - , Str "links" - , Space - , Str "without" - , Space - , Str "braces" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "rendered" - , Space - , Str "as" - , Space - , Str "well," - , Space - , Str "like" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.wikicreole.org/" ] - ( "http://www.wikicreole.org/", "" ) - , Space - , Str "and" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.wikicreole.org/users/~example" ] - ( "http://www.wikicreole.org/users/~example", "" ) - , Str "." - ] + [ Str "Free" + , Space + , Str "links" + , Space + , Str "without" + , Space + , Str "braces" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "rendered" + , Space + , Str "as" + , Space + , Str "well," + , Space + , Str "like" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.wikicreole.org/" ] + ( "http://www.wikicreole.org/" , "" ) + , Space + , Str "and" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.wikicreole.org/users/~example" ] + ( "http://www.wikicreole.org/users/~example" , "" ) + , Str "." + ] , Para - [ Str "Creole1.0" - , Space - , Str "specifies" - , Space - , Str "that" - , Space - , Link - ( "", [], [] ) - [ Str "http://bar" ] - ( "http://bar", "" ) - , Space - , Str "and" - , Space - , Link - ( "", [], [] ) - [ Str "ftp://bar" ] - ( "ftp://bar", "" ) - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "render" - , Space - , Str "italic," - , Space - , Str "something" - , Space - , Str "like" - , Space - , Str "foo:" - , Emph - [ Str "bar" + [ Str "Creole1.0" + , Space + , Str "specifies" + , Space + , Str "that" + , Space + , Link + ( "" , [] , [] ) [ Str "http://bar" ] ( "http://bar" , "" ) + , Space + , Str "and" + , Space + , Link + ( "" , [] , [] ) [ Str "ftp://bar" ] ( "ftp://bar" , "" ) , Space , Str "should" , Space + , Str "not" + , Space , Str "render" , Space - , Str "as" + , Str "italic," , Space - , Str "italic." + , Str "something" + , Space + , Str "like" + , Space + , Str "foo:" + , Emph + [ Str "bar" + , Space + , Str "should" + , Space + , Str "render" + , Space + , Str "as" + , Space + , Str "italic." + ] ] - ] , Para - [ Str "You" - , Space - , Str "can" - , Space - , Str "use" - , Space - , Str "this" - , Space - , Str "to" - , Space - , Str "draw" - , Space - , Str "a" - , Space - , Str "line" - , Space - , Str "to" - , Space - , Str "separate" - , Space - , Str "the" - , Space - , Str "page:" - ] + [ Str "You" + , Space + , Str "can" + , Space + , Str "use" + , Space + , Str "this" + , Space + , Str "to" + , Space + , Str "draw" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "to" + , Space + , Str "separate" + , Space + , Str "the" + , Space + , Str "page:" + ] , HorizontalRule , Para - [ Str "You" - , Space - , Str "can" - , Space - , Str "use" - , Space - , Str "lists," - , Space - , Str "start" - , Space - , Str "it" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "first" - , Space - , Str "column" - , Space - , Str "for" - , Space - , Str "now," - , Space - , Str "please..." - ] + [ Str "You" + , Space + , Str "can" + , Space + , Str "use" + , Space + , Str "lists," + , Space + , Str "start" + , Space + , Str "it" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "column" + , Space + , Str "for" + , Space + , Str "now," + , Space + , Str "please..." + ] , Para - [ Str "unnumbered" - , Space - , Str "lists" - , Space - , Str "are" - , Space - , Str "like" - ] + [ Str "unnumbered" + , Space + , Str "lists" + , Space + , Str "are" + , Space + , Str "like" + ] , BulletList - [ - [ Plain [ Str "item", Space, Str "a" ] ] - , - [ Plain [ Str "item", Space, Str "b" ] ] - , - [ Plain - [ Strong [ Str "bold", Space, Str "item", Space, Str "c" ] ] - ] - ] + [ [ Plain [ Str "item" , Space , Str "a" ] ] + , [ Plain [ Str "item" , Space , Str "b" ] ] + , [ Plain + [ Strong + [ Str "bold" , Space , Str "item" , Space , Str "c" ] + ] + ] + ] , Para - [ Str "blank" - , Space - , Str "space" - , Space - , Str "is" - , Space - , Str "also" - , Space - , Str "permitted" - , Space - , Str "before" - , Space - , Str "lists" - , Space - , Str "like:" - ] + [ Str "blank" + , Space + , Str "space" + , Space + , Str "is" + , Space + , Str "also" + , Space + , Str "permitted" + , Space + , Str "before" + , Space + , Str "lists" + , Space + , Str "like:" + ] , BulletList - [ - [ Plain [ Str "item", Space, Str "a" ] ] - , - [ Plain [ Str "item", Space, Str "b" ] ] - , - [ Plain - [ Str "item", Space, Str "c" ] - , BulletList - [ [ Plain [ Str "item", Space, Str "c.a" ] ] ] - ] - ] + [ [ Plain [ Str "item" , Space , Str "a" ] ] + , [ Plain [ Str "item" , Space , Str "b" ] ] + , [ Plain [ Str "item" , Space , Str "c" ] + , BulletList + [ [ Plain [ Str "item" , Space , Str "c.a" ] ] ] + ] + ] , Para - [ Str "or" - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "number" - , Space - , Str "them" - ] + [ Str "or" + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "number" + , Space + , Str "them" + ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Link ( "", [], [] ) [ Str "item 1" ] ( "item 1", "" ) ] - ] - , - [ Plain [ Str "item", Space, Str "2" ] ] - , - [ Plain - [ Emph - [ Space - , Str "italic" - , Space - , Str "item" - , Space - , Str "3" - , Space - ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Link ( "" , [] , [] ) [ Str "item 1" ] ( "item 1" , "" ) ] ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "item", Space, Str "3.1" ] ] - , - [ Plain [ Str "item", Space, Str "3.2" ] ] + , [ Plain [ Str "item" , Space , Str "2" ] ] + , [ Plain + [ Emph + [ Space + , Str "italic" + , Space + , Str "item" + , Space + , Str "3" + , Space + ] + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "item" , Space , Str "3.1" ] ] + , [ Plain [ Str "item" , Space , Str "3.2" ] ] + ] ] ] - ] , Para - [ Str "up" - , Space - , Str "to" - , Space - , Str "five" - , Space - , Str "levels" - ] + [ Str "up" + , Space + , Str "to" + , Space + , Str "five" + , Space + , Str "levels" + ] , BulletList - [ - [ Plain - [ Str "1" ] - , BulletList - [ - [ Plain - [ Str "2" ] - , BulletList - [ - [ Plain - [ Str "3" ] + [ [ Plain [ Str "1" ] + , BulletList + [ [ Plain [ Str "2" ] , BulletList - [ - [ Plain - [ Str "4" ] - , BulletList - [ [ Plain [ Str "5" ] ] ] + [ [ Plain [ Str "3" ] + , BulletList + [ [ Plain [ Str "4" ] + , BulletList [ [ Plain [ Str "5" ] ] ] + ] + ] + ] ] - ] ] ] - ] ] ] - ] , BulletList - [ - [ Plain - [ Str "You" - , Space - , Str "can" - , Space - , Str "have" - , Space - , Str "multiline" - , Space - , Str "list" - , Space - , Str "items" + [ [ Plain + [ Str "You" + , Space + , Str "can" + , Space + , Str "have" + , Space + , Str "multiline" + , Space + , Str "list" + , Space + , Str "items" + ] ] - ] - , - [ Plain - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "second" - , Space - , Str "multiline" - , Space - , Str "list" - , Space - , Str "item" + , [ Plain + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "second" + , Space + , Str "multiline" + , Space + , Str "list" + , Space + , Str "item" + ] ] ] - ] , Para - [ Str "You" - , Space - , Str "can" - , Space - , Str "use" - , Space - , Str "nowiki" - , Space - , Str "syntax" - , Space - , Str "if" - , Space - , Str "you" - , Space - , Str "would" - , Space - , Str "like" - , Space - , Str "do" - , Space - , Str "stuff" - , Space - , Str "like" - , Space - , Str "this:" - ] + [ Str "You" + , Space + , Str "can" + , Space + , Str "use" + , Space + , Str "nowiki" + , Space + , Str "syntax" + , Space + , Str "if" + , Space + , Str "you" + , Space + , Str "would" + , Space + , Str "like" + , Space + , Str "do" + , Space + , Str "stuff" + , Space + , Str "like" + , Space + , Str "this:" + ] , CodeBlock - ( "" - , [] - , [] - ) "Guitar Chord C:\n\n||---|---|---|\n||-0-|---|---|\n||---|---|---|\n||---|-0-|---|\n||---|---|-0-|\n||---|---|---|" + ( "" , [] , [] ) + "Guitar Chord C:\n\n||---|---|---|\n||-0-|---|---|\n||---|---|---|\n||---|-0-|---|\n||---|---|-0-|\n||---|---|---|" , Para - [ Str "You" - , Space - , Str "can" - , Space - , Str "also" - , Space - , Str "use" - , Space - , Str "it" - , Space - , Str "inline" - , Space - , Str "nowiki" - , Space - , Code - ( "", [], [] ) " in a sentence " - , Space - , Str "like" - , Space - , Str "this." - ] - , Header 1 - ( "", [], [] ) - [ Str "Escapes" ] + [ Str "You" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "use" + , Space + , Str "it" + , Space + , Str "inline" + , Space + , Str "nowiki" + , Space + , Code ( "" , [] , [] ) " in a sentence " + , Space + , Str "like" + , Space + , Str "this." + ] + , Header 1 ( "" , [] , [] ) [ Str "Escapes" ] , Para - [ Str "Normal" - , Space - , Str "Link:" - , Space - , Link - ( "", [], [] ) - [ Str "http://wikicreole.org/" ] - ( "http://wikicreole.org/", "" ) - , Space - , Str "-" - , Space - , Str "now" - , Space - , Str "same" - , Space - , Str "link," - , Space - , Str "but" - , Space - , Str "escaped:" - , Space - , Str "http://wikicreole.org/" - ] + [ Str "Normal" + , Space + , Str "Link:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://wikicreole.org/" ] + ( "http://wikicreole.org/" , "" ) + , Space + , Str "-" + , Space + , Str "now" + , Space + , Str "same" + , Space + , Str "link," + , Space + , Str "but" + , Space + , Str "escaped:" + , Space + , Str "http://wikicreole.org/" + ] , Para - [ Str "Normal" - , Space - , Str "asterisks:" - , Space - , Str "**not" - , Space - , Str "bold**" - ] + [ Str "Normal" + , Space + , Str "asterisks:" + , Space + , Str "**not" + , Space + , Str "bold**" + ] , Para - [ Str "a", Space, Str "tilde", Space, Str "alone:", Space, Str "~" ] + [ Str "a" + , Space + , Str "tilde" + , Space + , Str "alone:" + , Space + , Str "~" + ] , Para - [ Str "a" - , Space - , Str "tilde" - , Space - , Str "escapes" - , Space - , Str "itself:" - , Space - , Str "~xxx" - ] - , Header 3 - ( "", [], [] ) - [ Str "Creole 0.2" ] + [ Str "a" + , Space + , Str "tilde" + , Space + , Str "escapes" + , Space + , Str "itself:" + , Space + , Str "~xxx" + ] + , Header 3 ( "" , [] , [] ) [ Str "Creole 0.2" ] , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "flower" - , Space - , Str "with" - , Space - , Str "the" - , Space - , Str "ALT" - , Space - , Str "text" - , Space - , Str "\"this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "flower\"" - , Space - , Str "if" - , Space - , Str "your" - , Space - , Str "wiki" - , Space - , Str "supports" - , Space - , Str "ALT" - , Space - , Str "text" - , Space - , Str "on" - , Space - , Str "images:" - ] + [ Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "flower" + , Space + , Str "with" + , Space + , Str "the" + , Space + , Str "ALT" + , Space + , Str "text" + , Space + , Str "\"this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "flower\"" + , Space + , Str "if" + , Space + , Str "your" + , Space + , Str "wiki" + , Space + , Str "supports" + , Space + , Str "ALT" + , Space + , Str "text" + , Space + , Str "on" + , Space + , Str "images:" + ] , Para - [ Image - ( "", [], [] ) - [ Str "here is a red flower" ] - ( "Red-Flower.jpg", "" ) - ] - , Header 3 - ( "", [], [] ) - [ Str "Creole 0.4" ] + [ Image + ( "" , [] , [] ) + [ Str "here is a red flower" ] + ( "Red-Flower.jpg" , "" ) + ] + , Header 3 ( "" , [] , [] ) [ Str "Creole 0.4" ] , Para - [ Str "Tables" - , Space - , Str "are" - , Space - , Str "done" - , Space - , Str "like" - , Space - , Str "this:" - ] + [ Str "Tables" + , Space + , Str "are" + , Space + , Str "done" + , Space + , Str "like" + , Space + , Str "this:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "header", Space, Str "col1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "header", Space, Str "col2" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col2" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "you" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "can" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "also" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "align", LineBreak, Str "it." ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "header" , Space , Str "col1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "header" , Space , Str "col2" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col2" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "you" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "can" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "also" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "align" , LineBreak , Str "it." ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "You" - , Space - , Str "can" - , Space - , Str "format" - , Space - , Str "an" - , Space - , Str "address" - , Space - , Str "by" - , Space - , Str "simply" - , Space - , Str "forcing" - , Space - , Str "linebreaks:" - ] + [ Str "You" + , Space + , Str "can" + , Space + , Str "format" + , Space + , Str "an" + , Space + , Str "address" + , Space + , Str "by" + , Space + , Str "simply" + , Space + , Str "forcing" + , Space + , Str "linebreaks:" + ] , Para - [ Str "My" - , Space - , Str "contact" - , Space - , Str "dates:" - , LineBreak - , Str "Pone:" - , Space - , Str "xyz" - , LineBreak - , Str "Fax:" - , Space - , Str "+45" - , LineBreak - , Str "Mobile:" - , Space - , Str "abc" - ] - , Header 3 - ( "", [], [] ) - [ Str "Creole 0.5" ] + [ Str "My" + , Space + , Str "contact" + , Space + , Str "dates:" + , LineBreak + , Str "Pone:" + , Space + , Str "xyz" + , LineBreak + , Str "Fax:" + , Space + , Str "+45" + , LineBreak + , Str "Mobile:" + , Space + , Str "abc" + ] + , Header 3 ( "" , [] , [] ) [ Str "Creole 0.5" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Header", Space, Str "title" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Another", Space, Str "header", Space, Str "title" ] - ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Code ( "", [], [] ) " //not italic text// " ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Code ( "", [], [] ) " **not bold text** " ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Emph [ Str "italic", Space, Str "text" ] ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Strong [ Space, Str "bold", Space, Str "text", Space ] ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Header" , Space , Str "title" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Another" + , Space + , Str "header" + , Space + , Str "title" + ] + ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Code ( "" , [] , [] ) " //not italic text// " ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Code ( "" , [] , [] ) " **not bold text** " ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Emph [ Str "italic" , Space , Str "text" ] ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Strong + [ Space + , Str "bold" + , Space + , Str "text" + , Space + ] + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 3 - ( "", [], [] ) - [ Str "Creole 1.0" ] + (TableFoot ( "" , [] , [] ) []) + , Header 3 ( "" , [] , [] ) [ Str "Creole 1.0" ] , Para - [ Str "If" - , Space - , Str "interwiki" - , Space - , Str "links" - , Space - , Str "are" - , Space - , Str "setup" - , Space - , Str "in" - , Space - , Str "your" - , Space - , Str "wiki," - , Space - , Str "this" - , Space - , Str "links" - , Space - , Str "to" - , Space - , Str "the" - , Space - , Str "WikiCreole" - , Space - , Str "page" - , Space - , Str "about" - , Space - , Str "Creole" - , Space - , Str "1.0" - , Space - , Str "test" - , Space - , Str "cases:" - , Space - , Link - ( "", [], [] ) - [ Str "WikiCreole:Creole1.0TestCases" ] - ( "WikiCreole:Creole1.0TestCases", "" ) - , Str "." - ] + [ Str "If" + , Space + , Str "interwiki" + , Space + , Str "links" + , Space + , Str "are" + , Space + , Str "setup" + , Space + , Str "in" + , Space + , Str "your" + , Space + , Str "wiki," + , Space + , Str "this" + , Space + , Str "links" + , Space + , Str "to" + , Space + , Str "the" + , Space + , Str "WikiCreole" + , Space + , Str "page" + , Space + , Str "about" + , Space + , Str "Creole" + , Space + , Str "1.0" + , Space + , Str "test" + , Space + , Str "cases:" + , Space + , Link + ( "" , [] , [] ) + [ Str "WikiCreole:Creole1.0TestCases" ] + ( "WikiCreole:Creole1.0TestCases" , "" ) + , Str "." + ] , HorizontalRule , Para - [ Str "The" - , Space - , Str "above" - , Space - , Str "test" - , Space - , Str "document" - , Space - , Str "was" - , Space - , Str "found" - , Space - , Str "on" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.wikicreole.org/wiki/Creole1.0TestCases" ] - ( "http://www.wikicreole.org/wiki/Creole1.0TestCases", "" ) - , Space - , Str "and" - , Space - , Str "downloaded" - , Space - , Str "from" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.wikicreole.org/attach/Creole1.0TestCases/creole1.0test.txt" ] - ( "http://www.wikicreole.org/attach/Creole1.0TestCases/creole1.0test.txt" - , "" - ) - , Str "." - ] + [ Str "The" + , Space + , Str "above" + , Space + , Str "test" + , Space + , Str "document" + , Space + , Str "was" + , Space + , Str "found" + , Space + , Str "on" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.wikicreole.org/wiki/Creole1.0TestCases" ] + ( "http://www.wikicreole.org/wiki/Creole1.0TestCases" , "" ) + , Space + , Str "and" + , Space + , Str "downloaded" + , Space + , Str "from" + , Space + , Link + ( "" , [] , [] ) + [ Str + "http://www.wikicreole.org/attach/Creole1.0TestCases/creole1.0test.txt" + ] + ( "http://www.wikicreole.org/attach/Creole1.0TestCases/creole1.0test.txt" + , "" + ) + , Str "." + ] , Para - [ Str "The" - , Space - , Str "Creole" - , Space - , Str "Wiki" - , Space - , Str "is" - , Space - , Str "licensed:" - , Space - , Str "Copyright" - , Space - , Str "(C)" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "contributors." - , Space - , Str "Some" - , Space - , Str "rights" - , Space - , Str "reserved," - , Space - , Str "license" - , Space - , Link - ( "", [], [] ) - [ Str "https://creativecommons.org/licenses/by-sa/1.0/" ] - ( "BY-SA", "" ) - , Str "." - ] + [ Str "The" + , Space + , Str "Creole" + , Space + , Str "Wiki" + , Space + , Str "is" + , Space + , Str "licensed:" + , Space + , Str "Copyright" + , Space + , Str "(C)" + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "contributors." + , Space + , Str "Some" + , Space + , Str "rights" + , Space + , Str "reserved," + , Space + , Str "license" + , Space + , Link + ( "" , [] , [] ) + [ Str "https://creativecommons.org/licenses/by-sa/1.0/" ] + ( "BY-SA" , "" ) + , Str "." + ] ] diff --git a/test/docbook-chapter.native b/test/docbook-chapter.native index 0aed171de..c77867ad9 100644 --- a/test/docbook-chapter.native +++ b/test/docbook-chapter.native @@ -1,167 +1,173 @@ Pandoc - ( Meta { unMeta = fromList [] } ) - [ Header 1 - ( "", [], [] ) - [ Str "Test", Space, Str "Chapter" ] + Meta { unMeta = fromList [] } + [ Header + 1 ( "" , [] , [] ) [ Str "Test" , Space , Str "Chapter" ] , Para - [ Str "This" - , Space - , Str "chapter" - , Space - , Str "uses" - , Space - , Str "recursive" - , Space - , Str "sections." - ] - , Header 2 - ( "", [], [] ) - [ Str "Like", Space, Str "a", Space, Str "Sect1" ] + [ Str "This" + , Space + , Str "chapter" + , Space + , Str "uses" + , Space + , Str "recursive" + , Space + , Str "sections." + ] + , Header + 2 + ( "" , [] , [] ) + [ Str "Like" , Space , Str "a" , Space , Str "Sect1" ] , Para - [ Str "This" - , Space - , Str "section" - , Space - , Str "is" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "Sect1." - ] - , Header 3 - ( "", [], [] ) - [ Str "Like", Space, Str "a", Space, Str "Sect2" ] + [ Str "This" + , Space + , Str "section" + , Space + , Str "is" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "Sect1." + ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Like" , Space , Str "a" , Space , Str "Sect2" ] , Para - [ Str "This" - , Space - , Str "section" - , Space - , Str "is" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "Sect2." - ] - , Header 4 - ( "", [], [] ) - [ Str "Like", Space, Str "a", Space, Str "Sect3" ] + [ Str "This" + , Space + , Str "section" + , Space + , Str "is" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "Sect2." + ] + , Header + 4 + ( "" , [] , [] ) + [ Str "Like" , Space , Str "a" , Space , Str "Sect3" ] , Para - [ Str "This" - , Space - , Str "section" - , Space - , Str "is" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "Sect3." - ] - , Header 5 - ( "", [], [] ) - [ Str "Like", Space, Str "a", Space, Str "Sect4" ] + [ Str "This" + , Space + , Str "section" + , Space + , Str "is" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "Sect3." + ] + , Header + 5 + ( "" , [] , [] ) + [ Str "Like" , Space , Str "a" , Space , Str "Sect4" ] , Para - [ Str "This" - , Space - , Str "section" - , Space - , Str "is" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "Sect4." - ] - , Header 6 - ( "", [], [] ) - [ Str "Like", Space, Str "a", Space, Str "Sect5" ] + [ Str "This" + , Space + , Str "section" + , Space + , Str "is" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "Sect4." + ] + , Header + 6 + ( "" , [] , [] ) + [ Str "Like" , Space , Str "a" , Space , Str "Sect5" ] , Para - [ Str "This" - , Space - , Str "section" - , Space - , Str "is" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "Sect5." - ] - , Header 7 - ( "", [], [] ) - [ Str "Would" - , Space - , Str "be" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "Sect6" - ] + [ Str "This" + , Space + , Str "section" + , Space + , Str "is" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "Sect5." + ] + , Header + 7 + ( "" , [] , [] ) + [ Str "Would" + , Space + , Str "be" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "Sect6" + ] , Para - [ Str "This" - , Space - , Str "section" - , Space - , Str "would" - , Space - , Str "be" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "Sect6," - , Space - , Str "if" - , Space - , Str "there" - , Space - , Str "was" - , Space - , Str "one." - ] - , Header 8 - ( "", [], [] ) - [ Str "Would" - , Space - , Str "be" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "Sect7" - ] + [ Str "This" + , Space + , Str "section" + , Space + , Str "would" + , Space + , Str "be" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "Sect6," + , Space + , Str "if" + , Space + , Str "there" + , Space + , Str "was" + , Space + , Str "one." + ] + , Header + 8 + ( "" , [] , [] ) + [ Str "Would" + , Space + , Str "be" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "Sect7" + ] , Para - [ Str "This" - , Space - , Str "section" - , Space - , Str "would" - , Space - , Str "be" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "Sect7," - , Space - , Str "if" - , Space - , Str "there" - , Space - , Str "was" - , Space - , Str "one." - ] + [ Str "This" + , Space + , Str "section" + , Space + , Str "would" + , Space + , Str "be" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "Sect7," + , Space + , Str "if" + , Space + , Str "there" + , Space + , Str "was" + , Space + , Str "one." + ] ] diff --git a/test/docbook-reader.native b/test/docbook-reader.native index d23ade4e1..c8d59ca82 100644 --- a/test/docbook-reader.native +++ b/test/docbook-reader.native @@ -1,561 +1,467 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "author" - , MetaList - [ MetaInlines - [ Str "John", SoftBreak, Str "MacFarlane" ] - , MetaInlines - [ Str "Anonymous" ] + Meta + { unMeta = + fromList + [ ( "author" + , MetaList + [ MetaInlines + [ Str "John" , SoftBreak , Str "MacFarlane" ] + , MetaInlines [ Str "Anonymous" ] + ] + ) + , ( "date" + , MetaInlines + [ Str "July" , Space , Str "17," , Space , Str "2006" ] + ) + , ( "title" + , MetaInlines + [ Str "Pandoc" + , Space + , Str "Test" + , Space + , Str "Suite" + ] + ) ] - ) - , - ( "date" - , MetaInlines - [ Str "July", Space, Str "17,", Space, Str "2006" ] - ) - , - ( "title" - , MetaInlines - [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] - ) - ] } - ) [ 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 "Most" - , Space - , Str "of" - , Space - , Str "them" - , Space - , Str "are" - , Space - , Str "adapted" - , Space - , Str "from" - , Space - , Str "John" - , SoftBreak - , Str "Gruber\8217s" - , Space - , Str "markdown" - , Space - , Str "test" - , Space - , Str "suite." - ] - , Header 1 - ( "headers", [], [] ) - [ Str "Headers" ] - , 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" ] - ( "/url", "" ) - ] - , Header 3 - ( "level-3-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "3" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 4 - ( "level-4", [], [] ) - [ Str "Level", Space, Str "4" ] - , Header 5 - ( "level-5", [], [] ) - [ Str "Level", Space, Str "5" ] - , Para - [ Str "Hi." ] - , Header 1 - ( "level-1", [], [] ) - [ Str "Level", Space, Str "1" ] - , Header 2 - ( "level-2-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "2" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 3 - ( "level-3", [], [] ) - [ Str "Level", Space, Str "3" ] - , Para - [ Str "with" - , Space - , Str "no" - , Space - , Str "blank" - , Space - , Str "line" - ] - , Header 4 - ( "", [ "unnumbered" ], [] ) - [ Str "Level", Space, Str "4" ] - , Para - [ Str "An", Space, Str "unnumbered", Space, Str "section." ] - , Header 2 - ( "level-2", [], [] ) - [ Str "Level", Space, Str "2" ] - , Para - [ Str "with" - , Space - , Str "no" - , Space - , Str "blank" - , Space - , Str "line" - ] - , Header 1 - ( "paragraphs", [], [] ) - [ Str "Paragraphs" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "regular" - , Space - , Str "paragraph." - ] - , Para - [ Str "In" - , Space - , Str "Markdown" - , Space - , Str "1.0.0" - , Space - , Str "and" - , Space - , Str "earlier." - , Space - , Str "Version" - , Space - , Str "8." - , Space - , Str "This" - , Space - , Str "line" - , Space - , Str "turns" - , Space - , Str "into" - , Space - , Str "a" - , Space - , Str "list" - , SoftBreak - , Str "item." - , Space - , Str "Because" - , Space - , Str "a" - , Space - , Str "hard-wrapped" - , Space - , Str "line" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "middle" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "paragraph" - , Space - , Str "looked" - , Space - , Str "like" - , SoftBreak - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "bullet." - , Space - , Str "*" - , Space - , Str "criminey." - ] - , Header 1 - ( "block-quotes", [], [] ) - [ Str "Block", Space, Str "Quotes" ] - , Para - [ Str "E-mail", Space, Str "style:" ] - , BlockQuote - [ Para [ Str "This" , Space , Str "is" , Space , Str "a" , Space - , Str "block" + , Str "set" , Space - , Str "quote." + , Str "of" , Space - , Str "It" + , Str "tests" , Space - , Str "is" + , Str "for" + , Space + , Str "pandoc." + , Space + , Str "Most" + , Space + , Str "of" + , Space + , Str "them" + , Space + , Str "are" , Space - , Str "pretty" + , Str "adapted" , Space - , Str "short." + , Str "from" + , Space + , Str "John" + , SoftBreak + , Str "Gruber\8217s" + , Space + , Str "markdown" + , Space + , Str "test" + , Space + , Str "suite." ] - ] - , BlockQuote - [ Para - [ Str "Code" + , Header 1 ( "headers" , [] , [] ) [ Str "Headers" ] + , 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" ] + ( "/url" , "" ) + ] + , Header + 3 + ( "level-3-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 4 ( "level-4" , [] , [] ) [ Str "Level" , Space , Str "4" ] + , Header + 5 ( "level-5" , [] , [] ) [ Str "Level" , Space , Str "5" ] + , Para [ Str "Hi." ] + , Header + 1 ( "level-1" , [] , [] ) [ Str "Level" , Space , Str "1" ] + , Header + 2 + ( "level-2-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 3 ( "level-3" , [] , [] ) [ Str "Level" , Space , Str "3" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Header + 4 + ( "" , [ "unnumbered" ] , [] ) + [ Str "Level" , Space , Str "4" ] + , Para + [ Str "An" + , Space + , Str "unnumbered" + , Space + , Str "section." + ] + , Header + 2 ( "level-2" , [] , [] ) [ Str "Level" , Space , Str "2" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Header 1 ( "paragraphs" , [] , [] ) [ Str "Paragraphs" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , Space + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "list" + , SoftBreak + , Str "item." + , Space + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" , Space , Str "in" , Space + , Str "the" + , Space + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "looked" + , Space + , Str "like" + , SoftBreak + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , Space + , Str "*" + , Space + , Str "criminey." + ] + , Header + 1 + ( "block-quotes" , [] , [] ) + [ Str "Block" , Space , Str "Quotes" ] + , Para [ Str "E-mail" , Space , Str "style:" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , Space + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] + ] + , BlockQuote + [ Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + , CodeBlock ( "" , [] , [] ) "% ls" + , Para [ Str "A" , Space , Str "list:" ] + , OrderedList + ( 1 , Decimal , DefaultDelim ) + [ [ Para [ Str "item" , Space , Str "one" ] ] + , [ Para [ Str "item" , Space , Str "two" ] ] + ] + , Para + [ Str "Nested" + , Space + , Str "block" + , Space + , Str "quotes:" + ] + , BlockQuote [ Para [ Str "nested" ] ] + , BlockQuote [ Para [ Str "nested" ] ] + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space , Str "a" , Space , Str "block" , Space , Str "quote:" + , Space + , Str "2" + , Space + , Str ">" + , Space + , Str "1." ] - , CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - , CodeBlock - ( "", [], [] ) "% ls" - , Para - [ Str "A", Space, Str "list:" ] - , OrderedList - ( 1, Decimal, DefaultDelim ) - [ - [ Para [ Str "item", Space, Str "one" ] ] - , - [ Para [ Str "item", Space, Str "two" ] ] - ] - , Para - [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] - , BlockQuote - [ Para [ Str "nested" ] ] - , BlockQuote - [ Para [ Str "nested" ] ] - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "block" - , Space - , Str "quote:" - , Space - , Str "2" - , Space - , Str ">" - , Space - , Str "1." - ] - , Para - [ Str "And" - , Space - , Str "a" - , Space - , Str "following" - , Space - , Str "paragraph." - ] - , Header 1 - ( "code-blocks", [], [] ) - [ Str "Code", Space, Str "Blocks" ] - , Para - [ Str "Code:" ] - , CodeBlock - ( "" - , [] - , [] - ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" , Para - [ Str "And:" ] + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] + , Header + 1 + ( "code-blocks" , [] , [] ) + [ Str "Code" , Space , Str "Blocks" ] + , Para [ Str "Code:" ] + , CodeBlock + ( "" , [] , [] ) + "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + , Para [ Str "And:" ] , CodeBlock - ( "" - , [] - , [] - ) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" - , Header 1 - ( "lists", [], [] ) - [ Str "Lists" ] - , Header 2 - ( "unordered", [], [] ) - [ Str "Unordered" ] - , Para - [ Str "Asterisks", Space, Str "loose:" ] + ( "" , [] , [] ) + " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + , Header 1 ( "lists" , [] , [] ) [ Str "Lists" ] + , Header 2 ( "unordered" , [] , [] ) [ Str "Unordered" ] + , Para [ Str "Asterisks" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "asterisk", Space, Str "1" ] ] - , - [ Para [ Str "asterisk", Space, Str "2" ] ] - , - [ Para [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "loose:" ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Plus", Space, Str "1" ] ] - , - [ Para [ Str "Plus", Space, Str "2" ] ] - , - [ Para [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "loose:" ] + [ [ Para [ Str "Plus" , Space , Str "1" ] ] + , [ Para [ Str "Plus" , Space , Str "2" ] ] + , [ Para [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Minus", Space, Str "1" ] ] - , - [ Para [ Str "Minus", Space, Str "2" ] ] - , - [ Para [ Str "Minus", Space, Str "3" ] ] - ] - , Header 2 - ( "ordered", [], [] ) - [ Str "Ordered" ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] + ] + , Header 2 ( "ordered" , [] , [] ) [ Str "Ordered" ] , OrderedList - ( 1, Decimal, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para [ Str "Second" ] ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "and", Space, Str "using", Space, Str "spaces:" ] + ( 1 , Decimal , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second" ] ] + , [ Para [ Str "Third" ] ] + ] + , Para + [ Str "and" , Space , Str "using" , Space , Str "spaces:" ] , OrderedList - ( 1, Decimal, DefaultDelim ) - [ - [ Para [ Str "One" ] ] - , - [ Para [ Str "Two" ] ] - , - [ Para [ Str "Three" ] ] - ] - , Para - [ Str "Multiple", Space, Str "paragraphs:" ] + ( 1 , Decimal , DefaultDelim ) + [ [ Para [ Str "One" ] ] + , [ Para [ Str "Two" ] ] + , [ Para [ Str "Three" ] ] + ] + , Para [ Str "Multiple" , Space , Str "paragraphs:" ] , OrderedList - ( 1, Decimal, DefaultDelim ) - [ - [ Para - [ Str "Item" - , Space - , Str "1," - , Space - , Str "graf" - , Space - , Str "one." - ] - , Para - [ Str "Item" - , Space - , Str "1." - , Space - , Str "graf" - , Space - , Str "two." - , Space - , Str "The" - , Space - , Str "quick" - , Space - , Str "brown" - , Space - , Str "fox" - , Space - , Str "jumped" - , Space - , Str "over" - , Space - , Str "the" - , Space - , Str "lazy" - , Space - , Str "dog\8217s" - , SoftBreak - , Str "back." + ( 1 , Decimal , DefaultDelim ) + [ [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , SoftBreak + , Str "back." + ] ] + , [ Para [ Str "Item" , Space , Str "2." ] ] + , [ Para [ Str "Item" , Space , Str "3." ] ] ] - , - [ Para [ Str "Item", Space, Str "2." ] ] - , - [ Para [ Str "Item", Space, Str "3." ] ] - ] - , Header 2 - ( "nested", [], [] ) - [ Str "Nested" ] + , Header 2 ( "nested" , [] , [] ) [ Str "Nested" ] , BulletList - [ - [ Para - [ Str "Tab" ] - , BulletList - [ - [ Para [ Str "Tab" ], BulletList [ [ Para [ Str "Tab" ] ] ] ] + [ [ Para [ Str "Tab" ] + , BulletList + [ [ Para [ Str "Tab" ] + , BulletList [ [ Para [ Str "Tab" ] ] ] + ] + ] ] ] - ] - , Para - [ Str "Here\8217s", Space, Str "another:" ] + , Para [ Str "Here\8217s" , Space , Str "another:" ] , OrderedList - ( 1, Decimal, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Para [ Str "Fee" ] ] - , - [ Para [ Str "Fie" ] ] - , - [ Para [ Str "Foe" ] ] + ( 1 , Decimal , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Para [ Str "Fee" ] ] + , [ Para [ Str "Fie" ] ] + , [ Para [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] + ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "Same" - , Space - , Str "thing" - , Space - , Str "but" - , Space - , Str "with" - , Space - , Str "paragraphs:" - ] , OrderedList - ( 1, Decimal, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Para [ Str "Fee" ] ] - , - [ Para [ Str "Fie" ] ] - , - [ Para [ Str "Foe" ] ] + ( 1 , Decimal , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Para [ Str "Fee" ] ] + , [ Para [ Str "Fie" ] ] + , [ Para [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] ] - , - [ Para [ Str "Third" ] ] - ] - , Header 2 - ( "tabs-and-spaces", [], [] ) - [ Str "Tabs", Space, Str "and", Space, Str "spaces" ] + , Header + 2 + ( "tabs-and-spaces" , [] , [] ) + [ Str "Tabs" , Space , Str "and" , Space , Str "spaces" ] , BulletList - [ - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "indented" - , Space - , Str "with" - , Space - , Str "tabs" - ] - ] - , - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "indented" - , Space - , Str "with" - , Space - , Str "spaces" - ] - , BulletList - [ - [ Para + [ [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -567,16 +473,13 @@ Pandoc , Space , Str "tabs" ] - ] - , - [ Para + ] + , [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -588,2468 +491,2440 @@ Pandoc , Space , Str "spaces" ] - ] + , BulletList + [ [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + ] + ] ] ] - ] - , Header 2 - ( "fancy-list-markers", [], [] ) - [ Str "Fancy", Space, Str "list", Space, Str "markers" ] + , Header + 2 + ( "fancy-list-markers" , [] , [] ) + [ Str "Fancy" , Space , Str "list" , Space , Str "markers" ] , OrderedList - ( 2, Decimal, DefaultDelim ) - [ - [ Para [ Str "begins", Space, Str "with", Space, Str "2" ] ] - , - [ Para - [ Str "and", Space, Str "now", Space, Str "3" ] - , Para - [ Str "with", Space, Str "a", Space, Str "continuation" ] - , OrderedList - ( 4, LowerRoman, DefaultDelim ) - [ - [ Para - [ Str "sublist" - , Space - , Str "with" - , Space - , Str "roman" - , Space - , Str "numerals," - , Space - , Str "starting" + ( 2 , Decimal , DefaultDelim ) + [ [ Para + [ Str "begins" , Space , Str "with" , Space , Str "2" ] + ] + , [ Para [ Str "and" , Space , Str "now" , Space , Str "3" ] + , Para + [ Str "with" , Space - , Str "with" + , Str "a" , Space - , Str "4" + , Str "continuation" ] - ] - , - [ Para - [ Str "more", Space, Str "items" ] - , OrderedList - ( 1, UpperAlpha, DefaultDelim ) - [ - [ Para [ Str "a", Space, Str "subsublist" ] ] - , - [ Para [ Str "a", Space, Str "subsublist" ] ] + , OrderedList + ( 4 , LowerRoman , DefaultDelim ) + [ [ Para + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , Space + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" + ] + ] + , [ Para [ Str "more" , Space , Str "items" ] + , OrderedList + ( 1 , UpperAlpha , DefaultDelim ) + [ [ Para [ Str "a" , Space , Str "subsublist" ] ] + , [ Para [ Str "a" , Space , Str "subsublist" ] ] + ] + ] ] - ] ] ] - ] - , Para - [ Str "Nesting:" ] + , Para [ Str "Nesting:" ] , OrderedList - ( 1, UpperAlpha, DefaultDelim ) - [ - [ Para - [ Str "Upper", Space, Str "Alpha" ] - , OrderedList - ( 1, UpperRoman, DefaultDelim ) - [ - [ Para - [ Str "Upper", Space, Str "Roman." ] - , OrderedList - ( 6, Decimal, DefaultDelim ) - [ - [ Para - [ Str "Decimal" - , Space - , Str "start" - , Space - , Str "with" - , Space - , Str "6" - ] + ( 1 , UpperAlpha , DefaultDelim ) + [ [ Para [ Str "Upper" , Space , Str "Alpha" ] + , OrderedList + ( 1 , UpperRoman , DefaultDelim ) + [ [ Para [ Str "Upper" , Space , Str "Roman." ] , OrderedList - ( 3, LowerAlpha, DefaultDelim ) - [ - [ Para - [ Str "Lower" - , Space - , Str "alpha" - , Space - , Str "with" - , Space - , Str "paren" + ( 6 , Decimal , DefaultDelim ) + [ [ Para + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3 , LowerAlpha , DefaultDelim ) + [ [ Para + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] ] ] - ] ] ] - ] ] ] - ] - , Para - [ Str "Autonumbering:" ] + , Para [ Str "Autonumbering:" ] , OrderedList - ( 1, Decimal, DefaultDelim ) - [ - [ Para [ Str "Autonumber." ] ] - , - [ Para - [ Str "More." ] - , OrderedList - ( 1, Decimal, DefaultDelim ) - [ [ Para [ Str "Nested." ] ] ] - ] - ] - , Para - [ Str "Should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item:" - ] - , Para - [ Str "M.A.\160\&2007" ] - , Para - [ Str "B.", Space, Str "Williams" ] - , Header 2 - ( "callout", [], [] ) - [ Str "Callout" ] - , Para - [ Str "Simple." ] - , BulletList - [ - [ Para - [ Str "A" - , Space - , Code - ( "", [], [] ) "__letrec" - , Space - , Str "is" - , Space - , Str "equivalent" - , Space - , Str "to" - , Space - , Str "a" - , Space - , Str "normal" - , SoftBreak - , Str "Haskell" - , Space - , Str "LET." - ] - ] - , - [ Para - [ Str "GHC" - , Space - , Str "compiled" - , Space - , Str "the" - , Space - , Str "body" - , Space - , Str "of" - , Space - , Str "our" - , Space - , Str "list" - , Space - , Str "comprehension" - , Space - , Str "into" - , SoftBreak - , Str "a" - , Space - , Str "loop" - , Space - , Str "named" - , Space - , Code - ( "", [], [] ) "go_s1YC" - , Str "." + ( 1 , Decimal , DefaultDelim ) + [ [ Para [ Str "Autonumber." ] ] + , [ Para [ Str "More." ] + , OrderedList + ( 1 , Decimal , DefaultDelim ) + [ [ Para [ Str "Nested." ] ] ] ] ] - , - [ Para - [ Str "If" - , Space - , Str "our" - , Space - , Str "CASE" - , Space - , Str "expression" - , Space - , Str "matches" - , Space - , Str "the" - , Space - , Str "empty" - , Space - , Str "list," - , Space - , Str "we" - , SoftBreak - , Str "return" - , Space - , Str "the" - , Space - , Str "empty" - , Space - , Str "list." - , Space - , Str "This" - , Space - , Str "is" - , Space - , Str "reassuringly" - , SoftBreak - , Str "familiar." - ] + , Para + [ Str "Should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item:" ] - ] - , Header 1 - ( "definition-lists", [], [] ) - [ Str "Definition", Space, Str "Lists" ] - , DefinitionList - [ - ( - [ Str "apple" ] - , - [ [ Para [ Str "red", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "orange" ] - , - [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "banana" ] - , - [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] - ) - ] - , Para - [ Str "Multiple" - , Space - , Str "blocks" - , Space - , Str "with" - , Space - , Str "italics:" - ] - , DefinitionList - [ - ( - [ Emph [ Str "apple" ] ] - , - [ - [ Para - [ Str "red", Space, Str "fruit" ] - , Para - [ Str "contains" + , Para [ Str "M.A.\160\&2007" ] + , Para [ Str "B." , Space , Str "Williams" ] + , Header 2 ( "callout" , [] , [] ) [ Str "Callout" ] + , Para [ Str "Simple." ] + , BulletList + [ [ Para + [ Str "A" , Space - , Str "seeds," + , Code ( "" , [] , [] ) "__letrec" , Space - , Str "crisp," + , Str "is" , Space - , Str "pleasant" + , Str "equivalent" , Space , Str "to" , Space - , Str "taste" + , Str "a" + , Space + , Str "normal" + , SoftBreak + , Str "Haskell" + , Space + , Str "LET." ] - ] ] - ) - , - ( - [ Emph [ Str "orange" ] ] - , - [ + , [ Para + [ Str "GHC" + , Space + , Str "compiled" + , Space + , Str "the" + , Space + , Str "body" + , Space + , Str "of" + , Space + , Str "our" + , Space + , Str "list" + , Space + , Str "comprehension" + , Space + , Str "into" + , SoftBreak + , Str "a" + , Space + , Str "loop" + , Space + , Str "named" + , Space + , Code ( "" , [] , [] ) "go_s1YC" + , Str "." + ] + ] + , [ Para + [ Str "If" + , Space + , Str "our" + , Space + , Str "CASE" + , Space + , Str "expression" + , Space + , Str "matches" + , Space + , Str "the" + , Space + , Str "empty" + , Space + , Str "list," + , Space + , Str "we" + , SoftBreak + , Str "return" + , Space + , Str "the" + , Space + , Str "empty" + , Space + , Str "list." + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "reassuringly" + , SoftBreak + , Str "familiar." + ] + ] + ] + , Header + 1 + ( "definition-lists" , [] , [] ) + [ Str "Definition" , Space , Str "Lists" ] + , DefinitionList + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Para [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "with" + , Space + , Str "italics:" + ] + , DefinitionList + [ ( [ Emph [ Str "apple" ] ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] + , Para + [ Str "contains" + , Space + , Str "seeds," + , Space + , Str "crisp," + , Space + , Str "pleasant" + , Space + , Str "to" + , Space + , Str "taste" + ] + ] + ] + ) + , ( [ Emph [ Str "orange" ] ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , CodeBlock ( "" , [] , [] ) "{ orange code block }" + , BlockQuote + [ Para + [ Str "orange" + , Space + , Str "block" + , Space + , Str "quote" + ] + ] + ] + ] + ) + ] + , Para + [ Str "Multiple" + , Space + , Str "definitions," + , Space + , Str "loose:" + ] + , DefinitionList + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] + , [ Para [ Str "computer" ] ] + ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] ] + , [ Para [ Str "bank" ] ] + ] + ) + ] + , Para + [ Str "Blank" + , Space + , Str "line" + , Space + , Str "after" + , Space + , Str "term," + , Space + , Str "indented" + , Space + , Str "marker," + , Space + , Str "alternate" + , Space + , Str "markers:" + ] + , DefinitionList + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] + , [ Para [ Str "computer" ] ] + ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , OrderedList + ( 1 , Decimal , DefaultDelim ) + [ [ Para [ Str "sublist" ] ] + , [ Para [ Str "sublist" ] ] + ] + ] + ] + ) + ] + , Header + 1 + ( "inline-markup" , [] , [] ) + [ Str "Inline" , Space , Str "Markup" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph [ Str "is" , SoftBreak , Str "this" ] + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , SoftBreak + , Strong [ Str "is" , Space , Str "this" ] + , Str "." + ] + , Para + [ Str "An" + , Space + , Emph + [ Link + ( "" , [] , [] ) + [ Str "emphasized" , Space , Str "link" ] + ( "/url" , "" ) + ] + , Str "." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , SoftBreak + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , SoftBreak + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code ( "" , [] , [] ) ">" + , Str "," + , Space + , Code ( "" , [] , [] ) "$" + , Str "," + , SoftBreak + , Code ( "" , [] , [] ) "\\" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\$" + , Str "," + , SoftBreak + , Code ( "" , [] , [] ) "" + , Str "." + ] + , Para + [ Str "More" + , Space + , Str "code:" + , Space + , Code ( "" , [] , [] ) "Class" + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "Type" + ] + , Para + [ Str "Referencing" + , Space + , Str "a" + , Space + , Str "man" + , Space + , Str "page:" + , Space + , Code ( "" , [ "citerefentry" ] , [] ) "nix.conf(5)" + ] + , Para + [ Strikeout + [ Str "This" + , Space + , Str "is" + , SoftBreak + , Emph [ Str "strikeout" ] + , Str "." + ] + ] + , Para + [ Str "Superscripts:" + , Space + , Str "a" + , Superscript [ Str "bc" ] + , Str "d" + , SoftBreak + , Str "a" + , Superscript [ Emph [ Str "hello" ] ] + , SoftBreak + , Str "a" + , Superscript [ Str "hello\160there" ] + , Str "." + ] + , Para + [ Str "Subscripts:" + , Space + , Str "H" + , Subscript [ Str "2" ] + , Str "O," + , Space + , Str "H" + , Subscript [ Str "23" ] + , Str "O," + , SoftBreak + , Str "H" + , Subscript [ Str "many\160of\160them" ] + , Str "O." + ] + , Para + [ Str "These" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "superscripts" + , Space + , Str "or" + , Space + , Str "subscripts," + , Space + , Str "because" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "unescaped" + , SoftBreak + , Str "spaces:" + , Space + , Str "a^b" + , Space + , Str "c^d," + , Space + , Str "a~b" + , Space + , Str "c~d." + ] + , Header + 1 + ( "smart-quotes-ellipses-dashes" , [] , [] ) + [ Str "Smart" + , Space + , Str "quotes," + , Space + , Str "ellipses," + , Space + , Str "dashes" + ] + , Para + [ Quoted DoubleQuote [ Str "Hello," ] + , Space + , Str "said" + , Space + , Str "the" + , Space + , Str "spider." + , Space + , Quoted + DoubleQuote + [ Quoted SingleQuote [ Str "Shelob" ] + , Space + , Str "is" + , Space + , Str "my" + , SoftBreak + , Str "name." + ] + ] + , Para + [ Quoted DoubleQuote [ Str "A" ] + , Str "," + , Space + , Quoted DoubleQuote [ Str "B" ] + , Str "," + , Space + , Str "and" + , Space + , Quoted DoubleQuote [ Str "C" ] + , Space + , Str "are" + , Space + , Str "letters." + ] + , Para + [ Quoted + DoubleQuote + [ Str "He" + , Space + , Str "said," + , Space + , Quoted + SingleQuote + [ Str "I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "go." + ] + ] + , Space + , Str "Were" + , Space + , Str "you" + , Space + , Str "alive" + , Space + , Str "in" + , Space + , Str "the" + , SoftBreak + , Str "70\8217s?" + ] + , Para + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one\8212two" + , Space + , Str "\8212" + , Space + , Str "three\8212four" + , Space + , Str "\8212" + , Space + , Str "five." + ] + , Para + [ Str "Dashes" + , Space + , Str "between" + , Space + , Str "numbers:" + , Space + , Str "5\8211\&7," + , Space + , Str "255\8211\&66," + , Space + , Str "1987\8211\&1999." + ] + , Para [ Str "Ellipses\8230and\8230and\8230." ] + , Header 1 ( "math" , [] , [] ) [] + , Para + [ Math DisplayMath "e = mc^{2}" + , Math DisplayMath "1" + , SoftBreak + , Math InlineMath "e = mc^{2}" + , SoftBreak + , Math DisplayMath "e = mc^{2}" + ] + , Header + 1 + ( "special-characters" , [] , [] ) + [ Str "Special" , Space , Str "Characters" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "unicode:" + ] + , BulletList + [ [ Para + [ Str "I" , Space , Str "hat:" , Space , Str "\206" ] + ] + , [ Para + [ Str "o" , Space , Str "umlaut:" , Space , Str "\246" ] + ] + , [ Para [ Str "section:" , Space , Str "\167" ] ] + , [ Para + [ Str "set" + , Space + , Str "membership:" + , Space + , Str "\8712" + ] + ] + , [ Para [ Str "copyright:" , Space , Str "\169" ] ] + ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] + , Para + [ Str "This" , Space , Str "&" , Space , Str "that." ] + , Para [ Str "4" , Space , Str "<" , Space , Str "5." ] + , Para [ Str "6" , Space , Str ">" , Space , Str "5." ] + , Para [ Str "Backslash:" , Space , Str "\\" ] + , Para [ Str "Backtick:" , Space , Str "`" ] + , Para [ Str "Asterisk:" , Space , Str "*" ] + , Para [ Str "Underscore:" , Space , Str "_" ] + , Para + [ Str "Left" , Space , Str "brace:" , Space , Str "{" ] + , Para + [ Str "Right" , Space , Str "brace:" , Space , Str "}" ] + , Para + [ Str "Left" , Space , Str "bracket:" , Space , Str "[" ] + , Para + [ Str "Right" , Space , Str "bracket:" , Space , Str "]" ] + , Para + [ Str "Left" , Space , Str "paren:" , Space , Str "(" ] + , Para + [ Str "Right" , Space , Str "paren:" , Space , Str ")" ] + , Para [ Str "Greater-than:" , Space , Str ">" ] + , Para [ Str "Hash:" , Space , Str "#" ] + , Para [ Str "Period:" , Space , Str "." ] + , Para [ Str "Bang:" , Space , Str "!" ] + , Para [ Str "Plus:" , Space , Str "+" ] + , Para [ Str "Minus:" , Space , Str "-" ] + , Header 1 ( "links" , [] , [] ) [ Str "Links" ] + , Header 2 ( "explicit" , [] , [] ) [ Str "Explicit" ] + , Para + [ Str "Just" + , Space + , Str "a" + , Space + , Link ( "" , [] , [] ) [ Str "URL" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "with_underscore" ] + ( "/url/with_underscore" , "" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "nobody@nowhere.net" ] + ( "mailto:nobody@nowhere.net" , "" ) + ] + , Para + [ Link ( "" , [] , [] ) [ Str "Empty" ] ( "" , "" ) + , Str "." + ] + , Header 2 ( "reference" , [] , [] ) [ Str "Reference" ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "With" + , Space + , Link + ( "" , [] , [] ) + [ Str "embedded" , Space , Str "[brackets]" ] + ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link ( "" , [] , [] ) [ Str "b" ] ( "/url/" , "" ) + , Space + , Str "by" + , Space + , Str "itself" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "once" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "twice" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "thrice" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "[not][]" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , CodeBlock ( "" , [] , [] ) "[not]: /url" + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "biz" ] ( "/url/" , "" ) + , Str "." + ] + , Header + 2 + ( "with-ampersands" , [] , [] ) + [ Str "With" , Space , Str "ampersands" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Link + ( "" , [] , [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , SoftBreak + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "amersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "link" + , Space + , Str "text:" + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "AT&T" ] ( "http://att.com/" , "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Str "inline" , Space , Str "link" ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Str "inline" + , Space + , Str "link" + , Space + , Str "in" + , Space + , Str "pointy" + , SoftBreak + , Str "braces" + ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Header 2 ( "autolinks" , [] , [] ) [ Str "Autolinks" ] + , Para + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + ] + , BulletList + [ [ Para + [ Str "In" , Space , Str "a" , Space , Str "list?" ] + ] + , [ Para + [ Link + ( "" , [] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] + ] + , [ Para [ Str "It" , Space , Str "should." ] ] + ] + , Para + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" + , Space + , Link + ( "" , [] , [] ) + [ Str "nobody@nowhere.net" ] + ( "mailto:nobody@nowhere.net" , "" ) + ] + , BlockQuote + [ Para + [ Str "Blockquoted:" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] + ] + , Para + [ Str "Auto-links" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "occur" + , Space + , Str "here:" + , SoftBreak + , Code ( "" , [] , [] ) "" + ] + , CodeBlock + ( "" , [] , [] ) "or here: " + , Header 1 ( "images" , [] , [] ) [ Str "Images" ] + , Para + [ Str "From" + , Space + , Quoted + DoubleQuote + [ Str "Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune" + ] + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" + ] + , Para + [ Image + ( "" , [] , [] ) + [ Str "lalune" , Space , Str "fig" , Space , Str "caption" ] + ( "lalune.jpg" , "fig:" ) + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space + , Image ( "" , [] , [] ) [] ( "movie.jpg" , "" ) + , Space + , Str "icon." + , SoftBreak + , Str "And" + , Space + , Str "here" + , Space + , Str "a" + , Space + , Str "second" + , Space + , Str "movie" + , Space + , Image + ( "" , [] , [] ) + [ Str "alt" , Space , Str "text" ] + ( "movie.jpg" , "" ) + , Space + , Str "icon." + , SoftBreak + , Str "And" + , Space + , Str "here" + , Space + , Str "a" + , Space + , Str "third" + , Space + , Str "movie" + , Space + , Image + ( "" , [] , [] ) + [ Str "alt" , Space , Str "text" ] + ( "movie.jpg" , "" ) + , Space + , Str "icon." + ] + , Para + [ Image + ( "" , [] , [] ) + [ Str "lalune" + , Space + , Str "no" + , Space + , Str "figure" + , Space + , Str "alt" + , Space + , Str "text" + ] + ( "lalune.jpg" , "" ) + ] + , Header 1 ( "footnotes" , [] , [] ) [ Str "Footnotes" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Note [ Para - [ Str "orange", Space, Str "fruit" ] - , CodeBlock - ( "", [], [] ) "{ orange code block }" - , BlockQuote - [ Para - [ Str "orange", Space, Str "block", Space, Str "quote" ] - ] + [ Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "footnote." + , Space + , Str "It" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "anywhere" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "footnote" + , Space + , Str "reference." + , SoftBreak + , Str "It" + , Space + , Str "need" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "placed" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "document." + ] ] - ] - ) - ] - , Para - [ Str "Multiple", Space, Str "definitions,", Space, Str "loose:" ] - , DefinitionList - [ - ( - [ Str "apple" ] - , - [ - [ Para [ Str "red", Space, Str "fruit" ] ] - , - [ Para [ Str "computer" ] ] - ] - ) - , - ( - [ Str "orange" ] - , - [ - [ Para [ Str "orange", Space, Str "fruit" ] ] - , - [ Para [ Str "bank" ] ] - ] - ) - ] - , Para - [ Str "Blank" - , Space - , Str "line" - , Space - , Str "after" - , Space - , Str "term," - , Space - , Str "indented" - , Space - , Str "marker," - , Space - , Str "alternate" - , Space - , Str "markers:" - ] - , DefinitionList - [ - ( - [ Str "apple" ] - , - [ - [ Para [ Str "red", Space, Str "fruit" ] ] - , - [ Para [ Str "computer" ] ] - ] - ) - , - ( - [ Str "orange" ] - , - [ + , Space + , Str "and" + , Space + , Str "another." + , Note [ Para - [ Str "orange", Space, Str "fruit" ] - , OrderedList - ( 1, Decimal, DefaultDelim ) - [ [ Para [ Str "sublist" ] ], [ Para [ Str "sublist" ] ] ] + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "long" + , Space + , Str "note." + , Space + , Str "This" + , Space + , Str "one" + , Space + , Str "contains" + , Space + , Str "multiple" + , Space + , Str "blocks." + ] + , Para + [ Str "Subsequent" + , Space + , Str "blocks" + , Space + , Str "are" + , Space + , Str "indented" + , Space + , Str "to" + , Space + , Str "show" + , Space + , Str "that" + , Space + , Str "they" + , Space + , Str "belong" + , Space + , Str "to" + , Space + , Str "the" + , SoftBreak + , Str "footnote" + , Space + , Str "(as" + , Space + , Str "with" + , Space + , Str "list" + , Space + , Str "items)." + ] + , CodeBlock ( "" , [] , [] ) " { }" + , Para + [ Str "If" + , Space + , Str "you" + , Space + , Str "want," + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "indent" + , Space + , Str "every" + , Space + , Str "line," + , Space + , Str "but" + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "be" + , Space + , Str "lazy" + , Space + , Str "and" + , SoftBreak + , Str "just" + , Space + , Str "indent" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "line" + , Space + , Str "of" + , Space + , Str "each" + , Space + , Str "block." + ] ] - ] - ) - ] - , Header 1 - ( "inline-markup", [], [] ) - [ Str "Inline", Space, Str "Markup" ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "emphasized" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Emph - [ Str "is", SoftBreak, Str "this" ] - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , SoftBreak - , Strong - [ Str "is", Space, Str "this" ] - , Str "." - ] - , Para - [ Str "An" - , Space - , Emph - [ Link - ( "", [], [] ) - [ Str "emphasized", Space, Str "link" ] - ( "/url", "" ) - ] - , Str "." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , SoftBreak - , Str "em." - ] - ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , SoftBreak - , Str "em." - ] - ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "code:" - , Space - , Code - ( "", [], [] ) ">" - , Str "," - , Space - , Code - ( "", [], [] ) "$" - , Str "," - , SoftBreak - , Code - ( "", [], [] ) "\\" - , Str "," - , Space - , Code - ( "", [], [] ) "\\$" - , Str "," - , SoftBreak - , Code - ( "", [], [] ) "" - , Str "." - ] - , Para - [ Str "More" - , Space - , Str "code:" - , Space - , Code - ( "", [], [] ) "Class" - , Space - , Str "and" - , Space - , Code - ( "", [], [] ) "Type" - ] - , Para - [ Str "Referencing" - , Space - , Str "a" - , Space - , Str "man" - , Space - , Str "page:" - , Space - , Code - ( "", [ "citerefentry" ], [] ) "nix.conf(5)" - ] - , Para - [ Strikeout - [ Str "This" , Space - , Str "is" + , Str "This" + , Space + , Str "should" + , Space + , Emph [ Str "not" ] + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," , SoftBreak - , Emph - [ Str "strikeout" ] - , Str "." - ] - ] - , Para - [ Str "Superscripts:" - , Space - , Str "a" - , Superscript - [ Str "bc" ] - , Str "d" - , SoftBreak - , Str "a" - , Superscript - [ Emph [ Str "hello" ] ] - , SoftBreak - , Str "a" - , Superscript - [ Str "hello\160there" ] - , Str "." - ] - , Para - [ Str "Subscripts:" - , Space - , Str "H" - , Subscript - [ Str "2" ] - , Str "O," - , Space - , Str "H" - , Subscript - [ Str "23" ] - , Str "O," - , SoftBreak - , Str "H" - , Subscript - [ Str "many\160of\160them" ] - , Str "O." - ] - , Para - [ Str "These" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "superscripts" - , Space - , Str "or" - , Space - , Str "subscripts," - , Space - , Str "because" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "unescaped" - , SoftBreak - , Str "spaces:" - , Space - , Str "a^b" - , Space - , Str "c^d," - , Space - , Str "a~b" - , Space - , Str "c~d." - ] - , Header 1 - ( "smart-quotes-ellipses-dashes", [], [] ) - [ Str "Smart" - , Space - , Str "quotes," - , Space - , Str "ellipses," - , Space - , Str "dashes" - ] - , Para - [ Quoted DoubleQuote - [ Str "Hello," ] - , Space - , Str "said" - , Space - , Str "the" - , Space - , Str "spider." - , Space - , Quoted DoubleQuote - [ Quoted SingleQuote - [ Str "Shelob" ] + , Str "because" + , Space + , Str "it" + , Space + , Str "contains" + , Space + , Str "a" + , Space + , Str "space.[^my" + , Space + , Str "note]" + , Space + , Str "Here" , Space , Str "is" , Space - , Str "my" - , SoftBreak - , Str "name." - ] - ] - , Para - [ Quoted DoubleQuote - [ Str "A" ] - , Str "," - , Space - , Quoted DoubleQuote - [ Str "B" ] - , Str "," - , Space - , Str "and" - , Space - , Quoted DoubleQuote - [ Str "C" ] - , Space - , Str "are" - , Space - , Str "letters." - ] - , Para - [ Quoted DoubleQuote - [ Str "He" - , Space - , Str "said," - , Space - , Quoted SingleQuote - [ Str "I" - , Space - , Str "want" - , Space - , Str "to" - , Space - , Str "go." - ] + , Str "an" + , Space + , Str "inline" + , Space + , Str "note." + , Note + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "easier" ] + , Space + , Str "to" + , Space + , Str "type." + , Space + , Str "Inline" + , Space + , Str "notes" + , Space + , Str "may" + , Space + , Str "contain" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "links" ] + ( "http://google.com" , "" ) + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "]" + , SoftBreak + , Str "verbatim" + , Space + , Str "characters," + , Space + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str "[bracketed" + , Space + , Str "text]." + ] + ] ] - , Space - , Str "Were" - , Space - , Str "you" - , Space - , Str "alive" - , Space - , Str "in" - , Space - , Str "the" - , SoftBreak - , Str "70\8217s?" - ] - , Para - [ Str "Some" - , Space - , Str "dashes:" - , Space - , Str "one\8212two" - , Space - , Str "\8212" - , Space - , Str "three\8212four" - , Space - , Str "\8212" - , Space - , Str "five." - ] - , Para - [ Str "Dashes" - , Space - , Str "between" - , Space - , Str "numbers:" - , Space - , Str "5\8211\&7," - , Space - , Str "255\8211\&66," - , Space - , Str "1987\8211\&1999." - ] - , Para - [ Str "Ellipses\8230and\8230and\8230." ] - , Header 1 - ( "math", [], [] ) [] - , Para - [ Math DisplayMath "e = mc^{2}" - , Math DisplayMath "1" - , SoftBreak - , Math InlineMath "e = mc^{2}" - , SoftBreak - , Math DisplayMath "e = mc^{2}" - ] - , Header 1 - ( "special-characters", [], [] ) - [ Str "Special", Space, Str "Characters" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "unicode:" - ] - , BulletList - [ - [ Para [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] - , - [ Para [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] - , - [ Para [ Str "section:", Space, Str "\167" ] ] - , + , BlockQuote [ Para - [ Str "set", Space, Str "membership:", Space, Str "\8712" ] + [ Str "Notes" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "in" + , Space + , Str "quotes." + , Note [ Para [ Str "In" , Space , Str "quote." ] ] + ] + ] + , OrderedList + ( 1 , Decimal , DefaultDelim ) + [ [ Para + [ Str "And" + , Space + , Str "in" + , Space + , Str "list" + , Space + , Str "items." + , Note [ Para [ Str "In" , Space , Str "list." ] ] + ] + ] ] - , - [ Para [ Str "copyright:", Space, Str "\169" ] ] - ] , Para - [ Str "AT&T" - , Space - , Str "has" - , Space - , Str "an" - , Space - , Str "ampersand" - , Space - , Str "in" - , Space - , Str "their" - , Space - , Str "name." - ] - , Para - [ Str "AT&T" - , Space - , Str "is" - , Space - , Str "another" - , Space - , Str "way" - , Space - , Str "to" - , Space - , Str "write" - , Space - , Str "it." - ] - , Para - [ Str "This", Space, Str "&", Space, Str "that." ] - , Para - [ Str "4", Space, Str "<", Space, Str "5." ] - , Para - [ Str "6", Space, Str ">", Space, Str "5." ] - , Para - [ Str "Backslash:", Space, Str "\\" ] - , Para - [ Str "Backtick:", Space, Str "`" ] - , Para - [ Str "Asterisk:", Space, Str "*" ] - , Para - [ Str "Underscore:", Space, Str "_" ] - , Para - [ Str "Left", Space, Str "brace:", Space, Str "{" ] - , Para - [ Str "Right", Space, Str "brace:", Space, Str "}" ] - , Para - [ Str "Left", Space, Str "bracket:", Space, Str "[" ] - , Para - [ Str "Right", Space, Str "bracket:", Space, Str "]" ] - , Para - [ Str "Left", Space, Str "paren:", Space, Str "(" ] - , Para - [ Str "Right", Space, Str "paren:", Space, Str ")" ] - , Para - [ Str "Greater-than:", Space, Str ">" ] - , Para - [ Str "Hash:", Space, Str "#" ] - , Para - [ Str "Period:", Space, Str "." ] - , Para - [ Str "Bang:", Space, Str "!" ] - , Para - [ Str "Plus:", Space, Str "+" ] - , Para - [ Str "Minus:", Space, Str "-" ] - , Header 1 - ( "links", [], [] ) - [ Str "Links" ] - , Header 2 - ( "explicit", [], [] ) - [ Str "Explicit" ] - , Para - [ Str "Just" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "URL" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "with_underscore" ] - ( "/url/with_underscore", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "nobody@nowhere.net" ] - ( "mailto:nobody@nowhere.net", "" ) - ] - , Para - [ Link ( "", [], [] ) [ Str "Empty" ] ( "", "" ), Str "." ] - , Header 2 - ( "reference", [], [] ) - [ Str "Reference" ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "With" - , Space - , Link - ( "", [], [] ) - [ Str "embedded", Space, Str "[brackets]" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "b" ] - ( "/url/", "" ) - , Space - , Str "by" - , Space - , Str "itself" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "once" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "twice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "thrice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "[not][]" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , CodeBlock - ( "", [], [] ) "[not]: /url" - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "biz" ] - ( "/url/", "" ) - , Str "." - ] - , Header 2 - ( "with-ampersands", [], [] ) - [ Str "With", Space, Str "ampersands" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "link" + [ Str "This" , Space - , Str "with" + , Str "paragraph" , Space - , Str "an" - , SoftBreak - , Str "ampersand" + , Str "should" , Space - , Str "in" + , Str "not" , Space - , Str "the" + , Str "be" , Space - , Str "URL" - ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "link" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Str "amersand" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "link" - , Space - , Str "text:" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "AT&T" ] - ( "http://att.com/", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "inline", Space, Str "link" ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "inline" + , Str "part" , Space - , Str "link" + , Str "of" , Space - , Str "in" + , Str "the" , Space - , Str "pointy" - , SoftBreak - , Str "braces" - ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Header 2 - ( "autolinks", [], [] ) - [ Str "Autolinks" ] - , Para - [ Str "With" - , Space - , Str "an" - , Space - , Str "ampersand:" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://example.com/?foo=1&bar=2" ] - ( "http://example.com/?foo=1&bar=2", "" ) - ] - , BulletList - [ - [ Para [ Str "In", Space, Str "a", Space, Str "list?" ] ] - , - [ Para - [ Link - ( "", [], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) - ] - ] - , - [ Para [ Str "It", Space, Str "should." ] ] - ] - , Para - [ Str "An" - , Space - , Str "e-mail" - , Space - , Str "address:" - , Space - , Link - ( "", [], [] ) - [ Str "nobody@nowhere.net" ] - ( "mailto:nobody@nowhere.net", "" ) - ] - , BlockQuote - [ Para - [ Str "Blockquoted:" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) - ] - ] - , Para - [ Str "Auto-links" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "occur" - , Space - , Str "here:" - , SoftBreak - , Code - ( "", [], [] ) "" - ] - , CodeBlock - ( "", [], [] ) "or here: " - , Header 1 - ( "images", [], [] ) - [ Str "Images" ] - , Para - [ Str "From" - , Space - , Quoted DoubleQuote - [ Str "Voyage" - , Space - , Str "dans" - , Space - , Str "la" - , Space - , Str "Lune" - ] - , Space - , Str "by" - , Space - , Str "Georges" - , Space - , Str "Melies" - , Space - , Str "(1902):" - ] - , Para - [ Image - ( "", [], [] ) - [ Str "lalune", Space, Str "fig", Space, Str "caption" ] - ( "lalune.jpg", "fig:" ) - ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "movie" - , Space - , Image - ( "", [], [] ) [] - ( "movie.jpg", "" ) - , Space - , Str "icon." - , SoftBreak - , Str "And" - , Space - , Str "here" - , Space - , Str "a" - , Space - , Str "second" - , Space - , Str "movie" - , Space - , Image - ( "", [], [] ) - [ Str "alt", Space, Str "text" ] - ( "movie.jpg", "" ) - , Space - , Str "icon." - , SoftBreak - , Str "And" - , Space - , Str "here" - , Space - , Str "a" - , Space - , Str "third" - , Space - , Str "movie" - , Space - , Image - ( "", [], [] ) - [ Str "alt", Space, Str "text" ] - ( "movie.jpg", "" ) - , Space - , Str "icon." - ] - , Para - [ Image - ( "", [], [] ) - [ Str "lalune" + , Str "note," , Space - , Str "no" + , Str "as" + , Space + , Str "it" , Space - , Str "figure" + , Str "is" , Space - , Str "alt" + , Str "not" , Space - , Str "text" + , Str "indented." ] - ( "lalune.jpg", "" ) - ] - , Header 1 - ( "footnotes", [], [] ) - [ Str "Footnotes" ] + , Header 1 ( "tables" , [] , [] ) [ Str "Tables" ] , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference," - , Note - [ Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "footnote." - , Space - , Str "It" - , Space - , Str "can" - , Space - , Str "go" - , Space - , Str "anywhere" - , Space - , Str "after" - , Space - , Str "the" - , Space - , Str "footnote" - , Space - , Str "reference." - , SoftBreak - , Str "It" - , Space - , Str "need" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "placed" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "end" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "document." - ] + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "caption:" ] - , Space - , Str "and" - , Space - , Str "another." - , Note - [ Para - [ Str "Here\8217s" - , Space - , Str "the" - , Space - , Str "long" - , Space - , Str "note." - , Space - , Str "This" - , Space - , Str "one" - , Space - , Str "contains" - , Space - , Str "multiple" - , Space - , Str "blocks." - ] - , Para - [ Str "Subsequent" - , Space - , Str "blocks" - , Space - , Str "are" - , Space - , Str "indented" - , Space - , Str "to" - , Space - , Str "show" - , Space - , Str "that" - , Space - , Str "they" - , Space - , Str "belong" - , Space - , Str "to" - , Space - , Str "the" - , SoftBreak - , Str "footnote" - , Space - , Str "(as" - , Space - , Str "with" - , Space - , Str "list" - , Space - , Str "items)." - ] - , CodeBlock - ( "", [], [] ) " { }" - , Para - [ Str "If" - , Space - , Str "you" - , Space - , Str "want," - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "indent" - , Space - , Str "every" - , Space - , Str "line," - , Space - , Str "but" - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "also" - , Space - , Str "be" - , Space - , Str "lazy" - , Space - , Str "and" - , SoftBreak - , Str "just" - , Space - , Str "indent" - , Space - , Str "the" - , Space - , Str "first" - , Space - , Str "line" - , Space - , Str "of" - , Space - , Str "each" - , Space - , Str "block." - ] + , Table + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ]) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - , Space - , Str "This" - , Space - , Str "should" - , Space - , Emph - [ Str "not" ] - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference," - , SoftBreak - , Str "because" - , Space - , Str "it" - , Space - , Str "contains" - , Space - , Str "a" - , Space - , Str "space.[^my" - , Space - , Str "note]" - , Space - , Str "Here" - , Space - , Str "is" - , Space - , Str "an" - , Space - , Str "inline" - , Space - , Str "note." - , Note - [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "easier" ] - , Space - , Str "to" - , Space - , Str "type." - , Space - , Str "Inline" - , Space - , Str "notes" - , Space - , Str "may" - , Space - , Str "contain" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "links" ] - ( "http://google.com", "" ) - , Space - , Str "and" - , Space - , Code - ( "", [], [] ) "]" - , SoftBreak - , Str "verbatim" - , Space - , Str "characters," - , Space - , Str "as" - , Space - , Str "well" - , Space - , Str "as" - , Space - , Str "[bracketed" - , Space - , Str "text]." - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - , BlockQuote - [ Para - [ Str "Notes" - , Space - , Str "can" + (TableFoot ( "" , [] , [] ) []) + , Para + [ Str "Simple" , Space - , Str "go" + , Str "table" , Space - , Str "in" + , Str "without" , Space - , Str "quotes." - , Note - [ Para [ Str "In", Space, Str "quote." ] ] + , Str "caption:" ] - ] - , OrderedList - ( 1, Decimal, DefaultDelim ) - [ - [ Para - [ Str "And" - , Space - , Str "in" - , Space - , Str "list" - , Space - , Str "items." - , Note - [ Para [ Str "In", Space, Str "list." ] ] - ] - ] - ] - , Para - [ Str "This" - , Space - , Str "paragraph" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "part" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "note," - , Space - , Str "as" - , Space - , Str "it" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "indented." - ] - , Header 1 - ( "tables", [], [] ) - [ Str "Tables" ] - , Para - [ Str "Simple" - , Space - , Str "table" - , Space - , Str "with" - , Space - , Str "caption:" - ] , Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Demonstration" - , Space - , Str "of" - , Space - , Str "simple" - , Space - , Str "table" - , Space - , Str "syntax." - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , Para + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "indented" + , Space + , Str "two" + , Space + , Str "spaces:" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Simple" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "caption:" - ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ]) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Para + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "caption:" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Simple" - , Space - , Str "table" - , Space - , Str "indented" - , Space - , Str "two" - , Space - , Str "spaces:" - ] , Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Demonstration" - , Space - , Str "of" - , Space - , Str "simple" - , Space - , Str "table" - , Space - , Str "syntax." - ] + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Here's" + , Space + , Str "the" + , Space + , Str "caption." + , Space + , Str "It" + , Space + , Str "may" + , Space + , Str "span" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ]) + [ ( AlignCenter , ColWidth 0.2 ) + , ( AlignLeft , ColWidth 0.2 ) + , ( AlignRight , ColWidth 0.3 ) + , ( AlignLeft , ColWidth 0.3 ) ] - ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Centered" , Space , Str "Header" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" , Space , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" , Space , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" , Space , Str "aligned" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "First" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Second" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Here's" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , Space + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] + ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , Para + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Multiline" - , Space - , Str "table" - , Space - , Str "with" - , Space - , Str "caption:" - ] , Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Here's" - , Space - , Str "the" - , Space - , Str "caption." - , Space - , Str "It" - , Space - , Str "may" - , Space - , Str "span" - , Space - , Str "multiple" - , Space - , Str "lines." - ] - ] - ) - [ - ( AlignCenter, ColWidth 0.2 ) - , - ( AlignLeft, ColWidth 0.2 ) - , - ( AlignRight, ColWidth 0.3 ) - , - ( AlignLeft, ColWidth 0.3 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Centered", Space, Str "Header" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left", Space, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right", Space, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default", Space, Str "aligned" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidth 0.1 ) + , ( AlignLeft , ColWidth 0.2 ) + , ( AlignRight , ColWidth 0.3 ) + , ( AlignLeft , ColWidth 0.4 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "First" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "row" - , Space - , Str "that" - , Space - , Str "spans" - , Space - , Str "multiple" - , Space - , Str "lines." - ] - ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Second" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Here's" - , Space - , Str "another" - , Space - , Str "one." - , Space - , Str "Note" - , Space - , Str "the" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "between" - , Space - , Str "rows." - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Centered" , Space , Str "Header" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" , Space , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" , Space , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" , Space , Str "aligned" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "First" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Second" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Here's" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , Space + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Multiline" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "caption:" - ] + (TableFoot ( "" , [] , [] ) []) + , Para + [ Str "Table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidth 0.1 ) - , - ( AlignLeft, ColWidth 0.2 ) - , - ( AlignRight, ColWidth 0.3 ) - , - ( AlignLeft, ColWidth 0.4 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Centered", Space, Str "Header" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left", Space, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right", Space, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default", Space, Str "aligned" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "First" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "row" - , Space - , Str "that" - , Space - , Str "spans" - , Space - , Str "multiple" - , Space - , Str "lines." - ] - ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Second" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Here's" - , Space - , Str "another" - , Space - , Str "one." - , Space - , Str "Note" - , Space - , Str "the" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "between" - , Space - , Str "rows." - ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Table" - , Space - , Str "without" - , Space - , Str "column" - , Space - , Str "headers:" - ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , Para + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Multiline" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "column" - , Space - , Str "headers:" - ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidth 0.25 ) - , - ( AlignLeft, ColWidth 0.25 ) - , - ( AlignRight, ColWidth 0.25 ) - , - ( AlignLeft, ColWidth 0.25 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "First" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "row" - , Space - , Str "that" - , Space - , Str "spans" - , Space - , Str "multiple" - , Space - , Str "lines." - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidth 0.25 ) + , ( AlignLeft , ColWidth 0.25 ) + , ( AlignRight , ColWidth 0.25 ) + , ( AlignLeft , ColWidth 0.25 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "First" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Second" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Here's" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , Space + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Second" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Here's" - , Space - , Str "another" - , Space - , Str "one." - , Space - , Str "Note" + ] + (TableFoot ( "" , [] , [] ) []) + , BulletList + [ [ Para [ Str "A" , Space , Str "Step" ] ] + , [ Para [ Str "Another" , Space , Str "Step" ] + , Para + [ Str "Substeps" , Space - , Str "the" + , Str "can" , Space - , Str "blank" + , Str "be" , Space - , Str "line" + , Str "nested" , Space - , Str "between" + , Str "indefinitely" , Space - , Str "rows." + , Str "deep." ] - ] ] - ] - ] - ( TableFoot ( "", [], [] ) [] ) - , BulletList - [ - [ Para [ Str "A", Space, Str "Step" ] ] - , - [ Para - [ Str "Another", Space, Str "Step" ] - , Para - [ Str "Substeps" - , Space - , Str "can" - , Space - , Str "be" - , Space - , Str "nested" - , Space - , Str "indefinitely" - , Space - , Str "deep." + , [ Para + [ Str "A" , Space , Str "Final" , Space , Str "Step" ] ] ] - , - [ Para [ Str "A", Space, Str "Final", Space, Str "Step" ] ] - ] ] diff --git a/test/docbook-xref.native b/test/docbook-xref.native index 16113d50b..1b4ced24e 100644 --- a/test/docbook-xref.native +++ b/test/docbook-xref.native @@ -1,184 +1,177 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "title" - , MetaInlines - [ Str "An", Space, Str "Example", Space, Str "Book" ] - ) - ] + Meta + { unMeta = + fromList + [ ( "title" + , MetaInlines + [ Str "An" + , Space + , Str "Example" + , Space + , Str "Book" + ] + ) + ] } - ) - [ Header 1 - ( "ch01", [], [] ) - [ Str "XRef", Space, Str "Samples" ] + [ Header + 1 + ( "ch01" , [] , [] ) + [ Str "XRef" , Space , Str "Samples" ] , Para - [ Str "This" - , Space - , Str "paragraph" - , Space - , Str "demonstrates" - , Space - , Str "several" - , Space - , Str "features" - , Space - , Str "of" - , SoftBreak - , Str "XRef." - ] + [ Str "This" + , Space + , Str "paragraph" + , Space + , Str "demonstrates" + , Space + , Str "several" + , Space + , Str "features" + , Space + , Str "of" + , SoftBreak + , Str "XRef." + ] , BulletList - [ - [ Para - [ Str "A" - , Space - , Str "straight" - , Space - , Str "link" - , Space - , Str "generates" - , Space - , Str "the" - , SoftBreak - , Str "cross-reference" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "The", Space, Str "Second", Space, Str "Chapter" ] - ( "#ch02", "" ) - , Str "." + [ [ Para + [ Str "A" + , Space + , Str "straight" + , Space + , Str "link" + , Space + , Str "generates" + , Space + , Str "the" + , SoftBreak + , Str "cross-reference" + , Space + , Str "text:" + , Space + , Link + ( "" , [] , [] ) + [ Str "The" + , Space + , Str "Second" + , Space + , Str "Chapter" + ] + ( "#ch02" , "" ) + , Str "." + ] ] - ] - , - [ Para - [ Str "A" - , Space - , Str "link" - , Space - , Str "to" - , Space - , Str "an" - , Space - , Str "element" - , Space - , Str "with" - , Space - , Str "an" - , SoftBreak - , Str "XRefLabel:" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "Chapter", Space, Str "the", Space, Str "Third" ] - ( "#ch03", "" ) - , Str "." + , [ Para + [ Str "A" + , Space + , Str "link" + , Space + , Str "to" + , Space + , Str "an" + , Space + , Str "element" + , Space + , Str "with" + , Space + , Str "an" + , SoftBreak + , Str "XRefLabel:" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "Chapter" + , Space + , Str "the" + , Space + , Str "Third" + ] + ( "#ch03" , "" ) + , Str "." + ] ] - ] - , - [ Para - [ Str "A" - , Space - , Str "link" - , Space - , Str "with" - , Space - , Str "an" - , SoftBreak - , Str "EndTerm:" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "Chapter", Space, Str "4" ] - ( "#ch04", "" ) - , Str "." + , [ Para + [ Str "A" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , SoftBreak + , Str "EndTerm:" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "Chapter" , Space , Str "4" ] + ( "#ch04" , "" ) + , Str "." + ] ] - ] - , - [ Para - [ Str "A" - , Space - , Str "link" - , Space - , Str "to" - , Space - , Str "an" - , SoftBreak - , Str "cmdsynopsis" - , Space - , Str "element:" - , Space - , Link - ( "", [], [] ) - [ Str "chgrp" ] - ( "#cmd01", "" ) - , Str "." + , [ Para + [ Str "A" + , Space + , Str "link" + , Space + , Str "to" + , Space + , Str "an" + , SoftBreak + , Str "cmdsynopsis" + , Space + , Str "element:" + , Space + , Link ( "" , [] , [] ) [ Str "chgrp" ] ( "#cmd01" , "" ) + , Str "." + ] ] - ] - , - [ Para - [ Str "A" - , Space - , Str "link" - , Space - , Str "to" - , Space - , Str "an" - , SoftBreak - , Str "funcsynopsis" - , Space - , Str "element:" - , Space - , Link - ( "", [], [] ) - [ Str "max" ] - ( "#func01", "" ) - , Str "." + , [ Para + [ Str "A" + , Space + , Str "link" + , Space + , Str "to" + , Space + , Str "an" + , SoftBreak + , Str "funcsynopsis" + , Space + , Str "element:" + , Space + , Link ( "" , [] , [] ) [ Str "max" ] ( "#func01" , "" ) + , Str "." + ] ] ] - ] - , Header 1 - ( "ch02", [], [] ) - [ Str "The", Space, Str "Second", Space, Str "Chapter" ] + , Header + 1 + ( "ch02" , [] , [] ) + [ Str "The" , Space , Str "Second" , Space , Str "Chapter" ] , Para - [ Str "Some", Space, Str "content", Space, Str "here" ] - , Header 1 - ( "ch03", [], [] ) - [ Str "The", Space, Str "Third", Space, Str "Chapter" ] + [ Str "Some" , Space , Str "content" , Space , Str "here" ] + , Header + 1 + ( "ch03" , [] , [] ) + [ Str "The" , Space , Str "Third" , Space , Str "Chapter" ] , Para - [ Str "Some", Space, Str "content", Space, Str "here" ] - , Header 1 - ( "ch04", [], [] ) - [ Str "The", Space, Str "Fourth", Space, Str "Chapter" ] + [ Str "Some" , Space , Str "content" , Space , Str "here" ] + , Header + 1 + ( "ch04" , [] , [] ) + [ Str "The" , Space , Str "Fourth" , Space , Str "Chapter" ] , Para - [ Str "Some", Space, Str "content", Space, Str "here" ] - , Plain - [ Str "chgrp" ] - , Plain - [ Str "-R" ] - , Plain - [ Str "-H" ] - , Plain - [ Str "-L" ] - , Plain - [ Str "-P" ] - , Plain - [ Str "-f" ] - , Plain - [ Str "group" ] - , Plain - [ Str "file" ] - , Plain - [ Str "int" ] - , Plain - [ Str "max" ] - , Plain - [ Str "int" ] - , Plain - [ Str "int1" ] - , Plain - [ Str "int" ] - , Plain - [ Str "int2" ] + [ Str "Some" , Space , Str "content" , Space , Str "here" ] + , Plain [ Str "chgrp" ] + , Plain [ Str "-R" ] + , Plain [ Str "-H" ] + , Plain [ Str "-L" ] + , Plain [ Str "-P" ] + , Plain [ Str "-f" ] + , Plain [ Str "group" ] + , Plain [ Str "file" ] + , Plain [ Str "int" ] + , Plain [ Str "max" ] + , Plain [ Str "int" ] + , Plain [ Str "int1" ] + , Plain [ Str "int" ] + , Plain [ Str "int2" ] ] diff --git a/test/epub/features.native b/test/epub/features.native index cac926088..61d0f8ba9 100644 --- a/test/epub/features.native +++ b/test/epub/features.native @@ -1,1744 +1,1676 @@ -[ Para - [ Span ( "front.xhtml", [], [] ) [] ] +[ Para [ Span ( "front.xhtml" , [] , [] ) [] ] , Div - ( "", [ "section" ], [] ) - [ Header 1 - ( "", [], [] ) - [ Str "Reflowable" - , Space - , Str "EPUB" - , Space - , Str "3" - , Space - , Str "Conformance" - , Space - , Str "Test" - , Space - , Str "Document:" - , Space - , Str "0100" - ] - , Div - ( "", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "Status" - , Space - , Str "of" - , Space - , Str "this" - , Space - , Str "Document" - ] - , Para - [ Str "This" - , Space - , Str "publication" - , Space - , Str "is" - , Space - , Str "currently" - , Space - , Str "considered" - , Space - , Span - ( "", [ "status" ], [] ) - [ Str "[UNDER", Space, Str "DEVELOPMENT]" ] - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "IDPF." - ] - , Para - [ Str "This" - , Space - , Str "publication" - , Space - , Str "is" - , Space - , Str "part" - , Space - , Str "of" - , Space - , Str "version" - , Space - , Span - ( "", [ "version" ], [] ) - [ Str "X.X" ] - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "EPUB" - , Space - , Str "3.0" - , Space - , Str "Compliance" - , Space - , Str "Test" - , Space - , Str "Suite" - , Space - , Str "released" - , SoftBreak - , Str "on" - , Space - , RawInline - ( Format "html" ) "" - , Str "." - ] - , Para - [ Str "Before" - , Space - , Str "using" - , Space - , Str "this" - , Space - , Str "publication" - , Space - , Str "to" - , Space - , Str "evaluate" - , Space - , Str "reading" - , Space - , Str "systems," - , Space - , Str "testers" - , Space - , Str "are" - , Space - , Str "strongly" - , Space - , Str "encouraged" - , Space - , Str "to" - , SoftBreak - , Str "verify" - , Space - , Str "that" - , Space - , Str "they" - , Space - , Str "have" - , Space - , Str "the" - , Space - , Str "latest" - , Space - , Str "release" - , Space - , Str "by" - , Space - , Str "checking" - , Space - , Str "the" - , Space - , Str "current" - , Space - , Str "release" - , Space - , Str "version" - , Space - , Str "and" - , Space - , Str "date" - , Space - , Str "of" - , SoftBreak - , Str "the" - , Space - , Str "test" - , Space - , Str "suite" - , Space - , Str "at" - , Space - , Link - ( "", [], [] ) - [ Str "TBD" ] - ( "http://idpf.org/", "" ) - ] - , Para - [ Str "This" - , Space - , Str "publication" - , Space - , Str "is" - , Space - , Str "one" - , Space - , Str "of" - , Space - , Str "several" - , Space - , Str "that" - , Space - , Str "currently" - , Space - , Str "comprise" - , Space - , Str "the" - , Space - , Str "EPUB" - , Space - , Str "3" - , Space - , Str "conformance" - , Space - , Str "test" - , Space - , Str "suite" - , SoftBreak - , Str "for" - , Space - , Str "reflowable" - , Space - , Str "content." - , Space - , Str "The" - , Space - , Str "complete" - , Space - , Str "test" - , Space - , Str "suite" - , Space - , Str "includes" - , Space - , Str "all" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "following" - , Space - , Str "publications:" - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Plain [ Str "." ] ] ] - ] - , Div - ( "", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "About", Space, Str "this", Space, Str "Document" ] - , Para - [ Str "This" - , Space - , Str "document" - , Space - , Str "focuses" - , Space - , Str "on" - , Space - , Str "human-evaluated" - , Space - , Str "binary" - , Space - , Str "(pass/fail)" - , Space - , Str "tests" - , Space - , Str "in" - , Space - , Str "a" - , SoftBreak - , Str "reflowable" - , Space - , Str "context." - , Space - , Str "Tests" - , Space - , Str "for" - , Space - , Str "fixed-layout" - , Space - , Str "content" - , Space - , Str "and" - , Space - , Str "other" - , Space - , Str "individual" - , Space - , Str "tests" - , Space - , Str "that" - , SoftBreak - , Str "require" - , Space - , Str "a" - , Space - , Str "dedicated" - , Space - , Str "epub" - , Space - , Str "file" - , Space - , Str "are" - , Space - , Str "available" - , Space - , Str "in" - , Space - , Str "additional" - , Space - , Str "sibling" - , Space - , Str "documents;" - , Space - , Str "refer" - , Space - , Str "to" - , SoftBreak - , Str "the" - , Space - , Link - ( "", [], [] ) - [ Str "test", Space, Str "suite", SoftBreak, Str "wiki" ] - ( "https://github.com/mgylling/epub-testsuite/wiki/Overview" - , "" - ) - , Space - , Str "(" - , Code - ( "" - , [] - , [] - ) "https://github.com/mgylling/epub-testsuite/wiki/Overview" - , Str ")" - , Space - , Str "for" - , Space - , Str "additional" - , SoftBreak - , Str "information." - ] - ] - , Div - ( "", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "Conventions" ] - , Para - [ Str "The" - , Space - , Str "following" - , Space - , Str "conventions" - , Space - , Str "are" - , Space - , Str "used" - , Space - , Str "throughout" - , Space - , Str "the" - , Space - , Str "document:" - ] - , DefinitionList - [ - ( - [ Str "1." - , Space - , Str "Locating" - , Space - , Str "a" - , Space - , Str "test" - ] - , - [ - [ Div - ( "", [ "ctest" ], [] ) - [ Para - [ Str "Tests" - , Space - , Str "for" - , Space - , Emph - [ Str "required" ] - , Space - , Str "Reading" - , Space - , Str "System" - , Space - , Str "functionality" + ( "" , [ "section" ] , [] ) + [ Header + 1 + ( "" , [] , [] ) + [ Str "Reflowable" + , Space + , Str "EPUB" + , Space + , Str "3" + , Space + , Str "Conformance" + , Space + , Str "Test" + , Space + , Str "Document:" + , Space + , Str "0100" + ] + , Div + ( "" , [ "section" ] , [] ) + [ Header + 2 + ( "" , [] , [] ) + [ Str "Status" + , Space + , Str "of" + , Space + , Str "this" + , Space + , Str "Document" + ] + , Para + [ Str "This" + , Space + , Str "publication" + , Space + , Str "is" + , Space + , Str "currently" + , Space + , Str "considered" + , Space + , Span + ( "" , [ "status" ] , [] ) + [ Str "[UNDER" , Space , Str "DEVELOPMENT]" ] + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "IDPF." + ] + , Para + [ Str "This" + , Space + , Str "publication" + , Space + , Str "is" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "version" + , Space + , Span ( "" , [ "version" ] , [] ) [ Str "X.X" ] + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "EPUB" + , Space + , Str "3.0" + , Space + , Str "Compliance" + , Space + , Str "Test" + , Space + , Str "Suite" + , Space + , Str "released" + , SoftBreak + , Str "on" + , Space + , RawInline (Format "html") "" + , Str "." + ] + , Para + [ Str "Before" + , Space + , Str "using" + , Space + , Str "this" + , Space + , Str "publication" + , Space + , Str "to" + , Space + , Str "evaluate" + , Space + , Str "reading" + , Space + , Str "systems," + , Space + , Str "testers" + , Space + , Str "are" + , Space + , Str "strongly" + , Space + , Str "encouraged" + , Space + , Str "to" + , SoftBreak + , Str "verify" + , Space + , Str "that" + , Space + , Str "they" + , Space + , Str "have" + , Space + , Str "the" + , Space + , Str "latest" + , Space + , Str "release" + , Space + , Str "by" + , Space + , Str "checking" + , Space + , Str "the" + , Space + , Str "current" + , Space + , Str "release" + , Space + , Str "version" + , Space + , Str "and" + , Space + , Str "date" + , Space + , Str "of" + , SoftBreak + , Str "the" + , Space + , Str "test" + , Space + , Str "suite" + , Space + , Str "at" + , Space + , Link + ( "" , [] , [] ) + [ Str "TBD" ] + ( "http://idpf.org/" , "" ) + ] + , Para + [ Str "This" + , Space + , Str "publication" + , Space + , Str "is" + , Space + , Str "one" + , Space + , Str "of" + , Space + , Str "several" + , Space + , Str "that" + , Space + , Str "currently" + , Space + , Str "comprise" + , Space + , Str "the" + , Space + , Str "EPUB" + , Space + , Str "3" + , Space + , Str "conformance" + , Space + , Str "test" + , Space + , Str "suite" + , SoftBreak + , Str "for" + , Space + , Str "reflowable" + , Space + , Str "content." + , Space + , Str "The" + , Space + , Str "complete" + , Space + , Str "test" + , Space + , Str "suite" + , Space + , Str "includes" + , Space + , Str "all" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "following" + , Space + , Str "publications:" + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "." ] ] ] + ] + , Div + ( "" , [ "section" ] , [] ) + [ Header + 2 + ( "" , [] , [] ) + [ Str "About" + , Space + , Str "this" + , Space + , Str "Document" + ] + , Para + [ Str "This" + , Space + , Str "document" + , Space + , Str "focuses" + , Space + , Str "on" + , Space + , Str "human-evaluated" + , Space + , Str "binary" + , Space + , Str "(pass/fail)" + , Space + , Str "tests" + , Space + , Str "in" + , Space + , Str "a" + , SoftBreak + , Str "reflowable" + , Space + , Str "context." + , Space + , Str "Tests" + , Space + , Str "for" + , Space + , Str "fixed-layout" + , Space + , Str "content" + , Space + , Str "and" + , Space + , Str "other" + , Space + , Str "individual" + , Space + , Str "tests" + , Space + , Str "that" + , SoftBreak + , Str "require" + , Space + , Str "a" + , Space + , Str "dedicated" + , Space + , Str "epub" + , Space + , Str "file" + , Space + , Str "are" + , Space + , Str "available" + , Space + , Str "in" + , Space + , Str "additional" + , Space + , Str "sibling" + , Space + , Str "documents;" + , Space + , Str "refer" + , Space + , Str "to" + , SoftBreak + , Str "the" + , Space + , Link + ( "" , [] , [] ) + [ Str "test" , Space - , Str "are" + , Str "suite" , SoftBreak - , Str "preceded" - , Space - , Str "by" + , Str "wiki" + ] + ( "https://github.com/mgylling/epub-testsuite/wiki/Overview" + , "" + ) + , Space + , Str "(" + , Code + ( "" , [] , [] ) + "https://github.com/mgylling/epub-testsuite/wiki/Overview" + , Str ")" + , Space + , Str "for" + , Space + , Str "additional" + , SoftBreak + , Str "information." + ] + ] + , Div + ( "" , [ "section" ] , [] ) + [ Header 2 ( "" , [] , [] ) [ Str "Conventions" ] + , Para + [ Str "The" + , Space + , Str "following" + , Space + , Str "conventions" + , Space + , Str "are" + , Space + , Str "used" + , Space + , Str "throughout" + , Space + , Str "the" + , Space + , Str "document:" + ] + , DefinitionList + [ ( [ Str "1." , Space - , Str "the" + , Str "Locating" , Space - , Str "label:" + , Str "a" , Space - , Span - ( "" - , [ "nature" ] - , - [ ( "style", "display: inline; font-size: 100%" ) ] - ) - [ Str "[REQUIRED]" ] + , Str "test" ] - ] - , Div - ( "", [ "otest" ], [] ) - [ Para - [ Str "Tests" - , Space - , Str "for" - , Space - , Emph - [ Str "optional" ] + , [ [ Div + ( "" , [ "ctest" ] , [] ) + [ Para + [ Str "Tests" + , Space + , Str "for" + , Space + , Emph [ Str "required" ] + , Space + , Str "Reading" + , Space + , Str "System" + , Space + , Str "functionality" + , Space + , Str "are" + , SoftBreak + , Str "preceded" + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "label:" + , Space + , Span + ( "" + , [ "nature" ] + , [ ( "style" + , "display: inline; font-size: 100%" + ) + ] + ) + [ Str "[REQUIRED]" ] + ] + ] + , Div + ( "" , [ "otest" ] , [] ) + [ Para + [ Str "Tests" + , Space + , Str "for" + , Space + , Emph [ Str "optional" ] + , Space + , Str "Reading" + , Space + , Str "System" + , Space + , Str "functionality" + , Space + , Str "are" + , SoftBreak + , Str "preceded" + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "label:" + , Space + , Span + ( "" + , [ "nature" ] + , [ ( "style" + , "display: inline; font-size: 100%" + ) + ] + ) + [ Str "[OPTIONAL]" ] + ] + ] + ] + ] + ) + , ( [ Str "2." , Space - , Str "Reading" + , Str "Performing" , Space - , Str "System" + , Str "the" , Space - , Str "functionality" + , Str "test" + ] + , [ [ Plain + [ Str "Each" + , Space + , Str "test" + , Space + , Str "includes" + , Space + , Str "a" + , Space + , Str "description" + , Space + , Str "of" + , Space + , Str "its" + , Space + , Str "purpose" + , Space + , Str "followed" + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "actual" + , Space + , Strong + [ Str "test" + , Space + , Str "statement," + , SoftBreak + , Str "which" + , Space + , Str "can" + , Space + , Str "always" + , Space + , Str "be" + , Space + , Str "evaluated" + , Space + , Str "to" + , Space + , Str "true" + , Space + , Str "or" + , Space + , Str "false" + ] + , Str "." + , Space + , Str "These" + , Space + , Str "statements" + , Space + , Str "typically" + , Space + , Str "have" + , Space + , Str "the" + , Space + , Str "form:" + , SoftBreak + , Str "\"If" + , Space + , Str "[some" + , Space + , Str "condition]," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes\"." + ] + ] + ] + ) + , ( [ Str "3." , Space - , Str "are" - , SoftBreak - , Str "preceded" + , Str "Scoring" , Space - , Str "by" + , Str "in" , Space , Str "the" , Space - , Str "label:" + , Str "results" , Space - , Span - ( "" - , [ "nature" ] - , - [ ( "style", "display: inline; font-size: 100%" ) ] - ) - [ Str "[OPTIONAL]" ] + , Str "form" ] - ] + , [ [ Plain + [ Str "@@@TODO" + , Space + , Str "provide" + , Space + , Str "info" + , Space + , Str "on" + , Space + , Str "where" + , Space + , Str "to" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "results" + , Space + , Str "form" + ] + ] + ] + ) ] - ] + ] + ] +, Para [ Span ( "content-mathml-001.xhtml" , [] , [] ) [] ] +, Div + ( "" , [ "section" ] , [] ) + [ Header + 2 + ( "content-mathml-001.xhtml#mathml" , [] , [] ) + [ Str "MathML" ] + , Div + ( "content-mathml-001.xhtml#mathml-010" + , [ "section" , "ctest" ] + , [] ) - , - ( - [ Str "2." - , Space - , Str "Performing" - , Space - , Str "the" - , Space - , Str "test" - ] - , - [ - [ Plain - [ Str "Each" - , Space - , Str "test" - , Space - , Str "includes" - , Space - , Str "a" - , Space - , Str "description" - , Space - , Str "of" - , Space - , Str "its" - , Space - , Str "purpose" - , Space - , Str "followed" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "actual" - , Space - , Strong - [ Str "test" - , Space - , Str "statement," - , SoftBreak - , Str "which" - , Space - , Str "can" - , Space - , Str "always" - , Space - , Str "be" - , Space - , Str "evaluated" - , Space - , Str "to" - , Space - , Str "true" - , Space - , Str "or" - , Space - , Str "false" - ] - , Str "." - , Space - , Str "These" - , Space - , Str "statements" - , Space - , Str "typically" - , Space - , Str "have" - , Space - , Str "the" - , Space - , Str "form:" - , SoftBreak - , Str "\"If" - , Space - , Str "[some" - , Space - , Str "condition]," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes\"." - ] + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , SoftBreak + , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-010" ] + , Space + , Str "Rendering" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "MathML" + , Space + , Str "equation" + , Space + , Str "rendering" + , Space + , Str "is" + , Space + , Str "supported." ] - ] + , Plain + [ Math + DisplayMath + "\\int_{- \\infty}^{\\infty}e^{- x^{2}}\\, dx = \\sqrt{\\pi}" + , SoftBreak + , Math + DisplayMath + "\\sum\\limits_{n = 1}^{\\infty}\\frac{1}{n^{2}} = \\frac{\\pi^{2}}{6}" + , SoftBreak + , Math + DisplayMath + "x = \\frac{- b \\pm \\sqrt{b^{2} - 4ac}}{2a}" + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "equations" + , Space + , Str "are" + , Space + , Str "not" + , Space + , Str "presented" + , Space + , Str "as" + , Space + , Str "linear" + , Space + , Str "text" + , Space + , Str "(e.g.," + , Space + , Str "x=-b\177b2-4ac2a)," + , SoftBreak + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "content-mathml-001.xhtml#mathml-020" + , [ "section" , "otest" ] + , [] ) - , - ( - [ Str "3." - , Space - , Str "Scoring" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "results" - , Space - , Str "form" - ] - , - [ - [ Plain - [ Str "@@@TODO" - , Space - , Str "provide" - , Space - , Str "info" - , Space - , Str "on" - , Space - , Str "where" - , Space - , Str "to" - , Space - , Str "get" - , Space - , Str "the" - , Space - , Str "results" - , Space - , Str "form" - ] + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[OPTIONAL]" ] + , SoftBreak + , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-020" ] + , Space + , Str "CSS" + , Space + , Str "Styling" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "math" + , Space + , Str "element" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "basic" + , Space + , Str "CSS" + , Space + , Str "styling" + , Space + , Str "of" + , Space + , Str "MathML" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "math" + , Space + , Str "element." ] - ] + , Plain [ Math InlineMath "{2x}{+ y - z}" ] + , Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "equation" + , Space + , Str "has" + , Space + , Str "a" + , Space + , Str "yellow" + , Space + , Str "background" + , Space + , Str "and" + , Space + , Str "a" + , Space + , Str "dashed" + , Space + , Str "border." + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "reading" + , Space + , Str "system" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "have" + , Space + , Str "a" + , Space + , Str "viewport," + , Space + , Str "or" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "support" + , SoftBreak + , Str "CSS" + , Space + , Str "styles," + , Space + , Str "this" + , Space + , Str "test" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "marked" + , Space + , Code ( "" , [] , [] ) "Not Supported" + , Str "." + ] + ] + , Div + ( "content-mathml-001.xhtml#mathml-021" + , [ "section" , "otest" ] + , [] ) - ] - ] - ] -, Para - [ Span ( "content-mathml-001.xhtml", [], [] ) [] ] -, Div - ( "", [ "section" ], [] ) - [ Header 2 - ( "content-mathml-001.xhtml#mathml", [], [] ) - [ Str "MathML" ] - , Div - ( "content-mathml-001.xhtml#mathml-010" - , - [ "section", "ctest" ] - , [] - ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , SoftBreak - , Span - ( "", [ "test-id" ], [] ) - [ Str "mathml-010" ] - , Space - , Str "Rendering" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "MathML" - , Space - , Str "equation" - , Space - , Str "rendering" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Plain - [ Math DisplayMath "\\int_{- \\infty}^{\\infty}e^{- x^{2}}\\, dx = \\sqrt{\\pi}" - , SoftBreak - , Math DisplayMath "\\sum\\limits_{n = 1}^{\\infty}\\frac{1}{n^{2}} = \\frac{\\pi^{2}}{6}" - , SoftBreak - , Math DisplayMath "x = \\frac{- b \\pm \\sqrt{b^{2} - 4ac}}{2a}" - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "equations" - , Space - , Str "are" - , Space - , Str "not" - , Space - , Str "presented" - , Space - , Str "as" - , Space - , Str "linear" - , Space - , Str "text" - , Space - , Str "(e.g.," - , Space - , Str "x=-b\177b2-4ac2a)," - , SoftBreak - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "content-mathml-001.xhtml#mathml-020" - , - [ "section", "otest" ] - , [] - ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[OPTIONAL]" ] - , SoftBreak - , Span - ( "", [ "test-id" ], [] ) - [ Str "mathml-020" ] - , Space - , Str "CSS" - , Space - , Str "Styling" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "math" - , Space - , Str "element" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "basic" - , Space - , Str "CSS" - , Space - , Str "styling" - , Space - , Str "of" - , Space - , Str "MathML" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "math" - , Space - , Str "element." - ] - , Plain - [ Math InlineMath "{2x}{+ y - z}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "equation" - , Space - , Str "has" - , Space - , Str "a" - , Space - , Str "yellow" - , Space - , Str "background" - , Space - , Str "and" - , Space - , Str "a" - , Space - , Str "dashed" - , Space - , Str "border." - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "reading" - , Space - , Str "system" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "have" - , Space - , Str "a" - , Space - , Str "viewport," - , Space - , Str "or" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "support" - , SoftBreak - , Str "CSS" - , Space - , Str "styles," - , Space - , Str "this" - , Space - , Str "test" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "marked" - , Space - , Code - ( "", [], [] ) "Not Supported" - , Str "." - ] - ] - , Div - ( "content-mathml-001.xhtml#mathml-021" - , - [ "section", "otest" ] - , [] - ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[OPTIONAL]" ] - , SoftBreak - , Span - ( "", [ "test-id" ], [] ) - [ Str "mathml-021" ] - , Space - , Str "CSS" - , Space - , Str "Styling" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "mo" - , Space - , Str "element" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "basic" - , Space - , Str "CSS" - , Space - , Str "styling" - , Space - , Str "of" - , Space - , Str "MathML" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "mo" - , Space - , Str "element." - ] - , Plain - [ Math InlineMath "{2x}{+ y - z}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "operators" - , Space - , Str "are" - , Space - , Str "enlarged" - , Space - , Str "relative" - , Space - , Str "to" - , Space - , Str "the" - , Space - , Str "other" - , Space - , Str "symbols" - , Space - , Str "and" - , Space - , Str "numbers." - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "reading" - , Space - , Str "system" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "have" - , Space - , Str "a" - , Space - , Str "viewport," - , Space - , Str "or" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "support" - , SoftBreak - , Str "CSS" - , Space - , Str "styles," - , Space - , Str "this" - , Space - , Str "test" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "marked" - , Space - , Code - ( "", [], [] ) "Not Supported" - , Str "." - ] - ] - , Div - ( "content-mathml-001.xhtml#mathml-022" - , - [ "section", "otest" ] - , [] - ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[OPTIONAL]" ] - , SoftBreak - , Span - ( "", [ "test-id" ], [] ) - [ Str "mathml-022" ] - , Space - , Str "CSS" - , Space - , Str "Styling" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "mi" - , Space - , Str "element" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "basic" - , Space - , Str "CSS" - , Space - , Str "styling" - , Space - , Str "of" - , Space - , Str "MathML" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "mi" - , Space - , Str "element." - ] - , Plain - [ Math InlineMath "{2x}{+ y - z}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "identifiers" - , Space - , Str "are" - , Space - , Str "bolded" - , Space - , Str "and" - , Space - , Str "blue." - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "reading" - , Space - , Str "system" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "have" - , Space - , Str "a" - , Space - , Str "viewport," - , Space - , Str "or" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "support" - , SoftBreak - , Str "CSS" - , Space - , Str "styles," - , Space - , Str "this" - , Space - , Str "test" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "marked" - , Space - , Code - ( "", [], [] ) "Not Supported" - , Str "." - ] - ] - , Div - ( "content-mathml-001.xhtml#mathml-023" - , - [ "section", "otest" ] - , [] - ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[OPTIONAL]" ] - , SoftBreak - , Span - ( "", [ "test-id" ], [] ) - [ Str "mathml-023" ] - , Space - , Str "CSS" - , Space - , Str "Styling" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "mn" - , Space - , Str "element" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "basic" - , Space - , Str "CSS" - , Space - , Str "styling" - , Space - , Str "of" - , Space - , Str "MathML" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "mn" - , Space - , Str "element." - ] - , Plain - [ Math InlineMath "{2x}{+ y - z}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "number" - , Space - , Str "2" - , Space - , Str "is" - , Space - , Str "italicized" - , Space - , Str "and" - , Space - , Str "blue." - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "reading" - , Space - , Str "system" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "have" - , Space - , Str "a" - , Space - , Str "viewport," - , Space - , Str "or" - , Space - , Str "does" - , Space - , Str "not" - , Space - , Str "support" - , SoftBreak - , Str "CSS" - , Space - , Str "styles," - , Space - , Str "this" - , Space - , Str "test" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "marked" - , Space - , Code - ( "", [], [] ) "Not Supported" - , Str "." - ] - ] - , Div - ( "content-mathml-001.xhtml#mathml-024" - , - [ "section", "ctest" ] - , [] - ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , SoftBreak - , Span - ( "", [ "test-id" ], [] ) - [ Str "mathml-024" ] - , Str "Horizontal" - , Space - , Str "stretch," - , Space - , Code - ( "", [], [] ) "mover" - , Str "," - , Space - , Code - ( "", [], [] ) "munder" - , Str "," - , Space - , Str "and" - , Space - , Code - ( "", [], [] ) "mspace" - , Space - , Str "elements" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "horizontal" - , Space - , Str "stretch," - , Space - , Code - ( "", [], [] ) "mover" - , Str "," - , Space - , Code - ( "", [], [] ) "munder" - , Str "," - , Space - , Code - ( "", [], [] ) "mspace" - , Space - , Str "elements" - , Space - , Str "are" - , Space - , Str "supported." - ] - , Plain - [ Math DisplayMath "c = \\overset{\\text{complex\\ number}}{\\overbrace{\\underset{\\text{real}}{\\underbrace{\\mspace{20mu} a\\mspace{20mu}}} + \\underset{\\text{imaginary}}{\\underbrace{\\quad b{\\mathbb{i}}\\quad}}}}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "rendering" - , Space - , Str "looks" - , Space - , Str "like" - , Space - , Str "." - ] - ] - , Div - ( "content-mathml-001.xhtml#mathml-025" - , - [ "section", "ctest" ] - , [] - ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , SoftBreak - , Span - ( "", [ "test-id" ], [] ) - [ Str "mathml-025" ] - , Str "Testing" - , Space - , Code - ( "", [], [] ) "mtable" - , Space - , Str "with" - , Space - , Code - ( "", [], [] ) "colspan" - , Space - , Str "and" - , Space - , Code - ( "", [], [] ) "rowspan" - , Space - , Str "attributes," - , Space - , Str "Hebrew" - , Space - , Str "and" - , Space - , Str "Script" - , Space - , Str "fonts" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Code - ( "", [], [] ) "mtable" - , Space - , Str "with" - , Space - , Code - ( "", [], [] ) "colspan" - , Space - , Str "and" - , Space - , Code - ( "", [], [] ) "mspace" - , Space - , Str "attributes" - , Space - , Str "(column" - , Space - , Str "and" - , Space - , Str "row" - , Space - , Str "spanning)" - , Space - , Str "are" - , Space - , Str "supported;" - , Space - , Str "uses" - , Space - , Str "Hebrew" - , Space - , Str "and" - , Space - , Str "Script" - , Space - , Str "alphabets." - ] - , Plain - [ Math DisplayMath "\\begin{matrix}\n & {\\operatorname{cov}(\\mathcal{L})} & \\longrightarrow & {\\operatorname{non}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cof}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cof}(\\mathcal{L})} & \\longrightarrow & 2^{\\aleph_{0}} \\\\\n & \\uparrow & & \\uparrow & & \\uparrow & & \\uparrow & & \\\\\n & {\\mathfrak{b}} & \\longrightarrow & {\\mathfrak{d}} & & & & & & \\\\\n & \\uparrow & & \\uparrow & & & & & & \\\\\n\\aleph_{1} & \\longrightarrow & {\\operatorname{add}(\\mathcal{L})} & \\longrightarrow & {\\operatorname{add}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cov}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{non}(\\mathcal{L})} & \\\\\n\\end{matrix}" ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "rendering" - , Space - , Str "looks" - , Space - , Str "like" - , Space - , Link - ( "", [], [] ) - [ Str "Cicho\324's", Space, Str "Diagram" ] - ( "http://en.wikipedia.org/wiki/Cicho%C5%84's_diagram", "" ) - , Str ":" - , Space - , Str "." - ] - ] - , Div - ( "content-mathml-001.xhtml#mathml-026" - , - [ "section", "ctest" ] - , [] - ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , SoftBreak - , Span - ( "", [ "test-id" ], [] ) - [ Str "mathml-026" ] - , Str "BiDi," - , Space - , Str "RTL" - , Space - , Str "and" - , Space - , Str "Arabic" - , Space - , Str "alphabets" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "right-to-left" - , Space - , Str "and" - , Space - , Str "Arabic" - , Space - , Str "alphabets" - , Space - , Str "are" - , Space - , Str "supported." - ] - , Plain - [ Math DisplayMath "{\1583(\1587)} = \\left\\{ \\begin{matrix}\n{\\sum\\limits_{\1646 = 1}^{\1589}\1587^{\1646}} & {\\text{\1573\1584\1575\1603\1575\1606}\1587 > 0} \\\\\n{\\int_{1}^{\1589}{\1587^{\1646}\1569\1587}} & {\\text{\1573\1584\1575\1603\1575\1606}\1587 \\in \1605} \\\\\n{{\1591\1575}\\pi} & {\\text{\1594\1610\1585\1584\1604\1603}\\left( \\text{\1605\1593}\\pi \\simeq 3,141 \\right)} \\\\\n\\end{matrix} \\right." ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "rendering" - , Space - , Str "looks" - , Space - , Str "like" - , Space - , Str "the" - , Space - , Str "following" - , Space - , Str "image:" - ] - ] - , Div - ( "content-mathml-001.xhtml#mathml-027" - , - [ "section", "ctest" ] - , [] - ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , SoftBreak - , Span - ( "", [ "test-id" ], [] ) - [ Str "mathml-027" ] - , Str "Elementary" - , Space - , Str "math:" - , Space - , Str "long" - , Space - , Str "division" - , Space - , Str "notation" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Code - ( "", [], [] ) "mlongdiv" - , Space - , Str "elements" - , Space - , Str "(from" - , Space - , Str "elementary" - , Space - , Str "math)" - , Space - , Str "are" - , Space - , Str "supported." - ] - , Plain - [ Span - ( "" - , [ "math" ] - , - [ ( "xmlns", "http://www.w3.org/1998/Math/MathML" ) ] + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[OPTIONAL]" ] + , SoftBreak + , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-021" ] + , Space + , Str "CSS" + , Space + , Str "Styling" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "mo" + , Space + , Str "element" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "basic" + , Space + , Str "CSS" + , Space + , Str "styling" + , Space + , Str "of" + , Space + , Str "MathML" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "mo" + , Space + , Str "element." + ] + , Plain [ Math InlineMath "{2x}{+ y - z}" ] + , Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "operators" + , Space + , Str "are" + , Space + , Str "enlarged" + , Space + , Str "relative" + , Space + , Str "to" + , Space + , Str "the" + , Space + , Str "other" + , Space + , Str "symbols" + , Space + , Str "and" + , Space + , Str "numbers." + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "reading" + , Space + , Str "system" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "have" + , Space + , Str "a" + , Space + , Str "viewport," + , Space + , Str "or" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "support" + , SoftBreak + , Str "CSS" + , Space + , Str "styles," + , Space + , Str "this" + , Space + , Str "test" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "marked" + , Space + , Code ( "" , [] , [] ) "Not Supported" + , Str "." + ] + ] + , Div + ( "content-mathml-001.xhtml#mathml-022" + , [ "section" , "otest" ] + , [] ) - [ SoftBreak - , Str "3" - , SoftBreak - , Str "435.3" - , SoftBreak - , Str "1306" - , SoftBreak - , Str "12" - , SoftBreak - , Str "10" - , SoftBreak - , Str "9" - , SoftBreak - , Str "16" - , SoftBreak - , Str "15" - , SoftBreak - , Str "1.0" - , SoftBreak - , Str "9" - , SoftBreak - , Str "1" - , SoftBreak + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[OPTIONAL]" ] + , SoftBreak + , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-022" ] + , Space + , Str "CSS" + , Space + , Str "Styling" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "mi" + , Space + , Str "element" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "basic" + , Space + , Str "CSS" + , Space + , Str "styling" + , Space + , Str "of" + , Space + , Str "MathML" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "mi" + , Space + , Str "element." + ] + , Plain [ Math InlineMath "{2x}{+ y - z}" ] + , Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "identifiers" + , Space + , Str "are" + , Space + , Str "bolded" + , Space + , Str "and" + , Space + , Str "blue." + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "reading" + , Space + , Str "system" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "have" + , Space + , Str "a" + , Space + , Str "viewport," + , Space + , Str "or" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "support" + , SoftBreak + , Str "CSS" + , Space + , Str "styles," + , Space + , Str "this" + , Space + , Str "test" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "marked" + , Space + , Code ( "" , [] , [] ) "Not Supported" + , Str "." + ] + ] + , Div + ( "content-mathml-001.xhtml#mathml-023" + , [ "section" , "otest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[OPTIONAL]" ] + , SoftBreak + , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-023" ] + , Space + , Str "CSS" + , Space + , Str "Styling" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "mn" + , Space + , Str "element" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "basic" + , Space + , Str "CSS" + , Space + , Str "styling" + , Space + , Str "of" + , Space + , Str "MathML" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "mn" + , Space + , Str "element." + ] + , Plain [ Math InlineMath "{2x}{+ y - z}" ] + , Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "number" + , Space + , Str "2" + , Space + , Str "is" + , Space + , Str "italicized" + , Space + , Str "and" + , Space + , Str "blue." + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "reading" + , Space + , Str "system" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "have" + , Space + , Str "a" + , Space + , Str "viewport," + , Space + , Str "or" + , Space + , Str "does" + , Space + , Str "not" + , Space + , Str "support" + , SoftBreak + , Str "CSS" + , Space + , Str "styles," + , Space + , Str "this" + , Space + , Str "test" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "marked" + , Space + , Code ( "" , [] , [] ) "Not Supported" + , Str "." + ] + ] + , Div + ( "content-mathml-001.xhtml#mathml-024" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , SoftBreak + , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-024" ] + , Str "Horizontal" + , Space + , Str "stretch," + , Space + , Code ( "" , [] , [] ) "mover" + , Str "," + , Space + , Code ( "" , [] , [] ) "munder" + , Str "," + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "mspace" + , Space + , Str "elements" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "horizontal" + , Space + , Str "stretch," + , Space + , Code ( "" , [] , [] ) "mover" + , Str "," + , Space + , Code ( "" , [] , [] ) "munder" + , Str "," + , Space + , Code ( "" , [] , [] ) "mspace" + , Space + , Str "elements" + , Space + , Str "are" + , Space + , Str "supported." + ] + , Plain + [ Math + DisplayMath + "c = \\overset{\\text{complex\\ number}}{\\overbrace{\\underset{\\text{real}}{\\underbrace{\\mspace{20mu} a\\mspace{20mu}}} + \\underset{\\text{imaginary}}{\\underbrace{\\quad b{\\mathbb{i}}\\quad}}}}" + ] + , Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "rendering" + , Space + , Str "looks" + , Space + , Str "like" + , Space + , Str "." + ] + ] + , Div + ( "content-mathml-001.xhtml#mathml-025" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , SoftBreak + , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-025" ] + , Str "Testing" + , Space + , Code ( "" , [] , [] ) "mtable" + , Space + , Str "with" + , Space + , Code ( "" , [] , [] ) "colspan" + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "rowspan" + , Space + , Str "attributes," + , Space + , Str "Hebrew" + , Space + , Str "and" + , Space + , Str "Script" + , Space + , Str "fonts" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Code ( "" , [] , [] ) "mtable" + , Space + , Str "with" + , Space + , Code ( "" , [] , [] ) "colspan" + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "mspace" + , Space + , Str "attributes" + , Space + , Str "(column" + , Space + , Str "and" + , Space + , Str "row" + , Space + , Str "spanning)" + , Space + , Str "are" + , Space + , Str "supported;" + , Space + , Str "uses" + , Space + , Str "Hebrew" + , Space + , Str "and" + , Space + , Str "Script" + , Space + , Str "alphabets." + ] + , Plain + [ Math + DisplayMath + "\\begin{matrix}\n & {\\operatorname{cov}(\\mathcal{L})} & \\longrightarrow & {\\operatorname{non}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cof}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cof}(\\mathcal{L})} & \\longrightarrow & 2^{\\aleph_{0}} \\\\\n & \\uparrow & & \\uparrow & & \\uparrow & & \\uparrow & & \\\\\n & {\\mathfrak{b}} & \\longrightarrow & {\\mathfrak{d}} & & & & & & \\\\\n & \\uparrow & & \\uparrow & & & & & & \\\\\n\\aleph_{1} & \\longrightarrow & {\\operatorname{add}(\\mathcal{L})} & \\longrightarrow & {\\operatorname{add}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cov}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{non}(\\mathcal{L})} & \\\\\n\\end{matrix}" + ] + , Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "rendering" + , Space + , Str "looks" + , Space + , Str "like" + , Space + , Link + ( "" , [] , [] ) + [ Str "Cicho\324's" , Space , Str "Diagram" ] + ( "http://en.wikipedia.org/wiki/Cicho%C5%84's_diagram" + , "" + ) + , Str ":" + , Space + , Str "." + ] + ] + , Div + ( "content-mathml-001.xhtml#mathml-026" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , SoftBreak + , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-026" ] + , Str "BiDi," + , Space + , Str "RTL" + , Space + , Str "and" + , Space + , Str "Arabic" + , Space + , Str "alphabets" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "right-to-left" + , Space + , Str "and" + , Space + , Str "Arabic" + , Space + , Str "alphabets" + , Space + , Str "are" + , Space + , Str "supported." + ] + , Plain + [ Math + DisplayMath + "{\1583(\1587)} = \\left\\{ \\begin{matrix}\n{\\sum\\limits_{\1646 = 1}^{\1589}\1587^{\1646}} & {\\text{\1573\1584\1575\1603\1575\1606}\1587 > 0} \\\\\n{\\int_{1}^{\1589}{\1587^{\1646}\1569\1587}} & {\\text{\1573\1584\1575\1603\1575\1606}\1587 \\in \1605} \\\\\n{{\1591\1575}\\pi} & {\\text{\1594\1610\1585\1584\1604\1603}\\left( \\text{\1605\1593}\\pi \\simeq 3,141 \\right)} \\\\\n\\end{matrix} \\right." + ] + , Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "rendering" + , Space + , Str "looks" + , Space + , Str "like" + , Space + , Str "the" + , Space + , Str "following" + , Space + , Str "image:" + ] + ] + , Div + ( "content-mathml-001.xhtml#mathml-027" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , SoftBreak + , Span ( "" , [ "test-id" ] , [] ) [ Str "mathml-027" ] + , Str "Elementary" + , Space + , Str "math:" + , Space + , Str "long" + , Space + , Str "division" + , Space + , Str "notation" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Code ( "" , [] , [] ) "mlongdiv" + , Space + , Str "elements" + , Space + , Str "(from" + , Space + , Str "elementary" + , Space + , Str "math)" + , Space + , Str "are" + , Space + , Str "supported." + ] + , Plain + [ Span + ( "" + , [ "math" ] + , [ ( "xmlns" , "http://www.w3.org/1998/Math/MathML" ) ] + ) + [ SoftBreak + , Str "3" + , SoftBreak + , Str "435.3" + , SoftBreak + , Str "1306" + , SoftBreak + , Str "12" + , SoftBreak + , Str "10" + , SoftBreak + , Str "9" + , SoftBreak + , Str "16" + , SoftBreak + , Str "15" + , SoftBreak + , Str "1.0" + , SoftBreak + , Str "9" + , SoftBreak + , Str "1" + , SoftBreak + ] + ] + , Para + [ Str "The" + , Space + , Str "test" + , Space + , Str "passes" + , Space + , Str "if" + , Space + , Str "the" + , Space + , Str "rendering" + , Space + , Str "looks" + , Space + , Str "like" + , Space + , Str "the" + , Space + , Str "following" + , Space + , Str "image:" + , Space + , Str "." + ] ] - ] - , Para - [ Str "The" - , Space - , Str "test" - , Space - , Str "passes" - , Space - , Str "if" - , Space - , Str "the" - , Space - , Str "rendering" - , Space - , Str "looks" - , Space - , Str "like" - , Space - , Str "the" - , Space - , Str "following" - , Space - , Str "image:" - , Space - , Str "." - ] ] - ] -, Para - [ Span ( "content-switch-001.xhtml", [], [] ) [] ] +, Para [ Span ( "content-switch-001.xhtml" , [] , [] ) [] ] , Div - ( "content-switch-001.xhtml#epub-switch", [ "section" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Code ( "", [], [] ) "epub:switch" ] - , Div - ( "content-switch-001.xhtml#switch-010" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "switch-010" ] - , Space - , Str "Support" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "epub:switch" - , Space - , Str "element" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "PASS" ] - , Para - [ Str "If" - , Space - , Str "only" - , Space - , Str "the" - , Space - , Str "word" - , Space - , Str "\"PASS\"" - , Space - , Str "is" - , Space - , Str "rendered" - , Space - , Str "before" - , Space - , Str "this" - , Space - , Str "paragraph," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - , Space - , Str "If" - , Space - , Str "both" - , Space - , Str "\"PASS\"" - , Space - , Str "and" - , Space - , Str "\"FAIL\"" - , Space - , Str "are" - , Space - , Str "rendered," - , Space - , Str "or" - , Space - , Str "neither" - , SoftBreak - , Str "\"PASS\"" - , Space - , Str "nor" - , Space - , Str "\"FAIL\"" - , Space - , Str "is" - , Space - , Str "rendered," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "content-switch-001.xhtml#switch-020" - , - [ "section", "otest" ] + ( "content-switch-001.xhtml#epub-switch" + , [ "section" ] , [] ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[OPTIONAL]" ] - , SoftBreak - , Span - ( "", [ "test-id" ], [] ) - [ Str "switch-020" ] - , SoftBreak - , Str "MathML" - , Space - , Str "Embedding" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Str "MathML" - , Space - , Str "namespace" - , Space - , Str "is" - , Space - , Str "recognized" - , Space - , Str "when" - , Space - , Str "used" - , Space - , Str "in" - , Space - , Str "an" - , Space - , Code - ( "", [], [] ) "epub:case" - , Space - , Str "element." - ] - , Para - [ Math InlineMath "{2x}{+ y - z}" ] - , Para - [ Str "If" - , Space - , Str "a" - , Space - , Str "MathML" - , Space - , Str "equation" - , Space - , Str "is" - , Space - , Str "rendered" - , Space - , Str "before" - , Space - , Str "this" - , Space - , Str "paragraph," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - , Para - [ Str "If" - , Space - , Str "test" - , Space - , Code - ( "", [], [] ) "switch-010" - , Space - , Str "did" - , Space - , Str "not" - , Space - , Str "pass," - , Space - , Str "this" - , Space - , Str "test" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "marked" - , Space - , Code - ( "", [], [] ) "Not Supported" - , Str "." - ] + [ Header + 3 ( "" , [] , [] ) [ Code ( "" , [] , [] ) "epub:switch" ] + , Div + ( "content-switch-001.xhtml#switch-010" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "switch-010" ] + , Space + , Str "Support" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "epub:switch" + , Space + , Str "element" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "PASS" ] + , Para + [ Str "If" + , Space + , Str "only" + , Space + , Str "the" + , Space + , Str "word" + , Space + , Str "\"PASS\"" + , Space + , Str "is" + , Space + , Str "rendered" + , Space + , Str "before" + , Space + , Str "this" + , Space + , Str "paragraph," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + , Space + , Str "If" + , Space + , Str "both" + , Space + , Str "\"PASS\"" + , Space + , Str "and" + , Space + , Str "\"FAIL\"" + , Space + , Str "are" + , Space + , Str "rendered," + , Space + , Str "or" + , Space + , Str "neither" + , SoftBreak + , Str "\"PASS\"" + , Space + , Str "nor" + , Space + , Str "\"FAIL\"" + , Space + , Str "is" + , Space + , Str "rendered," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] + ] + , Div + ( "content-switch-001.xhtml#switch-020" + , [ "section" , "otest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[OPTIONAL]" ] + , SoftBreak + , Span ( "" , [ "test-id" ] , [] ) [ Str "switch-020" ] + , SoftBreak + , Str "MathML" + , Space + , Str "Embedding" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Str "MathML" + , Space + , Str "namespace" + , Space + , Str "is" + , Space + , Str "recognized" + , Space + , Str "when" + , Space + , Str "used" + , Space + , Str "in" + , Space + , Str "an" + , Space + , Code ( "" , [] , [] ) "epub:case" + , Space + , Str "element." + ] + , Para [ Math InlineMath "{2x}{+ y - z}" ] + , Para + [ Str "If" + , Space + , Str "a" + , Space + , Str "MathML" + , Space + , Str "equation" + , Space + , Str "is" + , Space + , Str "rendered" + , Space + , Str "before" + , Space + , Str "this" + , Space + , Str "paragraph," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + , Para + [ Str "If" + , Space + , Str "test" + , Space + , Code ( "" , [] , [] ) "switch-010" + , Space + , Str "did" + , Space + , Str "not" + , Space + , Str "pass," + , Space + , Str "this" + , Space + , Str "test" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "marked" + , Space + , Code ( "" , [] , [] ) "Not Supported" + , Str "." + ] + ] ] - ] ] diff --git a/test/epub/formatting.native b/test/epub/formatting.native index 6ffd5b8dd..cab9e40fa 100644 --- a/test/epub/formatting.native +++ b/test/epub/formatting.native @@ -1,3462 +1,1890 @@ -[ Para - [ Span ( "front.xhtml", [], [] ) [] ] +[ Para [ Span ( "front.xhtml" , [] , [] ) [] ] , Div - ( "", [ "section" ], [] ) - [ Header 1 - ( "", [], [] ) - [ Str "EPUB" - , Space - , Str "3" - , Space - , Str "Styling" - , Space - , Str "Test" - , Space - , Str "Document:" - , Space - , Str "0101" - ] - , Div - ( "", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "Status" - , Space - , Str "of" - , Space - , Str "this" - , Space - , Str "Document" - ] - , Para - [ Str "This" - , Space - , Str "publication" - , Space - , Str "is" - , Space - , Str "currently" - , Space - , Str "considered" - , Space - , Span - ( "", [ "status" ], [] ) - [ Str "[UNDER", Space, Str "DEVELOPMENT]" ] - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "IDPF." - ] - , Para - [ Str "This" - , Space - , Str "publication" - , Space - , Str "is" - , Space - , Str "part" - , Space - , Str "of" - , Space - , Str "version" - , Space - , Span - ( "", [ "version" ], [] ) - [ Str "X.X" ] - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "EPUB" - , Space - , Str "3.0" - , Space - , Str "Compliance" - , Space - , Str "Test" - , Space - , Str "Suite" - , Space - , Str "released" - , SoftBreak - , Str "on" - , Space - , RawInline - ( Format "html" ) "" - , Str "." - ] - , Para - [ Str "Before" - , Space - , Str "using" - , Space - , Str "this" - , Space - , Str "publication" - , Space - , Str "to" - , Space - , Str "evaluate" - , Space - , Str "reading" - , Space - , Str "systems," - , Space - , Str "testers" - , Space - , Str "are" - , Space - , Str "strongly" - , Space - , Str "encouraged" - , Space - , Str "to" - , SoftBreak - , Str "verify" - , Space - , Str "that" - , Space - , Str "they" - , Space - , Str "have" - , Space - , Str "the" - , Space - , Str "latest" - , Space - , Str "release" - , Space - , Str "by" - , Space - , Str "checking" - , Space - , Str "the" - , Space - , Str "current" - , Space - , Str "release" - , Space - , Str "version" - , Space - , Str "and" - , Space - , Str "date" - , Space - , Str "of" - , SoftBreak - , Str "the" - , Space - , Str "test" - , Space - , Str "suite" - , Space - , Str "at" - , Space - , Link - ( "", [], [] ) - [ Str "TBD" ] - ( "http://idpf.org/", "" ) - ] - , Para - [ Str "This" - , Space - , Str "publication" - , Space - , Str "is" - , Space - , Str "one" - , Space - , Str "of" - , Space - , Str "several" - , Space - , Str "that" - , Space - , Str "currently" - , Space - , Str "comprise" - , Space - , Str "the" - , Space - , Str "EPUB" - , Space - , Str "3" - , Space - , Str "conformance" - , Space - , Str "test" - , Space - , Str "suite" - , SoftBreak - , Str "for" - , Space - , Str "reflowable" - , Space - , Str "content." - , Space - , Str "The" - , Space - , Str "complete" - , Space - , Str "test" - , Space - , Str "suite" - , Space - , Str "includes" - , Space - , Str "all" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "following" - , Space - , Str "publications:" - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Plain [ Str "." ] ] ] - ] - , Div - ( "", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "About", Space, Str "this", Space, Str "Document" ] - , Para - [ Str "This" - , Space - , Str "document" - , Space - , Str "focuses" - , Space - , Str "on" - , Space - , Str "human-evaluated" - , Space - , Str "binary" - , Space - , Str "(pass/fail)" - , Space - , Str "tests" - , Space - , Str "in" - , Space - , Str "a" - , SoftBreak - , Str "reflowable" - , Space - , Str "context." - , Space - , Str "Tests" - , Space - , Str "for" - , Space - , Str "fixed-layout" - , Space - , Str "content" - , Space - , Str "and" - , Space - , Str "other" - , Space - , Str "individual" - , Space - , Str "tests" - , Space - , Str "that" - , SoftBreak - , Str "require" - , Space - , Str "a" - , Space - , Str "dedicated" - , Space - , Str "epub" - , Space - , Str "file" - , Space - , Str "are" - , Space - , Str "available" - , Space - , Str "in" - , Space - , Str "additional" - , Space - , Str "sibling" - , Space - , Str "documents;" - , Space - , Str "refer" - , Space - , Str "to" - , SoftBreak - , Str "the" - , Space - , Link - ( "", [], [] ) - [ Str "test", Space, Str "suite", SoftBreak, Str "wiki" ] - ( "https://github.com/mgylling/epub-testsuite/wiki/Overview" - , "" - ) - , Space - , Str "(" - , Code - ( "" - , [] - , [] - ) "https://github.com/mgylling/epub-testsuite/wiki/Overview" - , Str ")" - , Space - , Str "for" - , Space - , Str "additional" - , SoftBreak - , Str "information." - ] - ] - , Div - ( "", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "Conventions" ] - , Para - [ Str "The" - , Space - , Str "following" - , Space - , Str "conventions" - , Space - , Str "are" - , Space - , Str "used" - , Space - , Str "throughout" - , Space - , Str "the" - , Space - , Str "document:" - ] - , DefinitionList - [ - ( - [ Str "1." - , Space - , Str "Locating" - , Space - , Str "a" - , Space - , Str "test" - ] - , - [ - [ Div - ( "", [ "ctest" ], [] ) - [ Para - [ Str "Tests" - , Space - , Str "for" - , Space - , Emph - [ Str "required" ] - , Space - , Str "Reading" - , Space - , Str "System" - , Space - , Str "functionality" + ( "" , [ "section" ] , [] ) + [ Header + 1 + ( "" , [] , [] ) + [ Str "EPUB" + , Space + , Str "3" + , Space + , Str "Styling" + , Space + , Str "Test" + , Space + , Str "Document:" + , Space + , Str "0101" + ] + , Div + ( "" , [ "section" ] , [] ) + [ Header + 2 + ( "" , [] , [] ) + [ Str "Status" + , Space + , Str "of" + , Space + , Str "this" + , Space + , Str "Document" + ] + , Para + [ Str "This" + , Space + , Str "publication" + , Space + , Str "is" + , Space + , Str "currently" + , Space + , Str "considered" + , Space + , Span + ( "" , [ "status" ] , [] ) + [ Str "[UNDER" , Space , Str "DEVELOPMENT]" ] + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "IDPF." + ] + , Para + [ Str "This" + , Space + , Str "publication" + , Space + , Str "is" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "version" + , Space + , Span ( "" , [ "version" ] , [] ) [ Str "X.X" ] + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "EPUB" + , Space + , Str "3.0" + , Space + , Str "Compliance" + , Space + , Str "Test" + , Space + , Str "Suite" + , Space + , Str "released" + , SoftBreak + , Str "on" + , Space + , RawInline (Format "html") "" + , Str "." + ] + , Para + [ Str "Before" + , Space + , Str "using" + , Space + , Str "this" + , Space + , Str "publication" + , Space + , Str "to" + , Space + , Str "evaluate" + , Space + , Str "reading" + , Space + , Str "systems," + , Space + , Str "testers" + , Space + , Str "are" + , Space + , Str "strongly" + , Space + , Str "encouraged" + , Space + , Str "to" + , SoftBreak + , Str "verify" + , Space + , Str "that" + , Space + , Str "they" + , Space + , Str "have" + , Space + , Str "the" + , Space + , Str "latest" + , Space + , Str "release" + , Space + , Str "by" + , Space + , Str "checking" + , Space + , Str "the" + , Space + , Str "current" + , Space + , Str "release" + , Space + , Str "version" + , Space + , Str "and" + , Space + , Str "date" + , Space + , Str "of" + , SoftBreak + , Str "the" + , Space + , Str "test" + , Space + , Str "suite" + , Space + , Str "at" + , Space + , Link + ( "" , [] , [] ) + [ Str "TBD" ] + ( "http://idpf.org/" , "" ) + ] + , Para + [ Str "This" + , Space + , Str "publication" + , Space + , Str "is" + , Space + , Str "one" + , Space + , Str "of" + , Space + , Str "several" + , Space + , Str "that" + , Space + , Str "currently" + , Space + , Str "comprise" + , Space + , Str "the" + , Space + , Str "EPUB" + , Space + , Str "3" + , Space + , Str "conformance" + , Space + , Str "test" + , Space + , Str "suite" + , SoftBreak + , Str "for" + , Space + , Str "reflowable" + , Space + , Str "content." + , Space + , Str "The" + , Space + , Str "complete" + , Space + , Str "test" + , Space + , Str "suite" + , Space + , Str "includes" + , Space + , Str "all" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "following" + , Space + , Str "publications:" + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "." ] ] ] + ] + , Div + ( "" , [ "section" ] , [] ) + [ Header + 2 + ( "" , [] , [] ) + [ Str "About" + , Space + , Str "this" + , Space + , Str "Document" + ] + , Para + [ Str "This" + , Space + , Str "document" + , Space + , Str "focuses" + , Space + , Str "on" + , Space + , Str "human-evaluated" + , Space + , Str "binary" + , Space + , Str "(pass/fail)" + , Space + , Str "tests" + , Space + , Str "in" + , Space + , Str "a" + , SoftBreak + , Str "reflowable" + , Space + , Str "context." + , Space + , Str "Tests" + , Space + , Str "for" + , Space + , Str "fixed-layout" + , Space + , Str "content" + , Space + , Str "and" + , Space + , Str "other" + , Space + , Str "individual" + , Space + , Str "tests" + , Space + , Str "that" + , SoftBreak + , Str "require" + , Space + , Str "a" + , Space + , Str "dedicated" + , Space + , Str "epub" + , Space + , Str "file" + , Space + , Str "are" + , Space + , Str "available" + , Space + , Str "in" + , Space + , Str "additional" + , Space + , Str "sibling" + , Space + , Str "documents;" + , Space + , Str "refer" + , Space + , Str "to" + , SoftBreak + , Str "the" + , Space + , Link + ( "" , [] , [] ) + [ Str "test" , Space - , Str "are" + , Str "suite" , SoftBreak - , Str "preceded" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "label:" - , Space - , Span - ( "" - , [ "nature" ] - , - [ ( "style", "display: inline; font-size: 100%" ) ] - ) - [ Str "[REQUIRED]" ] + , Str "wiki" ] - ] - , Div - ( "", [ "otest" ], [] ) - [ Para - [ Str "Tests" - , Space - , Str "for" - , Space - , Emph - [ Str "optional" ] - , Space - , Str "Reading" + ( "https://github.com/mgylling/epub-testsuite/wiki/Overview" + , "" + ) + , Space + , Str "(" + , Code + ( "" , [] , [] ) + "https://github.com/mgylling/epub-testsuite/wiki/Overview" + , Str ")" + , Space + , Str "for" + , Space + , Str "additional" + , SoftBreak + , Str "information." + ] + ] + , Div + ( "" , [ "section" ] , [] ) + [ Header 2 ( "" , [] , [] ) [ Str "Conventions" ] + , Para + [ Str "The" + , Space + , Str "following" + , Space + , Str "conventions" + , Space + , Str "are" + , Space + , Str "used" + , Space + , Str "throughout" + , Space + , Str "the" + , Space + , Str "document:" + ] + , DefinitionList + [ ( [ Str "1." , Space - , Str "System" + , Str "Locating" , Space - , Str "functionality" + , Str "a" , Space - , Str "are" - , SoftBreak - , Str "preceded" + , Str "test" + ] + , [ [ Div + ( "" , [ "ctest" ] , [] ) + [ Para + [ Str "Tests" + , Space + , Str "for" + , Space + , Emph [ Str "required" ] + , Space + , Str "Reading" + , Space + , Str "System" + , Space + , Str "functionality" + , Space + , Str "are" + , SoftBreak + , Str "preceded" + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "label:" + , Space + , Span + ( "" + , [ "nature" ] + , [ ( "style" + , "display: inline; font-size: 100%" + ) + ] + ) + [ Str "[REQUIRED]" ] + ] + ] + , Div + ( "" , [ "otest" ] , [] ) + [ Para + [ Str "Tests" + , Space + , Str "for" + , Space + , Emph [ Str "optional" ] + , Space + , Str "Reading" + , Space + , Str "System" + , Space + , Str "functionality" + , Space + , Str "are" + , SoftBreak + , Str "preceded" + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "label:" + , Space + , Span + ( "" + , [ "nature" ] + , [ ( "style" + , "display: inline; font-size: 100%" + ) + ] + ) + [ Str "[OPTIONAL]" ] + ] + ] + ] + ] + ) + , ( [ Str "2." , Space - , Str "by" + , Str "Performing" , Space , Str "the" , Space - , Str "label:" - , Space - , Span - ( "" - , [ "nature" ] - , - [ ( "style", "display: inline; font-size: 100%" ) ] - ) - [ Str "[OPTIONAL]" ] + , Str "test" ] - ] - ] - ] - ) - , - ( - [ Str "2." - , Space - , Str "Performing" - , Space - , Str "the" - , Space - , Str "test" - ] - , - [ - [ Plain - [ Str "Each" - , Space - , Str "test" - , Space - , Str "includes" - , Space - , Str "a" - , Space - , Str "description" - , Space - , Str "of" - , Space - , Str "its" - , Space - , Str "purpose" - , Space - , Str "followed" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "actual" - , Space - , Strong - [ Str "test" - , Space - , Str "statement," - , SoftBreak - , Str "which" - , Space - , Str "can" - , Space - , Str "always" - , Space - , Str "be" + , [ [ Plain + [ Str "Each" + , Space + , Str "test" + , Space + , Str "includes" + , Space + , Str "a" + , Space + , Str "description" + , Space + , Str "of" + , Space + , Str "its" + , Space + , Str "purpose" + , Space + , Str "followed" + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "actual" + , Space + , Strong + [ Str "test" + , Space + , Str "statement," + , SoftBreak + , Str "which" + , Space + , Str "can" + , Space + , Str "always" + , Space + , Str "be" + , Space + , Str "evaluated" + , Space + , Str "to" + , Space + , Str "true" + , Space + , Str "or" + , Space + , Str "false" + ] + , Str "." + , Space + , Str "These" + , Space + , Str "statements" + , Space + , Str "typically" + , Space + , Str "have" + , Space + , Str "the" + , Space + , Str "form:" + , SoftBreak + , Str "\"If" + , Space + , Str "[some" + , Space + , Str "condition]," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes\"." + ] + ] + ] + ) + , ( [ Str "3." , Space - , Str "evaluated" + , Str "Scoring" , Space - , Str "to" + , Str "in" , Space - , Str "true" + , Str "the" , Space - , Str "or" + , Str "results" , Space - , Str "false" + , Str "form" ] - , Str "." - , Space - , Str "These" - , Space - , Str "statements" - , Space - , Str "typically" - , Space - , Str "have" - , Space - , Str "the" - , Space - , Str "form:" - , SoftBreak - , Str "\"If" - , Space - , Str "[some" - , Space - , Str "condition]," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes\"." - ] - ] - ] - ) - , - ( - [ Str "3." - , Space - , Str "Scoring" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "results" - , Space - , Str "form" - ] - , - [ - [ Plain - [ Str "@@@TODO" - , Space - , Str "provide" - , Space - , Str "info" - , Space - , Str "on" - , Space - , Str "where" - , Space - , Str "to" - , Space - , Str "get" - , Space - , Str "the" - , Space - , Str "results" - , Space - , Str "form" - ] + , [ [ Plain + [ Str "@@@TODO" + , Space + , Str "provide" + , Space + , Str "info" + , Space + , Str "on" + , Space + , Str "where" + , Space + , Str "to" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "results" + , Space + , Str "form" + ] + ] + ] + ) ] - ] - ) - ] - ] - ] -, Para - [ Span ( "styling-xhtml-001.xhtml", [], [] ) [] ] -, Div - ( "styling-xhtml-001.xhtml#epub-css", [ "section" ], [] ) - [ Header 1 - ( "", [], [] ) - [ Str "EPUB", Space, Str "Style", Space, Str "Sheets" ] - , Para - [ Str "This" - , Space - , Str "section" - , Space - , Str "contains" - , Space - , Str "tests" - , Space - , Str "for" - , Space - , Str "styling" - , Space - , Str "and" - , Space - , Str "layout." + ] ] - ] -, Para - [ Span ( "styling-xhtml-003.xhtml", [], [] ) [] ] +, Para [ Span ( "styling-xhtml-001.xhtml" , [] , [] ) [] ] , Div - ( "styling-xhtml-003.xhtml#style-110", [ "section", "ctest" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-110" ] - , Space - , Str "Multi-Column" - , Space - , Str "Layouts" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "CSS Multi-Column Layout" - , Space - , Str "properties" - , Space - , Str "are" - , Space - , Str "supported." - ] - , Div - ( "", [ "multicol" ], [] ) - [ Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] + ( "styling-xhtml-001.xhtml#epub-css" , [ "section" ] , [] ) + [ Header + 1 + ( "" , [] , [] ) + [ Str "EPUB" , Space , Str "Style" , Space , Str "Sheets" ] , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "text" - , Space - , Str "is" - , Space - , Str "rendered" - , Space - , Str "in" - , Space - , Str "three" - , Space - , Str "columns," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] -, Para - [ Span ( "styling-xhtml-002.xhtml", [], [] ) [] ] -, Div - ( "styling-xhtml-002.xhtml#style-lists", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "Lists" ] - , Div - ( "styling-xhtml-002.xhtml#style-list-style-type" - , [ "section" ] - , [] - ) - [ Header 3 - ( "", [], [] ) - [ Str "The" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - ] - , Div - ( "styling-xhtml-002.xhtml#style-009" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-009" ] - , Space - , Code - ( "", [], [] ) "decimal" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" + [ Str "This" , Space - , Str "to" + , Str "section" , Space - , Code - ( "", [], [] ) "decimal" + , Str "contains" , Space - , Str "is" - , Space - , Str "supported" + , Str "tests" , Space - , Str "on" + , Str "for" , Space - , Str "a" + , Str "styling" , Space - , Code - ( "", [], [] ) "ol" + , Str "and" , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] + , Str "layout." ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "decimal" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" + ] +, Para [ Span ( "styling-xhtml-003.xhtml" , [] , [] ) [] ] +, Div + ( "styling-xhtml-003.xhtml#style-110" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-010" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-110" ] , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-010" ] + , Str "Multi-Column" , Space - , Code - ( "", [], [] ) "circle" + , Str "Layouts" ] - , Para + , Para [ Str "Tests" , Space , Str "whether" , Space , Str "the" , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" + , Code ( "" , [] , [] ) "CSS Multi-Column Layout" , Space - , Str "to" + , Str "properties" , Space - , Code - ( "", [], [] ) "circle" + , Str "are" , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ul" - , Space - , Str "element." - ] - , BulletList - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "circle" - , Space - , Str "markers," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-011" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-011" ] - , Space - , Code - ( "", [], [] ) "square" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "square" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ul" - , Space - , Str "element." - ] - , BulletList - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "square" - , Space - , Str "markers," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-012" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-012" ] - , Space - , Code - ( "", [], [] ) "disc" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "disc" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ul" - , Space - , Str "element." - ] - , BulletList - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "disc" - , Space - , Str "markers," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-013" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-013" ] - , Space - , Code - ( "", [], [] ) "lower-latin" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "lower-latin" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "lower-latin" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-014" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-014" ] - , Space - , Code - ( "", [], [] ) "lower-roman" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "lower-roman" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "lower-roman" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-015" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-015" ] - , Space - , Code - ( "", [], [] ) "upper-alpha" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "upper-alpha" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "upper-alpha" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Str "supported." ] - ] , Div - ( "styling-xhtml-002.xhtml#style-016" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-016" ] - , Space - , Code - ( "", [], [] ) "hiragana" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "hiragana" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "hiragana" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-017" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-017" ] - , Space - , Code - ( "", [], [] ) "hiragana-iroha" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "hiragana-iroha" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "hiragana-iroha" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-018" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-018" ] - , Space - , Code - ( "", [], [] ) "katakana" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "katakana" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "katakana" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-019" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-019" ] - , Space - , Code - ( "", [], [] ) "katakana-iroha" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "katakana-iroha" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "katakana-iroha" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-020" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-020" ] - , Space - , Code - ( "", [], [] ) "upper-roman" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "upper-roman" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "upper-roman" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-021" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-021" ] - , Space - , Code - ( "", [], [] ) "upper-latin" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "upper-latin" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "upper-latin" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-022" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-022" ] - , Space - , Code - ( "", [], [] ) "lower-alpha" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "lower-alpha" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "lower-alpha" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-023" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-023" ] - , Space - , Code - ( "", [], [] ) "lower-greek" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "lower-greek" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "lower-greek" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-024" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-024" ] - , Space - , Code - ( "", [], [] ) "armenian" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "armenian" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "armenian" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-025" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-025" ] - , Space - , Code - ( "", [], [] ) "cjk-ideographic" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "cjk-ideographic" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] + ( "" , [ "multicol" ] , [] ) + [ Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + , Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + , Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + , Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + , Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + , Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + , Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + , Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + , Para + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] ] - , Para + , Para [ Str "If" , Space , Str "the" , Space , Str "preceding" , Space - , Str "list" - , Space - , Str "has" + , Str "text" , Space - , Str "cjk-ideographic" + , Str "is" , Space - , Str "markers" + , Str "rendered" , Space , Str "in" , Space - , Str "ascending" + , Str "three" , Space - , Str "order," + , Str "columns," , Space , Str "the" , Space @@ -3464,550 +1892,3233 @@ , Space , Str "passes." ] - ] + ] +, Para [ Span ( "styling-xhtml-002.xhtml" , [] , [] ) [] ] +, Div + ( "styling-xhtml-002.xhtml#style-lists" + , [ "section" ] + , [] + ) + [ Header 2 ( "" , [] , [] ) [ Str "Lists" ] + , Div + ( "styling-xhtml-002.xhtml#style-list-style-type" + , [ "section" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Str "The" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + ] + , Div + ( "styling-xhtml-002.xhtml#style-009" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-009" ] + , Space + , Code ( "" , [] , [] ) "decimal" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "decimal" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "decimal" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-010" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-010" ] + , Space + , Code ( "" , [] , [] ) "circle" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "circle" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] + , BulletList + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "circle" + , Space + , Str "markers," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-011" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-011" ] + , Space + , Code ( "" , [] , [] ) "square" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "square" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] + , BulletList + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "square" + , Space + , Str "markers," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-012" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-012" ] + , Space + , Code ( "" , [] , [] ) "disc" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "disc" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] + , BulletList + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "disc" + , Space + , Str "markers," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-013" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-013" ] + , Space + , Code ( "" , [] , [] ) "lower-latin" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "lower-latin" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "lower-latin" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-014" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-014" ] + , Space + , Code ( "" , [] , [] ) "lower-roman" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "lower-roman" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "lower-roman" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-015" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-015" ] + , Space + , Code ( "" , [] , [] ) "upper-alpha" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "upper-alpha" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "upper-alpha" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-016" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-016" ] + , Space + , Code ( "" , [] , [] ) "hiragana" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "hiragana" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "hiragana" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-017" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-017" ] + , Space + , Code ( "" , [] , [] ) "hiragana-iroha" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "hiragana-iroha" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "hiragana-iroha" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-018" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-018" ] + , Space + , Code ( "" , [] , [] ) "katakana" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "katakana" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "katakana" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-019" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-019" ] + , Space + , Code ( "" , [] , [] ) "katakana-iroha" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "katakana-iroha" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "katakana-iroha" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-020" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-020" ] + , Space + , Code ( "" , [] , [] ) "upper-roman" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "upper-roman" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "upper-roman" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-021" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-021" ] + , Space + , Code ( "" , [] , [] ) "upper-latin" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "upper-latin" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "upper-latin" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-022" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-022" ] + , Space + , Code ( "" , [] , [] ) "lower-alpha" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "lower-alpha" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "lower-alpha" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-023" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-023" ] + , Space + , Code ( "" , [] , [] ) "lower-greek" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "lower-greek" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "lower-greek" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-024" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-024" ] + , Space + , Code ( "" , [] , [] ) "armenian" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "armenian" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "armenian" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-025" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-025" ] + , Space + , Code ( "" , [] , [] ) "cjk-ideographic" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "cjk-ideographic" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "cjk-ideographic" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-026" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-026" ] + , Space + , Code ( "" , [] , [] ) "decimal-leading-zero" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "decimal-leading-zero" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "decimal-leading-zero" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-027" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-027" ] + , Space + , Code ( "" , [] , [] ) "georgian" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "georgian" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "georgian" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-028" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-028" ] + , Space + , Code ( "" , [] , [] ) "hebrew" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "hebrew" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "hebrew" + , Space + , Str "markers" + , Space + , Str "in" + , Space + , Str "ascending" + , Space + , Str "order," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-029" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-029" ] + , Space + , Code ( "" , [] , [] ) "none" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "none" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "no" + , Space + , Str "markers," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + ] , Div - ( "styling-xhtml-002.xhtml#style-026" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-026" ] - , Space - , Code - ( "", [], [] ) "decimal-leading-zero" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "decimal-leading-zero" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." + ( "styling-xhtml-002.xhtml#style-list-style" + , [ "section" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Str "The" + , Space + , Code ( "" , [] , [] ) "list-style" + , Space + , Str "property" + ] + , Div + ( "styling-xhtml-002.xhtml#style-030" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-030" ] + , Space + , Str "images" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style" + , Space + , Str "shorthand" + , Space + , Str "property" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "using" + , Space + , Str "a" + , Space + , Str "gif" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] + , BulletList + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "the" + , Space + , Str "purple" + , Space + , Str "and" + , Space + , Str "aqua" + , Space + , Str "square" + , Space + , Str "bullet" + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] + , Div + ( "styling-xhtml-002.xhtml#style-list-style-position" + , [ "section" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Str "The" + , Space + , Code ( "" , [] , [] ) "list-style-position" + , Space + , Str "property" + ] + , Div + ( "styling-xhtml-002.xhtml#style-040" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-040" ] + , Space + , Str "The" + , Space + , Code ( "" , [] , [] ) "list-style-position" + , Space + , Str "property:" + , Space + , Code ( "" , [] , [] ) "inside" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-position" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "inside" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] + , BulletList + [ [ Plain + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + ] + ] + , [ Plain + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + ] + ] + , [ Plain + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + ] + ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "markers" + , Space + , Str "inside" + , Space + , Str "the" + , Space + , Str "indentation," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-041" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-041" ] + , Space + , Str "The" + , Space + , Code ( "" , [] , [] ) "list-style-position" + , Space + , Str "property:" + , Space + , Code ( "" , [] , [] ) "outside" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "list-style-position" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "outside" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ul" + , Space + , Str "element." + ] + , BulletList + [ [ Plain + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + ] + ] + , [ Plain + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + ] + ] + , [ Plain + [ Str "Lorem" + , Space + , Str "ipsum" + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipisicing" + , Space + , Str "elit," + , Space + , Str "sed" + , Space + , Str "do" + , Space + , Str "eiusmod" + , Space + , Str "tempor" + , Space + , Str "incididunt" + , Space + , Str "ut" + , Space + , Str "labore" + , Space + , Str "et" + , Space + , Str "dolore" + , Space + , Str "magna" + , Space + , Str "aliqua." + , Space + , Str "Ut" + , Space + , Str "enim" + , Space + , Str "ad" + , Space + , Str "minim" + , Space + , Str "veniam," + , Space + , Str "quis" + , Space + , Str "nostrud" + , Space + , Str "exercitation" + , Space + , Str "ullamco" + , Space + , Str "laboris" + , Space + , Str "nisi" + , Space + , Str "ut" + , Space + , Str "aliquip" + , Space + , Str "ex" + , Space + , Str "ea" + , Space + , Str "commodo" + , Space + , Str "consequat." + ] + ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "has" + , Space + , Str "the" + , Space + , Str "default" + , Space + , Str "setting" + , Space + , Str "(marker" + , Space + , Str "outside" + , Space + , Str "the" + , Space + , Str "indentation)," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "decimal-leading-zero" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "styling-xhtml-002.xhtml#style-list-start" + , [ "section" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Str "The" + , Space + , Str "HTML" + , Space + , Code ( "" , [] , [] ) "start" + , Space + , Str "attribute" + ] + , Div + ( "styling-xhtml-002.xhtml#style-050" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-050" ] + , Space + , Str "Without" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "set" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "start" + , Space + , Str "attribute" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element" + , Space + , Str "with" + , Space + , Str "no" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property." + ] + , OrderedList + ( 25 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "starts" + , Space + , Str "at" + , Space + , Str "25," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-002.xhtml#style-051" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 4 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-051" ] + , Space + , Str "With" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "set" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "start" + , Space + , Str "attribute" + , Space + , Str "is" + , Space + , Str "supported" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "ol" + , Space + , Str "element" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "list-style-type" + , Space + , Str "property." + ] + , OrderedList + ( 50 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Lorem" ] ] + , [ Plain [ Str "Ipsum" ] ] + , [ Plain [ Str "Dolor" ] ] + , [ Plain [ Str "Sit" ] ] + , [ Plain [ Str "Amet" ] ] + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "list" + , Space + , Str "starts" + , Space + , Str "at" + , Space + , Str "'L'" + , Space + , Str "(50)," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] ] - ] + ] +, Para [ Span ( "styling-xhtml-004.xhtml" , [] , [] ) [] ] +, Div + ( "styling-xhtml-004.xhtml#style-media-rules" + , [ "section" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Code ( "" , [] , [] ) "@media" , Space , Str "Rules" ] , Div - ( "styling-xhtml-002.xhtml#style-027" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-027" ] - , Space - , Code - ( "", [], [] ) "georgian" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "georgian" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "georgian" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + ( "styling-xhtml-004.xhtml#style-210" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-210" ] + , Space + , Code ( "" , [] , [] ) "all" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "all" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "FAIL" ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] - ] , Div - ( "styling-xhtml-002.xhtml#style-028" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-028" ] - , Space - , Code - ( "", [], [] ) "hebrew" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "hebrew" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "hebrew" - , Space - , Str "markers" - , Space - , Str "in" - , Space - , Str "ascending" - , Space - , Str "order," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + ( "styling-xhtml-004.xhtml#style-211" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-211" ] + , Space + , Code ( "" , [] , [] ) "screen" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "screen" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "FAIL" ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] - ] , Div - ( "styling-xhtml-002.xhtml#style-029" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-029" ] - , Space - , Code - ( "", [], [] ) "none" + ( "styling-xhtml-004.xhtml#style-212" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-212" ] + , Space + , Code ( "" , [] , [] ) "handheld" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "handheld" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "FAIL" ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "none" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element." + , Div + ( "styling-xhtml-004.xhtml#style-213" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-213" ] + , Space + , Code ( "" , [] , [] ) "tv" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "tv" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "FAIL" ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] + , Div + ( "styling-xhtml-004.xhtml#style-220" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-220" ] + , Space + , Code ( "" , [] , [] ) "orientation:landscape" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "orientation:landscape" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "FAIL" ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"" + , Space + , Str "when" + , Space + , Str "the" + , Space + , Str "device" + , Space + , Str "is" + , Space + , Str "held" + , Space + , Str "in" + , Space + , Str "landscape" + , Space + , Str "mode," + , Space + , Str "and" + , Space + , Str "the" + , Space + , Str "device" + , Space + , Str "supports" + , Space + , Str "multiple" + , Space + , Str "orientations," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "no" - , Space - , Str "markers," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "styling-xhtml-004.xhtml#style-221" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-221" ] + , Space + , Code ( "" , [] , [] ) "orientation:portrait" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "orientation:portrait" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "FAIL" ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"" + , Space + , Str "when" + , Space + , Str "the" + , Space + , Str "device" + , Space + , Str "is" + , Space + , Str "held" + , Space + , Str "in" + , Space + , Str "portrait" + , Space + , Str "mode," + , Space + , Str "and" + , Space + , Str "the" + , Space + , Str "device" + , Space + , Str "supports" + , Space + , Str "multiple" + , Space + , Str "orientations," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-list-style", [ "section" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Str "The" - , Space - , Code - ( "", [], [] ) "list-style" - , Space - , Str "property" - ] , Div - ( "styling-xhtml-002.xhtml#style-030" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-030" ] - , Space - , Str "images" + ( "styling-xhtml-004.xhtml#style-230" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-230" ] + , Space + , Code ( "" , [] , [] ) "min-width" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "min-width:200px" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "FAIL" ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style" - , Space - , Str "shorthand" - , Space - , Str "property" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "using" - , Space - , Str "a" - , Space - , Str "gif" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ul" - , Space - , Str "element." + , Div + ( "styling-xhtml-004.xhtml#style-231" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-231" ] + , Space + , Code ( "" , [] , [] ) "max-width" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "max-width:2000px" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "FAIL" ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] - , BulletList - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] + , Div + ( "styling-xhtml-004.xhtml#style-240" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-240" ] + , Space + , Code ( "" , [] , [] ) "min-device-width" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "min-device-width:200px" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "FAIL" ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "the" - , Space - , Str "purple" - , Space - , Str "and" - , Space - , Str "aqua" - , Space - , Str "square" - , Space - , Str "bullet" - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." + , Div + ( "styling-xhtml-004.xhtml#style-241" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 3 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-241" ] + , Space + , Code ( "" , [] , [] ) "max-device-width" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "@media" + , Space + , Str "rule" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Code ( "" , [] , [] ) "max-device-width:2000px" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "FAIL" ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "reads" + , Space + , Str "\"FAIL\"," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "fails." + ] ] - ] ] - , Div - ( "styling-xhtml-002.xhtml#style-list-style-position" +, Para [ Span ( "styling-xhtml-005.xhtml" , [] , [] ) [] ] +, Div + ( "styling-xhtml-005.xhtml#style-text-xform" , [ "section" ] , [] ) - [ Header 3 - ( "", [], [] ) - [ Str "The" - , Space - , Code - ( "", [], [] ) "list-style-position" - , Space - , Str "property" - ] - , Div - ( "styling-xhtml-002.xhtml#style-040" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-040" ] - , Space - , Str "The" - , Space - , Code - ( "", [], [] ) "list-style-position" - , Space - , Str "property:" - , Space - , Code - ( "", [], [] ) "inside" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" + [ Header + 2 + ( "" , [] , [] ) + [ Str "The" , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-position" + , Code ( "" , [] , [] ) "text-transform" , Space , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "inside" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ul" - , Space - , Str "element." ] - , BulletList - [ - [ Plain + , Div + ( "styling-xhtml-005.xhtml#style-310" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-310" ] + , Space + , Code ( "" , [] , [] ) "uppercase" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "text-transform" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Str "uppercase" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "Lorem" , Space , Str "ipsum" @@ -4079,85 +5190,133 @@ , Str "commodo" , Space , Str "consequat." - ] - ] - , - [ Plain - [ Str "Lorem" , Space - , Str "ipsum" + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" , Space , Str "dolor" , Space - , Str "sit" + , Str "in" , Space - , Str "amet," + , Str "reprehenderit" , Space - , Str "consectetur" + , Str "in" , Space - , Str "adipisicing" + , Str "voluptate" , Space - , Str "elit," + , Str "velit" , Space - , Str "sed" + , Str "esse" , Space - , Str "do" + , Str "cillum" , Space - , Str "eiusmod" + , Str "dolore" , Space - , Str "tempor" + , Str "eu" , Space - , Str "incididunt" + , Str "fugiat" , Space - , Str "ut" + , Str "nulla" , Space - , Str "labore" + , Str "pariatur." , Space - , Str "et" + , Str "Excepteur" , Space - , Str "dolore" + , Str "sint" , Space - , Str "magna" + , Str "occaecat" , Space - , Str "aliqua." + , Str "cupidatat" , Space - , Str "Ut" + , Str "non" , Space - , Str "enim" + , Str "proident," , Space - , Str "ad" + , Str "sunt" , Space - , Str "minim" + , Str "in" , Space - , Str "veniam," + , Str "culpa" , Space - , Str "quis" + , Str "qui" , Space - , Str "nostrud" + , Str "officia" , Space - , Str "exercitation" + , Str "deserunt" , Space - , Str "ullamco" + , Str "mollit" , Space - , Str "laboris" + , Str "anim" , Space - , Str "nisi" + , Str "id" , Space - , Str "ut" + , Str "est" , Space - , Str "aliquip" + , Str "laborum." + ] + , Para + [ Str "If" , Space - , Str "ex" + , Str "the" , Space - , Str "ea" + , Str "preceding" , Space - , Str "commodo" + , Str "paragraph" , Space - , Str "consequat." + , Str "is" + , Space + , Str "in" + , Space + , Str "upper" + , Space + , Str "case," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-005.xhtml#style-311" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-311" ] + , Space + , Code ( "" , [] , [] ) "capitalize" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "text-transform" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Str "capitalize" + , Space + , Str "is" + , Space + , Str "supported." ] - ] - , - [ Plain + , Para [ Str "Lorem" , Space , Str "ipsum" @@ -4229,96 +5388,147 @@ , Str "commodo" , Space , Str "consequat." + , Space + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" + , Space + , Str "dolor" + , Space + , Str "in" + , Space + , Str "reprehenderit" + , Space + , Str "in" + , Space + , Str "voluptate" + , Space + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + , Para + [ Str "If" + , Space + , Str "each" + , Space + , Str "first" + , Space + , Str "letter" + , Space + , Str "of" + , Space + , Str "each" + , Space + , Str "word" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "is" + , Space + , Str "in" + , Space + , Str "upper" + , Space + , Str "case," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." ] - ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "markers" - , Space - , Str "inside" - , Space - , Str "the" - , Space - , Str "indentation," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." ] - ] , Div - ( "styling-xhtml-002.xhtml#style-041" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-041" ] - , Space - , Str "The" - , Space - , Code - ( "", [], [] ) "list-style-position" - , Space - , Str "property:" - , Space - , Code - ( "", [], [] ) "outside" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "list-style-position" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "outside" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ul" - , Space - , Str "element." - ] - , BulletList - [ - [ Plain + ( "styling-xhtml-005.xhtml#style-312" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-312" ] + , Space + , Code ( "" , [] , [] ) "lowercase" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "text-transform" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Str "lowercase" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Para [ Str "Lorem" , Space , Str "ipsum" @@ -4390,2000 +5600,385 @@ , Str "commodo" , Space , Str "consequat." - ] - ] - , - [ Plain - [ Str "Lorem" , Space - , Str "ipsum" + , Str "Duis" + , Space + , Str "aute" + , Space + , Str "irure" , Space , Str "dolor" , Space - , Str "sit" + , Str "in" , Space - , Str "amet," + , Str "reprehenderit" , Space - , Str "consectetur" + , Str "in" , Space - , Str "adipisicing" + , Str "voluptate" , Space - , Str "elit," + , Str "velit" + , Space + , Str "esse" + , Space + , Str "cillum" + , Space + , Str "dolore" + , Space + , Str "eu" + , Space + , Str "fugiat" + , Space + , Str "nulla" + , Space + , Str "pariatur." + , Space + , Str "Excepteur" + , Space + , Str "sint" + , Space + , Str "occaecat" + , Space + , Str "cupidatat" + , Space + , Str "non" + , Space + , Str "proident," + , Space + , Str "sunt" + , Space + , Str "in" + , Space + , Str "culpa" + , Space + , Str "qui" + , Space + , Str "officia" + , Space + , Str "deserunt" + , Space + , Str "mollit" + , Space + , Str "anim" + , Space + , Str "id" + , Space + , Str "est" + , Space + , Str "laborum." + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "preceding" + , Space + , Str "paragraph" + , Space + , Str "is" + , Space + , Str "in" + , Space + , Str "lower" + , Space + , Str "case," + , Space + , Str "the" + , Space + , Str "test" + , Space + , Str "passes." + ] + ] + ] +, Para [ Span ( "styling-xhtml-006.xhtml" , [] , [] ) [] ] +, Div + ( "styling-xhtml-006.xhtml#style-ruby" + , [ "section" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Str "The" + , Space + , Code ( "" , [] , [] ) "epub-ruby-position" + , Space + , Str "property" + ] + , Div + ( "styling-xhtml-006.xhtml#style-410" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] + , Space + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-410" ] + , Space + , Code ( "" , [] , [] ) "over" + ] + , Para + [ Str "Tests" + , Space + , Str "whether" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "-epub-ruby-position" + , Space + , Str "property" + , Space + , Str "set" + , Space + , Str "to" + , Space + , Str "over" + , Space + , Str "is" + , Space + , Str "supported." + ] + , Plain + [ RawInline (Format "html") "" + , Strong [ Str "Lorem" , Space , Str "Ipsum" ] + , Space + , RawInline (Format "html") "" + , Str "(" + , RawInline (Format "html") "" + , RawInline (Format "html") "" + , Str "Lorem" + , Space + , Str "Ipsum" + , RawInline (Format "html") "" + , RawInline (Format "html") "" + , Str ")" + , RawInline (Format "html") "" + , RawInline (Format "html") "" + ] + , Para + [ Str "If" + , Space + , Str "the" + , Space + , Str "Ruby" + , Space + , Str "text" + , Space + , Str "is" + , Space + , Str "positioned" + , Space + , Str "on" + , Space + , Str "the" , Space - , Str "sed" + , Link + ( "" , [] , [] ) + [ Str "over" ] + ( "http://www.w3.org/TR/css3-writing-modes/#over" , "" ) , Space - , Str "do" + , Str "side" , Space - , Str "eiusmod" + , Str "of" , Space - , Str "tempor" + , Str "the" , Space - , Str "incididunt" + , Str "ruby" , Space - , Str "ut" + , Str "base," , Space - , Str "labore" + , Str "the" , Space - , Str "et" + , Str "test" , Space - , Str "dolore" + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-006.xhtml#style-411" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] , Space - , Str "magna" + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-411" ] , Space - , Str "aliqua." + , Code ( "" , [] , [] ) "under" + ] + , Para + [ Str "Tests" , Space - , Str "Ut" + , Str "whether" , Space - , Str "enim" + , Str "the" , Space - , Str "ad" + , Code ( "" , [] , [] ) "-epub-ruby-position" , Space - , Str "minim" + , Str "property" , Space - , Str "veniam," + , Str "set" , Space - , Str "quis" + , Str "to" , Space - , Str "nostrud" + , Str "under" , Space - , Str "exercitation" + , Str "is" , Space - , Str "ullamco" + , Str "supported." + ] + , Plain + [ RawInline (Format "html") "" + , Strong [ Str "Lorem" , Space , Str "Ipsum" ] + , Space + , RawInline (Format "html") "" + , Str "(" + , RawInline (Format "html") "" + , RawInline (Format "html") "" + , Str "Lorem" + , Space + , Str "Ipsum" + , RawInline (Format "html") "" + , RawInline (Format "html") "" + , Str ")" + , RawInline (Format "html") "" + , RawInline (Format "html") "" + ] + , Para + [ Str "If" , Space - , Str "laboris" + , Str "the" , Space - , Str "nisi" + , Str "Ruby" , Space - , Str "ut" + , Str "text" , Space - , Str "aliquip" + , Str "is" , Space - , Str "ex" + , Str "positioned" , Space - , Str "ea" + , Str "on" , Space - , Str "commodo" + , Str "the" , Space - , Str "consequat." - ] - ] - , - [ Plain - [ Str "Lorem" + , Link + ( "" , [] , [] ) + [ Str "under" ] + ( "http://www.w3.org/TR/css3-writing-modes/#under" + , "" + ) , Space - , Str "ipsum" + , Str "side" , Space - , Str "dolor" + , Str "of" , Space - , Str "sit" + , Str "the" , Space - , Str "amet," + , Str "ruby" , Space - , Str "consectetur" + , Str "base," , Space - , Str "adipisicing" + , Str "the" , Space - , Str "elit," + , Str "test" , Space - , Str "sed" + , Str "passes." + ] + ] + , Div + ( "styling-xhtml-006.xhtml#style-412" + , [ "section" , "ctest" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Span ( "" , [ "nature" ] , [] ) [ Str "[REQUIRED]" ] , Space - , Str "do" + , Span ( "" , [ "test-id" ] , [] ) [ Str "style-412" ] , Space - , Str "eiusmod" + , Code ( "" , [] , [] ) "inter-character" + ] + , Para + [ Str "Tests" , Space - , Str "tempor" + , Str "whether" , Space - , Str "incididunt" + , Str "the" , Space - , Str "ut" + , Code ( "" , [] , [] ) "-epub-ruby-position" , Space - , Str "labore" + , Str "property" , Space - , Str "et" + , Str "set" , Space - , Str "dolore" + , Str "to" , Space - , Str "magna" + , Str "inter-caracter" , Space - , Str "aliqua." + , Str "is" , Space - , Str "Ut" + , Str "supported." + ] + , Plain + [ RawInline + (Format "html") "" + , Strong [ Str "Lorem" , Space , Str "Ipsum" ] + , Space + , RawInline (Format "html") "" + , Str "(" + , RawInline (Format "html") "" + , RawInline (Format "html") "" + , Str "Lorem" + , Space + , Str "Ipsum" + , RawInline (Format "html") "" + , RawInline (Format "html") "" + , Str ")" + , RawInline (Format "html") "" + , RawInline (Format "html") "" + ] + , Para + [ Str "If" , Space - , Str "enim" + , Str "the" , Space - , Str "ad" + , Str "Ruby" , Space - , Str "minim" + , Str "text" , Space - , Str "veniam," + , Str "is" , Space - , Str "quis" + , Str "positioned" , Space - , Str "nostrud" + , Str "on" , Space - , Str "exercitation" + , Str "the" , Space - , Str "ullamco" + , Str "right" , Space - , Str "laboris" + , Str "side" , Space - , Str "nisi" + , Str "of" , Space - , Str "ut" + , Str "the" , Space - , Str "aliquip" + , Str "base" , Space - , Str "ex" + , Str "text," , Space - , Str "ea" + , Str "the" , Space - , Str "commodo" + , Str "test" , Space - , Str "consequat." + , Str "passes." ] - ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "has" - , Space - , Str "the" - , Space - , Str "default" - , Space - , Str "setting" - , Space - , Str "(marker" - , Space - , Str "outside" - , Space - , Str "the" - , Space - , Str "indentation)," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-list-start", [ "section" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Str "The" - , Space - , Str "HTML" - , Space - , Code - ( "", [], [] ) "start" - , Space - , Str "attribute" - ] - , Div - ( "styling-xhtml-002.xhtml#style-050" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-050" ] - , Space - , Str "Without" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "set" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "start" - , Space - , Str "attribute" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element" - , Space - , Str "with" - , Space - , Str "no" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property." - ] - , OrderedList - ( 25, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "starts" - , Space - , Str "at" - , Space - , Str "25," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-002.xhtml#style-051" - , - [ "section", "ctest" ] - , [] - ) - [ Header 4 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-051" ] - , Space - , Str "With" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "set" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "start" - , Space - , Str "attribute" - , Space - , Str "is" - , Space - , Str "supported" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "ol" - , Space - , Str "element" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Code - ( "", [], [] ) "list-style-type" - , Space - , Str "property." - ] - , OrderedList - ( 50, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Lorem" ] ] - , - [ Plain [ Str "Ipsum" ] ] - , - [ Plain [ Str "Dolor" ] ] - , - [ Plain [ Str "Sit" ] ] - , - [ Plain [ Str "Amet" ] ] - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "list" - , Space - , Str "starts" - , Space - , Str "at" - , Space - , Str "'L'" - , Space - , Str "(50)," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." ] - ] - ] - ] -, Para - [ Span ( "styling-xhtml-004.xhtml", [], [] ) [] ] -, Div - ( "styling-xhtml-004.xhtml#style-media-rules", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Code ( "", [], [] ) "@media", Space, Str "Rules" ] - , Div - ( "styling-xhtml-004.xhtml#style-210", [ "section", "ctest" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-210" ] - , Space - , Code - ( "", [], [] ) "all" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "all" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "styling-xhtml-004.xhtml#style-211", [ "section", "ctest" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-211" ] - , Space - , Code - ( "", [], [] ) "screen" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "screen" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "styling-xhtml-004.xhtml#style-212", [ "section", "ctest" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-212" ] - , Space - , Code - ( "", [], [] ) "handheld" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "handheld" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "styling-xhtml-004.xhtml#style-213", [ "section", "ctest" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-213" ] - , Space - , Code - ( "", [], [] ) "tv" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "tv" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "styling-xhtml-004.xhtml#style-220", [ "section", "ctest" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-220" ] - , Space - , Code - ( "", [], [] ) "orientation:landscape" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "orientation:landscape" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"" - , Space - , Str "when" - , Space - , Str "the" - , Space - , Str "device" - , Space - , Str "is" - , Space - , Str "held" - , Space - , Str "in" - , Space - , Str "landscape" - , Space - , Str "mode," - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "device" - , Space - , Str "supports" - , Space - , Str "multiple" - , Space - , Str "orientations," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "styling-xhtml-004.xhtml#style-221", [ "section", "ctest" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-221" ] - , Space - , Code - ( "", [], [] ) "orientation:portrait" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "orientation:portrait" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"" - , Space - , Str "when" - , Space - , Str "the" - , Space - , Str "device" - , Space - , Str "is" - , Space - , Str "held" - , Space - , Str "in" - , Space - , Str "portrait" - , Space - , Str "mode," - , Space - , Str "and" - , Space - , Str "the" - , Space - , Str "device" - , Space - , Str "supports" - , Space - , Str "multiple" - , Space - , Str "orientations," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "styling-xhtml-004.xhtml#style-230", [ "section", "ctest" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-230" ] - , Space - , Code - ( "", [], [] ) "min-width" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "min-width:200px" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "styling-xhtml-004.xhtml#style-231", [ "section", "ctest" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-231" ] - , Space - , Code - ( "", [], [] ) "max-width" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "max-width:2000px" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "styling-xhtml-004.xhtml#style-240", [ "section", "ctest" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-240" ] - , Space - , Code - ( "", [], [] ) "min-device-width" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "min-device-width:200px" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - , Div - ( "styling-xhtml-004.xhtml#style-241", [ "section", "ctest" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-241" ] - , Space - , Code - ( "", [], [] ) "max-device-width" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "@media" - , Space - , Str "rule" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Code - ( "", [], [] ) "max-device-width:2000px" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "FAIL" ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "reads" - , Space - , Str "\"FAIL\"," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "fails." - ] - ] - ] -, Para - [ Span ( "styling-xhtml-005.xhtml", [], [] ) [] ] -, Div - ( "styling-xhtml-005.xhtml#style-text-xform", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "The" - , Space - , Code - ( "", [], [] ) "text-transform" - , Space - , Str "property" - ] - , Div - ( "styling-xhtml-005.xhtml#style-310", [ "section", "ctest" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-310" ] - , Space - , Code - ( "", [], [] ) "uppercase" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "text-transform" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "uppercase" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "is" - , Space - , Str "in" - , Space - , Str "upper" - , Space - , Str "case," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-005.xhtml#style-311", [ "section", "ctest" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-311" ] - , Space - , Code - ( "", [], [] ) "capitalize" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "text-transform" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "capitalize" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "If" - , Space - , Str "each" - , Space - , Str "first" - , Space - , Str "letter" - , Space - , Str "of" - , Space - , Str "each" - , Space - , Str "word" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "is" - , Space - , Str "in" - , Space - , Str "upper" - , Space - , Str "case," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-005.xhtml#style-312", [ "section", "ctest" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-312" ] - , Space - , Code - ( "", [], [] ) "lowercase" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "text-transform" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "lowercase" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Para - [ Str "Lorem" - , Space - , Str "ipsum" - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipisicing" - , Space - , Str "elit," - , Space - , Str "sed" - , Space - , Str "do" - , Space - , Str "eiusmod" - , Space - , Str "tempor" - , Space - , Str "incididunt" - , Space - , Str "ut" - , Space - , Str "labore" - , Space - , Str "et" - , Space - , Str "dolore" - , Space - , Str "magna" - , Space - , Str "aliqua." - , Space - , Str "Ut" - , Space - , Str "enim" - , Space - , Str "ad" - , Space - , Str "minim" - , Space - , Str "veniam," - , Space - , Str "quis" - , Space - , Str "nostrud" - , Space - , Str "exercitation" - , Space - , Str "ullamco" - , Space - , Str "laboris" - , Space - , Str "nisi" - , Space - , Str "ut" - , Space - , Str "aliquip" - , Space - , Str "ex" - , Space - , Str "ea" - , Space - , Str "commodo" - , Space - , Str "consequat." - , Space - , Str "Duis" - , Space - , Str "aute" - , Space - , Str "irure" - , Space - , Str "dolor" - , Space - , Str "in" - , Space - , Str "reprehenderit" - , Space - , Str "in" - , Space - , Str "voluptate" - , Space - , Str "velit" - , Space - , Str "esse" - , Space - , Str "cillum" - , Space - , Str "dolore" - , Space - , Str "eu" - , Space - , Str "fugiat" - , Space - , Str "nulla" - , Space - , Str "pariatur." - , Space - , Str "Excepteur" - , Space - , Str "sint" - , Space - , Str "occaecat" - , Space - , Str "cupidatat" - , Space - , Str "non" - , Space - , Str "proident," - , Space - , Str "sunt" - , Space - , Str "in" - , Space - , Str "culpa" - , Space - , Str "qui" - , Space - , Str "officia" - , Space - , Str "deserunt" - , Space - , Str "mollit" - , Space - , Str "anim" - , Space - , Str "id" - , Space - , Str "est" - , Space - , Str "laborum." - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "preceding" - , Space - , Str "paragraph" - , Space - , Str "is" - , Space - , Str "in" - , Space - , Str "lower" - , Space - , Str "case," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - ] -, Para - [ Span ( "styling-xhtml-006.xhtml", [], [] ) [] ] -, Div - ( "styling-xhtml-006.xhtml#style-ruby", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "The" - , Space - , Code - ( "", [], [] ) "epub-ruby-position" - , Space - , Str "property" - ] - , Div - ( "styling-xhtml-006.xhtml#style-410", [ "section", "ctest" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-410" ] - , Space - , Code - ( "", [], [] ) "over" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "-epub-ruby-position" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "over" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Plain - [ RawInline - ( Format "html" ) "" - , Strong - [ Str "Lorem", Space, Str "Ipsum" ] - , Space - , RawInline - ( Format "html" ) "" - , Str "(" - , RawInline - ( Format "html" ) "" - , RawInline - ( Format "html" ) "" - , Str "Lorem" - , Space - , Str "Ipsum" - , RawInline - ( Format "html" ) "" - , RawInline - ( Format "html" ) "" - , Str ")" - , RawInline - ( Format "html" ) "" - , RawInline - ( Format "html" ) "" - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "Ruby" - , Space - , Str "text" - , Space - , Str "is" - , Space - , Str "positioned" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Link - ( "", [], [] ) - [ Str "over" ] - ( "http://www.w3.org/TR/css3-writing-modes/#over", "" ) - , Space - , Str "side" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "ruby" - , Space - , Str "base," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-006.xhtml#style-411", [ "section", "ctest" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-411" ] - , Space - , Code - ( "", [], [] ) "under" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "-epub-ruby-position" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "under" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Plain - [ RawInline - ( Format "html" ) "" - , Strong - [ Str "Lorem", Space, Str "Ipsum" ] - , Space - , RawInline - ( Format "html" ) "" - , Str "(" - , RawInline - ( Format "html" ) "" - , RawInline - ( Format "html" ) "" - , Str "Lorem" - , Space - , Str "Ipsum" - , RawInline - ( Format "html" ) "" - , RawInline - ( Format "html" ) "" - , Str ")" - , RawInline - ( Format "html" ) "" - , RawInline - ( Format "html" ) "" - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "Ruby" - , Space - , Str "text" - , Space - , Str "is" - , Space - , Str "positioned" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Link - ( "", [], [] ) - [ Str "under" ] - ( "http://www.w3.org/TR/css3-writing-modes/#under", "" ) - , Space - , Str "side" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "ruby" - , Space - , Str "base," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] - ] - , Div - ( "styling-xhtml-006.xhtml#style-412", [ "section", "ctest" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Span - ( "", [ "nature" ], [] ) - [ Str "[REQUIRED]" ] - , Space - , Span - ( "", [ "test-id" ], [] ) - [ Str "style-412" ] - , Space - , Code - ( "", [], [] ) "inter-character" - ] - , Para - [ Str "Tests" - , Space - , Str "whether" - , Space - , Str "the" - , Space - , Code - ( "", [], [] ) "-epub-ruby-position" - , Space - , Str "property" - , Space - , Str "set" - , Space - , Str "to" - , Space - , Str "inter-caracter" - , Space - , Str "is" - , Space - , Str "supported." - ] - , Plain - [ RawInline - ( Format "html" ) "" - , Strong - [ Str "Lorem", Space, Str "Ipsum" ] - , Space - , RawInline - ( Format "html" ) "" - , Str "(" - , RawInline - ( Format "html" ) "" - , RawInline - ( Format "html" ) "" - , Str "Lorem" - , Space - , Str "Ipsum" - , RawInline - ( Format "html" ) "" - , RawInline - ( Format "html" ) "" - , Str ")" - , RawInline - ( Format "html" ) "" - , RawInline - ( Format "html" ) "" - ] - , Para - [ Str "If" - , Space - , Str "the" - , Space - , Str "Ruby" - , Space - , Str "text" - , Space - , Str "is" - , Space - , Str "positioned" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "right" - , Space - , Str "side" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "base" - , Space - , Str "text," - , Space - , Str "the" - , Space - , Str "test" - , Space - , Str "passes." - ] ] - ] ] diff --git a/test/epub/wasteland.native b/test/epub/wasteland.native index 17b2a875e..eb0c1d2e7 100644 --- a/test/epub/wasteland.native +++ b/test/epub/wasteland.native @@ -1,3509 +1,3493 @@ [ Para - [ Image ( "", [], [] ) [] ( "wasteland-cover.jpg", "" ) ] -, Para - [ Span ( "wasteland-content.xhtml", [], [] ) [] ] + [ Image ( "" , [] , [] ) [] ( "wasteland-cover.jpg" , "" ) ] +, Para [ Span ( "wasteland-content.xhtml" , [] , [] ) [] ] , Div - ( "wasteland-content.xhtml#frontmatter" - , - [ "section", "frontmatter" ] - , [] - ) [] + ( "wasteland-content.xhtml#frontmatter" + , [ "section" , "frontmatter" ] + , [] + ) + [] , Div - ( "wasteland-content.xhtml#bodymatter" - , - [ "section", "bodymatter" ] - , [] - ) - [ Div - ( "wasteland-content.xhtml#ch1", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "I." - , Space - , Str "THE" - , Space - , Str "BURIAL" - , Space - , Str "OF" - , Space - , Str "THE" - , Space - , Str "DEAD" - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "April" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "cruellest" - , Space - , Str "month," - , Space - , Str "breeding" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Lilacs" - , Space - , Str "out" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "dead" - , Space - , Str "land," - , Space - , Str "mixing" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Memory" - , Space - , Str "and" - , Space - , Str "desire," - , Space - , Str "stirring" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Dull" - , Space - , Str "roots" - , Space - , Str "with" - , Space - , Str "spring" - , Space - , Str "rain." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Winter" - , Space - , Str "kept" - , Space - , Str "us" - , Space - , Str "warm," - , Space - , Str "covering" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Earth" - , Space - , Str "in" - , Space - , Str "forgetful" - , Space - , Str "snow," - , Space - , Str "feeding" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "A" - , Space - , Str "little" - , Space - , Str "life" - , Space - , Str "with" - , Space - , Str "dried" - , Space - , Str "tubers." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Summer" - , Space - , Str "surprised" - , Space - , Str "us," - , Space - , Str "coming" - , Space - , Str "over" - , Space - , Str "the" - , Space - , Str "Starnbergersee" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "With" - , Space - , Str "a" - , Space - , Str "shower" - , Space - , Str "of" - , Space - , Str "rain;" - , Space - , Str "we" - , Space - , Str "stopped" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "colonnade," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "went" - , Space - , Str "on" - , Space - , Str "in" - , Space - , Str "sunlight," - , Space - , Str "into" - , Space - , Str "the" - , Space - , Str "Hofgarten," - , Span - ( "", [ "lnum" ], [] ) - [ Str "10" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "drank" - , Space - , Str "coffee," - , Space - , Str "and" - , Space - , Str "talked" - , Space - , Str "for" - , Space - , Str "an" - , Space - , Str "hour." - ] - ] - , Div - ( "", [], [ ( "lang", "de" ) ] ) - [ Plain - [ Str "Bin" - , Space - , Str "gar" - , Space - , Str "keine" - , Space - , Str "Russin," - , Space - , Str "stamm'" - , Space - , Str "aus" - , Space - , Str "Litauen," - , Space - , Str "echt" - , SoftBreak - , Str "deutsch." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "when" - , Space - , Str "we" - , Space - , Str "were" - , Space - , Str "children," - , Space - , Str "staying" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "archduke's," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "My" - , Space - , Str "cousin's," - , Space - , Str "he" - , Space - , Str "took" - , Space - , Str "me" - , Space - , Str "out" - , Space - , Str "on" - , Space - , Str "a" - , Space - , Str "sled," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "I" - , Space - , Str "was" - , Space - , Str "frightened." - , Space - , Str "He" - , Space - , Str "said," - , Space - , Str "Marie," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Marie," - , Space - , Str "hold" - , Space - , Str "on" - , Space - , Str "tight." - , Space - , Str "And" - , Space - , Str "down" - , Space - , Str "we" - , Space - , Str "went." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "In" - , Space - , Str "the" - , Space - , Str "mountains," - , Space - , Str "there" - , Space - , Str "you" - , Space - , Str "feel" - , Space - , Str "free." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "read," - , Space - , Str "much" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "night," - , Space - , Str "and" - , Space - , Str "go" - , Space - , Str "south" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "winter." - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "What" - , Space - , Str "are" - , Space - , Str "the" - , Space - , Str "roots" - , Space - , Str "that" - , Space - , Str "clutch," - , Space - , Str "what" - , Space - , Str "branches" - , Space - , Str "grow" - ] - ] - , Div - ( "wasteland-content.xhtml#ln20", [], [] ) - [ Plain - [ Str "Out" - , Space - , Str "of" - , Space - , Str "this" - , Space - , Str "stony" - , Space - , Str "rubbish?" - , Space - , Str "Son" - , Space - , Str "of" - , Space - , Str "man," - , Str "" - , Span - ( "", [ "lnum" ], [] ) - [ Str "20" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "You" - , Space - , Str "cannot" - , Space - , Str "say," - , Space - , Str "or" - , Space - , Str "guess," - , Space - , Str "for" - , Space - , Str "you" - , Space - , Str "know" - , Space - , Str "only" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "A" - , Space - , Str "heap" - , Space - , Str "of" - , Space - , Str "broken" - , Space - , Str "images," - , Space - , Str "where" - , Space - , Str "the" - , Space - , Str "sun" - , Space - , Str "beats," - ] - ] - , Div - ( "wasteland-content.xhtml#ln23", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "the" - , Space - , Str "dead" - , Space - , Str "tree" - , Space - , Str "gives" - , Space - , Str "no" - , Space - , Str "shelter," - , Space - , Str "the" - , Space - , Str "cricket" - , Space - , Str "no" - , Space - , Str "relief," - , Str "" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "the" - , Space - , Str "dry" - , Space - , Str "stone" - , Space - , Str "no" - , Space - , Str "sound" - , Space - , Str "of" - , Space - , Str "water." - , Space - , Str "Only" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "There" - , Space - , Str "is" - , Space - , Str "shadow" - , Space - , Str "under" - , Space - , Str "this" - , Space - , Str "red" - , Space - , Str "rock," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "(Come" - , Space - , Str "in" - , Space - , Str "under" - , Space - , Str "the" - , Space - , Str "shadow" - , Space - , Str "of" - , Space - , Str "this" - , Space - , Str "red" - , Space - , Str "rock)," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "I" - , Space - , Str "will" - , Space - , Str "show" - , Space - , Str "you" - , Space - , Str "something" - , Space - , Str "different" - , Space - , Str "from" - , Space - , Str "either" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Your" - , Space - , Str "shadow" - , Space - , Str "at" - , Space - , Str "morning" - , Space - , Str "striding" - , Space - , Str "behind" - , Space - , Str "you" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Or" - , Space - , Str "your" - , Space - , Str "shadow" - , Space - , Str "at" - , Space - , Str "evening" - , Space - , Str "rising" - , Space - , Str "to" - , Space - , Str "meet" - , Space - , Str "you;" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "will" - , Space - , Str "show" - , Space - , Str "you" - , Space - , Str "fear" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "handful" - , Space - , Str "of" - , Space - , Str "dust." - , Span - ( "", [ "lnum" ], [] ) - [ Str "30" ] - ] - ] - , BlockQuote - [ Div - ( "", [], [] ) - [ Div - ( "wasteland-content.xhtml#ln31", [], [] ) - [ Plain - [ Str "Frisch" - , Space - , Str "weht" - , Space - , Str "der" - , Space - , Str "Wind" - , Str "" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Der", Space, Str "Heimat", Space, Str "zu" ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Mein", Space, Str "Irisch", Space, Str "Kind," ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Wo", Space, Str "weilest", Space, Str "du?" ] - ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"You" - , Space - , Str "gave" - , Space - , Str "me" - , Space - , Str "hyacinths" - , Space - , Str "first" - , Space - , Str "a" - , Space - , Str "year" - , Space - , Str "ago;" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"They" - , Space - , Str "called" - , Space - , Str "me" - , Space - , Str "the" - , Space - , Str "hyacinth" - , Space - , Str "girl.\"" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\8213Yet" - , Space - , Str "when" - , Space - , Str "we" - , Space - , Str "came" - , Space - , Str "back," - , Space - , Str "late," - , Space - , Str "from" - , Space - , Str "the" - , Space - , Str "Hyacinth" - , SoftBreak - , Str "garden," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Your" - , Space - , Str "arms" - , Space - , Str "full," - , Space - , Str "and" - , Space - , Str "your" - , Space - , Str "hair" - , Space - , Str "wet," - , Space - , Str "I" - , Space - , Str "could" - , Space - , Str "not" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Speak," - , Space - , Str "and" - , Space - , Str "my" - , Space - , Str "eyes" - , Space - , Str "failed," - , Space - , Str "I" - , Space - , Str "was" - , Space - , Str "neither" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Living" - , Space - , Str "nor" - , Space - , Str "dead," - , Space - , Str "and" - , Space - , Str "I" - , Space - , Str "knew" - , Space - , Str "nothing," - , Span - ( "", [ "lnum" ], [] ) - [ Str "40" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Looking" - , Space - , Str "into" - , Space - , Str "the" - , Space - , Str "heart" - , Space - , Str "of" - , Space - , Str "light," - , Space - , Str "the" - , Space - , Str "silence." - ] - ] - , Div - ( "wasteland-content.xhtml#ln42", [], [ ( "lang", "de" ) ] ) - [ Plain - [ Emph - [ Str "Od'" - , Space - , Str "und" - , Space - , Str "leer" - , Space - , Str "das" - , Space - , Str "Meer" - ] - , Str "." - , Str "" - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "Madame" - , Space - , Str "Sosostris," - , Space - , Str "famous" - , Space - , Str "clairvoyante," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Had" - , Space - , Str "a" - , Space - , Str "bad" - , Space - , Str "cold," - , Space - , Str "nevertheless" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Is" - , Space - , Str "known" - , Space - , Str "to" - , Space - , Str "be" - , Space - , Str "the" - , Space - , Str "wisest" - , Space - , Str "woman" - , Space - , Str "in" - , Space - , Str "Europe," - ] - ] - , Div - ( "wasteland-content.xhtml#ln46", [], [] ) - [ Plain - [ Str "With" - , Space - , Str "a" - , Space - , Str "wicked" - , Space - , Str "pack" - , Space - , Str "of" - , Space - , Str "cards." - , Space - , Str "Here," - , Space - , Str "said" - , Space - , Str "she," - , Str "" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Is" - , Space - , Str "your" - , Space - , Str "card," - , Space - , Str "the" - , Space - , Str "drowned" - , Space - , Str "Phoenician" - , Space - , Str "Sailor," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "(Those" - , Space - , Str "are" - , Space - , Str "pearls" - , Space - , Str "that" - , Space - , Str "were" - , Space - , Str "his" - , Space - , Str "eyes." - , Space - , Str "Look!)" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Here" - , Space - , Str "is" - , Space - , Str "Belladonna," - , Space - , Str "the" - , Space - , Str "Lady" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "Rocks," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "lady" - , Space - , Str "of" - , Space - , Str "situations." - , Span - ( "", [ "lnum" ], [] ) - [ Str "50" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Here" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "man" - , Space - , Str "with" - , Space - , Str "three" - , Space - , Str "staves," - , Space - , Str "and" - , Space - , Str "here" - , Space - , Str "the" - , Space - , Str "Wheel," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "here" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "one-eyed" - , Space - , Str "merchant," - , Space - , Str "and" - , Space - , Str "this" - , Space - , Str "card," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Which" - , Space - , Str "is" - , Space - , Str "blank," - , Space - , Str "is" - , Space - , Str "something" - , Space - , Str "he" - , Space - , Str "carries" - , Space - , Str "on" - , Space - , Str "his" - , Space - , Str "back," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Which" - , Space - , Str "I" - , Space - , Str "am" - , Space - , Str "forbidden" - , Space - , Str "to" - , Space - , Str "see." - , Space - , Str "I" - , Space - , Str "do" - , Space - , Str "not" - , Space - , Str "find" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "Hanged" - , Space - , Str "Man." - , Space - , Str "Fear" - , Space - , Str "death" - , Space - , Str "by" - , Space - , Str "water." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "see" - , Space - , Str "crowds" - , Space - , Str "of" - , Space - , Str "people," - , Space - , Str "walking" - , Space - , Str "round" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "ring." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Thank" - , Space - , Str "you." - , Space - , Str "If" - , Space - , Str "you" - , Space - , Str "see" - , Space - , Str "dear" - , Space - , Str "Mrs." - , Space - , Str "Equitone," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Tell" - , Space - , Str "her" - , Space - , Str "I" - , Space - , Str "bring" - , Space - , Str "the" - , Space - , Str "horoscope" - , Space - , Str "myself:" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "One" - , Space - , Str "must" - , Space - , Str "be" - , Space - , Str "so" - , Space - , Str "careful" - , Space - , Str "these" - , Space - , Str "days." - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "wasteland-content.xhtml#ln60", [], [] ) - [ Plain - [ Str "Unreal" - , Space - , Str "City," - , Str "" - , Span - ( "", [ "lnum" ], [] ) - [ Str "60" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Under" - , Space - , Str "the" - , Space - , Str "brown" - , Space - , Str "fog" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "winter" - , Space - , Str "dawn," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "A" - , Space - , Str "crowd" - , Space - , Str "flowed" - , Space - , Str "over" - , Space - , Str "London" - , Space - , Str "Bridge," - , Space - , Str "so" - , Space - , Str "many," - ] - ] - , Div - ( "wasteland-content.xhtml#ln63", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "had" - , Space - , Str "not" - , Space - , Str "thought" - , Space - , Str "death" - , Space - , Str "had" - , Space - , Str "undone" - , Space - , Str "so" - , Space - , Str "many." - , Str "" - ] - ] - , Div - ( "wasteland-content.xhtml#ln64", [], [] ) - [ Plain - [ Str "Sighs," - , Space - , Str "short" - , Space - , Str "and" - , Space - , Str "infrequent," - , Space - , Str "were" - , Space - , Str "exhaled," - , Str "" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "each" - , Space - , Str "man" - , Space - , Str "fixed" - , Space - , Str "his" - , Space - , Str "eyes" - , Space - , Str "before" - , Space - , Str "his" - , Space - , Str "feet." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Flowed" - , Space - , Str "up" - , Space - , Str "the" - , Space - , Str "hill" - , Space - , Str "and" - , Space - , Str "down" - , Space - , Str "King" - , Space - , Str "William" - , Space - , Str "Street," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "To" - , Space - , Str "where" - , Space - , Str "Saint" - , Space - , Str "Mary" - , Space - , Str "Woolnoth" - , Space - , Str "kept" - , Space - , Str "the" - , Space - , Str "hours" - ] - ] - , Div - ( "wasteland-content.xhtml#ln68", [], [] ) - [ Plain - [ Str "With" - , Space - , Str "a" - , Space - , Str "dead" - , Space - , Str "sound" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "final" - , Space - , Str "stroke" - , Space - , Str "of" - , Space - , Str "nine." - , Str "" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "There" - , Space - , Str "I" - , Space - , Str "saw" - , Space - , Str "one" - , Space - , Str "I" - , Space - , Str "knew," - , Space - , Str "and" - , Space - , Str "stopped" - , Space - , Str "him," - , Space - , Str "crying" - , SoftBreak - , Str "\"Stetson!" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"You" - , Space - , Str "who" - , Space - , Str "were" - , Space - , Str "with" - , Space - , Str "me" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "ships" - , Space - , Str "at" - , Space - , Str "Mylae!" - , Span - ( "", [ "lnum" ], [] ) - [ Str "70" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"That" - , Space - , Str "corpse" - , Space - , Str "you" - , Space - , Str "planted" - , Space - , Str "last" - , Space - , Str "year" - , Space - , Str "in" - , Space - , Str "your" - , Space - , Str "garden," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"Has" - , Space - , Str "it" - , Space - , Str "begun" - , Space - , Str "to" - , Space - , Str "sprout?" - , Space - , Str "Will" - , Space - , Str "it" - , Space - , Str "bloom" - , Space - , Str "this" - , Space - , Str "year?" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"Or" - , Space - , Str "has" - , Space - , Str "the" - , Space - , Str "sudden" - , Space - , Str "frost" - , Space - , Str "disturbed" - , Space - , Str "its" - , Space - , Str "bed?" - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "wasteland-content.xhtml#ln74", [], [] ) - [ Plain - [ Str "\"Oh" - , Space - , Str "keep" - , Space - , Str "the" - , Space - , Str "Dog" - , Space - , Str "far" - , Space - , Str "hence," - , Space - , Str "that's" - , Space - , Str "friend" - , Space - , Str "to" - , Space - , Str "men," - , Str "" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"Or" - , Space - , Str "with" - , Space - , Str "his" - , Space - , Str "nails" - , Space - , Str "he'll" - , Space - , Str "dig" - , Space - , Str "it" - , Space - , Str "up" - , Space - , Str "again!" - ] - ] - , Div - ( "wasteland-content.xhtml#ln76", [], [] ) - [ Plain - [ Str "\"You!" - , Space - , Span - ( "", [], [ ( "lang", "fr" ) ] ) - [ Str "hypocrite" - , Space - , Str "lecteur!" + ( "wasteland-content.xhtml#bodymatter" + , [ "section" , "bodymatter" ] + , [] + ) + [ Div + ( "wasteland-content.xhtml#ch1" , [ "section" ] , [] ) + [ Header + 2 + ( "" , [] , [] ) + [ Str "I." , Space - , Str "-" + , Str "THE" , Space - , Str "mon" + , Str "BURIAL" , Space - , Str "semblable," + , Str "OF" , Space - , Str "-" - , SoftBreak - , Str "mon" + , Str "THE" , Space - , Str "frere" + , Str "DEAD" + ] + , Div + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "" , [] , [] ) + [ Plain + [ Str "April" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "cruellest" + , Space + , Str "month," + , Space + , Str "breeding" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Lilacs" + , Space + , Str "out" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "dead" + , Space + , Str "land," + , Space + , Str "mixing" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Memory" + , Space + , Str "and" + , Space + , Str "desire," + , Space + , Str "stirring" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Dull" + , Space + , Str "roots" + , Space + , Str "with" + , Space + , Str "spring" + , Space + , Str "rain." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Winter" + , Space + , Str "kept" + , Space + , Str "us" + , Space + , Str "warm," + , Space + , Str "covering" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Earth" + , Space + , Str "in" + , Space + , Str "forgetful" + , Space + , Str "snow," + , Space + , Str "feeding" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "A" + , Space + , Str "little" + , Space + , Str "life" + , Space + , Str "with" + , Space + , Str "dried" + , Space + , Str "tubers." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Summer" + , Space + , Str "surprised" + , Space + , Str "us," + , Space + , Str "coming" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "Starnbergersee" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "With" + , Space + , Str "a" + , Space + , Str "shower" + , Space + , Str "of" + , Space + , Str "rain;" + , Space + , Str "we" + , Space + , Str "stopped" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "colonnade," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "went" + , Space + , Str "on" + , Space + , Str "in" + , Space + , Str "sunlight," + , Space + , Str "into" + , Space + , Str "the" + , Space + , Str "Hofgarten," + , Span ( "" , [ "lnum" ] , [] ) [ Str "10" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "drank" + , Space + , Str "coffee," + , Space + , Str "and" + , Space + , Str "talked" + , Space + , Str "for" + , Space + , Str "an" + , Space + , Str "hour." + ] + ] + , Div + ( "" , [] , [ ( "lang" , "de" ) ] ) + [ Plain + [ Str "Bin" + , Space + , Str "gar" + , Space + , Str "keine" + , Space + , Str "Russin," + , Space + , Str "stamm'" + , Space + , Str "aus" + , Space + , Str "Litauen," + , Space + , Str "echt" + , SoftBreak + , Str "deutsch." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "when" + , Space + , Str "we" + , Space + , Str "were" + , Space + , Str "children," + , Space + , Str "staying" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "archduke's," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "My" + , Space + , Str "cousin's," + , Space + , Str "he" + , Space + , Str "took" + , Space + , Str "me" + , Space + , Str "out" + , Space + , Str "on" + , Space + , Str "a" + , Space + , Str "sled," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "I" + , Space + , Str "was" + , Space + , Str "frightened." + , Space + , Str "He" + , Space + , Str "said," + , Space + , Str "Marie," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Marie," + , Space + , Str "hold" + , Space + , Str "on" + , Space + , Str "tight." + , Space + , Str "And" + , Space + , Str "down" + , Space + , Str "we" + , Space + , Str "went." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "In" + , Space + , Str "the" + , Space + , Str "mountains," + , Space + , Str "there" + , Space + , Str "you" + , Space + , Str "feel" + , Space + , Str "free." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "I" + , Space + , Str "read," + , Space + , Str "much" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "night," + , Space + , Str "and" + , Space + , Str "go" + , Space + , Str "south" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "winter." + ] + ] + ] + , Div + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "" , [] , [] ) + [ Plain + [ Str "What" + , Space + , Str "are" + , Space + , Str "the" + , Space + , Str "roots" + , Space + , Str "that" + , Space + , Str "clutch," + , Space + , Str "what" + , Space + , Str "branches" + , Space + , Str "grow" + ] + ] + , Div + ( "wasteland-content.xhtml#ln20" , [] , [] ) + [ Plain + [ Str "Out" + , Space + , Str "of" + , Space + , Str "this" + , Space + , Str "stony" + , Space + , Str "rubbish?" + , Space + , Str "Son" + , Space + , Str "of" + , Space + , Str "man," + , Str "" + , Span ( "" , [ "lnum" ] , [] ) [ Str "20" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "You" + , Space + , Str "cannot" + , Space + , Str "say," + , Space + , Str "or" + , Space + , Str "guess," + , Space + , Str "for" + , Space + , Str "you" + , Space + , Str "know" + , Space + , Str "only" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "A" + , Space + , Str "heap" + , Space + , Str "of" + , Space + , Str "broken" + , Space + , Str "images," + , Space + , Str "where" + , Space + , Str "the" + , Space + , Str "sun" + , Space + , Str "beats," + ] + ] + , Div + ( "wasteland-content.xhtml#ln23" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "the" + , Space + , Str "dead" + , Space + , Str "tree" + , Space + , Str "gives" + , Space + , Str "no" + , Space + , Str "shelter," + , Space + , Str "the" + , Space + , Str "cricket" + , Space + , Str "no" + , Space + , Str "relief," + , Str "" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "the" + , Space + , Str "dry" + , Space + , Str "stone" + , Space + , Str "no" + , Space + , Str "sound" + , Space + , Str "of" + , Space + , Str "water." + , Space + , Str "Only" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "There" + , Space + , Str "is" + , Space + , Str "shadow" + , Space + , Str "under" + , Space + , Str "this" + , Space + , Str "red" + , Space + , Str "rock," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "(Come" + , Space + , Str "in" + , Space + , Str "under" + , Space + , Str "the" + , Space + , Str "shadow" + , Space + , Str "of" + , Space + , Str "this" + , Space + , Str "red" + , Space + , Str "rock)," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "I" + , Space + , Str "will" + , Space + , Str "show" + , Space + , Str "you" + , Space + , Str "something" + , Space + , Str "different" + , Space + , Str "from" + , Space + , Str "either" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Your" + , Space + , Str "shadow" + , Space + , Str "at" + , Space + , Str "morning" + , Space + , Str "striding" + , Space + , Str "behind" + , Space + , Str "you" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Or" + , Space + , Str "your" + , Space + , Str "shadow" + , Space + , Str "at" + , Space + , Str "evening" + , Space + , Str "rising" + , Space + , Str "to" + , Space + , Str "meet" + , Space + , Str "you;" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "I" + , Space + , Str "will" + , Space + , Str "show" + , Space + , Str "you" + , Space + , Str "fear" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "handful" + , Space + , Str "of" + , Space + , Str "dust." + , Span ( "" , [ "lnum" ] , [] ) [ Str "30" ] + ] + ] + , BlockQuote + [ Div + ( "" , [] , [] ) + [ Div + ( "wasteland-content.xhtml#ln31" , [] , [] ) + [ Plain + [ Str "Frisch" + , Space + , Str "weht" + , Space + , Str "der" + , Space + , Str "Wind" + , Str "" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Der" + , Space + , Str "Heimat" + , Space + , Str "zu" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Mein" + , Space + , Str "Irisch" + , Space + , Str "Kind," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Wo" + , Space + , Str "weilest" + , Space + , Str "du?" + ] + ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"You" + , Space + , Str "gave" + , Space + , Str "me" + , Space + , Str "hyacinths" + , Space + , Str "first" + , Space + , Str "a" + , Space + , Str "year" + , Space + , Str "ago;" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"They" + , Space + , Str "called" + , Space + , Str "me" + , Space + , Str "the" + , Space + , Str "hyacinth" + , Space + , Str "girl.\"" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\8213Yet" + , Space + , Str "when" + , Space + , Str "we" + , Space + , Str "came" + , Space + , Str "back," + , Space + , Str "late," + , Space + , Str "from" + , Space + , Str "the" + , Space + , Str "Hyacinth" + , SoftBreak + , Str "garden," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Your" + , Space + , Str "arms" + , Space + , Str "full," + , Space + , Str "and" + , Space + , Str "your" + , Space + , Str "hair" + , Space + , Str "wet," + , Space + , Str "I" + , Space + , Str "could" + , Space + , Str "not" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Speak," + , Space + , Str "and" + , Space + , Str "my" + , Space + , Str "eyes" + , Space + , Str "failed," + , Space + , Str "I" + , Space + , Str "was" + , Space + , Str "neither" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Living" + , Space + , Str "nor" + , Space + , Str "dead," + , Space + , Str "and" + , Space + , Str "I" + , Space + , Str "knew" + , Space + , Str "nothing," + , Span ( "" , [ "lnum" ] , [] ) [ Str "40" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Looking" + , Space + , Str "into" + , Space + , Str "the" + , Space + , Str "heart" + , Space + , Str "of" + , Space + , Str "light," + , Space + , Str "the" + , Space + , Str "silence." + ] + ] + , Div + ( "wasteland-content.xhtml#ln42" + , [] + , [ ( "lang" , "de" ) ] + ) + [ Plain + [ Emph + [ Str "Od'" + , Space + , Str "und" + , Space + , Str "leer" + , Space + , Str "das" + , Space + , Str "Meer" + ] + , Str "." + , Str "" + ] + ] + ] + , Div + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "" , [] , [] ) + [ Plain + [ Str "Madame" + , Space + , Str "Sosostris," + , Space + , Str "famous" + , Space + , Str "clairvoyante," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Had" + , Space + , Str "a" + , Space + , Str "bad" + , Space + , Str "cold," + , Space + , Str "nevertheless" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Is" + , Space + , Str "known" + , Space + , Str "to" + , Space + , Str "be" + , Space + , Str "the" + , Space + , Str "wisest" + , Space + , Str "woman" + , Space + , Str "in" + , Space + , Str "Europe," + ] + ] + , Div + ( "wasteland-content.xhtml#ln46" , [] , [] ) + [ Plain + [ Str "With" + , Space + , Str "a" + , Space + , Str "wicked" + , Space + , Str "pack" + , Space + , Str "of" + , Space + , Str "cards." + , Space + , Str "Here," + , Space + , Str "said" + , Space + , Str "she," + , Str "" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Is" + , Space + , Str "your" + , Space + , Str "card," + , Space + , Str "the" + , Space + , Str "drowned" + , Space + , Str "Phoenician" + , Space + , Str "Sailor," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "(Those" + , Space + , Str "are" + , Space + , Str "pearls" + , Space + , Str "that" + , Space + , Str "were" + , Space + , Str "his" + , Space + , Str "eyes." + , Space + , Str "Look!)" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Here" + , Space + , Str "is" + , Space + , Str "Belladonna," + , Space + , Str "the" + , Space + , Str "Lady" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "Rocks," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "The" + , Space + , Str "lady" + , Space + , Str "of" + , Space + , Str "situations." + , Span ( "" , [ "lnum" ] , [] ) [ Str "50" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "man" + , Space + , Str "with" + , Space + , Str "three" + , Space + , Str "staves," + , Space + , Str "and" + , Space + , Str "here" + , Space + , Str "the" + , Space + , Str "Wheel," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "one-eyed" + , Space + , Str "merchant," + , Space + , Str "and" + , Space + , Str "this" + , Space + , Str "card," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Which" + , Space + , Str "is" + , Space + , Str "blank," + , Space + , Str "is" + , Space + , Str "something" + , Space + , Str "he" + , Space + , Str "carries" + , Space + , Str "on" + , Space + , Str "his" + , Space + , Str "back," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Which" + , Space + , Str "I" + , Space + , Str "am" + , Space + , Str "forbidden" + , Space + , Str "to" + , Space + , Str "see." + , Space + , Str "I" + , Space + , Str "do" + , Space + , Str "not" + , Space + , Str "find" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "The" + , Space + , Str "Hanged" + , Space + , Str "Man." + , Space + , Str "Fear" + , Space + , Str "death" + , Space + , Str "by" + , Space + , Str "water." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "I" + , Space + , Str "see" + , Space + , Str "crowds" + , Space + , Str "of" + , Space + , Str "people," + , Space + , Str "walking" + , Space + , Str "round" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "ring." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Thank" + , Space + , Str "you." + , Space + , Str "If" + , Space + , Str "you" + , Space + , Str "see" + , Space + , Str "dear" + , Space + , Str "Mrs." + , Space + , Str "Equitone," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Tell" + , Space + , Str "her" + , Space + , Str "I" + , Space + , Str "bring" + , Space + , Str "the" + , Space + , Str "horoscope" + , Space + , Str "myself:" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "One" + , Space + , Str "must" + , Space + , Str "be" + , Space + , Str "so" + , Space + , Str "careful" + , Space + , Str "these" + , Space + , Str "days." + ] + ] + ] + , Div + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "wasteland-content.xhtml#ln60" , [] , [] ) + [ Plain + [ Str "Unreal" + , Space + , Str "City," + , Str "" + , Span ( "" , [ "lnum" ] , [] ) [ Str "60" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Under" + , Space + , Str "the" + , Space + , Str "brown" + , Space + , Str "fog" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "winter" + , Space + , Str "dawn," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "A" + , Space + , Str "crowd" + , Space + , Str "flowed" + , Space + , Str "over" + , Space + , Str "London" + , Space + , Str "Bridge," + , Space + , Str "so" + , Space + , Str "many," + ] + ] + , Div + ( "wasteland-content.xhtml#ln63" , [] , [] ) + [ Plain + [ Str "I" + , Space + , Str "had" + , Space + , Str "not" + , Space + , Str "thought" + , Space + , Str "death" + , Space + , Str "had" + , Space + , Str "undone" + , Space + , Str "so" + , Space + , Str "many." + , Str "" + ] + ] + , Div + ( "wasteland-content.xhtml#ln64" , [] , [] ) + [ Plain + [ Str "Sighs," + , Space + , Str "short" + , Space + , Str "and" + , Space + , Str "infrequent," + , Space + , Str "were" + , Space + , Str "exhaled," + , Str "" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "each" + , Space + , Str "man" + , Space + , Str "fixed" + , Space + , Str "his" + , Space + , Str "eyes" + , Space + , Str "before" + , Space + , Str "his" + , Space + , Str "feet." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Flowed" + , Space + , Str "up" + , Space + , Str "the" + , Space + , Str "hill" + , Space + , Str "and" + , Space + , Str "down" + , Space + , Str "King" + , Space + , Str "William" + , Space + , Str "Street," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "To" + , Space + , Str "where" + , Space + , Str "Saint" + , Space + , Str "Mary" + , Space + , Str "Woolnoth" + , Space + , Str "kept" + , Space + , Str "the" + , Space + , Str "hours" + ] + ] + , Div + ( "wasteland-content.xhtml#ln68" , [] , [] ) + [ Plain + [ Str "With" + , Space + , Str "a" + , Space + , Str "dead" + , Space + , Str "sound" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "final" + , Space + , Str "stroke" + , Space + , Str "of" + , Space + , Str "nine." + , Str "" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "There" + , Space + , Str "I" + , Space + , Str "saw" + , Space + , Str "one" + , Space + , Str "I" + , Space + , Str "knew," + , Space + , Str "and" + , Space + , Str "stopped" + , Space + , Str "him," + , Space + , Str "crying" + , SoftBreak + , Str "\"Stetson!" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"You" + , Space + , Str "who" + , Space + , Str "were" + , Space + , Str "with" + , Space + , Str "me" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "ships" + , Space + , Str "at" + , Space + , Str "Mylae!" + , Span ( "" , [ "lnum" ] , [] ) [ Str "70" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"That" + , Space + , Str "corpse" + , Space + , Str "you" + , Space + , Str "planted" + , Space + , Str "last" + , Space + , Str "year" + , Space + , Str "in" + , Space + , Str "your" + , Space + , Str "garden," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"Has" + , Space + , Str "it" + , Space + , Str "begun" + , Space + , Str "to" + , Space + , Str "sprout?" + , Space + , Str "Will" + , Space + , Str "it" + , Space + , Str "bloom" + , Space + , Str "this" + , Space + , Str "year?" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"Or" + , Space + , Str "has" + , Space + , Str "the" + , Space + , Str "sudden" + , Space + , Str "frost" + , Space + , Str "disturbed" + , Space + , Str "its" + , Space + , Str "bed?" + ] + ] + ] + , Div + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "wasteland-content.xhtml#ln74" , [] , [] ) + [ Plain + [ Str "\"Oh" + , Space + , Str "keep" + , Space + , Str "the" + , Space + , Str "Dog" + , Space + , Str "far" + , Space + , Str "hence," + , Space + , Str "that's" + , Space + , Str "friend" + , Space + , Str "to" + , Space + , Str "men," + , Str "" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"Or" + , Space + , Str "with" + , Space + , Str "his" + , Space + , Str "nails" + , Space + , Str "he'll" + , Space + , Str "dig" + , Space + , Str "it" + , Space + , Str "up" + , Space + , Str "again!" + ] + ] + , Div + ( "wasteland-content.xhtml#ln76" , [] , [] ) + [ Plain + [ Str "\"You!" + , Space + , Span + ( "" , [] , [ ( "lang" , "fr" ) ] ) + [ Str "hypocrite" + , Space + , Str "lecteur!" + , Space + , Str "-" + , Space + , Str "mon" + , Space + , Str "semblable," + , Space + , Str "-" + , SoftBreak + , Str "mon" + , Space + , Str "frere" + ] + , Space + , Str "!\"" + , Str "" + ] + ] ] - , Space - , Str "!\"" - , Str "" - ] - ] - ] - ] - , Div - ( "wasteland-content.xhtml#ch2", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "II." - , Space - , Str "A" - , Space - , Str "GAME" - , Space - , Str "OF" - , Space - , Str "CHESS" - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "wasteland-content.xhtml#ln77", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "Chair" - , Space - , Str "she" - , Space - , Str "sat" - , Space - , Str "in," - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "burnished" - , Space - , Str "throne," - , Str "" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Glowed" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "marble," - , Space - , Str "where" - , Space - , Str "the" - , Space - , Str "glass" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Held" - , Space - , Str "up" - , Space - , Str "by" - , Space - , Str "standards" - , Space - , Str "wrought" - , Space - , Str "with" - , Space - , Str "fruited" - , Space - , Str "vines" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "From" - , Space - , Str "which" - , Space - , Str "a" - , Space - , Str "golden" - , Space - , Str "Cupidon" - , Space - , Str "peeped" - , Space - , Str "out" - , Span - ( "", [ "lnum" ], [] ) - [ Str "80" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "(Another" - , Space - , Str "hid" - , Space - , Str "his" - , Space - , Str "eyes" - , Space - , Str "behind" - , Space - , Str "his" - , Space - , Str "wing)" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Doubled" - , Space - , Str "the" - , Space - , Str "flames" - , Space - , Str "of" - , Space - , Str "sevenbranched" - , Space - , Str "candelabra" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Reflecting" - , Space - , Str "light" - , Space - , Str "upon" - , Space - , Str "the" - , Space - , Str "table" - , Space - , Str "as" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "glitter" - , Space - , Str "of" - , Space - , Str "her" - , Space - , Str "jewels" - , Space - , Str "rose" - , Space - , Str "to" - , Space - , Str "meet" - , Space - , Str "it," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "From" - , Space - , Str "satin" - , Space - , Str "cases" - , Space - , Str "poured" - , Space - , Str "in" - , Space - , Str "rich" - , Space - , Str "profusion;" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "In" - , Space - , Str "vials" - , Space - , Str "of" - , Space - , Str "ivory" - , Space - , Str "and" - , Space - , Str "coloured" - , Space - , Str "glass" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Unstoppered," - , Space - , Str "lurked" - , Space - , Str "her" - , Space - , Str "strange" - , Space - , Str "synthetic" - , Space - , Str "perfumes," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Unguent," - , Space - , Str "powdered," - , Space - , Str "or" - , Space - , Str "liquid" - , Space - , Str "-" - , Space - , Str "troubled," - , Space - , Str "confused" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "drowned" - , Space - , Str "the" - , Space - , Str "sense" - , Space - , Str "in" - , Space - , Str "odours;" - , Space - , Str "stirred" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "air" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "That" - , Space - , Str "freshened" - , Space - , Str "from" - , Space - , Str "the" - , Space - , Str "window," - , Space - , Str "these" - , Space - , Str "ascended" - , Span - ( "", [ "lnum" ], [] ) - [ Str "90" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "In" - , Space - , Str "fattening" - , Space - , Str "the" - , Space - , Str "prolonged" - , Space - , Str "candle-flames," - ] - ] - , Div - ( "wasteland-content.xhtml#ln92", [], [] ) - [ Plain - [ Str "Flung" - , Space - , Str "their" - , Space - , Str "smoke" - , Space - , Str "into" - , Space - , Str "the" - , Space - , Str "laquearia," - , Str "" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Stirring" - , Space - , Str "the" - , Space - , Str "pattern" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "coffered" - , Space - , Str "ceiling." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Huge" - , Space - , Str "sea-wood" - , Space - , Str "fed" - , Space - , Str "with" - , Space - , Str "copper" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Burned" - , Space - , Str "green" - , Space - , Str "and" - , Space - , Str "orange," - , Space - , Str "framed" - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "coloured" - , Space - , Str "stone," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "In" - , Space - , Str "which" - , Space - , Str "sad" - , Space - , Str "light" - , Space - , Str "a" - , Space - , Str "carved" - , Space - , Str "dolphin" - , Space - , Str "swam." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Above" - , Space - , Str "the" - , Space - , Str "antique" - , Space - , Str "mantel" - , Space - , Str "was" - , Space - , Str "displayed" - ] - ] - , Div - ( "wasteland-content.xhtml#ln98", [], [] ) - [ Plain - [ Str "As" - , Space - , Str "though" - , Space - , Str "a" - , Space - , Str "window" - , Space - , Str "gave" - , Space - , Str "upon" - , Space - , Str "the" - , Space - , Str "sylvan" - , Space - , Str "scene" - , Str "" - ] - ] - , Div - ( "wasteland-content.xhtml#ln99", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "change" - , Space - , Str "of" - , Space - , Str "Philomel," - , Space - , Str "by" - , Space - , Str "the" - , Space - , Str "barbarous" - , Space - , Str "king" - , Str "" - ] - ] - , Div - ( "wasteland-content.xhtml#ln100", [], [] ) - [ Plain - [ Str "So" - , Space - , Str "rudely" - , Space - , Str "forced;" - , Space - , Str "yet" - , Space - , Str "there" - , Space - , Str "the" - , Space - , Str "nightingale" - , Str "" - , SoftBreak - , Span - ( "", [ "lnum" ], [] ) - [ Str "100" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Filled" - , Space - , Str "all" - , Space - , Str "the" - , Space - , Str "desert" - , Space - , Str "with" - , Space - , Str "inviolable" - , Space - , Str "voice" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "still" - , Space - , Str "she" - , Space - , Str "cried," - , Space - , Str "and" - , Space - , Str "still" - , Space - , Str "the" - , Space - , Str "world" - , Space - , Str "pursues," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"Jug" - , Space - , Str "Jug\"" - , Space - , Str "to" - , Space - , Str "dirty" - , Space - , Str "ears." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "other" - , Space - , Str "withered" - , Space - , Str "stumps" - , Space - , Str "of" - , Space - , Str "time" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Were" - , Space - , Str "told" - , Space - , Str "upon" - , Space - , Str "the" - , Space - , Str "walls;" - , Space - , Str "staring" - , Space - , Str "forms" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Leaned" - , Space - , Str "out," - , Space - , Str "leaning," - , Space - , Str "hushing" - , Space - , Str "the" - , Space - , Str "room" - , Space - , Str "enclosed." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Footsteps" - , Space - , Str "shuffled" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "stair." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Under" - , Space - , Str "the" - , Space - , Str "firelight," - , Space - , Str "under" - , Space - , Str "the" - , Space - , Str "brush," - , Space - , Str "her" - , Space - , Str "hair" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Spread" - , Space - , Str "out" - , Space - , Str "in" - , Space - , Str "fiery" - , Space - , Str "points" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Glowed" - , Space - , Str "into" - , Space - , Str "words," - , Space - , Str "then" - , Space - , Str "would" - , Space - , Str "be" - , Space - , Str "savagely" - , Space - , Str "still." - , Span - ( "", [ "lnum" ], [] ) - [ Str "110" ] - ] ] - ] , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "\"My" - , Space - , Str "nerves" - , Space - , Str "are" - , Space - , Str "bad" - , Space - , Str "to-night." - , Space - , Str "Yes," + ( "wasteland-content.xhtml#ch2" , [ "section" ] , [] ) + [ Header + 2 + ( "" , [] , [] ) + [ Str "II." , Space - , Str "bad." + , Str "A" , Space - , Str "Stay" + , Str "GAME" , Space - , Str "with" + , Str "OF" , Space - , Str "me." + , Str "CHESS" ] - ] , Div - ( "", [], [] ) - [ Plain - [ Str "\"Speak" - , Space - , Str "to" - , Space - , Str "me." - , Space - , Str "Why" - , Space - , Str "do" - , Space - , Str "you" - , Space - , Str "never" - , Space - , Str "speak." - , Space - , Str "Speak." + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "wasteland-content.xhtml#ln77" , [] , [] ) + [ Plain + [ Str "The" + , Space + , Str "Chair" + , Space + , Str "she" + , Space + , Str "sat" + , Space + , Str "in," + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "burnished" + , Space + , Str "throne," + , Str "" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Glowed" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "marble," + , Space + , Str "where" + , Space + , Str "the" + , Space + , Str "glass" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Held" + , Space + , Str "up" + , Space + , Str "by" + , Space + , Str "standards" + , Space + , Str "wrought" + , Space + , Str "with" + , Space + , Str "fruited" + , Space + , Str "vines" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "From" + , Space + , Str "which" + , Space + , Str "a" + , Space + , Str "golden" + , Space + , Str "Cupidon" + , Space + , Str "peeped" + , Space + , Str "out" + , Span ( "" , [ "lnum" ] , [] ) [ Str "80" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "(Another" + , Space + , Str "hid" + , Space + , Str "his" + , Space + , Str "eyes" + , Space + , Str "behind" + , Space + , Str "his" + , Space + , Str "wing)" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Doubled" + , Space + , Str "the" + , Space + , Str "flames" + , Space + , Str "of" + , Space + , Str "sevenbranched" + , Space + , Str "candelabra" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Reflecting" + , Space + , Str "light" + , Space + , Str "upon" + , Space + , Str "the" + , Space + , Str "table" + , Space + , Str "as" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "The" + , Space + , Str "glitter" + , Space + , Str "of" + , Space + , Str "her" + , Space + , Str "jewels" + , Space + , Str "rose" + , Space + , Str "to" + , Space + , Str "meet" + , Space + , Str "it," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "From" + , Space + , Str "satin" + , Space + , Str "cases" + , Space + , Str "poured" + , Space + , Str "in" + , Space + , Str "rich" + , Space + , Str "profusion;" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "In" + , Space + , Str "vials" + , Space + , Str "of" + , Space + , Str "ivory" + , Space + , Str "and" + , Space + , Str "coloured" + , Space + , Str "glass" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Unstoppered," + , Space + , Str "lurked" + , Space + , Str "her" + , Space + , Str "strange" + , Space + , Str "synthetic" + , Space + , Str "perfumes," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Unguent," + , Space + , Str "powdered," + , Space + , Str "or" + , Space + , Str "liquid" + , Space + , Str "-" + , Space + , Str "troubled," + , Space + , Str "confused" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "drowned" + , Space + , Str "the" + , Space + , Str "sense" + , Space + , Str "in" + , Space + , Str "odours;" + , Space + , Str "stirred" + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "air" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "That" + , Space + , Str "freshened" + , Space + , Str "from" + , Space + , Str "the" + , Space + , Str "window," + , Space + , Str "these" + , Space + , Str "ascended" + , Span ( "" , [ "lnum" ] , [] ) [ Str "90" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "In" + , Space + , Str "fattening" + , Space + , Str "the" + , Space + , Str "prolonged" + , Space + , Str "candle-flames," + ] + ] + , Div + ( "wasteland-content.xhtml#ln92" , [] , [] ) + [ Plain + [ Str "Flung" + , Space + , Str "their" + , Space + , Str "smoke" + , Space + , Str "into" + , Space + , Str "the" + , Space + , Str "laquearia," + , Str "" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Stirring" + , Space + , Str "the" + , Space + , Str "pattern" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "coffered" + , Space + , Str "ceiling." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Huge" + , Space + , Str "sea-wood" + , Space + , Str "fed" + , Space + , Str "with" + , Space + , Str "copper" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Burned" + , Space + , Str "green" + , Space + , Str "and" + , Space + , Str "orange," + , Space + , Str "framed" + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "coloured" + , Space + , Str "stone," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "In" + , Space + , Str "which" + , Space + , Str "sad" + , Space + , Str "light" + , Space + , Str "a" + , Space + , Str "carved" + , Space + , Str "dolphin" + , Space + , Str "swam." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Above" + , Space + , Str "the" + , Space + , Str "antique" + , Space + , Str "mantel" + , Space + , Str "was" + , Space + , Str "displayed" + ] + ] + , Div + ( "wasteland-content.xhtml#ln98" , [] , [] ) + [ Plain + [ Str "As" + , Space + , Str "though" + , Space + , Str "a" + , Space + , Str "window" + , Space + , Str "gave" + , Space + , Str "upon" + , Space + , Str "the" + , Space + , Str "sylvan" + , Space + , Str "scene" + , Str "" + ] + ] + , Div + ( "wasteland-content.xhtml#ln99" , [] , [] ) + [ Plain + [ Str "The" + , Space + , Str "change" + , Space + , Str "of" + , Space + , Str "Philomel," + , Space + , Str "by" + , Space + , Str "the" + , Space + , Str "barbarous" + , Space + , Str "king" + , Str "" + ] + ] + , Div + ( "wasteland-content.xhtml#ln100" , [] , [] ) + [ Plain + [ Str "So" + , Space + , Str "rudely" + , Space + , Str "forced;" + , Space + , Str "yet" + , Space + , Str "there" + , Space + , Str "the" + , Space + , Str "nightingale" + , Str "" + , SoftBreak + , Span ( "" , [ "lnum" ] , [] ) [ Str "100" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Filled" + , Space + , Str "all" + , Space + , Str "the" + , Space + , Str "desert" + , Space + , Str "with" + , Space + , Str "inviolable" + , Space + , Str "voice" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "still" + , Space + , Str "she" + , Space + , Str "cried," + , Space + , Str "and" + , Space + , Str "still" + , Space + , Str "the" + , Space + , Str "world" + , Space + , Str "pursues," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"Jug" + , Space + , Str "Jug\"" + , Space + , Str "to" + , Space + , Str "dirty" + , Space + , Str "ears." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "other" + , Space + , Str "withered" + , Space + , Str "stumps" + , Space + , Str "of" + , Space + , Str "time" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Were" + , Space + , Str "told" + , Space + , Str "upon" + , Space + , Str "the" + , Space + , Str "walls;" + , Space + , Str "staring" + , Space + , Str "forms" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Leaned" + , Space + , Str "out," + , Space + , Str "leaning," + , Space + , Str "hushing" + , Space + , Str "the" + , Space + , Str "room" + , Space + , Str "enclosed." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Footsteps" + , Space + , Str "shuffled" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "stair." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Under" + , Space + , Str "the" + , Space + , Str "firelight," + , Space + , Str "under" + , Space + , Str "the" + , Space + , Str "brush," + , Space + , Str "her" + , Space + , Str "hair" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Spread" + , Space + , Str "out" + , Space + , Str "in" + , Space + , Str "fiery" + , Space + , Str "points" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Glowed" + , Space + , Str "into" + , Space + , Str "words," + , Space + , Str "then" + , Space + , Str "would" + , Space + , Str "be" + , Space + , Str "savagely" + , Space + , Str "still." + , Span ( "" , [ "lnum" ] , [] ) [ Str "110" ] + ] + ] ] - ] , Div - ( "", [], [] ) - [ Plain - [ Str "\"What" - , Space - , Str "are" - , Space - , Str "you" - , Space - , Str "thinking" - , Space - , Str "of?" - , Space - , Str "What" - , Space - , Str "thinking?" - , Space - , Str "What?" + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "" , [] , [] ) + [ Plain + [ Str "\"My" + , Space + , Str "nerves" + , Space + , Str "are" + , Space + , Str "bad" + , Space + , Str "to-night." + , Space + , Str "Yes," + , Space + , Str "bad." + , Space + , Str "Stay" + , Space + , Str "with" + , Space + , Str "me." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"Speak" + , Space + , Str "to" + , Space + , Str "me." + , Space + , Str "Why" + , Space + , Str "do" + , Space + , Str "you" + , Space + , Str "never" + , Space + , Str "speak." + , Space + , Str "Speak." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"What" + , Space + , Str "are" + , Space + , Str "you" + , Space + , Str "thinking" + , Space + , Str "of?" + , Space + , Str "What" + , Space + , Str "thinking?" + , Space + , Str "What?" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"I" + , Space + , Str "never" + , Space + , Str "know" + , Space + , Str "what" + , Space + , Str "you" + , Space + , Str "are" + , Space + , Str "thinking." + , Space + , Str "Think.\"" + ] + ] + ] + , Div + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "wasteland-content.xhtml#ln115" , [] , [] ) + [ Plain + [ Str "I" + , Space + , Str "think" + , Space + , Str "we" + , Space + , Str "are" + , Space + , Str "in" + , Space + , Str "rats'" + , Space + , Str "alley" + , Str "" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Where" + , Space + , Str "the" + , Space + , Str "dead" + , Space + , Str "men" + , Space + , Str "lost" + , Space + , Str "their" + , Space + , Str "bones." + ] + ] + ] ] - ] , Div - ( "", [], [] ) - [ Plain - [ Str "\"I" - , Space - , Str "never" - , Space - , Str "know" - , Space - , Str "what" - , Space - , Str "you" - , Space - , Str "are" - , Space - , Str "thinking." - , Space - , Str "Think.\"" + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "" , [] , [] ) + [ Plain + [ Str "\"What" + , Space + , Str "is" + , Space + , Str "that" + , Space + , Str "noise?\"" + ] + ] + , Div + ( "wasteland-content.xhtml#ln118" , [ "indent" ] , [] ) + [ Plain + [ Str "The" + , Space + , Str "wind" + , Space + , Str "under" + , Space + , Str "the" + , Space + , Str "door." + , Str "" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"What" + , Space + , Str "is" + , Space + , Str "that" + , Space + , Str "noise" + , Space + , Str "now?" + , Space + , Str "What" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "wind" + , Space + , Str "doing?\"" + ] + ] + , Div + ( "" , [ "indent" ] , [] ) + [ Plain + [ Str "Nothing" + , Space + , Str "again" + , Space + , Str "nothing." + , Span ( "" , [ "lnum" ] , [] ) [ Str "120" ] + ] + ] ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "wasteland-content.xhtml#ln115", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "think" - , Space - , Str "we" - , Space - , Str "are" - , Space - , Str "in" - , Space - , Str "rats'" - , Space - , Str "alley" - , Str "" + , Div + ( "" , [ "linegroup" ] , [] ) + [ Div ( "" , [] , [] ) [ Plain [ Str "\"Do" ] ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"You" + , Space + , Str "know" + , Space + , Str "nothing?" + , Space + , Str "Do" + , Space + , Str "you" + , Space + , Str "see" + , Space + , Str "nothing?" + , Space + , Str "Do" + , Space + , Str "you" + , Space + , Str "remember" + ] + ] + , Div ( "" , [] , [] ) [ Plain [ Str "\"Nothing?\"" ] ] ] - ] , Div - ( "", [], [] ) - [ Plain - [ Str "Where" - , Space - , Str "the" - , Space - , Str "dead" - , Space - , Str "men" - , Space - , Str "lost" - , Space - , Str "their" - , Space - , Str "bones." + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "" , [] , [] ) + [ Plain [ Str "I" , Space , Str "remember" ] ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Those" + , Space + , Str "are" + , Space + , Str "pearls" + , Space + , Str "that" + , Space + , Str "were" + , Space + , Str "his" + , Space + , Str "eyes." + ] + ] + , Div + ( "wasteland-content.xhtml#ln126" , [] , [] ) + [ Plain + [ Str "\"Are" + , Space + , Str "you" + , Space + , Str "alive," + , Space + , Str "or" + , Space + , Str "not?" + , Space + , Str "Is" + , Space + , Str "there" + , Space + , Str "nothing" + , Space + , Str "in" + , Space + , Str "your" + , Space + , Str "head?\"" + , Str "" + ] + ] + , Div ( "" , [] , [] ) [ Plain [ Str "But" ] ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "O" + , Space + , Str "O" + , Space + , Str "O" + , Space + , Str "O" + , Space + , Str "that" + , Space + , Str "Shakespeherian" + , Space + , Str "Rag\8213" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "It's" + , Space + , Str "so" + , Space + , Str "elegant" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "So" + , Space + , Str "intelligent" + , Span ( "" , [ "lnum" ] , [] ) [ Str "130" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"What" + , Space + , Str "shall" + , Space + , Str "I" + , Space + , Str "do" + , Space + , Str "now?" + , Space + , Str "What" + , Space + , Str "shall" + , Space + , Str "I" + , Space + , Str "do?\"" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "I" + , Space + , Str "shall" + , Space + , Str "rush" + , Space + , Str "out" + , Space + , Str "as" + , Space + , Str "I" + , Space + , Str "am," + , Space + , Str "and" + , Space + , Str "walk" + , Space + , Str "the" + , Space + , Str "street" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"With" + , Space + , Str "my" + , Space + , Str "hair" + , Space + , Str "down," + , Space + , Str "so." + , Space + , Str "What" + , Space + , Str "shall" + , Space + , Str "we" + , Space + , Str "do" + , Space + , Str "to-morrow?" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "\"What" + , Space + , Str "shall" + , Space + , Str "we" + , Space + , Str "ever" + , Space + , Str "do?\"" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "The" + , Space + , Str "hot" + , Space + , Str "water" + , Space + , Str "at" + , Space + , Str "ten." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "if" + , Space + , Str "it" + , Space + , Str "rains," + , Space + , Str "a" + , Space + , Str "closed" + , Space + , Str "car" + , Space + , Str "at" + , Space + , Str "four." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "we" + , Space + , Str "shall" + , Space + , Str "play" + , Space + , Str "a" + , Space + , Str "game" + , Space + , Str "of" + , Space + , Str "chess," + ] + ] + , Div + ( "wasteland-content.xhtml#ln138" , [] , [] ) + [ Plain + [ Str "Pressing" + , Space + , Str "lidless" + , Space + , Str "eyes" + , Space + , Str "and" + , Space + , Str "waiting" + , Space + , Str "for" + , Space + , Str "a" + , Space + , Str "knock" + , Space + , Str "upon" + , Space + , Str "the" + , Space + , Str "door." + , Str "" + ] + ] + ] + , Div + ( "" , [ "linegroup" ] , [] ) + [ Div + ( "" , [] , [] ) + [ Plain + [ Str "When" + , Space + , Str "Lil's" + , Space + , Str "husband" + , Space + , Str "got" + , Space + , Str "demobbed," + , Space + , Str "I" + , Space + , Str "said" + , Space + , Str "-" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "I" + , Space + , Str "didn't" + , Space + , Str "mince" + , Space + , Str "my" + , Space + , Str "words," + , Space + , Str "I" + , Space + , Str "said" + , Space + , Str "to" + , Space + , Str "her" + , Space + , Str "myself," + , Span ( "" , [ "lnum" ] , [] ) [ Str "140" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "HURRY" + , Space + , Str "UP" + , Space + , Str "PLEASE" + , Space + , Str "ITS" + , Space + , Str "TIME" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Now" + , Space + , Str "Albert's" + , Space + , Str "coming" + , Space + , Str "back," + , Space + , Str "make" + , Space + , Str "yourself" + , Space + , Str "a" + , Space + , Str "bit" + , Space + , Str "smart." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "He'll" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "know" + , Space + , Str "what" + , Space + , Str "you" + , Space + , Str "done" + , Space + , Str "with" + , Space + , Str "that" + , Space + , Str "money" + , Space + , Str "he" + , Space + , Str "gave" + , SoftBreak + , Str "you" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "To" + , Space + , Str "get" + , Space + , Str "yourself" + , Space + , Str "some" + , Space + , Str "teeth." + , Space + , Str "He" + , Space + , Str "did," + , Space + , Str "I" + , Space + , Str "was" + , Space + , Str "there." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "You" + , Space + , Str "have" + , Space + , Str "them" + , Space + , Str "all" + , Space + , Str "out," + , Space + , Str "Lil," + , Space + , Str "and" + , Space + , Str "get" + , Space + , Str "a" + , Space + , Str "nice" + , Space + , Str "set," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "He" + , Space + , Str "said," + , Space + , Str "I" + , Space + , Str "swear," + , Space + , Str "I" + , Space + , Str "can't" + , Space + , Str "bear" + , Space + , Str "to" + , Space + , Str "look" + , Space + , Str "at" + , Space + , Str "you." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "no" + , Space + , Str "more" + , Space + , Str "can't" + , Space + , Str "I," + , Space + , Str "I" + , Space + , Str "said," + , Space + , Str "and" + , Space + , Str "think" + , Space + , Str "of" + , Space + , Str "poor" + , Space + , Str "Albert," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "He's" + , Space + , Str "been" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "army" + , Space + , Str "four" + , Space + , Str "years," + , Space + , Str "he" + , Space + , Str "wants" + , Space + , Str "a" + , Space + , Str "good" + , Space + , Str "time," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "if" + , Space + , Str "you" + , Space + , Str "don't" + , Space + , Str "give" + , Space + , Str "it" + , Space + , Str "him," + , Space + , Str "there's" + , Space + , Str "others" + , Space + , Str "will," + , Space + , Str "I" + , SoftBreak + , Str "said." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Oh" + , Space + , Str "is" + , Space + , Str "there," + , Space + , Str "she" + , Space + , Str "said." + , Space + , Str "Something" + , Space + , Str "o'" + , Space + , Str "that," + , Space + , Str "I" + , Space + , Str "said." + , Span ( "" , [ "lnum" ] , [] ) [ Str "150" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Then" + , Space + , Str "I'll" + , Space + , Str "know" + , Space + , Str "who" + , Space + , Str "to" + , Space + , Str "thank," + , Space + , Str "she" + , Space + , Str "said," + , Space + , Str "and" + , Space + , Str "give" + , Space + , Str "me" + , Space + , Str "a" + , Space + , Str "straight" + , SoftBreak + , Str "look." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "HURRY" + , Space + , Str "UP" + , Space + , Str "PLEASE" + , Space + , Str "ITS" + , Space + , Str "TIME" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "If" + , Space + , Str "you" + , Space + , Str "don't" + , Space + , Str "like" + , Space + , Str "it" + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "get" + , Space + , Str "on" + , Space + , Str "with" + , Space + , Str "it," + , Space + , Str "I" + , Space + , Str "said." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Others" + , Space + , Str "can" + , Space + , Str "pick" + , Space + , Str "and" + , Space + , Str "choose" + , Space + , Str "if" + , Space + , Str "you" + , Space + , Str "can't." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "But" + , Space + , Str "if" + , Space + , Str "Albert" + , Space + , Str "makes" + , Space + , Str "off," + , Space + , Str "it" + , Space + , Str "won't" + , Space + , Str "be" + , Space + , Str "for" + , Space + , Str "lack" + , Space + , Str "of" + , SoftBreak + , Str "telling." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "You" + , Space + , Str "ought" + , Space + , Str "to" + , Space + , Str "be" + , Space + , Str "ashamed," + , Space + , Str "I" + , Space + , Str "said," + , Space + , Str "to" + , Space + , Str "look" + , Space + , Str "so" + , Space + , Str "antique." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "(And" + , Space + , Str "her" + , Space + , Str "only" + , Space + , Str "thirty-one.)" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "I" + , Space + , Str "can't" + , Space + , Str "help" + , Space + , Str "it," + , Space + , Str "she" + , Space + , Str "said," + , Space + , Str "pulling" + , Space + , Str "a" + , Space + , Str "long" + , Space + , Str "face," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "It's" + , Space + , Str "them" + , Space + , Str "pills" + , Space + , Str "I" + , Space + , Str "took," + , Space + , Str "to" + , Space + , Str "bring" + , Space + , Str "it" + , Space + , Str "off," + , Space + , Str "she" + , Space + , Str "said." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "(She's" + , Space + , Str "had" + , Space + , Str "five" + , Space + , Str "already," + , Space + , Str "and" + , Space + , Str "nearly" + , Space + , Str "died" + , Space + , Str "of" + , Space + , Str "young" + , Space + , Str "George.)" + , Span ( "" , [ "lnum" ] , [] ) [ Str "160" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "The" + , Space + , Str "chemist" + , Space + , Str "said" + , Space + , Str "it" + , Space + , Str "would" + , Space + , Str "be" + , Space + , Str "all" + , Space + , Str "right," + , Space + , Str "but" + , Space + , Str "I've" + , Space + , Str "never" + , Space + , Str "been" + , Space + , Str "the" + , SoftBreak + , Str "same." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "You" + , Space + , Emph [ Str "are" ] + , Space + , Str "a" + , Space + , Str "proper" + , Space + , Str "fool," + , Space + , Str "I" + , Space + , Str "said." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Well," + , Space + , Str "if" + , Space + , Str "Albert" + , Space + , Str "won't" + , Space + , Str "leave" + , Space + , Str "you" + , Space + , Str "alone," + , Space + , Str "there" + , Space + , Str "it" + , Space + , Str "is," + , Space + , Str "I" + , SoftBreak + , Str "said," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "What" + , Space + , Str "you" + , Space + , Str "get" + , Space + , Str "married" + , Space + , Str "for" + , Space + , Str "if" + , Space + , Str "you" + , Space + , Str "don't" + , Space + , Str "want" + , Space + , Str "children?" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "HURRY" + , Space + , Str "UP" + , Space + , Str "PLEASE" + , Space + , Str "ITS" + , Space + , Str "TIME" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Well," + , Space + , Str "that" + , Space + , Str "Sunday" + , Space + , Str "Albert" + , Space + , Str "was" + , Space + , Str "home," + , Space + , Str "they" + , Space + , Str "had" + , Space + , Str "a" + , Space + , Str "hot" + , SoftBreak + , Str "gammon," + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "And" + , Space + , Str "they" + , Space + , Str "asked" + , Space + , Str "me" + , Space + , Str "in" + , Space + , Str "to" + , Space + , Str "dinner," + , Space + , Str "to" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "beauty" + , Space + , Str "of" + , Space + , Str "it" + , SoftBreak + , Str "hot\8213" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "HURRY" + , Space + , Str "UP" + , Space + , Str "PLEASE" + , Space + , Str "ITS" + , Space + , Str "TIME" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "HURRY" + , Space + , Str "UP" + , Space + , Str "PLEASE" + , Space + , Str "ITS" + , Space + , Str "TIME" + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Goonight" + , Space + , Str "Bill." + , Space + , Str "Goonight" + , Space + , Str "Lou." + , Space + , Str "Goonight" + , Space + , Str "May." + , Space + , Str "Goonight." + , Span ( "" , [ "lnum" ] , [] ) [ Str "170" ] + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Ta" + , Space + , Str "ta." + , Space + , Str "Goonight." + , Space + , Str "Goonight." + ] + ] + , Div + ( "" , [] , [] ) + [ Plain + [ Str "Good" + , Space + , Str "night," + , Space + , Str "ladies," + , Space + , Str "good" + , Space + , Str "night," + , Space + , Str "sweet" + , Space + , Str "ladies," + , Space + , Str "good" + , Space + , Str "night," + , Space + , Str "good" + , SoftBreak + , Str "night." + ] + ] ] - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "\"What" - , Space - , Str "is" - , Space - , Str "that" - , Space - , Str "noise?\"" - ] - ] - , Div - ( "wasteland-content.xhtml#ln118", [ "indent" ], [] ) - [ Plain - [ Str "The" - , Space - , Str "wind" - , Space - , Str "under" - , Space - , Str "the" - , Space - , Str "door." - , Str "" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"What" - , Space - , Str "is" - , Space - , Str "that" - , Space - , Str "noise" - , Space - , Str "now?" - , Space - , Str "What" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "wind" - , Space - , Str "doing?\"" - ] - ] - , Div - ( "", [ "indent" ], [] ) - [ Plain - [ Str "Nothing" - , Space - , Str "again" - , Space - , Str "nothing." - , Span - ( "", [ "lnum" ], [] ) - [ Str "120" ] - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain [ Str "\"Do" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"You" - , Space - , Str "know" - , Space - , Str "nothing?" - , Space - , Str "Do" - , Space - , Str "you" - , Space - , Str "see" - , Space - , Str "nothing?" - , Space - , Str "Do" - , Space - , Str "you" - , Space - , Str "remember" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "\"Nothing?\"" ] ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain [ Str "I", Space, Str "remember" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Those" - , Space - , Str "are" - , Space - , Str "pearls" - , Space - , Str "that" - , Space - , Str "were" - , Space - , Str "his" - , Space - , Str "eyes." - ] - ] - , Div - ( "wasteland-content.xhtml#ln126", [], [] ) - [ Plain - [ Str "\"Are" - , Space - , Str "you" - , Space - , Str "alive," - , Space - , Str "or" - , Space - , Str "not?" - , Space - , Str "Is" - , Space - , Str "there" - , Space - , Str "nothing" - , Space - , Str "in" - , Space - , Str "your" - , Space - , Str "head?\"" - , Str "" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "But" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "O" - , Space - , Str "O" - , Space - , Str "O" - , Space - , Str "O" - , Space - , Str "that" - , Space - , Str "Shakespeherian" - , Space - , Str "Rag\8213" - ] - ] - , Div - ( "", [], [] ) - [ Plain [ Str "It's", Space, Str "so", Space, Str "elegant" ] ] - , Div - ( "", [], [] ) - [ Plain - [ Str "So" - , Space - , Str "intelligent" - , Span - ( "", [ "lnum" ], [] ) - [ Str "130" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"What" - , Space - , Str "shall" - , Space - , Str "I" - , Space - , Str "do" - , Space - , Str "now?" - , Space - , Str "What" - , Space - , Str "shall" - , Space - , Str "I" - , Space - , Str "do?\"" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "shall" - , Space - , Str "rush" - , Space - , Str "out" - , Space - , Str "as" - , Space - , Str "I" - , Space - , Str "am," - , Space - , Str "and" - , Space - , Str "walk" - , Space - , Str "the" - , Space - , Str "street" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"With" - , Space - , Str "my" - , Space - , Str "hair" - , Space - , Str "down," - , Space - , Str "so." - , Space - , Str "What" - , Space - , Str "shall" - , Space - , Str "we" - , Space - , Str "do" - , Space - , Str "to-morrow?" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "\"What" - , Space - , Str "shall" - , Space - , Str "we" - , Space - , Str "ever" - , Space - , Str "do?\"" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "hot" - , Space - , Str "water" - , Space - , Str "at" - , Space - , Str "ten." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "if" - , Space - , Str "it" - , Space - , Str "rains," - , Space - , Str "a" - , Space - , Str "closed" - , Space - , Str "car" - , Space - , Str "at" - , Space - , Str "four." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "we" - , Space - , Str "shall" - , Space - , Str "play" - , Space - , Str "a" - , Space - , Str "game" - , Space - , Str "of" - , Space - , Str "chess," - ] - ] - , Div - ( "wasteland-content.xhtml#ln138", [], [] ) - [ Plain - [ Str "Pressing" - , Space - , Str "lidless" - , Space - , Str "eyes" - , Space - , Str "and" - , Space - , Str "waiting" - , Space - , Str "for" - , Space - , Str "a" - , Space - , Str "knock" - , Space - , Str "upon" - , Space - , Str "the" - , Space - , Str "door." - , Str "" - ] - ] - ] - , Div - ( "", [ "linegroup" ], [] ) - [ Div - ( "", [], [] ) - [ Plain - [ Str "When" - , Space - , Str "Lil's" - , Space - , Str "husband" - , Space - , Str "got" - , Space - , Str "demobbed," - , Space - , Str "I" - , Space - , Str "said" - , Space - , Str "-" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "didn't" - , Space - , Str "mince" - , Space - , Str "my" - , Space - , Str "words," - , Space - , Str "I" - , Space - , Str "said" - , Space - , Str "to" - , Space - , Str "her" - , Space - , Str "myself," - , Span - ( "", [ "lnum" ], [] ) - [ Str "140" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "HURRY" - , Space - , Str "UP" - , Space - , Str "PLEASE" - , Space - , Str "ITS" - , Space - , Str "TIME" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Now" - , Space - , Str "Albert's" - , Space - , Str "coming" - , Space - , Str "back," - , Space - , Str "make" - , Space - , Str "yourself" - , Space - , Str "a" - , Space - , Str "bit" - , Space - , Str "smart." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "He'll" - , Space - , Str "want" - , Space - , Str "to" - , Space - , Str "know" - , Space - , Str "what" - , Space - , Str "you" - , Space - , Str "done" - , Space - , Str "with" - , Space - , Str "that" - , Space - , Str "money" - , Space - , Str "he" - , Space - , Str "gave" - , SoftBreak - , Str "you" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "To" - , Space - , Str "get" - , Space - , Str "yourself" - , Space - , Str "some" - , Space - , Str "teeth." - , Space - , Str "He" - , Space - , Str "did," - , Space - , Str "I" - , Space - , Str "was" - , Space - , Str "there." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "You" - , Space - , Str "have" - , Space - , Str "them" - , Space - , Str "all" - , Space - , Str "out," - , Space - , Str "Lil," - , Space - , Str "and" - , Space - , Str "get" - , Space - , Str "a" - , Space - , Str "nice" - , Space - , Str "set," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "He" - , Space - , Str "said," - , Space - , Str "I" - , Space - , Str "swear," - , Space - , Str "I" - , Space - , Str "can't" - , Space - , Str "bear" - , Space - , Str "to" - , Space - , Str "look" - , Space - , Str "at" - , Space - , Str "you." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "no" - , Space - , Str "more" - , Space - , Str "can't" - , Space - , Str "I," - , Space - , Str "I" - , Space - , Str "said," - , Space - , Str "and" - , Space - , Str "think" - , Space - , Str "of" - , Space - , Str "poor" - , Space - , Str "Albert," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "He's" - , Space - , Str "been" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "army" - , Space - , Str "four" - , Space - , Str "years," - , Space - , Str "he" - , Space - , Str "wants" - , Space - , Str "a" - , Space - , Str "good" - , Space - , Str "time," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "if" - , Space - , Str "you" - , Space - , Str "don't" - , Space - , Str "give" - , Space - , Str "it" - , Space - , Str "him," - , Space - , Str "there's" - , Space - , Str "others" - , Space - , Str "will," - , Space - , Str "I" - , SoftBreak - , Str "said." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Oh" - , Space - , Str "is" - , Space - , Str "there," - , Space - , Str "she" - , Space - , Str "said." - , Space - , Str "Something" - , Space - , Str "o'" - , Space - , Str "that," - , Space - , Str "I" - , Space - , Str "said." - , Span - ( "", [ "lnum" ], [] ) - [ Str "150" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Then" - , Space - , Str "I'll" - , Space - , Str "know" - , Space - , Str "who" - , Space - , Str "to" - , Space - , Str "thank," - , Space - , Str "she" - , Space - , Str "said," - , Space - , Str "and" - , Space - , Str "give" - , Space - , Str "me" - , Space - , Str "a" - , Space - , Str "straight" - , SoftBreak - , Str "look." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "HURRY" - , Space - , Str "UP" - , Space - , Str "PLEASE" - , Space - , Str "ITS" - , Space - , Str "TIME" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "If" - , Space - , Str "you" - , Space - , Str "don't" - , Space - , Str "like" - , Space - , Str "it" - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "get" - , Space - , Str "on" - , Space - , Str "with" - , Space - , Str "it," - , Space - , Str "I" - , Space - , Str "said." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Others" - , Space - , Str "can" - , Space - , Str "pick" - , Space - , Str "and" - , Space - , Str "choose" - , Space - , Str "if" - , Space - , Str "you" - , Space - , Str "can't." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "But" - , Space - , Str "if" - , Space - , Str "Albert" - , Space - , Str "makes" - , Space - , Str "off," - , Space - , Str "it" - , Space - , Str "won't" - , Space - , Str "be" - , Space - , Str "for" - , Space - , Str "lack" - , Space - , Str "of" - , SoftBreak - , Str "telling." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "You" - , Space - , Str "ought" - , Space - , Str "to" - , Space - , Str "be" - , Space - , Str "ashamed," - , Space - , Str "I" - , Space - , Str "said," - , Space - , Str "to" - , Space - , Str "look" - , Space - , Str "so" - , Space - , Str "antique." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "(And" - , Space - , Str "her" - , Space - , Str "only" - , Space - , Str "thirty-one.)" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "I" - , Space - , Str "can't" - , Space - , Str "help" - , Space - , Str "it," - , Space - , Str "she" - , Space - , Str "said," - , Space - , Str "pulling" - , Space - , Str "a" - , Space - , Str "long" - , Space - , Str "face," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "It's" - , Space - , Str "them" - , Space - , Str "pills" - , Space - , Str "I" - , Space - , Str "took," - , Space - , Str "to" - , Space - , Str "bring" - , Space - , Str "it" - , Space - , Str "off," - , Space - , Str "she" - , Space - , Str "said." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "(She's" - , Space - , Str "had" - , Space - , Str "five" - , Space - , Str "already," - , Space - , Str "and" - , Space - , Str "nearly" - , Space - , Str "died" - , Space - , Str "of" - , Space - , Str "young" - , Space - , Str "George.)" - , Span - ( "", [ "lnum" ], [] ) - [ Str "160" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "The" - , Space - , Str "chemist" - , Space - , Str "said" - , Space - , Str "it" - , Space - , Str "would" - , Space - , Str "be" - , Space - , Str "all" - , Space - , Str "right," - , Space - , Str "but" - , Space - , Str "I've" - , Space - , Str "never" - , Space - , Str "been" - , Space - , Str "the" - , SoftBreak - , Str "same." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "You" - , Space - , Emph - [ Str "are" ] - , Space - , Str "a" - , Space - , Str "proper" - , Space - , Str "fool," - , Space - , Str "I" - , Space - , Str "said." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Well," - , Space - , Str "if" - , Space - , Str "Albert" - , Space - , Str "won't" - , Space - , Str "leave" - , Space - , Str "you" - , Space - , Str "alone," - , Space - , Str "there" - , Space - , Str "it" - , Space - , Str "is," - , Space - , Str "I" - , SoftBreak - , Str "said," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "What" - , Space - , Str "you" - , Space - , Str "get" - , Space - , Str "married" - , Space - , Str "for" - , Space - , Str "if" - , Space - , Str "you" - , Space - , Str "don't" - , Space - , Str "want" - , Space - , Str "children?" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "HURRY" - , Space - , Str "UP" - , Space - , Str "PLEASE" - , Space - , Str "ITS" - , Space - , Str "TIME" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Well," - , Space - , Str "that" - , Space - , Str "Sunday" - , Space - , Str "Albert" - , Space - , Str "was" - , Space - , Str "home," - , Space - , Str "they" - , Space - , Str "had" - , Space - , Str "a" - , Space - , Str "hot" - , SoftBreak - , Str "gammon," - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "And" - , Space - , Str "they" - , Space - , Str "asked" - , Space - , Str "me" - , Space - , Str "in" - , Space - , Str "to" - , Space - , Str "dinner," - , Space - , Str "to" - , Space - , Str "get" - , Space - , Str "the" - , Space - , Str "beauty" - , Space - , Str "of" - , Space - , Str "it" - , SoftBreak - , Str "hot\8213" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "HURRY" - , Space - , Str "UP" - , Space - , Str "PLEASE" - , Space - , Str "ITS" - , Space - , Str "TIME" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "HURRY" - , Space - , Str "UP" - , Space - , Str "PLEASE" - , Space - , Str "ITS" - , Space - , Str "TIME" - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Goonight" - , Space - , Str "Bill." - , Space - , Str "Goonight" - , Space - , Str "Lou." - , Space - , Str "Goonight" - , Space - , Str "May." - , Space - , Str "Goonight." - , Span - ( "", [ "lnum" ], [] ) - [ Str "170" ] - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Ta" - , Space - , Str "ta." - , Space - , Str "Goonight." - , Space - , Str "Goonight." - ] - ] - , Div - ( "", [], [] ) - [ Plain - [ Str "Good" - , Space - , Str "night," - , Space - , Str "ladies," - , Space - , Str "good" - , Space - , Str "night," - , Space - , Str "sweet" - , Space - , Str "ladies," - , Space - , Str "good" - , Space - , Str "night," - , Space - , Str "good" - , SoftBreak - , Str "night." - ] ] - ] ] - ] ] diff --git a/test/fb2/reader/emphasis.native b/test/fb2/reader/emphasis.native index 18fa49a8b..a3f4cdeb6 100644 --- a/test/fb2/reader/emphasis.native +++ b/test/fb2/reader/emphasis.native @@ -1,38 +1,35 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Div - ( "", [ "section" ], [] ) - [ Para - [ Str "Plain," - , Space - , Strong - [ Str "strong" ] - , Str "," - , Space - , Emph - [ Str "emphasis" ] - , Str "," - , Space - , Strong - [ Emph [ Str "strong", Space, Str "emphasis" ] ] - , Str "," - , Space - , Emph - [ Strong [ Str "emphasized", Space, Str "strong" ] ] - , Str "." + ( "" , [ "section" ] , [] ) + [ Para + [ Str "Plain," + , Space + , Strong [ Str "strong" ] + , Str "," + , Space + , Emph [ Str "emphasis" ] + , Str "," + , Space + , Strong [ Emph [ Str "strong" , Space , Str "emphasis" ] ] + , Str "," + , Space + , Emph + [ Strong [ Str "emphasized" , Space , Str "strong" ] ] + , Str "." + ] + , Para + [ Str "Strikethrough:" + , Space + , Strikeout [ Str "deleted" ] + ] + , Para + [ Subscript [ Str "Subscript" ] + , Space + , Str "and" + , Space + , Superscript [ Str "superscript" ] + ] + , Para [ Str "Some" , Space , Code ( "" , [] , [] ) "code" ] ] - , Para - [ Str "Strikethrough:", Space, Strikeout [ Str "deleted" ] ] - , Para - [ Subscript - [ Str "Subscript" ] - , Space - , Str "and" - , Space - , Superscript - [ Str "superscript" ] - ] - , Para - [ Str "Some", Space, Code ( "", [], [] ) "code" ] - ] ] diff --git a/test/fb2/reader/epigraph.native b/test/fb2/reader/epigraph.native index 2eaa6da41..eb11c1d79 100644 --- a/test/fb2/reader/epigraph.native +++ b/test/fb2/reader/epigraph.native @@ -1,18 +1,18 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Div - ( "", [ "epigraph" ], [] ) - [ Para [ Str "Body", Space, Str "epigraph" ] ] + ( "" , [ "epigraph" ] , [] ) + [ Para [ Str "Body" , Space , Str "epigraph" ] ] , Div - ( "", [ "section" ], [] ) - [ Div - ( "", [ "epigraph" ], [] ) - [ Para [ Str "Section", Space, Str "epigraph" ] ] - , Div - ( "", [ "section" ], [] ) + ( "" , [ "section" ] , [] ) [ Div - ( "", [ "epigraph" ], [] ) - [ Para [ Str "Subsection", Space, Str "epigraph" ] ] + ( "" , [ "epigraph" ] , [] ) + [ Para [ Str "Section" , Space , Str "epigraph" ] ] + , Div + ( "" , [ "section" ] , [] ) + [ Div + ( "" , [ "epigraph" ] , [] ) + [ Para [ Str "Subsection" , Space , Str "epigraph" ] ] + ] ] - ] ] diff --git a/test/fb2/reader/meta.native b/test/fb2/reader/meta.native index 37d229755..851250296 100644 --- a/test/fb2/reader/meta.native +++ b/test/fb2/reader/meta.native @@ -1,43 +1,48 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "abstract" - , MetaBlocks - [ Para - [ Str "Book", Space, Str "annotation" ] - , Para - [ Str "Second" - , Space - , Str "paragraph" - , Space - , Str "of" - , Space - , Str "book" - , Space - , Str "annotation" - ] + Meta + { unMeta = + fromList + [ ( "abstract" + , MetaBlocks + [ Para [ Str "Book" , Space , Str "annotation" ] + , Para + [ Str "Second" + , Space + , Str "paragraph" + , Space + , Str "of" + , Space + , Str "book" + , Space + , Str "annotation" + ] + ] + ) + , ( "author" + , MetaList + [ MetaInlines + [ Str "First" + , Space + , Str "Middle" + , Space + , Str "Last" + ] + , MetaInlines [ Str "Another" , Space , Str "Author" ] + ] + ) + , ( "date" , MetaInlines [ Str "2018" ] ) + , ( "keywords" + , MetaList + [ MetaString "foo" + , MetaString "bar" + , MetaString "baz" + ] + ) + , ( "title" + , MetaInlines [ Str "Book" , Space , Str "title" ] + ) ] - ) - , - ( "author" - , MetaList - [ MetaInlines - [ Str "First", Space, Str "Middle", Space, Str "Last" ] - , MetaInlines - [ Str "Another", Space, Str "Author" ] - ] - ) - , - ( "date", MetaInlines [ Str "2018" ] ) - , - ( "keywords" - , MetaList - [ MetaString "foo", MetaString "bar", MetaString "baz" ] - ) - , - ( "title", MetaInlines [ Str "Book", Space, Str "title" ] ) - ] } - ) - [ Header 1 ( "", [], [] ) [ Str "Body", Space, Str "title" ] ] + [ Header + 1 ( "" , [] , [] ) [ Str "Body" , Space , Str "title" ] + ] diff --git a/test/fb2/reader/notes.native b/test/fb2/reader/notes.native index 6ff16e701..56fa3873f 100644 --- a/test/fb2/reader/notes.native +++ b/test/fb2/reader/notes.native @@ -1,24 +1,28 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Div - ( "", [ "section" ], [] ) - [ Para - [ Str "Note" - , Space - , Note - [ Para [ Str "Note", Space, Str "contents" ] ] - , Str "." + ( "" , [ "section" ] , [] ) + [ Para + [ Str "Note" + , Space + , Note [ Para [ Str "Note" , Space , Str "contents" ] ] + , Str "." + ] + , Para + [ Str "Second" + , Space + , Str "note" + , Space + , Note + [ Para + [ Str "Second" + , Space + , Str "note" + , Space + , Str "contents." + ] + ] + , Str "." + ] ] - , Para - [ Str "Second" - , Space - , Str "note" - , Space - , Note - [ Para - [ Str "Second", Space, Str "note", Space, Str "contents." ] - ] - , Str "." - ] - ] ] diff --git a/test/fb2/reader/poem.native b/test/fb2/reader/poem.native index a43466b16..2b45347e8 100644 --- a/test/fb2/reader/poem.native +++ b/test/fb2/reader/poem.native @@ -1,26 +1,25 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Div - ( "", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "Poem", Space, Str "title" ] - , Div - ( "", [ "epigraph" ], [] ) - [ Para [ Str "Poem", Space, Str "epigraph" ] ] - , Header 2 - ( "", [ "unnumbered" ], [] ) - [ Str "Subtitle" ] - , Header 2 - ( "", [], [] ) - [ Str "First", Space, Str "stanza", Space, Str "title" ] - , LineBlock - [ [ Str "Verse" ], [ Emph [ Str "More" ], Space, Str "verse" ] ] - , LineBlock - [ [ Str "One", Space, Str "more", Space, Str "stanza" ] ] - , Para - [ Str "Author" ] - , Para - [ Str "April", Space, Str "2018" ] - ] + ( "" , [ "section" ] , [] ) + [ Header + 2 ( "" , [] , [] ) [ Str "Poem" , Space , Str "title" ] + , Div + ( "" , [ "epigraph" ] , [] ) + [ Para [ Str "Poem" , Space , Str "epigraph" ] ] + , Header 2 ( "" , [ "unnumbered" ] , [] ) [ Str "Subtitle" ] + , Header + 2 + ( "" , [] , [] ) + [ Str "First" , Space , Str "stanza" , Space , Str "title" ] + , LineBlock + [ [ Str "Verse" ] + , [ Emph [ Str "More" ] , Space , Str "verse" ] + ] + , LineBlock + [ [ Str "One" , Space , Str "more" , Space , Str "stanza" ] + ] + , Para [ Str "Author" ] + , Para [ Str "April" , Space , Str "2018" ] + ] ] diff --git a/test/fb2/reader/titles.native b/test/fb2/reader/titles.native index f98d0b00c..74669d848 100644 --- a/test/fb2/reader/titles.native +++ b/test/fb2/reader/titles.native @@ -1,33 +1,38 @@ Pandoc - ( Meta { unMeta = fromList [] } ) - [ Header 1 - ( "", [], [] ) - [ Str "Body", Space, Str "title" ] + Meta { unMeta = fromList [] } + [ Header + 1 ( "" , [] , [] ) [ Str "Body" , Space , Str "title" ] , Div - ( "", [ "section" ], [] ) - [ Header 2 - ( "", [], [] ) - [ Str "Section", Space, Str "title" ] - , Div - ( "", [ "section" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Str "Subsection" - , Space - , Str "title" - , LineBreak - , Str "with" - , Space - , Str "multiple" - , Space - , Str "paragraphs" - ] + ( "" , [ "section" ] , [] ) + [ Header + 2 ( "" , [] , [] ) [ Str "Section" , Space , Str "title" ] + , Div + ( "" , [ "section" ] , [] ) + [ Header + 3 + ( "" , [] , [] ) + [ Str "Subsection" + , Space + , Str "title" + , LineBreak + , Str "with" + , Space + , Str "multiple" + , Space + , Str "paragraphs" + ] + ] + , Div + ( "" , [ "section" ] , [] ) + [ Header + 3 + ( "" , [] , [] ) + [ Str "Another" + , Space + , Str "subsection" + , Space + , Str "title" + ] + ] ] - , Div - ( "", [ "section" ], [] ) - [ Header 3 - ( "", [], [] ) - [ Str "Another", Space, Str "subsection", Space, Str "title" ] - ] - ] ] diff --git a/test/haddock-reader.native b/test/haddock-reader.native index 2d61cb0b8..619a52fea 100644 --- a/test/haddock-reader.native +++ b/test/haddock-reader.native @@ -1,432 +1,401 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Para - [ Str "This" - , Space - , Str "file" - , Space - , Str "tests" - , Space - , Str "the" - , Space - , Str "Pandoc" - , Space - , Str "reader" - , Space - , Str "for" - , Space - , Str "Haddock." - , SoftBreak - , Str "We've" - , Space - , Str "borrowed" - , Space - , Str "examples" - , Space - , Str "from" - , Space - , Str "Haddock's" - , Space - , Str "documentation:" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.haskell.org/haddock/doc/html/ch03s08.html" ] - ( "http://www.haskell.org/haddock/doc/html/ch03s08.html" - , "http://www.haskell.org/haddock/doc/html/ch03s08.html" - ) - , Str "." - ] + [ Str "This" + , Space + , Str "file" + , Space + , Str "tests" + , Space + , Str "the" + , Space + , Str "Pandoc" + , Space + , Str "reader" + , Space + , Str "for" + , Space + , Str "Haddock." + , SoftBreak + , Str "We've" + , Space + , Str "borrowed" + , Space + , Str "examples" + , Space + , Str "from" + , Space + , Str "Haddock's" + , Space + , Str "documentation:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.haskell.org/haddock/doc/html/ch03s08.html" + ] + ( "http://www.haskell.org/haddock/doc/html/ch03s08.html" + , "http://www.haskell.org/haddock/doc/html/ch03s08.html" + ) + , Str "." + ] , Para - [ Str "The" - , Space - , Str "following" - , Space - , Str "characters" - , Space - , Str "have" - , Space - , Str "special" - , Space - , Str "meanings" - , Space - , Str "in" - , Space - , Str "Haddock," - , Space - , Str "/," - , Space - , Str "'," - , Space - , Str "`," - , Space - , Str "\"," - , Space - , Str "@," - , Space - , Str "<," - , Space - , Str "so" - , Space - , Str "they" - , Space - , Str "must" - , Space - , Str "be" - , Space - , Str "escaped." - ] + [ Str "The" + , Space + , Str "following" + , Space + , Str "characters" + , Space + , Str "have" + , Space + , Str "special" + , Space + , Str "meanings" + , Space + , Str "in" + , Space + , Str "Haddock," + , Space + , Str "/," + , Space + , Str "'," + , Space + , Str "`," + , Space + , Str "\"," + , Space + , Str "@," + , Space + , Str "<," + , Space + , Str "so" + , Space + , Str "they" + , Space + , Str "must" + , Space + , Str "be" + , Space + , Str "escaped." + ] , Para - [ Str "*" - , Space - , Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "paragraph," - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - , SoftBreak - , Str ">" - , Space - , Str "This" - , Space - , Str "sentence" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "code." - , SoftBreak - , Str ">>>" - , Space - , Str "This" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "an" - , Space - , Str "example." - ] + [ Str "*" + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "paragraph," + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + , SoftBreak + , Str ">" + , Space + , Str "This" + , Space + , Str "sentence" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "code." + , SoftBreak + , Str ">>>" + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "an" + , Space + , Str "example." + ] , Para - [ Str "The" - , Space - , Str "references" - , Space - , Str "\955," - , Space - , Str "\955" - , Space - , Str "and" - , Space - , Str "\955" - , Space - , Str "all" - , Space - , Str "represent" - , Space - , Str "the" - , Space - , Str "lower-case" - , Space - , Str "letter" - , Space - , Str "lambda." - ] + [ Str "The" + , Space + , Str "references" + , Space + , Str "\955," + , Space + , Str "\955" + , Space + , Str "and" + , Space + , Str "\955" + , Space + , Str "all" + , Space + , Str "represent" + , Space + , Str "the" + , Space + , Str "lower-case" + , Space + , Str "letter" + , Space + , Str "lambda." + ] , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "code" - , Space - , Str "block:" - ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "code" + , Space + , Str "block:" + ] , CodeBlock - ( "" - , [] - , [] - ) "map :: (a -> b) -> [a] -> [b]\nmap _ [] = []\nmap f (x:xs) = f x : map f xs" + ( "" , [] , [] ) + "map :: (a -> b) -> [a] -> [b]\nmap _ [] = []\nmap f (x:xs) = f x : map f xs" , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "another" - , Space - , Str "code" - , Space - , Str "block:" - ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "code" + , Space + , Str "block:" + ] , Para - [ Code - ( "", [], [] ) "f x = x + x." - , LineBreak - , Code - ( "", [], [] ) "The @...@ code block " - , Emph - [ Code ( "", [], [] ) "interprets markup normally" ] - , Code - ( "", [], [] ) "." - , Code - ( "", [ "haskell", "module" ], [] ) "Module.Foo" - , Code - ( "", [], [] ) "" - , LineBreak - , Code - ( "", [], [] ) "\"Hello World\"" - ] + [ Code ( "" , [] , [] ) "f x = x + x." + , LineBreak + , Code ( "" , [] , [] ) "The @...@ code block " + , Emph + [ Code ( "" , [] , [] ) "interprets markup normally" ] + , Code ( "" , [] , [] ) "." + , Code ( "" , [ "haskell" , "module" ] , [] ) "Module.Foo" + , Code ( "" , [] , [] ) "" + , LineBreak + , Code ( "" , [] , [] ) "\"Hello World\"" + ] , Para - [ Str "Haddock" - , Space - , Str "supports" - , Space - , Str "REPL" - , Space - , Str "examples:" - ] + [ Str "Haddock" + , Space + , Str "supports" + , Space + , Str "REPL" + , Space + , Str "examples:" + ] , Para - [ Code - ( "", [ "prompt" ], [] ) ">>>" - , Space - , Code - ( "", [ "haskell", "expr" ], [] ) "fib 10" - , LineBreak - , Code - ( "", [ "result" ], [] ) "55" - ] + [ Code ( "" , [ "prompt" ] , [] ) ">>>" + , Space + , Code ( "" , [ "haskell" , "expr" ] , [] ) "fib 10" + , LineBreak + , Code ( "" , [ "result" ] , [] ) "55" + ] , Para - [ Code - ( "", [ "prompt" ], [] ) ">>>" - , Space - , Code - ( "", [ "haskell", "expr" ], [] ) "putStrLn \"foo\\nbar\"" - , LineBreak - , Code - ( "", [ "result" ], [] ) "foo" - , LineBreak - , Code - ( "", [ "result" ], [] ) "bar" - ] + [ Code ( "" , [ "prompt" ] , [] ) ">>>" + , Space + , Code + ( "" , [ "haskell" , "expr" ] , [] ) + "putStrLn \"foo\\nbar\"" + , LineBreak + , Code ( "" , [ "result" ] , [] ) "foo" + , LineBreak + , Code ( "" , [ "result" ] , [] ) "bar" + ] , Para - [ Str "That" - , Space - , Str "was" - , Space - , Emph - [ Str "really", Space, Str "cool" ] - , Str "!" - , SoftBreak - , Str "I" - , Space - , Str "had" - , Space - , Str "no" - , Space - , Str "idea" - , Space - , Code - ( "", [], [] ) "fib 10 = 55" - , Str "." - ] + [ Str "That" + , Space + , Str "was" + , Space + , Emph [ Str "really" , Space , Str "cool" ] + , Str "!" + , SoftBreak + , Str "I" + , Space + , Str "had" + , Space + , Str "no" + , Space + , Str "idea" + , Space + , Code ( "" , [] , [] ) "fib 10 = 55" + , Str "." + ] , Para - [ Str "This" - , Space - , Str "module" - , Space - , Str "defines" - , Space - , Str "the" - , Space - , Str "type" - , Space - , Code - ( "", [ "haskell", "identifier" ], [] ) "T" - , Str "." - , SoftBreak - , Str "The" - , Space - , Str "identifier" - , Space - , Code - ( "", [ "haskell", "identifier" ], [] ) "M.T" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "in" - , Space - , Str "scope" - , SoftBreak - , Str "I" - , Space - , Str "don't" - , Space - , Str "have" - , Space - , Str "to" - , Space - , Str "escape" - , Space - , Str "my" - , Space - , Str "apostrophes;" - , Space - , Str "great," - , Space - , Str "isn't" - , Space - , Str "it?" - , SoftBreak - , Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "reference" - , Space - , Str "to" - , Space - , Str "the" - , Space - , Code - ( "", [ "haskell", "module" ], [] ) "Foo" - , Space - , Str "module." - ] + [ Str "This" + , Space + , Str "module" + , Space + , Str "defines" + , Space + , Str "the" + , Space + , Str "type" + , Space + , Code ( "" , [ "haskell" , "identifier" ] , [] ) "T" + , Str "." + , SoftBreak + , Str "The" + , Space + , Str "identifier" + , Space + , Code ( "" , [ "haskell" , "identifier" ] , [] ) "M.T" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "in" + , Space + , Str "scope" + , SoftBreak + , Str "I" + , Space + , Str "don't" + , Space + , Str "have" + , Space + , Str "to" + , Space + , Str "escape" + , Space + , Str "my" + , Space + , Str "apostrophes;" + , Space + , Str "great," + , Space + , Str "isn't" + , Space + , Str "it?" + , SoftBreak + , Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "reference" + , Space + , Str "to" + , Space + , Str "the" + , Space + , Code ( "" , [ "haskell" , "module" ] , [] ) "Foo" + , Space + , Str "module." + ] , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "bulleted" - , Space - , Str "list:" - ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "bulleted" + , Space + , Str "list:" + ] , BulletList - [ - [ Para [ Str "first", Space, Str "item" ] ] - , - [ Para [ Str "second", Space, Str "item" ] ] - ] + [ [ Para [ Str "first" , Space , Str "item" ] ] + , [ Para [ Str "second" , Space , Str "item" ] ] + ] , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "an" - , Space - , Str "enumerated" - , Space - , Str "list:" - ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "enumerated" + , Space + , Str "list:" + ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "first", Space, Str "item" ] ] - , - [ Para [ Str "second", Space, Str "item" ] ] - ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "first" , Space , Str "item" ] ] + , [ Para [ Str "second" , Space , Str "item" ] ] + ] , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "definition" - , Space - , Str "list:" - ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "definition" + , Space + , Str "list:" + ] , DefinitionList - [ - ( - [ Code ( "", [], [] ) "foo" ] - , - [ - [ Para - [ Str "The" - , Space - , Str "description" - , Space - , Str "of" - , Space - , Code - ( "", [], [] ) "foo" - , Str "." + [ ( [ Code ( "" , [] , [] ) "foo" ] + , [ [ Para + [ Str "The" + , Space + , Str "description" + , Space + , Str "of" + , Space + , Code ( "" , [] , [] ) "foo" + , Str "." + ] ] ] - ] - ) - , - ( - [ Code ( "", [], [] ) "bar" ] - , - [ - [ Para - [ Str "The" - , Space - , Str "description" - , Space - , Str "of" - , Space - , Code - ( "", [], [] ) "bar" - , Str "." + ) + , ( [ Code ( "" , [] , [] ) "bar" ] + , [ [ Para + [ Str "The" + , Space + , Str "description" + , Space + , Str "of" + , Space + , Code ( "" , [] , [] ) "bar" + , Str "." + ] ] ] - ] - ) - ] + ) + ] , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "link:" - , Space - , Link - ( "", [], [] ) - [ Str "http://haskell.org" ] - ( "http://haskell.org", "http://haskell.org" ) - ] + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "link:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://haskell.org" ] + ( "http://haskell.org" , "http://haskell.org" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "Haskell" ] - ( "http://haskell.org", "http://haskell.org" ) - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "fun" - , Space - , Str "language!" - ] + [ Link + ( "" , [] , [] ) + [ Str "Haskell" ] + ( "http://haskell.org" , "http://haskell.org" ) + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "fun" + , Space + , Str "language!" + ] , Para - [ Link - ( "", [], [] ) - [ Str "Click", Space, Str "Here!" ] - ( "http://example.com", "http://example.com" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "Click" , Space , Str "Here!" ] + ( "http://example.com" , "http://example.com" ) + ] ] diff --git a/test/html-reader.native b/test/html-reader.native index 20f45c873..dba1cb85f 100644 --- a/test/html-reader.native +++ b/test/html-reader.native @@ -1,729 +1,601 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "generator", MetaInlines [ Str "pandoc" ] ) - , - ( "title" - , MetaInlines - [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] - ) - ] + Meta + { unMeta = + fromList + [ ( "generator" , MetaInlines [ Str "pandoc" ] ) + , ( "title" + , MetaInlines + [ Str "Pandoc" + , Space + , Str "Test" + , Space + , Str "Suite" + ] + ) + ] } - ) - [ Header 1 - ( "pandoc-test-suite", [ "title" ], [] ) - [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] - , 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 "Most" - , Space - , Str "of" - , Space - , Str "them" - , Space - , Str "are" - , Space - , Str "adapted" - , Space - , Str "from" - , Space - , Str "John" - , Space - , Str "Gruber's" - , Space - , Str "markdown" - , Space - , Str "test" - , Space - , Str "suite." - ] - , HorizontalRule - , Header 1 - ( "headers", [], [] ) - [ Str "Headers" ] - , 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" ] - ( "/url", "" ) - ] - , Header 3 - ( "level-3-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "3" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 4 - ( "level-4", [], [] ) - [ Str "Level", Space, Str "4" ] - , Header 5 - ( "level-5", [], [] ) - [ Str "Level", Space, Str "5" ] - , Header 1 - ( "level-1", [], [] ) - [ Str "Level", Space, Str "1" ] - , Header 2 - ( "level-2-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "2" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 3 - ( "level-3", [], [] ) - [ Str "Level", Space, Str "3" ] - , Para - [ Str "with" - , Space - , Str "no" - , Space - , Str "blank" - , Space - , Str "line" - ] - , Header 2 - ( "level-2", [], [] ) - [ Str "Level", Space, Str "2" ] - , Para - [ Str "with" - , Space - , Str "no" - , Space - , Str "blank" - , Space - , Str "line" - ] - , HorizontalRule - , Header 1 - ( "paragraphs", [], [] ) - [ Str "Paragraphs" ] - , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Str "regular" - , Space - , Str "paragraph." - ] - , Para - [ Str "In" - , Space - , Str "Markdown" - , Space - , Str "1.0.0" - , Space - , Str "and" - , Space - , Str "earlier." - , Space - , Str "Version" - , Space - , Str "8." - , Space - , Str "This" - , Space - , Str "line" - , Space - , Str "turns" - , Space - , Str "into" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - , Space - , Str "Because" - , Space - , Str "a" - , Space - , Str "hard-wrapped" - , Space - , Str "line" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "middle" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "paragraph" - , Space - , Str "looked" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - ] - , Para - [ Str "Here's" - , Space - , Str "one" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "bullet." - , Space - , Str "*" - , Space - , Str "criminey." - ] - , Para - [ Str "There" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "hard" - , Space - , Str "line" - , Space - , Str "break" - , LineBreak - , Str "here." - ] - , HorizontalRule - , Header 1 - ( "block-quotes", [], [] ) - [ Str "Block", Space, Str "Quotes" ] + [ Header + 1 + ( "pandoc-test-suite" , [ "title" ] , [] ) + [ Str "Pandoc" , Space , Str "Test" , Space , Str "Suite" ] , Para - [ Str "E-mail", Space, Str "style:" ] - , BlockQuote - [ Para [ Str "This" , Space , Str "is" , Space , Str "a" , Space - , Str "block" + , Str "set" , Space - , Str "quote." + , Str "of" , Space - , Str "It" + , Str "tests" , Space - , Str "is" + , Str "for" + , Space + , Str "pandoc." + , Space + , Str "Most" , Space - , Str "pretty" + , Str "of" , Space - , Str "short." + , Str "them" + , Space + , Str "are" + , Space + , Str "adapted" + , Space + , Str "from" + , Space + , Str "John" + , Space + , Str "Gruber's" + , Space + , Str "markdown" + , Space + , Str "test" + , Space + , Str "suite." ] - ] - , BlockQuote - [ Para - [ Str "Code" + , HorizontalRule + , Header 1 ( "headers" , [] , [] ) [ Str "Headers" ] + , 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" ] + ( "/url" , "" ) + ] + , Header + 3 + ( "level-3-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 4 ( "level-4" , [] , [] ) [ Str "Level" , Space , Str "4" ] + , Header + 5 ( "level-5" , [] , [] ) [ Str "Level" , Space , Str "5" ] + , Header + 1 ( "level-1" , [] , [] ) [ Str "Level" , Space , Str "1" ] + , Header + 2 + ( "level-2-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 3 ( "level-3" , [] , [] ) [ Str "Level" , Space , Str "3" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Header + 2 ( "level-2" , [] , [] ) [ Str "Level" , Space , Str "2" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , HorizontalRule + , Header 1 ( "paragraphs" , [] , [] ) [ Str "Paragraphs" ] + , Para + [ Str "Here's" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , Space + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + , Space + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" , Space , Str "in" , Space + , Str "the" + , Space + , Str "middle" + , Space + , Str "of" + , Space , Str "a" , Space - , Str "block" + , Str "paragraph" , Space - , Str "quote:" + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + ] + , Para + [ Str "Here's" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , Space + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" + , LineBreak + , Str "here." ] - , CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - , Para - [ Str "A", Space, Str "list:" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "item", Space, Str "one" ] ] - , - [ Plain [ Str "item", Space, Str "two" ] ] - ] - , Para - [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] - , BlockQuote - [ Para [ Str "nested" ] ] - , BlockQuote - [ Para [ Str "nested" ] ] - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "block" - , Space - , Str "quote:" - , Space - , Str "2" - , Space - , Str ">" - , Space - , Str "1." - ] - , Para - [ Str "Box-style:" ] + , HorizontalRule + , Header + 1 + ( "block-quotes" , [] , [] ) + [ Str "Block" , Space , Str "Quotes" ] + , Para [ Str "E-mail" , Space , Str "style:" ] , BlockQuote - [ Para - [ Str "Example:" ] - , CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - ] + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , Space + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] + ] , BlockQuote - [ OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "do", Space, Str "laundry" ] ] - , - [ Plain - [ Str "take" + [ Para + [ Str "Code" , Space - , Str "out" + , Str "in" , Space - , Str "the" + , Str "a" + , Space + , Str "block" , Space - , Str "trash" + , Str "quote:" ] - ] + , CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + , Para [ Str "A" , Space , Str "list:" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "item" , Space , Str "one" ] ] + , [ Plain [ Str "item" , Space , Str "two" ] ] + ] + , Para + [ Str "Nested" + , Space + , Str "block" + , Space + , Str "quotes:" + ] + , BlockQuote [ Para [ Str "nested" ] ] + , BlockQuote [ Para [ Str "nested" ] ] ] - ] , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Str "nested" - , Space - , Str "one:" - ] + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + , Space + , Str "2" + , Space + , Str ">" + , Space + , Str "1." + ] + , Para [ Str "Box-style:" ] , BlockQuote - [ Para - [ Str "Joe", Space, Str "said:" ] - , BlockQuote - [ Para [ Str "Don't", Space, Str "quote", Space, Str "me." ] ] - ] - , Para - [ Str "And" - , Space - , Str "a" - , Space - , Str "following" - , Space - , Str "paragraph." - ] - , HorizontalRule - , Header 1 - ( "inline-quotes", [], [] ) - [ Str "Inline", Space, Str "quotes" ] - , Para - [ Str "Normal" - , Space - , Str "text" - , Space - , Str "but" - , Space - , Str "then" - , Space - , Str "a" - , Space - , Quoted DoubleQuote - [ Span - ( "" - , [] - , - [ - ( "cite" - , "https://www.imdb.com/title/tt0062622/quotes/qt0396921" - ) + [ Para [ Str "Example:" ] + , CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + ] + , BlockQuote + [ OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "do" , Space , Str "laundry" ] ] + , [ Plain + [ Str "take" + , Space + , Str "out" + , Space + , Str "the" + , Space + , Str "trash" + ] + ] ] - ) - [ Str "inline", Space, Str "quote" ] ] - , Str "." - ] , Para - [ Quoted DoubleQuote - [ Str "Missing" + [ Str "Here's" , Space , Str "a" , Space - , Str "cite" - , Space - , Str "attribute" + , Str "nested" , Space - , Str "means" + , Str "one:" + ] + , BlockQuote + [ Para [ Str "Joe" , Space , Str "said:" ] + , BlockQuote + [ Para + [ Str "Don't" , Space , Str "quote" , Space , Str "me." ] + ] + ] + , Para + [ Str "And" , Space - , Str "its" + , Str "a" , Space - , Str "just" + , Str "following" , Space - , Str "normal" + , Str "paragraph." + ] + , HorizontalRule + , Header + 1 + ( "inline-quotes" , [] , [] ) + [ Str "Inline" , Space , Str "quotes" ] + , Para + [ Str "Normal" , Space , Str "text" + , Space + , Str "but" + , Space + , Str "then" + , Space + , Str "a" + , Space + , Quoted + DoubleQuote + [ Span + ( "" + , [] + , [ ( "cite" + , "https://www.imdb.com/title/tt0062622/quotes/qt0396921" + ) + ] + ) + [ Str "inline" , Space , Str "quote" ] + ] + , Str "." ] - ] - , HorizontalRule - , Header 1 - ( "code-blocks", [], [] ) - [ Str "Code", Space, Str "Blocks" ] , Para - [ Str "Code:" ] + [ Quoted + DoubleQuote + [ Str "Missing" + , Space + , Str "a" + , Space + , Str "cite" + , Space + , Str "attribute" + , Space + , Str "means" + , Space + , Str "its" + , Space + , Str "just" + , Space + , Str "normal" + , Space + , Str "text" + ] + ] + , HorizontalRule + , Header + 1 + ( "code-blocks" , [] , [] ) + [ Str "Code" , Space , Str "Blocks" ] + , Para [ Str "Code:" ] , CodeBlock - ( "" - , [] - , [] - ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" - , Para - [ Str "And:" ] + ( "" , [] , [] ) + "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + , Para [ Str "And:" ] , CodeBlock - ( "" - , [] - , [] - ) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + ( "" , [] , [] ) + " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" , HorizontalRule - , Header 1 - ( "lists", [], [] ) - [ Str "Lists" ] - , Header 2 - ( "unordered", [], [] ) - [ Str "Unordered" ] - , Para - [ Str "Asterisks", Space, Str "tight:" ] + , Header 1 ( "lists" , [] , [] ) [ Str "Lists" ] + , Header 2 ( "unordered" , [] , [] ) [ Str "Unordered" ] + , Para [ Str "Asterisks" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "asterisk", Space, Str "1" ] ] - , - [ Plain [ Str "asterisk", Space, Str "2" ] ] - , - [ Plain [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Asterisks", Space, Str "loose:" ] + [ [ Plain [ Str "asterisk" , Space , Str "1" ] ] + , [ Plain [ Str "asterisk" , Space , Str "2" ] ] + , [ Plain [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Asterisks" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "asterisk", Space, Str "1" ] ] - , - [ Para [ Str "asterisk", Space, Str "2" ] ] - , - [ Para [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "tight:" ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "Plus", Space, Str "1" ] ] - , - [ Plain [ Str "Plus", Space, Str "2" ] ] - , - [ Plain [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "loose:" ] + [ [ Plain [ Str "Plus" , Space , Str "1" ] ] + , [ Plain [ Str "Plus" , Space , Str "2" ] ] + , [ Plain [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Plus", Space, Str "1" ] ] - , - [ Para [ Str "Plus", Space, Str "2" ] ] - , - [ Para [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "tight:" ] + [ [ Para [ Str "Plus" , Space , Str "1" ] ] + , [ Para [ Str "Plus" , Space , Str "2" ] ] + , [ Para [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "Minus", Space, Str "1" ] ] - , - [ Plain [ Str "Minus", Space, Str "2" ] ] - , - [ Plain [ Str "Minus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "loose:" ] + [ [ Plain [ Str "Minus" , Space , Str "1" ] ] + , [ Plain [ Str "Minus" , Space , Str "2" ] ] + , [ Plain [ Str "Minus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Minus", Space, Str "1" ] ] - , - [ Para [ Str "Minus", Space, Str "2" ] ] - , - [ Para [ Str "Minus", Space, Str "3" ] ] - ] - , Header 2 - ( "ordered", [], [] ) - [ Str "Ordered" ] - , Para - [ Str "Tight:" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "First" ] ] - , - [ Plain [ Str "Second" ] ] - , - [ Plain [ Str "Third" ] ] - ] - , Para - [ Str "and:" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "One" ] ] - , - [ Plain [ Str "Two" ] ] - , - [ Plain [ Str "Three" ] ] - ] - , Para - [ Str "Loose", Space, Str "using", Space, Str "tabs:" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para [ Str "Second" ] ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "and", Space, Str "using", Space, Str "spaces:" ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] + ] + , Header 2 ( "ordered" , [] , [] ) [ Str "Ordered" ] + , Para [ Str "Tight:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "One" ] ] - , - [ Para [ Str "Two" ] ] - , - [ Para [ Str "Three" ] ] - ] - , Para - [ Str "Multiple", Space, Str "paragraphs:" ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "First" ] ] + , [ Plain [ Str "Second" ] ] + , [ Plain [ Str "Third" ] ] + ] + , Para [ Str "and:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para - [ Str "Item" - , Space - , Str "1," - , Space - , Str "graf" - , Space - , Str "one." - ] - , Para - [ Str "Item" - , Space - , Str "1." - , Space - , Str "graf" - , Space - , Str "two." - , Space - , Str "The" - , Space - , Str "quick" - , Space - , Str "brown" - , Space - , Str "fox" - , Space - , Str "jumped" - , Space - , Str "over" - , Space - , Str "the" - , Space - , Str "lazy" - , Space - , Str "dog's" - , Space - , Str "back." - ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "One" ] ] + , [ Plain [ Str "Two" ] ] + , [ Plain [ Str "Three" ] ] ] - , - [ Para [ Str "Item", Space, Str "2." ] ] - , - [ Para [ Str "Item", Space, Str "3." ] ] - ] , Para - [ Str "List", Space, Str "styles:" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) [] - , OrderedList - ( 1, LowerRoman, DefaultDelim ) [] - , OrderedList - ( 1, LowerRoman, DefaultDelim ) [] + [ Str "Loose" , Space , Str "using" , Space , Str "tabs:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) [] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second" ] ] + , [ Para [ Str "Third" ] ] + ] + , Para + [ Str "and" , Space , Str "using" , Space , Str "spaces:" ] , OrderedList - ( 1, LowerRoman, DefaultDelim ) [] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "One" ] ] + , [ Para [ Str "Two" ] ] + , [ Para [ Str "Three" ] ] + ] + , Para [ Str "Multiple" , Space , Str "paragraphs:" ] , OrderedList - ( 1, LowerRoman, DefaultDelim ) [] - , Header 2 - ( "nested", [], [] ) - [ Str "Nested" ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog's" + , Space + , Str "back." + ] + ] + , [ Para [ Str "Item" , Space , Str "2." ] ] + , [ Para [ Str "Item" , Space , Str "3." ] ] + ] + , Para [ Str "List" , Space , Str "styles:" ] + , OrderedList ( 1 , DefaultStyle , DefaultDelim ) [] + , OrderedList ( 1 , LowerRoman , DefaultDelim ) [] + , OrderedList ( 1 , LowerRoman , DefaultDelim ) [] + , OrderedList ( 1 , DefaultStyle , DefaultDelim ) [] + , OrderedList ( 1 , LowerRoman , DefaultDelim ) [] + , OrderedList ( 1 , LowerRoman , DefaultDelim ) [] + , Header 2 ( "nested" , [] , [] ) [ Str "Nested" ] , BulletList - [ - [ Plain - [ Str "Tab" ] - , BulletList - [ - [ Plain - [ Str "Tab" ] - , BulletList - [ [ Plain [ Str "Tab" ] ] ] - ] + [ [ Plain [ Str "Tab" ] + , BulletList + [ [ Plain [ Str "Tab" ] + , BulletList [ [ Plain [ Str "Tab" ] ] ] + ] + ] ] ] - ] - , Para - [ Str "Here's", Space, Str "another:" ] + , Para [ Str "Here's" , Space , Str "another:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "First" ] ] - , - [ Plain - [ Str "Second:" ] - , BulletList - [ - [ Plain [ Str "Fee" ] ] - , - [ Plain [ Str "Fie" ] ] - , - [ Plain [ Str "Foe" ] ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "First" ] ] + , [ Plain [ Str "Second:" ] + , BulletList + [ [ Plain [ Str "Fee" ] ] + , [ Plain [ Str "Fie" ] ] + , [ Plain [ Str "Foe" ] ] + ] ] + , [ Plain [ Str "Third" ] ] + ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" ] - , - [ Plain [ Str "Third" ] ] - ] - , Para - [ Str "Same" - , Space - , Str "thing" - , Space - , Str "but" - , Space - , Str "with" - , Space - , Str "paragraphs:" - ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Plain [ Str "Fee" ] ] - , - [ Plain [ Str "Fie" ] ] - , - [ Plain [ Str "Foe" ] ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Plain [ Str "Fee" ] ] + , [ Plain [ Str "Fie" ] ] + , [ Plain [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] ] - , - [ Para [ Str "Third" ] ] - ] - , Header 2 - ( "tabs-and-spaces", [], [] ) - [ Str "Tabs", Space, Str "and", Space, Str "spaces" ] + , Header + 2 + ( "tabs-and-spaces" , [] , [] ) + [ Str "Tabs" , Space , Str "and" , Space , Str "spaces" ] , BulletList - [ - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "indented" - , Space - , Str "with" - , Space - , Str "tabs" - ] - ] - , - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "indented" - , Space - , Str "with" - , Space - , Str "spaces" - ] - , BulletList - [ - [ Para + [ [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -735,16 +607,13 @@ Pandoc , Space , Str "tabs" ] - ] - , - [ Para + ] + , [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -756,2610 +625,2660 @@ Pandoc , Space , Str "spaces" ] - ] - ] - ] - ] - , Header 2 - ( "fancy-list-markers", [], [] ) - [ Str "Fancy", Space, Str "list", Space, Str "markers" ] - , OrderedList - ( 2, Decimal, DefaultDelim ) - [ - [ Plain [ Str "begins", Space, Str "with", Space, Str "2" ] ] - , - [ Para - [ Str "and", Space, Str "now", Space, Str "3" ] - , Para - [ Str "with", Space, Str "a", Space, Str "continuation" ] - , OrderedList - ( 4, LowerRoman, DefaultDelim ) - [ - [ Plain - [ Str "sublist" - , Space - , Str "with" - , Space - , Str "roman" - , Space - , Str "numerals," - , Space - , Str "starting" + , BulletList + [ [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + ] + ] + ] + ] + , Header + 2 + ( "fancy-list-markers" , [] , [] ) + [ Str "Fancy" , Space , Str "list" , Space , Str "markers" ] + , OrderedList + ( 2 , Decimal , DefaultDelim ) + [ [ Plain + [ Str "begins" , Space , Str "with" , Space , Str "2" ] + ] + , [ Para [ Str "and" , Space , Str "now" , Space , Str "3" ] + , Para + [ Str "with" , Space - , Str "with" + , Str "a" , Space - , Str "4" + , Str "continuation" ] - ] - , - [ Plain - [ Str "more", Space, Str "items" ] - , OrderedList - ( 1, UpperAlpha, DefaultDelim ) - [ - [ Plain [ Str "a", Space, Str "subsublist" ] ] - , - [ Plain [ Str "a", Space, Str "subsublist" ] ] + , OrderedList + ( 4 , LowerRoman , DefaultDelim ) + [ [ Plain + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , Space + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" + ] + ] + , [ Plain [ Str "more" , Space , Str "items" ] + , OrderedList + ( 1 , UpperAlpha , DefaultDelim ) + [ [ Plain [ Str "a" , Space , Str "subsublist" ] ] + , [ Plain [ Str "a" , Space , Str "subsublist" ] ] + ] + ] ] - ] ] ] - ] - , Para - [ Str "Nesting:" ] + , Para [ Str "Nesting:" ] , OrderedList - ( 1, UpperAlpha, DefaultDelim ) - [ - [ Plain - [ Str "Upper", Space, Str "Alpha" ] - , OrderedList - ( 1, UpperRoman, DefaultDelim ) - [ - [ Plain - [ Str "Upper", Space, Str "Roman." ] - , OrderedList - ( 6, Decimal, DefaultDelim ) - [ - [ Plain - [ Str "Decimal" - , Space - , Str "start" - , Space - , Str "with" - , Space - , Str "6" - ] + ( 1 , UpperAlpha , DefaultDelim ) + [ [ Plain [ Str "Upper" , Space , Str "Alpha" ] + , OrderedList + ( 1 , UpperRoman , DefaultDelim ) + [ [ Plain [ Str "Upper" , Space , Str "Roman." ] , OrderedList - ( 3, LowerAlpha, DefaultDelim ) - [ - [ Plain - [ Str "Lower" - , Space - , Str "alpha" - , Space - , Str "with" - , Space - , Str "paren" + ( 6 , Decimal , DefaultDelim ) + [ [ Plain + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3 , LowerAlpha , DefaultDelim ) + [ [ Plain + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] ] ] - ] ] ] - ] ] ] - ] - , Para - [ Str "Autonumbering:" ] + , Para [ Str "Autonumbering:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Autonumber." ] ] - , - [ Plain - [ Str "More." ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Plain [ Str "Nested." ] ] ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Autonumber." ] ] + , [ Plain [ Str "More." ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Nested." ] ] ] + ] ] - ] , HorizontalRule - , Header 2 - ( "definition", [], [] ) - [ Str "Definition" ] + , Header 2 ( "definition" , [] , [] ) [ Str "Definition" ] , DefinitionList - [ - ( - [ Str "Violin" ] - , - [ - [ Plain - [ Str "Stringed" - , Space - , Str "musical" - , Space - , Str "instrument." + [ ( [ Str "Violin" ] + , [ [ Plain + [ Str "Stringed" + , Space + , Str "musical" + , Space + , Str "instrument." + ] ] + , [ Plain [ Str "Torture" , Space , Str "device." ] ] ] - , - [ Plain [ Str "Torture", Space, Str "device." ] ] - ] - ) - , - ( - [ Str "Cello", LineBreak, Str "Violoncello" ] - , - [ - [ Plain - [ Str "Low-voiced" - , Space - , Str "stringed" - , Space - , Str "instrument." + ) + , ( [ Str "Cello" , LineBreak , Str "Violoncello" ] + , [ [ Plain + [ Str "Low-voiced" + , Space + , Str "stringed" + , Space + , Str "instrument." + ] ] ] - ] - ) - ] - , HorizontalRule - , Header 1 - ( "inline-markup", [], [] ) - [ Str "Inline", Space, Str "Markup" ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "emphasized" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Emph - [ Str "is", Space, Str "this" ] - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Strong - [ Str "is", Space, Str "this" ] - , Str "." - ] - , Para - [ Str "Empty" - , Space - , Strong [] - , Space - , Str "and" - , Space - , Emph [] - , Str "." - ] - , Para - [ Str "An" - , Space - , Emph - [ Link - ( "", [], [] ) - [ Str "emphasized", Space, Str "link" ] - ( "/url", "" ) - ] - , Str "." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] - ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] + ) ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "code:" - , Space - , Code - ( "", [], [] ) ">" - , Str "," - , Space - , Code - ( "", [], [] ) "$" - , Str "," - , Space - , Code - ( "", [], [] ) "\\" - , Str "," - , Space - , Code - ( "", [], [] ) "\\$" - , Str "," - , Space - , Code - ( "", [], [] ) "" - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , SmallCaps - [ Str "small", Space, Str "caps" ] - , Str "." - ] - , Para - [ Str "These" - , Space - , Str "are" - , Space - , Str "all" - , Space - , Str "underlined:" - , Space - , Underline - [ Str "foo" ] - , Space - , Str "and" - , Space - , Underline - [ Str "bar" ] - , Str "." - ] - , Para - [ Str "These" - , Space - , Str "are" - , Space - , Str "all" - , Space - , Str "strikethrough:" - , Space - , Strikeout - [ Str "foo" ] - , Str "," - , Space - , Strikeout - [ Str "bar" ] - , Str "," - , Space - , Str "and" - , Space - , Strikeout - [ Str "baz" ] - , Str "." - ] - , HorizontalRule - , Header 1 - ( "smart-quotes-ellipses-dashes", [], [] ) - [ Str "Smart" - , Space - , Str "quotes," - , Space - , Str "ellipses," - , Space - , Str "dashes" - ] - , Para - [ Str "\"Hello,\"" - , Space - , Str "said" - , Space - , Str "the" - , Space - , Str "spider." - , Space - , Str "\"'Shelob'" - , Space - , Str "is" - , Space - , Str "my" - , Space - , Str "name.\"" - ] - , Para - [ Str "'A'," - , Space - , Str "'B'," - , Space - , Str "and" - , Space - , Str "'C'" - , Space - , Str "are" - , Space - , Str "letters." - ] - , Para - [ Str "'Oak,'" - , Space - , Str "'elm,'" - , Space - , Str "and" - , Space - , Str "'beech'" - , Space - , Str "are" - , Space - , Str "names" - , Space - , Str "of" - , Space - , Str "trees." - , Space - , Str "So" - , Space - , Str "is" - , Space - , Str "'pine.'" - ] - , Para - [ Str "'He" - , Space - , Str "said," - , Space - , Str "\"I" - , Space - , Str "want" - , Space - , Str "to" - , Space - , Str "go.\"'" - , Space - , Str "Were" - , Space - , Str "you" - , Space - , Str "alive" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "70's?" - ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "quoted" - , Space - , Str "'" - , Code - ( "", [], [] ) "code" - , Str "'" - , Space - , Str "and" - , Space - , Str "a" - , Space - , Str "\"" - , Link - ( "", [], [] ) - [ Str "quoted", Space, Str "link" ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Str "\"." - ] - , Para - [ Str "Some" - , Space - , Str "dashes:" - , Space - , Str "one---two" - , Space - , Str "---" - , Space - , Str "three--four" - , Space - , Str "--" - , Space - , Str "five." - ] - , Para - [ Str "Dashes" - , Space - , Str "between" - , Space - , Str "numbers:" - , Space - , Str "5-7," - , Space - , Str "255-66," - , Space - , Str "1987-1999." - ] - , Para - [ Str "Ellipses...and." - , Space - , Str "." - , Space - , Str ".and" - , Space - , Str "." - , Space - , Str "." - , Space - , Str "." - , Space - , Str "." - ] , HorizontalRule - , Header 1 - ( "latex", [], [] ) - [ Str "LaTeX" ] - , BulletList - [ - [ Plain [ Str "\\cite[22-23]{smith.1899}" ] ] - , - [ Plain [ Str "\\doublespacing" ] ] - , - [ Plain [ Str "$2+2=4$" ] ] - , - [ Plain [ Str "$x", Space, Str "\\in", Space, Str "y$" ] ] - , - [ Plain - [ Str "$\\alpha", Space, Str "\\wedge", Space, Str "\\omega$" ] - ] - , - [ Plain [ Str "$223$" ] ] - , - [ Plain [ Str "$p$-Tree" ] ] - , - [ Plain - [ Str "$\\frac{d}{dx}f(x)=\\lim_{h\\to" - , Space - , Str "0}\\frac{f(x+h)-f(x)}{h}$" - ] - ] - , - [ Plain - [ Str "Here's" - , Space - , Str "one" - , Space - , Str "that" - , Space - , Str "has" - , Space - , Str "a" - , Space - , Str "line" - , Space - , Str "break" - , Space - , Str "in" - , Space - , Str "it:" - , Space - , Str "$\\alpha" - , Space - , Str "+" - , Space - , Str "\\omega" - , Space - , Str "\\times" - , Space - , Str "x^2$." - ] + , Header + 1 + ( "inline-markup" , [] , [] ) + [ Str "Inline" , Space , Str "Markup" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph [ Str "is" , Space , Str "this" ] + , Str "." ] - ] , Para - [ Str "These" - , Space - , Str "shouldn't" - , Space - , Str "be" - , Space - , Str "math:" - ] - , BulletList - [ - [ Plain - [ Str "To" - , Space - , Str "get" - , Space - , Str "the" - , Space - , Str "famous" - , Space - , Str "equation," - , Space - , Str "write" - , Space - , Code - ( "", [], [] ) "$e = mc^2$" - , Str "." - ] + [ Str "This" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Strong [ Str "is" , Space , Str "this" ] + , Str "." ] - , - [ Plain - [ Str "$22,000" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Emph - [ Str "lot" ] - , Space - , Str "of" - , Space - , Str "money." - , Space - , Str "So" - , Space - , Str "is" - , Space - , Str "$34,000." - , Space - , Str "(It" - , Space - , Str "worked" - , Space - , Str "if" - , Space - , Str "\"lot\"" - , Space - , Str "is" - , Space - , Str "emphasized.)" - ] + , Para + [ Str "Empty" + , Space + , Strong [] + , Space + , Str "and" + , Space + , Emph [] + , Str "." ] - , - [ Plain - [ Str "Escaped" - , Space - , Code - ( "", [], [] ) "$" - , Str ":" - , Space - , Str "$73" - , Space - , Emph - [ Str "this" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "emphasized" + , Para + [ Str "An" + , Space + , Emph + [ Link + ( "" , [] , [] ) + [ Str "emphasized" , Space , Str "link" ] + ( "/url" , "" ) + ] + , Str "." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] ] - , Space - , Str "23$." - ] - ] - ] - , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Str "LaTeX" - , Space - , Str "table:" - ] - , Para - [ Str "\\begin{tabular}{|l|l|}\\hline" - , Space - , Str "Animal" - , Space - , Str "&" - , Space - , Str "Number" - , Space - , Str "\\\\" - , Space - , Str "\\hline" - , Space - , Str "Dog" - , Space - , Str "&" - , Space - , Str "2" - , Space - , Str "\\\\" - , Space - , Str "Cat" - , Space - , Str "&" - , Space - , Str "1" - , Space - , Str "\\\\" - , Space - , Str "\\hline" - , Space - , Str "\\end{tabular}" - ] - , HorizontalRule - , Header 1 - ( "special-characters", [], [] ) - [ Str "Special", Space, Str "Characters" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "unicode:" - ] - , BulletList - [ - [ Plain [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] - , - [ Plain [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] - , - [ Plain [ Str "section:", Space, Str "\167" ] ] - , - [ Plain - [ Str "set", Space, Str "membership:", Space, Str "\8712" ] ] - , - [ Plain [ Str "copyright:", Space, Str "\169" ] ] - ] - , Para - [ Str "AT&T" - , Space - , Str "has" - , Space - , Str "an" - , Space - , Str "ampersand" - , Space - , Str "in" - , Space - , Str "their" - , Space - , Str "name." - ] , Para - [ Str "AT&T" - , Space - , Str "is" - , Space - , Str "another" - , Space - , Str "way" - , Space - , Str "to" - , Space - , Str "write" - , Space - , Str "it." - ] - , Para - [ Str "This", Space, Str "&", Space, Str "that." ] - , Para - [ Str "4", Space, Str "<", Space, Str "5." ] + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] , Para - [ Str "6", Space, Str ">", Space, Str "5." ] + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] , Para - [ Str "Backslash:", Space, Str "\\" ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code ( "" , [] , [] ) ">" + , Str "," + , Space + , Code ( "" , [] , [] ) "$" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\$" + , Str "," + , Space + , Code ( "" , [] , [] ) "" + , Str "." + ] , Para - [ Str "Backtick:", Space, Str "`" ] + [ Str "This" + , Space + , Str "is" + , Space + , SmallCaps [ Str "small" , Space , Str "caps" ] + , Str "." + ] , Para - [ Str "Asterisk:", Space, Str "*" ] + [ Str "These" + , Space + , Str "are" + , Space + , Str "all" + , Space + , Str "underlined:" + , Space + , Underline [ Str "foo" ] + , Space + , Str "and" + , Space + , Underline [ Str "bar" ] + , Str "." + ] , Para - [ Str "Underscore:", Space, Str "_" ] + [ Str "These" + , Space + , Str "are" + , Space + , Str "all" + , Space + , Str "strikethrough:" + , Space + , Strikeout [ Str "foo" ] + , Str "," + , Space + , Strikeout [ Str "bar" ] + , Str "," + , Space + , Str "and" + , Space + , Strikeout [ Str "baz" ] + , Str "." + ] + , HorizontalRule + , Header + 1 + ( "smart-quotes-ellipses-dashes" , [] , [] ) + [ Str "Smart" + , Space + , Str "quotes," + , Space + , Str "ellipses," + , Space + , Str "dashes" + ] , Para - [ Str "Left", Space, Str "brace:", Space, Str "{" ] + [ Str "\"Hello,\"" + , Space + , Str "said" + , Space + , Str "the" + , Space + , Str "spider." + , Space + , Str "\"'Shelob'" + , Space + , Str "is" + , Space + , Str "my" + , Space + , Str "name.\"" + ] , Para - [ Str "Right", Space, Str "brace:", Space, Str "}" ] + [ Str "'A'," + , Space + , Str "'B'," + , Space + , Str "and" + , Space + , Str "'C'" + , Space + , Str "are" + , Space + , Str "letters." + ] , Para - [ Str "Left", Space, Str "bracket:", Space, Str "[" ] + [ Str "'Oak,'" + , Space + , Str "'elm,'" + , Space + , Str "and" + , Space + , Str "'beech'" + , Space + , Str "are" + , Space + , Str "names" + , Space + , Str "of" + , Space + , Str "trees." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "'pine.'" + ] , Para - [ Str "Right", Space, Str "bracket:", Space, Str "]" ] + [ Str "'He" + , Space + , Str "said," + , Space + , Str "\"I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "go.\"'" + , Space + , Str "Were" + , Space + , Str "you" + , Space + , Str "alive" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "70's?" + ] , Para - [ Str "Left", Space, Str "paren:", Space, Str "(" ] + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "quoted" + , Space + , Str "'" + , Code ( "" , [] , [] ) "code" + , Str "'" + , Space + , Str "and" + , Space + , Str "a" + , Space + , Str "\"" + , Link + ( "" , [] , [] ) + [ Str "quoted" , Space , Str "link" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + , Str "\"." + ] , Para - [ Str "Right", Space, Str "paren:", Space, Str ")" ] + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one---two" + , Space + , Str "---" + , Space + , Str "three--four" + , Space + , Str "--" + , Space + , Str "five." + ] , Para - [ Str "Greater-than:", Space, Str ">" ] + [ Str "Dashes" + , Space + , Str "between" + , Space + , Str "numbers:" + , Space + , Str "5-7," + , Space + , Str "255-66," + , Space + , Str "1987-1999." + ] , Para - [ Str "Hash:", Space, Str "#" ] + [ Str "Ellipses...and." + , Space + , Str "." + , Space + , Str ".and" + , Space + , Str "." + , Space + , Str "." + , Space + , Str "." + , Space + , Str "." + ] + , HorizontalRule + , Header 1 ( "latex" , [] , [] ) [ Str "LaTeX" ] + , BulletList + [ [ Plain [ Str "\\cite[22-23]{smith.1899}" ] ] + , [ Plain [ Str "\\doublespacing" ] ] + , [ Plain [ Str "$2+2=4$" ] ] + , [ Plain + [ Str "$x" , Space , Str "\\in" , Space , Str "y$" ] + ] + , [ Plain + [ Str "$\\alpha" + , Space + , Str "\\wedge" + , Space + , Str "\\omega$" + ] + ] + , [ Plain [ Str "$223$" ] ] + , [ Plain [ Str "$p$-Tree" ] ] + , [ Plain + [ Str "$\\frac{d}{dx}f(x)=\\lim_{h\\to" + , Space + , Str "0}\\frac{f(x+h)-f(x)}{h}$" + ] + ] + , [ Plain + [ Str "Here's" + , Space + , Str "one" + , Space + , Str "that" + , Space + , Str "has" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "break" + , Space + , Str "in" + , Space + , Str "it:" + , Space + , Str "$\\alpha" + , Space + , Str "+" + , Space + , Str "\\omega" + , Space + , Str "\\times" + , Space + , Str "x^2$." + ] + ] + ] , Para - [ Str "Period:", Space, Str "." ] + [ Str "These" + , Space + , Str "shouldn't" + , Space + , Str "be" + , Space + , Str "math:" + ] + , BulletList + [ [ Plain + [ Str "To" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "famous" + , Space + , Str "equation," + , Space + , Str "write" + , Space + , Code ( "" , [] , [] ) "$e = mc^2$" + , Str "." + ] + ] + , [ Plain + [ Str "$22,000" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Emph [ Str "lot" ] + , Space + , Str "of" + , Space + , Str "money." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "$34,000." + , Space + , Str "(It" + , Space + , Str "worked" + , Space + , Str "if" + , Space + , Str "\"lot\"" + , Space + , Str "is" + , Space + , Str "emphasized.)" + ] + ] + , [ Plain + [ Str "Escaped" + , Space + , Code ( "" , [] , [] ) "$" + , Str ":" + , Space + , Str "$73" + , Space + , Emph + [ Str "this" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "emphasized" + ] + , Space + , Str "23$." + ] + ] + ] + , Para + [ Str "Here's" + , Space + , Str "a" + , Space + , Str "LaTeX" + , Space + , Str "table:" + ] + , Para + [ Str "\\begin{tabular}{|l|l|}\\hline" + , Space + , Str "Animal" + , Space + , Str "&" + , Space + , Str "Number" + , Space + , Str "\\\\" + , Space + , Str "\\hline" + , Space + , Str "Dog" + , Space + , Str "&" + , Space + , Str "2" + , Space + , Str "\\\\" + , Space + , Str "Cat" + , Space + , Str "&" + , Space + , Str "1" + , Space + , Str "\\\\" + , Space + , Str "\\hline" + , Space + , Str "\\end{tabular}" + ] + , HorizontalRule + , Header + 1 + ( "special-characters" , [] , [] ) + [ Str "Special" , Space , Str "Characters" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "unicode:" + ] + , BulletList + [ [ Plain + [ Str "I" , Space , Str "hat:" , Space , Str "\206" ] + ] + , [ Plain + [ Str "o" , Space , Str "umlaut:" , Space , Str "\246" ] + ] + , [ Plain [ Str "section:" , Space , Str "\167" ] ] + , [ Plain + [ Str "set" + , Space + , Str "membership:" + , Space + , Str "\8712" + ] + ] + , [ Plain [ Str "copyright:" , Space , Str "\169" ] ] + ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] + , Para + [ Str "This" , Space , Str "&" , Space , Str "that." ] + , Para [ Str "4" , Space , Str "<" , Space , Str "5." ] + , Para [ Str "6" , Space , Str ">" , Space , Str "5." ] + , Para [ Str "Backslash:" , Space , Str "\\" ] + , Para [ Str "Backtick:" , Space , Str "`" ] + , Para [ Str "Asterisk:" , Space , Str "*" ] + , Para [ Str "Underscore:" , Space , Str "_" ] + , Para + [ Str "Left" , Space , Str "brace:" , Space , Str "{" ] + , Para + [ Str "Right" , Space , Str "brace:" , Space , Str "}" ] + , Para + [ Str "Left" , Space , Str "bracket:" , Space , Str "[" ] + , Para + [ Str "Right" , Space , Str "bracket:" , Space , Str "]" ] + , Para + [ Str "Left" , Space , Str "paren:" , Space , Str "(" ] + , Para + [ Str "Right" , Space , Str "paren:" , Space , Str ")" ] + , Para [ Str "Greater-than:" , Space , Str ">" ] + , Para [ Str "Hash:" , Space , Str "#" ] + , Para [ Str "Period:" , Space , Str "." ] + , Para [ Str "Bang:" , Space , Str "!" ] + , Para [ Str "Plus:" , Space , Str "+" ] + , Para [ Str "Minus:" , Space , Str "-" ] + , HorizontalRule + , Header 1 ( "links" , [] , [] ) [ Str "Links" ] + , Header 2 ( "explicit" , [] , [] ) [ Str "Explicit" ] + , Para + [ Str "Just" + , Space + , Str "a" + , Space + , Link ( "" , [] , [] ) [ Str "URL" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title preceded by two spaces" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title preceded by a tab" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title with \"quotes\" in it" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title with single quotes" ) + ] + , Para + [ Str "Email" + , Space + , Str "link" + , Space + , Str "(nobody" + , Space + , Str "[at]" + , Space + , Str "nowhere.net)" + ] + , Para + [ Link ( "" , [] , [] ) [ Str "Empty" ] ( "" , "" ) + , Str "." + ] + , Header 2 ( "reference" , [] , [] ) [ Str "Reference" ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "With" + , Space + , Link + ( "" , [] , [] ) + [ Str "embedded" , Space , Str "[brackets]" ] + ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link ( "" , [] , [] ) [ Str "b" ] ( "/url/" , "" ) + , Space + , Str "by" + , Space + , Str "itself" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "once" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "twice" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "thrice" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "[not]" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , CodeBlock ( "" , [] , [] ) "[not]: /url" + , Para + [ Str "Foo" + , Space + , Link + ( "" , [] , [] ) + [ Str "bar" ] + ( "/url/" , "Title with \"quotes\" inside" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link + ( "" , [] , [] ) + [ Str "biz" ] + ( "/url/" , "Title with \"quote\" inside" ) + , Str "." + ] + , Header + 2 + ( "with-ampersands" , [] , [] ) + [ Str "With" , Space , Str "ampersands" ] + , Para + [ Str "Here's" + , Space + , Str "a" + , Space + , Link + ( "" , [] , [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here's" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "amersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "link" + , Space + , Str "text:" + , Space + , Link + ( "" , [] , [] ) + [ Str "AT&T" ] + ( "http://att.com/" , "AT&T" ) + , Str "." + ] + , Para + [ Str "Here's" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Str "inline" , Space , Str "link" ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here's" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Str "inline" + , Space + , Str "link" + , Space + , Str "in" + , Space + , Str "pointy" + , Space + , Str "braces" + ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Header 2 ( "autolinks" , [] , [] ) [ Str "Autolinks" ] + , Para + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + ] + , BulletList + [ [ Plain + [ Str "In" , Space , Str "a" , Space , Str "list?" ] + ] + , [ Plain + [ Link + ( "" , [] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] + ] + , [ Plain [ Str "It" , Space , Str "should." ] ] + ] + , Para + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" + , Space + , Str "nobody" + , Space + , Str "[at]" + , Space + , Str "nowhere.net" + ] + , BlockQuote + [ Para + [ Str "Blockquoted:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] + ] + , Para + [ Str "Auto-links" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "occur" + , Space + , Str "here:" + , Space + , Code ( "" , [] , [] ) "" + ] + , CodeBlock + ( "" , [] , [] ) "or here: " + , HorizontalRule + , Header 1 ( "images" , [] , [] ) [ Str "Images" ] + , Para + [ Str "From" + , Space + , Str "\"Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune\"" + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" + ] + , Para + [ Image + ( "" , [] , [] ) + [ Str "lalune" ] + ( "lalune.jpg" , "Voyage dans la Lune" ) + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space + , Image + ( "" , [] , [] ) [ Str "movie" ] ( "movie.jpg" , "" ) + , Space + , Str "icon." + ] + , HorizontalRule + , Header 1 ( "footnotes" , [] , [] ) [ Str "Footnotes" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference" + , Link ( "" , [] , [] ) [ Str "(1)" ] ( "#note_1" , "" ) + , Str "," + , Space + , Str "and" + , Space + , Str "another" + , Link + ( "" , [] , [] ) + [ Str "(longnote)" ] + ( "#note_longnote" , "" ) + , Str "." + , Space + , Str "This" + , Space + , Str "should" + , Space + , Emph [ Str "not" ] + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Space + , Str "because" + , Space + , Str "it" + , Space + , Str "contains" + , Space + , Str "a" + , Space + , Str "space^(my" + , Space + , Str "note)." + ] + , Para + [ Link ( "" , [] , [] ) [ Str "(1)" ] ( "#ref_1" , "" ) + , Space + , Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "footnote." + , Space + , Str "It" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "anywhere" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "document," + , Space + , Str "not" + , Space + , Str "just" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end." + ] , Para - [ Str "Bang:", Space, Str "!" ] + [ Link + ( "" , [] , [] ) + [ Str "(longnote)" ] + ( "#ref_longnote" , "" ) + , Space + , Str "Here's" + , Space + , Str "the" + , Space + , Str "other" + , Space + , Str "note." + , Space + , Str "This" + , Space + , Str "one" + , Space + , Str "contains" + , Space + , Str "multiple" + , Space + , Str "blocks." + ] , Para - [ Str "Plus:", Space, Str "+" ] + [ Str "Caret" + , Space + , Str "characters" + , Space + , Str "are" + , Space + , Str "used" + , Space + , Str "to" + , Space + , Str "indicate" + , Space + , Str "that" + , Space + , Str "the" + , Space + , Str "blocks" + , Space + , Str "all" + , Space + , Str "belong" + , Space + , Str "to" + , Space + , Str "a" + , Space + , Str "single" + , Space + , Str "footnote" + , Space + , Str "(as" + , Space + , Str "with" + , Space + , Str "block" + , Space + , Str "quotes)." + ] + , CodeBlock ( "" , [] , [] ) " { }" , Para - [ Str "Minus:", Space, Str "-" ] - , HorizontalRule - , Header 1 - ( "links", [], [] ) - [ Str "Links" ] - , Header 2 - ( "explicit", [], [] ) - [ Str "Explicit" ] - , Para - [ Str "Just" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "URL" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title preceded by two spaces" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title preceded by a tab" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title with \"quotes\" in it" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title with single quotes" ) - ] - , Para - [ Str "Email" - , Space - , Str "link" - , Space - , Str "(nobody" - , Space - , Str "[at]" - , Space - , Str "nowhere.net)" - ] - , Para - [ Link ( "", [], [] ) [ Str "Empty" ] ( "", "" ), Str "." ] - , Header 2 - ( "reference", [], [] ) - [ Str "Reference" ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "With" - , Space - , Link - ( "", [], [] ) - [ Str "embedded", Space, Str "[brackets]" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "b" ] - ( "/url/", "" ) - , Space - , Str "by" - , Space - , Str "itself" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "once" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "twice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "thrice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "[not]" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , CodeBlock - ( "", [], [] ) "[not]: /url" - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "Title with \"quotes\" inside" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "biz" ] - ( "/url/", "Title with \"quote\" inside" ) - , Str "." - ] - , Header 2 - ( "with-ampersands", [], [] ) - [ Str "With", Space, Str "ampersands" ] - , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "link" + [ Str "If" + , Space + , Str "you" + , Space + , Str "want," + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "use" + , Space + , Str "a" + , Space + , Str "caret" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "beginning" + , Space + , Str "of" + , Space + , Str "every" + , Space + , Str "line," + , Space + , Str "as" , Space , Str "with" , Space - , Str "an" + , Str "blockquotes," , Space - , Str "ampersand" + , Str "but" , Space - , Str "in" + , Str "all" + , Space + , Str "that" + , Space + , Str "you" + , Space + , Str "need" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "caret" + , Space + , Str "at" , Space , Str "the" , Space - , Str "URL" - ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Str "link" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Str "amersand" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "link" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "AT&T" ] - ( "http://att.com/", "AT&T" ) - , Str "." - ] - , Para - [ Str "Here's" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "inline", Space, Str "link" ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here's" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "inline" + , Str "beginning" , Space - , Str "link" + , Str "of" , Space - , Str "in" + , Str "the" , Space - , Str "pointy" - , Space - , Str "braces" - ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Header 2 - ( "autolinks", [], [] ) - [ Str "Autolinks" ] - , Para - [ Str "With" - , Space - , Str "an" - , Space - , Str "ampersand:" - , Space - , Link - ( "", [], [] ) - [ Str "http://example.com/?foo=1&bar=2" ] - ( "http://example.com/?foo=1&bar=2", "" ) - ] - , BulletList - [ - [ Plain [ Str "In", Space, Str "a", Space, Str "list?" ] ] - , - [ Plain - [ Link - ( "", [], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) - ] - ] - , - [ Plain [ Str "It", Space, Str "should." ] ] - ] - , Para - [ Str "An" - , Space - , Str "e-mail" - , Space - , Str "address:" - , Space - , Str "nobody" - , Space - , Str "[at]" - , Space - , Str "nowhere.net" - ] - , BlockQuote - [ Para - [ Str "Blockquoted:" + , Str "first" , Space - , Link - ( "", [], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) - ] - ] - , Para - [ Str "Auto-links" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "occur" - , Space - , Str "here:" - , Space - , Code - ( "", [], [] ) "" - ] - , CodeBlock - ( "", [], [] ) "or here: " - , HorizontalRule - , Header 1 - ( "images", [], [] ) - [ Str "Images" ] - , Para - [ Str "From" - , Space - , Str "\"Voyage" - , Space - , Str "dans" - , Space - , Str "la" - , Space - , Str "Lune\"" - , Space - , Str "by" - , Space - , Str "Georges" - , Space - , Str "Melies" - , Space - , Str "(1902):" - ] - , Para - [ Image - ( "", [], [] ) - [ Str "lalune" ] - ( "lalune.jpg", "Voyage dans la Lune" ) - ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "movie" - , Space - , Image - ( "", [], [] ) - [ Str "movie" ] - ( "movie.jpg", "" ) - , Space - , Str "icon." - ] - , HorizontalRule - , Header 1 - ( "footnotes", [], [] ) - [ Str "Footnotes" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference" - , Link - ( "", [], [] ) - [ Str "(1)" ] - ( "#note_1", "" ) - , Str "," - , Space - , Str "and" - , Space - , Str "another" - , Link - ( "", [], [] ) - [ Str "(longnote)" ] - ( "#note_longnote", "" ) - , Str "." - , Space - , Str "This" - , Space - , Str "should" - , Space - , Emph - [ Str "not" ] - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference," - , Space - , Str "because" - , Space - , Str "it" - , Space - , Str "contains" - , Space - , Str "a" - , Space - , Str "space^(my" - , Space - , Str "note)." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "(1)" ] - ( "#ref_1", "" ) - , Space - , Str "Here" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "footnote." - , Space - , Str "It" - , Space - , Str "can" - , Space - , Str "go" - , Space - , Str "anywhere" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "document," - , Space - , Str "not" - , Space - , Str "just" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "end." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "(longnote)" ] - ( "#ref_longnote", "" ) - , Space - , Str "Here's" - , Space - , Str "the" - , Space - , Str "other" - , Space - , Str "note." - , Space - , Str "This" - , Space - , Str "one" - , Space - , Str "contains" - , Space - , Str "multiple" - , Space - , Str "blocks." - ] - , Para - [ Str "Caret" - , Space - , Str "characters" - , Space - , Str "are" - , Space - , Str "used" - , Space - , Str "to" - , Space - , Str "indicate" - , Space - , Str "that" - , Space - , Str "the" - , Space - , Str "blocks" - , Space - , Str "all" - , Space - , Str "belong" - , Space - , Str "to" - , Space - , Str "a" - , Space - , Str "single" - , Space - , Str "footnote" - , Space - , Str "(as" - , Space - , Str "with" - , Space - , Str "block" - , Space - , Str "quotes)." - ] - , CodeBlock - ( "", [], [] ) " { }" - , Para - [ Str "If" - , Space - , Str "you" - , Space - , Str "want," - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "use" - , Space - , Str "a" - , Space - , Str "caret" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "beginning" - , Space - , Str "of" - , Space - , Str "every" - , Space - , Str "line," - , Space - , Str "as" - , Space - , Str "with" - , Space - , Str "blockquotes," - , Space - , Str "but" - , Space - , Str "all" - , Space - , Str "that" - , Space - , Str "you" - , Space - , Str "need" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "caret" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "beginning" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "first" - , Space - , Str "line" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "block" - , Space - , Str "and" - , Space - , Str "any" - , Space - , Str "preceding" - , Space - , Str "blank" - , Space - , Str "lines." - ] - , Para - [ Str "text", Space, Emph [ Str "Leading", Space, Str "space" ] ] - , Para - [ Emph [ Str "Trailing", Space, Str "space" ], Space, Str "text" ] - , Para - [ Str "text", Space, Emph [ Str "Leading", Space, Str "spaces" ] ] - , Para - [ Emph [ Str "Trailing", Space, Str "spaces" ], Space, Str "text" ] - , Header 1 - ( "tables", [], [] ) - [ Str "Tables" ] - , Header 2 - ( "tables-with-headers", [], [] ) - [ Str "Tables", Space, Str "with", Space, Str "Headers" ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Z" ] ] - ] + , Str "line" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "block" + , Space + , Str "and" + , Space + , Str "any" + , Space + , Str "preceding" + , Space + , Str "blank" + , Space + , Str "lines." ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + , Para + [ Str "text" + , Space + , Emph [ Str "Leading" , Space , Str "space" ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , HorizontalRule - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Z" ] ] - ] + , Para + [ Emph [ Str "Trailing" , Space , Str "space" ] + , Space + , Str "text" ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + , Para + [ Str "text" + , Space + , Emph [ Str "Leading" , Space , Str "spaces" ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , HorizontalRule , Para - [ Str "Row", Space, Str "headers" ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Z" ] ] - ] + [ Emph [ Str "Trailing" , Space , Str "spaces" ] + , Space + , Str "text" ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 1 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + , Header 1 ( "tables" , [] , [] ) [ Str "Tables" ] + , Header + 2 + ( "tables-with-headers" , [] , [] ) + [ Str "Tables" + , Space + , Str "with" + , Space + , Str "Headers" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , HorizontalRule , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Z" ] ] - ] - ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 1 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - ] - ] - ( TableFoot - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - ) + (TableFoot ( "" , [] , [] ) []) , HorizontalRule , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Z" ] ] - ] - ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - ] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , HorizontalRule + , Para [ Str "Row" , Space , Str "headers" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Z" ] ] - ] - ] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 1) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , HorizontalRule , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Z" ] ] - ] - ] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 1) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ]) , HorizontalRule , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + ] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , HorizontalRule + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Z" ] ] + ] + ] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - , TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , HorizontalRule + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Z" ] ] + ] + ] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , HorizontalRule , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + ] + , TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , HorizontalRule + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + ] + , TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - , TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , Header + 2 + ( "tables-without-headers" , [] , [] ) + [ Str "Tables" + , Space + , Str "without" + , Space + , Str "Headers" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 2 - ( "tables-without-headers", [], [] ) - [ Str "Tables", Space, Str "without", Space, Str "Headers" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , HorizontalRule , Para - [ Str "tbody", Space, Str "tags", Space, Str "omitted" ] + [ Str "tbody" , Space , Str "tags" , Space , Str "omitted" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , HorizontalRule - , Para - [ Str "empty", Space, Str "head" ] + , Para [ Str "empty" , Space , Str "head" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , HorizontalRule , Para - [ Str "explicit" - , Space - , Str "body" - , Space - , Str "and" - , Space - , Str "foot" - ] + [ Str "explicit" + , Space + , Str "body" + , Space + , Str "and" + , Space + , Str "foot" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + ] ] - ] - ( TableFoot - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + (TableFoot + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ]) + , Header + 2 + ( "colspans-and-rowspans" , [] , [] ) + [ Str "Colspans" + , Space + , Str "and" + , Space + , Str "Rowspans" ] - ) - , Header 2 - ( "colspans-and-rowspans", [], [] ) - [ Str "Colspans", Space, Str "and", Space, Str "Rowspans" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 2 ) - [ Plain [ Str "1", Space, Str "and", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 3 ) - [ Plain - [ Str "4," - , Space - , Str "5," - , Space - , Str "and" - , Space - , Str "6" - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 2) + [ Plain + [ Str "1" , Space , Str "and" , Space , Str "2" ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 3) + [ Plain + [ Str "4," + , Space + , Str "5," + , Space + , Str "and" + , Space + , Str "6" + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , HorizontalRule , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 3 ) - [ Plain [ Str "Numbers" ] ] - ] - ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 2 ) - ( ColSpan 1 ) - [ Plain [ Str "1", Space, Str "and", Space, Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 3) + [ Plain [ Str "Numbers" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 2) + (ColSpan 1) + [ Plain + [ Str "1" , Space , Str "and" , Space , Str "4" ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 2 - ( "attributes", [], [] ) - [ Str "Attributes" ] + (TableFoot ( "" , [] , [] ) []) + , Header 2 ( "attributes" , [] , [] ) [ Str "Attributes" ] , Table - ( "attrib-test-table", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [ "table-head" ], [] ) - [ Row - ( "", [ "table-head-row" ], [] ) - [ Cell - ( "", [], [ ( "abbr", "x" ) ] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 3 ) - [ Plain [ Str "Cat", Space, Str "X" ] ] - ] - ] - ) - [ TableBody - ( "", [ "main" ], [ ( "part", "body" ) ] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [ ( "part", "row" ) ] ) - [ Cell - ( "", [], [ ( "part", "cell" ) ] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [ ( "valign", "bottom" ) ] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [ ( "style", "color: #151950" ) ] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] + ( "attrib-test-table" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [ "table-head" ] , [] ) + [ Row + ( "" , [ "table-head-row" ] , [] ) + [ Cell + ( "" , [] , [ ( "abbr" , "x" ) ] ) + AlignDefault + (RowSpan 1) + (ColSpan 3) + [ Plain [ Str "Cat" , Space , Str "X" ] ] + ] + ]) + [ TableBody + ( "" , [ "main" ] , [ ( "part" , "body" ) ] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [ ( "part" , "row" ) ] ) + [ Cell + ( "" , [] , [ ( "part" , "cell" ) ] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [ ( "valign" , "bottom" ) ] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [ ( "style" , "color: #151950" ) ] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + ] ] - ] - ( TableFoot - ( "", [ "summary" ], [] ) - [ Row - ( "", [], [ ( "bgcolor", "#ccc" ) ] ) - [ Cell - ( "", [], [ ( "square", "true" ) ] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + (TableFoot + ( "" , [ "summary" ] , [] ) + [ Row + ( "" , [] , [ ( "bgcolor" , "#ccc" ) ] ) + [ Cell + ( "" , [] , [ ( "square" , "true" ) ] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ]) + , Header + 2 + ( "tag-omission" , [] , [] ) + [ Str "Tag" , Space , Str "omission" ] + , Para + [ Str "thead," + , Space + , Str "tbody," + , Space + , Str "and" + , Space + , Str "tfoot" ] - ) - , Header 2 - ( "tag-omission", [], [] ) - [ Str "Tag", Space, Str "omission" ] - , Para - [ Str "thead," - , Space - , Str "tbody," - , Space - , Str "and" - , Space - , Str "tfoot" - ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Z" ] ] - ] - ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + ] + ] ] - ] - ( TableFoot - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - ] + (TableFoot + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + ] + ]) + , Header + 2 + ( "empty-tables" , [] , [] ) + [ Str "Empty" , Space , Str "Tables" ] + , Para + [ Str "This" + , Space + , Str "section" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "empty." ] - ) - , Header 2 - ( "empty-tables", [], [] ) - [ Str "Empty", Space, Str "Tables" ] - , Para - [ Str "This" - , Space - , Str "section" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "empty." - ] ] diff --git a/test/ipynb/simple.out.native b/test/ipynb/simple.out.native index 43b170a3a..0f243ca48 100644 --- a/test/ipynb/simple.out.native +++ b/test/ipynb/simple.out.native @@ -1,106 +1,103 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "jupyter" - , MetaMap - ( fromList - [ - ( "nbformat", MetaString "4" ) - , - ( "nbformat_minor", MetaString "5" ) - ] - ) - ) - ] + Meta + { unMeta = + fromList + [ ( "jupyter" + , MetaMap + (fromList + [ ( "nbformat" , MetaString "4" ) + , ( "nbformat_minor" , MetaString "5" ) + ]) + ) + ] } - ) [ Div - ( "", [ "cell", "markdown" ], [] ) - [ Header 1 - ( "lorem-ipsum", [], [] ) - [ Str "Lorem", Space, Str "ipsum" ] - , Para - [ Strong - [ Str "Lorem", Space, Str "ipsum" ] - , Space - , Str "dolor" - , Space - , Str "sit" - , Space - , Str "amet," - , Space - , Str "consectetur" - , Space - , Str "adipiscing" - , Space - , Str "elit." - , Space - , Str "Nunc" - , Space - , Str "luctus" - , SoftBreak - , Str "bibendum" - , Space - , Str "felis" - , Space - , Str "dictum" - , Space - , Str "sodales." + ( "" , [ "cell" , "markdown" ] , [] ) + [ Header + 1 + ( "lorem-ipsum" , [] , [] ) + [ Str "Lorem" , Space , Str "ipsum" ] + , Para + [ Strong [ Str "Lorem" , Space , Str "ipsum" ] + , Space + , Str "dolor" + , Space + , Str "sit" + , Space + , Str "amet," + , Space + , Str "consectetur" + , Space + , Str "adipiscing" + , Space + , Str "elit." + , Space + , Str "Nunc" + , Space + , Str "luctus" + , SoftBreak + , Str "bibendum" + , Space + , Str "felis" + , Space + , Str "dictum" + , Space + , Str "sodales." + ] ] - ] , Div - ( "", [ "cell", "code" ], [] ) - [ CodeBlock ( "", [ "python" ], [] ) "print(\"hello\")" ] + ( "" , [ "cell" , "code" ] , [] ) + [ CodeBlock ( "" , [ "python" ] , [] ) "print(\"hello\")" ] , Div - ( "", [ "cell", "markdown" ], [] ) - [ Header 2 ( "pyout", [], [] ) [ Str "Pyout" ] ] + ( "" , [ "cell" , "markdown" ] , [] ) + [ Header 2 ( "pyout" , [] , [] ) [ Str "Pyout" ] ] , Div - ( "", [ "cell", "code" ], [ ( "execution_count", "2" ) ] ) - [ CodeBlock - ( "" - , [ "python" ] - , [] - ) "from IPython.display import HTML\nHTML(\"\"\"\n\nHTML\n\"\"\")" - , Div ( "" - , - [ "output", "execute_result" ] - , - [ ( "execution_count", "2" ) ] + , [ "cell" , "code" ] + , [ ( "execution_count" , "2" ) ] ) - [ RawBlock - ( Format "html" ) "\nHTML\nhello" + [ CodeBlock + ( "" , [ "python" ] , [] ) + "from IPython.display import HTML\nHTML(\"\"\"\n\nHTML\n\"\"\")" + , Div + ( "" + , [ "output" , "execute_result" ] + , [ ( "execution_count" , "2" ) ] + ) + [ RawBlock + (Format "html") + "\nHTML\nhello" + ] ] - ] , Div - ( "", [ "cell", "markdown" ], [ ( "tags", "[\"foo\",\"bar\"]" ) ] ) - [ Header 2 - ( "image", [], [] ) - [ Str "Image" ] - , Para - [ Str "This" - , Space - , Str "image" - , Space - , Image - ( "", [], [] ) - [ Str "the", Space, Str "moon" ] - ( "lalune.jpg", "" ) - , Space - , Str "will" - , Space - , Str "be" - , Space - , Str "included" - , Space - , Str "as" - , Space - , Str "a" - , Space - , Str "cell" - , SoftBreak - , Str "attachment." + ( "" + , [ "cell" , "markdown" ] + , [ ( "tags" , "[\"foo\",\"bar\"]" ) ] + ) + [ Header 2 ( "image" , [] , [] ) [ Str "Image" ] + , Para + [ Str "This" + , Space + , Str "image" + , Space + , Image + ( "" , [] , [] ) + [ Str "the" , Space , Str "moon" ] + ( "lalune.jpg" , "" ) + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "included" + , Space + , Str "as" + , Space + , Str "a" + , Space + , Str "cell" + , SoftBreak + , Str "attachment." + ] ] - ] ] diff --git a/test/jats-reader.native b/test/jats-reader.native index b9b1a95ba..02439ce31 100644 --- a/test/jats-reader.native +++ b/test/jats-reader.native @@ -1,665 +1,541 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "author" - , MetaList - [ MetaInlines - [ Str "John", Space, Str "MacFarlane" ] - , MetaInlines - [ Str "Anonymous" ] + Meta + { unMeta = + fromList + [ ( "author" + , MetaList + [ MetaInlines [ Str "John" , Space , Str "MacFarlane" ] + , MetaInlines [ Str "Anonymous" ] + ] + ) + , ( "title" + , MetaInlines + [ Str "Pandoc" + , Space + , Str "Test" + , Space + , Str "Suite" + ] + ) ] - ) - , - ( "title" - , MetaInlines - [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] - ) - ] } - ) [ 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 "Most" - , Space - , Str "of" - , Space - , Str "them" - , Space - , Str "are" - , Space - , Str "adapted" - , Space - , Str "from" - , Space - , Str "John" - , Space - , Str "Gruber's" - , Space - , Str "markdown" - , Space - , Str "test" - , Space - , Str "suite." - ] - , Header 1 - ( "headers", [], [] ) - [ Str "Headers" ] - , Header 2 - ( "level-2-with-an-embedded-link", [], [] ) - [ Str "Level" - , Space - , Str "2" - , Space - , Str "with" - , Space - , Str "an" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "embedded", SoftBreak, Str "link" ] - ( "/url", "" ) - ] - , Header 3 - ( "level-3-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "3" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 4 - ( "level-4", [], [] ) - [ Str "Level", Space, Str "4" ] - , Header 5 - ( "level-5", [], [] ) - [ Str "Level", Space, Str "5" ] - , Header 1 - ( "level-1", [], [] ) - [ Str "Level", Space, Str "1" ] - , Header 2 - ( "level-2-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "2" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 3 - ( "level-3", [], [] ) - [ Str "Level", Space, Str "3" ] - , Para - [ Str "with" - , Space - , Str "no" - , Space - , Str "blank" - , Space - , Str "line" - ] - , Header 2 - ( "level-2", [], [] ) - [ Str "Level", Space, Str "2" ] - , Para - [ Str "with" - , Space - , Str "no" - , Space - , Str "blank" - , Space - , Str "line" - ] - , Header 1 - ( "paragraphs", [], [] ) - [ Str "Paragraphs" ] - , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Str "regular" - , Space - , Str "paragraph." - ] - , Para - [ Str "In" - , Space - , Str "Markdown" - , Space - , Str "1.0.0" - , Space - , Str "and" - , Space - , Str "earlier." - , Space - , Str "Version" - , Space - , Str "8." - , Space - , Str "This" - , Space - , Str "line" - , Space - , Str "turns" - , Space - , Str "into" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - , Space - , Str "Because" - , Space - , Str "a" - , Space - , Str "hard-wrapped" - , Space - , Str "line" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "middle" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "paragraph" - , Space - , Str "looked" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - ] - , Para - [ Str "Here's" - , Space - , Str "one" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "bullet." - , Space - , Str "*" - , Space - , Str "criminey." - ] - , Para - [ Str "There" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "hard" - , Space - , Str "line" - , Space - , Str "break" - , LineBreak - , Str "here." - ] - , Header 1 - ( "block-quotes", [], [] ) - [ Str "Block", Space, Str "Quotes" ] - , Para - [ Str "E-mail", Space, Str "style:" ] - , BlockQuote - [ Para [ Str "This" , Space , Str "is" , Space , Str "a" , Space - , Str "block" + , Str "set" , Space - , Str "quote." + , Str "of" , Space - , Str "It" + , Str "tests" , Space - , Str "is" + , Str "for" + , Space + , Str "pandoc." + , Space + , Str "Most" + , Space + , Str "of" + , Space + , Str "them" + , Space + , Str "are" + , Space + , Str "adapted" + , Space + , Str "from" + , Space + , Str "John" + , Space + , Str "Gruber's" , Space - , Str "pretty" + , Str "markdown" , Space - , Str "short." + , Str "test" + , Space + , Str "suite." ] - ] - , BlockQuote - [ Para - [ Str "Code" + , Header 1 ( "headers" , [] , [] ) [ Str "Headers" ] + , Header + 2 + ( "level-2-with-an-embedded-link" , [] , [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Str "an" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "embedded" , SoftBreak , Str "link" ] + ( "/url" , "" ) + ] + , Header + 3 + ( "level-3-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 4 ( "level-4" , [] , [] ) [ Str "Level" , Space , Str "4" ] + , Header + 5 ( "level-5" , [] , [] ) [ Str "Level" , Space , Str "5" ] + , Header + 1 ( "level-1" , [] , [] ) [ Str "Level" , Space , Str "1" ] + , Header + 2 + ( "level-2-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 3 ( "level-3" , [] , [] ) [ Str "Level" , Space , Str "3" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Header + 2 ( "level-2" , [] , [] ) [ Str "Level" , Space , Str "2" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Header 1 ( "paragraphs" , [] , [] ) [ Str "Paragraphs" ] + , Para + [ Str "Here's" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , Space + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + , Space + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" , Space , Str "in" , Space + , Str "the" + , Space + , Str "middle" + , Space + , Str "of" + , Space , Str "a" , Space - , Str "block" + , Str "paragraph" , Space - , Str "quote:" + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + ] + , Para + [ Str "Here's" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , Space + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" + , LineBreak + , Str "here." ] - , CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - , Para - [ Str "A", Space, Str "list:" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "item", Space, Str "one" ] ] - , - [ Para [ Str "item", Space, Str "two" ] ] - ] - , Para - [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] - , BlockQuote - [ Para [ Str "nested" ] ] - , BlockQuote - [ Para [ Str "nested" ] ] - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "block" - , Space - , Str "quote:" - , Space - , Str "2" - , Space - , Str ">" - , Space - , Str "1." - ] - , Para - [ Str "Box-style:" ] + , Header + 1 + ( "block-quotes" , [] , [] ) + [ Str "Block" , Space , Str "Quotes" ] + , Para [ Str "E-mail" , Space , Str "style:" ] , BlockQuote - [ Para - [ Str "Example:" ] - , CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - ] + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , Space + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] + ] , BlockQuote - [ OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "do", Space, Str "laundry" ] ] - , - [ Para - [ Str "take" + [ Para + [ Str "Code" , Space - , Str "out" + , Str "in" , Space - , Str "the" + , Str "a" + , Space + , Str "block" , Space - , Str "trash" + , Str "quote:" + ] + , CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + , Para [ Str "A" , Space , Str "list:" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "item" , Space , Str "one" ] ] + , [ Para [ Str "item" , Space , Str "two" ] ] + ] + , Para + [ Str "Nested" + , Space + , Str "block" + , Space + , Str "quotes:" + ] + , BlockQuote [ Para [ Str "nested" ] ] + , BlockQuote [ Para [ Str "nested" ] ] + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + , Space + , Str "2" + , Space + , Str ">" + , Space + , Str "1." + ] + , Para [ Str "Box-style:" ] + , BlockQuote + [ Para [ Str "Example:" ] + , CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + ] + , BlockQuote + [ OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "do" , Space , Str "laundry" ] ] + , [ Para + [ Str "take" + , Space + , Str "out" + , Space + , Str "the" + , Space + , Str "trash" + ] + ] ] - ] ] - ] , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Str "nested" - , Space - , Str "one:" - ] + [ Str "Here's" + , Space + , Str "a" + , Space + , Str "nested" + , Space + , Str "one:" + ] , BlockQuote - [ Para - [ Str "Joe", Space, Str "said:" ] - , BlockQuote - [ Para [ Str "Don't", Space, Str "quote", Space, Str "me." ] ] - ] - , Para - [ Str "And" - , Space - , Str "a" - , Space - , Str "following" - , Space - , Str "paragraph." - ] - , Header 1 - ( "code-blocks", [], [] ) - [ Str "Code", Space, Str "Blocks" ] - , Para - [ Str "Code:" ] - , CodeBlock - ( "" - , [] - , [] - ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + [ Para [ Str "Joe" , Space , Str "said:" ] + , BlockQuote + [ Para + [ Str "Don't" , Space , Str "quote" , Space , Str "me." ] + ] + ] , Para - [ Str "And:" ] + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] + , Header + 1 + ( "code-blocks" , [] , [] ) + [ Str "Code" , Space , Str "Blocks" ] + , Para [ Str "Code:" ] , CodeBlock - ( "" - , [] - , [] - ) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" - , Header 1 - ( "lists", [], [] ) - [ Str "Lists" ] - , Header 2 - ( "unordered", [], [] ) - [ Str "Unordered" ] - , Para - [ Str "Asterisks", Space, Str "tight:" ] + ( "" , [] , [] ) + "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + , Para [ Str "And:" ] + , CodeBlock + ( "" , [] , [] ) + " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + , Header 1 ( "lists" , [] , [] ) [ Str "Lists" ] + , Header 2 ( "unordered" , [] , [] ) [ Str "Unordered" ] + , Para [ Str "Asterisks" , Space , Str "tight:" ] , BulletList - [ - [ Para [ Str "asterisk", Space, Str "1" ] ] - , - [ Para [ Str "asterisk", Space, Str "2" ] ] - , - [ Para [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Asterisks", Space, Str "loose:" ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Asterisks" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "asterisk", Space, Str "1" ] ] - , - [ Para [ Str "asterisk", Space, Str "2" ] ] - , - [ Para [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "tight:" ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "tight:" ] , BulletList - [ - [ Para [ Str "Plus", Space, Str "1" ] ] - , - [ Para [ Str "Plus", Space, Str "2" ] ] - , - [ Para [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "loose:" ] + [ [ Para [ Str "Plus" , Space , Str "1" ] ] + , [ Para [ Str "Plus" , Space , Str "2" ] ] + , [ Para [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Plus", Space, Str "1" ] ] - , - [ Para [ Str "Plus", Space, Str "2" ] ] - , - [ Para [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "tight:" ] + [ [ Para [ Str "Plus" , Space , Str "1" ] ] + , [ Para [ Str "Plus" , Space , Str "2" ] ] + , [ Para [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "tight:" ] , BulletList - [ - [ Para [ Str "Minus", Space, Str "1" ] ] - , - [ Para [ Str "Minus", Space, Str "2" ] ] - , - [ Para [ Str "Minus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "loose:" ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Minus", Space, Str "1" ] ] - , - [ Para [ Str "Minus", Space, Str "2" ] ] - , - [ Para [ Str "Minus", Space, Str "3" ] ] - ] - , Header 2 - ( "ordered", [], [] ) - [ Str "Ordered" ] - , Para - [ Str "Tight:" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para [ Str "Second" ] ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "and:" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "One" ] ] - , - [ Para [ Str "Two" ] ] - , - [ Para [ Str "Three" ] ] - ] - , Para - [ Str "Loose", Space, Str "using", Space, Str "tabs:" ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] + ] + , Header 2 ( "ordered" , [] , [] ) [ Str "Ordered" ] + , Para [ Str "Tight:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para [ Str "Second" ] ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "and", Space, Str "using", Space, Str "spaces:" ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second" ] ] + , [ Para [ Str "Third" ] ] + ] + , Para [ Str "and:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "One" ] ] - , - [ Para [ Str "Two" ] ] - , - [ Para [ Str "Three" ] ] - ] - , Para - [ Str "Multiple", Space, Str "paragraphs:" ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "One" ] ] + , [ Para [ Str "Two" ] ] + , [ Para [ Str "Three" ] ] + ] + , Para + [ Str "Loose" , Space , Str "using" , Space , Str "tabs:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para - [ Str "Item" - , Space - , Str "1," - , Space - , Str "graf" - , Space - , Str "one." - ] - , Para - [ Str "Item" - , Space - , Str "1." - , Space - , Str "graf" - , Space - , Str "two." - , Space - , Str "The" - , Space - , Str "quick" - , Space - , Str "brown" - , Space - , Str "fox" - , Space - , Str "jumped" - , Space - , Str "over" - , Space - , Str "the" - , Space - , Str "lazy" - , SoftBreak - , Str "dog's" - , Space - , Str "back." - ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second" ] ] + , [ Para [ Str "Third" ] ] ] - , - [ Para [ Str "Item", Space, Str "2." ] ] - , - [ Para [ Str "Item", Space, Str "3." ] ] - ] , Para - [ Str "List", Space, Str "styles:" ] + [ Str "and" , Space , Str "using" , Space , Str "spaces:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) [] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "One" ] ] + , [ Para [ Str "Two" ] ] + , [ Para [ Str "Three" ] ] + ] + , Para [ Str "Multiple" , Space , Str "paragraphs:" ] , OrderedList - ( 1, LowerRoman, DefaultDelim ) [] - , Header 2 - ( "nested", [], [] ) - [ Str "Nested" ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , SoftBreak + , Str "dog's" + , Space + , Str "back." + ] + ] + , [ Para [ Str "Item" , Space , Str "2." ] ] + , [ Para [ Str "Item" , Space , Str "3." ] ] + ] + , Para [ Str "List" , Space , Str "styles:" ] + , OrderedList ( 1 , DefaultStyle , DefaultDelim ) [] + , OrderedList ( 1 , LowerRoman , DefaultDelim ) [] + , Header 2 ( "nested" , [] , [] ) [ Str "Nested" ] , BulletList - [ - [ Para - [ Str "Tab" ] - , BulletList - [ - [ Para [ Str "Tab" ], BulletList [ [ Para [ Str "Tab" ] ] ] ] + [ [ Para [ Str "Tab" ] + , BulletList + [ [ Para [ Str "Tab" ] + , BulletList [ [ Para [ Str "Tab" ] ] ] + ] + ] ] ] - ] - , Para - [ Str "Here's", Space, Str "another:" ] + , Para [ Str "Here's" , Space , Str "another:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Para [ Str "Fee" ] ] - , - [ Para [ Str "Fie" ] ] - , - [ Para [ Str "Foe" ] ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Para [ Str "Fee" ] ] + , [ Para [ Str "Fie" ] ] + , [ Para [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] + ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "Same" - , Space - , Str "thing" - , Space - , Str "but" - , Space - , Str "with" - , Space - , Str "paragraphs:" - ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Para [ Str "Fee" ] ] - , - [ Para [ Str "Fie" ] ] - , - [ Para [ Str "Foe" ] ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Para [ Str "Fee" ] ] + , [ Para [ Str "Fie" ] ] + , [ Para [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] ] - , - [ Para [ Str "Third" ] ] - ] - , Header 2 - ( "tabs-and-spaces", [], [] ) - [ Str "Tabs", Space, Str "and", Space, Str "spaces" ] + , Header + 2 + ( "tabs-and-spaces" , [] , [] ) + [ Str "Tabs" , Space , Str "and" , Space , Str "spaces" ] , BulletList - [ - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "indented" - , Space - , Str "with" - , Space - , Str "tabs" - ] - ] - , - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "indented" - , Space - , Str "with" - , Space - , Str "spaces" - ] - , BulletList - [ - [ Para + [ [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -671,16 +547,13 @@ Pandoc , Space , Str "tabs" ] - ] - , - [ Para + ] + , [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -692,2202 +565,2246 @@ Pandoc , Space , Str "spaces" ] - ] + , BulletList + [ [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + ] + ] ] ] - ] - , Header 2 - ( "fancy-list-markers", [], [] ) - [ Str "Fancy", Space, Str "list", Space, Str "markers" ] - , Para - [ Str "Autonumbering:" ] + , Header + 2 + ( "fancy-list-markers" , [] , [] ) + [ Str "Fancy" , Space , Str "list" , Space , Str "markers" ] + , Para [ Str "Autonumbering:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "Autonumber." ] ] - , - [ Para - [ Str "More." ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Para [ Str "Nested." ] ] ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "Autonumber." ] ] + , [ Para [ Str "More." ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "Nested." ] ] ] + ] ] - ] - , Header 2 - ( "definition", [], [] ) - [ Str "Definition" ] + , Header 2 ( "definition" , [] , [] ) [ Str "Definition" ] , DefinitionList - [ - ( - [ Str "Violin" ] - , - [ - [ Para - [ Str "Stringed" - , Space - , Str "musical" - , Space - , Str "instrument." + [ ( [ Str "Violin" ] + , [ [ Para + [ Str "Stringed" + , Space + , Str "musical" + , Space + , Str "instrument." + ] + , Para [ Str "Torture" , Space , Str "device." ] ] - , Para - [ Str "Torture", Space, Str "device." ] ] - ] - ) - , - ( - [ Str "Cello", LineBreak, Str "Violoncello" ] - , - [ - [ Para - [ Str "Low-voiced" - , Space - , Str "stringed" - , Space - , Str "instrument." + ) + , ( [ Str "Cello" , LineBreak , Str "Violoncello" ] + , [ [ Para + [ Str "Low-voiced" + , Space + , Str "stringed" + , Space + , Str "instrument." + ] ] ] - ] - ) - ] - , Header 1 - ( "inline-markup", [], [] ) - [ Str "Inline", Space, Str "Markup" ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "emphasized" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Emph - [ Str "is", SoftBreak, Str "this" ] - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , SoftBreak - , Strong - [ Str "is", Space, Str "this" ] - , Str "." - ] - , Para - [ Str "Empty" - , Space - , Strong [] - , Space - , Str "and" - , Space - , Emph [] - , Str "." - ] - , Para - [ Str "An" - , SoftBreak - , Emph - [ Link - ( "", [], [] ) - [ Str "emphasized", SoftBreak, Str "link" ] - ( "/url", "" ) - ] - , Str "." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] - ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] - ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "code:" - , Space - , Code - ( "", [], [] ) ">" - , Str "," - , Space - , Code - ( "", [], [] ) "$" - , Str "," - , SoftBreak - , Code - ( "", [], [] ) "\\" - , Str "," - , Space - , Code - ( "", [], [] ) "\\$" - , Str "," - , SoftBreak - , Code - ( "", [], [] ) "" - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , SmallCaps - [ Str "small", Space, Str "caps" ] - , Str "." - ] - , Para - [ Str "These" - , Space - , Str "are" - , Space - , Str "all" - , Space - , Str "underlined:" - , Space - , Str "foo" - , Space - , Str "and" - , Space - , Str "bar." - ] - , Para - [ Str "These" - , Space - , Str "are" - , Space - , Str "all" - , Space - , Str "strikethrough:" - , Space - , Strikeout - [ Str "foo" ] - , Str "," - , SoftBreak - , Strikeout - [ Str "bar" ] - , Str "," - , Space - , Str "and" - , Space - , Strikeout - [ Str "baz" ] - , Str "." - ] - , Header 1 - ( "smart-quotes-ellipses-dashes", [], [] ) - [ Str "Smart" - , Space - , Str "quotes," - , Space - , Str "ellipses," - , Space - , Str "dashes" - ] - , Para - [ Str "\"Hello,\"" - , Space - , Str "said" - , Space - , Str "the" - , Space - , Str "spider." - , Space - , Str "\"'Shelob'" - , Space - , Str "is" - , Space - , Str "my" - , Space - , Str "name.\"" - ] - , Para - [ Str "'A'," - , Space - , Str "'B'," - , Space - , Str "and" - , Space - , Str "'C'" - , Space - , Str "are" - , Space - , Str "letters." - ] - , Para - [ Str "'Oak,'" - , Space - , Str "'elm,'" - , Space - , Str "and" - , Space - , Str "'beech'" - , Space - , Str "are" - , Space - , Str "names" - , Space - , Str "of" - , Space - , Str "trees." - , Space - , Str "So" - , Space - , Str "is" - , Space - , Str "'pine.'" - ] - , Para - [ Str "'He" - , Space - , Str "said," - , Space - , Str "\"I" - , Space - , Str "want" - , Space - , Str "to" - , Space - , Str "go.\"'" - , Space - , Str "Were" - , Space - , Str "you" - , Space - , Str "alive" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "70's?" - ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "quoted" - , Space - , Str "'" - , Code - ( "", [], [] ) "code" - , Str "'" - , Space - , Str "and" - , Space - , Str "a" - , SoftBreak - , Str "\"" - , Link - ( "", [], [] ) - [ Str "quoted", SoftBreak, Str "link" ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Str "\"." - ] - , Para - [ Str "Some" - , Space - , Str "dashes:" - , Space - , Str "one---two" - , Space - , Str "---" - , Space - , Str "three--four" - , Space - , Str "--" - , Space - , Str "five." - ] - , Para - [ Str "Dashes" - , Space - , Str "between" - , Space - , Str "numbers:" - , Space - , Str "5-7," - , Space - , Str "255-66," - , Space - , Str "1987-1999." - ] - , Para - [ Str "Ellipses...and." - , Space - , Str "." - , Space - , Str ".and" - , Space - , Str "." - , Space - , Str "." - , Space - , Str "." - , Space - , Str "." - ] - , Header 1 - ( "latex", [], [] ) - [ Str "LaTeX" ] - , BulletList - [ - [ Para [ Str "\\cite[22-23]{smith.1899}" ] ] - , - [ Para [ Str "\\doublespacing" ] ] - , - [ Para [ Str "$2+2=4$" ] ] - , - [ Para [ Str "$x", Space, Str "\\in", Space, Str "y$" ] ] - , - [ Para - [ Str "$\\alpha", Space, Str "\\wedge", Space, Str "\\omega$" ] - ] - , - [ Para [ Str "$223$" ] ] - , - [ Para [ Str "$p$-Tree" ] ] - , - [ Para - [ Str "$\\frac{d}{dx}f(x)=\\lim_{h\\to" - , Space - , Str "0}\\frac{f(x+h)-f(x)}{h}$" - ] + ) ] - , - [ Para - [ Str "Here's" - , Space - , Str "one" - , Space - , Str "that" - , Space - , Str "has" - , Space - , Str "a" - , Space - , Str "line" - , Space - , Str "break" - , Space - , Str "in" - , Space - , Str "it:" - , Space - , Str "$\\alpha" - , Space - , Str "+" - , Space - , Str "\\omega" - , Space - , Str "\\times" - , SoftBreak - , Str "x^2$." - ] + , Header + 1 + ( "inline-markup" , [] , [] ) + [ Str "Inline" , Space , Str "Markup" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph [ Str "is" , SoftBreak , Str "this" ] + , Str "." ] - ] , Para - [ Str "These" - , Space - , Str "shouldn't" - , Space - , Str "be" - , Space - , Str "math:" - ] - , BulletList - [ - [ Para - [ Str "To" - , Space - , Str "get" - , Space - , Str "the" - , Space - , Str "famous" - , Space - , Str "equation," - , Space - , Str "write" - , SoftBreak - , Code - ( "", [], [] ) "$e = mc^2$" - , Str "." + [ Str "This" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , SoftBreak + , Strong [ Str "is" , Space , Str "this" ] + , Str "." + ] + , Para + [ Str "Empty" + , Space + , Strong [] + , Space + , Str "and" + , Space + , Emph [] + , Str "." + ] + , Para + [ Str "An" + , SoftBreak + , Emph + [ Link + ( "" , [] , [] ) + [ Str "emphasized" , SoftBreak , Str "link" ] + ( "/url" , "" ) + ] + , Str "." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code ( "" , [] , [] ) ">" + , Str "," + , Space + , Code ( "" , [] , [] ) "$" + , Str "," + , SoftBreak + , Code ( "" , [] , [] ) "\\" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\$" + , Str "," + , SoftBreak + , Code ( "" , [] , [] ) "" + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , SmallCaps [ Str "small" , Space , Str "caps" ] + , Str "." + ] + , Para + [ Str "These" + , Space + , Str "are" + , Space + , Str "all" + , Space + , Str "underlined:" + , Space + , Str "foo" + , Space + , Str "and" + , Space + , Str "bar." + ] + , Para + [ Str "These" + , Space + , Str "are" + , Space + , Str "all" + , Space + , Str "strikethrough:" + , Space + , Strikeout [ Str "foo" ] + , Str "," + , SoftBreak + , Strikeout [ Str "bar" ] + , Str "," + , Space + , Str "and" + , Space + , Strikeout [ Str "baz" ] + , Str "." + ] + , Header + 1 + ( "smart-quotes-ellipses-dashes" , [] , [] ) + [ Str "Smart" + , Space + , Str "quotes," + , Space + , Str "ellipses," + , Space + , Str "dashes" + ] + , Para + [ Str "\"Hello,\"" + , Space + , Str "said" + , Space + , Str "the" + , Space + , Str "spider." + , Space + , Str "\"'Shelob'" + , Space + , Str "is" + , Space + , Str "my" + , Space + , Str "name.\"" + ] + , Para + [ Str "'A'," + , Space + , Str "'B'," + , Space + , Str "and" + , Space + , Str "'C'" + , Space + , Str "are" + , Space + , Str "letters." + ] + , Para + [ Str "'Oak,'" + , Space + , Str "'elm,'" + , Space + , Str "and" + , Space + , Str "'beech'" + , Space + , Str "are" + , Space + , Str "names" + , Space + , Str "of" + , Space + , Str "trees." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "'pine.'" + ] + , Para + [ Str "'He" + , Space + , Str "said," + , Space + , Str "\"I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "go.\"'" + , Space + , Str "Were" + , Space + , Str "you" + , Space + , Str "alive" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "70's?" + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "quoted" + , Space + , Str "'" + , Code ( "" , [] , [] ) "code" + , Str "'" + , Space + , Str "and" + , Space + , Str "a" + , SoftBreak + , Str "\"" + , Link + ( "" , [] , [] ) + [ Str "quoted" , SoftBreak , Str "link" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + , Str "\"." + ] + , Para + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one---two" + , Space + , Str "---" + , Space + , Str "three--four" + , Space + , Str "--" + , Space + , Str "five." + ] + , Para + [ Str "Dashes" + , Space + , Str "between" + , Space + , Str "numbers:" + , Space + , Str "5-7," + , Space + , Str "255-66," + , Space + , Str "1987-1999." + ] + , Para + [ Str "Ellipses...and." + , Space + , Str "." + , Space + , Str ".and" + , Space + , Str "." + , Space + , Str "." + , Space + , Str "." + , Space + , Str "." + ] + , Header 1 ( "latex" , [] , [] ) [ Str "LaTeX" ] + , BulletList + [ [ Para [ Str "\\cite[22-23]{smith.1899}" ] ] + , [ Para [ Str "\\doublespacing" ] ] + , [ Para [ Str "$2+2=4$" ] ] + , [ Para + [ Str "$x" , Space , Str "\\in" , Space , Str "y$" ] + ] + , [ Para + [ Str "$\\alpha" + , Space + , Str "\\wedge" + , Space + , Str "\\omega$" + ] + ] + , [ Para [ Str "$223$" ] ] + , [ Para [ Str "$p$-Tree" ] ] + , [ Para + [ Str "$\\frac{d}{dx}f(x)=\\lim_{h\\to" + , Space + , Str "0}\\frac{f(x+h)-f(x)}{h}$" + ] + ] + , [ Para + [ Str "Here's" + , Space + , Str "one" + , Space + , Str "that" + , Space + , Str "has" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "break" + , Space + , Str "in" + , Space + , Str "it:" + , Space + , Str "$\\alpha" + , Space + , Str "+" + , Space + , Str "\\omega" + , Space + , Str "\\times" + , SoftBreak + , Str "x^2$." + ] + ] + ] + , Para + [ Str "These" + , Space + , Str "shouldn't" + , Space + , Str "be" + , Space + , Str "math:" + ] + , BulletList + [ [ Para + [ Str "To" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "famous" + , Space + , Str "equation," + , Space + , Str "write" + , SoftBreak + , Code ( "" , [] , [] ) "$e = mc^2$" + , Str "." + ] + ] + , [ Para + [ Str "$22,000" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Emph [ Str "lot" ] + , Space + , Str "of" + , Space + , Str "money." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "$34,000." + , Space + , Str "(It" + , SoftBreak + , Str "worked" + , Space + , Str "if" + , Space + , Str "\"lot\"" + , Space + , Str "is" + , Space + , Str "emphasized.)" + ] + ] + , [ Para + [ Str "Escaped" + , Space + , Code ( "" , [] , [] ) "$" + , Str ":" + , Space + , Str "$73" + , Space + , Emph + [ Str "this" + , Space + , Str "should" + , Space + , Str "be" + , SoftBreak + , Str "emphasized" + ] + , Space + , Str "23$." + ] + ] + ] + , Para + [ Str "Here's" + , Space + , Str "a" + , Space + , Str "LaTeX" + , Space + , Str "table:" + ] + , Para + [ Str "\\begin{tabular}{|l|l|}\\hline" + , Space + , Str "Animal" + , Space + , Str "&" + , Space + , Str "Number" + , Space + , Str "\\\\" + , Space + , Str "\\hline" + , Space + , Str "Dog" + , Space + , Str "&" + , SoftBreak + , Str "2" + , Space + , Str "\\\\" + , Space + , Str "Cat" + , Space + , Str "&" + , Space + , Str "1" + , Space + , Str "\\\\" + , Space + , Str "\\hline" + , Space + , Str "\\end{tabular}" + ] + , Header + 1 + ( "special-characters" , [] , [] ) + [ Str "Special" , Space , Str "Characters" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "unicode:" + ] + , BulletList + [ [ Para + [ Str "I" , Space , Str "hat:" , Space , Str "\206" ] + ] + , [ Para + [ Str "o" , Space , Str "umlaut:" , Space , Str "\246" ] + ] + , [ Para [ Str "section:" , Space , Str "\167" ] ] + , [ Para + [ Str "set" + , Space + , Str "membership:" + , Space + , Str "elem" + ] + ] + , [ Para [ Str "copyright:" , Space , Str "\169" ] ] + ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] + , Para + [ Str "This" , Space , Str "&" , Space , Str "that." ] + , Para [ Str "4" , Space , Str "<" , Space , Str "5." ] + , Para [ Str "6" , Space , Str ">" , Space , Str "5." ] + , Para [ Str "Backslash:" , Space , Str "\\" ] + , Para [ Str "Backtick:" , Space , Str "`" ] + , Para [ Str "Asterisk:" , Space , Str "*" ] + , Para [ Str "Underscore:" , Space , Str "_" ] + , Para + [ Str "Left" , Space , Str "brace:" , Space , Str "{" ] + , Para + [ Str "Right" , Space , Str "brace:" , Space , Str "}" ] + , Para + [ Str "Left" , Space , Str "bracket:" , Space , Str "[" ] + , Para + [ Str "Right" , Space , Str "bracket:" , Space , Str "]" ] + , Para + [ Str "Left" , Space , Str "paren:" , Space , Str "(" ] + , Para + [ Str "Right" , Space , Str "paren:" , Space , Str ")" ] + , Para [ Str "Greater-than:" , Space , Str ">" ] + , Para [ Str "Hash:" , Space , Str "#" ] + , Para [ Str "Period:" , Space , Str "." ] + , Para [ Str "Bang:" , Space , Str "!" ] + , Para [ Str "Plus:" , Space , Str "+" ] + , Para [ Str "Minus:" , Space , Str "-" ] + , Header 1 ( "links" , [] , [] ) [ Str "Links" ] + , Header 2 ( "explicit" , [] , [] ) [ Str "Explicit" ] + , Para + [ Str "Just" + , Space + , Str "a" + , SoftBreak + , Link ( "" , [] , [] ) [ Str "URL" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , SoftBreak , Str "and" , Space , Str "title" ] + ( "/url/" , "title" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , SoftBreak , Str "and" , Space , Str "title" ] + ( "/url/" , "title preceded by two spaces" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , SoftBreak , Str "and" , Space , Str "title" ] + ( "/url/" , "title preceded by a tab" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , SoftBreak , Str "and" , Space , Str "title" ] + ( "/url/" , "title with \"quotes\" in it" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , SoftBreak , Str "and" , Space , Str "title" ] + ( "/url/" , "title with single quotes" ) + ] + , Para + [ Str "Email" + , Space + , Str "link" + , Space + , Str "(nobody" + , Space + , Str "[at]" + , Space + , Str "nowhere.net)" + ] + , Para + [ Link ( "" , [] , [] ) [ Str "Empty" ] ( "" , "" ) + , Str "." + ] + , Header 2 ( "reference" , [] , [] ) [ Str "Reference" ] + , Para + [ Str "Foo" + , SoftBreak + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Foo" + , SoftBreak + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Foo" + , SoftBreak + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "With" + , Space + , Link + ( "" , [] , [] ) + [ Str "embedded" , SoftBreak , Str "[brackets]" ] + ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link ( "" , [] , [] ) [ Str "b" ] ( "/url/" , "" ) + , Space + , Str "by" + , SoftBreak + , Str "itself" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , Para + [ Str "Indented" + , SoftBreak + , Link ( "" , [] , [] ) [ Str "once" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "Indented" + , SoftBreak + , Link ( "" , [] , [] ) [ Str "twice" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "Indented" + , SoftBreak + , Link ( "" , [] , [] ) [ Str "thrice" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "[not]" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , CodeBlock ( "" , [] , [] ) "[not]: /url" + , Para + [ Str "Foo" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "bar" ] + ( "/url/" , "Title with \"quotes\" inside" ) + , Str "." + ] + , Para + [ Str "Foo" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "biz" ] + ( "/url/" , "Title with \"quote\" inside" ) + , Str "." + ] + , Header + 2 + ( "with-ampersands" , [] , [] ) + [ Str "With" , Space , Str "ampersands" ] + , Para + [ Str "Here's" + , Space + , Str "a" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "link" + , SoftBreak + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here's" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "amersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "link" + , Space + , Str "text:" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "AT&T" ] + ( "http://att.com/" , "AT&T" ) + , Str "." + ] + , Para + [ Str "Here's" + , Space + , Str "an" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "inline" , SoftBreak , Str "link" ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here's" + , Space + , Str "an" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "inline" + , SoftBreak + , Str "link" + , Space + , Str "in" + , Space + , Str "pointy" + , Space + , Str "braces" + ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Header 2 ( "autolinks" , [] , [] ) [ Str "Autolinks" ] + , Para + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + ] + , BulletList + [ [ Para + [ Str "In" , Space , Str "a" , Space , Str "list?" ] + ] + , [ Para + [ Link + ( "" , [] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] ] + , [ Para [ Str "It" , Space , Str "should." ] ] ] - , - [ Para - [ Str "$22,000" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Emph - [ Str "lot" ] - , Space - , Str "of" - , Space - , Str "money." - , Space - , Str "So" - , Space - , Str "is" - , Space - , Str "$34,000." - , Space - , Str "(It" - , SoftBreak - , Str "worked" - , Space - , Str "if" - , Space - , Str "\"lot\"" - , Space - , Str "is" - , Space - , Str "emphasized.)" - ] + , Para + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" + , Space + , Str "nobody" + , Space + , Str "[at]" + , Space + , Str "nowhere.net" ] - , + , BlockQuote [ Para - [ Str "Escaped" - , Space - , Code - ( "", [], [] ) "$" - , Str ":" - , Space - , Str "$73" - , Space - , Emph - [ Str "this" - , Space - , Str "should" - , Space - , Str "be" + [ Str "Blockquoted:" , SoftBreak - , Str "emphasized" + , Link + ( "" , [] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) ] - , Space - , Str "23$." - ] ] - ] - , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Str "LaTeX" - , Space - , Str "table:" - ] - , Para - [ Str "\\begin{tabular}{|l|l|}\\hline" - , Space - , Str "Animal" - , Space - , Str "&" - , Space - , Str "Number" - , Space - , Str "\\\\" - , Space - , Str "\\hline" - , Space - , Str "Dog" - , Space - , Str "&" - , SoftBreak - , Str "2" - , Space - , Str "\\\\" - , Space - , Str "Cat" - , Space - , Str "&" - , Space - , Str "1" - , Space - , Str "\\\\" - , Space - , Str "\\hline" - , Space - , Str "\\end{tabular}" - ] - , Header 1 - ( "special-characters", [], [] ) - [ Str "Special", Space, Str "Characters" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "unicode:" - ] - , BulletList - [ - [ Para [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] - , - [ Para [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] - , - [ Para [ Str "section:", Space, Str "\167" ] ] - , - [ Para - [ Str "set", Space, Str "membership:", Space, Str "elem" ] - ] - , - [ Para [ Str "copyright:", Space, Str "\169" ] ] - ] , Para - [ Str "AT&T" - , Space - , Str "has" - , Space - , Str "an" - , Space - , Str "ampersand" - , Space - , Str "in" - , Space - , Str "their" - , Space - , Str "name." - ] - , Para - [ Str "AT&T" - , Space - , Str "is" - , Space - , Str "another" - , Space - , Str "way" - , Space - , Str "to" - , Space - , Str "write" - , Space - , Str "it." - ] - , Para - [ Str "This", Space, Str "&", Space, Str "that." ] - , Para - [ Str "4", Space, Str "<", Space, Str "5." ] - , Para - [ Str "6", Space, Str ">", Space, Str "5." ] - , Para - [ Str "Backslash:", Space, Str "\\" ] - , Para - [ Str "Backtick:", Space, Str "`" ] - , Para - [ Str "Asterisk:", Space, Str "*" ] - , Para - [ Str "Underscore:", Space, Str "_" ] - , Para - [ Str "Left", Space, Str "brace:", Space, Str "{" ] - , Para - [ Str "Right", Space, Str "brace:", Space, Str "}" ] - , Para - [ Str "Left", Space, Str "bracket:", Space, Str "[" ] - , Para - [ Str "Right", Space, Str "bracket:", Space, Str "]" ] - , Para - [ Str "Left", Space, Str "paren:", Space, Str "(" ] - , Para - [ Str "Right", Space, Str "paren:", Space, Str ")" ] - , Para - [ Str "Greater-than:", Space, Str ">" ] - , Para - [ Str "Hash:", Space, Str "#" ] - , Para - [ Str "Period:", Space, Str "." ] - , Para - [ Str "Bang:", Space, Str "!" ] - , Para - [ Str "Plus:", Space, Str "+" ] - , Para - [ Str "Minus:", Space, Str "-" ] - , Header 1 - ( "links", [], [] ) - [ Str "Links" ] - , Header 2 - ( "explicit", [], [] ) - [ Str "Explicit" ] - , Para - [ Str "Just" - , Space - , Str "a" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "URL" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", SoftBreak, Str "and", Space, Str "title" ] - ( "/url/", "title" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", SoftBreak, Str "and", Space, Str "title" ] - ( "/url/", "title preceded by two spaces" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", SoftBreak, Str "and", Space, Str "title" ] - ( "/url/", "title preceded by a tab" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", SoftBreak, Str "and", Space, Str "title" ] - ( "/url/", "title with \"quotes\" in it" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", SoftBreak, Str "and", Space, Str "title" ] - ( "/url/", "title with single quotes" ) - ] - , Para - [ Str "Email" - , Space - , Str "link" - , Space - , Str "(nobody" - , Space - , Str "[at]" - , Space - , Str "nowhere.net)" - ] - , Para - [ Link ( "", [], [] ) [ Str "Empty" ] ( "", "" ), Str "." ] - , Header 2 - ( "reference", [], [] ) - [ Str "Reference" ] - , Para - [ Str "Foo" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Foo" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Foo" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "With" - , Space - , Link - ( "", [], [] ) - [ Str "embedded", SoftBreak, Str "[brackets]" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "b" ] - ( "/url/", "" ) - , Space - , Str "by" - , SoftBreak - , Str "itself" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , Para - [ Str "Indented" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "once" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "twice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "thrice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "[not]" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] + [ Str "Auto-links" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "occur" + , Space + , Str "here:" + , SoftBreak + , Code ( "" , [] , [] ) "" + ] , CodeBlock - ( "", [], [] ) "[not]: /url" - , Para - [ Str "Foo" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "Title with \"quotes\" inside" ) - , Str "." - ] - , Para - [ Str "Foo" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "biz" ] - ( "/url/", "Title with \"quote\" inside" ) - , Str "." - ] - , Header 2 - ( "with-ampersands", [], [] ) - [ Str "With", Space, Str "ampersands" ] - , Para - [ Str "Here's" - , Space - , Str "a" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "link" + ( "" , [] , [] ) "or here: " + , Header 1 ( "images" , [] , [] ) [ Str "Images" ] + , Para + [ Str "From" + , Space + , Str "\"Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune\"" + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" + ] + , Para + [ Image + ( "" , [] , [] ) [] ( "lalune.jpg" , "Voyage dans la Lune" ) + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" , SoftBreak - , Str "with" + , Image ( "" , [] , [] ) [] ( "movie.jpg" , "" ) + , SoftBreak + , Str "icon." + ] + , Header 1 ( "footnotes" , [] , [] ) [ Str "Footnotes" ] + , Para + [ Str "Here" , Space - , Str "an" + , Str "is" , Space - , Str "ampersand" + , Str "a" , Space - , Str "in" + , Str "footnote" + , Space + , Str "reference" + , Link ( "" , [] , [] ) [ Str "(1)" ] ( "#note_1" , "" ) + , Str "," + , SoftBreak + , Str "and" + , SoftBreak + , Str "another" + , Link + ( "" , [] , [] ) + [ Str "(longnote)" ] + ( "#note_longnote" , "" ) + , Str "." + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Emph [ Str "not" ] + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Space + , Str "because" + , Space + , Str "it" + , SoftBreak + , Str "contains" + , Space + , Str "a" + , Space + , Str "space^(my" + , Space + , Str "note)." + ] + , Para + [ Link ( "" , [] , [] ) [ Str "(1)" ] ( "#ref_1" , "" ) + , Space + , Str "Here" + , Space + , Str "is" , Space , Str "the" , Space - , Str "URL" - ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Str "link" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Str "amersand" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "link" - , Space - , Str "text:" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "AT&T" ] - ( "http://att.com/", "AT&T" ) - , Str "." - ] - , Para - [ Str "Here's" - , Space - , Str "an" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "inline", SoftBreak, Str "link" ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here's" - , Space - , Str "an" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "inline" + , Str "footnote." + , Space + , Str "It" + , Space + , Str "can" , SoftBreak - , Str "link" + , Str "go" + , Space + , Str "anywhere" , Space , Str "in" , Space - , Str "pointy" - , Space - , Str "braces" - ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Header 2 - ( "autolinks", [], [] ) - [ Str "Autolinks" ] - , Para - [ Str "With" - , Space - , Str "an" - , Space - , Str "ampersand:" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://example.com/?foo=1&bar=2" ] - ( "http://example.com/?foo=1&bar=2", "" ) - ] - , BulletList - [ - [ Para [ Str "In", Space, Str "a", Space, Str "list?" ] ] - , - [ Para - [ Link - ( "", [], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) - ] + , Str "the" + , Space + , Str "document," + , Space + , Str "not" + , Space + , Str "just" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end." ] - , - [ Para [ Str "It", Space, Str "should." ] ] - ] - , Para - [ Str "An" - , Space - , Str "e-mail" - , Space - , Str "address:" - , Space - , Str "nobody" - , Space - , Str "[at]" - , Space - , Str "nowhere.net" - ] - , BlockQuote - [ Para - [ Str "Blockquoted:" + , Para + [ Link + ( "" , [] , [] ) + [ Str "(longnote)" ] + ( "#ref_longnote" , "" ) + , Space + , Str "Here's" , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) - ] - ] - , Para - [ Str "Auto-links" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "occur" - , Space - , Str "here:" - , SoftBreak - , Code - ( "", [], [] ) "" - ] - , CodeBlock - ( "", [], [] ) "or here: " - , Header 1 - ( "images", [], [] ) - [ Str "Images" ] - , Para - [ Str "From" - , Space - , Str "\"Voyage" - , Space - , Str "dans" - , Space - , Str "la" - , Space - , Str "Lune\"" - , Space - , Str "by" - , Space - , Str "Georges" - , Space - , Str "Melies" - , Space - , Str "(1902):" - ] - , Para - [ Image ( "", [], [] ) [] ( "lalune.jpg", "Voyage dans la Lune" ) ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "movie" - , SoftBreak - , Image - ( "", [], [] ) [] - ( "movie.jpg", "" ) - , SoftBreak - , Str "icon." - ] - , Header 1 - ( "footnotes", [], [] ) - [ Str "Footnotes" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference" - , Link - ( "", [], [] ) - [ Str "(1)" ] - ( "#note_1", "" ) - , Str "," - , SoftBreak - , Str "and" - , SoftBreak - , Str "another" - , Link - ( "", [], [] ) - [ Str "(longnote)" ] - ( "#note_longnote", "" ) - , Str "." - , SoftBreak - , Str "This" - , Space - , Str "should" - , Space - , Emph - [ Str "not" ] - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference," - , Space - , Str "because" - , Space - , Str "it" - , SoftBreak - , Str "contains" - , Space - , Str "a" - , Space - , Str "space^(my" - , Space - , Str "note)." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "(1)" ] - ( "#ref_1", "" ) - , Space - , Str "Here" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "footnote." - , Space - , Str "It" - , Space - , Str "can" - , SoftBreak - , Str "go" - , Space - , Str "anywhere" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "document," - , Space - , Str "not" - , Space - , Str "just" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "end." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "(longnote)" ] - ( "#ref_longnote", "" ) - , Space - , Str "Here's" - , SoftBreak - , Str "the" - , Space - , Str "other" - , Space - , Str "note." - , Space - , Str "This" - , Space - , Str "one" - , Space - , Str "contains" - , Space - , Str "multiple" - , Space - , Str "blocks." - ] - , Para - [ Str "Caret" - , Space - , Str "characters" - , Space - , Str "are" - , Space - , Str "used" - , Space - , Str "to" - , Space - , Str "indicate" - , Space - , Str "that" - , Space - , Str "the" - , Space - , Str "blocks" - , Space - , Str "all" - , Space - , Str "belong" - , Space - , Str "to" - , SoftBreak - , Str "a" - , Space - , Str "single" - , Space - , Str "footnote" - , Space - , Str "(as" - , Space - , Str "with" - , Space - , Str "block" - , Space - , Str "quotes)." - ] - , CodeBlock - ( "", [], [] ) " { }" - , Para - [ Str "If" - , Space - , Str "you" - , Space - , Str "want," - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "use" - , Space - , Str "a" - , Space - , Str "caret" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "beginning" - , Space - , Str "of" - , Space - , Str "every" - , Space - , Str "line," - , Space - , Str "as" - , SoftBreak - , Str "with" - , Space - , Str "blockquotes," - , Space - , Str "but" - , Space - , Str "all" - , Space - , Str "that" - , Space - , Str "you" - , Space - , Str "need" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "caret" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "beginning" - , SoftBreak - , Str "of" - , Space - , Str "the" - , Space - , Str "first" - , Space - , Str "line" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "block" - , Space - , Str "and" - , Space - , Str "any" - , Space - , Str "preceding" - , Space - , Str "blank" - , Space - , Str "lines." - ] - , Para - [ Str "text", Space, Emph [ Str "Leading", Space, Str "space" ] ] - , Para - [ Emph [ Str "Trailing", Space, Str "space" ], Space, Str "text" ] - , Para - [ Str "text", Space, Emph [ Str "Leading", Space, Str "spaces" ] ] - , Para - [ Emph [ Str "Trailing", Space, Str "spaces" ], Space, Str "text" ] - , Header 1 - ( "tables", [], [] ) - [ Str "Tables" ] - , Header 2 - ( "tables-with-headers", [], [] ) - [ Str "Tables", Space, Str "with", Space, Str "Headers" ] + , Str "the" + , Space + , Str "other" + , Space + , Str "note." + , Space + , Str "This" + , Space + , Str "one" + , Space + , Str "contains" + , Space + , Str "multiple" + , Space + , Str "blocks." + ] + , Para + [ Str "Caret" + , Space + , Str "characters" + , Space + , Str "are" + , Space + , Str "used" + , Space + , Str "to" + , Space + , Str "indicate" + , Space + , Str "that" + , Space + , Str "the" + , Space + , Str "blocks" + , Space + , Str "all" + , Space + , Str "belong" + , Space + , Str "to" + , SoftBreak + , Str "a" + , Space + , Str "single" + , Space + , Str "footnote" + , Space + , Str "(as" + , Space + , Str "with" + , Space + , Str "block" + , Space + , Str "quotes)." + ] + , CodeBlock ( "" , [] , [] ) " { }" + , Para + [ Str "If" + , Space + , Str "you" + , Space + , Str "want," + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "use" + , Space + , Str "a" + , Space + , Str "caret" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "beginning" + , Space + , Str "of" + , Space + , Str "every" + , Space + , Str "line," + , Space + , Str "as" + , SoftBreak + , Str "with" + , Space + , Str "blockquotes," + , Space + , Str "but" + , Space + , Str "all" + , Space + , Str "that" + , Space + , Str "you" + , Space + , Str "need" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "caret" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "beginning" + , SoftBreak + , Str "of" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "line" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "block" + , Space + , Str "and" + , Space + , Str "any" + , Space + , Str "preceding" + , Space + , Str "blank" + , Space + , Str "lines." + ] + , Para + [ Str "text" + , Space + , Emph [ Str "Leading" , Space , Str "space" ] + ] + , Para + [ Emph [ Str "Trailing" , Space , Str "space" ] + , Space + , Str "text" + ] + , Para + [ Str "text" + , Space + , Emph [ Str "Leading" , Space , Str "spaces" ] + ] + , Para + [ Emph [ Str "Trailing" , Space , Str "spaces" ] + , Space + , Str "text" + ] + , Header 1 ( "tables" , [] , [] ) [ Str "Tables" ] + , Header + 2 + ( "tables-with-headers" , [] , [] ) + [ Str "Tables" + , Space + , Str "with" + , Space + , Str "Headers" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "X" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Y" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Z" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "X" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Y" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Z" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Header + 2 + ( "tables-without-headers" , [] , [] ) + [ Str "Tables" + , Space + , Str "without" + , Space + , Str "Headers" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 2 - ( "tables-without-headers", [], [] ) - [ Str "Tables", Space, Str "without", Space, Str "Headers" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Header + 2 + ( "empty-tables" , [] , [] ) + [ Str "Empty" , Space , Str "Tables" ] + , Para + [ Str "This" + , Space + , Str "section" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "empty." ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 2 - ( "empty-tables", [], [] ) - [ Str "Empty", Space, Str "Tables" ] - , Para - [ Str "This" - , Space - , Str "section" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "empty." - ] ] diff --git a/test/jira-reader.native b/test/jira-reader.native index 7de455cbe..5cb00a929 100644 --- a/test/jira-reader.native +++ b/test/jira-reader.native @@ -1,887 +1,844 @@ Pandoc - ( Meta { unMeta = fromList [] } ) - [ Header 1 - ( "", [], [] ) - [ Span ( "headers", [], [] ) [], Str "Headers" ] - , Header 2 - ( "", [], [] ) - [ Span - ( "level-2-with-an-embedded-link", [], [] ) [] - , Str "Level" - , Space - , Str "2" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "embedded", Space, Str "link" ] - ( "https://test.example/url", "" ) - ] - , Header 3 - ( "", [], [] ) - [ Span - ( "level-3-with-emphasis", [], [] ) [] - , Str "Level" - , Space - , Str "3" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 4 - ( "", [], [] ) - [ Str "Level", Space, Str "4" ] - , Header 5 - ( "", [], [] ) - [ Str "Level", Space, Str "5" ] - , Header 6 - ( "", [], [] ) - [ Str "Level", Space, Str "6" ] - , Para - [ Str "h0." - , Space - , Str "this" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header." - ] - , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Paragraphs" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "regular" - , Space - , Str "paragraph." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "bullet." - , Space - , Str "*" - , Space - , Str "criminey." - ] - , Para - [ Str "There" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "hard" - , Space - , Str "line" - , Space - , Str "break" - , LineBreak - , Str "here." - ] - , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Block", Space, Str "Quotes" ] - , Para - [ Str "E-mail", Space, Str "style:" ] - , BlockQuote - [ Para - [ Str "This" + Meta { unMeta = fromList [] } + [ Header + 1 + ( "" , [] , [] ) + [ Span ( "headers" , [] , [] ) [] , Str "Headers" ] + , Header + 2 + ( "" , [] , [] ) + [ Span ( "level-2-with-an-embedded-link" , [] , [] ) [] + , Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Str "embedded" , Space , Str "link" ] + ( "https://test.example/url" , "" ) + ] + , Header + 3 + ( "" , [] , [] ) + [ Span ( "level-3-with-emphasis" , [] , [] ) [] + , Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 4 ( "" , [] , [] ) [ Str "Level" , Space , Str "4" ] + , Header + 5 ( "" , [] , [] ) [ Str "Level" , Space , Str "5" ] + , Header + 6 ( "" , [] , [] ) [ Str "Level" , Space , Str "6" ] + , Para + [ Str "h0." + , Space + , Str "this" , Space , Str "is" , Space + , Str "not" + , Space , Str "a" , Space - , Str "block" + , Str "header." + ] + , HorizontalRule + , Header 1 ( "" , [] , [] ) [ Str "Paragraphs" ] + , Para + [ Str "Here\8217s" , Space - , Str "quote." + , Str "a" , Space - , Str "It" + , Str "regular" , Space - , Str "is" + , Str "paragraph." + ] + , Para + [ Str "Here\8217s" , Space - , Str "pretty" + , Str "one" , Space - , Str "short." + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , Space + , Str "*" + , Space + , Str "criminey." ] - ] - , BlockQuote - [ Para - [ Str "Code" + , Para + [ Str "There" , Space - , Str "in" + , Str "should" + , Space + , Str "be" , Space , Str "a" , Space - , Str "block" + , Str "hard" + , Space + , Str "line" , Space - , Str "quote:" + , Str "break" + , LineBreak + , Str "here." ] - , CodeBlock - ( "", [ "java" ], [] ) "sub status {\n print \"working\";\n}\n" - , Para - [ Str "An", Space, Str "enumeration:" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "item", Space, Str "one" ] ] - , - [ Para [ Str "item", Space, Str "two" ] ] + , HorizontalRule + , Header + 1 ( "" , [] , [] ) [ Str "Block" , Space , Str "Quotes" ] + , Para [ Str "E-mail" , Space , Str "style:" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , Space + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] + ] + , BlockQuote + [ Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , CodeBlock + ( "" , [ "java" ] , [] ) + "sub status {\n print \"working\";\n}\n" + , Para [ Str "An" , Space , Str "enumeration:" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "item" , Space , Str "one" ] ] + , [ Para [ Str "item" , Space , Str "two" ] ] + ] ] - ] , Para - [ Str "A", Space, Str "following", Space, Str "paragraph." ] + [ Str "A" + , Space + , Str "following" + , Space + , Str "paragraph." + ] , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Code", Space, Str "Blocks" ] - , Para - [ Str "Code:" ] + , Header + 1 ( "" , [] , [] ) [ Str "Code" , Space , Str "Blocks" ] + , Para [ Str "Code:" ] , CodeBlock - ( "" - , [ "java" ] - , [] - ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n" - , Para - [ Str "And:" ] + ( "" , [ "java" ] , [] ) + "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n" + , Para [ Str "And:" ] , CodeBlock - ( "" - , [ "java" ] - , [] - ) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{\n" + ( "" , [ "java" ] , [] ) + " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{\n" , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Span ( "lists", [], [] ) [], Str "Lists" ] - , Header 2 - ( "", [], [] ) - [ Span ( "unordered", [], [] ) [], Str "Unordered" ] - , Para - [ Str "Asterisks:" ] + , Header + 1 + ( "" , [] , [] ) + [ Span ( "lists" , [] , [] ) [] , Str "Lists" ] + , Header + 2 + ( "" , [] , [] ) + [ Span ( "unordered" , [] , [] ) [] , Str "Unordered" ] + , Para [ Str "Asterisks:" ] , BulletList - [ - [ Para [ Str "asterisk", Space, Str "1" ] ] - , - [ Para [ Str "asterisk", Space, Str "2" ] ] - , - [ Para [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses:" ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses:" ] , BulletList - [ - [ Para [ Str "Minus", Space, Str "1" ] ] - , - [ Para [ Str "Minus", Space, Str "2" ] ] - , - [ Para [ Str "Minus", Space, Str "3" ] ] - ] - , Header 2 - ( "", [], [] ) - [ Str "Ordered" ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] + ] + , Header 2 ( "" , [] , [] ) [ Str "Ordered" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para [ Str "Second" ] ] - , - [ Para [ Str "Third" ] ] - ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second" ] ] + , [ Para [ Str "Third" ] ] + ] , Para - [ Str "Linebreak", Space, Str "in", Space, Str "paragraph:" ] + [ Str "Linebreak" + , Space + , Str "in" + , Space + , Str "paragraph:" + ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para - [ Str "Item" - , Space - , Str "1," - , Space - , Str "line" - , Space - , Str "one." - , LineBreak - , Str "Item" - , Space - , Str "1." - , Space - , Str "line" - , Space - , Str "two." - , Space - , Str "The" - , Space - , Str "quick" - , Space - , Str "brown" - , Space - , Str "fox" - , Space - , Str "jumped" - , Space - , Str "over" - , Space - , Str "the" - , Space - , Str "lazy" - , Space - , Str "dog\8217s" - , Space - , Str "back." + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "line" + , Space + , Str "one." + , LineBreak + , Str "Item" + , Space + , Str "1." + , Space + , Str "line" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , Space + , Str "back." + ] ] + , [ Para [ Str "Item" , Space , Str "2." ] ] + , [ Para [ Str "Item" , Space , Str "3." ] ] ] - , - [ Para [ Str "Item", Space, Str "2." ] ] - , - [ Para [ Str "Item", Space, Str "3." ] ] - ] - , Header 2 - ( "", [], [] ) - [ Str "Nested" ] + , Header 2 ( "" , [] , [] ) [ Str "Nested" ] , BulletList - [ - [ Para - [ Str "Tab" ] - , BulletList - [ - [ Para [ Str "Tab" ], BulletList [ [ Para [ Str "Tab" ] ] ] ] + [ [ Para [ Str "Tab" ] + , BulletList + [ [ Para [ Str "Tab" ] + , BulletList [ [ Para [ Str "Tab" ] ] ] + ] + ] ] ] - ] - , Para - [ Str "Here\8217s", Space, Str "another:" ] + , Para [ Str "Here\8217s" , Space , Str "another:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Para [ Str "Fee" ] ] - , - [ Para [ Str "Fie" ] ] - , - [ Para [ Str "Foe" ] ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Para [ Str "Fee" ] ] + , [ Para [ Str "Fie" ] ] + , [ Para [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "Nested", Space, Str "enumerations:" ] + , Para [ Str "Nested" , Space , Str "enumerations:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para - [ Str "Essential" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para - [ Str "Important" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para - [ Str "Relevant" ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "Essential" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "Important" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Para [ Str "Insignificant" ] ] ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "Relevant" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "Insignificant" ] ] ] + ] + ] ] ] - ] ] ] - ] , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Linebreaks" - , Space - , Str "and" - , Space - , Str "Markup" - , Space - , Str "in" - , Space - , Str "Lists" - ] + , Header + 1 + ( "" , [] , [] ) + [ Str "Linebreaks" + , Space + , Str "and" + , Space + , Str "Markup" + , Space + , Str "in" + , Space + , Str "Lists" + ] , BulletList - [ - [ Para - [ Strong - [ Str "apple" ] - , LineBreak - , Str "red" - , Space - , Str "fruit" + [ [ Para + [ Strong [ Str "apple" ] + , LineBreak + , Str "red" + , Space + , Str "fruit" + ] ] - ] - , - [ Para - [ Strong - [ Str "orange" ] - , LineBreak - , Str "orange" - , Space - , Str "fruit" + , [ Para + [ Strong [ Str "orange" ] + , LineBreak + , Str "orange" + , Space + , Str "fruit" + ] ] - ] - , - [ Para - [ Strong - [ Str "banana" ] - , LineBreak - , Str "yellow" - , Space - , Str "fruit" + , [ Para + [ Strong [ Str "banana" ] + , LineBreak + , Str "yellow" + , Space + , Str "fruit" + ] ] ] - ] , Para - [ Str "Multiple" - , Space - , Str "blocks" - , Space - , Str "with" - , Space - , Str "italics:" - ] - , BulletList - [ - [ Para - [ Strong - [ Emph [ Str "apple" ] ] - , LineBreak - , Str "red" - , Space - , Str "fruit" - , LineBreak - , Str "contains" - , Space - , Str "seeds," - , Space - , Str "crisp," - , Space - , Str "pleasant" - , Space - , Str "to" - , Space - , Str "taste" - ] + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "with" + , Space + , Str "italics:" ] - , - [ Para - [ Strong - [ Emph [ Str "orange" ] ] - , LineBreak - , Str "orange" - , Space - , Str "fruit" + , BulletList + [ [ Para + [ Strong [ Emph [ Str "apple" ] ] + , LineBreak + , Str "red" + , Space + , Str "fruit" + , LineBreak + , Str "contains" + , Space + , Str "seeds," + , Space + , Str "crisp," + , Space + , Str "pleasant" + , Space + , Str "to" + , Space + , Str "taste" + ] ] - , CodeBlock - ( "", [ "java" ], [] ) "{ orange code block }\n" - , BlockQuote - [ Para - [ Str "orange", Space, Str "block", Space, Str "quote" ] + , [ Para + [ Strong [ Emph [ Str "orange" ] ] + , LineBreak + , Str "orange" + , Space + , Str "fruit" + ] + , CodeBlock + ( "" , [ "java" ] , [] ) "{ orange code block }\n" + , BlockQuote + [ Para + [ Str "orange" + , Space + , Str "block" + , Space + , Str "quote" + ] + ] ] ] - ] , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Colored", Space, Str "Text", Space, Str "Blocks" ] + , Header + 1 + ( "" , [] , [] ) + [ Str "Colored" + , Space + , Str "Text" + , Space + , Str "Blocks" + ] , Div - ( "", [], [ ( "color", "red" ) ] ) - [ Para - [ LineBreak, Str "This", Space, Str "is", Space, Str "red." ] - ] - , Header 2 - ( "", [], [] ) - [ Str "Eiffel", Space, Str "65" ] + ( "" , [] , [ ( "color" , "red" ) ] ) + [ Para + [ LineBreak + , Str "This" + , Space + , Str "is" + , Space + , Str "red." + ] + ] + , Header + 2 ( "" , [] , [] ) [ Str "Eiffel" , Space , Str "65" ] , Div - ( "", [], [ ( "color", "blue" ) ] ) - [ Para [ LineBreak, Str "da", Space, Str "ba", Space, Str "dee" ] ] + ( "" , [] , [ ( "color" , "blue" ) ] ) + [ Para + [ LineBreak + , Str "da" + , Space + , Str "ba" + , Space + , Str "dee" + ] + ] , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Inline", Space, Str "Markup" ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "emphasized" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Emph - [ Str "is", Space, Str "this" ] - , Str "." - ] + , Header + 1 ( "" , [] , [] ) [ Str "Inline" , Space , Str "Markup" ] , Para - [ Str "This" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Strong - [ Str "is", Space, Str "this" ] - , Str "." - ] + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph [ Str "is" , Space , Str "this" ] + , Str "." + ] , Para - [ Str "An" - , Space - , Emph - [ Link - ( "", [], [] ) - [ Str "emphasized", Space, Str "link" ] - ( "https://my.example/url", "" ) + [ Str "This" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Strong [ Str "is" , Space , Str "this" ] + , Str "." ] - , Str "." - ] , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] + [ Str "An" + , Space + , Emph + [ Link + ( "" , [] , [] ) + [ Str "emphasized" , Space , Str "link" ] + ( "https://my.example/url" , "" ) + ] + , Str "." ] - ] , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "code:" - , Space - , Code - ( "", [], [] ) ">" - , Str "," - , Space - , Code - ( "", [], [] ) "$" - , Str "," - , Space - , Code - ( "", [], [] ) "\\" - , Str "," - , Space - , Code - ( "", [], [] ) "\\$" - , Str "," - , Space - , Code - ( "", [], [] ) "" - , Str "." - ] + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] , Para - [ Strikeout [ Str "This" , Space , Str "is" , Space - , Emph - [ Str "strikeout" ] + , Str "code:" + , Space + , Code ( "" , [] , [] ) ">" + , Str "," + , Space + , Code ( "" , [] , [] ) "$" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\$" + , Str "," + , Space + , Code ( "" , [] , [] ) "" , Str "." ] - ] - , Para - [ Str "Superscripts:" - , Space - , Str "a" - , Superscript - [ Str "bc" ] - , Str "d" - , Space - , Str "a" - , Superscript - [ Emph [ Str "hello" ] ] - , Space - , Str "a" - , Superscript - [ Str "hello\160there" ] - , Str "." - ] , Para - [ Str "Subscripts:" - , Space - , Str "H" - , Subscript - [ Str "2" ] - , Str "O," - , Space - , Str "C" - , Subscript - [ Str "6" ] - , Str "H" - , Subscript - [ Str "12" ] - , Str "O" - , Subscript - [ Str "6" ] - , Str "," - , Space - , Str "C" - , Subscript - [ Str "\160n\160" ] - , Str "H" - , Subscript - [ Emph [ Str "2n" ] ] - , Str "O" - , Subscript - [ Str "n" ] - , Str "." - ] + [ Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "strikeout" ] + , Str "." + ] + ] , Para - [ Str "These" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "superscripts" - , Space - , Str "or" - , Space - , Str "subscripts," - , Space - , Str "because" - , Space - , Str "of" - , Space - , Str "markers" - , Space - , Str "used" - , Space - , Str "within" - , Space - , Str "words:" - , Space - , Str "a^b" - , Space - , Str "c^d," - , Space - , Str "a~b" - , Space - , Str "c~d." - ] - , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Dashes,", Space, Str "and", Space, Str "emoticons" ] + [ Str "Superscripts:" + , Space + , Str "a" + , Superscript [ Str "bc" ] + , Str "d" + , Space + , Str "a" + , Superscript [ Emph [ Str "hello" ] ] + , Space + , Str "a" + , Superscript [ Str "hello\160there" ] + , Str "." + ] , Para - [ Str "Some" - , Space - , Str "dashes:" - , Space - , Str "one" - , Space - , Str "\8211" - , Space - , Str "two" - , Space - , Str "\8212" - , Space - , Str "three." - ] + [ Str "Subscripts:" + , Space + , Str "H" + , Subscript [ Str "2" ] + , Str "O," + , Space + , Str "C" + , Subscript [ Str "6" ] + , Str "H" + , Subscript [ Str "12" ] + , Str "O" + , Subscript [ Str "6" ] + , Str "," + , Space + , Str "C" + , Subscript [ Str "\160n\160" ] + , Str "H" + , Subscript [ Emph [ Str "2n" ] ] + , Str "O" + , Subscript [ Str "n" ] + , Str "." + ] , Para - [ Str "Sure" - , Space - , Str "\10004" - , LineBreak - , Str "Nope" - , Space - , Str "\10060" - ] + [ Str "These" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "superscripts" + , Space + , Str "or" + , Space + , Str "subscripts," + , Space + , Str "because" + , Space + , Str "of" + , Space + , Str "markers" + , Space + , Str "used" + , Space + , Str "within" + , Space + , Str "words:" + , Space + , Str "a^b" + , Space + , Str "c^d," + , Space + , Str "a~b" + , Space + , Str "c~d." + ] + , HorizontalRule + , Header + 1 + ( "" , [] , [] ) + [ Str "Dashes," + , Space + , Str "and" + , Space + , Str "emoticons" + ] , Para - [ Str "Nice", Space, Str "\128515" ] + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one" + , Space + , Str "\8211" + , Space + , Str "two" + , Space + , Str "\8212" + , Space + , Str "three." + ] , Para - [ Str "Capital", Space, Str "d:D" ] + [ Str "Sure" + , Space + , Str "\10004" + , LineBreak + , Str "Nope" + , Space + , Str "\10060" + ] + , Para [ Str "Nice" , Space , Str "\128515" ] + , Para [ Str "Capital" , Space , Str "d:D" ] , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Math" ] + , Header 1 ( "" , [] , [] ) [ Str "Math" ] , BulletList - [ - [ Para [ Str "2\8197+\8197\&2\8196=\8196\&4" ] ] - , - [ Para - [ Emph [ Str "x" ], Str "\8196\8712\8196", Emph [ Str "y" ] ] - ] - , - [ Para - [ Emph - [ Str "\945" ] - , Str "\8197\8743\8197" - , Emph - [ Str "\969" ] + [ [ Para [ Str "2\8197+\8197\&2\8196=\8196\&4" ] ] + , [ Para + [ Emph [ Str "x" ] + , Str "\8196\8712\8196" + , Emph [ Str "y" ] + ] ] - ] - , - [ Para [ Emph [ Str "p" ], Str "-Tree" ] ] - , - [ Para - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "more:" - , Space - , Emph - [ Str "\945" ] - , Str "\8197+\8197" - , Emph - [ Str "\969" ] - , Str "\8197\215\8197" - , Emph - [ Str "x" ] - , Superscript - [ Str "2" ] - , Str "." + , [ Para + [ Emph [ Str "\945" ] + , Str "\8197\8743\8197" + , Emph [ Str "\969" ] + ] + ] + , [ Para [ Emph [ Str "p" ] , Str "-Tree" ] ] + , [ Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "more:" + , Space + , Emph [ Str "\945" ] + , Str "\8197+\8197" + , Emph [ Str "\969" ] + , Str "\8197\215\8197" + , Emph [ Str "x" ] + , Superscript [ Str "2" ] + , Str "." + ] ] ] - ] , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Special", Space, Str "Characters" ] + , Header + 1 + ( "" , [] , [] ) + [ Str "Special" , Space , Str "Characters" ] , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "unicode:" - ] + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "unicode:" + ] , BulletList - [ - [ Para [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] - , - [ Para [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] - , - [ Para [ Str "section:", Space, Str "\167" ] ] - , - [ Para - [ Str "set", Space, Str "membership:", Space, Str "\8712" ] + [ [ Para + [ Str "I" , Space , Str "hat:" , Space , Str "\206" ] + ] + , [ Para + [ Str "o" , Space , Str "umlaut:" , Space , Str "\246" ] + ] + , [ Para [ Str "section:" , Space , Str "\167" ] ] + , [ Para + [ Str "set" + , Space + , Str "membership:" + , Space + , Str "\8712" + ] + ] + , [ Para [ Str "copyright:" , Space , Str "\169" ] ] ] - , - [ Para [ Str "copyright:", Space, Str "\169" ] ] - ] - , Para - [ Str "AT&T" - , Space - , Str "has" - , Space - , Str "an" - , Space - , Str "ampersand" - , Space - , Str "in" - , Space - , Str "their" - , Space - , Str "name." - ] - , Para - [ Str "AT&T" - , Space - , Str "is" - , Space - , Str "another" - , Space - , Str "way" - , Space - , Str "to" - , Space - , Str "write" - , Space - , Str "it." - ] - , Para - [ Str "This", Space, Str "&", Space, Str "that." ] - , Para - [ Str "4", Space, Str "<", Space, Str "5." ] - , Para - [ Str "6", Space, Str ">", Space, Str "5." ] - , Para - [ Str "Backslash:", Space, Str "\\" ] - , Para - [ Str "Backtick:", Space, Str "`" ] - , Para - [ Str "Asterisk:", Space, Str "*" ] - , Para - [ Str "Underscore:", Space, Str "_" ] - , Para - [ Str "Left", Space, Str "brace:", Space, Str "{" ] , Para - [ Str "Right", Space, Str "brace:", Space, Str "}" ] - , Para - [ Str "Left", Space, Str "bracket:", Space, Str "[" ] - , Para - [ Str "Right", Space, Str "bracket:", Space, Str "]" ] + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] , Para - [ Str "Left", Space, Str "paren:", Space, Str "(" ] + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] , Para - [ Str "Right", Space, Str "paren:", Space, Str ")" ] + [ Str "This" , Space , Str "&" , Space , Str "that." ] + , Para [ Str "4" , Space , Str "<" , Space , Str "5." ] + , Para [ Str "6" , Space , Str ">" , Space , Str "5." ] + , Para [ Str "Backslash:" , Space , Str "\\" ] + , Para [ Str "Backtick:" , Space , Str "`" ] + , Para [ Str "Asterisk:" , Space , Str "*" ] + , Para [ Str "Underscore:" , Space , Str "_" ] , Para - [ Str "Greater-than:", Space, Str ">" ] + [ Str "Left" , Space , Str "brace:" , Space , Str "{" ] , Para - [ Str "Hash:", Space, Str "#" ] + [ Str "Right" , Space , Str "brace:" , Space , Str "}" ] , Para - [ Str "Period:", Space, Str "." ] + [ Str "Left" , Space , Str "bracket:" , Space , Str "[" ] , Para - [ Str "Bang:", Space, Str "!" ] + [ Str "Right" , Space , Str "bracket:" , Space , Str "]" ] , Para - [ Str "Plus:", Space, Str "+" ] + [ Str "Left" , Space , Str "paren:" , Space , Str "(" ] , Para - [ Str "Minus:", Space, Str "-" ] + [ Str "Right" , Space , Str "paren:" , Space , Str ")" ] + , Para [ Str "Greater-than:" , Space , Str ">" ] + , Para [ Str "Hash:" , Space , Str "#" ] + , Para [ Str "Period:" , Space , Str "." ] + , Para [ Str "Bang:" , Space , Str "!" ] + , Para [ Str "Plus:" , Space , Str "+" ] + , Para [ Str "Minus:" , Space , Str "-" ] , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Links" ] - , Header 2 - ( "", [], [] ) - [ Str "Explicit" ] + , Header 1 ( "" , [] , [] ) [ Str "Links" ] + , Header 2 ( "" , [] , [] ) [ Str "Explicit" ] , Para - [ Str "Just" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "URL" ] - ( "https://example.org/url", "" ) - , Str "." - ] + [ Str "Just" + , Space + , Str "a" + , Space + , Link + ( "" , [] , [] ) + [ Str "URL" ] + ( "https://example.org/url" , "" ) + , Str "." + ] , Para - [ Link - ( "", [], [] ) - [ Str "File", Space, Str "URL" ] - ( "file://some/file/name/", "" ) - , Str "." - ] + [ Link + ( "" , [] , [] ) + [ Str "File" , Space , Str "URL" ] + ( "file://some/file/name/" , "" ) + , Str "." + ] , Para - [ Link - ( "", [], [] ) - [ Str "IRC", Space, Str "link" ] - ( "irc://example.org/pandoc", "" ) - , Str "." - ] + [ Link + ( "" , [] , [] ) + [ Str "IRC" , Space , Str "link" ] + ( "irc://example.org/pandoc" , "" ) + , Str "." + ] , Para - [ Link - ( "", [], [] ) - [ Str "Email", Space, Str "link" ] - ( "mailto:nobody@nowhere.invalid", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "Email" , Space , Str "link" ] + ( "mailto:nobody@nowhere.invalid" , "" ) + ] + , Para + [ Str "[Not" + , Space + , Str "a" + , Space + , Str "link|not" + , Space + , Str "a" + , Space + , Str "URL]." + ] + , Header 2 ( "" , [] , [] ) [ Str "Reference" ] , Para - [ Str "[Not" - , Space - , Str "a" - , Space - , Str "link|not" - , Space - , Str "a" - , Space - , Str "URL]." - ] - , Header 2 - ( "", [], [] ) - [ Str "Reference" ] + [ Str "With" + , Space + , Link + ( "" , [] , [] ) + [ Str "embedded" , Space , Str "[brackets]" ] + ( "https://example.net/url/" , "" ) + , Str "." + ] , Para - [ Str "With" - , Space - , Link - ( "", [], [] ) - [ Str "embedded", Space, Str "[brackets]" ] - ( "https://example.net/url/", "" ) - , Str "." - ] + [ Link + ( "" , [] , [] ) + [ Str "https://pandoc.org" ] + ( "https://pandoc.org" , "" ) + , Space + , Str "by" + , Space + , Str "itself" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , Header + 2 ( "" , [] , [] ) [ Str "With" , Space , Str "ampersands" ] , Para - [ Link - ( "", [], [] ) - [ Str "https://pandoc.org" ] - ( "https://pandoc.org", "" ) - , Space - , Str "by" - , Space - , Str "itself" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , Header 2 - ( "", [], [] ) - [ Str "With", Space, Str "ampersands" ] + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Link + ( "" , [] , [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2" , "" ) + , Str "." + ] , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "link" + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "link" , Space , Str "with" , Space @@ -893,132 +850,98 @@ Pandoc , Space , Str "the" , Space - , Str "URL" + , Str "link" + , Space + , Str "text:" + , Space + , Link + ( "" , [] , [] ) [ Str "AT&T" ] ( "http://att.com/" , "" ) + , Str "." ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Str "." - ] + , Header 2 ( "" , [] , [] ) [ Str "Autolinks" ] , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "link" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Str "ampersand" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "link" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "AT&T" ] - ( "http://att.com/", "" ) - , Str "." - ] - , Header 2 - ( "", [], [] ) - [ Str "Autolinks" ] - , Para - [ Str "With" - , Space - , Str "an" - , Space - , Str "ampersand:" - , Space - , Link - ( "", [], [] ) - [ Str "http://example.com/?foo=1&bar=2" ] - ( "http://example.com/?foo=1&bar=2", "" ) - ] + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + ] , BulletList - [ - [ Para [ Str "In", Space, Str "a", Space, Str "list?" ] ] - , - [ Para - [ Link - ( "", [], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) + [ [ Para + [ Str "In" , Space , Str "a" , Space , Str "list?" ] + ] + , [ Para + [ Link + ( "" , [] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] ] + , [ Para [ Str "It" , Space , Str "should." ] ] ] - , - [ Para [ Str "It", Space, Str "should." ] ] - ] , Para - [ Str "An" - , Space - , Str "e-mail" - , Space - , Str "address:" - , Space - , Link - ( "", [], [] ) - [ Str "mailto:nobody@nowhere.invalid" ] - ( "mailto:nobody@nowhere.invalid", "" ) - ] - , BlockQuote - [ Para - [ Str "Blockquoted:" + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" , Space , Link - ( "", [], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) + ( "" , [] , [] ) + [ Str "mailto:nobody@nowhere.invalid" ] + ( "mailto:nobody@nowhere.invalid" , "" ) + ] + , BlockQuote + [ Para + [ Str "Blockquoted:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] ] - ] , CodeBlock - ( "" - , [ "java" ] - , [] - ) "Autolink should not occur here: \n" + ( "" , [ "java" ] , [] ) + "Autolink should not occur here: \n" , HorizontalRule - , Header 1 - ( "", [], [] ) - [ Str "Images" ] - , Para - [ Str "From" - , Space - , Str "\"Voyage" - , Space - , Str "dans" - , Space - , Str "la" - , Space - , Str "Lune\"" - , Space - , Str "by" - , Space - , Str "Georges" - , Space - , Str "Melies" - , Space - , Str "(1902):" - ] + , Header 1 ( "" , [] , [] ) [ Str "Images" ] , Para - [ Image ( "", [], [] ) [] ( "lalune.jpg", "" ) ] + [ Str "From" + , Space + , Str "\"Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune\"" + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" + ] + , Para [ Image ( "" , [] , [] ) [] ( "lalune.jpg" , "" ) ] , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "movie" - , Space - , Image - ( "", [], [] ) [] - ( "movie.jpg", "" ) - , Space - , Str "icon." - ] + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space + , Image ( "" , [] , [] ) [] ( "movie.jpg" , "" ) + , Space + , Str "icon." + ] ] diff --git a/test/latex-reader.native b/test/latex-reader.native index 82ef0506e..2be447c0d 100644 --- a/test/latex-reader.native +++ b/test/latex-reader.native @@ -1,682 +1,558 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "author" - , MetaList - [ MetaInlines - [ Str "John", Space, Str "MacFarlane" ] - , MetaInlines - [ Str "Anonymous" ] + Meta + { unMeta = + fromList + [ ( "author" + , MetaList + [ MetaInlines [ Str "John" , Space , Str "MacFarlane" ] + , MetaInlines [ Str "Anonymous" ] + ] + ) + , ( "date" + , MetaInlines + [ Str "July" , Space , Str "17," , Space , Str "2006" ] + ) + , ( "title" + , MetaInlines + [ Str "Pandoc" + , Space + , Str "Test" + , Space + , Str "Suite" + ] + ) ] - ) - , - ( "date" - , MetaInlines - [ Str "July", Space, Str "17,", Space, Str "2006" ] - ) - , - ( "title" - , MetaInlines - [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] - ) - ] } - ) - [ RawBlock - ( Format "latex" ) "\\maketitle" - , 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 "Most" - , Space - , Str "of" - , Space - , Str "them" - , Space - , Str "are" - , Space - , Str "adapted" - , Space - , Str "from" - , SoftBreak - , Str "John" - , Space - , Str "Gruber\8217s" - , Space - , Str "markdown" - , Space - , Str "test" - , Space - , Str "suite." - ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "headers", [], [] ) - [ Str "Headers" ] - , 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" ] - ( "/url", "" ) - ] - , Header 3 - ( "level-3-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "3" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Para - [ Str "Level", Space, Str "4" ] - , Para - [ Str "Level", Space, Str "5" ] - , Header 1 - ( "level-1", [], [] ) - [ Str "Level", Space, Str "1" ] - , Header 2 - ( "level-2-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "2" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 3 - ( "level-3", [], [] ) - [ Str "Level", Space, Str "3" ] - , Para - [ Str "with" - , Space - , Str "no" - , Space - , Str "blank" - , Space - , Str "line" - ] - , Header 2 - ( "level-2", [], [] ) - [ Str "Level", Space, Str "2" ] - , Para - [ Str "with" - , Space - , Str "no" - , Space - , Str "blank" - , Space - , Str "line" - ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "paragraphs", [], [] ) - [ Str "Paragraphs" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "regular" - , Space - , Str "paragraph." - ] - , Para - [ Str "In" - , Space - , Str "Markdown" - , Space - , Str "1.0.0" - , Space - , Str "and" - , Space - , Str "earlier." - , Space - , Str "Version" - , Space - , Str "8." - , Space - , Str "This" - , Space - , Str "line" - , Space - , Str "turns" - , Space - , Str "into" - , Space - , Str "a" - , SoftBreak - , Str "list" - , Space - , Str "item." - , Space - , Str "Because" - , Space - , Str "a" - , Space - , Str "hard-wrapped" - , Space - , Str "line" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "middle" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "paragraph" - , SoftBreak - , Str "looked" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "bullet." - , Space - , Str "*" - , Space - , Str "criminey." - ] - , Para - [ Str "There" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "hard" - , Space - , Str "line" - , Space - , Str "break" - , LineBreak - , Str "here." - ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "block-quotes", [], [] ) - [ Str "Block", Space, Str "Quotes" ] - , Para - [ Str "E-mail", Space, Str "style:" ] - , BlockQuote - [ Para + [ RawBlock (Format "latex") "\\maketitle" + , Para [ Str "This" , Space , Str "is" , Space , Str "a" , Space - , Str "block" + , Str "set" , Space - , Str "quote." + , Str "of" , Space - , Str "It" + , Str "tests" , Space - , Str "is" + , Str "for" + , Space + , Str "pandoc." + , Space + , Str "Most" + , Space + , Str "of" + , Space + , Str "them" , Space - , Str "pretty" + , Str "are" , Space - , Str "short." + , Str "adapted" + , Space + , Str "from" + , SoftBreak + , Str "John" + , Space + , Str "Gruber\8217s" + , Space + , Str "markdown" + , Space + , Str "test" + , Space + , Str "suite." ] - ] - , BlockQuote - [ Para - [ Str "Code" + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header 1 ( "headers" , [] , [] ) [ Str "Headers" ] + , 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" ] + ( "/url" , "" ) + ] + , Header + 3 + ( "level-3-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Para [ Str "Level" , Space , Str "4" ] + , Para [ Str "Level" , Space , Str "5" ] + , Header + 1 ( "level-1" , [] , [] ) [ Str "Level" , Space , Str "1" ] + , Header + 2 + ( "level-2-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 3 ( "level-3" , [] , [] ) [ Str "Level" , Space , Str "3" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Header + 2 ( "level-2" , [] , [] ) [ Str "Level" , Space , Str "2" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header 1 ( "paragraphs" , [] , [] ) [ Str "Paragraphs" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , Space + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , SoftBreak + , Str "list" + , Space + , Str "item." + , Space + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" , Space , Str "in" , Space + , Str "the" + , Space + , Str "middle" + , Space + , Str "of" + , Space , Str "a" , Space - , Str "block" + , Str "paragraph" + , SoftBreak + , Str "looked" , Space - , Str "quote:" + , Str "like" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , Space + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" + , LineBreak + , Str "here." ] - , CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - , Para - [ Str "A", Space, Str "list:" ] - , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "item", Space, Str "one" ] ] - , - [ Para [ Str "item", Space, Str "two" ] ] - ] - , Para - [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] - , BlockQuote - [ Para [ Str "nested" ] ] - , BlockQuote - [ Para [ Str "nested" ] ] - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "block" - , Space - , Str "quote:" - , Space - , Str "2" - , Space - , Str ">" - , Space - , Str "1." - ] - , Para - [ Str "Box-style:" ] + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header + 1 + ( "block-quotes" , [] , [] ) + [ Str "Block" , Space , Str "Quotes" ] + , Para [ Str "E-mail" , Space , Str "style:" ] , BlockQuote - [ Para - [ Str "Example:" ] - , CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - ] + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , Space + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] + ] , BlockQuote - [ OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "do", Space, Str "laundry" ] ] - , - [ Para - [ Str "take" + [ Para + [ Str "Code" , Space - , Str "out" + , Str "in" , Space - , Str "the" + , Str "a" + , Space + , Str "block" , Space - , Str "trash" + , Str "quote:" + ] + , CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + , Para [ Str "A" , Space , Str "list:" ] + , OrderedList + ( 1 , Decimal , Period ) + [ [ Para [ Str "item" , Space , Str "one" ] ] + , [ Para [ Str "item" , Space , Str "two" ] ] + ] + , Para + [ Str "Nested" + , Space + , Str "block" + , Space + , Str "quotes:" + ] + , BlockQuote [ Para [ Str "nested" ] ] + , BlockQuote [ Para [ Str "nested" ] ] + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + , Space + , Str "2" + , Space + , Str ">" + , Space + , Str "1." + ] + , Para [ Str "Box-style:" ] + , BlockQuote + [ Para [ Str "Example:" ] + , CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + ] + , BlockQuote + [ OrderedList + ( 1 , Decimal , Period ) + [ [ Para [ Str "do" , Space , Str "laundry" ] ] + , [ Para + [ Str "take" + , Space + , Str "out" + , Space + , Str "the" + , Space + , Str "trash" + ] + ] ] - ] ] - ] , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "nested" - , Space - , Str "one:" - ] + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "nested" + , Space + , Str "one:" + ] , BlockQuote - [ Para - [ Str "Joe", Space, Str "said:" ] - , BlockQuote - [ Para [ Str "Don\8217t", Space, Str "quote", Space, Str "me." ] ] - ] - , Para - [ Str "And" - , Space - , Str "a" - , Space - , Str "following" - , Space - , Str "paragraph." - ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "code-blocks", [], [] ) - [ Str "Code", Space, Str "Blocks" ] - , Para - [ Str "Code:" ] - , CodeBlock - ( "" - , [] - , [] - ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + [ Para [ Str "Joe" , Space , Str "said:" ] + , BlockQuote + [ Para + [ Str "Don\8217t" + , Space + , Str "quote" + , Space + , Str "me." + ] + ] + ] , Para - [ Str "And:" ] + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header + 1 + ( "code-blocks" , [] , [] ) + [ Str "Code" , Space , Str "Blocks" ] + , Para [ Str "Code:" ] + , CodeBlock + ( "" , [] , [] ) + "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + , Para [ Str "And:" ] , CodeBlock - ( "" - , [] - , [] - ) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" - , Para - [ Str "this" - , Space - , Str "has" - , Space - , Emph - [ Str "two", LineBreak, Str "lines" ] - ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "lists", [], [] ) - [ Str "Lists" ] - , Header 2 - ( "unordered", [], [] ) - [ Str "Unordered" ] - , Para - [ Str "Asterisks", Space, Str "tight:" ] + ( "" , [] , [] ) + " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + , Para + [ Str "this" + , Space + , Str "has" + , Space + , Emph [ Str "two" , LineBreak , Str "lines" ] + ] + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header 1 ( "lists" , [] , [] ) [ Str "Lists" ] + , Header 2 ( "unordered" , [] , [] ) [ Str "Unordered" ] + , Para [ Str "Asterisks" , Space , Str "tight:" ] , BulletList - [ - [ Para [ Str "asterisk", Space, Str "1" ] ] - , - [ Para [ Str "asterisk", Space, Str "2" ] ] - , - [ Para [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Asterisks", Space, Str "loose:" ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Asterisks" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "asterisk", Space, Str "1" ] ] - , - [ Para [ Str "asterisk", Space, Str "2" ] ] - , - [ Para [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "tight:" ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "tight:" ] , BulletList - [ - [ Para [ Str "Plus", Space, Str "1" ] ] - , - [ Para [ Str "Plus", Space, Str "2" ] ] - , - [ Para [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "loose:" ] + [ [ Para [ Str "Plus" , Space , Str "1" ] ] + , [ Para [ Str "Plus" , Space , Str "2" ] ] + , [ Para [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Plus", Space, Str "1" ] ] - , - [ Para [ Str "Plus", Space, Str "2" ] ] - , - [ Para [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "tight:" ] + [ [ Para [ Str "Plus" , Space , Str "1" ] ] + , [ Para [ Str "Plus" , Space , Str "2" ] ] + , [ Para [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "tight:" ] , BulletList - [ - [ Para [ Str "Minus", Space, Str "1" ] ] - , - [ Para [ Str "Minus", Space, Str "2" ] ] - , - [ Para [ Str "Minus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "loose:" ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Minus", Space, Str "1" ] ] - , - [ Para [ Str "Minus", Space, Str "2" ] ] - , - [ Para [ Str "Minus", Space, Str "3" ] ] - ] - , Header 2 - ( "ordered", [], [] ) - [ Str "Ordered" ] - , Para - [ Str "Tight:" ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] + ] + , Header 2 ( "ordered" , [] , [] ) [ Str "Ordered" ] + , Para [ Str "Tight:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para [ Str "Second" ] ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "and:" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second" ] ] + , [ Para [ Str "Third" ] ] + ] + , Para [ Str "and:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "One" ] ] - , - [ Para [ Str "Two" ] ] - , - [ Para [ Str "Three" ] ] - ] - , Para - [ Str "Loose", Space, Str "using", Space, Str "tabs:" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "One" ] ] + , [ Para [ Str "Two" ] ] + , [ Para [ Str "Three" ] ] + ] + , Para + [ Str "Loose" , Space , Str "using" , Space , Str "tabs:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para [ Str "Second" ] ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "and", Space, Str "using", Space, Str "spaces:" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second" ] ] + , [ Para [ Str "Third" ] ] + ] + , Para + [ Str "and" , Space , Str "using" , Space , Str "spaces:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "One" ] ] - , - [ Para [ Str "Two" ] ] - , - [ Para [ Str "Three" ] ] - ] - , Para - [ Str "Multiple", Space, Str "paragraphs:" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "One" ] ] + , [ Para [ Str "Two" ] ] + , [ Para [ Str "Three" ] ] + ] + , Para [ Str "Multiple" , Space , Str "paragraphs:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para - [ Str "Item" - , Space - , Str "1," - , Space - , Str "graf" - , Space - , Str "one." - ] - , Para - [ Str "Item" - , Space - , Str "1." - , Space - , Str "graf" - , Space - , Str "two." - , Space - , Str "The" - , Space - , Str "quick" - , Space - , Str "brown" - , Space - , Str "fox" - , Space - , Str "jumped" - , Space - , Str "over" - , Space - , Str "the" - , Space - , Str "lazy" - , Space - , Str "dog\8217s" - , SoftBreak - , Str "back." + ( 1 , Decimal , Period ) + [ [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , SoftBreak + , Str "back." + ] ] + , [ Para [ Str "Item" , Space , Str "2." ] ] + , [ Para [ Str "Item" , Space , Str "3." ] ] ] - , - [ Para [ Str "Item", Space, Str "2." ] ] - , - [ Para [ Str "Item", Space, Str "3." ] ] - ] - , Header 2 - ( "nested", [], [] ) - [ Str "Nested" ] + , Header 2 ( "nested" , [] , [] ) [ Str "Nested" ] , BulletList - [ - [ Para - [ Str "Tab" ] - , BulletList - [ - [ Para [ Str "Tab" ], BulletList [ [ Para [ Str "Tab" ] ] ] ] + [ [ Para [ Str "Tab" ] + , BulletList + [ [ Para [ Str "Tab" ] + , BulletList [ [ Para [ Str "Tab" ] ] ] + ] + ] ] ] - ] - , Para - [ Str "Here\8217s", Space, Str "another:" ] + , Para [ Str "Here\8217s" , Space , Str "another:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Para [ Str "Fee" ] ] - , - [ Para [ Str "Fie" ] ] - , - [ Para [ Str "Foe" ] ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Para [ Str "Fee" ] ] + , [ Para [ Str "Fie" ] ] + , [ Para [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] + ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "Same" - , Space - , Str "thing" - , Space - , Str "but" - , Space - , Str "with" - , Space - , Str "paragraphs:" - ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Para [ Str "Fee" ] ] - , - [ Para [ Str "Fie" ] ] - , - [ Para [ Str "Foe" ] ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Para [ Str "Fee" ] ] + , [ Para [ Str "Fie" ] ] + , [ Para [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] ] - , - [ Para [ Str "Third" ] ] - ] - , Header 2 - ( "tabs-and-spaces", [], [] ) - [ Str "Tabs", Space, Str "and", Space, Str "spaces" ] + , Header + 2 + ( "tabs-and-spaces" , [] , [] ) + [ Str "Tabs" , Space , Str "and" , Space , Str "spaces" ] , BulletList - [ - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "indented" - , Space - , Str "with" - , Space - , Str "tabs" - ] - ] - , - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "indented" - , Space - , Str "with" - , Space - , Str "spaces" - ] - , BulletList - [ - [ Para + [ [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -688,16 +564,13 @@ Pandoc , Space , Str "tabs" ] - ] - , - [ Para + ] + , [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -709,1811 +582,1710 @@ Pandoc , Space , Str "spaces" ] - ] + , BulletList + [ [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + ] + ] ] ] - ] - , Header 2 - ( "fancy-list-markers", [], [] ) - [ Str "Fancy", Space, Str "list", Space, Str "markers" ] + , Header + 2 + ( "fancy-list-markers" , [] , [] ) + [ Str "Fancy" , Space , Str "list" , Space , Str "markers" ] , OrderedList - ( 2, Decimal, TwoParens ) - [ - [ Para [ Str "begins", Space, Str "with", Space, Str "2" ] ] - , - [ Para - [ Str "and", Space, Str "now", Space, Str "3" ] - , Para - [ Str "with", Space, Str "a", Space, Str "continuation" ] - , OrderedList - ( 4, LowerRoman, Period ) - [ - [ Para - [ Str "sublist" - , Space - , Str "with" - , Space - , Str "roman" - , Space - , Str "numerals," - , Space - , Str "starting" + ( 2 , Decimal , TwoParens ) + [ [ Para + [ Str "begins" , Space , Str "with" , Space , Str "2" ] + ] + , [ Para [ Str "and" , Space , Str "now" , Space , Str "3" ] + , Para + [ Str "with" , Space - , Str "with" + , Str "a" , Space - , Str "4" + , Str "continuation" ] - ] - , - [ Para - [ Str "more", Space, Str "items" ] - , OrderedList - ( 1, UpperAlpha, TwoParens ) - [ - [ Para [ Str "a", Space, Str "subsublist" ] ] - , - [ Para [ Str "a", Space, Str "subsublist" ] ] + , OrderedList + ( 4 , LowerRoman , Period ) + [ [ Para + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , Space + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" + ] + ] + , [ Para [ Str "more" , Space , Str "items" ] + , OrderedList + ( 1 , UpperAlpha , TwoParens ) + [ [ Para [ Str "a" , Space , Str "subsublist" ] ] + , [ Para [ Str "a" , Space , Str "subsublist" ] ] + ] + ] ] - ] ] ] - ] - , Para - [ Str "Nesting:" ] + , Para [ Str "Nesting:" ] , OrderedList - ( 1, UpperAlpha, Period ) - [ - [ Para - [ Str "Upper", Space, Str "Alpha" ] - , OrderedList - ( 1, UpperRoman, Period ) - [ - [ Para - [ Str "Upper", Space, Str "Roman." ] - , OrderedList - ( 6, Decimal, TwoParens ) - [ - [ Para - [ Str "Decimal" - , Space - , Str "start" - , Space - , Str "with" - , Space - , Str "6" - ] + ( 1 , UpperAlpha , Period ) + [ [ Para [ Str "Upper" , Space , Str "Alpha" ] + , OrderedList + ( 1 , UpperRoman , Period ) + [ [ Para [ Str "Upper" , Space , Str "Roman." ] , OrderedList - ( 3, LowerAlpha, OneParen ) - [ - [ Para - [ Str "Lower" - , Space - , Str "alpha" - , Space - , Str "with" - , Space - , Str "paren" + ( 6 , Decimal , TwoParens ) + [ [ Para + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3 , LowerAlpha , OneParen ) + [ [ Para + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] ] ] - ] ] ] - ] ] ] - ] - , Para - [ Str "Autonumbering:" ] + , Para [ Str "Autonumbering:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Para [ Str "Autonumber." ] ] - , - [ Para - [ Str "More." ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Para [ Str "Nested." ] ] ] - ] - ] - , Para - [ Str "Should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item:" - ] - , Para - [ Str "M.A.", Space, Str "2007" ] - , Para - [ Str "B.", Space, Str "Williams" ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "definition-lists", [], [] ) - [ Str "Definition", Space, Str "Lists" ] - , Para - [ Str "Tight", Space, Str "using", Space, Str "spaces:" ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "Autonumber." ] ] + , [ Para [ Str "More." ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "Nested." ] ] ] + ] + ] + , Para + [ Str "Should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item:" + ] + , Para [ Str "M.A." , Space , Str "2007" ] + , Para [ Str "B." , Space , Str "Williams" ] + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header + 1 + ( "definition-lists" , [] , [] ) + [ Str "Definition" , Space , Str "Lists" ] + , Para + [ Str "Tight" + , Space + , Str "using" + , Space + , Str "spaces:" + ] , DefinitionList - [ - ( - [ Str "apple" ] - , - [ [ Para [ Str "red", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "orange" ] - , - [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "banana" ] - , - [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] - ) - ] - , Para - [ Str "Tight", Space, Str "using", Space, Str "tabs:" ] + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Para [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Tight" , Space , Str "using" , Space , Str "tabs:" ] , DefinitionList - [ - ( - [ Str "apple" ] - , - [ [ Para [ Str "red", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "orange" ] - , - [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "banana" ] - , - [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] - ) - ] - , Para - [ Str "Loose:" ] + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Para [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para [ Str "Loose:" ] , DefinitionList - [ - ( - [ Str "apple" ] - , - [ [ Para [ Str "red", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "orange" ] - , - [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "banana" ] - , - [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] - ) - ] - , Para - [ Str "Multiple" - , Space - , Str "blocks" - , Space - , Str "with" - , Space - , Str "italics:" - ] + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Para [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "with" + , Space + , Str "italics:" + ] , DefinitionList - [ - ( - [ Emph [ Str "apple" ] ] - , - [ - [ Para - [ Str "red", Space, Str "fruit" ] - , Para - [ Str "contains" - , Space - , Str "seeds," - , Space - , Str "crisp," - , Space - , Str "pleasant" - , Space - , Str "to" - , Space - , Str "taste" + [ ( [ Emph [ Str "apple" ] ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] + , Para + [ Str "contains" + , Space + , Str "seeds," + , Space + , Str "crisp," + , Space + , Str "pleasant" + , Space + , Str "to" + , Space + , Str "taste" + ] ] ] - ] - ) - , - ( - [ Emph [ Str "orange" ] ] - , - [ - [ Para - [ Str "orange", Space, Str "fruit" ] - , CodeBlock - ( "", [], [] ) "{ orange code block }" - , BlockQuote - [ Para - [ Str "orange", Space, Str "block", Space, Str "quote" ] + ) + , ( [ Emph [ Str "orange" ] ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , CodeBlock ( "" , [] , [] ) "{ orange code block }" + , BlockQuote + [ Para + [ Str "orange" + , Space + , Str "block" + , Space + , Str "quote" + ] + ] ] ] - ] - ) - ] - , Header 1 - ( "html-blocks", [], [] ) - [ Str "HTML", Space, Str "Blocks" ] - , Para - [ Str "Simple" - , Space - , Str "block" - , Space - , Str "on" - , Space - , Str "one" - , Space - , Str "line:" - ] - , Para - [ Str "foo" - , SoftBreak - , Str "And" - , Space - , Str "nested" - , Space - , Str "without" - , Space - , Str "indentation:" - ] - , Para - [ Str "foo" - , SoftBreak - , Str "bar" - , SoftBreak - , Str "Interpreted" - , Space - , Str "markdown" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "table:" - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "emphasized" ] - , SoftBreak - , Str "And" - , Space - , Str "this" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - , SoftBreak - , Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "simple" - , Space - , Str "block:" - ] - , Para - [ Str "foo" - , SoftBreak - , Str "This" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "code" - , Space - , Str "block," - , Space - , Str "though:" - ] - , CodeBlock - ( "", [], [] ) "
\n foo\n
" + ) + ] + , Header + 1 + ( "html-blocks" , [] , [] ) + [ Str "HTML" , Space , Str "Blocks" ] , Para - [ Str "As", Space, Str "should", Space, Str "this:" ] - , CodeBlock - ( "", [], [] ) "
foo
" - , Para - [ Str "Now,", Space, Str "nested:" ] - , Para - [ Str "foo" - , SoftBreak - , Str "This" - , Space - , Str "should" - , Space - , Str "just" - , Space - , Str "be" - , Space - , Str "an" - , Space - , Str "HTML" - , Space - , Str "comment:" - ] - , Para - [ Str "Multiline:" ] - , Para - [ Str "Code", Space, Str "block:" ] - , CodeBlock - ( "", [], [] ) "" - , Para - [ Str "Just" - , Space - , Str "plain" - , Space - , Str "comment," - , Space - , Str "with" - , Space - , Str "trailing" - , Space - , Str "spaces" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "line:" - ] - , Para - [ Str "Code:" ] - , CodeBlock - ( "", [], [] ) "
" - , Para - [ Str "Hr\8217s:" ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "inline-markup", [], [] ) - [ Str "Inline", Space, Str "Markup" ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "emphasized" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Emph - [ Str "is", Space, Str "this" ] - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Strong - [ Str "is", Space, Str "this" ] - , Str "." - ] - , Para - [ Str "An" - , Space - , Emph - [ Link - ( "", [], [] ) - [ Str "emphasized", Space, Str "link" ] - ( "/url", "" ) - ] - , Str "." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] + [ Str "Simple" + , Space + , Str "block" + , Space + , Str "on" + , Space + , Str "one" + , Space + , Str "line:" ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] + , Para + [ Str "foo" + , SoftBreak + , Str "And" + , Space + , Str "nested" + , Space + , Str "without" + , Space + , Str "indentation:" + ] + , Para + [ Str "foo" + , SoftBreak + , Str "bar" + , SoftBreak + , Str "Interpreted" + , Space + , Str "markdown" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "table:" ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "code:" - , Space - , Code - ( "", [], [] ) ">" - , Str "," - , Space - , Code - ( "", [], [] ) "$" - , Str "," - , Space - , Code - ( "", [], [] ) "\\" - , Str "," - , Space - , Code - ( "", [], [] ) "\\$" - , Str "," - , SoftBreak - , Code - ( "", [], [] ) "" - , Str "." - ] - , Para - [ Strikeout + , Para [ Str "This" , Space , Str "is" , Space - , Emph - [ Str "strikeout" ] + , Emph [ Str "emphasized" ] + , SoftBreak + , Str "And" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + , SoftBreak + , Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "simple" + , Space + , Str "block:" + ] + , Para + [ Str "foo" + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "code" + , Space + , Str "block," + , Space + , Str "though:" + ] + , CodeBlock ( "" , [] , [] ) "
\n foo\n
" + , Para + [ Str "As" , Space , Str "should" , Space , Str "this:" ] + , CodeBlock ( "" , [] , [] ) "
foo
" + , Para [ Str "Now," , Space , Str "nested:" ] + , Para + [ Str "foo" + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Str "just" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "HTML" + , Space + , Str "comment:" + ] + , Para [ Str "Multiline:" ] + , Para [ Str "Code" , Space , Str "block:" ] + , CodeBlock ( "" , [] , [] ) "" + , Para + [ Str "Just" + , Space + , Str "plain" + , Space + , Str "comment," + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "spaces" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "line:" + ] + , Para [ Str "Code:" ] + , CodeBlock ( "" , [] , [] ) "
" + , Para [ Str "Hr\8217s:" ] + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header + 1 + ( "inline-markup" , [] , [] ) + [ Str "Inline" , Space , Str "Markup" ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph [ Str "is" , Space , Str "this" ] , Str "." ] - ] - , Para - [ Str "Superscripts:" - , Space - , Str "a" - , Superscript - [ Str "bc" ] - , Str "d" - , SoftBreak - , Str "a" - , Superscript - [ Emph [ Str "hello" ] ] - , Space - , Str "a" - , Superscript - [ Str "hello", Space, Str "there" ] - , Str "." - ] - , Para - [ Str "Subscripts:" - , Space - , Str "H" - , Subscript - [ Str "2" ] - , Str "O," - , Space - , Str "H" - , Subscript - [ Str "23" ] - , Str "O," - , SoftBreak - , Str "H" - , Subscript - [ Str "many", Space, Str "of", Space, Str "them" ] - , Str "O." - ] - , Para - [ Str "These" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "superscripts" - , Space - , Str "or" - , Space - , Str "subscripts," - , Space - , Str "because" - , Space - , Str "of" - , Space - , Str "the" - , SoftBreak - , Str "unescaped" - , Space - , Str "spaces:" - , Space - , Str "a^b" - , Space - , Str "c^d," - , Space - , Str "a" - , Math InlineMath "\\sim" - , Str "b" - , SoftBreak - , Str "c" - , Math InlineMath "\\sim" - , Str "d." - ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "smart-quotes-ellipses-dashes", [], [] ) - [ Str "Smart" - , Space - , Str "quotes," - , Space - , Str "ellipses," - , Space - , Str "dashes" - ] - , Para - [ Quoted DoubleQuote - [ Str "Hello," ] - , Space - , Str "said" - , Space - , Str "the" - , Space - , Str "spider." - , Space - , Quoted DoubleQuote - [ Str "\8198" - , Quoted SingleQuote - [ Str "Shelob" ] + , Para + [ Str "This" , Space , Str "is" , Space - , Str "my" + , Strong [ Str "strong" ] + , Str "," , Space - , Str "name." + , Str "and" + , Space + , Str "so" + , Space + , Strong [ Str "is" , Space , Str "this" ] + , Str "." ] - ] - , Para - [ Quoted SingleQuote - [ Str "A" ] - , Str "," - , Space - , Quoted SingleQuote - [ Str "B" ] - , Str "," - , Space - , Str "and" - , Space - , Quoted SingleQuote - [ Str "C" ] - , Space - , Str "are" - , Space - , Str "letters." - ] - , Para - [ Quoted SingleQuote - [ Str "Oak," ] - , Space - , Quoted SingleQuote - [ Str "elm," ] - , Space - , Str "and" - , Space - , Quoted SingleQuote - [ Str "beech" ] - , Space - , Str "are" - , Space - , Str "names" - , Space - , Str "of" - , Space - , Str "trees." - , Space - , Str "So" - , Space - , Str "is" - , Space - , Quoted SingleQuote - [ Str "pine." ] - ] - , Para - [ Quoted SingleQuote - [ Str "He" - , Space - , Str "said," - , Space - , Quoted DoubleQuote - [ Str "I" - , Space - , Str "want" - , Space - , Str "to" - , Space - , Str "go." - ] - , Str "\8198" - ] - , Space - , Str "Were" - , Space - , Str "you" - , Space - , Str "alive" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "70\8217s?" - ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "quoted" - , Space - , Quoted SingleQuote - [ Code ( "", [], [] ) "code" ] - , Space - , Str "and" - , Space - , Str "a" - , SoftBreak - , Quoted DoubleQuote - [ Link - ( "", [], [] ) - [ Str "quoted", Space, Str "link" ] - ( "http://example.com/?foo=1&bar=2", "" ) - ] - , Str "." - ] - , Para - [ Str "Some" - , Space - , Str "dashes:" - , Space - , Str "one\8212two\8212three\8212four\8212five." - ] - , Para - [ Str "Dashes" - , Space - , Str "between" - , Space - , Str "numbers:" - , Space - , Str "5\8211\&7," - , Space - , Str "255\8211\&66," - , Space - , Str "1987\8211\&1999." - ] - , Para - [ Str "Ellipses\8230and\8230and\8230." ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "latex", [], [] ) - [ Str "LaTeX" ] - , BulletList - [ - [ Para - [ Cite - [ Citation - { citationId = "smith.1899" - , citationPrefix = [] - , citationSuffix = - [ Str "22-23" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } + , Para + [ Str "An" + , Space + , Emph + [ Link + ( "" , [] , [] ) + [ Str "emphasized" , Space , Str "link" ] + ( "/url" , "" ) ] - [ RawInline ( Format "latex" ) "\\cite[22-23]{smith.1899}" ] - ] + , Str "." ] - , - [ RawBlock ( Format "latex" ) "\\doublespacing" ] - , - [ Para [ Math InlineMath "2+2=4" ] ] - , - [ Para [ Math InlineMath "x \\in y" ] ] - , - [ Para [ Math InlineMath "\\alpha \\wedge \\omega" ] ] - , - [ Para [ Math InlineMath "223" ] ] - , - [ Para [ Math InlineMath "p", Str "-Tree" ] ] - , - [ Para - [ Math InlineMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}" ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] ] - , - [ Para - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "that" - , Space - , Str "has" - , Space - , Str "a" - , Space - , Str "line" - , Space - , Str "break" - , Space - , Str "in" - , Space - , Str "it:" - , SoftBreak - , Math InlineMath "\\alpha + \\omega \\times x^2" - , Str "." - ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." ] - ] , Para - [ Str "These" - , Space - , Str "shouldn\8217t" - , Space - , Str "be" - , Space - , Str "math:" - ] - , BulletList - [ - [ Para - [ Str "To" - , Space - , Str "get" - , Space - , Str "the" - , Space - , Str "famous" - , Space - , Str "equation," - , Space - , Str "write" - , Space - , Code - ( "", [], [] ) "$e = mc^2$" - , Str "." - ] + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] ] - , - [ Para - [ Str "$22,000" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Emph - [ Str "lot" ] - , Space - , Str "of" - , Space - , Str "money." - , Space - , Str "So" - , Space - , Str "is" - , Space - , Str "$34,000." - , Space - , Str "(It" - , Space - , Str "worked" - , Space - , Str "if" - , SoftBreak - , Quoted DoubleQuote - [ Str "lot" ] - , Space - , Str "is" - , Space - , Str "emphasized.)" - ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." ] - , - [ Para - [ Str "Escaped" - , Space - , Code - ( "", [], [] ) "$" - , Str ":" - , Space - , Str "$73" - , Space - , Emph - [ Str "this" - , Space - , Str "should" + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code ( "" , [] , [] ) ">" + , Str "," + , Space + , Code ( "" , [] , [] ) "$" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\$" + , Str "," + , SoftBreak + , Code ( "" , [] , [] ) "" + , Str "." + ] + , Para + [ Strikeout + [ Str "This" , Space - , Str "be" + , Str "is" , Space - , Str "emphasized" + , Emph [ Str "strikeout" ] + , Str "." ] - , Space - , Str "23$." - ] ] - ] , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "LaTeX" - , Space - , Str "table:" - ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignLeft, ColWidthDefault ), ( AlignLeft, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Animal" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Number" ] ] - ] - ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Dog" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cat" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] - ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "A" - , Space - , Str "table" - , Space - , Str "with" - , Space - , Str "one" - , Space - , Str "column:" - ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignCenter, ColWidthDefault ) ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Animal" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Vegetable" ] ] - ] + [ Str "Superscripts:" + , Space + , Str "a" + , Superscript [ Str "bc" ] + , Str "d" + , SoftBreak + , Str "a" + , Superscript [ Emph [ Str "hello" ] ] + , Space + , Str "a" + , Superscript [ Str "hello" , Space , Str "there" ] + , Str "." ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "special-characters", [], [] ) - [ Str "Special", Space, Str "Characters" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "unicode:" - ] - , BulletList - [ - [ Para [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] - , - [ Para [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] - , - [ Para [ Str "section:", Space, Str "\167" ] ] - , - [ Para - [ Str "set", Space, Str "membership:", Space, Str "\8712" ] + , Para + [ Str "Subscripts:" + , Space + , Str "H" + , Subscript [ Str "2" ] + , Str "O," + , Space + , Str "H" + , Subscript [ Str "23" ] + , Str "O," + , SoftBreak + , Str "H" + , Subscript + [ Str "many" , Space , Str "of" , Space , Str "them" ] + , Str "O." ] - , - [ Para [ Str "copyright:", Space, Str "\169" ] ] - ] - , Para - [ Str "AT&T" - , Space - , Str "has" - , Space - , Str "an" - , Space - , Str "ampersand" - , Space - , Str "in" - , Space - , Str "their" - , Space - , Str "name." - ] - , Para - [ Str "AT&T" - , Space - , Str "is" - , Space - , Str "another" - , Space - , Str "way" - , Space - , Str "to" - , Space - , Str "write" - , Space - , Str "it." - ] - , Para - [ Str "This", Space, Str "&", Space, Str "that." ] - , Para - [ Str "4", Space, Str "<", Space, Str "5." ] - , Para - [ Str "6", Space, Str ">", Space, Str "5." ] - , Para - [ Str "Backslash:", Space, Str "\\" ] - , Para - [ Str "Backtick:", Space, Str "\8216" ] - , Para - [ Str "Asterisk:", Space, Str "*" ] - , Para - [ Str "Underscore:", Space, Str "_" ] - , Para - [ Str "Left", Space, Str "brace:", Space, Str "{" ] - , Para - [ Str "Right", Space, Str "brace:", Space, Str "}" ] - , Para - [ Str "Left", Space, Str "bracket:", Space, Str "[" ] - , Para - [ Str "Right", Space, Str "bracket:", Space, Str "]" ] - , Para - [ Str "Left", Space, Str "paren:", Space, Str "(" ] - , Para - [ Str "Right", Space, Str "paren:", Space, Str ")" ] - , Para - [ Str "Greater-than:", Space, Str ">" ] - , Para - [ Str "Hash:", Space, Str "#" ] - , Para - [ Str "Period:", Space, Str "." ] - , Para - [ Str "Bang:", Space, Str "!" ] - , Para - [ Str "Plus:", Space, Str "+" ] - , Para - [ Str "Minus:", Space, Str "-" ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "links", [], [] ) - [ Str "Links" ] - , Header 2 - ( "explicit", [], [] ) - [ Str "Explicit" ] - , Para - [ Str "Just" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "URL" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "with_underscore" ] - ( "/url/with_underscore", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "Email", Space, Str "link" ] - ( "mailto:nobody@nowhere.net", "" ) - ] - , Para - [ Link ( "", [], [] ) [ Str "Empty" ] ( "", "" ), Str "." ] - , Header 2 - ( "reference", [], [] ) - [ Str "Reference" ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "With" - , Space - , Link - ( "", [], [] ) - [ Str "embedded", Space, Str "[brackets]" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "b" ] - ( "/url/", "" ) - , Space - , Str "by" - , Space - , Str "itself" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "once" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "twice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "thrice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "[not][]" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , CodeBlock - ( "", [], [] ) "[not]: /url" - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "biz" ] - ( "/url/", "" ) - , Str "." - ] - , Header 2 - ( "with-ampersands", [], [] ) - [ Str "With", Space, Str "ampersands" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "link" + , Para + [ Str "These" , Space - , Str "with" + , Str "should" , Space - , Str "an" + , Str "not" , Space - , Str "ampersand" + , Str "be" , Space - , Str "in" + , Str "superscripts" + , Space + , Str "or" + , Space + , Str "subscripts," + , Space + , Str "because" + , Space + , Str "of" , Space , Str "the" + , SoftBreak + , Str "unescaped" , Space - , Str "URL" - ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "link" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Str "amersand" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "link" - , Space - , Str "text:" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "AT&T" ] - ( "http://att.com/", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "inline", Space, Str "link" ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "an" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "inline" + , Str "spaces:" , Space - , Str "link" + , Str "a^b" , Space - , Str "in" + , Str "c^d," , Space - , Str "pointy" - , Space - , Str "braces" - ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Header 2 - ( "autolinks", [], [] ) - [ Str "Autolinks" ] - , Para - [ Str "With" - , Space - , Str "an" - , Space - , Str "ampersand:" - , Space - , Link - ( "", [], [] ) - [ Str "http://example.com/?foo=1&bar=2" ] - ( "http://example.com/?foo=1&bar=2", "" ) - ] - , BulletList - [ - [ Para [ Str "In", Space, Str "a", Space, Str "list?" ] ] - , - [ Para - [ Link - ( "", [], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) - ] + , Str "a" + , Math InlineMath "\\sim" + , Str "b" + , SoftBreak + , Str "c" + , Math InlineMath "\\sim" + , Str "d." ] - , - [ Para [ Str "It", Space, Str "should." ] ] - ] - , Para - [ Str "An" - , Space - , Str "e-mail" - , Space - , Str "address:" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "nobody@nowhere.net" ] - ( "mailto:nobody@nowhere.net", "" ) - ] - , BlockQuote - [ Para - [ Str "Blockquoted:" + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header + 1 + ( "smart-quotes-ellipses-dashes" , [] , [] ) + [ Str "Smart" , Space - , Link - ( "", [], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) - ] - ] - , Para - [ Str "Auto-links" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "occur" - , Space - , Str "here:" - , Space - , Code - ( "", [], [] ) "" - ] - , CodeBlock - ( "", [], [] ) "or here: " - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "images", [], [] ) - [ Str "Images" ] - , Para - [ Str "From" - , Space - , Quoted DoubleQuote - [ Str "Voyage" - , Space - , Str "dans" - , Space - , Str "la" - , Space - , Str "Lune" - ] - , Space - , Str "by" - , Space - , Str "Georges" - , Space - , Str "Melies" - , Space - , Str "(1902):" - ] - , Para - [ Image ( "", [], [] ) [ Str "image" ] ( "lalune.jpg", "" ) ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "movie" - , Space - , Image - ( "", [], [] ) - [ Str "image" ] - ( "movie.jpg", "" ) - , Space - , Str "icon." - ] - , Div - ( "", [ "center" ], [] ) [ HorizontalRule ] - , Header 1 - ( "footnotes", [], [] ) - [ Str "Footnotes" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "footnote" - , SoftBreak - , Str "reference," - , Note - [ Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "footnote." - , Space - , Str "It" - , Space - , Str "can" - , Space - , Str "go" - , Space - , Str "anywhere" - , Space - , Str "after" - , Space - , Str "the" - , Space - , Str "footnote" - , SoftBreak - , Str "reference." - , Space - , Str "It" - , Space - , Str "need" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "placed" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "end" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "document." - ] - ] - , SoftBreak - , Str "and" - , SoftBreak - , Str "another." - , Note - [ Para - [ Str "Here\8217s" - , Space - , Str "the" - , Space - , Str "long" - , Space - , Str "note." - , Space - , Str "This" - , Space - , Str "one" - , Space - , Str "contains" - , Space - , Str "multiple" - , Space - , Str "blocks." - ] - , Para - [ Str "Subsequent" - , Space - , Str "blocks" - , Space - , Str "are" - , Space - , Str "indented" - , Space - , Str "to" - , Space - , Str "show" - , Space - , Str "that" - , Space - , Str "they" - , Space - , Str "belong" - , Space - , Str "to" - , Space - , Str "the" - , SoftBreak - , Str "footnote" - , Space - , Str "(as" - , Space - , Str "with" - , Space - , Str "list" - , Space - , Str "items)." - ] - , CodeBlock - ( "", [], [] ) " { }" - , Para - [ Str "If" - , Space - , Str "you" - , Space - , Str "want," - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "indent" - , Space - , Str "every" - , Space - , Str "line," - , Space - , Str "but" - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "also" - , Space - , Str "be" - , Space - , Str "lazy" - , SoftBreak - , Str "and" - , Space - , Str "just" - , Space - , Str "indent" - , Space - , Str "the" - , Space - , Str "first" - , Space - , Str "line" - , Space - , Str "of" - , Space - , Str "each" - , Space - , Str "block." - ] - ] - , SoftBreak - , Str "This" - , Space - , Str "should" - , Space - , Emph - [ Str "not" ] - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference," - , Space - , Str "because" - , Space - , Str "it" - , Space - , Str "contains" - , SoftBreak - , Str "a" - , Space - , Str "space.[^my" - , Space - , Str "note]" - , Space - , Str "Here" - , Space - , Str "is" - , Space - , Str "an" - , Space - , Str "inline" - , SoftBreak - , Str "note." - , Note - [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "easier" ] - , Space - , Str "to" - , Space - , Str "type." - , Space - , Str "Inline" - , Space - , Str "notes" - , Space - , Str "may" - , Space - , Str "contain" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "links" ] - ( "http://google.com", "" ) - , Space - , Str "and" - , Space - , Code - ( "", [], [] ) "]" - , Space - , Str "verbatim" - , Space - , Str "characters," - , SoftBreak - , Str "as" - , Space - , Str "well" - , Space - , Str "as" - , Space - , Str "[bracketed" - , Space - , Str "text]." - ] + , Str "quotes," + , Space + , Str "ellipses," + , Space + , Str "dashes" ] - ] - , BlockQuote - [ Para - [ Str "Notes" + , Para + [ Quoted DoubleQuote [ Str "Hello," ] , Space - , Str "can" + , Str "said" , Space - , Str "go" + , Str "the" , Space - , Str "in" + , Str "spider." , Space - , Str "quotes." - , Note - [ Para [ Str "In", Space, Str "quote." ] ] + , Quoted + DoubleQuote + [ Str "\8198" + , Quoted SingleQuote [ Str "Shelob" ] + , Space + , Str "is" + , Space + , Str "my" + , Space + , Str "name." + ] ] - ] - , OrderedList - ( 1, Decimal, Period ) - [ + , Para + [ Quoted SingleQuote [ Str "A" ] + , Str "," + , Space + , Quoted SingleQuote [ Str "B" ] + , Str "," + , Space + , Str "and" + , Space + , Quoted SingleQuote [ Str "C" ] + , Space + , Str "are" + , Space + , Str "letters." + ] + , Para + [ Quoted SingleQuote [ Str "Oak," ] + , Space + , Quoted SingleQuote [ Str "elm," ] + , Space + , Str "and" + , Space + , Quoted SingleQuote [ Str "beech" ] + , Space + , Str "are" + , Space + , Str "names" + , Space + , Str "of" + , Space + , Str "trees." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Quoted SingleQuote [ Str "pine." ] + ] + , Para + [ Quoted + SingleQuote + [ Str "He" + , Space + , Str "said," + , Space + , Quoted + DoubleQuote + [ Str "I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "go." + ] + , Str "\8198" + ] + , Space + , Str "Were" + , Space + , Str "you" + , Space + , Str "alive" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "70\8217s?" + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "quoted" + , Space + , Quoted SingleQuote [ Code ( "" , [] , [] ) "code" ] + , Space + , Str "and" + , Space + , Str "a" + , SoftBreak + , Quoted + DoubleQuote + [ Link + ( "" , [] , [] ) + [ Str "quoted" , Space , Str "link" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + ] + , Str "." + ] + , Para + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one\8212two\8212three\8212four\8212five." + ] + , Para + [ Str "Dashes" + , Space + , Str "between" + , Space + , Str "numbers:" + , Space + , Str "5\8211\&7," + , Space + , Str "255\8211\&66," + , Space + , Str "1987\8211\&1999." + ] + , Para [ Str "Ellipses\8230and\8230and\8230." ] + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header 1 ( "latex" , [] , [] ) [ Str "LaTeX" ] + , BulletList + [ [ Para + [ Cite + [ Citation + { citationId = "smith.1899" + , citationPrefix = [] + , citationSuffix = [ Str "22-23" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline (Format "latex") "\\cite[22-23]{smith.1899}" + ] + ] + ] + , [ RawBlock (Format "latex") "\\doublespacing" ] + , [ Para [ Math InlineMath "2+2=4" ] ] + , [ Para [ Math InlineMath "x \\in y" ] ] + , [ Para [ Math InlineMath "\\alpha \\wedge \\omega" ] ] + , [ Para [ Math InlineMath "223" ] ] + , [ Para [ Math InlineMath "p" , Str "-Tree" ] ] + , [ Para + [ Math + InlineMath + "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}" + ] + ] + , [ Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "that" + , Space + , Str "has" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "break" + , Space + , Str "in" + , Space + , Str "it:" + , SoftBreak + , Math InlineMath "\\alpha + \\omega \\times x^2" + , Str "." + ] + ] + ] + , Para + [ Str "These" + , Space + , Str "shouldn\8217t" + , Space + , Str "be" + , Space + , Str "math:" + ] + , BulletList + [ [ Para + [ Str "To" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "famous" + , Space + , Str "equation," + , Space + , Str "write" + , Space + , Code ( "" , [] , [] ) "$e = mc^2$" + , Str "." + ] + ] + , [ Para + [ Str "$22,000" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Emph [ Str "lot" ] + , Space + , Str "of" + , Space + , Str "money." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "$34,000." + , Space + , Str "(It" + , Space + , Str "worked" + , Space + , Str "if" + , SoftBreak + , Quoted DoubleQuote [ Str "lot" ] + , Space + , Str "is" + , Space + , Str "emphasized.)" + ] + ] + , [ Para + [ Str "Escaped" + , Space + , Code ( "" , [] , [] ) "$" + , Str ":" + , Space + , Str "$73" + , Space + , Emph + [ Str "this" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "emphasized" + ] + , Space + , Str "23$." + ] + ] + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "LaTeX" + , Space + , Str "table:" + ] + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Animal" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Number" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Dog" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cat" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Para + [ Str "A" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "one" + , Space + , Str "column:" + ] + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Animal" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Vegetable" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header + 1 + ( "special-characters" , [] , [] ) + [ Str "Special" , Space , Str "Characters" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "unicode:" + ] + , BulletList + [ [ Para + [ Str "I" , Space , Str "hat:" , Space , Str "\206" ] + ] + , [ Para + [ Str "o" , Space , Str "umlaut:" , Space , Str "\246" ] + ] + , [ Para [ Str "section:" , Space , Str "\167" ] ] + , [ Para + [ Str "set" + , Space + , Str "membership:" + , Space + , Str "\8712" + ] + ] + , [ Para [ Str "copyright:" , Space , Str "\169" ] ] + ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] + , Para + [ Str "This" , Space , Str "&" , Space , Str "that." ] + , Para [ Str "4" , Space , Str "<" , Space , Str "5." ] + , Para [ Str "6" , Space , Str ">" , Space , Str "5." ] + , Para [ Str "Backslash:" , Space , Str "\\" ] + , Para [ Str "Backtick:" , Space , Str "\8216" ] + , Para [ Str "Asterisk:" , Space , Str "*" ] + , Para [ Str "Underscore:" , Space , Str "_" ] + , Para + [ Str "Left" , Space , Str "brace:" , Space , Str "{" ] + , Para + [ Str "Right" , Space , Str "brace:" , Space , Str "}" ] + , Para + [ Str "Left" , Space , Str "bracket:" , Space , Str "[" ] + , Para + [ Str "Right" , Space , Str "bracket:" , Space , Str "]" ] + , Para + [ Str "Left" , Space , Str "paren:" , Space , Str "(" ] + , Para + [ Str "Right" , Space , Str "paren:" , Space , Str ")" ] + , Para [ Str "Greater-than:" , Space , Str ">" ] + , Para [ Str "Hash:" , Space , Str "#" ] + , Para [ Str "Period:" , Space , Str "." ] + , Para [ Str "Bang:" , Space , Str "!" ] + , Para [ Str "Plus:" , Space , Str "+" ] + , Para [ Str "Minus:" , Space , Str "-" ] + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header 1 ( "links" , [] , [] ) [ Str "Links" ] + , Header 2 ( "explicit" , [] , [] ) [ Str "Explicit" ] + , Para + [ Str "Just" + , Space + , Str "a" + , Space + , Link ( "" , [] , [] ) [ Str "URL" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "with_underscore" ] + ( "/url/with_underscore" , "" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "Email" , Space , Str "link" ] + ( "mailto:nobody@nowhere.net" , "" ) + ] + , Para + [ Link ( "" , [] , [] ) [ Str "Empty" ] ( "" , "" ) + , Str "." + ] + , Header 2 ( "reference" , [] , [] ) [ Str "Reference" ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "With" + , Space + , Link + ( "" , [] , [] ) + [ Str "embedded" , Space , Str "[brackets]" ] + ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link ( "" , [] , [] ) [ Str "b" ] ( "/url/" , "" ) + , Space + , Str "by" + , Space + , Str "itself" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "once" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "twice" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "thrice" ] ( "/url" , "" ) + , Str "." + ] + , Para + [ Str "This" + , Space + , Str "should" + , Space + , Str "[not][]" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , CodeBlock ( "" , [] , [] ) "[not]: /url" + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "biz" ] ( "/url/" , "" ) + , Str "." + ] + , Header + 2 + ( "with-ampersands" , [] , [] ) + [ Str "With" , Space , Str "ampersands" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "amersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "link" + , Space + , Str "text:" + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "AT&T" ] ( "http://att.com/" , "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Str "inline" , Space , Str "link" ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "inline" + , Space + , Str "link" + , Space + , Str "in" + , Space + , Str "pointy" + , Space + , Str "braces" + ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Header 2 ( "autolinks" , [] , [] ) [ Str "Autolinks" ] + , Para + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + ] + , BulletList + [ [ Para + [ Str "In" , Space , Str "a" , Space , Str "list?" ] + ] + , [ Para + [ Link + ( "" , [] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] + ] + , [ Para [ Str "It" , Space , Str "should." ] ] + ] + , Para + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "nobody@nowhere.net" ] + ( "mailto:nobody@nowhere.net" , "" ) + ] + , BlockQuote [ Para - [ Str "And" - , Space - , Str "in" - , Space - , Str "list" - , Space - , Str "items." - , Note - [ Para [ Str "In", Space, Str "list." ] ] + [ Str "Blockquoted:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] + ] + , Para + [ Str "Auto-links" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "occur" + , Space + , Str "here:" + , Space + , Code ( "" , [] , [] ) "" + ] + , CodeBlock + ( "" , [] , [] ) "or here: " + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header 1 ( "images" , [] , [] ) [ Str "Images" ] + , Para + [ Str "From" + , Space + , Quoted + DoubleQuote + [ Str "Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune" + ] + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" + ] + , Para + [ Image + ( "" , [] , [] ) [ Str "image" ] ( "lalune.jpg" , "" ) + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space + , Image + ( "" , [] , [] ) [ Str "image" ] ( "movie.jpg" , "" ) + , Space + , Str "icon." + ] + , Div ( "" , [ "center" ] , [] ) [ HorizontalRule ] + , Header 1 ( "footnotes" , [] , [] ) [ Str "Footnotes" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "footnote" + , SoftBreak + , Str "reference," + , Note + [ Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "footnote." + , Space + , Str "It" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "anywhere" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "footnote" + , SoftBreak + , Str "reference." + , Space + , Str "It" + , Space + , Str "need" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "placed" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "document." + ] + ] + , SoftBreak + , Str "and" + , SoftBreak + , Str "another." + , Note + [ Para + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "long" + , Space + , Str "note." + , Space + , Str "This" + , Space + , Str "one" + , Space + , Str "contains" + , Space + , Str "multiple" + , Space + , Str "blocks." + ] + , Para + [ Str "Subsequent" + , Space + , Str "blocks" + , Space + , Str "are" + , Space + , Str "indented" + , Space + , Str "to" + , Space + , Str "show" + , Space + , Str "that" + , Space + , Str "they" + , Space + , Str "belong" + , Space + , Str "to" + , Space + , Str "the" + , SoftBreak + , Str "footnote" + , Space + , Str "(as" + , Space + , Str "with" + , Space + , Str "list" + , Space + , Str "items)." + ] + , CodeBlock ( "" , [] , [] ) " { }" + , Para + [ Str "If" + , Space + , Str "you" + , Space + , Str "want," + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "indent" + , Space + , Str "every" + , Space + , Str "line," + , Space + , Str "but" + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "be" + , Space + , Str "lazy" + , SoftBreak + , Str "and" + , Space + , Str "just" + , Space + , Str "indent" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "line" + , Space + , Str "of" + , Space + , Str "each" + , Space + , Str "block." + ] + ] + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Emph [ Str "not" ] + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Space + , Str "because" + , Space + , Str "it" + , Space + , Str "contains" + , SoftBreak + , Str "a" + , Space + , Str "space.[^my" + , Space + , Str "note]" + , Space + , Str "Here" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "inline" + , SoftBreak + , Str "note." + , Note + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "easier" ] + , Space + , Str "to" + , Space + , Str "type." + , Space + , Str "Inline" + , Space + , Str "notes" + , Space + , Str "may" + , Space + , Str "contain" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "links" ] + ( "http://google.com" , "" ) + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "]" + , Space + , Str "verbatim" + , Space + , Str "characters," + , SoftBreak + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str "[bracketed" + , Space + , Str "text]." + ] + ] + ] + , BlockQuote + [ Para + [ Str "Notes" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "in" + , Space + , Str "quotes." + , Note [ Para [ Str "In" , Space , Str "quote." ] ] + ] + ] + , OrderedList + ( 1 , Decimal , Period ) + [ [ Para + [ Str "And" + , Space + , Str "in" + , Space + , Str "list" + , Space + , Str "items." + , Note [ Para [ Str "In" , Space , Str "list." ] ] + ] ] ] - ] - , Para - [ Str "This" - , Space - , Str "paragraph" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "part" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "note," - , Space - , Str "as" - , Space - , Str "it" - , Space - , Str "is" - , Space - , Str "not" - , SoftBreak - , Str "indented." - ] - , Header 1 - ( "escaped-characters", [], [] ) - [ Str "Escaped", Space, Str "characters" ] - , Para - [ Str "$" - , Space - , Str "%" - , Space - , Str "&" - , Space - , Str "#" - , Space - , Str "_" - , Space - , Str "{" - , Space - , Str "}" - ] + , Para + [ Str "This" + , Space + , Str "paragraph" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "note," + , Space + , Str "as" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "not" + , SoftBreak + , Str "indented." + ] + , Header + 1 + ( "escaped-characters" , [] , [] ) + [ Str "Escaped" , Space , Str "characters" ] + , Para + [ Str "$" + , Space + , Str "%" + , Space + , Str "&" + , Space + , Str "#" + , Space + , Str "_" + , Space + , Str "{" + , Space + , Str "}" + ] ] diff --git a/test/lhs-test-markdown.native b/test/lhs-test-markdown.native index db2acd318..42a32697b 100644 --- a/test/lhs-test-markdown.native +++ b/test/lhs-test-markdown.native @@ -1,130 +1,124 @@ -[ Header 1 - ( "lhs-test", [], [] ) - [ Str "lhs", Space, Str "test" ] +[ Header + 1 + ( "lhs-test" , [] , [] ) + [ Str "lhs" , Space , Str "test" ] , Para - [ Code - ( "", [], [] ) "unsplit" - , Space - , Str "is" - , Space - , Str "an" - , Space - , Str "arrow" - , Space - , Str "that" - , Space - , Str "takes" - , Space - , Str "a" - , Space - , Str "pair" - , Space - , Str "of" - , Space - , Str "values" - , Space - , Str "and" - , Space - , Str "combines" - , Space - , Str "them" - , Space - , Str "to" - , SoftBreak - , Str "return" - , Space - , Str "a" - , Space - , Str "single" - , Space - , Str "value:" - ] + [ Code ( "" , [] , [] ) "unsplit" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "arrow" + , Space + , Str "that" + , Space + , Str "takes" + , Space + , Str "a" + , Space + , Str "pair" + , Space + , Str "of" + , Space + , Str "values" + , Space + , Str "and" + , Space + , Str "combines" + , Space + , Str "them" + , Space + , Str "to" + , SoftBreak + , Str "return" + , Space + , Str "a" + , Space + , Str "single" + , Space + , Str "value:" + ] , CodeBlock - ( "" - , - [ "haskell", "literate" ] - , [] - ) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" + ( "" , [ "haskell" , "literate" ] , [] ) + "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" , Para - [ Code - ( "", [], [] ) "(***)" - , Space - , Str "combines" - , Space - , Str "two" - , Space - , Str "arrows" - , Space - , Str "into" - , Space - , Str "a" - , Space - , Str "new" - , Space - , Str "arrow" - , Space - , Str "by" - , Space - , Str "running" - , Space - , Str "the" - , Space - , Str "two" - , Space - , Str "arrows" - , Space - , Str "on" - , Space - , Str "a" - , SoftBreak - , Str "pair" - , Space - , Str "of" - , Space - , Str "values" - , Space - , Str "(one" - , Space - , Str "arrow" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "first" - , Space - , Str "item" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "pair" - , Space - , Str "and" - , Space - , Str "one" - , Space - , Str "arrow" - , Space - , Str "on" - , Space - , Str "the" - , SoftBreak - , Str "second" - , Space - , Str "item" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "pair)." - ] + [ Code ( "" , [] , [] ) "(***)" + , Space + , Str "combines" + , Space + , Str "two" + , Space + , Str "arrows" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "new" + , Space + , Str "arrow" + , Space + , Str "by" + , Space + , Str "running" + , Space + , Str "the" + , Space + , Str "two" + , Space + , Str "arrows" + , Space + , Str "on" + , Space + , Str "a" + , SoftBreak + , Str "pair" + , Space + , Str "of" + , Space + , Str "values" + , Space + , Str "(one" + , Space + , Str "arrow" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "item" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "pair" + , Space + , Str "and" + , Space + , Str "one" + , Space + , Str "arrow" + , Space + , Str "on" + , Space + , Str "the" + , SoftBreak + , Str "second" + , Space + , Str "item" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "pair)." + ] , CodeBlock - ( "", [], [] ) "f *** g = first f >>> second g" -, Para - [ Str "Block", Space, Str "quote:" ] -, BlockQuote - [ Para [ Str "foo", Space, Str "bar" ] ] + ( "" , [] , [] ) "f *** g = first f >>> second g" +, Para [ Str "Block" , Space , Str "quote:" ] +, BlockQuote [ Para [ Str "foo" , Space , Str "bar" ] ] ] diff --git a/test/lhs-test.native b/test/lhs-test.native index db2acd318..42a32697b 100644 --- a/test/lhs-test.native +++ b/test/lhs-test.native @@ -1,130 +1,124 @@ -[ Header 1 - ( "lhs-test", [], [] ) - [ Str "lhs", Space, Str "test" ] +[ Header + 1 + ( "lhs-test" , [] , [] ) + [ Str "lhs" , Space , Str "test" ] , Para - [ Code - ( "", [], [] ) "unsplit" - , Space - , Str "is" - , Space - , Str "an" - , Space - , Str "arrow" - , Space - , Str "that" - , Space - , Str "takes" - , Space - , Str "a" - , Space - , Str "pair" - , Space - , Str "of" - , Space - , Str "values" - , Space - , Str "and" - , Space - , Str "combines" - , Space - , Str "them" - , Space - , Str "to" - , SoftBreak - , Str "return" - , Space - , Str "a" - , Space - , Str "single" - , Space - , Str "value:" - ] + [ Code ( "" , [] , [] ) "unsplit" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "arrow" + , Space + , Str "that" + , Space + , Str "takes" + , Space + , Str "a" + , Space + , Str "pair" + , Space + , Str "of" + , Space + , Str "values" + , Space + , Str "and" + , Space + , Str "combines" + , Space + , Str "them" + , Space + , Str "to" + , SoftBreak + , Str "return" + , Space + , Str "a" + , Space + , Str "single" + , Space + , Str "value:" + ] , CodeBlock - ( "" - , - [ "haskell", "literate" ] - , [] - ) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" + ( "" , [ "haskell" , "literate" ] , [] ) + "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" , Para - [ Code - ( "", [], [] ) "(***)" - , Space - , Str "combines" - , Space - , Str "two" - , Space - , Str "arrows" - , Space - , Str "into" - , Space - , Str "a" - , Space - , Str "new" - , Space - , Str "arrow" - , Space - , Str "by" - , Space - , Str "running" - , Space - , Str "the" - , Space - , Str "two" - , Space - , Str "arrows" - , Space - , Str "on" - , Space - , Str "a" - , SoftBreak - , Str "pair" - , Space - , Str "of" - , Space - , Str "values" - , Space - , Str "(one" - , Space - , Str "arrow" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "first" - , Space - , Str "item" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "pair" - , Space - , Str "and" - , Space - , Str "one" - , Space - , Str "arrow" - , Space - , Str "on" - , Space - , Str "the" - , SoftBreak - , Str "second" - , Space - , Str "item" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "pair)." - ] + [ Code ( "" , [] , [] ) "(***)" + , Space + , Str "combines" + , Space + , Str "two" + , Space + , Str "arrows" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "new" + , Space + , Str "arrow" + , Space + , Str "by" + , Space + , Str "running" + , Space + , Str "the" + , Space + , Str "two" + , Space + , Str "arrows" + , Space + , Str "on" + , Space + , Str "a" + , SoftBreak + , Str "pair" + , Space + , Str "of" + , Space + , Str "values" + , Space + , Str "(one" + , Space + , Str "arrow" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "item" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "pair" + , Space + , Str "and" + , Space + , Str "one" + , Space + , Str "arrow" + , Space + , Str "on" + , Space + , Str "the" + , SoftBreak + , Str "second" + , Space + , Str "item" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "pair)." + ] , CodeBlock - ( "", [], [] ) "f *** g = first f >>> second g" -, Para - [ Str "Block", Space, Str "quote:" ] -, BlockQuote - [ Para [ Str "foo", Space, Str "bar" ] ] + ( "" , [] , [] ) "f *** g = first f >>> second g" +, Para [ Str "Block" , Space , Str "quote:" ] +, BlockQuote [ Para [ Str "foo" , Space , Str "bar" ] ] ] diff --git a/test/man-reader.native b/test/man-reader.native index f8341fb84..1fe99ae35 100644 --- a/test/man-reader.native +++ b/test/man-reader.native @@ -1,986 +1,951 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "date" - , MetaInlines - [ Str "Oct", Space, Str "17,", Space, Str "2018" ] - ) - , - ( "section", MetaInlines [] ) - , - ( "title" - , MetaInlines - [ Str "Pandoc", Space, Str "Man", Space, Str "tests" ] - ) - ] + Meta + { unMeta = + fromList + [ ( "date" + , MetaInlines + [ Str "Oct" , Space , Str "17," , Space , Str "2018" ] + ) + , ( "section" , MetaInlines [] ) + , ( "title" + , MetaInlines + [ Str "Pandoc" + , Space + , Str "Man" + , Space + , Str "tests" + ] + ) + ] } - ) [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "set" - , Space - , Str "of" - , Space - , Str "tests" - , Space - , Str "for" - , Space - , Str "pandoc." - ] - , Para - [ Str "*" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" - ] - , Header 1 - ( "", [], [] ) - [ Str "Headers" ] - , Header 1 - ( "", [], [] ) - [ Str "Level", Space, Str "1" ] - , Header 2 - ( "", [], [] ) - [ Str "Level", Space, Str "2" ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "set" + , Space + , Str "of" + , Space + , Str "tests" + , Space + , Str "for" + , Space + , Str "pandoc." + ] , Para - [ Str "*" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" - ] - , Header 1 - ( "", [], [] ) - [ Str "Paragraphs" ] + [ Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + ] + , Header 1 ( "" , [] , [] ) [ Str "Headers" ] + , Header + 1 ( "" , [] , [] ) [ Str "Level" , Space , Str "1" ] + , Header + 2 ( "" , [] , [] ) [ Str "Level" , Space , Str "2" ] , Para - [ Str "Here's" - , Space - , Str "a" - , Space - , Str "regular" - , Space - , Str "paragraph." - ] + [ Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + ] + , Header 1 ( "" , [] , [] ) [ Str "Paragraphs" ] , Para - [ Str "Another" - , Space - , Str "paragraph" - , Space - , Str "In" - , Space - , Str "Markdown" - , Space - , Str "1.0.0" - , Space - , Str "and" - , Space - , Str "earlier." - , Space - , Str "Version" - , Space - , Str "8." - , Space - , Str "This" - , Space - , Str "line" - , Space - , Str "turns" - , Space - , Str "into" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - , Space - , Str "Because" - , Space - , Str "a" - , Space - , Str "hard-wrapped" - , Space - , Str "line" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "middle" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "paragraph" - , Space - , Str "looked" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - ] + [ Str "Here's" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] , Para - [ Str "There" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "hard" - , Space - , Str "line" - , Space - , Str "break" - ] + [ Str "Another" + , Space + , Str "paragraph" + , Space + , Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , Space + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + , Space + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item." + ] , Para - [ Str "here." ] + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" + ] + , Para [ Str "here." ] , Para - [ Str "*" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" - ] - , Header 1 - ( "", [], [] ) - [ Str "Block", Space, Str "Quotes" ] + [ Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + ] + , Header + 1 ( "" , [] , [] ) [ Str "Block" , Space , Str "Quotes" ] , Para - [ Str "Code" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "block" - , Space - , Str "quote:" - ] + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] , BlockQuote - [ CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - ] - , Para - [ Str "A", Space, Str "list:" ] + [ CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + ] + , Para [ Str "A" , Space , Str "list:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "item", Space, Str "one" ] ] - , - [ Para [ Str "item", Space, Str "two" ] ] - ] - , Header 1 - ( "", [], [] ) - [ Str "Code", Space, Str "Blocks" ] - , Para - [ Str "Code:" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "item" , Space , Str "one" ] ] + , [ Para [ Str "item" , Space , Str "two" ] ] + ] + , Header + 1 ( "" , [] , [] ) [ Str "Code" , Space , Str "Blocks" ] + , Para [ Str "Code:" ] , CodeBlock - ( "" - , [] - , [] - ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n" - , Para - [ Str "And:" ] + ( "" , [] , [] ) + "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n" + , Para [ Str "And:" ] , CodeBlock - ( "", [], [] ) "\tthis code line is indented by one tab" + ( "" , [] , [] ) "\tthis code line is indented by one tab" , Para - [ Str "*" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" - ] - , Header 1 - ( "", [], [] ) - [ Str "Lists" ] - , Header 2 - ( "", [], [] ) - [ Str "Unordered" ] - , Para - [ Str "Asterisks:" ] + [ Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + ] + , Header 1 ( "" , [] , [] ) [ Str "Lists" ] + , Header 2 ( "" , [] , [] ) [ Str "Unordered" ] + , Para [ Str "Asterisks:" ] , BulletList - [ - [ Para [ Str "asterisk", Space, Str "1" ] ] - , - [ Para [ Str "asterisk", Space, Str "2" ] ] - , - [ Para [ Str "asterisk", Space, Str "3" ] ] - ] - , Header 2 - ( "", [], [] ) - [ Str "Ordered" ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] + ] + , Header 2 ( "" , [] , [] ) [ Str "Ordered" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para [ Str "Second" ] ] - , - [ Para [ Str "Third" ] ] - ] - , Header 2 - ( "", [], [] ) - [ Str "Nested" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second" ] ] + , [ Para [ Str "Third" ] ] + ] + , Header 2 ( "" , [] , [] ) [ Str "Nested" ] , BulletList - [ - [ Para - [ Str "Tab" ] - , BulletList - [ - [ Para [ Str "Tab" ], BulletList [ [ Para [ Str "Tab" ] ] ] ] + [ [ Para [ Str "Tab" ] + , BulletList + [ [ Para [ Str "Tab" ] + , BulletList [ [ Para [ Str "Tab" ] ] ] + ] + ] ] ] - ] - , Para - [ Str "Here's", Space, Str "another:" ] + , Para [ Str "Here's" , Space , Str "another:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Para [ Str "Fee" ] ] - , - [ Para [ Str "Fie" ] ] - , - [ Para [ Str "Foe" ] ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Para [ Str "Fee" ] ] + , [ Para [ Str "Fie" ] ] + , [ Para [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "Same", Space, Str "thing:" ] + , Para [ Str "Same" , Space , Str "thing:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Para [ Str "Fee" ] ] - , - [ Para [ Str "Fie" ] ] - , - [ Para [ Str "Foe" ] ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Para [ Str "Fee" ] ] + , [ Para [ Str "Fie" ] ] + , [ Para [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] ] - , - [ Para [ Str "Third" ] ] - ] - , Header 2 - ( "", [], [] ) - [ Str "different", Space, Str "styles:" ] + , Header + 2 + ( "" , [] , [] ) + [ Str "different" , Space , Str "styles:" ] , OrderedList - ( 1, UpperAlpha, Period ) - [ - [ Para - [ Str "Upper", Space, Str "Alpha" ] - , OrderedList - ( 1, UpperRoman, Period ) - [ - [ Para - [ Str "Upper", Space, Str "Roman." ] - , OrderedList - ( 6, Decimal, TwoParens ) - [ - [ Para - [ Str "Decimal" - , Space - , Str "start" - , Space - , Str "with" - , Space - , Str "6" - ] + ( 1 , UpperAlpha , Period ) + [ [ Para [ Str "Upper" , Space , Str "Alpha" ] + , OrderedList + ( 1 , UpperRoman , Period ) + [ [ Para [ Str "Upper" , Space , Str "Roman." ] , OrderedList - ( 3, LowerAlpha, OneParen ) - [ - [ Para - [ Str "Lower" - , Space - , Str "alpha" - , Space - , Str "with" - , Space - , Str "paren" + ( 6 , Decimal , TwoParens ) + [ [ Para + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3 , LowerAlpha , OneParen ) + [ [ Para + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] ] ] - ] ] ] - ] ] ] - ] - , Header 2 - ( "", [], [] ) - [ Str "Ordered" ] - , Para - [ Str "Definition", Space, Str "lists" ] + , Header 2 ( "" , [] , [] ) [ Str "Ordered" ] + , Para [ Str "Definition" , Space , Str "lists" ] , DefinitionList - [ - ( - [ Strong [ Str "term1" ] ] - , - [ - [ Para - [ Str "definition", Space, Str "1" ] - , Para - [ Str "continued" ] + [ ( [ Strong [ Str "term1" ] ] + , [ [ Para [ Str "definition" , Space , Str "1" ] + , Para [ Str "continued" ] + ] ] - ] - ) - , - ( - [ Strong [ Str "term2" ] ] - , - [ - [ Para - [ Str "definition" - , Space - , Str "2" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" - , Space - , Str "*" + ) + , ( [ Strong [ Str "term2" ] ] + , [ [ Para + [ Str "definition" + , Space + , Str "2" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + , Space + , Str "*" + ] ] ] - ] - ) - ] - , Header 1 - ( "", [], [] ) - [ Str "Special", Space, Str "Characters" ] - , Para - [ Str "AT&T" - , Space - , Str "has" - , Space - , Str "an" - , Space - , Str "ampersand" - , Space - , Str "in" - , Space - , Str "their" - , Space - , Str "name." - ] - , Para - [ Str "4", Space, Str "<", Space, Str "5." ] - , Para - [ Str "6", Space, Str ">", Space, Str "5." ] - , Para - [ Str "Backslash:", Space, Str "\\" ] - , Para - [ Str "Backtick:", Space, Str "`" ] - , Para - [ Str "Asterisk:", Space, Str "*" ] - , Para - [ Str "Underscore:", Space, Str "_" ] - , Para - [ Str "Left", Space, Str "brace:", Space, Str "{" ] - , Para - [ Str "Right", Space, Str "brace:", Space, Str "}" ] - , Para - [ Str "Left", Space, Str "bracket:", Space, Str "[" ] - , Para - [ Str "Right", Space, Str "bracket:", Space, Str "]" ] - , Para - [ Str "Left", Space, Str "paren:", Space, Str "(" ] + ) + ] + , Header + 1 + ( "" , [] , [] ) + [ Str "Special" , Space , Str "Characters" ] , Para - [ Str "Right", Space, Str "paren:", Space, Str ")" ] + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para [ Str "4" , Space , Str "<" , Space , Str "5." ] + , Para [ Str "6" , Space , Str ">" , Space , Str "5." ] + , Para [ Str "Backslash:" , Space , Str "\\" ] + , Para [ Str "Backtick:" , Space , Str "`" ] + , Para [ Str "Asterisk:" , Space , Str "*" ] + , Para [ Str "Underscore:" , Space , Str "_" ] , Para - [ Str "Greater-than:", Space, Str ">" ] + [ Str "Left" , Space , Str "brace:" , Space , Str "{" ] , Para - [ Str "Hash:", Space, Str "#" ] + [ Str "Right" , Space , Str "brace:" , Space , Str "}" ] , Para - [ Str "Period:", Space, Str "." ] + [ Str "Left" , Space , Str "bracket:" , Space , Str "[" ] , Para - [ Str "Bang:", Space, Str "!" ] + [ Str "Right" , Space , Str "bracket:" , Space , Str "]" ] , Para - [ Str "Plus:", Space, Str "+" ] + [ Str "Left" , Space , Str "paren:" , Space , Str "(" ] , Para - [ Str "Minus:", Space, Str "-" ] - , Header 1 - ( "", [], [] ) - [ Str "Links" ] + [ Str "Right" , Space , Str "paren:" , Space , Str ")" ] + , Para [ Str "Greater-than:" , Space , Str ">" ] + , Para [ Str "Hash:" , Space , Str "#" ] + , Para [ Str "Period:" , Space , Str "." ] + , Para [ Str "Bang:" , Space , Str "!" ] + , Para [ Str "Plus:" , Space , Str "+" ] + , Para [ Str "Minus:" , Space , Str "-" ] + , Header 1 ( "" , [] , [] ) [ Str "Links" ] , Para - [ Link - ( "", [], [] ) - [ Str "some", Space, Str "randomsite" ] - ( "http://example.com", "" ) - , Str "." - ] + [ Link + ( "" , [] , [] ) + [ Str "some" , Space , Str "randomsite" ] + ( "http://example.com" , "" ) + , Str "." + ] , Para - [ Link - ( "", [], [] ) - [ Str "my", Space, Str "email", Space, Str "address" ] - ( "mailto:me@example.com", "" ) - , Str "." - ] - , Header 1 - ( "", [], [] ) - [ Str "Macros" ] + [ Link + ( "" , [] , [] ) + [ Str "my" , Space , Str "email" , Space , Str "address" ] + ( "mailto:me@example.com" , "" ) + , Str "." + ] + , Header 1 ( "" , [] , [] ) [ Str "Macros" ] , Para - [ Strong - [ Str "Me", Space, Str "Myself" ] - , Space - , Str "and" - , Space - , Str "I." - , Space - , Emph - [ Str "The" - , Space - , Str "author" + [ Strong [ Str "Me" , Space , Str "Myself" ] , Space - , Str "is" + , Str "and" + , Space + , Str "I." + , Space + , Emph + [ Str "The" + , Space + , Str "author" + , Space + , Str "is" + , Space + , Str "John" + , Space + , Str "Jones." + ] , Space - , Str "John" - , Space - , Str "Jones." - ] - , Space - , Str "It's" - , Space - , Str "The" - , Space - , Strong - [ Str "Author" ] - , Str "." - ] - , Header 1 - ( "", [], [] ) - [ Str "Tables" ] + , Str "It's" + , Space + , Str "The" + , Space + , Strong [ Str "Author" ] + , Str "." + ] + , Header 1 ( "" , [] , [] ) [ Str "Tables" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left", Space, Emph [ Str "more" ] ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" , Space , Emph [ Str "more" ] ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Centered", Space, Str "Header" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left", Space, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right", Space, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default", Space, Str "aligned" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "First" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "row" - , Space - , Str "that" - , Space - , Str "spans" - , Space - , Str "multiple" - , Space - , Str "lines." - ] - ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Second" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Here\8217s" - , Space - , Str "another" - , Space - , Str "one." - , Space - , Str "Note" - , Space - , Str "the" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "between" - , Space - , Str "rows." - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Centered" , Space , Str "Header" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" , Space , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" , Space , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" , Space , Str "aligned" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "First" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Second" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , Space + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Table" - , Space - , Str "without" - , Space - , Str "column" - , Space - , Str "headers:" - ] + [ Str "Table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignRight, ColWidth 0.5 ), ( AlignLeft, ColWidth 0.5 ) ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "a" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "one" ], Para [ Str "two" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ CodeBlock ( "", [], [] ) "some\n code" ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidth 0.5 ) + , ( AlignLeft , ColWidth 0.5 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "a" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "one" ] , Para [ Str "two" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ CodeBlock ( "" , [] , [] ) "some\n code" ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] diff --git a/test/markdown-citations.native b/test/markdown-citations.native index bafdb0bbf..f37fd82fb 100644 --- a/test/markdown-citations.native +++ b/test/markdown-citations.native @@ -1,539 +1,522 @@ -[ Header 1 - ( "pandoc-with-citeproc-hs", [], [] ) - [ Str "Pandoc", Space, Str "with", Space, Str "citeproc-hs" ] -, BulletList - [ - [ Para - [ Cite - [ Citation - { citationId = "nonexistent" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 1 - , citationHash = 0 - } - ] - [ Str "[@nonexistent]" ] - ] +[ Header + 1 + ( "pandoc-with-citeproc-hs" , [] , [] ) + [ Str "Pandoc" + , Space + , Str "with" + , Space + , Str "citeproc-hs" ] - , - [ Para - [ Cite - [ Citation - { citationId = "nonexistent" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = AuthorInText - , citationNoteNum = 2 - , citationHash = 0 - } - ] - [ Str "@nonexistent" ] +, BulletList + [ [ Para + [ Cite + [ Citation + { citationId = "nonexistent" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "[@nonexistent]" ] + ] ] - ] - , - [ Para - [ Cite - [ Citation - { citationId = "item1" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = AuthorInText - , citationNoteNum = 3 - , citationHash = 0 - } - ] - [ Str "@item1" ] - , Space - , Str "says" - , Space - , Str "blah." + , [ Para + [ Cite + [ Citation + { citationId = "nonexistent" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 2 + , citationHash = 0 + } + ] + [ Str "@nonexistent" ] + ] ] - ] - , - [ Para - [ Cite - [ Citation - { citationId = "item1" - , citationPrefix = [] - , citationSuffix = - [ Str "p.\160\&30" ] - , citationMode = AuthorInText - , citationNoteNum = 4 - , citationHash = 0 - } - ] - [ Str "@item1", Space, Str "[p.", Space, Str "30]" ] - , Space - , Str "says" - , Space - , Str "blah." + , [ Para + [ Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 3 + , citationHash = 0 + } + ] + [ Str "@item1" ] + , Space + , Str "says" + , Space + , Str "blah." + ] ] - ] - , - [ Para - [ Cite - [ Citation - { citationId = "item1" - , citationPrefix = [] - , citationSuffix = - [ Str "p.\160\&30," - , Space - , Str "with" - , Space - , Str "suffix" - ] - , citationMode = AuthorInText - , citationNoteNum = 5 - , citationHash = 0 - } - ] - [ Str "@item1" - , Space - , Str "[p." - , Space - , Str "30," - , Space - , Str "with" - , Space - , Str "suffix]" - ] - , Space - , Str "says" - , Space - , Str "blah." + , [ Para + [ Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = [ Str "p.\160\&30" ] + , citationMode = AuthorInText + , citationNoteNum = 4 + , citationHash = 0 + } + ] + [ Str "@item1" , Space , Str "[p." , Space , Str "30]" ] + , Space + , Str "says" + , Space + , Str "blah." + ] ] - ] - , - [ Para - [ Cite - [ Citation - { citationId = "item1" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = AuthorInText - , citationNoteNum = 6 - , citationHash = 0 - } - , Citation - { citationId = "item2" - , citationPrefix = [] - , citationSuffix = - [ Space, Str "p.\160\&30" ] - , citationMode = SuppressAuthor - , citationNoteNum = 6 - , citationHash = 0 - } - , Citation - { citationId = "\1087\1091\1085\1082\1090\&3" - , citationPrefix = - [ Str "see", Space, Str "also" ] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 6 - , citationHash = 0 - } - ] - [ Str "@item1" - , Space - , Str "[-@item2" - , Space - , Str "p." - , Space - , Str "30;" - , Space - , Str "see" - , Space - , Str "also" - , Space - , Str "@\1087\1091\1085\1082\1090\&3]" - ] - , Space - , Str "says" - , Space - , Str "blah." + , [ Para + [ Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = + [ Str "p.\160\&30," + , Space + , Str "with" + , Space + , Str "suffix" + ] + , citationMode = AuthorInText + , citationNoteNum = 5 + , citationHash = 0 + } + ] + [ Str "@item1" + , Space + , Str "[p." + , Space + , Str "30," + , Space + , Str "with" + , Space + , Str "suffix]" + ] + , Space + , Str "says" + , Space + , Str "blah." + ] ] - ] - , - [ Para - [ Str "In" - , Space - , Str "a" - , Space - , Str "note." - , Note - [ Para + , [ Para [ Cite - [ Citation - { citationId = "\1087\1091\1085\1082\1090\&3" - , citationPrefix = [] - , citationSuffix = - [ Str "p.\160\&12" ] - , citationMode = AuthorInText - , citationNoteNum = 7 - , citationHash = 0 - } - ] - [ Str "@\1087\1091\1085\1082\1090\&3" - , Space - , Str "[p." - , Space - , Str "12]" - ] + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 6 + , citationHash = 0 + } + , Citation + { citationId = "item2" + , citationPrefix = [] + , citationSuffix = [ Space , Str "p.\160\&30" ] + , citationMode = SuppressAuthor + , citationNoteNum = 6 + , citationHash = 0 + } + , Citation + { citationId = "\1087\1091\1085\1082\1090\&3" + , citationPrefix = [ Str "see" , Space , Str "also" ] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 6 + , citationHash = 0 + } + ] + [ Str "@item1" + , Space + , Str "[-@item2" + , Space + , Str "p." + , Space + , Str "30;" + , Space + , Str "see" + , Space + , Str "also" + , Space + , Str "@\1087\1091\1085\1082\1090\&3]" + ] , Space - , Str "and" + , Str "says" + , Space + , Str "blah." + ] + ] + , [ Para + [ Str "In" , Space , Str "a" , Space - , Str "citation" + , Str "note." + , Note + [ Para + [ Cite + [ Citation + { citationId = "\1087\1091\1085\1082\1090\&3" + , citationPrefix = [] + , citationSuffix = [ Str "p.\160\&12" ] + , citationMode = AuthorInText + , citationNoteNum = 7 + , citationHash = 0 + } + ] + [ Str "@\1087\1091\1085\1082\1090\&3" + , Space + , Str "[p." + , Space + , Str "12]" + ] + , Space + , Str "and" + , Space + , Str "a" + , Space + , Str "citation" + , Space + , Str "without" + , Space + , Str "locators" + , Space + , Cite + [ Citation + { citationId = "\1087\1091\1085\1082\1090\&3" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 7 + , citationHash = 0 + } + ] + [ Str "[@\1087\1091\1085\1082\1090\&3]" ] + , Str "." + ] + ] + ] + ] + , [ Para + [ Str "A" , Space - , Str "without" + , Str "citation" , Space - , Str "locators" + , Str "group" , Space , Cite - [ Citation - { citationId = "\1087\1091\1085\1082\1090\&3" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 7 - , citationHash = 0 - } - ] - [ Str "[@\1087\1091\1085\1082\1090\&3]" ] + [ Citation + { citationId = "item1" + , citationPrefix = [ Str "see" ] + , citationSuffix = [ Space , Str "chap.\160\&3" ] + , citationMode = NormalCitation + , citationNoteNum = 8 + , citationHash = 0 + } + , Citation + { citationId = "\1087\1091\1085\1082\1090\&3" + , citationPrefix = [ Str "also" ] + , citationSuffix = [ Space , Str "p.\160\&34-35" ] + , citationMode = NormalCitation + , citationNoteNum = 8 + , citationHash = 0 + } + ] + [ Str "[see" + , Space + , Str "@item1" + , Space + , Str "chap." + , Space + , Str "3;" + , Space + , Str "also" + , Space + , Str "@\1087\1091\1085\1082\1090\&3" + , Space + , Str "p." + , Space + , Str "34-35]" + ] , Str "." ] - ] - ] - ] - , - [ Para - [ Str "A" - , Space - , Str "citation" - , Space - , Str "group" - , Space - , Cite - [ Citation - { citationId = "item1" - , citationPrefix = - [ Str "see" ] - , citationSuffix = - [ Space, Str "chap.\160\&3" ] - , citationMode = NormalCitation - , citationNoteNum = 8 - , citationHash = 0 - } - , Citation - { citationId = "\1087\1091\1085\1082\1090\&3" - , citationPrefix = - [ Str "also" ] - , citationSuffix = - [ Space, Str "p.\160\&34-35" ] - , citationMode = NormalCitation - , citationNoteNum = 8 - , citationHash = 0 - } - ] - [ Str "[see" - , Space - , Str "@item1" - , Space - , Str "chap." - , Space - , Str "3;" - , Space - , Str "also" - , Space - , Str "@\1087\1091\1085\1082\1090\&3" - , Space - , Str "p." - , Space - , Str "34-35]" - ] - , Str "." - ] - ] - , - [ Para - [ Str "Another" - , Space - , Str "one" - , Space - , Cite - [ Citation - { citationId = "item1" - , citationPrefix = - [ Str "see" ] - , citationSuffix = - [ Space, Str "p.\160\&34-35" ] - , citationMode = NormalCitation - , citationNoteNum = 9 - , citationHash = 0 - } - ] - [ Str "[see" - , Space - , Str "@item1" - , Space - , Str "p." - , Space - , Str "34-35]" - ] - , Str "." ] - ] - , - [ Para - [ Str "And" - , Space - , Str "another" - , Space - , Str "one" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "note." - , Note - [ Para - [ Str "Some" - , Space - , Str "citations" + , [ Para + [ Str "Another" + , Space + , Str "one" , Space , Cite - [ Citation - { citationId = "item1" - , citationPrefix = - [ Str "see" ] - , citationSuffix = - [ Space, Str "chap.\160\&3" ] - , citationMode = NormalCitation - , citationNoteNum = 10 - , citationHash = 0 - } - , Citation - { citationId = "\1087\1091\1085\1082\1090\&3" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 10 - , citationHash = 0 - } - , Citation - { citationId = "item2" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 10 - , citationHash = 0 - } - ] - [ Str "[see" - , Space - , Str "@item1" - , Space - , Str "chap." - , Space - , Str "3;" - , Space - , Str "@\1087\1091\1085\1082\1090\&3;" - , Space - , Str "@item2]" - ] + [ Citation + { citationId = "item1" + , citationPrefix = [ Str "see" ] + , citationSuffix = [ Space , Str "p.\160\&34-35" ] + , citationMode = NormalCitation + , citationNoteNum = 9 + , citationHash = 0 + } + ] + [ Str "[see" + , Space + , Str "@item1" + , Space + , Str "p." + , Space + , Str "34-35]" + ] , Str "." ] - ] - ] - ] - , - [ Para - [ Str "Citation" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "suffix" - , Space - , Str "and" - , Space - , Str "locator" - , Space - , Cite - [ Citation - { citationId = "item1" - , citationPrefix = [] - , citationSuffix = - [ Space - , Str "pp.\160\&33," - , Space - , Str "35-37," - , Space - , Str "and" - , Space - , Str "nowhere" - , Space - , Str "else" - ] - , citationMode = NormalCitation - , citationNoteNum = 11 - , citationHash = 0 - } - ] - [ Str "[@item1" - , Space - , Str "pp." - , Space - , Str "33," - , Space - , Str "35-37," - , Space - , Str "and" - , Space - , Str "nowhere" - , Space - , Str "else]" - ] - , Str "." ] - ] - , - [ Para - [ Str "Citation" - , Space - , Str "with" - , Space - , Str "suffix" - , Space - , Str "only" - , Space - , Cite - [ Citation - { citationId = "item1" - , citationPrefix = [] - , citationSuffix = - [ Space - , Str "and" - , Space - , Str "nowhere" - , Space - , Str "else" - ] - , citationMode = NormalCitation - , citationNoteNum = 12 - , citationHash = 0 - } - ] - [ Str "[@item1" - , Space - , Str "and" - , Space - , Str "nowhere" - , Space - , Str "else]" - ] - , Str "." - ] - ] - , - [ Para - [ Str "Now" - , Space - , Str "some" - , Space - , Str "modifiers." - , Note - [ Para - [ Str "Like" + , [ Para + [ Str "And" + , Space + , Str "another" + , Space + , Str "one" + , Space + , Str "in" , Space , Str "a" , Space - , Str "citation" + , Str "note." + , Note + [ Para + [ Str "Some" + , Space + , Str "citations" + , Space + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = [ Str "see" ] + , citationSuffix = + [ Space , Str "chap.\160\&3" ] + , citationMode = NormalCitation + , citationNoteNum = 10 + , citationHash = 0 + } + , Citation + { citationId = "\1087\1091\1085\1082\1090\&3" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 10 + , citationHash = 0 + } + , Citation + { citationId = "item2" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 10 + , citationHash = 0 + } + ] + [ Str "[see" + , Space + , Str "@item1" + , Space + , Str "chap." + , Space + , Str "3;" + , Space + , Str "@\1087\1091\1085\1082\1090\&3;" + , Space + , Str "@item2]" + ] + , Str "." + ] + ] + ] + ] + , [ Para + [ Str "Citation" , Space - , Str "without" + , Str "with" , Space - , Str "author:" + , Str "a" , Space - , Cite - [ Citation - { citationId = "item1" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = SuppressAuthor - , citationNoteNum = 13 - , citationHash = 0 - } - ] - [ Str "[-@item1]" ] - , Str "," + , Str "suffix" , Space , Str "and" , Space - , Str "now" + , Str "locator" , Space - , Str "Doe" + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = + [ Space + , Str "pp.\160\&33," + , Space + , Str "35-37," + , Space + , Str "and" + , Space + , Str "nowhere" + , Space + , Str "else" + ] + , citationMode = NormalCitation + , citationNoteNum = 11 + , citationHash = 0 + } + ] + [ Str "[@item1" + , Space + , Str "pp." + , Space + , Str "33," + , Space + , Str "35-37," + , Space + , Str "and" + , Space + , Str "nowhere" + , Space + , Str "else]" + ] + , Str "." + ] + ] + , [ Para + [ Str "Citation" , Space , Str "with" , Space - , Str "a" + , Str "suffix" , Space - , Str "locator" + , Str "only" , Space , Cite - [ Citation - { citationId = "item2" - , citationPrefix = [] - , citationSuffix = - [ Space, Str "p.\160\&44" ] - , citationMode = SuppressAuthor - , citationNoteNum = 13 - , citationHash = 0 - } - ] - [ Str "[-@item2", Space, Str "p.", Space, Str "44]" ] + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = + [ Space + , Str "and" + , Space + , Str "nowhere" + , Space + , Str "else" + ] + , citationMode = NormalCitation + , citationNoteNum = 12 + , citationHash = 0 + } + ] + [ Str "[@item1" + , Space + , Str "and" + , Space + , Str "nowhere" + , Space + , Str "else]" + ] , Str "." ] - ] ] - ] - , - [ Para - [ Str "With" - , Space - , Str "some" - , Space - , Str "markup" - , Space - , Cite - [ Citation - { citationId = "item1" - , citationPrefix = - [ Emph [ Str "see" ] ] - , citationSuffix = - [ Space, Str "p.\160", Strong [ Str "32" ] ] - , citationMode = NormalCitation - , citationNoteNum = 14 - , citationHash = 0 - } - ] - [ Str "[*see*" - , Space - , Str "@item1" - , Space - , Str "p." - , Space - , Str "**32**]" - ] - , Str "." + , [ Para + [ Str "Now" + , Space + , Str "some" + , Space + , Str "modifiers." + , Note + [ Para + [ Str "Like" + , Space + , Str "a" + , Space + , Str "citation" + , Space + , Str "without" + , Space + , Str "author:" + , Space + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = SuppressAuthor + , citationNoteNum = 13 + , citationHash = 0 + } + ] + [ Str "[-@item1]" ] + , Str "," + , Space + , Str "and" + , Space + , Str "now" + , Space + , Str "Doe" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "locator" + , Space + , Cite + [ Citation + { citationId = "item2" + , citationPrefix = [] + , citationSuffix = + [ Space , Str "p.\160\&44" ] + , citationMode = SuppressAuthor + , citationNoteNum = 13 + , citationHash = 0 + } + ] + [ Str "[-@item2" + , Space + , Str "p." + , Space + , Str "44]" + ] + , Str "." + ] + ] + ] + ] + , [ Para + [ Str "With" + , Space + , Str "some" + , Space + , Str "markup" + , Space + , Cite + [ Citation + { citationId = "item1" + , citationPrefix = [ Emph [ Str "see" ] ] + , citationSuffix = + [ Space , Str "p.\160" , Strong [ Str "32" ] ] + , citationMode = NormalCitation + , citationNoteNum = 14 + , citationHash = 0 + } + ] + [ Str "[*see*" + , Space + , Str "@item1" + , Space + , Str "p." + , Space + , Str "**32**]" + ] + , Str "." + ] ] ] - ] -, Header 1 - ( "references", [], [] ) - [ Str "References" ] +, Header 1 ( "references" , [] , [] ) [ Str "References" ] ] diff --git a/test/markdown-reader-more.native b/test/markdown-reader-more.native index 99ab260ba..7c15f627a 100644 --- a/test/markdown-reader-more.native +++ b/test/markdown-reader-more.native @@ -1,501 +1,406 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "author" - , MetaList - [ MetaInlines - [ Str "Author", Space, Str "One" ] - , MetaInlines - [ Str "Author", Space, Str "Two" ] - , MetaInlines - [ Str "Author", Space, Str "Three" ] - , MetaInlines - [ Str "Author", Space, Str "Four" ] + Meta + { unMeta = + fromList + [ ( "author" + , MetaList + [ MetaInlines [ Str "Author" , Space , Str "One" ] + , MetaInlines [ Str "Author" , Space , Str "Two" ] + , MetaInlines [ Str "Author" , Space , Str "Three" ] + , MetaInlines [ Str "Author" , Space , Str "Four" ] + ] + ) + , ( "title" + , MetaInlines + [ Str "Title" + , SoftBreak + , Str "spanning" + , Space + , Str "multiple" + , Space + , Str "lines" + ] + ) ] - ) - , - ( "title" - , MetaInlines - [ Str "Title" - , SoftBreak - , Str "spanning" - , Space - , Str "multiple" - , Space - , Str "lines" - ] - ) - ] } - ) - [ Header 1 - ( "additional-markdown-reader-tests", [], [] ) - [ Str "Additional" - , Space - , Str "markdown" - , Space - , Str "reader" - , Space - , Str "tests" - ] - , Header 2 - ( "blank-line-before-url-in-link-reference", [], [] ) - [ Str "Blank" - , Space - , Str "line" - , Space - , Str "before" - , Space - , Str "URL" - , Space - , Str "in" - , Space - , Str "link" - , Space - , Str "reference" - ] + [ Header + 1 + ( "additional-markdown-reader-tests" , [] , [] ) + [ Str "Additional" + , Space + , Str "markdown" + , Space + , Str "reader" + , Space + , Str "tests" + ] + , Header + 2 + ( "blank-line-before-url-in-link-reference" , [] , [] ) + [ Str "Blank" + , Space + , Str "line" + , Space + , Str "before" + , Space + , Str "URL" + , Space + , Str "in" + , Space + , Str "link" + , Space + , Str "reference" + ] , Para - [ Link - ( "", [], [] ) - [ Str "foo" ] - ( "/url", "" ) - , Space - , Str "and" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url", "title" ) - ] - , Header 2 - ( "raw-context-environments", [], [] ) - [ Str "Raw", Space, Str "ConTeXt", Space, Str "environments" ] - , RawBlock - ( Format "tex" ) "\\placeformula \\startformula" + [ Link ( "" , [] , [] ) [ Str "foo" ] ( "/url" , "" ) + , Space + , Str "and" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url" , "title" ) + ] + , Header + 2 + ( "raw-context-environments" , [] , [] ) + [ Str "Raw" + , Space + , Str "ConTeXt" + , Space + , Str "environments" + ] + , RawBlock (Format "tex") "\\placeformula \\startformula" , Para - [ Str "L_{1}" - , Space - , Str "=" - , Space - , Str "L_{2}" - , SoftBreak - , RawInline - ( Format "tex" ) "\\stopformula" - ] + [ Str "L_{1}" + , Space + , Str "=" + , Space + , Str "L_{2}" + , SoftBreak + , RawInline (Format "tex") "\\stopformula" + ] , RawBlock - ( Format "tex" ) "\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]" - , Header 2 - ( "raw-latex-environments", [], [] ) - [ Str "Raw", Space, Str "LaTeX", Space, Str "environments" ] + (Format "tex") + "\\start[a2]\n\\start[a2]\n\\stop[a2]\n\\stop[a2]" + , Header + 2 + ( "raw-latex-environments" , [] , [] ) + [ Str "Raw" + , Space + , Str "LaTeX" + , Space + , Str "environments" + ] , RawBlock - ( Format "tex" ) "\\begin{center}\n\\begin{tikzpicture}[baseline={([yshift=+-.5ex]current bounding box.center)}, level distance=24pt]\n\\Tree [.{S} [.NP John\\index{i} ] [.VP [.V likes ] [.NP himself\\index{i,*j} ]]]\n\\end{tikzpicture}\n\\end{center}" - , Header 2 - ( "urls-with-spaces-and-punctuation", [], [] ) - [ Str "URLs" - , Space - , Str "with" - , Space - , Str "spaces" - , Space - , Str "and" - , Space - , Str "punctuation" - ] + (Format "tex") + "\\begin{center}\n\\begin{tikzpicture}[baseline={([yshift=+-.5ex]current bounding box.center)}, level distance=24pt]\n\\Tree [.{S} [.NP John\\index{i} ] [.VP [.V likes ] [.NP himself\\index{i,*j} ]]]\n\\end{tikzpicture}\n\\end{center}" + , Header + 2 + ( "urls-with-spaces-and-punctuation" , [] , [] ) + [ Str "URLs" + , Space + , Str "with" + , Space + , Str "spaces" + , Space + , Str "and" + , Space + , Str "punctuation" + ] , Para - [ Link - ( "", [], [] ) - [ Str "foo" ] - ( "/bar%20and%20baz", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "foo" ] - ( "/bar%20and%20baz", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "foo" ] - ( "/bar%20and%20baz", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "foo" ] - ( "bar%20baz", "title" ) - ] + [ Link + ( "" , [] , [] ) [ Str "foo" ] ( "/bar%20and%20baz" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "foo" ] ( "/bar%20and%20baz" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "foo" ] ( "/bar%20and%20baz" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "foo" ] ( "bar%20baz" , "title" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "baz" ] - ( "/foo%20foo", "" ) - , Space - , Link - ( "", [], [] ) - [ Str "bam" ] - ( "/foo%20fee", "" ) - , Space - , Link - ( "", [], [] ) - [ Str "bork" ] - ( "/foo/zee%20zob", "title" ) - ] + [ Link ( "" , [] , [] ) [ Str "baz" ] ( "/foo%20foo" , "" ) + , Space + , Link ( "" , [] , [] ) [ Str "bam" ] ( "/foo%20fee" , "" ) + , Space + , Link + ( "" , [] , [] ) + [ Str "bork" ] + ( "/foo/zee%20zob" , "title" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "Ward\8217s", Space, Str "method." ] - ( "http://en.wikipedia.org/wiki/Ward's_method", "" ) - ] - , Header 2 - ( "horizontal-rules-with-spaces-at-end", [], [] ) - [ Str "Horizontal" - , Space - , Str "rules" - , Space - , Str "with" - , Space - , Str "spaces" - , Space - , Str "at" - , Space - , Str "end" - ] + [ Link + ( "" , [] , [] ) + [ Str "Ward\8217s" , Space , Str "method." ] + ( "http://en.wikipedia.org/wiki/Ward's_method" , "" ) + ] + , Header + 2 + ( "horizontal-rules-with-spaces-at-end" , [] , [] ) + [ Str "Horizontal" + , Space + , Str "rules" + , Space + , Str "with" + , Space + , Str "spaces" + , Space + , Str "at" + , Space + , Str "end" + ] , HorizontalRule , HorizontalRule - , Header 2 - ( "raw-html-before-header", [], [] ) - [ Str "Raw" - , Space - , Str "HTML" - , Space - , Str "before" - , Space - , Str "header" - ] - , Para - [ RawInline - ( Format "html" ) "" - , RawInline - ( Format "html" ) "" - ] - , Header 3 - ( "my-header", [], [] ) - [ Str "my", Space, Str "header" ] - , Header 2 - ( "in-math", [], [] ) - [ Str "$", Space, Str "in", Space, Str "math" ] + , Header + 2 + ( "raw-html-before-header" , [] , [] ) + [ Str "Raw" + , Space + , Str "HTML" + , Space + , Str "before" + , Space + , Str "header" + ] , Para - [ Math InlineMath "\\$2 + \\$3" ] + [ RawInline (Format "html") "" + , RawInline (Format "html") "" + ] + , Header + 3 + ( "my-header" , [] , [] ) + [ Str "my" , Space , Str "header" ] + , Header + 2 + ( "in-math" , [] , [] ) + [ Str "$" , Space , Str "in" , Space , Str "math" ] + , Para [ Math InlineMath "\\$2 + \\$3" ] , Para - [ Math InlineMath "x = \\text{the $n$th root of $y$}" ] + [ Math InlineMath "x = \\text{the $n$th root of $y$}" ] , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "math:" - ] + [ Str "This" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "math:" + ] , Para - [ Str "$PATH", Space, Str "90", Space, Str "$PATH" ] - , Header 2 - ( "commented-out-list-item", [], [] ) - [ Str "Commented-out", Space, Str "list", Space, Str "item" ] + [ Str "$PATH" , Space , Str "90" , Space , Str "$PATH" ] + , Header + 2 + ( "commented-out-list-item" , [] , [] ) + [ Str "Commented-out" + , Space + , Str "list" + , Space + , Str "item" + ] , BulletList - [ - [ Plain - [ Str "one" - , SoftBreak - , RawInline - ( Format "html" ) "" + [ [ Plain + [ Str "one" + , SoftBreak + , RawInline (Format "html") "" + ] ] + , [ Plain [ Str "three" ] ] + ] + , Header + 2 + ( "indented-code-at-beginning-of-list" , [] , [] ) + [ Str "Indented" + , Space + , Str "code" + , Space + , Str "at" + , Space + , Str "beginning" + , Space + , Str "of" + , Space + , Str "list" ] - , - [ Plain [ Str "three" ] ] - ] - , Header 2 - ( "indented-code-at-beginning-of-list", [], [] ) - [ Str "Indented" - , Space - , Str "code" - , Space - , Str "at" - , Space - , Str "beginning" - , Space - , Str "of" - , Space - , Str "list" - ] , BulletList - [ - [ CodeBlock - ( "", [], [] ) "code\ncode" - , OrderedList - ( 1, Decimal, Period ) - [ - [ CodeBlock ( "", [], [] ) "code\ncode" ] - , - [ CodeBlock ( "", [], [] ) "code\ncode" ] - ] - , BulletList - [ - [ CodeBlock ( "", [], [] ) "code\ncode" ] - , - [ Plain [ Str "no", Space, Str "code" ] ] + [ [ CodeBlock ( "" , [] , [] ) "code\ncode" + , OrderedList + ( 1 , Decimal , Period ) + [ [ CodeBlock ( "" , [] , [] ) "code\ncode" ] + , [ CodeBlock ( "" , [] , [] ) "code\ncode" ] + ] + , BulletList + [ [ CodeBlock ( "" , [] , [] ) "code\ncode" ] + , [ Plain [ Str "no" , Space , Str "code" ] ] + ] ] ] - ] - , Header 2 - ( "backslash-newline", [], [] ) - [ Str "Backslash", Space, Str "newline" ] - , Para - [ Str "hi", LineBreak, Str "there" ] - , Header 2 - ( "code-spans", [], [] ) - [ Str "Code", Space, Str "spans" ] + , Header + 2 + ( "backslash-newline" , [] , [] ) + [ Str "Backslash" , Space , Str "newline" ] + , Para [ Str "hi" , LineBreak , Str "there" ] + , Header + 2 + ( "code-spans" , [] , [] ) + [ Str "Code" , Space , Str "spans" ] + , Para [ Code ( "" , [] , [] ) "hi\\" ] + , Para [ Code ( "" , [] , [] ) "hi there" ] + , Para [ Code ( "" , [] , [] ) "hi````there" ] + , Para [ Str "`hi" ] + , Para [ Str "there`" ] + , Header + 2 + ( "multilingual-urls" , [] , [] ) + [ Str "Multilingual" , Space , Str "URLs" ] , Para - [ Code ( "", [], [] ) "hi\\" ] - , Para - [ Code ( "", [], [] ) "hi there" ] - , Para - [ Code ( "", [], [] ) "hi````there" ] - , Para - [ Str "`hi" ] - , Para - [ Str "there`" ] - , Header 2 - ( "multilingual-urls", [], [] ) - [ Str "Multilingual", Space, Str "URLs" ] - , Para - [ Link - ( "", [ "uri" ], [] ) - [ Str "http://\27979.com?\27979=\27979" ] - ( "http://\27979.com?\27979=\27979", "" ) - ] + [ Link + ( "" , [ "uri" ] , [] ) + [ Str "http://\27979.com?\27979=\27979" ] + ( "http://\27979.com?\27979=\27979" , "" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "foo" ] - ( "/bar/\27979?x=\27979", "title" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "foo" ] + ( "/bar/\27979?x=\27979" , "title" ) + ] , Para - [ Link - ( "", [ "email" ], [] ) - [ Str "\27979@foo.\27979.baz" ] - ( "mailto:\27979@foo.\27979.baz", "" ) - ] - , Header 2 - ( "numbered-examples", [], [] ) - [ Str "Numbered", Space, Str "examples" ] + [ Link + ( "" , [ "email" ] , [] ) + [ Str "\27979@foo.\27979.baz" ] + ( "mailto:\27979@foo.\27979.baz" , "" ) + ] + , Header + 2 + ( "numbered-examples" , [] , [] ) + [ Str "Numbered" , Space , Str "examples" ] , OrderedList - ( 1, Example, TwoParens ) - [ - [ Plain [ Str "First", Space, Str "example." ] ] - , - [ Plain [ Str "Second", Space, Str "example." ] ] - ] + ( 1 , Example , TwoParens ) + [ [ Plain [ Str "First" , Space , Str "example." ] ] + , [ Plain [ Str "Second" , Space , Str "example." ] ] + ] , Para - [ Str "Explanation" - , Space - , Str "of" - , Space - , Str "examples" - , Space - , Str "(2)" - , Space - , Str "and" - , Space - , Str "(3)." - ] + [ Str "Explanation" + , Space + , Str "of" + , Space + , Str "examples" + , Space + , Str "(2)" + , Space + , Str "and" + , Space + , Str "(3)." + ] , OrderedList - ( 3, Example, TwoParens ) - [ [ Plain [ Str "Third", Space, Str "example." ] ] ] - , Header 2 - ( "macros", [], [] ) - [ Str "Macros" ] + ( 3 , Example , TwoParens ) + [ [ Plain [ Str "Third" , Space , Str "example." ] ] ] + , Header 2 ( "macros" , [] , [] ) [ Str "Macros" ] , RawBlock - ( Format "tex" ) "\\newcommand{\\tuple}[1]{\\langle #1 \\rangle}" - , Para - [ Math InlineMath "\\langle x,y \\rangle" ] - , Header 2 - ( "case-insensitive-references", [], [] ) - [ Str "Case-insensitive", Space, Str "references" ] + (Format "tex") + "\\newcommand{\\tuple}[1]{\\langle #1 \\rangle}" + , Para [ Math InlineMath "\\langle x,y \\rangle" ] + , Header + 2 + ( "case-insensitive-references" , [] , [] ) + [ Str "Case-insensitive" , Space , Str "references" ] , Para - [ Link ( "", [], [] ) [ Str "Fum" ] ( "/fum", "" ) ] + [ Link ( "" , [] , [] ) [ Str "Fum" ] ( "/fum" , "" ) ] , Para - [ Link ( "", [], [] ) [ Str "FUM" ] ( "/fum", "" ) ] + [ Link ( "" , [] , [] ) [ Str "FUM" ] ( "/fum" , "" ) ] , Para - [ Link ( "", [], [] ) [ Str "bat" ] ( "/bat", "" ) ] - , Header 2 - ( "curly-smart-quotes", [], [] ) - [ Str "Curly", Space, Str "smart", Space, Str "quotes" ] - , Para - [ Quoted DoubleQuote [ Str "Hi" ] ] - , Para - [ Quoted SingleQuote [ Str "Hi" ] ] - , Header 2 - ( "consecutive-lists", [], [] ) - [ Str "Consecutive", Space, Str "lists" ] + [ Link ( "" , [] , [] ) [ Str "bat" ] ( "/bat" , "" ) ] + , Header + 2 + ( "curly-smart-quotes" , [] , [] ) + [ Str "Curly" , Space , Str "smart" , Space , Str "quotes" ] + , Para [ Quoted DoubleQuote [ Str "Hi" ] ] + , Para [ Quoted SingleQuote [ Str "Hi" ] ] + , Header + 2 + ( "consecutive-lists" , [] , [] ) + [ Str "Consecutive" , Space , Str "lists" ] , BulletList - [ [ Plain [ Str "one" ] ], [ Plain [ Str "two" ] ] ] + [ [ Plain [ Str "one" ] ] , [ Plain [ Str "two" ] ] ] , OrderedList - ( 1, Decimal, Period ) - [ [ Plain [ Str "one" ] ], [ Plain [ Str "two" ] ] ] + ( 1 , Decimal , Period ) + [ [ Plain [ Str "one" ] ] , [ Plain [ Str "two" ] ] ] , OrderedList - ( 1, LowerAlpha, Period ) - [ [ Plain [ Str "one" ] ], [ Plain [ Str "two" ] ] ] - , Header 2 - ( "implicit-header-references", [], [] ) - [ Str "Implicit", Space, Str "header", Space, Str "references" ] - , Header 3 - ( "my-header-1", [], [] ) - [ Str "My", Space, Str "header" ] - , Header 3 - ( "my-other-header", [], [] ) - [ Str "My", Space, Str "other", Space, Str "header" ] - , Para - [ Str "A" - , Space - , Str "link" - , Space - , Str "to" - , Space - , Link - ( "", [], [] ) - [ Str "My", Space, Str "header" ] - ( "#my-header-1", "" ) - , Str "." - ] - , Para - [ Str "Another" - , Space - , Str "link" - , Space - , Str "to" - , Space - , Link - ( "", [], [] ) - [ Str "it" ] - ( "#my-header-1", "" ) - , Str "." - ] - , Para - [ Str "Should" - , Space - , Str "be" - , Space - , Link - ( "", [], [] ) - [ Str "case", Space, Str "insensitive" ] - ( "#my-header-1", "" ) - , Str "." - ] - , Para - [ Str "Link" - , Space - , Str "to" - , Space - , Link - ( "", [], [] ) - [ Str "Explicit", Space, Str "header", Space, Str "attributes" ] - ( "#foobar", "" ) - , Str "." - ] - , Para - [ Str "But" - , Space - , Str "this" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "link" - , Space - , Str "to" - , Space - , Link - ( "", [], [] ) - [ Str "My", Space, Str "other", Space, Str "header" ] - ( "/foo", "" ) - , Str "," - , Space - , Str "since" - , Space - , Str "the" - , Space - , Str "reference" - , Space - , Str "is" - , Space - , Str "defined." - ] - , Header 2 - ( "foobar", [ "baz" ], [ ( "key", "val" ) ] ) - [ Str "Explicit", Space, Str "header", Space, Str "attributes" ] - , BlockQuote - [ Header 2 - ( "foobar", [ "baz" ], [ ( "key", "val" ) ] ) - [ Str "Header" - , Space - , Str "attributes" - , Space - , Str "inside" + ( 1 , LowerAlpha , Period ) + [ [ Plain [ Str "one" ] ] , [ Plain [ Str "two" ] ] ] + , Header + 2 + ( "implicit-header-references" , [] , [] ) + [ Str "Implicit" , Space - , Str "block" + , Str "header" , Space - , Str "quote" + , Str "references" ] - ] - , Header 2 - ( "line-blocks", [], [] ) - [ Str "Line", Space, Str "blocks" ] - , LineBlock - [ - [ Str "But" - , Space - , Str "can" - , Space - , Str "a" - , Space - , Str "bee" - , Space - , Str "be" + , Header + 3 + ( "my-header-1" , [] , [] ) + [ Str "My" , Space , Str "header" ] + , Header + 3 + ( "my-other-header" , [] , [] ) + [ Str "My" , Space , Str "other" , Space , Str "header" ] + , Para + [ Str "A" , Space - , Str "said" + , Str "link" , Space , Str "to" , Space - , Str "be" + , Link + ( "" , [] , [] ) + [ Str "My" , Space , Str "header" ] + ( "#my-header-1" , "" ) + , Str "." ] - , - [ Str "\160\160\160\160or" + , Para + [ Str "Another" , Space - , Str "not" + , Str "link" , Space , Str "to" , Space - , Str "be" - , Space - , Str "an" + , Link ( "" , [] , [] ) [ Str "it" ] ( "#my-header-1" , "" ) + , Str "." + ] + , Para + [ Str "Should" , Space - , Str "entire" + , Str "be" , Space - , Str "bee," + , Link + ( "" , [] , [] ) + [ Str "case" , Space , Str "insensitive" ] + ( "#my-header-1" , "" ) + , Str "." ] - , - [ Str "\160\160\160\160\160\160\160\160when" + , Para + [ Str "Link" , Space - , Str "half" + , Str "to" , Space - , Str "the" + , Link + ( "" , [] , [] ) + [ Str "Explicit" + , Space + , Str "header" + , Space + , Str "attributes" + ] + ( "#foobar" , "" ) + , Str "." + ] + , Para + [ Str "But" , Space - , Str "bee" + , Str "this" , Space , Str "is" , Space @@ -503,725 +408,937 @@ Pandoc , Space , Str "a" , Space - , Str "bee," - ] - , - [ Str "\160\160\160\160\160\160\160\160\160\160\160\160due" + , Str "link" , Space , Str "to" , Space - , Str "some" + , Link + ( "" , [] , [] ) + [ Str "My" , Space , Str "other" , Space , Str "header" ] + ( "/foo" , "" ) + , Str "," , Space - , Str "ancient" + , Str "since" , Space - , Str "injury?" + , Str "the" + , Space + , Str "reference" + , Space + , Str "is" + , Space + , Str "defined." ] - , [] - , - [ Str "Continuation", Space, Str "line" ] - , - [ Str "\160\160and", Space, Str "another" ] - ] - , Header 2 - ( "grid-tables", [], [] ) - [ Str "Grid", Space, Str "Tables" ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.2638888888888889 ) - , - ( AlignDefault, ColWidth 0.16666666666666666 ) - , - ( AlignDefault, ColWidth 0.18055555555555555 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "3" ] ] - ] + , Header + 2 + ( "foobar" , [ "baz" ] , [ ( "key" , "val" ) ] ) + [ Str "Explicit" + , Space + , Str "header" + , Space + , Str "attributes" ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "r1" - , Space - , Str "a" - , SoftBreak - , Str "r1" - , Space - , Str "bis" - ] + , BlockQuote + [ Header + 2 + ( "foobar" , [ "baz" ] , [ ( "key" , "val" ) ] ) + [ Str "Header" + , Space + , Str "attributes" + , Space + , Str "inside" + , Space + , Str "block" + , Space + , Str "quote" ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] + ] + , Header + 2 + ( "line-blocks" , [] , [] ) + [ Str "Line" , Space , Str "blocks" ] + , LineBlock + [ [ Str "But" + , Space + , Str "can" + , Space + , Str "a" + , Space + , Str "bee" + , Space + , Str "be" + , Space + , Str "said" + , Space + , Str "to" + , Space + , Str "be" ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r2", Space, Str "d" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] + , [ Str "\160\160\160\160or" + , Space + , Str "not" + , Space + , Str "to" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "entire" + , Space + , Str "bee," ] + , [ Str "\160\160\160\160\160\160\160\160when" + , Space + , Str "half" + , Space + , Str "the" + , Space + , Str "bee" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "bee," + ] + , [ Str + "\160\160\160\160\160\160\160\160\160\160\160\160due" + , Space + , Str "to" + , Space + , Str "some" + , Space + , Str "ancient" + , Space + , Str "injury?" + ] + , [] + , [ Str "Continuation" , Space , Str "line" ] + , [ Str "\160\160and" , Space , Str "another" ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Headless" ] + , Header + 2 + ( "grid-tables" , [] , [] ) + [ Str "Grid" , Space , Str "Tables" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.2638888888888889 ) - , - ( AlignDefault, ColWidth 0.16666666666666666 ) - , - ( AlignDefault, ColWidth 0.18055555555555555 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "r1" - , Space - , Str "a" - , SoftBreak - , Str "r1" - , Space - , Str "bis" - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.2638888888888889 ) + , ( AlignDefault , ColWidth 0.16666666666666666 ) + , ( AlignDefault , ColWidth 0.18055555555555555 ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "3" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "b" + , SoftBreak + , Str "b" + , Space + , Str "2" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "c" + , SoftBreak + , Str "c" + , Space + , Str "2" + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r2" , Space , Str "d" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r2", Space, Str "d" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "With", Space, Str "alignments" ] + (TableFoot ( "" , [] , [] ) []) + , Para [ Str "Headless" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidth 0.2638888888888889 ) - , - ( AlignLeft, ColWidth 0.16666666666666666 ) - , - ( AlignCenter, ColWidth 0.18055555555555555 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.2638888888888889 ) + , ( AlignDefault , ColWidth 0.16666666666666666 ) + , ( AlignDefault , ColWidth 0.18055555555555555 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "r1" - , Space - , Str "a" - , SoftBreak - , Str "r1" - , Space - , Str "bis" - ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "b" + , SoftBreak + , Str "b" + , Space + , Str "2" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "c" + , SoftBreak + , Str "c" + , Space + , Str "2" + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r2" , Space , Str "d" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r2", Space, Str "d" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Headless", Space, Str "with", Space, Str "alignments" ] + (TableFoot ( "" , [] , [] ) []) + , Para [ Str "With" , Space , Str "alignments" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidth 0.2638888888888889 ) - , - ( AlignLeft, ColWidth 0.16666666666666666 ) - , - ( AlignCenter, ColWidth 0.18055555555555555 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "r1" - , Space - , Str "a" - , SoftBreak - , Str "r1" - , Space - , Str "bis" - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidth 0.2638888888888889 ) + , ( AlignLeft , ColWidth 0.16666666666666666 ) + , ( AlignCenter , ColWidth 0.18055555555555555 ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "3" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "b" + , SoftBreak + , Str "b" + , Space + , Str "2" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "c" + , SoftBreak + , Str "c" + , Space + , Str "2" + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r2" , Space , Str "d" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r2", Space, Str "d" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Spaces" - , Space - , Str "at" - , Space - , Str "ends" - , Space - , Str "of" - , Space - , Str "lines" - ] + [ Str "Headless" + , Space + , Str "with" + , Space + , Str "alignments" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.2638888888888889 ) - , - ( AlignDefault, ColWidth 0.16666666666666666 ) - , - ( AlignDefault, ColWidth 0.18055555555555555 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "r1" - , Space - , Str "a" - , SoftBreak - , Str "r1" - , Space - , Str "bis" - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidth 0.2638888888888889 ) + , ( AlignLeft , ColWidth 0.16666666666666666 ) + , ( AlignCenter , ColWidth 0.18055555555555555 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "b" + , SoftBreak + , Str "b" + , Space + , Str "2" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "c" + , SoftBreak + , Str "c" + , Space + , Str "2" + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r2" , Space , Str "d" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r2", Space, Str "d" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Multiple" - , Space - , Str "blocks" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "cell" - ] + [ Str "Spaces" + , Space + , Str "at" + , Space + , Str "ends" + , Space + , Str "of" + , Space + , Str "lines" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.2638888888888889 ) - , - ( AlignDefault, ColWidth 0.16666666666666666 ) - , - ( AlignDefault, ColWidth 0.18055555555555555 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Header 1 - ( "col-1", [], [] ) - [ Str "col", Space, Str "1" ] - , Plain - [ Str "col", Space, Str "1" ] - ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Header 1 - ( "col-2", [], [] ) - [ Str "col", Space, Str "2" ] - , Plain - [ Str "col", Space, Str "2" ] - ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Header 1 - ( "col-3", [], [] ) - [ Str "col", Space, Str "3" ] - , Plain - [ Str "col", Space, Str "3" ] - ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para - [ Str "r1", Space, Str "a" ] - , Para - [ Str "r1", Space, Str "bis" ] - ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ BulletList - [ - [ Plain [ Str "b" ] ] - , - [ Plain [ Str "b", Space, Str "2" ] ] - , - [ Plain [ Str "b", Space, Str "2" ] ] - ] - ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "c" - , SoftBreak - , Str "c" - , Space - , Str "2" - , SoftBreak - , Str "c" - , Space - , Str "2" - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.2638888888888889 ) + , ( AlignDefault , ColWidth 0.16666666666666666 ) + , ( AlignDefault , ColWidth 0.18055555555555555 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "b" + , SoftBreak + , Str "b" + , Space + , Str "2" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "c" + , SoftBreak + , Str "c" + , Space + , Str "2" + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r2" , Space , Str "d" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Empty", Space, Str "cells" ] + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "cell" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 5.555555555555555 e- 2 ) - , - ( AlignDefault, ColWidth 5.555555555555555 e- 2 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.2638888888888889 ) + , ( AlignDefault , ColWidth 0.16666666666666666 ) + , ( AlignDefault , ColWidth 0.18055555555555555 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Header + 1 + ( "col-1" , [] , [] ) + [ Str "col" , Space , Str "1" ] + , Plain [ Str "col" , Space , Str "1" ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Header + 1 + ( "col-2" , [] , [] ) + [ Str "col" , Space , Str "2" ] + , Plain [ Str "col" , Space , Str "2" ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Header + 1 + ( "col-3" , [] , [] ) + [ Str "col" , Space , Str "3" ] + , Plain [ Str "col" , Space , Str "3" ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "r1" , Space , Str "a" ] + , Para [ Str "r1" , Space , Str "bis" ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ BulletList + [ [ Plain [ Str "b" ] ] + , [ Plain [ Str "b" , Space , Str "2" ] ] + , [ Plain [ Str "b" , Space , Str "2" ] ] + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "c" + , SoftBreak + , Str "c" + , Space + , Str "2" + , SoftBreak + , Str "c" + , Space + , Str "2" + ] + ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Para [ Str "Empty" , Space , Str "cells" ] + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 5.555555555555555e-2 ) + , ( AlignDefault , ColWidth 5.555555555555555e-2 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Header + 2 + ( "entities-in-links-and-titles" , [] , [] ) + [ Str "Entities" + , Space + , Str "in" + , Space + , Str "links" + , Space + , Str "and" + , Space + , Str "titles" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 2 - ( "entities-in-links-and-titles", [], [] ) - [ Str "Entities" - , Space - , Str "in" - , Space - , Str "links" - , Space - , Str "and" - , Space - , Str "titles" - ] - , Para - [ Link ( "", [], [] ) [ Str "link" ] ( "/\252rl", "\246\246!" ) ] - , Para - [ Link - ( "", [ "uri" ], [] ) - [ Str "http://g\246\246gle.com" ] - ( "http://g\246\246gle.com", "" ) - ] - , Para - [ Link - ( "", [ "email" ], [] ) - [ Str "me@ex\228mple.com" ] - ( "mailto:me@ex\228mple.com", "" ) - ] , Para - [ Link ( "", [], [] ) [ Str "foobar" ] ( "/\252rl", "\246\246!" ) ] - , Header 2 - ( "parentheses-in-urls", [], [] ) - [ Str "Parentheses", Space, Str "in", Space, Str "URLs" ] + [ Link + ( "" , [] , [] ) [ Str "link" ] ( "/\252rl" , "\246\246!" ) + ] , Para - [ Link ( "", [], [] ) [ Str "link" ] ( "/hi(there)", "" ) ] + [ Link + ( "" , [ "uri" ] , [] ) + [ Str "http://g\246\246gle.com" ] + ( "http://g\246\246gle.com" , "" ) + ] , Para - [ Link ( "", [], [] ) [ Str "link" ] ( "/hithere)", "" ) ] + [ Link + ( "" , [ "email" ] , [] ) + [ Str "me@ex\228mple.com" ] + ( "mailto:me@ex\228mple.com" , "" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "linky" ] - ( "hi_(there_(nested))", "" ) - ] - , Header 2 - ( "backslashes-in-link-references", [], [] ) - [ Str "Backslashes" - , Space - , Str "in" - , Space - , Str "link" - , Space - , Str "references" - ] + [ Link + ( "" , [] , [] ) + [ Str "foobar" ] + ( "/\252rl" , "\246\246!" ) + ] + , Header + 2 + ( "parentheses-in-urls" , [] , [] ) + [ Str "Parentheses" + , Space + , Str "in" + , Space + , Str "URLs" + ] , Para - [ Link - ( "", [], [] ) - [ Str "*", RawInline ( Format "tex" ) "\\a" ] - ( "b", "" ) - ] - , Header 2 - ( "reference-link-fallbacks", [], [] ) - [ Str "Reference", Space, Str "link", Space, Str "fallbacks" ] + [ Link ( "" , [] , [] ) [ Str "link" ] ( "/hi(there)" , "" ) + ] , Para - [ Str "[" - , Emph - [ Str "not", Space, Str "a", Space, Str "link" ] - , Str "]" - , Space - , Str "[" - , Emph - [ Str "nope" ] - , Str "]\8230" - ] - , Header 2 - ( "reference-link-followed-by-a-citation", [], [] ) - [ Str "Reference" - , Space - , Str "link" - , Space - , Str "followed" - , Space - , Str "by" - , Space - , Str "a" - , Space - , Str "citation" - ] + [ Link ( "" , [] , [] ) [ Str "link" ] ( "/hithere)" , "" ) + ] , Para - [ Str "MapReduce" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "paradigm" - , Space - , Str "popularized" - , Space - , Str "by" - , Space - , Link - ( "", [], [] ) - [ Str "Google" ] - ( "http://google.com", "" ) - , Space - , Cite - [ Citation - { citationId = "mapreduce" - , citationPrefix = [] - , citationSuffix = [] - , citationMode = NormalCitation - , citationNoteNum = 2 - , citationHash = 0 - } - ] - [ Str "[@mapreduce]" ] - , Space - , Str "as" - , Space - , Str "its" - , SoftBreak - , Str "most" - , Space - , Str "vocal" - , Space - , Str "proponent." - ] - , Header 2 - ( "empty-reference-links", [], [] ) - [ Str "Empty", Space, Str "reference", Space, Str "links" ] + [ Link + ( "" , [] , [] ) + [ Str "linky" ] + ( "hi_(there_(nested))" , "" ) + ] + , Header + 2 + ( "backslashes-in-link-references" , [] , [] ) + [ Str "Backslashes" + , Space + , Str "in" + , Space + , Str "link" + , Space + , Str "references" + ] , Para - [ Str "bar" ] + [ Link + ( "" , [] , [] ) + [ Str "*" , RawInline (Format "tex") "\\a" ] + ( "b" , "" ) + ] + , Header + 2 + ( "reference-link-fallbacks" , [] , [] ) + [ Str "Reference" + , Space + , Str "link" + , Space + , Str "fallbacks" + ] , Para - [ Link ( "", [], [] ) [ Str "foo2" ] ( "", "" ) ] - , Header 2 - ( "wrapping-shouldnt-introduce-new-list-items", [], [] ) - [ Str "Wrapping" - , Space - , Str "shouldn\8217t" - , Space - , Str "introduce" - , Space - , Str "new" - , Space - , Str "list" - , Space - , Str "items" - ] - , BulletList - [ - [ Plain - [ Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "blah" - , Space - , Str "2015." - ] + [ Str "[" + , Emph [ Str "not" , Space , Str "a" , Space , Str "link" ] + , Str "]" + , Space + , Str "[" + , Emph [ Str "nope" ] + , Str "]\8230" + ] + , Header + 2 + ( "reference-link-followed-by-a-citation" , [] , [] ) + [ Str "Reference" + , Space + , Str "link" + , Space + , Str "followed" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "citation" ] - ] - , Header 2 - ( "bracketed-spans", [], [] ) - [ Str "Bracketed", Space, Str "spans" ] , Para - [ Span - ( "id", [ "class" ], [ ( "key", "val" ) ] ) - [ Emph - [ Str "foo" ] + [ Str "MapReduce" , Space - , Str "bar" + , Str "is" , Space - , Str "baz" + , Str "a" + , Space + , Str "paradigm" + , Space + , Str "popularized" + , Space + , Str "by" , Space , Link - ( "", [], [] ) - [ Str "link" ] - ( "url", "" ) + ( "" , [] , [] ) + [ Str "Google" ] + ( "http://google.com" , "" ) + , Space + , Cite + [ Citation + { citationId = "mapreduce" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 2 + , citationHash = 0 + } + ] + [ Str "[@mapreduce]" ] + , Space + , Str "as" + , Space + , Str "its" + , SoftBreak + , Str "most" + , Space + , Str "vocal" + , Space + , Str "proponent." + ] + , Header + 2 + ( "empty-reference-links" , [] , [] ) + [ Str "Empty" + , Space + , Str "reference" + , Space + , Str "links" + ] + , Para [ Str "bar" ] + , Para [ Link ( "" , [] , [] ) [ Str "foo2" ] ( "" , "" ) ] + , Header + 2 + ( "wrapping-shouldnt-introduce-new-list-items" , [] , [] ) + [ Str "Wrapping" + , Space + , Str "shouldn\8217t" + , Space + , Str "introduce" + , Space + , Str "new" + , Space + , Str "list" + , Space + , Str "items" + ] + , BulletList + [ [ Plain + [ Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "blah" + , Space + , Str "2015." + ] + ] + ] + , Header + 2 + ( "bracketed-spans" , [] , [] ) + [ Str "Bracketed" , Space , Str "spans" ] + , Para + [ Span + ( "id" , [ "class" ] , [ ( "key" , "val" ) ] ) + [ Emph [ Str "foo" ] + , Space + , Str "bar" + , Space + , Str "baz" + , Space + , Link ( "" , [] , [] ) [ Str "link" ] ( "url" , "" ) + ] ] - ] ] diff --git a/test/mediawiki-reader.native b/test/mediawiki-reader.native index 0a1e1c29d..184809ea6 100644 --- a/test/mediawiki-reader.native +++ b/test/mediawiki-reader.native @@ -1,1444 +1,1431 @@ Pandoc - ( Meta { unMeta = fromList [] } ) - [ Header 1 - ( "header", [], [] ) - [ Str "header" ] - , Header 2 - ( "header_level_two", [], [] ) - [ Str "header", Space, Str "level", Space, Str "two" ] - , Header 3 - ( "header_level_3", [], [] ) - [ Str "header", Space, Str "level", Space, Str "3" ] - , Header 4 - ( "header_level_four", [], [] ) - [ Str "header", Space, Emph [ Str "level" ], Space, Str "four" ] - , Header 5 - ( "header_level_5", [], [] ) - [ Str "header", Space, Str "level", Space, Str "5" ] - , Header 6 - ( "header_level_6", [], [] ) - [ Str "header", Space, Str "level", Space, Str "6" ] - , Para - [ Str "=======" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header" - , Space - , Str "========" - ] - , Para - [ Code ( "", [], [] ) "==\160not\160a\160header\160==" ] - , Header 2 - ( "emph_and_strong", [], [] ) - [ Str "emph", Space, Str "and", Space, Str "strong" ] + Meta { unMeta = fromList [] } + [ Header 1 ( "header" , [] , [] ) [ Str "header" ] + , Header + 2 + ( "header_level_two" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "two" ] + , Header + 3 + ( "header_level_3" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "3" ] + , Header + 4 + ( "header_level_four" , [] , [] ) + [ Str "header" + , Space + , Emph [ Str "level" ] + , Space + , Str "four" + ] + , Header + 5 + ( "header_level_5" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "5" ] + , Header + 6 + ( "header_level_6" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "6" ] + , Para + [ Str "=======" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + , Space + , Str "========" + ] , Para - [ Emph [ Str "emph" ], Space, Strong [ Str "strong" ] ] + [ Code ( "" , [] , [] ) "==\160not\160a\160header\160==" ] + , Header + 2 + ( "emph_and_strong" , [] , [] ) + [ Str "emph" , Space , Str "and" , Space , Str "strong" ] , Para - [ Strong - [ Emph [ Str "strong", Space, Str "and", Space, Str "emph" ] ] - ] + [ Emph [ Str "emph" ] , Space , Strong [ Str "strong" ] ] , Para - [ Strong - [ Emph [ Str "emph", Space, Str "inside" ], Space, Str "strong" ] - ] + [ Strong + [ Emph + [ Str "strong" , Space , Str "and" , Space , Str "emph" ] + ] + ] , Para - [ Strong - [ Str "strong", Space, Str "with", Space, Emph [ Str "emph" ] ] - ] + [ Strong + [ Emph [ Str "emph" , Space , Str "inside" ] + , Space + , Str "strong" + ] + ] , Para - [ Emph [ Strong - [ Str "strong", Space, Str "inside" ] - , Space - , Str "emph" + [ Str "strong" + , Space + , Str "with" + , Space + , Emph [ Str "emph" ] + ] ] - ] - , Header 2 - ( "horizontal_rule", [], [] ) - [ Str "horizontal", Space, Str "rule" ] , Para - [ Str "top" ] + [ Emph + [ Strong [ Str "strong" , Space , Str "inside" ] + , Space + , Str "emph" + ] + ] + , Header + 2 + ( "horizontal_rule" , [] , [] ) + [ Str "horizontal" , Space , Str "rule" ] + , Para [ Str "top" ] , HorizontalRule - , Para - [ Str "bottom" ] + , Para [ Str "bottom" ] , HorizontalRule - , Header 2 - ( "nowiki", [], [] ) - [ Str "nowiki" ] + , Header 2 ( "nowiki" , [] , [] ) [ Str "nowiki" ] + , Para [ Str "''not" , Space , Str "emph''" ] + , Header 2 ( "strikeout" , [] , [] ) [ Str "strikeout" ] + , Para + [ Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "struck" , Space , Str "out" ] + ] + ] + , Header 2 ( "entities" , [] , [] ) [ Str "entities" ] + , Para [ Str "hi" , Space , Str "&" , Space , Str "low" ] + , Para [ Str "hi" , Space , Str "&" , Space , Str "low" ] + , Para [ Str "G\246del" ] + , Para [ Str "\777\2730" ] + , Header 2 ( "comments" , [] , [] ) [ Str "comments" ] + , Para [ Str "inline" , Space , Str "comment" ] + , Para [ Str "between" , Space , Str "blocks" ] + , Header 2 ( "linebreaks" , [] , [] ) [ Str "linebreaks" ] + , Para [ Str "hi" , LineBreak , Str "there" ] + , Para [ Str "hi" , LineBreak , Str "there" ] + , Header + 2 + ( "indents" , [] , [] ) + [ Str ":" , Space , Str "indents" ] + , Para [ Str "hi" ] + , DefinitionList [ ( [] , [ [ Plain [ Str "there" ] ] ] ) ] + , Para [ Str "bud" ] + , Para [ Str "hi" ] + , DefinitionList + [ ( [] + , [ [ DefinitionList + [ ( [] , [ [ Plain [ Str "there" ] ] ] ) ] + ] + ] + ) + ] + , Para [ Str "bud" ] + , Header + 2 ( "p_tags" , [] , [] ) [ Str "p" , Space , Str "tags" ] + , Para [ Str "hi" , Space , Str "there" ] + , Para [ Str "bud" ] + , Para [ Str "another" ] + , Header + 2 + ( "raw_html" , [] , [] ) + [ Str "raw" , Space , Str "html" ] + , Para + [ Str "hi" + , Space + , RawInline (Format "html") "" + , Emph [ Str "there" ] + , RawInline (Format "html") "" + , Str "." + ] , Para - [ Str "''not", Space, Str "emph''" ] - , Header 2 - ( "strikeout", [], [] ) - [ Str "strikeout" ] + [ RawInline (Format "html") "" + , Str "inserted" + , RawInline (Format "html") "" + ] + , RawBlock (Format "html") "
" + , Para [ Str "hi" , Space , Emph [ Str "there" ] ] + , RawBlock (Format "html") "
" + , Header + 2 + ( "sup_sub_del" , [] , [] ) + [ Str "sup," , Space , Str "sub," , Space , Str "del" ] + , Para + [ Str "H" + , Subscript [ Str "2" ] + , Str "O" + , Space + , Str "base" + , Superscript [ Emph [ Str "exponent" ] ] + , SoftBreak + , Strikeout [ Str "hello" ] + ] + , Header + 2 + ( "inline_code" , [] , [] ) + [ Str "inline" , Space , Str "code" ] , Para - [ Strikeout - [ Str "This" + [ Code ( "" , [] , [] ) "*\8594*" , Space - , Str "is" + , Code ( "" , [] , [] ) "typed" , Space - , Emph - [ Str "struck", Space, Str "out" ] + , Code ( "" , [ "haskell" ] , [] ) ">>=" ] - ] - , Header 2 - ( "entities", [], [] ) - [ Str "entities" ] - , Para - [ Str "hi", Space, Str "&", Space, Str "low" ] - , Para - [ Str "hi", Space, Str "&", Space, Str "low" ] - , Para - [ Str "G\246del" ] - , Para - [ Str "\777\2730" ] - , Header 2 - ( "comments", [], [] ) - [ Str "comments" ] - , Para - [ Str "inline", Space, Str "comment" ] - , Para - [ Str "between", Space, Str "blocks" ] - , Header 2 - ( "linebreaks", [], [] ) - [ Str "linebreaks" ] - , Para - [ Str "hi", LineBreak, Str "there" ] - , Para - [ Str "hi", LineBreak, Str "there" ] - , Header 2 - ( "indents", [], [] ) - [ Str ":", Space, Str "indents" ] - , Para - [ Str "hi" ] - , DefinitionList - [ ( [], [ [ Plain [ Str "there" ] ] ] ) ] - , Para - [ Str "bud" ] - , Para - [ Str "hi" ] - , DefinitionList - [ - ( [] - , - [ [ DefinitionList [ ( [], [ [ Plain [ Str "there" ] ] ] ) ] ] ] - ) - ] - , Para - [ Str "bud" ] - , Header 2 - ( "p_tags", [], [] ) - [ Str "p", Space, Str "tags" ] - , Para - [ Str "hi", Space, Str "there" ] - , Para - [ Str "bud" ] - , Para - [ Str "another" ] - , Header 2 - ( "raw_html", [], [] ) - [ Str "raw", Space, Str "html" ] - , Para - [ Str "hi" - , Space - , RawInline - ( Format "html" ) "" - , Emph - [ Str "there" ] - , RawInline - ( Format "html" ) "" - , Str "." - ] - , Para - [ RawInline - ( Format "html" ) "" - , Str "inserted" - , RawInline - ( Format "html" ) "" - ] - , RawBlock - ( Format "html" ) "
" - , Para - [ Str "hi", Space, Emph [ Str "there" ] ] - , RawBlock - ( Format "html" ) "
" - , Header 2 - ( "sup_sub_del", [], [] ) - [ Str "sup,", Space, Str "sub,", Space, Str "del" ] - , Para - [ Str "H" - , Subscript - [ Str "2" ] - , Str "O" - , Space - , Str "base" - , Superscript - [ Emph [ Str "exponent" ] ] - , SoftBreak - , Strikeout - [ Str "hello" ] - ] - , Header 2 - ( "inline_code", [], [] ) - [ Str "inline", Space, Str "code" ] - , Para - [ Code - ( "", [], [] ) "*\8594*" - , Space - , Code - ( "", [], [] ) "typed" - , Space - , Code - ( "", [ "haskell" ], [] ) ">>=" - ] - , Header 2 - ( "code_blocks", [], [] ) - [ Str "code", Space, Str "blocks" ] + , Header + 2 + ( "code_blocks" , [] , [] ) + [ Str "code" , Space , Str "blocks" ] , CodeBlock - ( "" - , [] - , [] - ) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" + ( "" , [] , [] ) + "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" , CodeBlock - ( "" - , [ "haskell" ] - , [] - ) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" + ( "" , [ "haskell" ] , [] ) + "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" , CodeBlock - ( "" - , - [ "ruby", "numberLines" ] - , - [ ( "startFrom", "100" ) ] - ) "widgets.each do |w|\n print w.price\nend" - , Header 2 - ( "block_quotes", [], [] ) - [ Str "block", Space, Str "quotes" ] - , Para - [ Str "Regular", Space, Str "paragraph" ] + ( "" + , [ "ruby" , "numberLines" ] + , [ ( "startFrom" , "100" ) ] + ) + "widgets.each do |w|\n print w.price\nend" + , Header + 2 + ( "block_quotes" , [] , [] ) + [ Str "block" , Space , Str "quotes" ] + , Para [ Str "Regular" , Space , Str "paragraph" ] , BlockQuote - [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "block" - , Space - , Str "quote." + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + ] + , Para + [ Str "With" + , Space + , Str "two" + , Space + , Str "paragraphs." + ] + ] + , Para [ Str "Nother" , Space , Str "paragraph." ] + , Header + 2 + ( "external_links" , [] , [] ) + [ Str "external" , Space , Str "links" ] + , Para + [ Link + ( "" , [] , [] ) + [ Emph [ Str "Google" ] + , Space + , Str "search" + , Space + , Str "engine" + ] + ( "http://google.com" , "" ) ] - , Para - [ Str "With", Space, Str "two", Space, Str "paragraphs." ] - ] , Para - [ Str "Nother", Space, Str "paragraph." ] - , Header 2 - ( "external_links", [], [] ) - [ Str "external", Space, Str "links" ] + [ Link + ( "" , [] , [] ) + [ Str "http://pandoc.org" ] + ( "http://pandoc.org" , "" ) + ] , Para - [ Link - ( "", [], [] ) - [ Emph - [ Str "Google" ] - , Space - , Str "search" + [ Link + ( "" , [] , [] ) [ Str "1" ] ( "http://google.com" , "" ) , Space - , Str "engine" + , Link + ( "" , [] , [] ) [ Str "2" ] ( "http://yahoo.com" , "" ) ] - ( "http://google.com", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "http://pandoc.org" ] - ( "http://pandoc.org", "" ) - ] , Para - [ Link - ( "", [], [] ) - [ Str "1" ] - ( "http://google.com", "" ) - , Space - , Link - ( "", [], [] ) - [ Str "2" ] - ( "http://yahoo.com", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "email", Space, Str "me" ] - ( "mailto:info@example.org", "" ) - ] - , Header 2 - ( "internal_links", [], [] ) - [ Str "internal", Space, Str "links" ] + [ Link + ( "" , [] , [] ) + [ Str "email" , Space , Str "me" ] + ( "mailto:info@example.org" , "" ) + ] + , Header + 2 + ( "internal_links" , [] , [] ) + [ Str "internal" , Space , Str "links" ] , Para - [ Link ( "", [], [] ) [ Str "Help" ] ( "Help", "wikilink" ) ] + [ Link + ( "" , [] , [] ) [ Str "Help" ] ( "Help" , "wikilink" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "the", Space, Str "help", Space, Str "page" ] - ( "Help", "wikilink" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "the" , Space , Str "help" , Space , Str "page" ] + ( "Help" , "wikilink" ) + ] , Para - [ Link ( "", [], [] ) [ Str "Helpers" ] ( "Help", "wikilink" ) ] + [ Link + ( "" , [] , [] ) [ Str "Helpers" ] ( "Help" , "wikilink" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "Help" ] - ( "Help", "wikilink" ) - , Str "ers" - ] + [ Link + ( "" , [] , [] ) [ Str "Help" ] ( "Help" , "wikilink" ) + , Str "ers" + ] , Para - [ Link - ( "", [], [] ) - [ Str "Contents" ] - ( "Help:Contents", "wikilink" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "Contents" ] + ( "Help:Contents" , "wikilink" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "#My", Space, Str "anchor" ] - ( "#My_anchor", "wikilink" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "#My" , Space , Str "anchor" ] + ( "#My_anchor" , "wikilink" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "and", Space, Str "text" ] - ( "Page#with_anchor", "wikilink" ) - ] - , Header 2 - ( "images", [], [] ) - [ Str "images" ] + [ Link + ( "" , [] , [] ) + [ Str "and" , Space , Str "text" ] + ( "Page#with_anchor" , "wikilink" ) + ] + , Header 2 ( "images" , [] , [] ) [ Str "images" ] , Para - [ Image - ( "", [], [] ) - [ Str "caption" ] - ( "example.jpg", "fig:caption" ) - ] + [ Image + ( "" , [] , [] ) + [ Str "caption" ] + ( "example.jpg" , "fig:caption" ) + ] , Para - [ Image - ( "", [], [] ) - [ Str "the" - , Space - , Emph - [ Str "caption" ] - , Space - , Str "with" - , Space - , Link - ( "", [], [] ) - [ Str "external", Space, Str "link" ] - ( "http://google.com", "" ) + [ Image + ( "" , [] , [] ) + [ Str "the" + , Space + , Emph [ Str "caption" ] + , Space + , Str "with" + , Space + , Link + ( "" , [] , [] ) + [ Str "external" , Space , Str "link" ] + ( "http://google.com" , "" ) + ] + ( "example.jpg" , "fig:the caption with external link" ) ] - ( "example.jpg", "fig:the caption with external link" ) - ] , Para - [ Image - ( "", [], [ ( "width", "30" ), ( "height", "40" ) ] ) - [ Str "caption" ] - ( "example.jpg", "fig:caption" ) - ] + [ Image + ( "" , [] , [ ( "width" , "30" ) , ( "height" , "40" ) ] ) + [ Str "caption" ] + ( "example.jpg" , "fig:caption" ) + ] , Para - [ Image - ( "", [], [ ( "width", "30" ) ] ) - [ Str "caption" ] - ( "example.jpg", "fig:caption" ) - ] + [ Image + ( "" , [] , [ ( "width" , "30" ) ] ) + [ Str "caption" ] + ( "example.jpg" , "fig:caption" ) + ] , Para - [ Image - ( "", [], [ ( "width", "30" ) ] ) - [ Str "caption" ] - ( "example.jpg", "fig:caption" ) - ] + [ Image + ( "" , [] , [ ( "width" , "30" ) ] ) + [ Str "caption" ] + ( "example.jpg" , "fig:caption" ) + ] , Para - [ Image - ( "", [], [] ) - [ Str "example.jpg" ] - ( "example.jpg", "fig:example.jpg" ) - ] + [ Image + ( "" , [] , [] ) + [ Str "example.jpg" ] + ( "example.jpg" , "fig:example.jpg" ) + ] , Para - [ Image - ( "", [], [] ) - [ Str "example_es.jpg" ] - ( "example_es.jpg", "fig:example_es.jpg" ) - ] - , Header 2 - ( "lists", [], [] ) - [ Str "lists" ] + [ Image + ( "" , [] , [] ) + [ Str "example_es.jpg" ] + ( "example_es.jpg" , "fig:example_es.jpg" ) + ] + , Header 2 ( "lists" , [] , [] ) [ Str "lists" ] , BulletList - [ - [ Plain [ Str "Start", Space, Str "each", Space, Str "line" ] ] - , - [ Plain - [ Str "with" - , Space - , Str "an" - , Space - , Str "asterisk" - , Space - , Str "(*)." + [ [ Plain + [ Str "Start" , Space , Str "each" , Space , Str "line" ] ] - , BulletList - [ - [ Plain - [ Str "More" + , [ Plain + [ Str "with" , Space - , Str "asterisks" + , Str "an" , Space - , Str "gives" + , Str "asterisk" , Space - , Str "deeper" + , Str "(*)." ] - , BulletList - [ - [ Plain - [ Str "and", Space, Str "deeper", Space, Str "levels." ] + , BulletList + [ [ Plain + [ Str "More" + , Space + , Str "asterisks" + , Space + , Str "gives" + , Space + , Str "deeper" + ] + , BulletList + [ [ 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." ] - , BulletList - [ - [ BulletList - [ - [ Plain - [ Str "But" - , Space - , Str "jumping" - , Space - , Str "levels" - , Space - , Str "creates" - , Space - , Str "empty" - , Space - , Str "space." - ] + , [ Plain + [ Str "Line" + , Space + , Str "breaks" + , LineBreak + , Str "don't" + , Space + , Str "break" + , Space + , Str "levels." + ] + , BulletList + [ [ BulletList + [ [ Plain + [ Str "But" + , Space + , Str "jumping" + , Space + , Str "levels" + , Space + , Str "creates" + , Space + , Str "empty" + , Space + , Str "space." + ] + ] + ] ] ] - ] ] ] - ] , Para - [ Str "Any" - , Space - , Str "other" - , Space - , Str "start" - , Space - , Str "ends" - , Space - , Str "the" - , Space - , Str "list." - ] + [ Str "Any" + , Space + , Str "other" + , Space + , Str "start" + , Space + , Str "ends" + , Space + , Str "the" + , Space + , Str "list." + ] , BulletList - [ - [ BulletList [ [ Plain [ Str "two" ] ] ] ] - , - [ Plain [ Str "one" ] ] - ] + [ [ BulletList [ [ Plain [ Str "two" ] ] ] ] + , [ Plain [ Str "one" ] ] + ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Start", Space, Str "each", Space, Str "line" ] ] - , - [ Plain - [ Str "with" - , Space - , Str "a" - , Space - , Str "number" - , Space - , Str "sign" - , Space - , Str "(#)." + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Start" , Space , Str "each" , Space , Str "line" ] ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "More" + , [ Plain + [ Str "with" , Space - , Str "number" + , Str "a" , Space - , Str "signs" + , Str "number" , Space - , Str "gives" + , Str "sign" , Space - , Str "deeper" + , Str "(#)." ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "and", Space, Str "deeper" ] ] - , - [ Plain [ Str "levels." ] ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ 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" ] ] + , [ Plain [ Str "levels." ] ] + ] + ] ] - ] ] - ] - , - [ Plain - [ Str "Line" - , Space - , Str "breaks" - , LineBreak - , Str "don't" - , Space - , Str "break" - , Space - , Str "levels." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "But" - , Space - , Str "jumping" - , Space - , Str "levels" - , Space - , Str "creates" - , Space - , Str "empty" - , Space - , Str "space." - ] + , [ Plain + [ Str "Line" + , Space + , Str "breaks" + , LineBreak + , Str "don't" + , Space + , Str "break" + , Space + , Str "levels." + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "But" + , Space + , Str "jumping" + , Space + , Str "levels" + , Space + , Str "creates" + , Space + , Str "empty" + , Space + , Str "space." + ] + ] + ] ] ] - ] ] + , [ Plain [ Str "Blank" , Space , Str "lines" ] ] ] - , - [ 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." + ( 1 , DefaultStyle , DefaultDelim ) + [ [ 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" - , SoftBreak - , Str "ends" - , Space - , Str "the" - , Space - , Str "list." - ] + [ Str "Any" + , Space + , Str "other" + , Space + , Str "start" + , Space + , Str "also" + , SoftBreak + , Str "ends" + , Space + , Str "the" + , Space + , Str "list." + ] , DefinitionList - [ - ( - [ Str "item", Space, Str "1" ] - , - [ [ Plain [ Str "definition", Space, Str "1" ] ] ] - ) - , - ( - [ Str "item", Space, Str "2" ] - , - [ - [ Plain [ Str "definition", Space, Str "2-1" ] ] - , - [ Plain [ Str "definition", Space, Str "2-2" ] ] - ] - ) - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "one" ] ] - , - [ Plain - [ Str "two" ] - , BulletList - [ - [ Plain [ Str "two", Space, Str "point", Space, Str "one" ] ] - , - [ Plain [ Str "two", Space, Str "point", Space, Str "two" ] ] - ] + [ ( [ Str "item" , Space , Str "1" ] + , [ [ Plain [ Str "definition" , Space , Str "1" ] ] ] + ) + , ( [ Str "item" , Space , Str "2" ] + , [ [ Plain [ Str "definition" , Space , Str "2-1" ] ] + , [ Plain [ Str "definition" , Space , Str "2-2" ] ] + ] + ) ] - , - [ Plain - [ Str "three" ] - , DefinitionList - [ - ( - [ Str "three", Space, Str "item", Space, Str "one" ] - , - [ - [ Plain - [ Str "three", Space, Str "def", Space, Str "one" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "one" ] ] + , [ Plain [ Str "two" ] + , BulletList + [ [ Plain + [ Str "two" + , Space + , Str "point" + , Space + , Str "one" + ] + ] + , [ Plain + [ Str "two" + , Space + , Str "point" + , Space + , Str "two" + ] ] ] - ) ] - ] - , - [ Plain - [ Str "four" ] - , DefinitionList - [ - ( [] - , - [ - [ Plain - [ Str "four", Space, Str "def", Space, Str "one" ] - ] - , - [ Plain - [ Str "this" - , Space - , Str "looks" - , Space - , Str "like" - , Space - , Str "a" - , Space - , Str "continuation" - ] - ] - , - [ Plain - [ Str "and" - , Space - , Str "is" - , Space - , Str "often" - , Space - , Str "used" + , [ Plain [ Str "three" ] + , DefinitionList + [ ( [ Str "three" , Space , Str "item" , Space , Str "one" ] + , [ [ Plain + [ Str "three" + , Space + , Str "def" + , Space + , Str "one" + ] + ] ] - ] - , - [ Plain - [ Str "instead" - , LineBreak - , Str "of" - , Space - , Str "
" - ] - ] + ) ] - ) - ] - ] - , - [ Plain - [ RawInline - ( Format "mediawiki" ) "{{{template\n|author=John\n|title=My Book\n}}}" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ 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" + , [ Plain [ Str "four" ] + , DefinitionList + [ ( [] + , [ [ Plain + [ Str "four" + , Space + , Str "def" + , Space + , Str "one" + ] + ] + , [ Plain + [ Str "this" + , Space + , Str "looks" + , Space + , Str "like" + , Space + , Str "a" + , Space + , Str "continuation" + ] + ] + , [ Plain + [ Str "and" + , Space + , Str "is" + , Space + , Str "often" + , Space + , Str "used" + ] + ] + , [ Plain + [ Str "instead" + , LineBreak + , Str "of" + , Space + , Str "
" + ] + ] ] + ) + ] + ] + , [ Plain + [ RawInline + (Format "mediawiki") + "{{{template\n|author=John\n|title=My Book\n}}}" + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ 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" + ] + ] + ] + ] + , [ Plain + [ Str "five" , Space , Str "sub" , Space , Str "2" ] ] ] - ] - , - [ Plain [ Str "five", Space, Str "sub", Space, Str "2" ] ] ] ] - ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "list", Space, Str "item", Space, Emph [ Str "emph" ] ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "list", Space, Str "item", Space, Str "B1" ] ] - , - [ Plain [ Str "list", Space, Str "item", Space, Str "B2" ] ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "list" + , Space + , Str "item" + , Space + , Emph [ Str "emph" ] + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "list" , Space , Str "item" , Space , Str "B1" ] + ] + , [ Plain + [ Str "list" , Space , Str "item" , Space , Str "B2" ] + ] + ] + , Para + [ Str "continuing" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "A1" + ] ] - , Para - [ Str "continuing" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "A1" + , [ Plain + [ Str "list" , Space , Str "item" , Space , Str "A2" ] ] ] - , - [ Plain [ Str "list", Space, Str "item", Space, Str "A2" ] ] - ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "abc" ] ] - , - [ Plain [ Str "def" ] ] - , - [ Plain [ Str "ghi" ] ] - ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "abc" ] ] + , [ Plain [ Str "def" ] ] + , [ Plain [ Str "ghi" ] ] + ] , OrderedList - ( 9, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Amsterdam" ] ] - , - [ Plain [ Str "Rotterdam" ] ] - , - [ Plain [ Str "The", Space, Str "Hague" ] ] - ] - , Header 2 - ( "math", [], [] ) - [ Str "math" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Math InlineMath "x=\\frac{y^\\pi}{z}" - , Str "." - ] - , Para - [ Str "With" - , Space - , Str "spaces:" - , Space - , Math InlineMath "x=\\frac{y^\\pi}{z}" - , Str "." - ] - , Header 2 - ( "preformatted_blocks", [], [] ) - [ Str "preformatted", Space, Str "blocks" ] - , Para - [ Code - ( "", [], [] ) "Start\160each\160line\160with\160a\160space." - , LineBreak - , Code - ( "", [], [] ) "Text\160is\160" - , Strong - [ Code ( "", [], [] ) "preformatted" ] - , Code - ( "", [], [] ) "\160and" - , LineBreak - , Emph - [ Code ( "", [], [] ) "markups" ] - , Code - ( "", [], [] ) "\160" - , Strong - [ Emph [ Code ( "", [], [] ) "can" ] ] - , Code - ( "", [], [] ) "\160be\160done." - ] - , Para - [ Code ( "", [], [] ) "\160hell\160\160\160\160\160\160yeah" ] - , Para - [ Code - ( "" - , [] - , [] - ) "Start\160with\160a\160space\160in\160the\160first\160column," - , LineBreak - , Code - ( "", [], [] ) "(before\160the\160)." - , LineBreak - , Code - ( "", [], [] ) "" - , LineBreak - , Code - ( "", [], [] ) "Then\160your\160block\160format\160will\160be" - , LineBreak - , Code - ( "", [], [] ) "\160\160\160\160maintained." - , LineBreak - , Code - ( "", [], [] ) "" - , LineBreak - , Code - ( "" - , [] - , [] - ) "This\160is\160good\160for\160copying\160in\160code\160blocks:" - , LineBreak - , Code - ( "", [], [] ) "" - , LineBreak - , Code - ( "", [], [] ) "def\160function():" - , LineBreak - , Code - ( "" - , [] - , [] - ) "\160\160\160\160\"\"\"documentation\160string\"\"\"" - , LineBreak - , Code - ( "", [], [] ) "" - , LineBreak - , Code - ( "", [], [] ) "\160\160\160\160if\160True:" - , LineBreak - , Code - ( "", [], [] ) "\160\160\160\160\160\160\160\160print\160True" - , LineBreak - , Code - ( "", [], [] ) "\160\160\160\160else:" - , LineBreak - , Code - ( "", [], [] ) "\160\160\160\160\160\160\160\160print\160False" - ] + ( 9 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Amsterdam" ] ] + , [ Plain [ Str "Rotterdam" ] ] + , [ Plain [ Str "The" , Space , Str "Hague" ] ] + ] + , Header 2 ( "math" , [] , [] ) [ Str "math" ] , Para - [ Str "Not" ] - , RawBlock - ( Format "html" ) "
" + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Math InlineMath "x=\\frac{y^\\pi}{z}" + , Str "." + ] , Para - [ Str "preformatted" ] + [ Str "With" + , Space + , Str "spaces:" + , Space + , Math InlineMath "x=\\frac{y^\\pi}{z}" + , Str "." + ] + , Header + 2 + ( "preformatted_blocks" , [] , [] ) + [ Str "preformatted" , Space , Str "blocks" ] + , Para + [ Code + ( "" , [] , [] ) + "Start\160each\160line\160with\160a\160space." + , LineBreak + , Code ( "" , [] , [] ) "Text\160is\160" + , Strong [ Code ( "" , [] , [] ) "preformatted" ] + , Code ( "" , [] , [] ) "\160and" + , LineBreak + , Emph [ Code ( "" , [] , [] ) "markups" ] + , Code ( "" , [] , [] ) "\160" + , Strong [ Emph [ Code ( "" , [] , [] ) "can" ] ] + , Code ( "" , [] , [] ) "\160be\160done." + ] , Para - [ Str "Don't", Space, Str "need" ] + [ Code + ( "" , [] , [] ) "\160hell\160\160\160\160\160\160yeah" + ] , Para - [ Code ( "", [], [] ) "a\160blank\160line" ] + [ Code + ( "" , [] , [] ) + "Start\160with\160a\160space\160in\160the\160first\160column," + , LineBreak + , Code ( "" , [] , [] ) "(before\160the\160)." + , LineBreak + , Code ( "" , [] , [] ) "" + , LineBreak + , Code + ( "" , [] , [] ) + "Then\160your\160block\160format\160will\160be" + , LineBreak + , Code ( "" , [] , [] ) "\160\160\160\160maintained." + , LineBreak + , Code ( "" , [] , [] ) "" + , LineBreak + , Code + ( "" , [] , [] ) + "This\160is\160good\160for\160copying\160in\160code\160blocks:" + , LineBreak + , Code ( "" , [] , [] ) "" + , LineBreak + , Code ( "" , [] , [] ) "def\160function():" + , LineBreak + , Code + ( "" , [] , [] ) + "\160\160\160\160\"\"\"documentation\160string\"\"\"" + , LineBreak + , Code ( "" , [] , [] ) "" + , LineBreak + , Code ( "" , [] , [] ) "\160\160\160\160if\160True:" + , LineBreak + , Code + ( "" , [] , [] ) + "\160\160\160\160\160\160\160\160print\160True" + , LineBreak + , Code ( "" , [] , [] ) "\160\160\160\160else:" + , LineBreak + , Code + ( "" , [] , [] ) + "\160\160\160\160\160\160\160\160print\160False" + ] + , Para [ Str "Not" ] + , RawBlock (Format "html") "
" + , Para [ Str "preformatted" ] + , Para [ Str "Don't" , Space , Str "need" ] + , Para [ Code ( "" , [] , [] ) "a\160blank\160line" ] , Para - [ Str "around" - , Space - , Str "a" - , Space - , Str "preformatted" - , Space - , Str "block." - ] - , Header 2 - ( "templates", [], [] ) - [ Str "templates" ] - , RawBlock - ( Format "mediawiki" ) "{{Welcome}}" - , RawBlock - ( Format "mediawiki" ) "{{Foo:Bar}}" + [ Str "around" + , Space + , Str "a" + , Space + , Str "preformatted" + , Space + , Str "block." + ] + , Header 2 ( "templates" , [] , [] ) [ Str "templates" ] + , RawBlock (Format "mediawiki") "{{Welcome}}" + , RawBlock (Format "mediawiki") "{{Foo:Bar}}" , RawBlock - ( Format "mediawiki" ) "{{Thankyou|all your effort|Me}}" + (Format "mediawiki") "{{Thankyou|all your effort|Me}}" , Para - [ Str "Written" - , Space - , RawInline - ( Format "mediawiki" ) "{{{date}}}" - , Space - , Str "by" - , Space - , RawInline - ( Format "mediawiki" ) "{{{name}}}" - , Str "." - ] - , Header 2 - ( "tables", [], [] ) - [ Str "tables" ] + [ Str "Written" + , Space + , RawInline (Format "mediawiki") "{{{date}}}" + , Space + , Str "by" + , Space + , RawInline (Format "mediawiki") "{{{name}}}" + , Str "." + ] + , Header 2 ( "tables" , [] , [] ) [ Str "tables" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Apple" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Bread" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Pie" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Butter" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Ice", Space, Str "cream" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Apple" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Bread" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Pie" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Butter" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Ice" , Space , Str "cream" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing - [ Plain [ Str "Food", Space, Str "complements" ] ] - ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Apple" ] ] - ] + ( "" , [] , [] ) + (Caption + Nothing + [ Plain [ Str "Food" , Space , Str "complements" ] ]) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Bread" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Pie" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Butter" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Ice", Space, Str "cream" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Apple" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Bread" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Pie" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Butter" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Ice" , Space , Str "cream" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing - [ Plain [ Str "Food", Space, Str "complements" ] ] - ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Apple" ] ] - ] + ( "" , [] , [] ) + (Caption + Nothing + [ Plain [ Str "Food" , Space , Str "complements" ] ]) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para - [ Str "Bread" ] - , Para - [ Str "and", Space, Str "cheese" ] - ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para - [ Str "Pie" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Plain [ Str "apple" ] ], [ Plain [ Str "carrot" ] ] ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Apple" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Bread" ] + , Para [ Str "and" , Space , Str "cheese" ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Pie" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "apple" ] ] + , [ Plain [ Str "carrot" ] ] + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Apple" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "more" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Bread" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Pie" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "more" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Butter" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Ice", Space, Str "cream" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "and", Space, Str "more" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Apple" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "more" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Bread" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Pie" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "more" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Butter" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Ice" , Space , Str "cream" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "and" , Space , Str "more" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidth 0.25 ) - , - ( AlignRight, ColWidth 0.125 ) - , - ( AlignCenter, ColWidth 0.125 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Center" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidth 0.25 ) + , ( AlignRight , ColWidth 0.125 ) + , ( AlignCenter , ColWidth 0.125 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "15.00" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "centered" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "more" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "2.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "more" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Center" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "15.00" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "centered" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "more" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "2.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "more" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Apple" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Bread" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "fruit" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "topping" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Apple" ] ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "apple" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "ice", Space, Str "cream" ] ] - ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Bread" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "fruit" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "topping" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "apple" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para + [ Str "ice" + , Space + , Str "cream" + ] + ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Butter" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Ice" , Space , Str "cream" ] ] ] - ] - ( TableFoot ( "", [], [] ) [] ) ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Butter" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Ice", Space, Str "cream" ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignDefault, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Orange" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Orange" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Paragraph" - , Space - , Str "after" - , Space - , Str "the" - , Space - , Str "table." - ] + [ Str "Paragraph" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "table." + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "fruit" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "topping" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "apple" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "ice", Space, Str "cream" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "fruit" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "topping" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "apple" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "ice" , Space , Str "cream" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 2 - ( "notes", [], [] ) - [ Str "notes" ] + (TableFoot ( "" , [] , [] ) []) + , Header 2 ( "notes" , [] , [] ) [ Str "notes" ] , Para - [ Str "My", Space, Str "note!", Note [ Plain [ Str "This." ] ] ] + [ Str "My" + , Space + , Str "note!" + , Note [ Plain [ Str "This." ] ] + ] , Para - [ Str "URL" - , Space - , Str "note." - , Note - [ Plain - [ Link - ( "", [], [] ) - [ Str "http://docs.python.org/library/functions.html#range" ] - ( "http://docs.python.org/library/functions.html#range", "" ) - ] + [ Str "URL" + , Space + , Str "note." + , Note + [ Plain + [ Link + ( "" , [] , [] ) + [ Str + "http://docs.python.org/library/functions.html#range" + ] + ( "http://docs.python.org/library/functions.html#range" + , "" + ) + ] + ] ] - ] ] diff --git a/test/opml-reader.native b/test/opml-reader.native index bbb54e068..29623d1fc 100644 --- a/test/opml-reader.native +++ b/test/opml-reader.native @@ -1,232 +1,123 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "author" - , MetaList - [ MetaInlines [ Str "Dave", Space, Str "Winer" ] ] - ) - , - ( "date" - , MetaInlines - [ Str "Thu," - , Space - , Str "14" - , Space - , Str "Jul" - , Space - , Str "2005" - , Space - , Str "23:41:05" - , Space - , Str "GMT" + Meta + { unMeta = + fromList + [ ( "author" + , MetaList + [ MetaInlines [ Str "Dave" , Space , Str "Winer" ] ] + ) + , ( "date" + , MetaInlines + [ Str "Thu," + , Space + , Str "14" + , Space + , Str "Jul" + , Space + , Str "2005" + , Space + , Str "23:41:05" + , Space + , Str "GMT" + ] + ) + , ( "title" , MetaInlines [ Str "States" ] ) ] - ) - , - ( "title", MetaInlines [ Str "States" ] ) - ] } - ) - [ Header 1 - ( "", [], [] ) - [ Str "United", Space, Str "States" ] - , Header 2 - ( "", [], [] ) - [ Str "Far", Space, Str "West" ] - , Header 3 - ( "", [], [] ) - [ Str "Alaska" ] - , Header 3 - ( "", [], [] ) - [ Str "California" ] - , Header 3 - ( "", [], [] ) - [ Str "Hawaii" ] - , Header 3 - ( "", [], [] ) - [ Strong [ Str "Nevada" ] ] - , Para - [ Str "I" - , Space - , Str "lived" - , Space - , Str "here" - , Space - , Emph - [ Str "once" ] - , Str "." - ] + [ Header + 1 ( "" , [] , [] ) [ Str "United" , Space , Str "States" ] + , Header + 2 ( "" , [] , [] ) [ Str "Far" , Space , Str "West" ] + , Header 3 ( "" , [] , [] ) [ Str "Alaska" ] + , Header 3 ( "" , [] , [] ) [ Str "California" ] + , Header 3 ( "" , [] , [] ) [ Str "Hawaii" ] + , Header 3 ( "" , [] , [] ) [ Strong [ Str "Nevada" ] ] , Para - [ Str "Loved", Space, Str "it." ] - , Header 4 - ( "", [], [] ) - [ Link ( "", [], [] ) [ Str "Reno" ] ( "http://www.reno.gov", "" ) ] - , Header 4 - ( "", [], [] ) - [ Str "Las", Space, Str "Vegas" ] - , Header 4 - ( "", [], [] ) - [ Str "Ely" ] - , Header 4 - ( "", [], [] ) - [ Str "Gerlach" ] - , Header 3 - ( "", [], [] ) - [ Str "Oregon" ] - , Header 3 - ( "", [], [] ) - [ Str "Washington" ] - , Header 2 - ( "", [], [] ) - [ Str "Great", Space, Str "Plains" ] - , Header 3 - ( "", [], [] ) - [ Str "Kansas" ] - , Header 3 - ( "", [], [] ) - [ Str "Nebraska" ] - , Header 3 - ( "", [], [] ) - [ Str "North", Space, Str "Dakota" ] - , Header 3 - ( "", [], [] ) - [ Str "Oklahoma" ] - , Header 3 - ( "", [], [] ) - [ Str "South", Space, Str "Dakota" ] - , Header 2 - ( "", [], [] ) - [ Str "Mid-Atlantic" ] - , Header 3 - ( "", [], [] ) - [ Str "Delaware" ] - , Header 3 - ( "", [], [] ) - [ Str "Maryland" ] - , Header 3 - ( "", [], [] ) - [ Str "New", Space, Str "Jersey" ] - , Header 3 - ( "", [], [] ) - [ Str "New", Space, Str "York" ] - , Header 3 - ( "", [], [] ) - [ Str "Pennsylvania" ] - , Header 2 - ( "", [], [] ) - [ Str "Midwest" ] - , Header 3 - ( "", [], [] ) - [ Str "Illinois" ] - , Header 3 - ( "", [], [] ) - [ Str "Indiana" ] - , Header 3 - ( "", [], [] ) - [ Str "Iowa" ] - , Header 3 - ( "", [], [] ) - [ Str "Kentucky" ] - , Header 3 - ( "", [], [] ) - [ Str "Michigan" ] - , Header 3 - ( "", [], [] ) - [ Str "Minnesota" ] - , Header 3 - ( "", [], [] ) - [ Str "Missouri" ] - , Header 3 - ( "", [], [] ) - [ Str "Ohio" ] - , Header 3 - ( "", [], [] ) - [ Str "West", Space, Str "Virginia" ] - , Header 3 - ( "", [], [] ) - [ Str "Wisconsin" ] - , Header 2 - ( "", [], [] ) - [ Str "Mountains" ] - , Header 3 - ( "", [], [] ) - [ Str "Colorado" ] - , Header 3 - ( "", [], [] ) - [ Str "Idaho" ] - , Header 3 - ( "", [], [] ) - [ Str "Montana" ] - , Header 3 - ( "", [], [] ) - [ Str "Utah" ] - , Header 3 - ( "", [], [] ) - [ Str "Wyoming" ] - , Header 2 - ( "", [], [] ) - [ Str "New", Space, Str "England" ] - , Header 3 - ( "", [], [] ) - [ Str "Connecticut" ] - , Header 3 - ( "", [], [] ) - [ Str "Maine" ] - , Header 3 - ( "", [], [] ) - [ Str "Massachusetts" ] - , Header 3 - ( "", [], [] ) - [ Str "New", Space, Str "Hampshire" ] - , Header 3 - ( "", [], [] ) - [ Str "Rhode", Space, Str "Island" ] - , Header 3 - ( "", [], [] ) - [ Str "Vermont" ] - , Header 2 - ( "", [], [] ) - [ Str "South" ] - , Header 3 - ( "", [], [] ) - [ Str "Alabama" ] - , Header 3 - ( "", [], [] ) - [ Str "Arkansas" ] - , Header 3 - ( "", [], [] ) - [ Str "Florida" ] - , Header 3 - ( "", [], [] ) - [ Str "Georgia" ] - , Header 3 - ( "", [], [] ) - [ Str "Louisiana" ] - , Header 3 - ( "", [], [] ) - [ Str "Mississippi" ] - , Header 3 - ( "", [], [] ) - [ Str "North", Space, Str "Carolina" ] - , Header 3 - ( "", [], [] ) - [ Str "South", Space, Str "Carolina" ] - , Header 3 - ( "", [], [] ) - [ Str "Tennessee" ] - , Header 3 - ( "", [], [] ) - [ Str "Virginia" ] - , Header 2 - ( "", [], [] ) - [ Str "Southwest" ] - , Header 3 - ( "", [], [] ) - [ Str "Arizona" ] - , Header 3 - ( "", [], [] ) - [ Str "New", Space, Str "Mexico" ] - , Header 3 - ( "", [], [] ) - [ Str "Texas" ] + [ Str "I" + , Space + , Str "lived" + , Space + , Str "here" + , Space + , Emph [ Str "once" ] + , Str "." + ] + , Para [ Str "Loved" , Space , Str "it." ] + , Header + 4 + ( "" , [] , [] ) + [ Link + ( "" , [] , [] ) + [ Str "Reno" ] + ( "http://www.reno.gov" , "" ) + ] + , Header + 4 ( "" , [] , [] ) [ Str "Las" , Space , Str "Vegas" ] + , Header 4 ( "" , [] , [] ) [ Str "Ely" ] + , Header 4 ( "" , [] , [] ) [ Str "Gerlach" ] + , Header 3 ( "" , [] , [] ) [ Str "Oregon" ] + , Header 3 ( "" , [] , [] ) [ Str "Washington" ] + , Header + 2 ( "" , [] , [] ) [ Str "Great" , Space , Str "Plains" ] + , Header 3 ( "" , [] , [] ) [ Str "Kansas" ] + , Header 3 ( "" , [] , [] ) [ Str "Nebraska" ] + , Header + 3 ( "" , [] , [] ) [ Str "North" , Space , Str "Dakota" ] + , Header 3 ( "" , [] , [] ) [ Str "Oklahoma" ] + , Header + 3 ( "" , [] , [] ) [ Str "South" , Space , Str "Dakota" ] + , Header 2 ( "" , [] , [] ) [ Str "Mid-Atlantic" ] + , Header 3 ( "" , [] , [] ) [ Str "Delaware" ] + , Header 3 ( "" , [] , [] ) [ Str "Maryland" ] + , Header + 3 ( "" , [] , [] ) [ Str "New" , Space , Str "Jersey" ] + , Header + 3 ( "" , [] , [] ) [ Str "New" , Space , Str "York" ] + , Header 3 ( "" , [] , [] ) [ Str "Pennsylvania" ] + , Header 2 ( "" , [] , [] ) [ Str "Midwest" ] + , Header 3 ( "" , [] , [] ) [ Str "Illinois" ] + , Header 3 ( "" , [] , [] ) [ Str "Indiana" ] + , Header 3 ( "" , [] , [] ) [ Str "Iowa" ] + , Header 3 ( "" , [] , [] ) [ Str "Kentucky" ] + , Header 3 ( "" , [] , [] ) [ Str "Michigan" ] + , Header 3 ( "" , [] , [] ) [ Str "Minnesota" ] + , Header 3 ( "" , [] , [] ) [ Str "Missouri" ] + , Header 3 ( "" , [] , [] ) [ Str "Ohio" ] + , Header + 3 ( "" , [] , [] ) [ Str "West" , Space , Str "Virginia" ] + , Header 3 ( "" , [] , [] ) [ Str "Wisconsin" ] + , Header 2 ( "" , [] , [] ) [ Str "Mountains" ] + , Header 3 ( "" , [] , [] ) [ Str "Colorado" ] + , Header 3 ( "" , [] , [] ) [ Str "Idaho" ] + , Header 3 ( "" , [] , [] ) [ Str "Montana" ] + , Header 3 ( "" , [] , [] ) [ Str "Utah" ] + , Header 3 ( "" , [] , [] ) [ Str "Wyoming" ] + , Header + 2 ( "" , [] , [] ) [ Str "New" , Space , Str "England" ] + , Header 3 ( "" , [] , [] ) [ Str "Connecticut" ] + , Header 3 ( "" , [] , [] ) [ Str "Maine" ] + , Header 3 ( "" , [] , [] ) [ Str "Massachusetts" ] + , Header + 3 ( "" , [] , [] ) [ Str "New" , Space , Str "Hampshire" ] + , Header + 3 ( "" , [] , [] ) [ Str "Rhode" , Space , Str "Island" ] + , Header 3 ( "" , [] , [] ) [ Str "Vermont" ] + , Header 2 ( "" , [] , [] ) [ Str "South" ] + , Header 3 ( "" , [] , [] ) [ Str "Alabama" ] + , Header 3 ( "" , [] , [] ) [ Str "Arkansas" ] + , Header 3 ( "" , [] , [] ) [ Str "Florida" ] + , Header 3 ( "" , [] , [] ) [ Str "Georgia" ] + , Header 3 ( "" , [] , [] ) [ Str "Louisiana" ] + , Header 3 ( "" , [] , [] ) [ Str "Mississippi" ] + , Header + 3 ( "" , [] , [] ) [ Str "North" , Space , Str "Carolina" ] + , Header + 3 ( "" , [] , [] ) [ Str "South" , Space , Str "Carolina" ] + , Header 3 ( "" , [] , [] ) [ Str "Tennessee" ] + , Header 3 ( "" , [] , [] ) [ Str "Virginia" ] + , Header 2 ( "" , [] , [] ) [ Str "Southwest" ] + , Header 3 ( "" , [] , [] ) [ Str "Arizona" ] + , Header + 3 ( "" , [] , [] ) [ Str "New" , Space , Str "Mexico" ] + , Header 3 ( "" , [] , [] ) [ Str "Texas" ] ] diff --git a/test/org-select-tags.native b/test/org-select-tags.native index a94c70abe..9f2d84a9f 100644 --- a/test/org-select-tags.native +++ b/test/org-select-tags.native @@ -1,99 +1,103 @@ Pandoc - ( Meta { unMeta = fromList [] } ) - [ Header 1 - ( "will-appear-because-it-is-the-ancestor-of-something-tagged-yes" - , [] - , [] - ) - [ Str "Will" - , Space - , Str "appear" - , Space - , Str "because" - , Space - , Str "it" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "ancestor" - , Space - , Str "of" - , Space - , Str "something" - , Space - , Str "tagged" - , Space - , Str "\"yes\"" - ] - , Header 2 - ( "will-appear", [], [] ) - [ Str "Will" - , Space - , Str "appear" - , Space - , Span - ( "", [ "tag" ], [ ( "tag-name", "yes" ) ] ) - [ SmallCaps [ Str "yes" ] ] - ] - , Header 3 - ( "will-appear-since-the-entire-subtree-of-something-selected-will-appear" - , [] - , [] - ) - [ Str "Will" - , Space - , Str "appear" - , Space - , Str "since" - , Space - , Str "the" - , Space - , Str "entire" - , Space - , Str "subtree" - , Space - , Str "of" - , Space - , Str "something" - , Space - , Str "selected" - , Space - , Str "will" - , Space - , Str "appear" - ] + Meta { unMeta = fromList [] } + [ Header + 1 + ( "will-appear-because-it-is-the-ancestor-of-something-tagged-yes" + , [] + , [] + ) + [ Str "Will" + , Space + , Str "appear" + , Space + , Str "because" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "ancestor" + , Space + , Str "of" + , Space + , Str "something" + , Space + , Str "tagged" + , Space + , Str "\"yes\"" + ] + , Header + 2 + ( "will-appear" , [] , [] ) + [ Str "Will" + , Space + , Str "appear" + , Space + , Span + ( "" , [ "tag" ] , [ ( "tag-name" , "yes" ) ] ) + [ SmallCaps [ Str "yes" ] ] + ] + , Header + 3 + ( "will-appear-since-the-entire-subtree-of-something-selected-will-appear" + , [] + , [] + ) + [ Str "Will" + , Space + , Str "appear" + , Space + , Str "since" + , Space + , Str "the" + , Space + , Str "entire" + , Space + , Str "subtree" + , Space + , Str "of" + , Space + , Str "something" + , Space + , Str "selected" + , Space + , Str "will" + , Space + , Str "appear" + ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Para [ Str "Will", Space, Str "appear" ] ] ] - , Header 2 - ( "will-appear-because-it-is-the-ancestor-of-something-listed-in-select-tags" - , [] - , [] - ) - [ Str "Will" - , Space - , Str "appear" - , Space - , Str "because" - , Space - , Str "it" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "ancestor" - , Space - , Str "of" - , Space - , Str "something" - , Space - , Str "listed" - , Space - , Str "in" - , Space - , Str "SELECT-TAGS" - ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Para [ Str "Will" , Space , Str "appear" ] ] ] + , Header + 2 + ( "will-appear-because-it-is-the-ancestor-of-something-listed-in-select-tags" + , [] + , [] + ) + [ Str "Will" + , Space + , Str "appear" + , Space + , Str "because" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "ancestor" + , Space + , Str "of" + , Space + , Str "something" + , Space + , Str "listed" + , Space + , Str "in" + , Space + , Str "SELECT-TAGS" + ] ] diff --git a/test/pipe-tables.native b/test/pipe-tables.native index e678053d2..886a7e343 100644 --- a/test/pipe-tables.native +++ b/test/pipe-tables.native @@ -1,850 +1,927 @@ [ Para - [ Str "Simplest" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "caption:" - ] + [ Str "Simplest" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default3" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Simple", Space, Str "table", Space, Str "with", Space, Str "caption:" ] -, Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Demonstration" - , Space - , Str "of" - , Space - , Str "simple" - , Space - , Str "table" - , Space - , Str "syntax." - ] + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "caption:" ] - ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - ] +, Table + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ]) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Simple" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "caption:" - ] + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Headerless" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "caption:" - ] -, Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + [ Str "Headerless" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" ] - ] - ( TableFoot ( "", [], [] ) [] ) -, Para - [ Str "Table", Space, Str "without", Space, Str "sides:" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignDefault, ColWidthDefault ), ( AlignRight, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Fruit" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Quantity" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "apple" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "17" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "pear" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "302" ] ] - ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "One-column:" ] + [ Str "Table" , Space , Str "without" , Space , Str "sides:" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignDefault, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "hi" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "lo" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Fruit" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Quantity" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "apple" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "17" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "pear" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "302" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) -, Para - [ Str "Header-less", Space, Str "one-column:" ] + (TableFoot ( "" , [] , [] ) []) +, Para [ Str "One-column:" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignCenter, ColWidthDefault ) ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "hi" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "hi" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "lo" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) +, Para [ Str "Header-less" , Space , Str "one-column:" ] +, Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "hi" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Indented", Space, Str "left", Space, Str "column:" ] + [ Str "Indented" , Space , Str "left" , Space , Str "column:" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignRight, ColWidthDefault ), ( AlignLeft, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Number", Space, Str "of", Space, Str "siblings" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Salary" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "33" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "44" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Number" , Space , Str "of" , Space , Str "siblings" ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Salary" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "33" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "44" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Long" - , Space - , Str "pipe" - , Space - , Str "table" - , Space - , Str "with" - , Space - , Str "relative" - , Space - , Str "widths:" - ] + [ Str "Long" + , Space + , Str "pipe" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "relative" + , Space + , Str "widths:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.15517241379310345 ) - , - ( AlignDefault, ColWidth 0.1724137931034483 ) - , - ( AlignDefault, ColWidth 0.6724137931034483 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.15517241379310345 ) + , ( AlignDefault , ColWidth 0.1724137931034483 ) + , ( AlignDefault , ColWidth 0.6724137931034483 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "table" - , Space - , Str "cell" - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default3" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "table" + , Space + , Str "cell" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "and" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "really" + , Space + , Str "long" + , Space + , Str "table" + , Space + , Str "cell" + , Space + , Str "that" + , Space + , Str "will" + , Space + , Str "probably" + , Space + , Str "need" + , Space + , Str "wrapping" + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "and" - , Space - , Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "really" - , Space - , Str "long" - , Space - , Str "table" - , Space - , Str "cell" - , Space - , Str "that" - , Space - , Str "will" - , Space - , Str "probably" - , Space - , Str "need" - , Space - , Str "wrapping" - ] - ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Pipe" - , Space - , Str "table" - , Space - , Str "with" - , Space - , Str "no" - , Space - , Str "body:" - ] -, Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignDefault, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Header" ] ] - ] + [ Str "Pipe" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "no" + , Space + , Str "body:" ] - ) - [ TableBody ( "", [], [] ) ( RowHeadColumns 0 ) [] [] ] - ( TableFoot ( "", [], [] ) [] ) +, Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Header" ] ] + ] + ]) + [ TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [] ] + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Pipe" - , Space - , Str "table" - , Space - , Str "with" - , Space - , Str "tricky" - , Space - , Str "cell" - , Space - , Str "contents" - , Space - , Str "(see" - , Space - , Str "#2765):" - ] + [ Str "Pipe" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "tricky" + , Space + , Str "cell" + , Space + , Str "contents" + , Space + , Str "(see" + , Space + , Str "#2765):" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignLeft, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "IP_gene8-_1st" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "IP_gene8+_1st" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "IP_gene8-_1st" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1.0000000" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "0.4357325" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "IP_gene8+_1st" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "0.4357325" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1.0000000" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "foo", Code ( "", [], [] ) "bar|baz" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "and|escaped" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3.0000000" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "IP_gene8-_1st" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "IP_gene8+_1st" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "IP_gene8-_1st" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1.0000000" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "0.4357325" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "IP_gene8+_1st" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "0.4357325" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1.0000000" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "foo" , Code ( "" , [] , [] ) "bar|baz" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "and|escaped" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3.0000000" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] diff --git a/test/rst-reader.native b/test/rst-reader.native index 7a5c3d812..d3e7f6caa 100644 --- a/test/rst-reader.native +++ b/test/rst-reader.native @@ -1,267 +1,181 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "author" - , MetaList - [ MetaInlines - [ Str "John", Space, Str "MacFarlane" ] - , MetaInlines - [ Str "Anonymous" ] + Meta + { unMeta = + fromList + [ ( "author" + , MetaList + [ MetaInlines [ Str "John" , Space , Str "MacFarlane" ] + , MetaInlines [ Str "Anonymous" ] + ] + ) + , ( "date" + , MetaInlines + [ Str "July" , Space , Str "17," , Space , Str "2006" ] + ) + , ( "revision" , MetaBlocks [ Para [ Str "3" ] ] ) + , ( "subtitle" , MetaInlines [ Str "Subtitle" ] ) + , ( "title" + , MetaInlines + [ Str "Pandoc" , Space , Str "Test" , Space , Str "Suite" ] + ) ] - ) - , - ( "date" - , MetaInlines - [ Str "July", Space, Str "17,", Space, Str "2006" ] - ) - , - ( "revision", MetaBlocks [ Para [ Str "3" ] ] ) - , - ( "subtitle", MetaInlines [ Str "Subtitle" ] ) - , - ( "title" - , MetaInlines - [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] - ) - ] } - ) - [ Header 1 - ( "level-one-header", [], [] ) - [ Str "Level", Space, Str "one", Space, Str "header" ] - , 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 "Most" - , Space - , Str "of" - , Space - , Str "them" - , Space - , Str "are" - , Space - , Str "adapted" - , Space - , Str "from" - , SoftBreak - , Str "John" - , Space - , Str "Gruber\8217s" - , Space - , Str "markdown" - , Space - , Str "test" - , Space - , Str "suite." - ] - , Header 2 - ( "level-two-header", [], [] ) - [ Str "Level", Space, Str "two", Space, Str "header" ] - , Header 3 - ( "level-three", [], [] ) - [ Str "Level", Space, Str "three" ] - , Header 4 - ( "level-four-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "four" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 5 - ( "level-five", [], [] ) - [ Str "Level", Space, Str "five" ] - , Header 1 - ( "paragraphs", [], [] ) - [ Str "Paragraphs" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "regular" - , Space - , Str "paragraph." - ] - , Para - [ Str "In" - , Space - , Str "Markdown" - , Space - , Str "1.0.0" - , Space - , Str "and" - , Space - , Str "earlier." - , Space - , Str "Version" - , SoftBreak - , Str "8." - , Space - , Str "This" - , Space - , Str "line" - , Space - , Str "turns" - , Space - , Str "into" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - , SoftBreak - , Str "Because" - , Space - , Str "a" - , Space - , Str "hard-wrapped" - , Space - , Str "line" - , Space - , Str "in" - , Space - , Str "the" - , SoftBreak - , Str "middle" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "paragraph" - , Space - , Str "looked" - , Space - , Str "like" - , Space - , Str "a" - , SoftBreak - , Str "list" - , Space - , Str "item." - ] + [ Header + 1 + ( "level-one-header" , [] , [] ) + [ Str "Level" , Space , Str "one" , Space , Str "header" ] , Para - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "bullet." - , SoftBreak - , Str "*" - , Space - , Str "criminey." - ] - , Para - [ Str "Horizontal", Space, Str "rule:" ] - , HorizontalRule - , Para - [ Str "Another:" ] - , HorizontalRule - , Header 1 - ( "block-quotes", [], [] ) - [ Str "Block", Space, Str "Quotes" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "block" - , Space - , Str "quote:" - ] - , BlockQuote - [ Para [ Str "This" , Space , Str "is" , Space , Str "a" , Space - , Str "block" + , Str "set" + , Space + , Str "of" + , Space + , Str "tests" + , Space + , Str "for" + , Space + , Str "pandoc." + , Space + , Str "Most" + , Space + , Str "of" + , Space + , Str "them" , Space - , Str "quote." + , Str "are" + , Space + , Str "adapted" + , Space + , Str "from" , SoftBreak - , Str "It" + , Str "John" , Space - , Str "is" + , Str "Gruber\8217s" + , Space + , Str "markdown" , Space - , Str "pretty" + , Str "test" , Space - , Str "short." + , Str "suite." ] - ] - , Para - [ Str "Here\8217s" - , Space - , Str "another," - , Space - , Str "differently" - , Space - , Str "indented:" - ] - , BlockQuote - [ Para - [ Str "This" + , Header + 2 + ( "level-two-header" , [] , [] ) + [ Str "Level" , Space , Str "two" , Space , Str "header" ] + , Header + 3 ( "level-three" , [] , [] ) [ Str "Level" , Space , Str "three" ] + , Header + 4 + ( "level-four-with-emphasis" , [] , [] ) + [ Str "Level" , Space - , Str "is" + , Str "four" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 5 ( "level-five" , [] , [] ) [ Str "Level" , Space , Str "five" ] + , Header 1 ( "paragraphs" , [] , [] ) [ Str "Paragraphs" ] + , Para + [ Str "Here\8217s" , Space , Str "a" , Space - , Str "block" + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" , Space - , Str "quote." + , Str "earlier." + , Space + , Str "Version" , SoftBreak - , Str "It\8217s" + , Str "8." , Space - , Str "indented" + , Str "This" , Space - , Str "with" + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" , Space , Str "a" , Space - , Str "tab." - ] - , Para - [ Str "Code" + , Str "list" + , Space + , Str "item." + , SoftBreak + , Str "Because" + , Space + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" , Space , Str "in" , Space + , Str "the" + , SoftBreak + , Str "middle" + , Space + , Str "of" + , Space , Str "a" , Space - , Str "block" + , Str "paragraph" , Space - , Str "quote:" + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , SoftBreak + , Str "list" + , Space + , Str "item." ] - , CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - , Para - [ Str "List" + , Para + [ Str "Here\8217s" , Space - , Str "in" + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , SoftBreak + , Str "*" + , Space + , Str "criminey." + ] + , Para [ Str "Horizontal" , Space , Str "rule:" ] + , HorizontalRule + , Para [ Str "Another:" ] + , HorizontalRule + , Header + 1 + ( "block-quotes" , [] , [] ) + [ Str "Block" , Space , Str "Quotes" ] + , Para + [ Str "Here\8217s" , Space , Str "a" , Space @@ -269,755 +183,564 @@ Pandoc , Space , Str "quote:" ] - , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "item", Space, Str "one" ] ] - , - [ Plain [ Str "item", Space, Str "two" ] ] - ] - , Para - [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] - , BlockQuote - [ Para [ Str "nested" ], BlockQuote [ Para [ Str "nested" ] ] ] - ] - , Header 1 - ( "code-blocks", [], [] ) - [ Str "Code", Space, Str "Blocks" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , SoftBreak + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] + ] , Para - [ Str "Code:" ] + [ Str "Here\8217s" + , Space + , Str "another," + , Space + , Str "differently" + , Space + , Str "indented:" + ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , SoftBreak + , Str "It\8217s" + , Space + , Str "indented" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "tab." + ] + , Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + , Para + [ Str "List" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , OrderedList + ( 1 , Decimal , Period ) + [ [ Plain [ Str "item" , Space , Str "one" ] ] + , [ Plain [ Str "item" , Space , Str "two" ] ] + ] + , Para + [ Str "Nested" , Space , Str "block" , Space , Str "quotes:" ] + , BlockQuote + [ Para [ Str "nested" ] , BlockQuote [ Para [ Str "nested" ] ] ] + ] + , Header + 1 ( "code-blocks" , [] , [] ) [ Str "Code" , Space , Str "Blocks" ] + , Para [ Str "Code:" ] , CodeBlock - ( "" - , [] - , [] - ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}" + ( "" , [] , [] ) + "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}" , CodeBlock - ( "", [], [] ) "this code block is indented by one tab" - , Para - [ Str "And:" ] + ( "" , [] , [] ) "this code block is indented by one tab" + , Para [ Str "And:" ] , CodeBlock - ( "" - , [] - , [] - ) "this block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" - , Para - [ Str "And:" ] + ( "" , [] , [] ) + "this block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + , Para [ Str "And:" ] , CodeBlock - ( "", [ "python" ], [] ) "def my_function(x):\n return x + 1" + ( "" , [ "python" ] , [] ) "def my_function(x):\n return x + 1" , Para - [ Str "If" - , Space - , Str "we" - , Space - , Str "use" - , Space - , Str "the" - , Space - , Str "highlight" - , Space - , Str "directive," - , Space - , Str "we" - , Space - , Str "can" - , Space - , Str "specify" - , Space - , Str "a" - , Space - , Str "default" - , Space - , Str "language" - , SoftBreak - , Str "for" - , Space - , Str "literate" - , Space - , Str "blocks." - ] + [ Str "If" + , Space + , Str "we" + , Space + , Str "use" + , Space + , Str "the" + , Space + , Str "highlight" + , Space + , Str "directive," + , Space + , Str "we" + , Space + , Str "can" + , Space + , Str "specify" + , Space + , Str "a" + , Space + , Str "default" + , Space + , Str "language" + , SoftBreak + , Str "for" + , Space + , Str "literate" + , Space + , Str "blocks." + ] , CodeBlock - ( "" - , [ "haskell" ] - , [] - ) "-- this code is in haskell\ndata Tree = Leaf | Node Tree Tree" + ( "" , [ "haskell" ] , [] ) + "-- this code is in haskell\ndata Tree = Leaf | Node Tree Tree" , CodeBlock - ( "" - , [ "haskell" ] - , [] - ) "-- this code is in haskell too\ndata Nat = Zero | Succ Nat" + ( "" , [ "haskell" ] , [] ) + "-- this code is in haskell too\ndata Nat = Zero | Succ Nat" , CodeBlock - ( "" - , [ "javascript" ] - , [] - ) "-- this code is in javascript\nlet f = (x, y) => x + y" - , Header 1 - ( "lists", [], [] ) - [ Str "Lists" ] - , Header 2 - ( "unordered", [], [] ) - [ Str "Unordered" ] - , Para - [ Str "Asterisks", Space, Str "tight:" ] + ( "" , [ "javascript" ] , [] ) + "-- this code is in javascript\nlet f = (x, y) => x + y" + , Header 1 ( "lists" , [] , [] ) [ Str "Lists" ] + , Header 2 ( "unordered" , [] , [] ) [ Str "Unordered" ] + , Para [ Str "Asterisks" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "asterisk", Space, Str "1" ] ] - , - [ Plain [ Str "asterisk", Space, Str "2" ] ] - , - [ Plain [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Asterisks", Space, Str "loose:" ] + [ [ Plain [ Str "asterisk" , Space , Str "1" ] ] + , [ Plain [ Str "asterisk" , Space , Str "2" ] ] + , [ Plain [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Asterisks" , Space , Str "loose:" ] , BulletList - [ - [ Plain [ Str "asterisk", Space, Str "1" ] ] - , - [ Plain [ Str "asterisk", Space, Str "2" ] ] - , - [ Plain [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "tight:" ] + [ [ Plain [ Str "asterisk" , Space , Str "1" ] ] + , [ Plain [ Str "asterisk" , Space , Str "2" ] ] + , [ Plain [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "Plus", Space, Str "1" ] ] - , - [ Plain [ Str "Plus", Space, Str "2" ] ] - , - [ Plain [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "loose:" ] + [ [ Plain [ Str "Plus" , Space , Str "1" ] ] + , [ Plain [ Str "Plus" , Space , Str "2" ] ] + , [ Plain [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "loose:" ] , BulletList - [ - [ Plain [ Str "Plus", Space, Str "1" ] ] - , - [ Plain [ Str "Plus", Space, Str "2" ] ] - , - [ Plain [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "tight:" ] + [ [ Plain [ Str "Plus" , Space , Str "1" ] ] + , [ Plain [ Str "Plus" , Space , Str "2" ] ] + , [ Plain [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "Minus", Space, Str "1" ] ] - , - [ Plain [ Str "Minus", Space, Str "2" ] ] - , - [ Plain [ Str "Minus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "loose:" ] + [ [ Plain [ Str "Minus" , Space , Str "1" ] ] + , [ Plain [ Str "Minus" , Space , Str "2" ] ] + , [ Plain [ Str "Minus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "loose:" ] , BulletList - [ - [ Plain [ Str "Minus", Space, Str "1" ] ] - , - [ Plain [ Str "Minus", Space, Str "2" ] ] - , - [ Plain [ Str "Minus", Space, Str "3" ] ] - ] - , Header 2 - ( "ordered", [], [] ) - [ Str "Ordered" ] - , Para - [ Str "Tight:" ] - , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "First" ] ] - , - [ Plain [ Str "Second" ] ] - , - [ Plain [ Str "Third" ] ] - ] - , Para - [ Str "and:" ] - , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "One" ] ] - , - [ Plain [ Str "Two" ] ] - , - [ Plain [ Str "Three" ] ] - ] - , Para - [ Str "Loose", Space, Str "using", Space, Str "tabs:" ] - , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "First" ] ] - , - [ Plain [ Str "Second" ] ] - , - [ Plain [ Str "Third" ] ] - ] - , Para - [ Str "and", Space, Str "using", Space, Str "spaces:" ] + [ [ Plain [ Str "Minus" , Space , Str "1" ] ] + , [ Plain [ Str "Minus" , Space , Str "2" ] ] + , [ Plain [ Str "Minus" , Space , Str "3" ] ] + ] + , Header 2 ( "ordered" , [] , [] ) [ Str "Ordered" ] + , Para [ Str "Tight:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "One" ] ] - , - [ Plain [ Str "Two" ] ] - , - [ Plain [ Str "Three" ] ] - ] - , Para - [ Str "Multiple", Space, Str "paragraphs:" ] + ( 1 , Decimal , Period ) + [ [ Plain [ Str "First" ] ] + , [ Plain [ Str "Second" ] ] + , [ Plain [ Str "Third" ] ] + ] + , Para [ Str "and:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para - [ Str "Item", Space, Str "1,", Space, Str "graf", Space, Str "one." ] - , Para - [ Str "Item" - , Space - , Str "1." - , Space - , Str "graf" - , Space - , Str "two." - , Space - , Str "The" - , Space - , Str "quick" - , Space - , Str "brown" - , Space - , Str "fox" - , Space - , Str "jumped" - , Space - , Str "over" - , Space - , Str "the" - , Space - , Str "lazy" - , Space - , Str "dog\8217s" - , SoftBreak - , Str "back." - ] + ( 1 , Decimal , Period ) + [ [ Plain [ Str "One" ] ] + , [ Plain [ Str "Two" ] ] + , [ Plain [ Str "Three" ] ] ] - , - [ Para [ Str "Item", Space, Str "2." ] ] - , - [ Para [ Str "Item", Space, Str "3." ] ] - ] - , Para - [ Str "Nested:" ] - , BulletList - [ - [ Plain - [ Str "Tab" ] - , BulletList - [ [ Plain [ Str "Tab" ], BulletList [ [ Plain [ Str "Tab" ] ] ] ] ] + , Para [ Str "Loose" , Space , Str "using" , Space , Str "tabs:" ] + , OrderedList + ( 1 , Decimal , Period ) + [ [ Plain [ Str "First" ] ] + , [ Plain [ Str "Second" ] ] + , [ Plain [ Str "Third" ] ] ] - ] - , Para - [ Str "Here\8217s", Space, Str "another:" ] + , Para [ Str "and" , Space , Str "using" , Space , Str "spaces:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BlockQuote - [ BulletList - [ - [ Plain [ Str "Fee" ] ] - , - [ Plain [ Str "Fie" ] ] - , - [ Plain [ Str "Foe" ] ] - ] - ] + ( 1 , Decimal , Period ) + [ [ Plain [ Str "One" ] ] + , [ Plain [ Str "Two" ] ] + , [ Plain [ Str "Three" ] ] ] - , - [ Para [ Str "Third" ] ] - ] - , Header 2 - ( "fancy-list-markers", [], [] ) - [ Str "Fancy", Space, Str "list", Space, Str "markers" ] + , Para [ Str "Multiple" , Space , Str "paragraphs:" ] , OrderedList - ( 2, Decimal, TwoParens ) - [ - [ Para [ Str "begins", Space, Str "with", Space, Str "2" ] ] - , - [ Para - [ Str "and", Space, Str "now", Space, Str "3" ] - , Para - [ Str "with", Space, Str "a", Space, Str "continuation" ] - , OrderedList - ( 4, LowerRoman, Period ) - [ - [ Plain - [ Str "sublist" + ( 1 , Decimal , Period ) + [ [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." , Space - , Str "with" + , Str "The" , Space - , Str "roman" + , Str "quick" , Space - , Str "numerals," + , Str "brown" , Space - , Str "starting" + , Str "fox" , Space - , Str "with" + , Str "jumped" , Space - , Str "4" + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , SoftBreak + , Str "back." ] - ] - , - [ Plain - [ Str "more", Space, Str "items" ] - , OrderedList - ( 1, UpperAlpha, TwoParens ) - [ - [ Plain [ Str "a", Space, Str "subsublist" ] ] - , - [ Plain [ Str "a", Space, Str "subsublist" ] ] + ] + , [ Para [ Str "Item" , Space , Str "2." ] ] + , [ Para [ Str "Item" , Space , Str "3." ] ] + ] + , Para [ Str "Nested:" ] + , BulletList + [ [ Plain [ Str "Tab" ] + , BulletList + [ [ Plain [ Str "Tab" ] , BulletList [ [ Plain [ Str "Tab" ] ] ] ] ] - ] ] ] - ] - , Para - [ Str "Nesting:" ] + , Para [ Str "Here\8217s" , Space , Str "another:" ] , OrderedList - ( 1, UpperAlpha, Period ) - [ - [ Plain - [ Str "Upper", Space, Str "Alpha" ] - , OrderedList - ( 1, UpperRoman, Period ) - [ - [ Plain - [ Str "Upper", Space, Str "Roman." ] - , OrderedList - ( 6, Decimal, TwoParens ) - [ - [ Plain - [ Str "Decimal" - , Space - , Str "start" - , Space - , Str "with" - , Space - , Str "6" + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BlockQuote + [ BulletList + [ [ Plain [ Str "Fee" ] ] + , [ Plain [ Str "Fie" ] ] + , [ Plain [ Str "Foe" ] ] ] + ] + ] + , [ Para [ Str "Third" ] ] + ] + , Header + 2 + ( "fancy-list-markers" , [] , [] ) + [ Str "Fancy" , Space , Str "list" , Space , Str "markers" ] + , OrderedList + ( 2 , Decimal , TwoParens ) + [ [ Para [ Str "begins" , Space , Str "with" , Space , Str "2" ] ] + , [ Para [ Str "and" , Space , Str "now" , Space , Str "3" ] + , Para + [ Str "with" , Space , Str "a" , Space , Str "continuation" ] + , OrderedList + ( 4 , LowerRoman , Period ) + [ [ Plain + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , Space + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" + ] + ] + , [ Plain [ Str "more" , Space , Str "items" ] , OrderedList - ( 3, LowerAlpha, OneParen ) - [ - [ Plain - [ Str "Lower" - , Space - , Str "alpha" - , Space - , Str "with" - , Space - , Str "paren" + ( 1 , UpperAlpha , TwoParens ) + [ [ Plain [ Str "a" , Space , Str "subsublist" ] ] + , [ Plain [ Str "a" , Space , Str "subsublist" ] ] + ] + ] + ] + ] + ] + , Para [ Str "Nesting:" ] + , OrderedList + ( 1 , UpperAlpha , Period ) + [ [ Plain [ Str "Upper" , Space , Str "Alpha" ] + , OrderedList + ( 1 , UpperRoman , Period ) + [ [ Plain [ Str "Upper" , Space , Str "Roman." ] + , OrderedList + ( 6 , Decimal , TwoParens ) + [ [ Plain + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3 , LowerAlpha , OneParen ) + [ [ Plain + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] ] ] - ] ] ] - ] ] ] - ] - , Para - [ Str "Autonumbering:" ] + , Para [ Str "Autonumbering:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Autonumber." ] ] - , - [ Plain - [ Str "More." ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Plain [ Str "Nested." ] ] ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Autonumber." ] ] + , [ Plain [ Str "More." ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) [ [ Plain [ Str "Nested." ] ] ] + ] ] - ] , Para - [ Str "Autonumbering" - , Space - , Str "with" - , Space - , Str "explicit" - , Space - , Str "start:" - ] + [ Str "Autonumbering" + , Space + , Str "with" + , Space + , Str "explicit" + , Space + , Str "start:" + ] , OrderedList - ( 4, LowerAlpha, TwoParens ) - [ - [ Plain [ Str "item", Space, Str "1" ] ] - , - [ Plain [ Str "item", Space, Str "2" ] ] - ] - , Header 2 - ( "definition", [], [] ) - [ Str "Definition" ] + ( 4 , LowerAlpha , TwoParens ) + [ [ Plain [ Str "item" , Space , Str "1" ] ] + , [ Plain [ Str "item" , Space , Str "2" ] ] + ] + , Header 2 ( "definition" , [] , [] ) [ Str "Definition" ] , DefinitionList - [ - ( - [ Str "term", Space, Str "1" ] - , - [ [ Para [ Str "Definition", Space, Str "1." ] ] ] - ) - , - ( - [ Str "term", Space, Str "2" ] - , - [ - [ Para - [ Str "Definition" - , Space - , Str "2," - , Space - , Str "paragraph" - , Space - , Str "1." - ] - , Para - [ Str "Definition" - , Space - , Str "2," - , Space - , Str "paragraph" - , Space - , Str "2." + [ ( [ Str "term" , Space , Str "1" ] + , [ [ Para [ Str "Definition" , Space , Str "1." ] ] ] + ) + , ( [ Str "term" , Space , Str "2" ] + , [ [ Para + [ Str "Definition" + , Space + , Str "2," + , Space + , Str "paragraph" + , Space + , Str "1." + ] + , Para + [ Str "Definition" + , Space + , Str "2," + , Space + , Str "paragraph" + , Space + , Str "2." + ] ] ] - ] - ) - , - ( - [ Str "term", Space, Str "with", Space, Emph [ Str "emphasis" ] ] - , - [ [ Para [ Str "Definition", Space, Str "3." ] ] ] - ) - ] - , Header 1 - ( "field-lists", [], [] ) - [ Str "Field", Space, Str "Lists" ] - , BlockQuote - [ DefinitionList - [ - ( - [ Str "address" ] - , - [ [ Para [ Str "61", Space, Str "Main", Space, Str "St." ] ] ] ) - , - ( - [ Str "city" ] - , - [ - [ Para - [ Emph - [ Str "Nowhere" ] - , Str "," - , Space - , Str "MA," - , SoftBreak - , Str "USA" - ] - ] + , ( [ Str "term" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] ] + , [ [ Para [ Str "Definition" , Space , Str "3." ] ] ] ) - , - ( [ Str "phone" ], [ [ Para [ Str "123-4567" ] ] ] ) ] - ] + , Header + 1 ( "field-lists" , [] , [] ) [ Str "Field" , Space , Str "Lists" ] + , BlockQuote + [ DefinitionList + [ ( [ Str "address" ] + , [ [ Para [ Str "61" , Space , Str "Main" , Space , Str "St." ] ] + ] + ) + , ( [ Str "city" ] + , [ [ Para + [ Emph [ Str "Nowhere" ] + , Str "," + , Space + , Str "MA," + , SoftBreak + , Str "USA" + ] + ] + ] + ) + , ( [ Str "phone" ] , [ [ Para [ Str "123-4567" ] ] ] ) + ] + ] , DefinitionList - [ - ( - [ Str "address" ] - , - [ [ Para [ Str "61", Space, Str "Main", Space, Str "St." ] ] ] - ) - , - ( - [ Str "city" ] - , - [ - [ Para - [ Emph - [ Str "Nowhere" ] - , Str "," - , Space - , Str "MA," - , SoftBreak - , Str "USA" - ] + [ ( [ Str "address" ] + , [ [ Para [ Str "61" , Space , Str "Main" , Space , Str "St." ] ] ] - ] - ) - , - ( [ Str "phone" ], [ [ Para [ Str "123-4567" ] ] ] ) - ] - , Header 1 - ( "html-blocks", [], [] ) - [ Str "HTML", Space, Str "Blocks" ] - , Para - [ Str "Simple" - , Space - , Str "block" - , Space - , Str "on" - , Space - , Str "one" - , Space - , Str "line:" - ] - , RawBlock - ( Format "html" ) "
foo
" + ) + , ( [ Str "city" ] + , [ [ Para + [ Emph [ Str "Nowhere" ] + , Str "," + , Space + , Str "MA," + , SoftBreak + , Str "USA" + ] + ] + ] + ) + , ( [ Str "phone" ] , [ [ Para [ Str "123-4567" ] ] ] ) + ] + , Header + 1 ( "html-blocks" , [] , [] ) [ Str "HTML" , Space , Str "Blocks" ] , Para - [ Str "Now,", Space, Str "nested:" ] + [ Str "Simple" + , Space + , Str "block" + , Space + , Str "on" + , Space + , Str "one" + , Space + , Str "line:" + ] + , RawBlock (Format "html") "
foo
" + , Para [ Str "Now," , Space , Str "nested:" ] , RawBlock - ( Format "html" ) "
\n
\n
\n foo\n
\n
\n
" - , Header 1 - ( "latex-block", [], [] ) - [ Str "LaTeX", Space, Str "Block" ] + (Format "html") + "
\n
\n
\n foo\n
\n
\n
" + , Header + 1 ( "latex-block" , [] , [] ) [ Str "LaTeX" , Space , Str "Block" ] , RawBlock - ( Format "latex" ) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" - , Header 1 - ( "inline-markup", [], [] ) - [ Str "Inline", Space, Str "Markup" ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "emphasized" ] - , Str "." - , Space - , Str "This" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "code:" - , Space - , Code - ( "", [], [] ) ">" - , Str "," - , Space - , Code - ( "", [], [] ) "$" - , Str "," - , Space - , Code - ( "", [], [] ) "\\" - , Str "," - , Space - , Code - ( "", [], [] ) "\\$" - , Str "," - , Space - , Code - ( "", [], [] ) "" - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Subscript - [ Str "subscripted" ] - , Space - , Str "and" - , Space - , Str "this" - , Space - , Str "is" - , Space - , Superscript - [ Str "superscripted" ] - , Str "." - ] - , Header 1 - ( "special-characters", [], [] ) - [ Str "Special", Space, Str "Characters" ] - , Para - [ Str "Here", Space, Str "is", Space, Str "some", Space, Str "unicode:" ] - , BulletList - [ - [ Plain [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] - , - [ Plain [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] - , - [ Plain [ Str "section:", Space, Str "\167" ] ] - , - [ Plain [ Str "set", Space, Str "membership:", Space, Str "\8712" ] ] - , - [ Plain [ Str "copyright:", Space, Str "\169" ] ] - ] - , Para - [ Str "AT&T" - , Space - , Str "has" - , Space - , Str "an" - , Space - , Str "ampersand" - , Space - , Str "in" - , Space - , Str "their" - , Space - , Str "name." - ] - , Para - [ Str "This", Space, Str "&", Space, Str "that." ] - , Para - [ Str "4", Space, Str "<", Space, Str "5." ] + (Format "latex") + "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" + , Header + 1 + ( "inline-markup" , [] , [] ) + [ Str "Inline" , Space , Str "Markup" ] , Para - [ Str "6", Space, Str ">", Space, Str "5." ] - , Para - [ Str "Backslash:", Space, Str "\\" ] - , Para - [ Str "Backtick:", Space, Str "`" ] - , Para - [ Str "Asterisk:", Space, Str "*" ] - , Para - [ Str "Underscore:", Space, Str "_" ] - , Para - [ Str "Left", Space, Str "brace:", Space, Str "{" ] - , Para - [ Str "Right", Space, Str "brace:", Space, Str "}" ] - , Para - [ Str "Left", Space, Str "bracket:", Space, Str "[" ] - , Para - [ Str "Right", Space, Str "bracket:", Space, Str "]" ] - , Para - [ Str "Left", Space, Str "paren:", Space, Str "(" ] - , Para - [ Str "Right", Space, Str "paren:", Space, Str ")" ] - , Para - [ Str "Greater-than:", Space, Str ">" ] - , Para - [ Str "Hash:", Space, Str "#" ] - , Para - [ Str "Period:", Space, Str "." ] - , Para - [ Str "Bang:", Space, Str "!" ] - , Para - [ Str "Plus:", Space, Str "+" ] - , Para - [ Str "Minus:", Space, Str "-" ] - , Header 1 - ( "links", [], [] ) - [ Str "Links" ] - , Para - [ Str "Explicit:" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "URL" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Explicit" - , Space - , Str "with" - , Space - , Str "no" - , Space - , Str "label:" - , Space - , Link - ( "", [], [] ) - [ Str "foo" ] - ( "foo", "" ) - , Str "." - ] + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + , Str "." + , Space + , Str "This" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + , Str "." + ] , Para - [ Str "Two" - , Space - , Str "anonymous" - , Space - , Str "links:" - , Space - , Link - ( "", [], [] ) - [ Str "the", Space, Str "first" ] - ( "/url1/", "" ) - , Space - , Str "and" - , Space - , Link - ( "", [], [] ) - [ Str "the", Space, Str "second" ] - ( "/url2/", "" ) - ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code ( "" , [] , [] ) ">" + , Str "," + , Space + , Code ( "" , [] , [] ) "$" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\$" + , Str "," + , Space + , Code ( "" , [] , [] ) "" + , Str "." + ] , Para - [ Str "Reference" - , Space - , Str "links:" - , Space - , Link - ( "", [], [] ) - [ Str "link1" ] - ( "/url1/", "" ) - , Space - , Str "and" - , Space - , Link - ( "", [], [] ) - [ Str "link2" ] - ( "/url2/", "" ) - , Space - , Str "and" - , Space - , Link - ( "", [], [] ) - [ Str "link1" ] - ( "/url1/", "" ) - , Space - , Str "again." - ] + [ Str "This" + , Space + , Str "is" + , Subscript [ Str "subscripted" ] + , Space + , Str "and" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Superscript [ Str "superscripted" ] + , Str "." + ] + , Header + 1 + ( "special-characters" , [] , [] ) + [ Str "Special" , Space , Str "Characters" ] , Para - [ Str "Another" - , Space - , Link - ( "", [], [] ) - [ Str "style" + [ Str "Here" , Space - , Str "of" + , Str "is" , Space - , Str "reference" + , Str "some" , Space - , Str "link" + , Str "unicode:" + ] + , BulletList + [ [ Plain [ Str "I" , Space , Str "hat:" , Space , Str "\206" ] ] + , [ Plain [ Str "o" , Space , Str "umlaut:" , Space , Str "\246" ] + ] + , [ Plain [ Str "section:" , Space , Str "\167" ] ] + , [ Plain + [ Str "set" , Space , Str "membership:" , Space , Str "\8712" ] + ] + , [ Plain [ Str "copyright:" , Space , Str "\169" ] ] ] - ( "/url1/", "" ) - , Str "." - ] , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "link" + [ Str "AT&T" , Space - , Str "with" + , Str "has" , Space , Str "an" , Space @@ -1025,850 +748,978 @@ Pandoc , Space , Str "in" , Space - , Str "the" + , Str "their" , Space - , Str "URL" + , Str "name." + ] + , Para [ Str "This" , Space , Str "&" , Space , Str "that." ] + , Para [ Str "4" , Space , Str "<" , Space , Str "5." ] + , Para [ Str "6" , Space , Str ">" , Space , Str "5." ] + , Para [ Str "Backslash:" , Space , Str "\\" ] + , Para [ Str "Backtick:" , Space , Str "`" ] + , Para [ Str "Asterisk:" , Space , Str "*" ] + , Para [ Str "Underscore:" , Space , Str "_" ] + , Para [ Str "Left" , Space , Str "brace:" , Space , Str "{" ] + , Para [ Str "Right" , Space , Str "brace:" , Space , Str "}" ] + , Para [ Str "Left" , Space , Str "bracket:" , Space , Str "[" ] + , Para [ Str "Right" , Space , Str "bracket:" , Space , Str "]" ] + , Para [ Str "Left" , Space , Str "paren:" , Space , Str "(" ] + , Para [ Str "Right" , Space , Str "paren:" , Space , Str ")" ] + , Para [ Str "Greater-than:" , Space , Str ">" ] + , Para [ Str "Hash:" , Space , Str "#" ] + , Para [ Str "Period:" , Space , Str "." ] + , Para [ Str "Bang:" , Space , Str "!" ] + , Para [ Str "Plus:" , Space , Str "+" ] + , Para [ Str "Minus:" , Space , Str "-" ] + , Header 1 ( "links" , [] , [] ) [ Str "Links" ] + , Para + [ Str "Explicit:" + , Space + , Str "a" + , Space + , Link ( "" , [] , [] ) [ Str "URL" ] ( "/url/" , "" ) + , Str "." ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "link" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Str "amersand" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "link" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "AT&T" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "Autolinks:" - , Space - , Link - ( "", [], [] ) - [ Str "http://example.com/?foo=1&bar=2" ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Space - , Str "and" - , Space - , Link - ( "", [], [] ) - [ Str "nobody@nowhere.net" ] - ( "mailto:nobody@nowhere.net", "" ) - , Str "." - ] - , Para - [ Str "But", Space, Str "not", Space, Str "here:" ] - , CodeBlock - ( "", [], [] ) "http://example.com/" - , Header 1 - ( "images", [], [] ) - [ Str "Images" ] - , Para - [ Str "From" - , Space - , Quoted DoubleQuote - [ Str "Voyage", Space, Str "dans", Space, Str "la", Space, Str "Lune" ] - , Space - , Str "by" - , Space - , Str "Georges" - , Space - , Str "Melies" - , Space - , Str "(1902):" - ] - , Para - [ Image ( "", [], [] ) [ Str "image" ] ( "lalune.jpg", "" ) ] - , Para - [ Image - ( "", [], [ ( "height", "2343px" ) ] ) - [ Str "Voyage dans la Lune" ] - ( "lalune.jpg", "" ) - ] , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "movie" - , Space - , Image - ( "", [], [] ) - [ Str "movie" ] - ( "movie.jpg", "" ) - , Space - , Str "icon." - ] + [ Str "Explicit" + , Space + , Str "with" + , Space + , Str "no" + , Space + , Str "label:" + , Space + , Link ( "" , [] , [] ) [ Str "foo" ] ( "foo" , "" ) + , Str "." + ] , Para - [ Str "And" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Image ( "", [], [] ) [ Str "A movie" ] ( "movie.jpg", "" ) ] - ( "/url", "" ) - , Str "." - ] - , Header 1 - ( "comments", [], [] ) - [ Str "Comments" ] + [ Str "Two" + , Space + , Str "anonymous" + , Space + , Str "links:" + , Space + , Link + ( "" , [] , [] ) + [ Str "the" , Space , Str "first" ] + ( "/url1/" , "" ) + , Space + , Str "and" + , Space + , Link + ( "" , [] , [] ) + [ Str "the" , Space , Str "second" ] + ( "/url2/" , "" ) + ] , Para - [ Str "First", Space, Str "paragraph" ] + [ Str "Reference" + , Space + , Str "links:" + , Space + , Link ( "" , [] , [] ) [ Str "link1" ] ( "/url1/" , "" ) + , Space + , Str "and" + , Space + , Link ( "" , [] , [] ) [ Str "link2" ] ( "/url2/" , "" ) + , Space + , Str "and" + , Space + , Link ( "" , [] , [] ) [ Str "link1" ] ( "/url1/" , "" ) + , Space + , Str "again." + ] , Para - [ Str "Another", Space, Str "paragraph" ] + [ Str "Another" + , Space + , Link + ( "" , [] , [] ) + [ Str "style" + , Space + , Str "of" + , Space + , Str "reference" + , Space + , Str "link" + ] + ( "/url1/" , "" ) + , Str "." + ] , Para - [ Str "A", Space, Str "third", Space, Str "paragraph" ] - , Header 1 - ( "line-blocks", [], [] ) - [ Str "Line", Space, Str "blocks" ] - , LineBlock - [ - [ Str "But" + [ Str "Here\8217s" , Space - , Str "can" + , Str "a" + , Space + , Link + ( "" , [] , [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" , Space , Str "a" , Space - , Str "bee" + , Str "link" , Space - , Str "be" + , Str "with" , Space - , Str "said" + , Str "an" , Space - , Str "to" + , Str "amersand" , Space - , Str "be" - ] - , - [ Str "\160\160\160\160or" + , Str "in" , Space - , Str "not" + , Str "the" , Space - , Str "to" + , Str "link" , Space - , Str "be" + , Str "text:" , Space - , Str "an" + , Link ( "" , [] , [] ) [ Str "AT&T" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "Autolinks:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2" , "" ) , Space - , Str "entire" + , Str "and" , Space - , Str "bee," + , Link + ( "" , [] , [] ) + [ Str "nobody@nowhere.net" ] + ( "mailto:nobody@nowhere.net" , "" ) + , Str "." ] - , - [ Str "\160\160\160\160\160\160\160\160when" + , Para [ Str "But" , Space , Str "not" , Space , Str "here:" ] + , CodeBlock ( "" , [] , [] ) "http://example.com/" + , Header 1 ( "images" , [] , [] ) [ Str "Images" ] + , Para + [ Str "From" , Space - , Str "half" + , Quoted + DoubleQuote + [ Str "Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune" + ] , Space - , Str "the" + , Str "by" , Space - , Str "bee" + , Str "Georges" , Space - , Str "is" + , Str "Melies" , Space - , Str "not" + , Str "(1902):" + ] + , Para + [ Image ( "" , [] , [] ) [ Str "image" ] ( "lalune.jpg" , "" ) ] + , Para + [ Image + ( "" , [] , [ ( "height" , "2343px" ) ] ) + [ Str "Voyage dans la Lune" ] + ( "lalune.jpg" , "" ) + ] + , Para + [ Str "Here" + , Space + , Str "is" , Space , Str "a" , Space - , Str "bee," - ] - , - [ Str "\160\160\160\160\160\160\160\160\160\160\160\160due" + , Str "movie" , Space - , Str "to" + , Image ( "" , [] , [] ) [ Str "movie" ] ( "movie.jpg" , "" ) , Space - , Str "some" + , Str "icon." + ] + , Para + [ Str "And" , Space - , Str "ancient" + , Str "an" , Space - , Str "injury?" + , Link + ( "" , [] , [] ) + [ Image ( "" , [] , [] ) [ Str "A movie" ] ( "movie.jpg" , "" ) ] + ( "/url" , "" ) + , Str "." ] - , [] - , - [ Str "Continuation", Space, Str "line" ] - , - [ Str "\160\160and", Space, Str "another" ] - ] - , Header 1 - ( "simple-tables", [], [] ) - [ Str "Simple", Space, Str "Tables" ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "3" ] ] + , Header 1 ( "comments" , [] , [] ) [ Str "Comments" ] + , Para [ Str "First" , Space , Str "paragraph" ] + , Para [ Str "Another" , Space , Str "paragraph" ] + , Para [ Str "A" , Space , Str "third" , Space , Str "paragraph" ] + , Header + 1 ( "line-blocks" , [] , [] ) [ Str "Line" , Space , Str "blocks" ] + , LineBlock + [ [ Str "But" + , Space + , Str "can" + , Space + , Str "a" + , Space + , Str "bee" + , Space + , Str "be" + , Space + , Str "said" + , Space + , Str "to" + , Space + , Str "be" ] - ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r1", Space, Str "a" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c" ] ] + , [ Str "\160\160\160\160or" + , Space + , Str "not" + , Space + , Str "to" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "entire" + , Space + , Str "bee," + ] + , [ Str "\160\160\160\160\160\160\160\160when" + , Space + , Str "half" + , Space + , Str "the" + , Space + , Str "bee" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "bee," ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r2", Space, Str "d" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] + , [ Str "\160\160\160\160\160\160\160\160\160\160\160\160due" + , Space + , Str "to" + , Space + , Str "some" + , Space + , Str "ancient" + , Space + , Str "injury?" ] + , [] + , [ Str "Continuation" , Space , Str "line" ] + , [ Str "\160\160and" , Space , Str "another" ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Headless" ] + , Header + 1 + ( "simple-tables" , [] , [] ) + [ Str "Simple" , Space , Str "Tables" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r1", Space, Str "a" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r2", Space, Str "d" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "3" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r1" , Space , Str "a" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "c" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r2" , Space , Str "d" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 1 - ( "grid-tables", [], [] ) - [ Str "Grid", Space, Str "Tables" ] + (TableFoot ( "" , [] , [] ) []) + , Para [ Str "Headless" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.2375 ) - , - ( AlignDefault, ColWidth 0.15 ) - , - ( AlignDefault, ColWidth 0.1625 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "col", Space, Str "3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "r1", Space, Str "a", SoftBreak, Str "r1", Space, Str "bis" ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r1" , Space , Str "a" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "c" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r2" , Space , Str "d" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r2", Space, Str "d" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Headless" ] + (TableFoot ( "" , [] , [] ) []) + , Header + 1 ( "grid-tables" , [] , [] ) [ Str "Grid" , Space , Str "Tables" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.2375 ) - , - ( AlignDefault, ColWidth 0.15 ) - , - ( AlignDefault, ColWidth 0.1625 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "r1", Space, Str "a", SoftBreak, Str "r1", Space, Str "bis" ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.2375 ) + , ( AlignDefault , ColWidth 0.15 ) + , ( AlignDefault , ColWidth 0.1625 ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "col" , Space , Str "3" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" , SoftBreak , Str "b" , Space , Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "c" , SoftBreak , Str "c" , Space , Str "2" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r2" , Space , Str "d" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r2", Space, Str "d" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "Spaces" - , Space - , Str "at" - , Space - , Str "ends" - , Space - , Str "of" - , Space - , Str "lines" - ] + (TableFoot ( "" , [] , [] ) []) + , Para [ Str "Headless" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.2375 ) - , - ( AlignDefault, ColWidth 0.15 ) - , - ( AlignDefault, ColWidth 0.1625 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "r1", Space, Str "a", SoftBreak, Str "r1", Space, Str "bis" ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.2375 ) + , ( AlignDefault , ColWidth 0.15 ) + , ( AlignDefault , ColWidth 0.1625 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" , SoftBreak , Str "b" , Space , Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "c" , SoftBreak , Str "c" , Space , Str "2" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r2" , Space , Str "d" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b", SoftBreak, Str "b", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c", SoftBreak, Str "c", Space, Str "2" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "r2", Space, Str "d" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Multiple" - , Space - , Str "blocks" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "cell" - ] + [ Str "Spaces" + , Space + , Str "at" + , Space + , Str "ends" + , Space + , Str "of" + , Space + , Str "lines" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.2375 ) - , - ( AlignDefault, ColWidth 0.15 ) - , - ( AlignDefault, ColWidth 0.1625 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para - [ Str "r1", Space, Str "a" ] - , Para - [ Str "r1", Space, Str "bis" ] - ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ BulletList - [ - [ Plain [ Str "b" ] ] - , - [ Plain [ Str "b", Space, Str "2" ] ] - , - [ Plain [ Str "b", Space, Str "2" ] ] - ] - ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "c" - , SoftBreak - , Str "c" - , Space - , Str "2" - , SoftBreak - , Str "c" - , Space - , Str "2" - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.2375 ) + , ( AlignDefault , ColWidth 0.15 ) + , ( AlignDefault , ColWidth 0.1625 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "r1" + , Space + , Str "a" + , SoftBreak + , Str "r1" + , Space + , Str "bis" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" , SoftBreak , Str "b" , Space , Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "c" , SoftBreak , Str "c" , Space , Str "2" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "r2" , Space , Str "d" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 1 - ( "footnotes", [], [] ) - [ Str "Footnotes" ] + (TableFoot ( "" , [] , [] ) []) , Para - [ Note - [ Para - [ Str "Note", Space, Str "with", Space, Str "one", Space, Str "line." ] + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "cell" ] - ] - , Para - [ Note - [ Para - [ Str "Note" - , Space - , Str "with" - , SoftBreak - , Str "continuation" - , Space - , Str "line." - ] + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.2375 ) + , ( AlignDefault , ColWidth 0.15 ) + , ( AlignDefault , ColWidth 0.1625 ) ] - ] - , Para - [ Note - [ Para - [ Str "Note", Space, Str "with" ] - , Para - [ Str "continuation", Space, Str "block." ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "r1" , Space , Str "a" ] + , Para [ Str "r1" , Space , Str "bis" ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ BulletList + [ [ Plain [ Str "b" ] ] + , [ Plain [ Str "b" , Space , Str "2" ] ] + , [ Plain [ Str "b" , Space , Str "2" ] ] + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "c" + , SoftBreak + , Str "c" + , Space + , Str "2" + , SoftBreak + , Str "c" + , Space + , Str "2" + ] + ] + ] + ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , Header 1 ( "footnotes" , [] , [] ) [ Str "Footnotes" ] , Para - [ Note - [ Para - [ Str "Note" - , Space - , Str "with" - , SoftBreak - , Str "continuation" - , Space - , Str "line" - ] - , Para - [ Str "and", Space, Str "a", Space, Str "second", Space, Str "para." ] + [ Note + [ Para + [ Str "Note" + , Space + , Str "with" + , Space + , Str "one" + , Space + , Str "line." + ] + ] ] - ] - , Para - [ Str "Not", Space, Str "in", Space, Str "note." ] - , Header 1 - ( "math", [], [] ) - [ Str "Math" ] , Para - [ Str "Some" - , Space - , Str "inline" - , Space - , Str "math" - , Space - , Math InlineMath "E=mc^2" - , Str "." - , Space - , Str "Now" - , Space - , Str "some" - , SoftBreak - , Str "display" - , Space - , Str "math:" - ] - , Para - [ Math DisplayMath "E=mc^2" ] + [ Note + [ Para + [ Str "Note" + , Space + , Str "with" + , SoftBreak + , Str "continuation" + , Space + , Str "line." + ] + ] + ] , Para - [ Math DisplayMath "E = mc^2" ] + [ Note + [ Para [ Str "Note" , Space , Str "with" ] + , Para [ Str "continuation" , Space , Str "block." ] + ] + ] , Para - [ Math DisplayMath "E = mc^2", Math DisplayMath "\\alpha = \\beta" ] + [ Note + [ Para + [ Str "Note" + , Space + , Str "with" + , SoftBreak + , Str "continuation" + , Space + , Str "line" + ] + , Para + [ Str "and" + , Space + , Str "a" + , Space + , Str "second" + , Space + , Str "para." + ] + ] + ] + , Para [ Str "Not" , Space , Str "in" , Space , Str "note." ] + , Header 1 ( "math" , [] , [] ) [ Str "Math" ] , Para - [ Math DisplayMath "\\begin{aligned}\nE &= mc^2\\\\\nF &= \\pi E\n\\end{aligned}" - , Math DisplayMath "F &= \\gamma \\alpha^2" - ] + [ Str "Some" + , Space + , Str "inline" + , Space + , Str "math" + , Space + , Math InlineMath "E=mc^2" + , Str "." + , Space + , Str "Now" + , Space + , Str "some" + , SoftBreak + , Str "display" + , Space + , Str "math:" + ] + , Para [ Math DisplayMath "E=mc^2" ] + , Para [ Math DisplayMath "E = mc^2" ] , Para - [ Str "All", Space, Str "done." ] - , Header 1 - ( "default-role", [], [] ) - [ Str "Default-Role" ] + [ Math DisplayMath "E = mc^2" + , Math DisplayMath "\\alpha = \\beta" + ] , Para - [ Str "Try" - , Space - , Str "changing" - , Space - , Str "the" - , Space - , Str "default" - , Space - , Str "role" - , Space - , Str "to" - , Space - , Str "a" - , Space - , Str "few" - , Space - , Str "different" - , Space - , Str "things." - ] - , Header 2 - ( "doesnt-break-title-parsing", [], [] ) - [ Str "Doesn\8217t" - , Space - , Str "Break" - , Space - , Str "Title" - , Space - , Str "Parsing" - ] + [ Math + DisplayMath + "\\begin{aligned}\nE &= mc^2\\\\\nF &= \\pi E\n\\end{aligned}" + , Math DisplayMath "F &= \\gamma \\alpha^2" + ] + , Para [ Str "All" , Space , Str "done." ] + , Header 1 ( "default-role" , [] , [] ) [ Str "Default-Role" ] , Para - [ Str "Inline" - , Space - , Str "math:" - , Space - , Math InlineMath "E=mc^2" - , Space - , Str "or" - , Space - , Math InlineMath "E=mc^2" - , Space - , Str "or" - , Space - , Math InlineMath "E=mc^2" - , Str "." - , SoftBreak - , Str "Other" - , Space - , Str "roles:" - , Space - , Superscript - [ Str "super" ] - , Str "," - , Space - , Subscript - [ Str "sub" ] - , Str "." - ] + [ Str "Try" + , Space + , Str "changing" + , Space + , Str "the" + , Space + , Str "default" + , Space + , Str "role" + , Space + , Str "to" + , Space + , Str "a" + , Space + , Str "few" + , Space + , Str "different" + , Space + , Str "things." + ] + , Header + 2 + ( "doesnt-break-title-parsing" , [] , [] ) + [ Str "Doesn\8217t" + , Space + , Str "Break" + , Space + , Str "Title" + , Space + , Str "Parsing" + ] , Para - [ Math DisplayMath "\\alpha = beta", Math DisplayMath "E = mc^2" ] + [ Str "Inline" + , Space + , Str "math:" + , Space + , Math InlineMath "E=mc^2" + , Space + , Str "or" + , Space + , Math InlineMath "E=mc^2" + , Space + , Str "or" + , Space + , Math InlineMath "E=mc^2" + , Str "." + , SoftBreak + , Str "Other" + , Space + , Str "roles:" + , Space + , Superscript [ Str "super" ] + , Str "," + , Space + , Subscript [ Str "sub" ] + , Str "." + ] , Para - [ Str "Some" - , Space - , Superscript - [ Str "of" ] - , Space - , Str "these" - , Space - , Superscript - [ Str "words" ] - , Space - , Str "are" - , Space - , Str "in" - , Space - , Superscript - [ Str "superscript" ] - , Str "." - ] + [ Math DisplayMath "\\alpha = beta" , Math DisplayMath "E = mc^2" ] , Para - [ Str "Reset" - , Space - , Str "default-role" - , Space - , Str "to" - , Space - , Str "the" - , Space - , Str "default" - , Space - , Str "default." - ] + [ Str "Some" + , Space + , Superscript [ Str "of" ] + , Space + , Str "these" + , Space + , Superscript [ Str "words" ] + , Space + , Str "are" + , Space + , Str "in" + , Space + , Superscript [ Str "superscript" ] + , Str "." + ] , Para - [ Str "And" - , Space - , Str "now" - , Space - , Span - ( "", [ "title-ref" ], [] ) - [ Str "some-invalid-string-3231231" ] - , Space - , Str "is" - , Space - , Str "nonsense." - ] + [ Str "Reset" + , Space + , Str "default-role" + , Space + , Str "to" + , Space + , Str "the" + , Space + , Str "default" + , Space + , Str "default." + ] , Para - [ Str "And" - , Space - , Str "now" - , Space - , Str "with" - , Space - , RawInline - ( Format "html" ) "inline HTML" - , Str "." - ] + [ Str "And" + , Space + , Str "now" + , Space + , Span + ( "" , [ "title-ref" ] , [] ) [ Str "some-invalid-string-3231231" ] + , Space + , Str "is" + , Space + , Str "nonsense." + ] , Para - [ Str "And" - , Space - , Str "some" - , Space - , Str "inline" - , Space - , Str "haskell" - , Space - , Code - ( "", [ "haskell" ], [] ) "fmap id [1,2..10]" - , Str "." - ] + [ Str "And" + , Space + , Str "now" + , Space + , Str "with" + , Space + , RawInline + (Format "html") "inline HTML" + , Str "." + ] , Para - [ Str "Indirect" - , Space - , Str "python" - , Space - , Str "role" - , Space - , Code - ( "", [ "py", "python", "indirect" ], [] ) "[x*x for x in [1,2,3,4,5]]" - , Str "." - ] + [ Str "And" + , Space + , Str "some" + , Space + , Str "inline" + , Space + , Str "haskell" + , Space + , Code ( "" , [ "haskell" ] , [] ) "fmap id [1,2..10]" + , Str "." + ] , Para - [ Str "Different" - , Space - , Str "indirect" - , Space - , Str "C" - , Space - , Code - ( "", [ "c", "different-indirect" ], [] ) "int x = 15;" - , Str "." - ] - , Header 2 - ( "literal-symbols", [], [] ) - [ Str "Literal", Space, Str "symbols" ] + [ Str "Indirect" + , Space + , Str "python" + , Space + , Str "role" + , Space + , Code + ( "" , [ "py" , "python" , "indirect" ] , [] ) + "[x*x for x in [1,2,3,4,5]]" + , Str "." + ] , Para - [ Str "2*2", Space, Str "=", Space, Str "4*1" ] + [ Str "Different" + , Space + , Str "indirect" + , Space + , Str "C" + , Space + , Code ( "" , [ "c" , "different-indirect" ] , [] ) "int x = 15;" + , Str "." + ] + , Header + 2 + ( "literal-symbols" , [] , [] ) + [ Str "Literal" , Space , Str "symbols" ] + , Para [ Str "2*2" , Space , Str "=" , Space , Str "4*1" ] ] diff --git a/test/rtf/accent.native b/test/rtf/accent.native index 67eb654fe..115620aff 100644 --- a/test/rtf/accent.native +++ b/test/rtf/accent.native @@ -1,18 +1,18 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Para - [ Str "le" - , Space - , Str "caf\233" - , Space - , Str "o\249" - , Space - , Str "on" - , Space - , Str "ne" - , Space - , Str "fume" - , Space - , Str "pas" - ] + [ Str "le" + , Space + , Str "caf\233" + , Space + , Str "o\249" + , Space + , Str "on" + , Space + , Str "ne" + , Space + , Str "fume" + , Space + , Str "pas" + ] ] diff --git a/test/rtf/bookmark.native b/test/rtf/bookmark.native index 765bf29d0..8f6df567c 100644 --- a/test/rtf/bookmark.native +++ b/test/rtf/bookmark.native @@ -1,11 +1,11 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Para - [ Span ( "bookmark_1", [], [] ) [ Str "Bookmark_1" ] ] + [ Span ( "bookmark_1" , [] , [] ) [ Str "Bookmark_1" ] ] , Para - [ Link - ( "", [], [] ) - [ Str "click", Space, Str "me" ] - ( "#bookmark_1", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "click" , Space , Str "me" ] + ( "#bookmark_1" , "" ) + ] ] diff --git a/test/rtf/footnote.native b/test/rtf/footnote.native index cfea5f4a1..70f8453a9 100644 --- a/test/rtf/footnote.native +++ b/test/rtf/footnote.native @@ -1,130 +1,130 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Para - [ Str "Mead's" - , Space - , Str "landmark" - , Space - , Str "study" - , Space - , Str "has" - , Space - , Str "been" - , Space - , Str "amply" - , Space - , Str "annotated." - , Note - [ Para - [ Str "See" - , Space - , Str "Sahlins," - , Space - , Str "Bateson," - , Space - , Str "and" - , Space - , Str "Geertz" - , Space - , Str "for" - , Space - , Str "a" - , Space - , Str "complete" - , Space - , Str "bibliography." - ] + [ Str "Mead's" + , Space + , Str "landmark" + , Space + , Str "study" + , Space + , Str "has" + , Space + , Str "been" + , Space + , Str "amply" + , Space + , Str "annotated." + , Note + [ Para + [ Str "See" + , Space + , Str "Sahlins," + , Space + , Str "Bateson," + , Space + , Str "and" + , Space + , Str "Geertz" + , Space + , Str "for" + , Space + , Str "a" + , Space + , Str "complete" + , Space + , Str "bibliography." + ] + ] + , Space + , Str "It" + , Space + , Str "was" + , Space + , Str "her" + , Space + , Str "work" + , Space + , Str "in" + , Space + , Str "America" + , Space + , Str "during" + , Space + , Str "the" + , Space + , Str "Second" + , Space + , Str "World" + , Space + , Str "War," + , Space + , Str "however," + , Space + , Str "that" + , Space + , Str "forms" + , Space + , Str "the" + , Space + , Str "basis" + , Space + , Str "for" + , Space + , Str "the" + , Space + , Str "paper." + , Space + , Str "As" + , Space + , Str "others" + , Space + , Str "have" + , Space + , Str "noted," + , Note + [ Para + [ Str "A" + , Space + , Str "complete" + , Space + , Str "bibliography" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "found" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "this" + , Space + , Str "chapter." + ] + ] + , Space + , Str "this" + , Space + , Str "period" + , Space + , Str "was" + , Space + , Str "a" + , Space + , Str "turning" + , Space + , Str "point" + , Space + , Str "for" + , Space + , Str "Margaret" + , Space + , Str "Mead." ] - , Space - , Str "It" - , Space - , Str "was" - , Space - , Str "her" - , Space - , Str "work" - , Space - , Str "in" - , Space - , Str "America" - , Space - , Str "during" - , Space - , Str "the" - , Space - , Str "Second" - , Space - , Str "World" - , Space - , Str "War," - , Space - , Str "however," - , Space - , Str "that" - , Space - , Str "forms" - , Space - , Str "the" - , Space - , Str "basis" - , Space - , Str "for" - , Space - , Str "the" - , Space - , Str "paper." - , Space - , Str "As" - , Space - , Str "others" - , Space - , Str "have" - , Space - , Str "noted," - , Note - [ Para - [ Str "A" - , Space - , Str "complete" - , Space - , Str "bibliography" - , Space - , Str "will" - , Space - , Str "be" - , Space - , Str "found" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "end" - , Space - , Str "of" - , Space - , Str "this" - , Space - , Str "chapter." - ] - ] - , Space - , Str "this" - , Space - , Str "period" - , Space - , Str "was" - , Space - , Str "a" - , Space - , Str "turning" - , Space - , Str "point" - , Space - , Str "for" - , Space - , Str "Margaret" - , Space - , Str "Mead." - ] ] diff --git a/test/rtf/formatting.native b/test/rtf/formatting.native index 6e5001de3..7035ccb91 100644 --- a/test/rtf/formatting.native +++ b/test/rtf/formatting.native @@ -1,51 +1,45 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "operator" - , MetaInlines - [ Str "John", Space, Str "MacFarlane" ] - ) - ] + Meta + { unMeta = + fromList + [ ( "operator" + , MetaInlines [ Str "John" , Space , Str "MacFarlane" ] + ) + ] } - ) [ Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "test" - , Space - , Str "of" - , Space - , Str "FORMATTING." - , Space - , Str "This" - , Space - , Str "is" - , Space - , Str "hidden:" - , Space - , Str "." - ] - , Para - [ SmallCaps [ Str "Small", Space, Str "Caps" ] ] - , Para - [ Strong [ Str "bold" ] ] - , Para - [ Emph [ Str "italics" ] ] - , Para - [ Strong - [ Str "bold", Space, Emph [ Str "and", Space, Str "italics" ] ] - ] - , Para - [ Underline [ Str "underlined" ] ] - , Para - [ Strikeout [ Str "strikeout" ] ] - , Para - [ Str "x", Superscript [ Str "superscript" ] ] - , Para - [ Str "x", Subscript [ Str "subscript" ] ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "test" + , Space + , Str "of" + , Space + , Str "FORMATTING." + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "hidden:" + , Space + , Str "." + ] + , Para [ SmallCaps [ Str "Small" , Space , Str "Caps" ] ] + , Para [ Strong [ Str "bold" ] ] + , Para [ Emph [ Str "italics" ] ] + , Para + [ Strong + [ Str "bold" + , Space + , Emph [ Str "and" , Space , Str "italics" ] + ] + ] + , Para [ Underline [ Str "underlined" ] ] + , Para [ Strikeout [ Str "strikeout" ] ] + , Para [ Str "x" , Superscript [ Str "superscript" ] ] + , Para [ Str "x" , Subscript [ Str "subscript" ] ] ] diff --git a/test/rtf/heading.native b/test/rtf/heading.native index 27d5d455e..5a076424b 100644 --- a/test/rtf/heading.native +++ b/test/rtf/heading.native @@ -1,14 +1,10 @@ Pandoc - ( Meta { unMeta = fromList [] } ) - [ Header 1 - ( "", [], [] ) - [ Str "Heading", Space, Str "1" ] - , Header 2 - ( "", [], [] ) - [ Str "Heading", Space, Str "2" ] - , Header 3 - ( "", [], [] ) - [ Str "Heading", Space, Str "3" ] - , Para - [ Str "Paragraph" ] + Meta { unMeta = fromList [] } + [ Header + 1 ( "" , [] , [] ) [ Str "Heading" , Space , Str "1" ] + , Header + 2 ( "" , [] , [] ) [ Str "Heading" , Space , Str "2" ] + , Header + 3 ( "" , [] , [] ) [ Str "Heading" , Space , Str "3" ] + , Para [ Str "Paragraph" ] ] diff --git a/test/rtf/image.native b/test/rtf/image.native index 551a0f95c..1efe9d4aa 100644 --- a/test/rtf/image.native +++ b/test/rtf/image.native @@ -1,9 +1,12 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Para - [ Image - ( "", [], [ ( "width", "2.0in" ), ( "height", "2.0in" ) ] ) - [ Str "image" ] - ( "f9d88c3dbe18f6a7f5670e994a947d51216cdf0e.jpg", "" ) - ] + [ Image + ( "" + , [] + , [ ( "width" , "2.0in" ) , ( "height" , "2.0in" ) ] + ) + [ Str "image" ] + ( "f9d88c3dbe18f6a7f5670e994a947d51216cdf0e.jpg" , "" ) + ] ] diff --git a/test/rtf/link.native b/test/rtf/link.native index 9902760e1..63a0d19ff 100644 --- a/test/rtf/link.native +++ b/test/rtf/link.native @@ -1,5 +1,9 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Para - [ Link ( "", [], [] ) [ Str "pandoc" ] ( "http://pandoc.org", "" ) ] + [ Link + ( "" , [] , [] ) + [ Str "pandoc" ] + ( "http://pandoc.org" , "" ) + ] ] diff --git a/test/rtf/list_complex.native b/test/rtf/list_complex.native index 73e2e14f8..9dfd17755 100644 --- a/test/rtf/list_complex.native +++ b/test/rtf/list_complex.native @@ -1,84 +1,64 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "author" - , MetaInlines - [ Str "Cynthia", Space, Str "Johnson" ] - ) - , - ( "operator" - , MetaInlines - [ Str "John", Space, Str "MacFarlane" ] - ) - , - ( "title" - , MetaInlines - [ Str "Text", Space, Str "before", Space, Str "list" ] - ) - ] + Meta + { unMeta = + fromList + [ ( "author" + , MetaInlines [ Str "Cynthia" , Space , Str "Johnson" ] + ) + , ( "operator" + , MetaInlines [ Str "John" , Space , Str "MacFarlane" ] + ) + , ( "title" + , MetaInlines + [ Str "Text" + , Space + , Str "before" + , Space + , Str "list" + ] + ) + ] } - ) [ OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "One" ] ] - , - [ Para - [ Str "Two" ] - , OrderedList - ( 1, LowerAlpha, Period ) - [ - [ Para [ Str "Three" ] ] - , - [ Para - [ Str "Four" ] - , OrderedList - ( 1, LowerRoman, Period ) - [ - [ Para [ Str "Five" ] ] - , - [ Para - [ Str "Six" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "One" ] ] + , [ Para [ Str "Two" ] + , OrderedList + ( 1 , LowerAlpha , Period ) + [ [ Para [ Str "Three" ] ] + , [ Para [ Str "Four" ] , OrderedList - ( 1, UpperAlpha, Period ) - [ - [ Para [ Str "Seven" ] ] - , - [ Para - [ Str "Eight" ] - , OrderedList - ( 1, UpperRoman, Period ) - [ - [ Para [ Str "Nine" ] ] - , - [ Para - [ Str "Ten" ] - , BulletList - [ - [ Para [ Str "Eleven" ] ] - , - [ Para [ Str "Twelve" ] ] + ( 1 , LowerRoman , Period ) + [ [ Para [ Str "Five" ] ] + , [ Para [ Str "Six" ] + , OrderedList + ( 1 , UpperAlpha , Period ) + [ [ Para [ Str "Seven" ] ] + , [ Para [ Str "Eight" ] + , OrderedList + ( 1 , UpperRoman , Period ) + [ [ Para [ Str "Nine" ] ] + , [ Para [ Str "Ten" ] + , BulletList + [ [ Para [ Str "Eleven" ] ] + , [ Para [ Str "Twelve" ] ] + ] + ] + ] + ] ] - ] ] ] - ] ] ] - ] ] ] - ] - , Para - [ Str "Out", Space, Str "of", Space, Str "list!" ] , Para - [ Str "Start", Space, Str "with" ] + [ Str "Out" , Space , Str "of" , Space , Str "list!" ] + , Para [ Str "Start" , Space , Str "with" ] , OrderedList - ( 7, Decimal, Period ) - [ - [ Para [ Str "Seven", Space, Str "Start" ] ] - , - [ Para [ Str "Eight", Space, Str "Continue" ] ] - ] + ( 7 , Decimal , Period ) + [ [ Para [ Str "Seven" , Space , Str "Start" ] ] + , [ Para [ Str "Eight" , Space , Str "Continue" ] ] + ] ] diff --git a/test/rtf/list_simple.native b/test/rtf/list_simple.native index dc5b65b97..10d9dede2 100644 --- a/test/rtf/list_simple.native +++ b/test/rtf/list_simple.native @@ -1,11 +1,10 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ BulletList - [ - [ Para [ Str "one" ] ] - , - [ Para [ Str "two" ], BulletList [ [ Para [ Str "sub" ] ] ] ] - ] - , BulletList - [ [ Para [ Str "new", Space, Str "list" ] ] ] + [ [ Para [ Str "one" ] ] + , [ Para [ Str "two" ] + , BulletList [ [ Para [ Str "sub" ] ] ] + ] + ] + , BulletList [ [ Para [ Str "new" , Space , Str "list" ] ] ] ] diff --git a/test/rtf/table_error_codes.native b/test/rtf/table_error_codes.native index 35d774065..33c143933 100644 --- a/test/rtf/table_error_codes.native +++ b/test/rtf/table_error_codes.native @@ -1,369 +1,422 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Code" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "Error" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocFailOnWarningError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocAppError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocTemplateError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "6" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocOptionError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "21" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocUnknownReaderError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "22" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocUnknownWriterError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "23" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocUnsupportedExtensionError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "24" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocCiteprocError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "31" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocEpubSubdirectoryError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "43" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocPDFError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "44" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocXMLError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "47" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocPDFProgramNotFoundError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "61" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocHttpError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "62" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocShouldNeverHappenError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "63" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocSomeError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "64" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocParseError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "65" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocParsecError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "66" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocMakePDFError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "67" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocSyntaxMapError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "83" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocFilterError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "91" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocMacroLoop" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "92" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocUTF8DecodingError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "93" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocIpynbDecodingError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "94" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocUnsupportedCharsetError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "97" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocCouldNotFindDataFileError" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "99" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "PandocResourceNotFound" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Code" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "Error" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocFailOnWarningError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocAppError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocTemplateError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "6" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocOptionError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "21" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocUnknownReaderError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "22" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocUnknownWriterError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "23" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocUnsupportedExtensionError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "24" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocCiteprocError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "31" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocEpubSubdirectoryError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "43" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocPDFError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "44" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocXMLError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "47" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocPDFProgramNotFoundError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "61" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocHttpError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "62" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocShouldNeverHappenError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "63" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocSomeError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "64" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocParseError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "65" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocParsecError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "66" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocMakePDFError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "67" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocSyntaxMapError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "83" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocFilterError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "91" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocMacroLoop" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "92" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocUTF8DecodingError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "93" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocIpynbDecodingError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "94" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocUnsupportedCharsetError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "97" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocCouldNotFindDataFileError" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "99" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "PandocResourceNotFound" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) ] diff --git a/test/rtf/table_simple.native b/test/rtf/table_simple.native index 05e736829..dce03cf25 100644 --- a/test/rtf/table_simple.native +++ b/test/rtf/table_simple.native @@ -1,68 +1,73 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "A" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "B" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "C" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "D" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "E" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "F" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "G" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Para [ Str "H" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "A" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "B" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "C" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "D" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "E" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "F" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "G" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Para [ Str "H" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) ] diff --git a/test/rtf/unicode.native b/test/rtf/unicode.native index 4e2340b84..ed21b4f47 100644 --- a/test/rtf/unicode.native +++ b/test/rtf/unicode.native @@ -1,3 +1,3 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ Para [ Str "\8220hi\8221\8216hi\8217\61623\945\228" ] ] diff --git a/test/tables-rstsubset.native b/test/tables-rstsubset.native index dce2c9406..ba3fb211a 100644 --- a/test/tables-rstsubset.native +++ b/test/tables-rstsubset.native @@ -1,913 +1,973 @@ [ Para - [ Str "Simple", Space, Str "table", Space, Str "with", Space, Str "caption:" ] -, Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Demonstration" - , Space - , Str "of" - , Space - , Str "simple" - , Space - , Str "table" - , Space - , Str "syntax." - ] + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "caption:" ] - ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] +, Table + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ]) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Simple" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "caption:" - ] + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Simple" - , Space - , Str "table" - , Space - , Str "indented" - , Space - , Str "two" - , Space - , Str "spaces:" - ] -, Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Demonstration" - , Space - , Str "of" - , Space - , Str "simple" - , Space - , Str "table" - , Space - , Str "syntax." - ] + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "indented" + , Space + , Str "two" + , Space + , Str "spaces:" ] - ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] +, Table + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ]) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Multiline" - , Space - , Str "table" - , Space - , Str "with" - , Space - , Str "caption:" - ] -, Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Here\8217s" - , Space - , Str "the" - , Space - , Str "caption." - , Space - , Str "It" - , Space - , Str "may" - , Space - , Str "span" - , Space - , Str "multiple" - , Space - , Str "lines." - ] + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "caption:" ] - ) - [ - ( AlignDefault, ColWidth 0.15 ) - , - ( AlignDefault, ColWidth 0.1375 ) - , - ( AlignDefault, ColWidth 0.1625 ) - , - ( AlignDefault, ColWidth 0.35 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Centered", SoftBreak, Str "Header" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left", SoftBreak, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right", SoftBreak, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default", Space, Str "aligned" ] ] - ] +, Table + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "caption." + , Space + , Str "It" + , Space + , Str "may" + , Space + , Str "span" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ]) + [ ( AlignDefault , ColWidth 0.15 ) + , ( AlignDefault , ColWidth 0.1375 ) + , ( AlignDefault , ColWidth 0.1625 ) + , ( AlignDefault , ColWidth 0.35 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "First" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "row" - , Space - , Str "that" - , SoftBreak - , Str "spans" - , Space - , Str "multiple" - , Space - , Str "lines." - ] - ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Second" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Here\8217s" - , Space - , Str "another" - , Space - , Str "one." - , Space - , Str "Note" - , SoftBreak - , Str "the" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "between" - , SoftBreak - , Str "rows." - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Centered" , SoftBreak , Str "Header" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" , SoftBreak , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" , SoftBreak , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" , Space , Str "aligned" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "First" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , SoftBreak + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Second" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , SoftBreak + , Str "rows." + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Multiline" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "caption:" - ] + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.15 ) - , - ( AlignDefault, ColWidth 0.1375 ) - , - ( AlignDefault, ColWidth 0.1625 ) - , - ( AlignDefault, ColWidth 0.35 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Centered", SoftBreak, Str "Header" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left", SoftBreak, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right", SoftBreak, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default", Space, Str "aligned" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.15 ) + , ( AlignDefault , ColWidth 0.1375 ) + , ( AlignDefault , ColWidth 0.1625 ) + , ( AlignDefault , ColWidth 0.35 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "First" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "row" - , Space - , Str "that" - , SoftBreak - , Str "spans" - , Space - , Str "multiple" - , Space - , Str "lines." - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Centered" , SoftBreak , Str "Header" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" , SoftBreak , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" , SoftBreak , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" , Space , Str "aligned" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "First" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , SoftBreak + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Second" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , SoftBreak + , Str "rows." + ] + ] + ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Second" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Here\8217s" - , Space - , Str "another" - , Space - , Str "one." - , Space - , Str "Note" - , SoftBreak - , Str "the" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "between" - , SoftBreak - , Str "rows." - ] - ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Table" - , Space - , Str "without" - , Space - , Str "column" - , Space - , Str "headers:" - ] + [ Str "Table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + , Cell ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Multiline" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "column" - , Space - , Str "headers:" - ] + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidth 0.15 ) - , - ( AlignDefault, ColWidth 0.1375 ) - , - ( AlignDefault, ColWidth 0.1625 ) - , - ( AlignDefault, ColWidth 0.35 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "First" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "row" - , Space - , Str "that" - , SoftBreak - , Str "spans" - , Space - , Str "multiple" - , Space - , Str "lines." - ] - ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Second" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Here\8217s" - , Space - , Str "another" - , Space - , Str "one." - , Space - , Str "Note" - , SoftBreak - , Str "the" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "between" - , SoftBreak - , Str "rows." - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidth 0.15 ) + , ( AlignDefault , ColWidth 0.1375 ) + , ( AlignDefault , ColWidth 0.1625 ) + , ( AlignDefault , ColWidth 0.35 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "First" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , SoftBreak + , Str "spans" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Second" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , SoftBreak + , Str "rows." + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] diff --git a/test/tables.native b/test/tables.native index c3a2537cb..de46ce368 100644 --- a/test/tables.native +++ b/test/tables.native @@ -1,891 +1,964 @@ [ Para - [ Str "Simple", Space, Str "table", Space, Str "with", Space, Str "caption:" ] -, Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Demonstration" - , Space - , Str "of" - , Space - , Str "simple" - , Space - , Str "table" - , Space - , Str "syntax." - ] + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "caption:" ] - ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] +, Table + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ]) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Simple" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "caption:" - ] + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Simple" - , Space - , Str "table" - , Space - , Str "indented" - , Space - , Str "two" - , Space - , Str "spaces:" - ] -, Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Demonstration" - , Space - , Str "of" - , Space - , Str "simple" - , Space - , Str "table" - , Space - , Str "syntax." - ] + [ Str "Simple" + , Space + , Str "table" + , Space + , Str "indented" + , Space + , Str "two" + , Space + , Str "spaces:" ] - ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Center" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default" ] ] - ] +, Table + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Demonstration" + , Space + , Str "of" + , Space + , Str "simple" + , Space + , Str "table" + , Space + , Str "syntax." + ] + ]) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Center" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Multiline" - , Space - , Str "table" - , Space - , Str "with" - , Space - , Str "caption:" - ] -, Table - ( "", [], [] ) - ( Caption Nothing - [ Plain - [ Str "Here\8217s" - , Space - , Str "the" - , Space - , Str "caption." - , SoftBreak - , Str "It" - , Space - , Str "may" - , Space - , Str "span" - , Space - , Str "multiple" - , Space - , Str "lines." - ] + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "with" + , Space + , Str "caption:" ] - ) - [ - ( AlignCenter, ColWidth 0.15 ) - , - ( AlignLeft, ColWidth 0.1375 ) - , - ( AlignRight, ColWidth 0.1625 ) - , - ( AlignLeft, ColWidth 0.35 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Centered", SoftBreak, Str "Header" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left", SoftBreak, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right", SoftBreak, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default", Space, Str "aligned" ] ] - ] +, Table + ( "" , [] , [] ) + (Caption + Nothing + [ Plain + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "caption." + , SoftBreak + , Str "It" + , Space + , Str "may" + , Space + , Str "span" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ]) + [ ( AlignCenter , ColWidth 0.15 ) + , ( AlignLeft , ColWidth 0.1375 ) + , ( AlignRight , ColWidth 0.1625 ) + , ( AlignLeft , ColWidth 0.35 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "First" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "row" - , Space - , Str "that" - , Space - , Str "spans" - , SoftBreak - , Str "multiple" - , Space - , Str "lines." - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Centered" , SoftBreak , Str "Header" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" , SoftBreak , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" , SoftBreak , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" , Space , Str "aligned" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "First" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , SoftBreak + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Second" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Second" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Here\8217s" - , Space - , Str "another" - , Space - , Str "one." - , Space - , Str "Note" - , SoftBreak - , Str "the" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "between" - , Space - , Str "rows." - ] - ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Multiline" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "caption:" - ] + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "caption:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidth 0.15 ) - , - ( AlignLeft, ColWidth 0.1375 ) - , - ( AlignRight, ColWidth 0.1625 ) - , - ( AlignLeft, ColWidth 0.35 ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Centered", SoftBreak, Str "Header" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Left", SoftBreak, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Right", SoftBreak, Str "Aligned" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Default", Space, Str "aligned" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidth 0.15 ) + , ( AlignLeft , ColWidth 0.1375 ) + , ( AlignRight , ColWidth 0.1625 ) + , ( AlignLeft , ColWidth 0.35 ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "First" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "row" - , Space - , Str "that" - , Space - , Str "spans" - , SoftBreak - , Str "multiple" - , Space - , Str "lines." - ] - ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Second" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Here\8217s" - , Space - , Str "another" - , Space - , Str "one." - , Space - , Str "Note" - , SoftBreak - , Str "the" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "between" - , Space - , Str "rows." - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Centered" , SoftBreak , Str "Header" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Left" , SoftBreak , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Right" , SoftBreak , Str "Aligned" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Default" , Space , Str "aligned" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "First" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , SoftBreak + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Second" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Table" - , Space - , Str "without" - , Space - , Str "column" - , Space - , Str "headers:" - ] + [ Str "Table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignRight, ColWidthDefault ) - , - ( AlignLeft, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "123" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "123" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "Multiline" - , Space - , Str "table" - , Space - , Str "without" - , Space - , Str "column" - , Space - , Str "headers:" - ] + [ Str "Multiline" + , Space + , Str "table" + , Space + , Str "without" + , Space + , Str "column" + , Space + , Str "headers:" + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidth 0.15 ) - , - ( AlignLeft, ColWidth 0.1375 ) - , - ( AlignRight, ColWidth 0.1625 ) - , - ( AlignDefault, ColWidth 0.35 ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "First" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "12.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "row" - , Space - , Str "that" - , Space - , Str "spans" - , SoftBreak - , Str "multiple" - , Space - , Str "lines." - ] - ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Second" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "row" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5.0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Here\8217s" - , Space - , Str "another" - , Space - , Str "one." - , Space - , Str "Note" - , SoftBreak - , Str "the" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "between" - , Space - , Str "rows." - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidth 0.15 ) + , ( AlignLeft , ColWidth 0.1375 ) + , ( AlignRight , ColWidth 0.1625 ) + , ( AlignDefault , ColWidth 0.35 ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "First" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "12.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "row" + , Space + , Str "that" + , Space + , Str "spans" + , SoftBreak + , Str "multiple" + , Space + , Str "lines." + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Second" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "row" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5.0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Here\8217s" + , Space + , Str "another" + , Space + , Str "one." + , Space + , Str "Note" + , SoftBreak + , Str "the" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "rows." + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] diff --git a/test/testsuite.native b/test/testsuite.native index d6b91ca69..5f9be452f 100644 --- a/test/testsuite.native +++ b/test/testsuite.native @@ -1,632 +1,509 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "author" - , MetaList - [ MetaInlines - [ Str "John", Space, Str "MacFarlane" ] - , MetaInlines - [ Str "Anonymous" ] + Meta + { unMeta = + fromList + [ ( "author" + , MetaList + [ MetaInlines [ Str "John" , Space , Str "MacFarlane" ] + , MetaInlines [ Str "Anonymous" ] + ] + ) + , ( "date" + , MetaInlines + [ Str "July" , Space , Str "17," , Space , Str "2006" ] + ) + , ( "title" + , MetaInlines + [ Str "Pandoc" + , Space + , Str "Test" + , Space + , Str "Suite" + ] + ) ] - ) - , - ( "date" - , MetaInlines - [ Str "July", Space, Str "17,", Space, Str "2006" ] - ) - , - ( "title" - , MetaInlines - [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] - ) - ] } - ) [ 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 "Most" - , Space - , Str "of" - , Space - , Str "them" - , Space - , Str "are" - , Space - , Str "adapted" - , Space - , Str "from" - , SoftBreak - , 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-embedded-link", [], [] ) - [ Str "Level" - , Space - , Str "2" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "embedded", Space, Str "link" ] - ( "/url", "" ) - ] - , Header 3 - ( "level-3-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "3" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 4 - ( "level-4", [], [] ) - [ Str "Level", Space, Str "4" ] - , Header 5 - ( "level-5", [], [] ) - [ Str "Level", Space, Str "5" ] - , Header 1 - ( "level-1", [], [] ) - [ Str "Level", Space, Str "1" ] - , Header 2 - ( "level-2-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "2" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 3 - ( "level-3", [], [] ) - [ Str "Level", Space, Str "3" ] - , Para - [ Str "with" - , Space - , Str "no" - , Space - , Str "blank" - , Space - , Str "line" - ] - , Header 2 - ( "level-2", [], [] ) - [ Str "Level", Space, Str "2" ] - , Para - [ Str "with" - , Space - , Str "no" - , Space - , Str "blank" - , Space - , Str "line" - ] + [ 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 "Most" + , Space + , Str "of" + , Space + , Str "them" + , Space + , Str "are" + , Space + , Str "adapted" + , Space + , Str "from" + , SoftBreak + , Str "John" + , Space + , Str "Gruber\8217s" + , Space + , Str "markdown" + , Space + , Str "test" + , Space + , Str "suite." + ] , HorizontalRule - , Header 1 - ( "paragraphs", [], [] ) - [ Str "Paragraphs" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "regular" - , Space - , Str "paragraph." - ] - , Para - [ Str "In" - , Space - , Str "Markdown" - , Space - , Str "1.0.0" - , Space - , Str "and" - , Space - , Str "earlier." - , Space - , Str "Version" - , SoftBreak - , Str "8." - , Space - , Str "This" - , Space - , Str "line" - , Space - , Str "turns" - , Space - , Str "into" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - , SoftBreak - , Str "Because" - , Space - , Str "a" - , Space - , Str "hard-wrapped" - , Space - , Str "line" - , Space - , Str "in" - , Space - , Str "the" - , SoftBreak - , Str "middle" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "paragraph" - , Space - , Str "looked" - , Space - , Str "like" - , Space - , Str "a" - , SoftBreak - , Str "list" - , Space - , Str "item." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "bullet." - , SoftBreak - , Str "*" - , Space - , Str "criminey." - ] - , Para - [ Str "There" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "hard" - , Space - , Str "line" - , Space - , Str "break" - , LineBreak - , Str "here." - ] + , Header 1 ( "headers" , [] , [] ) [ Str "Headers" ] + , 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" ] + ( "/url" , "" ) + ] + , Header + 3 + ( "level-3-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 4 ( "level-4" , [] , [] ) [ Str "Level" , Space , Str "4" ] + , Header + 5 ( "level-5" , [] , [] ) [ Str "Level" , Space , Str "5" ] + , Header + 1 ( "level-1" , [] , [] ) [ Str "Level" , Space , Str "1" ] + , Header + 2 + ( "level-2-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 3 ( "level-3" , [] , [] ) [ Str "Level" , Space , Str "3" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Header + 2 ( "level-2" , [] , [] ) [ Str "Level" , Space , Str "2" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] , HorizontalRule - , Header 1 - ( "block-quotes", [], [] ) - [ Str "Block", Space, Str "Quotes" ] + , Header 1 ( "paragraphs" , [] , [] ) [ Str "Paragraphs" ] , Para - [ Str "E-mail", Space, Str "style:" ] - , BlockQuote - [ Para - [ Str "This" + [ Str "Here\8217s" , Space - , Str "is" + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , SoftBreak + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" , Space , Str "a" , Space - , Str "block" + , Str "list" , Space - , Str "quote." + , Str "item." , SoftBreak - , Str "It" + , Str "Because" , Space - , Str "is" + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" + , Space + , Str "in" + , Space + , Str "the" + , SoftBreak + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , SoftBreak + , Str "list" , Space - , Str "pretty" + , Str "item." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , SoftBreak + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" , Space - , Str "short." + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" + , LineBreak + , Str "here." + ] + , HorizontalRule + , Header + 1 + ( "block-quotes" , [] , [] ) + [ Str "Block" , Space , Str "Quotes" ] + , Para [ Str "E-mail" , Space , Str "style:" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , SoftBreak + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] ] - ] , BlockQuote - [ Para - [ Str "Code" + [ Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + , Para [ Str "A" , Space , Str "list:" ] + , OrderedList + ( 1 , Decimal , Period ) + [ [ Plain [ Str "item" , Space , Str "one" ] ] + , [ Plain [ Str "item" , Space , Str "two" ] ] + ] + , Para + [ Str "Nested" + , Space + , Str "block" + , Space + , Str "quotes:" + ] + , BlockQuote [ Para [ Str "nested" ] ] + , BlockQuote [ Para [ Str "nested" ] ] + ] + , Para + [ Str "This" , Space - , Str "in" + , Str "should" + , Space + , Str "not" + , Space + , Str "be" , Space , Str "a" , Space , Str "block" , Space , Str "quote:" + , Space + , Str "2" + , SoftBreak + , Str ">" + , Space + , Str "1." ] - , CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - , Para - [ Str "A", Space, Str "list:" ] - , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "item", Space, Str "one" ] ] - , - [ Plain [ Str "item", Space, Str "two" ] ] - ] - , Para - [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] - , BlockQuote - [ Para [ Str "nested" ] ] - , BlockQuote - [ Para [ Str "nested" ] ] - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "block" - , Space - , Str "quote:" - , Space - , Str "2" - , SoftBreak - , Str ">" - , Space - , Str "1." - ] - , Para - [ Str "And" - , Space - , Str "a" - , Space - , Str "following" - , Space - , Str "paragraph." - ] - , HorizontalRule - , Header 1 - ( "code-blocks", [], [] ) - [ Str "Code", Space, Str "Blocks" ] , Para - [ Str "Code:" ] + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] + , HorizontalRule + , Header + 1 + ( "code-blocks" , [] , [] ) + [ Str "Code" , Space , Str "Blocks" ] + , Para [ Str "Code:" ] , CodeBlock - ( "" - , [] - , [] - ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" - , Para - [ Str "And:" ] + ( "" , [] , [] ) + "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + , Para [ Str "And:" ] , CodeBlock - ( "" - , [] - , [] - ) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + ( "" , [] , [] ) + " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" , HorizontalRule - , Header 1 - ( "lists", [], [] ) - [ Str "Lists" ] - , Header 2 - ( "unordered", [], [] ) - [ Str "Unordered" ] - , Para - [ Str "Asterisks", Space, Str "tight:" ] + , Header 1 ( "lists" , [] , [] ) [ Str "Lists" ] + , Header 2 ( "unordered" , [] , [] ) [ Str "Unordered" ] + , Para [ Str "Asterisks" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "asterisk", Space, Str "1" ] ] - , - [ Plain [ Str "asterisk", Space, Str "2" ] ] - , - [ Plain [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Asterisks", Space, Str "loose:" ] + [ [ Plain [ Str "asterisk" , Space , Str "1" ] ] + , [ Plain [ Str "asterisk" , Space , Str "2" ] ] + , [ Plain [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Asterisks" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "asterisk", Space, Str "1" ] ] - , - [ Para [ Str "asterisk", Space, Str "2" ] ] - , - [ Para [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "tight:" ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "Plus", Space, Str "1" ] ] - , - [ Plain [ Str "Plus", Space, Str "2" ] ] - , - [ Plain [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "loose:" ] + [ [ Plain [ Str "Plus" , Space , Str "1" ] ] + , [ Plain [ Str "Plus" , Space , Str "2" ] ] + , [ Plain [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Plus", Space, Str "1" ] ] - , - [ Para [ Str "Plus", Space, Str "2" ] ] - , - [ Para [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "tight:" ] + [ [ Para [ Str "Plus" , Space , Str "1" ] ] + , [ Para [ Str "Plus" , Space , Str "2" ] ] + , [ Para [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "Minus", Space, Str "1" ] ] - , - [ Plain [ Str "Minus", Space, Str "2" ] ] - , - [ Plain [ Str "Minus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "loose:" ] + [ [ Plain [ Str "Minus" , Space , Str "1" ] ] + , [ Plain [ Str "Minus" , Space , Str "2" ] ] + , [ Plain [ Str "Minus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Minus", Space, Str "1" ] ] - , - [ Para [ Str "Minus", Space, Str "2" ] ] - , - [ Para [ Str "Minus", Space, Str "3" ] ] - ] - , Header 2 - ( "ordered", [], [] ) - [ Str "Ordered" ] - , Para - [ Str "Tight:" ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] + ] + , Header 2 ( "ordered" , [] , [] ) [ Str "Ordered" ] + , Para [ Str "Tight:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "First" ] ] - , - [ Plain [ Str "Second" ] ] - , - [ Plain [ Str "Third" ] ] - ] - , Para - [ Str "and:" ] + ( 1 , Decimal , Period ) + [ [ Plain [ Str "First" ] ] + , [ Plain [ Str "Second" ] ] + , [ Plain [ Str "Third" ] ] + ] + , Para [ Str "and:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "One" ] ] - , - [ Plain [ Str "Two" ] ] - , - [ Plain [ Str "Three" ] ] - ] - , Para - [ Str "Loose", Space, Str "using", Space, Str "tabs:" ] + ( 1 , Decimal , Period ) + [ [ Plain [ Str "One" ] ] + , [ Plain [ Str "Two" ] ] + , [ Plain [ Str "Three" ] ] + ] + , Para + [ Str "Loose" , Space , Str "using" , Space , Str "tabs:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para [ Str "Second" ] ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "and", Space, Str "using", Space, Str "spaces:" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second" ] ] + , [ Para [ Str "Third" ] ] + ] + , Para + [ Str "and" , Space , Str "using" , Space , Str "spaces:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "One" ] ] - , - [ Para [ Str "Two" ] ] - , - [ Para [ Str "Three" ] ] - ] - , Para - [ Str "Multiple", Space, Str "paragraphs:" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "One" ] ] + , [ Para [ Str "Two" ] ] + , [ Para [ Str "Three" ] ] + ] + , Para [ Str "Multiple" , Space , Str "paragraphs:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para - [ Str "Item" - , Space - , Str "1," - , Space - , Str "graf" - , Space - , Str "one." - ] - , Para - [ Str "Item" - , Space - , Str "1." - , Space - , Str "graf" - , Space - , Str "two." - , Space - , Str "The" - , Space - , Str "quick" - , Space - , Str "brown" - , Space - , Str "fox" - , Space - , Str "jumped" - , Space - , Str "over" - , Space - , Str "the" - , Space - , Str "lazy" - , Space - , Str "dog\8217s" - , SoftBreak - , Str "back." + ( 1 , Decimal , Period ) + [ [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , SoftBreak + , Str "back." + ] ] + , [ Para [ Str "Item" , Space , Str "2." ] ] + , [ Para [ Str "Item" , Space , Str "3." ] ] ] - , - [ Para [ Str "Item", Space, Str "2." ] ] - , - [ Para [ Str "Item", Space, Str "3." ] ] - ] - , Header 2 - ( "nested", [], [] ) - [ Str "Nested" ] + , Header 2 ( "nested" , [] , [] ) [ Str "Nested" ] , BulletList - [ - [ Plain - [ Str "Tab" ] - , BulletList - [ - [ Plain - [ Str "Tab" ] - , BulletList - [ [ Plain [ Str "Tab" ] ] ] - ] + [ [ Plain [ Str "Tab" ] + , BulletList + [ [ Plain [ Str "Tab" ] + , BulletList [ [ Plain [ Str "Tab" ] ] ] + ] + ] ] ] - ] - , Para - [ Str "Here\8217s", Space, Str "another:" ] + , Para [ Str "Here\8217s" , Space , Str "another:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "First" ] ] - , - [ Plain - [ Str "Second:" ] - , BulletList - [ - [ Plain [ Str "Fee" ] ] - , - [ Plain [ Str "Fie" ] ] - , - [ Plain [ Str "Foe" ] ] + ( 1 , Decimal , Period ) + [ [ Plain [ Str "First" ] ] + , [ Plain [ Str "Second:" ] + , BulletList + [ [ Plain [ Str "Fee" ] ] + , [ Plain [ Str "Fie" ] ] + , [ Plain [ Str "Foe" ] ] + ] ] + , [ Plain [ Str "Third" ] ] + ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" ] - , - [ Plain [ Str "Third" ] ] - ] - , Para - [ Str "Same" - , Space - , Str "thing" - , Space - , Str "but" - , Space - , Str "with" - , Space - , Str "paragraphs:" - ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Plain [ Str "Fee" ] ] - , - [ Plain [ Str "Fie" ] ] - , - [ Plain [ Str "Foe" ] ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Plain [ Str "Fee" ] ] + , [ Plain [ Str "Fie" ] ] + , [ Plain [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] ] - , - [ Para [ Str "Third" ] ] - ] - , Header 2 - ( "tabs-and-spaces", [], [] ) - [ Str "Tabs", Space, Str "and", Space, Str "spaces" ] + , Header + 2 + ( "tabs-and-spaces" , [] , [] ) + [ Str "Tabs" , Space , Str "and" , Space , Str "spaces" ] , BulletList - [ - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , SoftBreak - , Str "indented" - , Space - , Str "with" - , Space - , Str "tabs" - ] - ] - , - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , SoftBreak - , Str "indented" - , Space - , Str "with" - , Space - , Str "spaces" - ] - , BulletList - [ - [ Para + [ [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -638,16 +515,13 @@ Pandoc , Space , Str "tabs" ] - ] - , - [ Para + ] + , [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -659,1833 +533,1702 @@ Pandoc , Space , Str "spaces" ] - ] + , BulletList + [ [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + ] + ] ] ] - ] - , Header 2 - ( "fancy-list-markers", [], [] ) - [ Str "Fancy", Space, Str "list", Space, Str "markers" ] + , Header + 2 + ( "fancy-list-markers" , [] , [] ) + [ Str "Fancy" , Space , Str "list" , Space , Str "markers" ] , OrderedList - ( 2, Decimal, TwoParens ) - [ - [ Para [ Str "begins", Space, Str "with", Space, Str "2" ] ] - , - [ Para - [ Str "and", Space, Str "now", Space, Str "3" ] - , Para - [ Str "with", Space, Str "a", Space, Str "continuation" ] - , OrderedList - ( 4, LowerRoman, Period ) - [ - [ Plain - [ Str "sublist" - , Space - , Str "with" - , Space - , Str "roman" - , Space - , Str "numerals," - , SoftBreak - , Str "starting" + ( 2 , Decimal , TwoParens ) + [ [ Para + [ Str "begins" , Space , Str "with" , Space , Str "2" ] + ] + , [ Para [ Str "and" , Space , Str "now" , Space , Str "3" ] + , Para + [ Str "with" , Space - , Str "with" + , Str "a" , Space - , Str "4" + , Str "continuation" ] - ] - , - [ Plain - [ Str "more", Space, Str "items" ] - , OrderedList - ( 1, UpperAlpha, TwoParens ) - [ - [ Plain [ Str "a", Space, Str "subsublist" ] ] - , - [ Plain [ Str "a", Space, Str "subsublist" ] ] + , OrderedList + ( 4 , LowerRoman , Period ) + [ [ Plain + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , SoftBreak + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" + ] + ] + , [ Plain [ Str "more" , Space , Str "items" ] + , OrderedList + ( 1 , UpperAlpha , TwoParens ) + [ [ Plain [ Str "a" , Space , Str "subsublist" ] ] + , [ Plain [ Str "a" , Space , Str "subsublist" ] ] + ] + ] ] - ] ] ] - ] - , Para - [ Str "Nesting:" ] + , Para [ Str "Nesting:" ] , OrderedList - ( 1, UpperAlpha, Period ) - [ - [ Plain - [ Str "Upper", Space, Str "Alpha" ] - , OrderedList - ( 1, UpperRoman, Period ) - [ - [ Plain - [ Str "Upper", Space, Str "Roman." ] - , OrderedList - ( 6, Decimal, TwoParens ) - [ - [ Plain - [ Str "Decimal" - , Space - , Str "start" - , Space - , Str "with" - , Space - , Str "6" - ] + ( 1 , UpperAlpha , Period ) + [ [ Plain [ Str "Upper" , Space , Str "Alpha" ] + , OrderedList + ( 1 , UpperRoman , Period ) + [ [ Plain [ Str "Upper" , Space , Str "Roman." ] , OrderedList - ( 3, LowerAlpha, OneParen ) - [ - [ Plain - [ Str "Lower" - , Space - , Str "alpha" - , Space - , Str "with" - , Space - , Str "paren" + ( 6 , Decimal , TwoParens ) + [ [ Plain + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3 , LowerAlpha , OneParen ) + [ [ Plain + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] ] ] - ] ] ] - ] ] ] - ] - , Para - [ Str "Autonumbering:" ] + , Para [ Str "Autonumbering:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Autonumber." ] ] - , - [ Plain - [ Str "More." ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Plain [ Str "Nested." ] ] ] - ] - ] - , Para - [ Str "Should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item:" - ] - , Para - [ Str "M.A.\160\&2007" ] - , Para - [ Str "B.", Space, Str "Williams" ] - , HorizontalRule - , Header 1 - ( "definition-lists", [], [] ) - [ Str "Definition", Space, Str "Lists" ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Autonumber." ] ] + , [ Plain [ Str "More." ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Nested." ] ] ] + ] + ] , Para - [ Str "Tight", Space, Str "using", Space, Str "spaces:" ] - , DefinitionList - [ - ( - [ Str "apple" ] - , - [ [ Plain [ Str "red", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "orange" ] - , - [ [ Plain [ Str "orange", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "banana" ] - , - [ [ Plain [ Str "yellow", Space, Str "fruit" ] ] ] - ) - ] - , Para - [ Str "Tight", Space, Str "using", Space, Str "tabs:" ] - , DefinitionList - [ - ( - [ Str "apple" ] - , - [ [ Plain [ Str "red", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "orange" ] - , - [ [ Plain [ Str "orange", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "banana" ] - , - [ [ Plain [ Str "yellow", Space, Str "fruit" ] ] ] - ) - ] - , Para - [ Str "Loose:" ] - , DefinitionList - [ - ( - [ Str "apple" ] - , - [ [ Para [ Str "red", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "orange" ] - , - [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] - ) - , - ( - [ Str "banana" ] - , - [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] - ) - ] - , Para - [ Str "Multiple" - , Space - , Str "blocks" - , Space - , Str "with" - , Space - , Str "italics:" - ] + [ Str "Should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item:" + ] + , Para [ Str "M.A.\160\&2007" ] + , Para [ Str "B." , Space , Str "Williams" ] + , HorizontalRule + , Header + 1 + ( "definition-lists" , [] , [] ) + [ Str "Definition" , Space , Str "Lists" ] + , Para + [ Str "Tight" + , Space + , Str "using" + , Space + , Str "spaces:" + ] , DefinitionList - [ - ( - [ Emph [ Str "apple" ] ] - , - [ - [ Para - [ Str "red", Space, Str "fruit" ] - , Para - [ Str "contains" - , Space - , Str "seeds," - , SoftBreak - , Str "crisp," - , Space - , Str "pleasant" - , Space - , Str "to" - , Space - , Str "taste" + [ ( [ Str "apple" ] + , [ [ Plain [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Plain [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Plain [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Tight" , Space , Str "using" , Space , Str "tabs:" ] + , DefinitionList + [ ( [ Str "apple" ] + , [ [ Plain [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Plain [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Plain [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para [ Str "Loose:" ] + , DefinitionList + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Para [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "with" + , Space + , Str "italics:" + ] + , DefinitionList + [ ( [ Emph [ Str "apple" ] ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] + , Para + [ Str "contains" + , Space + , Str "seeds," + , SoftBreak + , Str "crisp," + , Space + , Str "pleasant" + , Space + , Str "to" + , Space + , Str "taste" + ] ] ] - ] - ) - , - ( - [ Emph [ Str "orange" ] ] - , - [ - [ Para - [ Str "orange", Space, Str "fruit" ] - , CodeBlock - ( "", [], [] ) "{ orange code block }" - , BlockQuote - [ Para - [ Str "orange", Space, Str "block", Space, Str "quote" ] + ) + , ( [ Emph [ Str "orange" ] ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , CodeBlock ( "" , [] , [] ) "{ orange code block }" + , BlockQuote + [ Para + [ Str "orange" + , Space + , Str "block" + , Space + , Str "quote" + ] + ] ] ] - ] - ) - ] + ) + ] , Para - [ Str "Multiple", Space, Str "definitions,", Space, Str "tight:" ] + [ Str "Multiple" + , Space + , Str "definitions," + , Space + , Str "tight:" + ] , DefinitionList - [ - ( - [ Str "apple" ] - , - [ - [ Plain [ Str "red", Space, Str "fruit" ] ] - , - [ Plain [ Str "computer" ] ] - ] - ) - , - ( - [ Str "orange" ] - , - [ - [ Plain [ Str "orange", Space, Str "fruit" ] ] - , - [ Plain [ Str "bank" ] ] - ] - ) - ] + [ ( [ Str "apple" ] + , [ [ Plain [ Str "red" , Space , Str "fruit" ] ] + , [ Plain [ Str "computer" ] ] + ] + ) + , ( [ Str "orange" ] + , [ [ Plain [ Str "orange" , Space , Str "fruit" ] ] + , [ Plain [ Str "bank" ] ] + ] + ) + ] , Para - [ Str "Multiple", Space, Str "definitions,", Space, Str "loose:" ] + [ Str "Multiple" + , Space + , Str "definitions," + , Space + , Str "loose:" + ] , DefinitionList - [ - ( - [ Str "apple" ] - , - [ - [ Para [ Str "red", Space, Str "fruit" ] ] - , - [ Para [ Str "computer" ] ] - ] - ) - , - ( - [ Str "orange" ] - , - [ - [ Para [ Str "orange", Space, Str "fruit" ] ] - , - [ Para [ Str "bank" ] ] - ] - ) - ] - , Para - [ Str "Blank" - , Space - , Str "line" - , Space - , Str "after" - , Space - , Str "term," - , Space - , Str "indented" - , Space - , Str "marker," - , Space - , Str "alternate" - , Space - , Str "markers:" - ] + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] + , [ Para [ Str "computer" ] ] + ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] ] + , [ Para [ Str "bank" ] ] + ] + ) + ] + , Para + [ Str "Blank" + , Space + , Str "line" + , Space + , Str "after" + , Space + , Str "term," + , Space + , Str "indented" + , Space + , Str "marker," + , Space + , Str "alternate" + , Space + , Str "markers:" + ] , DefinitionList - [ - ( - [ Str "apple" ] - , - [ - [ Para [ Str "red", Space, Str "fruit" ] ] - , - [ Para [ Str "computer" ] ] - ] - ) - , - ( - [ Str "orange" ] - , - [ - [ Para - [ Str "orange", Space, Str "fruit" ] - , OrderedList - ( 1, Decimal, Period ) - [ [ Plain [ Str "sublist" ] ], [ Plain [ Str "sublist" ] ] ] + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] + , [ Para [ Str "computer" ] ] ] - ] - ) - ] - , Header 1 - ( "html-blocks", [], [] ) - [ Str "HTML", Space, Str "Blocks" ] - , Para - [ Str "Simple" - , Space - , Str "block" - , Space - , Str "on" - , Space - , Str "one" - , Space - , Str "line:" - ] - , Div - ( "", [], [] ) - [ Plain [ Str "foo" ] ] - , Para - [ Str "And" - , Space - , Str "nested" - , Space - , Str "without" - , Space - , Str "indentation:" - ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , OrderedList + ( 1 , Decimal , Period ) + [ [ Plain [ Str "sublist" ] ] + , [ Plain [ Str "sublist" ] ] + ] + ] + ] + ) + ] + , Header + 1 + ( "html-blocks" , [] , [] ) + [ Str "HTML" , Space , Str "Blocks" ] + , Para + [ Str "Simple" + , Space + , Str "block" + , Space + , Str "on" + , Space + , Str "one" + , Space + , Str "line:" + ] + , Div ( "" , [] , [] ) [ Plain [ Str "foo" ] ] + , Para + [ Str "And" + , Space + , Str "nested" + , Space + , Str "without" + , Space + , Str "indentation:" + ] , Div - ( "", [], [] ) - [ Div - ( "", [], [] ) - [ Div ( "", [], [] ) [ Para [ Str "foo" ] ] ] - , Div - ( "", [], [] ) - [ Plain [ Str "bar" ] ] - ] - , Para - [ Str "Interpreted" - , Space - , Str "markdown" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "table:" - ] - , RawBlock - ( Format "html" ) "" - , RawBlock - ( Format "html" ) "" - , RawBlock - ( Format "html" ) "" + , RawBlock (Format "html") "" + , RawBlock (Format "html") "
" + ( "" , [] , [] ) + [ Div + ( "" , [] , [] ) + [ Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] ] + , Div ( "" , [] , [] ) [ Plain [ Str "bar" ] ] + ] + , Para + [ Str "Interpreted" + , Space + , Str "markdown" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "table:" + ] + , RawBlock (Format "html") "" + , RawBlock (Format "html") "" + , RawBlock (Format "html") "" - , RawBlock - ( Format "html" ) "" + , RawBlock (Format "html") "" - , RawBlock - ( Format "html" ) "" - , RawBlock - ( Format "html" ) "
" , Plain - [ Str "This", Space, Str "is", Space, Emph [ Str "emphasized" ] ] - , RawBlock - ( Format "html" ) "" + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + ] + , RawBlock (Format "html") "" , Plain - [ Str "And" - , Space - , Str "this" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - ] - , RawBlock - ( Format "html" ) "
" + [ Str "And" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + ] + , RawBlock (Format "html") "
" , RawBlock - ( Format "html" ) "" - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "simple" - , Space - , Str "block:" - ] - , Div - ( "", [], [] ) - [ Para [ Str "foo" ] ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "code" - , Space - , Str "block," - , Space - , Str "though:" - ] - , CodeBlock - ( "", [], [] ) "
\n foo\n
" + (Format "html") + "" , Para - [ Str "As", Space, Str "should", Space, Str "this:" ] - , CodeBlock - ( "", [], [] ) "
foo
" + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "simple" + , Space + , Str "block:" + ] + , Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] , Para - [ Str "Now,", Space, Str "nested:" ] + [ Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "code" + , Space + , Str "block," + , Space + , Str "though:" + ] + , CodeBlock ( "" , [] , [] ) "
\n foo\n
" + , Para + [ Str "As" , Space , Str "should" , Space , Str "this:" ] + , CodeBlock ( "" , [] , [] ) "
foo
" + , Para [ Str "Now," , Space , Str "nested:" ] , Div - ( "", [], [] ) - [ Div - ( "", [], [] ) - [ Div ( "", [], [] ) [ Plain [ Str "foo" ] ] ] - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "just" - , Space - , Str "be" - , Space - , Str "an" - , Space - , Str "HTML" - , Space - , Str "comment:" - ] - , RawBlock - ( Format "html" ) "" + ( "" , [] , [] ) + [ Div + ( "" , [] , [] ) + [ Div ( "" , [] , [] ) [ Plain [ Str "foo" ] ] ] + ] , Para - [ Str "Multiline:" ] - , RawBlock - ( Format "html" ) "" + [ Str "This" + , Space + , Str "should" + , Space + , Str "just" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "HTML" + , Space + , Str "comment:" + ] + , RawBlock (Format "html") "" + , Para [ Str "Multiline:" ] + , RawBlock (Format "html") "" , RawBlock - ( Format "html" ) "" + (Format "html") "" + , Para [ Str "Code" , Space , Str "block:" ] + , CodeBlock ( "" , [] , [] ) "" , Para - [ Str "Code", Space, Str "block:" ] - , CodeBlock - ( "", [], [] ) "" - , Para - [ Str "Just" - , Space - , Str "plain" - , Space - , Str "comment," - , Space - , Str "with" - , Space - , Str "trailing" - , Space - , Str "spaces" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "line:" - ] - , RawBlock - ( Format "html" ) "" + [ Str "Just" + , Space + , Str "plain" + , Space + , Str "comment," + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "spaces" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "line:" + ] + , RawBlock (Format "html") "" + , Para [ Str "Code:" ] + , CodeBlock ( "" , [] , [] ) "
" + , Para [ Str "Hr\8217s:" ] + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , HorizontalRule + , Header + 1 + ( "inline-markup" , [] , [] ) + [ Str "Inline" , Space , Str "Markup" ] , Para - [ Str "Code:" ] - , CodeBlock - ( "", [], [] ) "
" + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph [ Str "is" , Space , Str "this" ] + , Str "." + ] , Para - [ Str "Hr\8217s:" ] - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" + [ Str "This" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Strong [ Str "is" , Space , Str "this" ] + , Str "." + ] + , Para + [ Str "An" + , Space + , Emph + [ Link + ( "" , [] , [] ) + [ Str "emphasized" , Space , Str "link" ] + ( "/url" , "" ) + ] + , Str "." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code ( "" , [] , [] ) ">" + , Str "," + , Space + , Code ( "" , [] , [] ) "$" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\$" + , Str "," + , Space + , Code ( "" , [] , [] ) "" + , Str "." + ] + , Para + [ Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "strikeout" ] + , Str "." + ] + ] + , Para + [ Str "Superscripts:" + , Space + , Str "a" + , Superscript [ Str "bc" ] + , Str "d" + , Space + , Str "a" + , Superscript [ Emph [ Str "hello" ] ] + , Space + , Str "a" + , Superscript [ Str "hello\160there" ] + , Str "." + ] + , Para + [ Str "Subscripts:" + , Space + , Str "H" + , Subscript [ Str "2" ] + , Str "O," + , Space + , Str "H" + , Subscript [ Str "23" ] + , Str "O," + , Space + , Str "H" + , Subscript [ Str "many\160of\160them" ] + , Str "O." + ] + , Para + [ Str "These" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "superscripts" + , Space + , Str "or" + , Space + , Str "subscripts," + , SoftBreak + , Str "because" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "unescaped" + , Space + , Str "spaces:" + , Space + , Str "a^b" + , Space + , Str "c^d," + , Space + , Str "a~b" + , Space + , Str "c~d." + ] + , HorizontalRule + , Header + 1 + ( "smart-quotes-ellipses-dashes" , [] , [] ) + [ Str "Smart" + , Space + , Str "quotes," + , Space + , Str "ellipses," + , Space + , Str "dashes" + ] + , Para + [ Quoted DoubleQuote [ Str "Hello," ] + , Space + , Str "said" + , Space + , Str "the" + , Space + , Str "spider." + , Space + , Quoted + DoubleQuote + [ Quoted SingleQuote [ Str "Shelob" ] + , Space + , Str "is" + , Space + , Str "my" + , Space + , Str "name." + ] + ] + , Para + [ Quoted SingleQuote [ Str "A" ] + , Str "," + , Space + , Quoted SingleQuote [ Str "B" ] + , Str "," + , Space + , Str "and" + , Space + , Quoted SingleQuote [ Str "C" ] + , Space + , Str "are" + , Space + , Str "letters." + ] + , Para + [ Quoted SingleQuote [ Str "Oak," ] + , Space + , Quoted SingleQuote [ Str "elm," ] + , Space + , Str "and" + , Space + , Quoted SingleQuote [ Str "beech" ] + , Space + , Str "are" + , Space + , Str "names" + , Space + , Str "of" + , Space + , Str "trees." + , SoftBreak + , Str "So" + , Space + , Str "is" + , Space + , Quoted SingleQuote [ Str "pine." ] + ] + , Para + [ Quoted + SingleQuote + [ Str "He" + , Space + , Str "said," + , Space + , Quoted + DoubleQuote + [ Str "I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "go." + ] + ] + , Space + , Str "Were" + , Space + , Str "you" + , Space + , Str "alive" + , Space + , Str "in" + , Space + , Str "the" + , SoftBreak + , Str "70\8217s?" + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "quoted" + , Space + , Quoted SingleQuote [ Code ( "" , [] , [] ) "code" ] + , Space + , Str "and" + , Space + , Str "a" + , Space + , Quoted + DoubleQuote + [ Link + ( "" , [] , [] ) + [ Str "quoted" , Space , Str "link" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + ] + , Str "." + ] + , Para + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one\8212two" + , Space + , Str "\8212" + , Space + , Str "three\8212four" + , Space + , Str "\8212" + , Space + , Str "five." + ] + , Para + [ Str "Dashes" + , Space + , Str "between" + , Space + , Str "numbers:" + , Space + , Str "5\8211\&7," + , Space + , Str "255\8211\&66," + , Space + , Str "1987\8211\&1999." + ] + , Para [ Str "Ellipses\8230and\8230and\8230." ] + , HorizontalRule + , Header 1 ( "latex" , [] , [] ) [ Str "LaTeX" ] + , BulletList + [ [ Plain + [ RawInline (Format "tex") "\\cite[22-23]{smith.1899}" ] + ] + , [ Plain [ Math InlineMath "2+2=4" ] ] + , [ Plain [ Math InlineMath "x \\in y" ] ] + , [ Plain [ Math InlineMath "\\alpha \\wedge \\omega" ] ] + , [ Plain [ Math InlineMath "223" ] ] + , [ Plain [ Math InlineMath "p" , Str "-Tree" ] ] + , [ Plain + [ Str "Here\8217s" + , Space + , Str "some" + , Space + , Str "display" + , Space + , Str "math:" + , SoftBreak + , Math + DisplayMath + "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}" + ] + ] + , [ Plain + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "that" + , Space + , Str "has" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "break" + , Space + , Str "in" + , Space + , Str "it:" + , Space + , Math InlineMath "\\alpha + \\omega \\times x^2" + , Str "." + ] + ] + ] + , Para + [ Str "These" + , Space + , Str "shouldn\8217t" + , Space + , Str "be" + , Space + , Str "math:" + ] + , BulletList + [ [ Plain + [ Str "To" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "famous" + , Space + , Str "equation," + , Space + , Str "write" + , Space + , Code ( "" , [] , [] ) "$e = mc^2$" + , Str "." + ] + ] + , [ Plain + [ Str "$22,000" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Emph [ Str "lot" ] + , Space + , Str "of" + , Space + , Str "money." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "$34,000." + , SoftBreak + , Str "(It" + , Space + , Str "worked" + , Space + , Str "if" + , Space + , Quoted DoubleQuote [ Str "lot" ] + , Space + , Str "is" + , Space + , Str "emphasized.)" + ] + ] + , [ Plain + [ Str "Shoes" + , Space + , Str "($20)" + , Space + , Str "and" + , Space + , Str "socks" + , Space + , Str "($5)." + ] + ] + , [ Plain + [ Str "Escaped" + , Space + , Code ( "" , [] , [] ) "$" + , Str ":" + , Space + , Str "$73" + , Space + , Emph + [ Str "this" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "emphasized" + ] + , Space + , Str "23$." + ] + ] + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "LaTeX" + , Space + , Str "table:" + ] , RawBlock - ( Format "html" ) "
" + (Format "tex") + "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" , HorizontalRule - , Header 1 - ( "inline-markup", [], [] ) - [ Str "Inline", Space, Str "Markup" ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "emphasized" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Emph - [ Str "is", Space, Str "this" ] - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Strong - [ Str "is", Space, Str "this" ] - , Str "." - ] - , Para - [ Str "An" - , Space - , Emph + , Header + 1 + ( "special-characters" , [] , [] ) + [ Str "Special" , Space , Str "Characters" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "unicode:" + ] + , BulletList + [ [ Plain + [ Str "I" , Space , Str "hat:" , Space , Str "\206" ] + ] + , [ Plain + [ Str "o" , Space , Str "umlaut:" , Space , Str "\246" ] + ] + , [ Plain [ Str "section:" , Space , Str "\167" ] ] + , [ Plain + [ Str "set" + , Space + , Str "membership:" + , Space + , Str "\8712" + ] + ] + , [ Plain [ Str "copyright:" , Space , Str "\169" ] ] + ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." + ] + , Para + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] + , Para + [ Str "This" , Space , Str "&" , Space , Str "that." ] + , Para [ Str "4" , Space , Str "<" , Space , Str "5." ] + , Para [ Str "6" , Space , Str ">" , Space , Str "5." ] + , Para [ Str "Backslash:" , Space , Str "\\" ] + , Para [ Str "Backtick:" , Space , Str "`" ] + , Para [ Str "Asterisk:" , Space , Str "*" ] + , Para [ Str "Underscore:" , Space , Str "_" ] + , Para + [ Str "Left" , Space , Str "brace:" , Space , Str "{" ] + , Para + [ Str "Right" , Space , Str "brace:" , Space , Str "}" ] + , Para + [ Str "Left" , Space , Str "bracket:" , Space , Str "[" ] + , Para + [ Str "Right" , Space , Str "bracket:" , Space , Str "]" ] + , Para + [ Str "Left" , Space , Str "paren:" , Space , Str "(" ] + , Para + [ Str "Right" , Space , Str "paren:" , Space , Str ")" ] + , Para [ Str "Greater-than:" , Space , Str ">" ] + , Para [ Str "Hash:" , Space , Str "#" ] + , Para [ Str "Period:" , Space , Str "." ] + , Para [ Str "Bang:" , Space , Str "!" ] + , Para [ Str "Plus:" , Space , Str "+" ] + , Para [ Str "Minus:" , Space , Str "-" ] + , HorizontalRule + , Header 1 ( "links" , [] , [] ) [ Str "Links" ] + , Header 2 ( "explicit" , [] , [] ) [ Str "Explicit" ] + , Para + [ Str "Just" + , Space + , Str "a" + , Space + , Link ( "" , [] , [] ) [ Str "URL" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title preceded by two spaces" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title preceded by a tab" ) + , Str "." + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title with \"quotes\" in it" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title with single quotes" ) + ] + , Para [ Link - ( "", [], [] ) - [ Str "emphasized", Space, Str "link" ] - ( "/url", "" ) - ] - , Str "." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] + ( "" , [] , [] ) + [ Str "with_underscore" ] + ( "/url/with_underscore" , "" ) ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "Email" , Space , Str "link" ] + ( "mailto:nobody@nowhere.net" , "" ) ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "code:" - , Space - , Code - ( "", [], [] ) ">" - , Str "," - , Space - , Code - ( "", [], [] ) "$" - , Str "," - , Space - , Code - ( "", [], [] ) "\\" - , Str "," - , Space - , Code - ( "", [], [] ) "\\$" - , Str "," - , Space - , Code - ( "", [], [] ) "" - , Str "." - ] - , Para - [ Strikeout - [ Str "This" + , Para + [ Link ( "" , [] , [] ) [ Str "Empty" ] ( "" , "" ) + , Str "." + ] + , Header 2 ( "reference" , [] , [] ) [ Str "Reference" ] + , Para + [ Str "Foo" , Space - , Str "is" + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] + , Para + [ Str "With" , Space - , Emph - [ Str "strikeout" ] + , Link + ( "" , [] , [] ) + [ Str "embedded" , Space , Str "[brackets]" ] + ( "/url/" , "" ) , Str "." ] - ] - , Para - [ Str "Superscripts:" - , Space - , Str "a" - , Superscript - [ Str "bc" ] - , Str "d" - , Space - , Str "a" - , Superscript - [ Emph [ Str "hello" ] ] - , Space - , Str "a" - , Superscript - [ Str "hello\160there" ] - , Str "." - ] - , Para - [ Str "Subscripts:" - , Space - , Str "H" - , Subscript - [ Str "2" ] - , Str "O," - , Space - , Str "H" - , Subscript - [ Str "23" ] - , Str "O," - , Space - , Str "H" - , Subscript - [ Str "many\160of\160them" ] - , Str "O." - ] - , Para - [ Str "These" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "superscripts" - , Space - , Str "or" - , Space - , Str "subscripts," - , SoftBreak - , Str "because" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "unescaped" - , Space - , Str "spaces:" - , Space - , Str "a^b" - , Space - , Str "c^d," - , Space - , Str "a~b" - , Space - , Str "c~d." - ] - , HorizontalRule - , Header 1 - ( "smart-quotes-ellipses-dashes", [], [] ) - [ Str "Smart" - , Space - , Str "quotes," - , Space - , Str "ellipses," - , Space - , Str "dashes" - ] - , Para - [ Quoted DoubleQuote - [ Str "Hello," ] - , Space - , Str "said" - , Space - , Str "the" - , Space - , Str "spider." - , Space - , Quoted DoubleQuote - [ Quoted SingleQuote - [ Str "Shelob" ] + , Para + [ Link ( "" , [] , [] ) [ Str "b" ] ( "/url/" , "" ) , Space - , Str "is" + , Str "by" , Space - , Str "my" + , Str "itself" , Space - , Str "name." + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." ] - ] - , Para - [ Quoted SingleQuote - [ Str "A" ] - , Str "," - , Space - , Quoted SingleQuote - [ Str "B" ] - , Str "," - , Space - , Str "and" - , Space - , Quoted SingleQuote - [ Str "C" ] - , Space - , Str "are" - , Space - , Str "letters." - ] - , Para - [ Quoted SingleQuote - [ Str "Oak," ] - , Space - , Quoted SingleQuote - [ Str "elm," ] - , Space - , Str "and" - , Space - , Quoted SingleQuote - [ Str "beech" ] - , Space - , Str "are" - , Space - , Str "names" - , Space - , Str "of" - , Space - , Str "trees." - , SoftBreak - , Str "So" - , Space - , Str "is" - , Space - , Quoted SingleQuote - [ Str "pine." ] - ] - , Para - [ Quoted SingleQuote - [ Str "He" - , Space - , Str "said," - , Space - , Quoted DoubleQuote - [ Str "I" - , Space - , Str "want" - , Space - , Str "to" - , Space - , Str "go." - ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "once" ] ( "/url" , "" ) + , Str "." ] - , Space - , Str "Were" - , Space - , Str "you" - , Space - , Str "alive" - , Space - , Str "in" - , Space - , Str "the" - , SoftBreak - , Str "70\8217s?" - ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "quoted" - , Space - , Quoted SingleQuote - [ Code ( "", [], [] ) "code" ] - , Space - , Str "and" - , Space - , Str "a" - , Space - , Quoted DoubleQuote - [ Link - ( "", [], [] ) - [ Str "quoted", Space, Str "link" ] - ( "http://example.com/?foo=1&bar=2", "" ) - ] - , Str "." - ] - , Para - [ Str "Some" - , Space - , Str "dashes:" - , Space - , Str "one\8212two" - , Space - , Str "\8212" - , Space - , Str "three\8212four" - , Space - , Str "\8212" - , Space - , Str "five." - ] - , Para - [ Str "Dashes" - , Space - , Str "between" - , Space - , Str "numbers:" - , Space - , Str "5\8211\&7," - , Space - , Str "255\8211\&66," - , Space - , Str "1987\8211\&1999." - ] - , Para - [ Str "Ellipses\8230and\8230and\8230." ] - , HorizontalRule - , Header 1 - ( "latex", [], [] ) - [ Str "LaTeX" ] - , BulletList - [ - [ Plain - [ RawInline ( Format "tex" ) "\\cite[22-23]{smith.1899}" ] - ] - , - [ Plain [ Math InlineMath "2+2=4" ] ] - , - [ Plain [ Math InlineMath "x \\in y" ] ] - , - [ Plain [ Math InlineMath "\\alpha \\wedge \\omega" ] ] - , - [ Plain [ Math InlineMath "223" ] ] - , - [ Plain [ Math InlineMath "p", Str "-Tree" ] ] - , - [ Plain - [ Str "Here\8217s" - , Space - , Str "some" - , Space - , Str "display" - , Space - , Str "math:" - , SoftBreak - , Math DisplayMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}" - ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "twice" ] ( "/url" , "" ) + , Str "." ] - , - [ Plain - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "that" - , Space - , Str "has" - , Space - , Str "a" - , Space - , Str "line" - , Space - , Str "break" - , Space - , Str "in" - , Space - , Str "it:" - , Space - , Math InlineMath "\\alpha + \\omega \\times x^2" - , Str "." - ] + , Para + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "thrice" ] ( "/url" , "" ) + , Str "." ] - ] , Para - [ Str "These" - , Space - , Str "shouldn\8217t" - , Space - , Str "be" - , Space - , Str "math:" - ] - , BulletList - [ - [ Plain - [ Str "To" - , Space - , Str "get" - , Space - , Str "the" - , Space - , Str "famous" - , Space - , Str "equation," - , Space - , Str "write" - , Space - , Code - ( "", [], [] ) "$e = mc^2$" - , Str "." - ] + [ Str "This" + , Space + , Str "should" + , Space + , Str "[not][]" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." ] - , - [ Plain - [ Str "$22,000" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Emph - [ Str "lot" ] - , Space - , Str "of" - , Space - , Str "money." - , Space - , Str "So" - , Space - , Str "is" - , Space - , Str "$34,000." - , SoftBreak - , Str "(It" - , Space - , Str "worked" - , Space - , Str "if" - , Space - , Quoted DoubleQuote - [ Str "lot" ] - , Space - , Str "is" - , Space - , Str "emphasized.)" - ] + , CodeBlock ( "" , [] , [] ) "[not]: /url" + , Para + [ Str "Foo" + , Space + , Link + ( "" , [] , [] ) + [ Str "bar" ] + ( "/url/" , "Title with \"quotes\" inside" ) + , Str "." ] - , - [ Plain - [ Str "Shoes" - , Space - , Str "($20)" - , Space - , Str "and" - , Space - , Str "socks" - , Space - , Str "($5)." - ] + , Para + [ Str "Foo" + , Space + , Link + ( "" , [] , [] ) + [ Str "biz" ] + ( "/url/" , "Title with \"quote\" inside" ) + , Str "." ] - , - [ Plain - [ Str "Escaped" - , Space - , Code - ( "", [], [] ) "$" - , Str ":" - , Space - , Str "$73" - , Space - , Emph - [ Str "this" + , Header + 2 + ( "with-ampersands" , [] , [] ) + [ Str "With" , Space , Str "ampersands" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Link + ( "" , [] , [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" , Space - , Str "should" + , Str "ampersand" , Space - , Str "be" + , Str "in" , Space - , Str "emphasized" + , Str "the" + , Space + , Str "URL" ] - , Space - , Str "23$." - ] - ] - ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "LaTeX" - , Space - , Str "table:" - ] - , RawBlock - ( Format "tex" ) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" - , HorizontalRule - , Header 1 - ( "special-characters", [], [] ) - [ Str "Special", Space, Str "Characters" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "unicode:" - ] - , BulletList - [ - [ Plain [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] - , - [ Plain [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] - , - [ Plain [ Str "section:", Space, Str "\167" ] ] - , - [ Plain - [ Str "set", Space, Str "membership:", Space, Str "\8712" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + , Str "." ] - , - [ Plain [ Str "copyright:", Space, Str "\169" ] ] - ] - , Para - [ Str "AT&T" - , Space - , Str "has" - , Space - , Str "an" - , Space - , Str "ampersand" - , Space - , Str "in" - , Space - , Str "their" - , Space - , Str "name." - ] - , Para - [ Str "AT&T" - , Space - , Str "is" - , Space - , Str "another" - , Space - , Str "way" - , Space - , Str "to" - , Space - , Str "write" - , Space - , Str "it." - ] - , Para - [ Str "This", Space, Str "&", Space, Str "that." ] - , Para - [ Str "4", Space, Str "<", Space, Str "5." ] - , Para - [ Str "6", Space, Str ">", Space, Str "5." ] - , Para - [ Str "Backslash:", Space, Str "\\" ] - , Para - [ Str "Backtick:", Space, Str "`" ] - , Para - [ Str "Asterisk:", Space, Str "*" ] , Para - [ Str "Underscore:", Space, Str "_" ] - , Para - [ Str "Left", Space, Str "brace:", Space, Str "{" ] - , Para - [ Str "Right", Space, Str "brace:", Space, Str "}" ] - , Para - [ Str "Left", Space, Str "bracket:", Space, Str "[" ] - , Para - [ Str "Right", Space, Str "bracket:", Space, Str "]" ] - , Para - [ Str "Left", Space, Str "paren:", Space, Str "(" ] - , Para - [ Str "Right", Space, Str "paren:", Space, Str ")" ] - , Para - [ Str "Greater-than:", Space, Str ">" ] - , Para - [ Str "Hash:", Space, Str "#" ] - , Para - [ Str "Period:", Space, Str "." ] - , Para - [ Str "Bang:", Space, Str "!" ] - , Para - [ Str "Plus:", Space, Str "+" ] - , Para - [ Str "Minus:", Space, Str "-" ] - , HorizontalRule - , Header 1 - ( "links", [], [] ) - [ Str "Links" ] - , Header 2 - ( "explicit", [], [] ) - [ Str "Explicit" ] - , Para - [ Str "Just" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "URL" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title preceded by two spaces" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title preceded by a tab" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title with \"quotes\" in it" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title with single quotes" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "with_underscore" ] - ( "/url/with_underscore", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "Email", Space, Str "link" ] - ( "mailto:nobody@nowhere.net", "" ) - ] - , Para - [ Link ( "", [], [] ) [ Str "Empty" ] ( "", "" ), Str "." ] - , Header 2 - ( "reference", [], [] ) - [ Str "Reference" ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "With" - , Space - , Link - ( "", [], [] ) - [ Str "embedded", Space, Str "[brackets]" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "b" ] - ( "/url/", "" ) - , Space - , Str "by" - , Space - , Str "itself" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "once" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "twice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "thrice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "[not][]" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , CodeBlock - ( "", [], [] ) "[not]: /url" - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "Title with \"quotes\" inside" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "biz" ] - ( "/url/", "Title with \"quote\" inside" ) - , Str "." - ] - , Header 2 - ( "with-ampersands", [], [] ) - [ Str "With", Space, Str "ampersands" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "link" + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "link" , Space , Str "with" , Space , Str "an" , Space - , Str "ampersand" + , Str "amersand" , Space , Str "in" , Space , Str "the" , Space - , Str "URL" - ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "link" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Str "amersand" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "link" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "AT&T" ] - ( "http://att.com/", "AT&T" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "inline", Space, Str "link" ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "inline" - , Space , Str "link" , Space - , Str "in" + , Str "text:" + , Space + , Link + ( "" , [] , [] ) + [ Str "AT&T" ] + ( "http://att.com/" , "AT&T" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Str "inline" , Space , Str "link" ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Str "inline" + , Space + , Str "link" + , Space + , Str "in" + , Space + , Str "pointy" + , Space + , Str "braces" + ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Header 2 ( "autolinks" , [] , [] ) [ Str "Autolinks" ] + , Para + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" , Space - , Str "pointy" - , Space - , Str "braces" - ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Header 2 - ( "autolinks", [], [] ) - [ Str "Autolinks" ] - , Para - [ Str "With" - , Space - , Str "an" - , Space - , Str "ampersand:" - , Space - , Link - ( "", [ "uri" ], [] ) - [ Str "http://example.com/?foo=1&bar=2" ] - ( "http://example.com/?foo=1&bar=2", "" ) - ] + , Link + ( "" , [ "uri" ] , [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + ] , BulletList - [ - [ Plain [ Str "In", Space, Str "a", Space, Str "list?" ] ] - , - [ Plain - [ Link - ( "", [ "uri" ], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) + [ [ Plain + [ Str "In" , Space , Str "a" , Space , Str "list?" ] + ] + , [ Plain + [ Link + ( "" , [ "uri" ] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] ] + , [ Plain [ Str "It" , Space , Str "should." ] ] ] - , - [ Plain [ Str "It", Space, Str "should." ] ] - ] - , Para - [ Str "An" - , Space - , Str "e-mail" - , Space - , Str "address:" - , Space - , Link - ( "", [ "email" ], [] ) - [ Str "nobody@nowhere.net" ] - ( "mailto:nobody@nowhere.net", "" ) - ] - , BlockQuote - [ Para - [ Str "Blockquoted:" + , Para + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" , Space , Link - ( "", [ "uri" ], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) - ] - ] - , Para - [ Str "Auto-links" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "occur" - , Space - , Str "here:" - , Space - , Code - ( "", [], [] ) "" - ] + ( "" , [ "email" ] , [] ) + [ Str "nobody@nowhere.net" ] + ( "mailto:nobody@nowhere.net" , "" ) + ] + , BlockQuote + [ Para + [ Str "Blockquoted:" + , Space + , Link + ( "" , [ "uri" ] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] + ] + , Para + [ Str "Auto-links" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "occur" + , Space + , Str "here:" + , Space + , Code ( "" , [] , [] ) "" + ] , CodeBlock - ( "", [], [] ) "or here: " - , HorizontalRule - , Header 1 - ( "images", [], [] ) - [ Str "Images" ] - , Para - [ Str "From" - , Space - , Quoted DoubleQuote - [ Str "Voyage" - , Space - , Str "dans" - , Space - , Str "la" - , Space - , Str "Lune" - ] - , Space - , Str "by" - , Space - , Str "Georges" - , Space - , Str "Melies" - , Space - , Str "(1902):" - ] - , Para - [ Image - ( "", [], [] ) - [ Str "lalune" ] - ( "lalune.jpg", "fig:Voyage dans la Lune" ) - ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "movie" - , Space - , Image - ( "", [], [] ) - [ Str "movie" ] - ( "movie.jpg", "" ) - , Space - , Str "icon." - ] + ( "" , [] , [] ) "or here: " , HorizontalRule - , Header 1 - ( "footnotes", [], [] ) - [ Str "Footnotes" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference," - , Note - [ Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "footnote." - , Space - , Str "It" - , Space - , Str "can" - , Space - , Str "go" - , Space - , Str "anywhere" - , Space - , Str "after" - , Space - , Str "the" - , Space - , Str "footnote" - , SoftBreak - , Str "reference." - , Space - , Str "It" - , Space - , Str "need" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "placed" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "end" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "document." - ] + , Header 1 ( "images" , [] , [] ) [ Str "Images" ] + , Para + [ Str "From" + , Space + , Quoted + DoubleQuote + [ Str "Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune" + ] + , Space + , Str "by" + , Space + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" ] - , Space - , Str "and" - , Space - , Str "another." - , Note - [ Para - [ Str "Here\8217s" - , Space - , Str "the" - , Space - , Str "long" - , Space - , Str "note." - , Space - , Str "This" - , Space - , Str "one" - , Space - , Str "contains" - , Space - , Str "multiple" - , SoftBreak - , Str "blocks." - ] - , Para - [ Str "Subsequent" - , Space - , Str "blocks" - , Space - , Str "are" - , Space - , Str "indented" - , Space - , Str "to" - , Space - , Str "show" - , Space - , Str "that" - , Space - , Str "they" - , Space - , Str "belong" - , Space - , Str "to" - , Space - , Str "the" - , SoftBreak - , Str "footnote" - , Space - , Str "(as" - , Space - , Str "with" - , Space - , Str "list" - , Space - , Str "items)." - ] - , CodeBlock - ( "", [], [] ) " { }" - , Para - [ Str "If" - , Space - , Str "you" - , Space - , Str "want," - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "indent" - , Space - , Str "every" - , Space - , Str "line," - , Space - , Str "but" - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "also" - , Space - , Str "be" - , SoftBreak - , Str "lazy" - , Space - , Str "and" - , Space - , Str "just" - , Space - , Str "indent" - , Space - , Str "the" - , Space - , Str "first" - , Space - , Str "line" - , Space - , Str "of" - , Space - , Str "each" - , Space - , Str "block." - ] + , Para + [ Image + ( "" , [] , [] ) + [ Str "lalune" ] + ( "lalune.jpg" , "fig:Voyage dans la Lune" ) ] - , SoftBreak - , Str "This" - , Space - , Str "should" - , Space - , Emph - [ Str "not" ] - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference," - , Space - , Str "because" - , Space - , Str "it" - , SoftBreak - , Str "contains" - , Space - , Str "a" - , Space - , Str "space.[^my" - , Space - , Str "note]" - , Space - , Str "Here" - , Space - , Str "is" - , Space - , Str "an" - , Space - , Str "inline" - , Space - , Str "note." - , Note - [ Para - [ Str "This" - , SoftBreak - , Str "is" - , Space - , Emph - [ Str "easier" ] - , Space - , Str "to" - , Space - , Str "type." - , Space - , Str "Inline" - , Space - , Str "notes" - , Space - , Str "may" - , Space - , Str "contain" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "links" ] - ( "http://google.com", "" ) - , Space - , Str "and" - , Space - , Code - ( "", [], [] ) "]" - , Space - , Str "verbatim" - , Space - , Str "characters," - , SoftBreak - , Str "as" - , Space - , Str "well" - , Space - , Str "as" - , Space - , Str "[bracketed" - , Space - , Str "text]." - ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space + , Image + ( "" , [] , [] ) [ Str "movie" ] ( "movie.jpg" , "" ) + , Space + , Str "icon." ] - ] - , BlockQuote - [ Para - [ Str "Notes" + , HorizontalRule + , Header 1 ( "footnotes" , [] , [] ) [ Str "Footnotes" ] + , Para + [ Str "Here" + , Space + , Str "is" , Space - , Str "can" + , Str "a" , Space - , Str "go" + , Str "footnote" , Space - , Str "in" + , Str "reference," + , Note + [ Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "footnote." + , Space + , Str "It" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "anywhere" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "footnote" + , SoftBreak + , Str "reference." + , Space + , Str "It" + , Space + , Str "need" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "placed" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "document." + ] + ] + , Space + , Str "and" , Space - , Str "quotes." + , Str "another." , Note - [ Para [ Str "In", Space, Str "quote." ] ] + [ Para + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "long" + , Space + , Str "note." + , Space + , Str "This" + , Space + , Str "one" + , Space + , Str "contains" + , Space + , Str "multiple" + , SoftBreak + , Str "blocks." + ] + , Para + [ Str "Subsequent" + , Space + , Str "blocks" + , Space + , Str "are" + , Space + , Str "indented" + , Space + , Str "to" + , Space + , Str "show" + , Space + , Str "that" + , Space + , Str "they" + , Space + , Str "belong" + , Space + , Str "to" + , Space + , Str "the" + , SoftBreak + , Str "footnote" + , Space + , Str "(as" + , Space + , Str "with" + , Space + , Str "list" + , Space + , Str "items)." + ] + , CodeBlock ( "" , [] , [] ) " { }" + , Para + [ Str "If" + , Space + , Str "you" + , Space + , Str "want," + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "indent" + , Space + , Str "every" + , Space + , Str "line," + , Space + , Str "but" + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "be" + , SoftBreak + , Str "lazy" + , Space + , Str "and" + , Space + , Str "just" + , Space + , Str "indent" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "line" + , Space + , Str "of" + , Space + , Str "each" + , Space + , Str "block." + ] + ] + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Emph [ Str "not" ] + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Space + , Str "because" + , Space + , Str "it" + , SoftBreak + , Str "contains" + , Space + , Str "a" + , Space + , Str "space.[^my" + , Space + , Str "note]" + , Space + , Str "Here" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "inline" + , Space + , Str "note." + , Note + [ Para + [ Str "This" + , SoftBreak + , Str "is" + , Space + , Emph [ Str "easier" ] + , Space + , Str "to" + , Space + , Str "type." + , Space + , Str "Inline" + , Space + , Str "notes" + , Space + , Str "may" + , Space + , Str "contain" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "links" ] + ( "http://google.com" , "" ) + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "]" + , Space + , Str "verbatim" + , Space + , Str "characters," + , SoftBreak + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str "[bracketed" + , Space + , Str "text]." + ] + ] + ] + , BlockQuote + [ Para + [ Str "Notes" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "in" + , Space + , Str "quotes." + , Note [ Para [ Str "In" , Space , Str "quote." ] ] + ] ] - ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain - [ Str "And" - , Space - , Str "in" - , Space - , Str "list" - , Space - , Str "items." - , Note - [ Para [ Str "In", Space, Str "list." ] ] + ( 1 , Decimal , Period ) + [ [ Plain + [ Str "And" + , Space + , Str "in" + , Space + , Str "list" + , Space + , Str "items." + , Note [ Para [ Str "In" , Space , Str "list." ] ] + ] ] ] - ] - , Para - [ Str "This" - , Space - , Str "paragraph" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "part" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "note," - , Space - , Str "as" - , Space - , Str "it" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "indented." - ] + , Para + [ Str "This" + , Space + , Str "paragraph" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "note," + , Space + , Str "as" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "indented." + ] ] diff --git a/test/textile-reader.native b/test/textile-reader.native index 34dfa7ca3..a9c78ec8f 100644 --- a/test/textile-reader.native +++ b/test/textile-reader.native @@ -1,1317 +1,1260 @@ Pandoc - ( Meta { unMeta = fromList [] } ) + Meta { unMeta = fromList [] } [ 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-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" ] - , Header 6 - ( "level-6", [], [] ) - [ Str "Level", Space, Str "6" ] - , Header 1 - ( "paragraphs", [], [] ) - [ Str "Paragraphs" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "regular" - , Space - , Str "paragraph." - ] - , Para - [ Str "Line" - , Space - , Str "breaks" - , Space - , Str "are" - , Space - , Str "preserved" - , Space - , Str "in" - , Space - , Str "textile," - , Space - , Str "so" - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "not" - , Space - , Str "wrap" - , Space - , Str "your" - , Space - , Str "very" - , LineBreak - , Str "long" - , Space - , Str "paragraph" - , Space - , Str "with" - , Space - , Str "your" - , Space - , Str "favourite" - , Space - , Str "text" - , Space - , Str "editor" - , Space - , Str "and" - , Space - , Str "have" - , Space - , Str "it" - , Space - , Str "rendered" - , LineBreak - , Str "with" - , Space - , Str "no" - , Space - , Str "break." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "bullet." - ] - , BulletList - [ [ Plain [ Str "criminey." ] ] ] - , Para - [ Str "There" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "paragraph" - , Space - , Str "break" - , Space - , Str "between" - , Space - , Str "here" - ] - , Para - [ Str "and", Space, Str "here." ] - , Para - [ Str "pandoc", Space, Str "converts", Space, Str "textile." ] - , Header 1 - ( "block-quotes", [], [] ) - [ Str "Block", Space, Str "Quotes" ] - , BlockQuote - [ Para [ Str "This" , Space , Str "is" , Space , Str "a" , Space - , Str "famous" + , Str "set" , Space - , Str "quote" + , Str "of" , Space - , Str "from" + , Str "tests" , Space - , Str "somebody." + , Str "for" , Space - , Str "He" + , Str "pandoc" , Space - , Str "had" + , Str "Textile" , Space - , Str "a" + , Str "Reader." , Space - , Str "lot" + , Str "Part" , Space , Str "of" , Space - , Str "things" + , Str "it" , Space - , Str "to" + , Str "comes" , LineBreak - , Str "say," + , 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-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" ] + , Header + 6 ( "level-6" , [] , [] ) [ Str "Level" , Space , Str "6" ] + , Header 1 ( "paragraphs" , [] , [] ) [ Str "Paragraphs" ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "Line" + , Space + , Str "breaks" + , Space + , Str "are" + , Space + , Str "preserved" + , Space + , Str "in" + , Space + , Str "textile," , Space , Str "so" , Space - , Str "the" + , Str "you" , Space - , Str "text" + , Str "can" , Space - , Str "is" + , Str "not" , Space - , Str "really" + , Str "wrap" , Space - , Str "really" + , Str "your" , Space + , Str "very" + , LineBreak , Str "long" , Space + , Str "paragraph" + , Space + , Str "with" + , Space + , Str "your" + , Space + , Str "favourite" + , Space + , Str "text" + , Space + , Str "editor" + , Space , Str "and" , Space - , Str "spans" + , Str "have" , Space - , Str "on" + , Str "it" , Space - , Str "multiple" + , Str "rendered" + , LineBreak + , Str "with" + , Space + , Str "no" , Space - , Str "lines." + , Str "break." ] - ] , Para - [ Str "And" - , Space - , Str "a" - , Space - , Str "following" - , Space - , Str "paragraph." - ] - , Header 1 - ( "code-blocks", [], [] ) - [ Str "Code", Space, Str "Blocks" ] + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + ] + , BulletList [ [ Plain [ Str "criminey." ] ] ] , Para - [ Str "Code:" ] - , CodeBlock - ( "" - , [] - , [] - ) " ---- (should be four hyphens)\n\n sub status {\n print \"working\";\n }\n\n this code block is indented by one tab" + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "break" + , Space + , Str "between" + , Space + , Str "here" + ] + , Para [ Str "and" , Space , Str "here." ] , Para - [ Str "And:" ] + [ Str "pandoc" + , Space + , Str "converts" + , Space + , Str "textile." + ] + , Header + 1 + ( "block-quotes" , [] , [] ) + [ Str "Block" , Space , Str "Quotes" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "famous" + , Space + , Str "quote" + , Space + , Str "from" + , Space + , Str "somebody." + , Space + , Str "He" + , Space + , Str "had" + , Space + , Str "a" + , Space + , Str "lot" + , Space + , Str "of" + , Space + , Str "things" + , Space + , Str "to" + , LineBreak + , Str "say," + , Space + , Str "so" + , Space + , Str "the" + , Space + , Str "text" + , Space + , Str "is" + , Space + , Str "really" + , Space + , Str "really" + , Space + , Str "long" + , Space + , Str "and" + , Space + , Str "spans" + , Space + , Str "on" + , Space + , Str "multiple" + , Space + , Str "lines." + ] + ] + , Para + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] + , Header + 1 + ( "code-blocks" , [] , [] ) + [ Str "Code" , Space , Str "Blocks" ] + , Para [ Str "Code:" ] , CodeBlock - ( "" - , [] - , [] - ) " this code block is indented by two tabs\n\n These should not be escaped: \\$ \\\\ \\> \\[ \\{" + ( "" , [] , [] ) + " ---- (should be four hyphens)\n\n sub status {\n print \"working\";\n }\n\n this code block is indented by one tab" + , Para [ Str "And:" ] , CodeBlock - ( "", [], [] ) "Code block with .bc\n continued\n @ \\[ \\{" , CodeBlock - ( "", [], [] ) "extended code block\n\n continued" - , Para - [ Str "ended", Space, Str "by", Space, Str "paragraph" ] - , Para - [ Str "Inline" - , Space - , Str "code:" - , Space - , Code - ( "", [], [] ) "" - , Str "," - , Space - , Code - ( "", [], [] ) "@" - , Str "." - ] - , Header 1 - ( "notextile", [], [] ) - [ Str "Notextile" ] + ( "" , [] , [] ) + "Code block with .bc\n continued\n @" + , Str "," + , Space + , Code ( "" , [] , [] ) "@" + , Str "." + ] + , Header 1 ( "notextile" , [] , [] ) [ Str "Notextile" ] , Para - [ Str "and" - , Space - , Str "inlines" - , Space - , Str "can" - , Space - , Str "be" - , Space - , Str "protected" - , Space - , Str "with" - , Space - , Str "double *equals (=)* markup." - ] - , Header 1 - ( "lists", [], [] ) - [ Str "Lists" ] - , Header 2 - ( "unordered", [], [] ) - [ Str "Unordered" ] + [ Str "A" + , Space + , Str "block" + , Space + , Str "of" + , Space + , Str "text" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "protected" + , Space + , Str "with" + , Space + , Str "notextile" + , Space + , Str ":" + ] + , Para [ Str "\nNo *bold* and\n* no bullet\n" ] , Para - [ Str "Asterisks", Space, Str "tight:" ] + [ Str "and" + , Space + , Str "inlines" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "protected" + , Space + , Str "with" + , Space + , Str "double *equals (=)* markup." + ] + , Header 1 ( "lists" , [] , [] ) [ Str "Lists" ] + , Header 2 ( "unordered" , [] , [] ) [ Str "Unordered" ] + , Para [ Str "Asterisks" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "asterisk", Space, Str "1" ] ] - , - [ Plain [ Str "asterisk", Space, Str "2" ] ] - , - [ Plain [ Str "asterisk", Space, Str "3" ] ] - ] + [ [ Plain [ Str "asterisk" , Space , Str "1" ] ] + , [ Plain [ Str "asterisk" , Space , Str "2" ] ] + , [ Plain [ Str "asterisk" , Space , Str "3" ] ] + ] , Para - [ Str "With", Space, Str "line", Space, Str "breaks:" ] + [ Str "With" , Space , Str "line" , Space , Str "breaks:" ] , BulletList - [ - [ Plain - [ Str "asterisk", Space, Str "1", LineBreak, Str "newline" ] + [ [ Plain + [ Str "asterisk" + , Space + , Str "1" + , LineBreak + , Str "newline" + ] + ] + , [ Plain [ Str "asterisk" , Space , Str "2" ] ] ] - , - [ Plain [ Str "asterisk", Space, Str "2" ] ] - ] - , Header 2 - ( "ordered", [], [] ) - [ Str "Ordered" ] - , Para - [ Str "Tight:" ] + , Header 2 ( "ordered" , [] , [] ) [ Str "Ordered" ] + , Para [ Str "Tight:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "First" ] ] - , - [ Plain [ Str "Second" ] ] - , - [ Plain [ Str "Third" ] ] - ] - , Header 2 - ( "nested", [], [] ) - [ Str "Nested" ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "First" ] ] + , [ Plain [ Str "Second" ] ] + , [ Plain [ Str "Third" ] ] + ] + , Header 2 ( "nested" , [] , [] ) [ Str "Nested" ] , BulletList - [ - [ Plain - [ Str "ui", Space, Str "1" ] - , BulletList - [ - [ Plain - [ Str "ui", Space, Str "1.1" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "oi", Space, Str "1.1.1" ] ] - , - [ Plain [ Str "oi", Space, Str "1.1.2" ] ] + [ [ Plain [ Str "ui" , Space , Str "1" ] + , BulletList + [ [ Plain [ Str "ui" , Space , Str "1.1" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "oi" , Space , Str "1.1.1" ] ] + , [ Plain [ Str "oi" , Space , Str "1.1.2" ] ] + ] + ] + , [ Plain [ Str "ui" , Space , Str "1.2" ] ] ] - ] - , - [ Plain [ Str "ui", Space, Str "1.2" ] ] ] - ] - , - [ Plain - [ Str "ui", Space, Str "2" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "oi", Space, Str "2.1" ] - , BulletList - [ - [ Plain [ Str "ui", Space, Str "2.1.1" ] ] - , - [ Plain [ Str "ui", Space, Str "2.1.2" ] ] + , [ Plain [ Str "ui" , Space , Str "2" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "oi" , Space , Str "2.1" ] + , BulletList + [ [ Plain [ Str "ui" , Space , Str "2.1.1" ] ] + , [ Plain [ Str "ui" , Space , Str "2.1.2" ] ] + ] + ] ] - ] ] ] - ] - , Header 2 - ( "issue-1500", [], [] ) - [ Str "Issue", Space, Str "#1500" ] + , Header + 2 + ( "issue-1500" , [] , [] ) + [ Str "Issue" , Space , Str "#1500" ] , BulletList - [ - [ Plain [ Str "one" ] ] - , - [ Plain - [ Str "two" - , LineBreak - , Str "->" - , Space - , Str "and" - , Space - , Str "more" + [ [ Plain [ Str "one" ] ] + , [ Plain + [ Str "two" + , LineBreak + , Str "->" + , Space + , Str "and" + , Space + , Str "more" + ] ] ] - ] - , Header 2 - ( "issue-1513", [], [] ) - [ Str "Issue", Space, Str "#1513" ] - , Para - [ Str "List:" ] + , Header + 2 + ( "issue-1513" , [] , [] ) + [ Str "Issue" , Space , Str "#1513" ] + , Para [ Str "List:" ] , BulletList - [ [ Plain [ Str "one" ] ], [ Plain [ Str "two" ] ] ] - , Header 2 - ( "definition-list", [], [] ) - [ Str "Definition", Space, Str "List" ] + [ [ Plain [ Str "one" ] ] , [ Plain [ Str "two" ] ] ] + , Header + 2 + ( "definition-list" , [] , [] ) + [ Str "Definition" , Space , Str "List" ] , DefinitionList - [ - ( - [ Str "coffee" ] - , - [ - [ Plain [ Str "Hot", Space, Str "and", Space, Str "black" ] ] - ] - ) - , - ( - [ Str "tea" ] - , - [ - [ Plain - [ Str "Also" - , Space - , Str "hot," - , Space - , Str "but" - , Space - , Str "a" - , Space - , Str "little" - , Space - , Str "less" - , Space - , Str "black" + [ ( [ Str "coffee" ] + , [ [ Plain + [ Str "Hot" , Space , Str "and" , Space , Str "black" ] ] ] - ] - ) - , - ( - [ Str "milk" ] - , - [ - [ Para - [ Str "Nourishing" - , Space - , Str "beverage" - , Space - , Str "for" - , Space - , Str "baby" - , Space - , Str "cows." + ) + , ( [ Str "tea" ] + , [ [ Plain + [ Str "Also" + , Space + , Str "hot," + , Space + , Str "but" + , Space + , Str "a" + , Space + , Str "little" + , Space + , Str "less" + , Space + , Str "black" + ] ] - , Para - [ Str "Cold" - , Space - , Str "drink" - , Space - , Str "that" - , Space - , Str "goes" - , Space - , Str "great" - , Space - , Str "with" - , Space - , Str "cookies." + ] + ) + , ( [ Str "milk" ] + , [ [ Para + [ Str "Nourishing" + , Space + , Str "beverage" + , Space + , Str "for" + , Space + , Str "baby" + , Space + , Str "cows." + ] + , Para + [ Str "Cold" + , Space + , Str "drink" + , Space + , Str "that" + , Space + , Str "goes" + , Space + , Str "great" + , Space + , Str "with" + , Space + , Str "cookies." + ] ] ] - ] - ) - , - ( - [ Str "beer" ] - , - [ - [ Plain - [ Str "fresh", Space, Str "and", Space, Str "bitter" ] + ) + , ( [ Str "beer" ] + , [ [ Plain + [ Str "fresh" + , Space + , Str "and" + , Space + , Str "bitter" + ] + ] ] - ] - ) - ] - , Header 1 - ( "inline-markup", [], [] ) - [ Str "Inline", Space, Str "Markup" ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "emphasized" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Emph - [ Str "is", Space, Str "this" ] - , Str "." - , LineBreak - , Str "This" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Strong - [ Str "is", Space, Str "this" ] - , Str "." - , LineBreak - , Str "This" - , Space - , Str "is" - , Space - , Underline - [ Str "inserted" ] - , Str "," - , Space - , Str "and" - , Space - , Str "this" - , Space - , Str "is" - , Space - , Strikeout - [ Str "deleted" ] - , Str "." - , LineBreak - , Str "Hyphenated-words-are-ok," - , Space - , Str "as" - , Space - , Str "well" - , Space - , Str "as" - , Space - , Str "strange_underscore_notation." - , LineBreak - , Str "A" - , Space - , Link - ( "", [], [] ) - [ Strong [ Str "strong", Space, Str "link" ] ] - ( "http://www.foobar.com", "" ) - , Str "." - ] - , Para - [ Emph - [ Strong - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] + ) ] - , LineBreak - , Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word" - , Space - , Str "and" - , Space - , Emph - [ Strong [ Str "that", Space, Str "one" ] ] - , Str "." - , LineBreak - , Strikeout + , Header + 1 + ( "inline-markup" , [] , [] ) + [ Str "Inline" , Space , Str "Markup" ] + , Para [ Str "This" , Space , Str "is" , Space - , Str "strikeout" + , Emph [ Str "emphasized" ] + , Str "," , Space , Str "and" , Space - , Strong - [ Str "strong" ] + , Str "so" + , Space + , Emph [ Str "is" , Space , Str "this" ] + , Str "." + , LineBreak + , Str "This" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Strong [ Str "is" , Space , Str "this" ] + , Str "." + , LineBreak + , Str "This" + , Space + , Str "is" + , Space + , Underline [ Str "inserted" ] + , Str "," + , Space + , Str "and" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Strikeout [ Str "deleted" ] + , Str "." + , LineBreak + , Str "Hyphenated-words-are-ok," + , Space + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str "strange_underscore_notation." + , LineBreak + , Str "A" + , Space + , Link + ( "" , [] , [] ) + [ Strong [ Str "strong" , Space , Str "link" ] ] + ( "http://www.foobar.com" , "" ) + , Str "." + ] + , Para + [ Emph + [ Strong + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + , LineBreak + , Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word" + , Space + , Str "and" + , Space + , Emph [ Strong [ Str "that" , Space , Str "one" ] ] + , Str "." + , LineBreak + , Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Str "strikeout" + , Space + , Str "and" + , Space + , Strong [ Str "strong" ] + ] ] - ] , Para - [ Str "Superscripts:" - , Space - , Str "a" - , Superscript - [ Str "bc" ] - , Str "d" - , Space - , Str "a" - , Space - , Superscript - [ Strong [ Str "hello" ] ] - , Space - , Str "a" - , Superscript - [ Str "hello", Space, Str "there" ] - , Str "." - , LineBreak - , Str "Subscripts:" - , Space - , Subscript - [ Str "here" ] - , Space - , Str "H" - , Space - , Subscript - [ Str "2" ] - , Str "O," - , Space - , Str "H" - , Space - , Subscript - [ Str "23" ] - , Str "O," - , Space - , Str "H" - , Space - , Subscript - [ Str "many", Space, Str "of", Space, Str "them" ] - , Str "O." - ] + [ Str "Superscripts:" + , Space + , Str "a" + , Superscript [ Str "bc" ] + , Str "d" + , Space + , Str "a" + , Space + , Superscript [ Strong [ Str "hello" ] ] + , Space + , Str "a" + , Superscript [ Str "hello" , Space , Str "there" ] + , Str "." + , LineBreak + , Str "Subscripts:" + , Space + , Subscript [ Str "here" ] + , Space + , Str "H" + , Space + , Subscript [ Str "2" ] + , Str "O," + , Space + , Str "H" + , Space + , Subscript [ Str "23" ] + , Str "O," + , Space + , Str "H" + , Space + , Subscript + [ Str "many" , Space , Str "of" , Space , Str "them" ] + , Str "O." + ] , Para - [ Str "Dashes" - , Space - , Str ":" - , Space - , Str "How" - , Space - , Str "cool" - , Space - , Str "\8212" - , Space - , Str "automatic" - , Space - , Str "dashes." - ] + [ Str "Dashes" + , Space + , Str ":" + , Space + , Str "How" + , Space + , Str "cool" + , Space + , Str "\8212" + , Space + , Str "automatic" + , Space + , Str "dashes." + ] , Para - [ Str "Ellipses" - , Space - , Str ":" - , Space - , Str "He" - , Space - , Str "thought" - , Space - , Str "and" - , Space - , Str "thought" - , Space - , Str "\8230" - , Space - , Str "and" - , Space - , Str "then" - , Space - , Str "thought" - , Space - , Str "some" - , Space - , Str "more." - ] + [ Str "Ellipses" + , Space + , Str ":" + , Space + , Str "He" + , Space + , Str "thought" + , Space + , Str "and" + , Space + , Str "thought" + , Space + , Str "\8230" + , Space + , Str "and" + , Space + , Str "then" + , Space + , Str "thought" + , Space + , Str "some" + , Space + , Str "more." + ] , Para - [ Str "Quotes" - , Space - , Str "and" - , Space - , Str "apostrophes" - , Space - , Str ":" - , Space - , Quoted DoubleQuote - [ Str "I\8217d" + [ Str "Quotes" , Space - , Str "like" + , Str "and" , Space - , Str "to" + , Str "apostrophes" , Space - , Str "thank" + , Str ":" , Space - , Str "you" + , Quoted + DoubleQuote + [ Str "I\8217d" + , Space + , Str "like" + , Space + , Str "to" + , Space + , Str "thank" + , Space + , Str "you" + ] + , Space + , Str "for" + , Space + , Str "example." ] - , Space - , Str "for" - , Space - , Str "example." - ] - , Header 1 - ( "links", [], [] ) - [ Str "Links" ] - , Header 2 - ( "explicit", [], [] ) - [ Str "Explicit" ] + , Header 1 ( "links" , [] , [] ) [ Str "Links" ] + , Header 2 ( "explicit" , [] , [] ) [ Str "Explicit" ] , Para - [ Str "Just" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "url" ] - ( "http://www.url.com", "" ) - ] + [ Str "Just" + , Space + , Str "a" + , Space + , Link + ( "" , [] , [] ) [ Str "url" ] ( "http://www.url.com" , "" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "Email", Space, Str "link" ] - ( "mailto:nobody@nowhere.net", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "Email" , Space , Str "link" ] + ( "mailto:nobody@nowhere.net" , "" ) + ] , Para - [ Quoted DoubleQuote - [ Str "not", Space, Str "a", Space, Str "link" ] - , Str ":" - , Space - , Str "foo" - ] + [ Quoted + DoubleQuote + [ Str "not" , Space , Str "a" , Space , Str "link" ] + , Str ":" + , Space + , Str "foo" + ] , Para - [ Str "Automatic" - , Space - , Str "linking" - , Space - , Str "to" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.example.com" ] - ( "http://www.example.com", "" ) - , Str "." - ] + [ Str "Automatic" + , Space + , Str "linking" + , Space + , Str "to" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.example.com" ] + ( "http://www.example.com" , "" ) + , Str "." + ] , Para - [ Link - ( "", [], [] ) - [ Str "Example" ] - ( "http://www.example.com/", "" ) - , Str ":" - , Space - , Str "Example" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "link" - , Space - , Str "followed" - , Space - , Str "by" - , Space - , Str "a" - , Space - , Str "colon." - ] + [ Link + ( "" , [] , [] ) + [ Str "Example" ] + ( "http://www.example.com/" , "" ) + , Str ":" + , Space + , Str "Example" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "link" + , Space + , Str "followed" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "colon." + ] , Para - [ Str "A" - , Space - , Str "link" - , Link - ( "", [], [] ) - [ Str "with", Space, Str "brackets" ] - ( "http://www.example.com", "" ) - , Str "and" - , Space - , Str "no" - , Space - , Str "spaces." - ] - , Header 1 - ( "tables", [], [] ) - [ Str "Tables" ] + [ Str "A" + , Space + , Str "link" + , Link + ( "" , [] , [] ) + [ Str "with" , Space , Str "brackets" ] + ( "http://www.example.com" , "" ) + , Str "and" + , Space + , Str "no" + , Space + , Str "spaces." + ] + , Header 1 ( "tables" , [] , [] ) [ Str "Tables" ] , Para - [ Str "Textile" - , Space - , Str "allows" - , Space - , Str "tables" - , Space - , Str "with" - , Space - , Str "and" - , Space - , Str "without" - , Space - , Str "headers" - , Space - , Str ":" - ] - , Header 2 - ( "without-headers", [], [] ) - [ Str "Without", Space, Str "headers" ] + [ Str "Textile" + , Space + , Str "allows" + , Space + , Str "tables" + , Space + , Str "with" + , Space + , Str "and" + , Space + , Str "without" + , Space + , Str "headers" + , Space + , Str ":" + ] + , Header + 2 + ( "without-headers" , [] , [] ) + [ Str "Without" , Space , Str "headers" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "name" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "age" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "sex" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "joan" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "24" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "archie" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "29" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "m" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "bella" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "45" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "name" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "age" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "sex" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "joan" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "24" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "archie" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "29" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "m" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "bella" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "45" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "and" - , Space - , Str "some" - , Space - , Str "text" - , Space - , Str "following" - , Space - , Str "\8230" - ] - , Header 2 - ( "with-headers", [], [] ) - [ Str "With", Space, Str "headers" ] + [ Str "and" + , Space + , Str "some" + , Space + , Str "text" + , Space + , Str "following" + , Space + , Str "\8230" + ] + , Header + 2 + ( "with-headers" , [] , [] ) + [ Str "With" , Space , Str "headers" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "name" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "age" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "sex" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "joan" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "24" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "archie" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "29" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "m" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "bella" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "45" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "name" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "age" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "sex" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "joan" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "24" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "archie" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "29" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "m" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "bella" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "45" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 1 - ( "images", [], [] ) - [ Str "Images" ] + (TableFoot ( "" , [] , [] ) []) + , Header 1 ( "images" , [] , [] ) [ Str "Images" ] , Para - [ Str "Textile" - , Space - , Str "inline" - , Space - , Str "image" - , Space - , Str "syntax," - , Space - , Str "like" - , LineBreak - , Str "here" - , Space - , Image - ( "", [], [] ) - [ Str "this is the alt text" ] - ( "this_is_an_image.png", "this is the alt text" ) - , LineBreak - , Str "and" - , Space - , Str "here" - , Space - , Image - ( "", [], [] ) - [ Str "" ] - ( "this_is_an_image.png", "" ) - , Str "." - ] - , Header 1 - ( "attributes", [], [] ) - [ Str "Attributes" ] - , Header 2 - ( "ident" - , - [ "bar", "foo" ] - , - [ ( "style", "color:red;" ), ( "lang", "en" ) ] - ) - [ Str "HTML" - , Space - , Str "and" - , Space - , Str "CSS" - , Space - , Str "attributes" - , Space - , Str "are" - , Space - , Str "parsed" - , Space - , Str "in" - , Space - , Str "headers." - ] - , Header 2 - ( "centered", [], [ ( "style", "text-align:center;" ) ] ) - [ Str "Centered" ] - , Header 2 - ( "right", [], [ ( "style", "text-align:right;" ) ] ) - [ Str "Right" ] - , Header 2 - ( "justified" - , [] - , - [ - ( "lang", "en" ) - , - ( "style", "color:blue;text-align:justify;" ) + [ Str "Textile" + , Space + , Str "inline" + , Space + , Str "image" + , Space + , Str "syntax," + , Space + , Str "like" + , LineBreak + , Str "here" + , Space + , Image + ( "" , [] , [] ) + [ Str "this is the alt text" ] + ( "this_is_an_image.png" , "this is the alt text" ) + , LineBreak + , Str "and" + , Space + , Str "here" + , Space + , Image + ( "" , [] , [] ) [ Str "" ] ( "this_is_an_image.png" , "" ) + , Str "." + ] + , Header 1 ( "attributes" , [] , [] ) [ Str "Attributes" ] + , Header + 2 + ( "ident" + , [ "bar" , "foo" ] + , [ ( "style" , "color:red;" ) , ( "lang" , "en" ) ] + ) + [ Str "HTML" + , Space + , Str "and" + , Space + , Str "CSS" + , Space + , Str "attributes" + , Space + , Str "are" + , Space + , Str "parsed" + , Space + , Str "in" + , Space + , Str "headers." ] - ) - [ Str "Justified" ] + , Header + 2 + ( "centered" , [] , [ ( "style" , "text-align:center;" ) ] ) + [ Str "Centered" ] + , Header + 2 + ( "right" , [] , [ ( "style" , "text-align:right;" ) ] ) + [ Str "Right" ] + , Header + 2 + ( "justified" + , [] + , [ ( "lang" , "en" ) + , ( "style" , "color:blue;text-align:justify;" ) + ] + ) + [ Str "Justified" ] , Para - [ Str "as" - , Space - , Str "well" - , Space - , Str "as" - , Space - , Strong - [ Span - ( "", [ "foo" ], [] ) - [ Str "inline", Space, Str "attributes" ] + [ Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Strong + [ Span + ( "" , [ "foo" ] , [] ) + [ Str "inline" , Space , Str "attributes" ] + ] + , Space + , Str "of" + , Space + , Span + ( "" , [] , [ ( "style" , "color:red;" ) ] ) + [ Str "all" , Space , Str "kind" ] ] - , Space - , Str "of" - , Space - , Span - ( "", [], [ ( "style", "color:red;" ) ] ) - [ Str "all", Space, Str "kind" ] - ] , Para - [ Str "and" - , Space - , Str "paragraph" - , Space - , Str "attributes," - , Space - , Str "and" - , Space - , Str "table" - , Space - , Str "attributes." - ] + [ Str "and" + , Space + , Str "paragraph" + , Space + , Str "attributes," + , Space + , Str "and" + , Space + , Str "table" + , Space + , Str "attributes." + ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "name" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "age" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "sex" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "joan" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "24" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Emph [ Str "(class#id)", Space, Str "emph" ] ] - , Para - [ Emph [ Str "(no", Space, Str "class#id)", Space, Str "emph" ] ] - , Header 1 - ( "entities", [], [] ) - [ Str "Entities" ] - , Para - [ Str "*", LineBreak, Str "&" ] - , Header 1 - ( "raw-html", [], [] ) - [ Str "Raw", Space, Str "HTML" ] - , Para - [ Str "However," - , Space - , RawInline - ( Format "html" ) "" - , Space - , Str "raw" - , Space - , Str "HTML" - , Space - , Str "inlines" - , Space - , RawInline - ( Format "html" ) "" - , Space - , Str "are" - , Space - , Str "accepted," - , Space - , Str "as" - , Space - , Str "well" - , Space - , Str "as" - , Space - , Str ":" - ] - , RawBlock - ( Format "html" ) "
" - , Para - [ Str "any" - , Space - , Strong - [ Str "Raw", Space, Str "HTML", Space, Str "Block" ] - , Space - , Str "with" - , Space - , Str "bold" - ] - , RawBlock - ( Format "html" ) "
" - , Para - [ Str "Html", Space, Str "blocks", Space, Str "can" ] - , RawBlock - ( Format "html" ) "
" - , Para - [ Str "interrupt", Space, Str "paragraphs" ] - , RawBlock - ( Format "html" ) "
" - , Para - [ Str "as", Space, Str "well." ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "name" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "age" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "sex" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "joan" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "24" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Para [ Emph [ Str "(class#id)" , Space , Str "emph" ] ] , Para - [ Str "Can" - , Space - , Str "you" - , Space - , Str "prove" - , Space - , Str "that" - , Space - , Str "2" - , Space - , Str "<" - , Space - , Str "3" - , Space - , Str "?" - ] - , Header 1 - ( "acronyms-and-marks", [], [] ) - [ Str "Acronyms", Space, Str "and", Space, Str "marks" ] + [ Emph + [ Str "(no" , Space , Str "class#id)" , Space , Str "emph" ] + ] + , Header 1 ( "entities" , [] , [] ) [ Str "Entities" ] + , Para [ Str "*" , LineBreak , Str "&" ] + , Header + 1 + ( "raw-html" , [] , [] ) + [ Str "Raw" , Space , Str "HTML" ] , Para - [ Str "PBS (Public Broadcasting System)" ] + [ Str "However," + , Space + , RawInline (Format "html") "" + , Space + , Str "raw" + , Space + , Str "HTML" + , Space + , Str "inlines" + , Space + , RawInline (Format "html") "" + , Space + , Str "are" + , Space + , Str "accepted," + , Space + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str ":" + ] + , RawBlock (Format "html") "
" , Para - [ Str "Hi\8482" ] + [ Str "any" + , Space + , Strong + [ Str "Raw" , Space , Str "HTML" , Space , Str "Block" ] + , Space + , Str "with" + , Space + , Str "bold" + ] + , RawBlock (Format "html") "
" , Para - [ Str "Hi", Space, Str "\8482" ] + [ Str "Html" , Space , Str "blocks" , Space , Str "can" ] + , RawBlock (Format "html") "
" + , Para [ Str "interrupt" , Space , Str "paragraphs" ] + , RawBlock (Format "html") "
" + , Para [ Str "as" , Space , Str "well." ] , Para - [ Str "\174", Space, Str "Hi\174" ] + [ Str "Can" + , Space + , Str "you" + , Space + , Str "prove" + , Space + , Str "that" + , Space + , Str "2" + , Space + , Str "<" + , Space + , Str "3" + , Space + , Str "?" + ] + , Header + 1 + ( "acronyms-and-marks" , [] , [] ) + [ Str "Acronyms" , Space , Str "and" , Space , Str "marks" ] + , Para [ Str "PBS (Public Broadcasting System)" ] + , Para [ Str "Hi\8482" ] + , Para [ Str "Hi" , Space , Str "\8482" ] + , Para [ Str "\174" , Space , Str "Hi\174" ] , Para - [ Str "Hi\169\&2008", Space, Str "\169", Space, Str "2008" ] - , Header 1 - ( "footnotes", [], [] ) - [ Str "Footnotes" ] + [ Str "Hi\169\&2008" + , Space + , Str "\169" + , Space + , Str "2008" + ] + , Header 1 ( "footnotes" , [] , [] ) [ Str "Footnotes" ] , Para - [ Str "A" - , Space - , Str "note." - , Note - [ Para - [ Str "The" - , Space - , Str "note" - , LineBreak - , Str "is" - , Space - , Str "here!" - ] + [ Str "A" + , Space + , Str "note." + , Note + [ Para + [ Str "The" + , Space + , Str "note" + , LineBreak + , Str "is" + , Space + , Str "here!" + ] + ] + , Space + , Str "Another" + , Space + , Str "note" + , Note [ Para [ Str "Other" , Space , Str "note." ] ] + , Str "." ] - , Space - , Str "Another" - , Space - , Str "note" - , Note - [ Para [ Str "Other", Space, Str "note." ] ] - , Str "." - ] - , Header 1 - ( "comment-blocks", [], [] ) - [ Str "Comment", Space, Str "blocks" ] + , Header + 1 + ( "comment-blocks" , [] , [] ) + [ Str "Comment" , Space , Str "blocks" ] , Para - [ Str "not", Space, Str "a", Space, Str "comment." ] + [ Str "not" , Space , Str "a" , Space , Str "comment." ] ] diff --git a/test/tikiwiki-reader.native b/test/tikiwiki-reader.native index eb10421da..3a3f1038f 100644 --- a/test/tikiwiki-reader.native +++ b/test/tikiwiki-reader.native @@ -1,761 +1,775 @@ Pandoc - ( Meta { unMeta = fromList [] } ) - [ Header 1 - ( "header", [], [] ) - [ Str "header" ] - , Header 2 - ( "header-level-two", [], [] ) - [ Str "header", Space, Str "level", Space, Str "two" ] - , Header 3 - ( "header-level-3", [], [] ) - [ Str "header", Space, Str "level", Space, Str "3" ] - , Header 4 - ( "header-_level_-four", [], [] ) - [ Str "header", Space, Str "_level_", Space, Str "four" ] - , Header 5 - ( "header-level-5", [], [] ) - [ Str "header", Space, Str "level", Space, Str "5" ] - , Header 6 - ( "header-level-6", [], [] ) - [ Str "header", Space, Str "level", Space, Str "6" ] - , Para - [ Str "!!!!!!!" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header" - ] - , Para - [ Str "--++" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header" - ] - , Header 1 - ( "emph-and-strong", [], [] ) - [ Str "emph", Space, Str "and", Space, Str "strong" ] + Meta { unMeta = fromList [] } + [ Header 1 ( "header" , [] , [] ) [ Str "header" ] + , Header + 2 + ( "header-level-two" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "two" ] + , Header + 3 + ( "header-level-3" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "3" ] + , Header + 4 + ( "header-_level_-four" , [] , [] ) + [ Str "header" + , Space + , Str "_level_" + , Space + , Str "four" + ] + , Header + 5 + ( "header-level-5" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "5" ] + , Header + 6 + ( "header-level-6" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "6" ] , Para - [ Emph [ Str "emph" ], Space, Strong [ Str "strong" ] ] + [ Str "!!!!!!!" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" + ] , Para - [ Emph - [ Strong - [ Str "strong" - , Space - , Str "and" - , Space - , Str "emph" - , Space - , Str "1" - ] + [ Str "--++" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "header" ] - ] + , Header + 1 + ( "emph-and-strong" , [] , [] ) + [ Str "emph" , Space , Str "and" , Space , Str "strong" ] + , Para + [ Emph [ Str "emph" ] , Space , Strong [ Str "strong" ] ] , Para - [ Strong [ Emph - [ Str "strong" - , Space - , Str "and" - , Space - , Str "emph" - , Space - , Str "2" - ] + [ Strong + [ Str "strong" + , Space + , Str "and" + , Space + , Str "emph" + , Space + , Str "1" + ] + ] ] - ] , Para - [ Strong - [ Emph [ Str "emph", Space, Str "inside" ], Space, Str "strong" ] - ] + [ Strong + [ Emph + [ Str "strong" + , Space + , Str "and" + , Space + , Str "emph" + , Space + , Str "2" + ] + ] + ] , Para - [ Strong - [ Str "strong", Space, Str "with", Space, Emph [ Str "emph" ] ] - ] + [ Strong + [ Emph [ Str "emph" , Space , Str "inside" ] + , Space + , Str "strong" + ] + ] , Para - [ Emph [ Strong - [ Str "strong", Space, Str "inside" ] - , Space - , Str "emph" + [ Str "strong" + , Space + , Str "with" + , Space + , Emph [ Str "emph" ] + ] ] - ] - , Header 1 - ( "horizontal-rule", [], [] ) - [ Str "horizontal", Space, Str "rule" ] , Para - [ Str "top" ] + [ Emph + [ Strong [ Str "strong" , Space , Str "inside" ] + , Space + , Str "emph" + ] + ] + , Header + 1 + ( "horizontal-rule" , [] , [] ) + [ Str "horizontal" , Space , Str "rule" ] + , Para [ Str "top" ] , HorizontalRule - , Para - [ Str "bottom" ] + , Para [ Str "bottom" ] , HorizontalRule - , Header 1 - ( "nop", [], [] ) - [ Str "nop" ] - , Para - [ Str "__not emph__" ] - , Header 1 - ( "entities", [], [] ) - [ Str "entities" ] - , Para - [ Str "hi", Space, Str "&", Space, Str "low" ] - , Para - [ Str "hi", Space, Str "&", Space, Str "low" ] - , Para - [ Str "G\246del" ] - , Para - [ Str "\777\2730" ] - , Header 1 - ( "linebreaks", [], [] ) - [ Str "linebreaks" ] - , Para - [ Str "hi", LineBreak, Str "there" ] - , Para - [ Str "hi", LineBreak, Str "there" ] - , Header 1 - ( "inline-code", [], [] ) - [ Str "inline", Space, Str "code" ] - , Para - [ Code - ( "", [], [] ) "*\8594*" - , Space - , Code - ( "", [], [] ) "typed" - , Space - , Code - ( "", [], [] ) ">>=" - ] - , Header 1 - ( "code-blocks", [], [] ) - [ Str "code", Space, Str "blocks" ] - , CodeBlock - ( "" - , [] - , [] - ) "\ncase xs of\n (_:_) -> reverse xs\n [] -> ['*']\n" - , CodeBlock - ( "" - , [ "haskell" ] - , - [ ( "colors", "haskell" ), ( "ln", "0" ) ] - ) "\ncase xs of\n (_:_) -> reverse xs\n [] -> ['*']\n" - , Header 1 - ( "external-links", [], [] ) - [ Str "external", Space, Str "links" ] + , Header 1 ( "nop" , [] , [] ) [ Str "nop" ] + , Para [ Str "__not emph__" ] + , Header 1 ( "entities" , [] , [] ) [ Str "entities" ] + , Para [ Str "hi" , Space , Str "&" , Space , Str "low" ] + , Para [ Str "hi" , Space , Str "&" , Space , Str "low" ] + , Para [ Str "G\246del" ] + , Para [ Str "\777\2730" ] + , Header 1 ( "linebreaks" , [] , [] ) [ Str "linebreaks" ] + , Para [ Str "hi" , LineBreak , Str "there" ] + , Para [ Str "hi" , LineBreak , Str "there" ] + , Header + 1 + ( "inline-code" , [] , [] ) + [ Str "inline" , Space , Str "code" ] , Para - [ Link - ( "", [], [] ) - [ Emph - [ Str "Google" ] + [ Code ( "" , [] , [] ) "*\8594*" , Space - , Str "search" + , Code ( "" , [] , [] ) "typed" , Space - , Str "engine" + , Code ( "" , [] , [] ) ">>=" ] - ( "http://google.com", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "http://pandoc.org" ] - ( "http://pandoc.org", "" ) - ] + , Header + 1 + ( "code-blocks" , [] , [] ) + [ Str "code" , Space , Str "blocks" ] + , CodeBlock + ( "" , [] , [] ) + "\ncase xs of\n (_:_) -> reverse xs\n [] -> ['*']\n" + , CodeBlock + ( "" + , [ "haskell" ] + , [ ( "colors" , "haskell" ) , ( "ln" , "0" ) ] + ) + "\ncase xs of\n (_:_) -> reverse xs\n [] -> ['*']\n" + , Header + 1 + ( "external-links" , [] , [] ) + [ Str "external" , Space , Str "links" ] , Para - [ Link - ( "", [], [] ) - [ Str "http://google.com" ] - ( "http://google.com", "" ) - , Space - , Link - ( "", [], [] ) - [ Str "http://yahoo.com" ] - ( "http://yahoo.com", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Emph [ Str "Google" ] + , Space + , Str "search" + , Space + , Str "engine" + ] + ( "http://google.com" , "" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "email", Space, Str "me" ] - ( "mailto:info@example.org", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "http://pandoc.org" ] + ( "http://pandoc.org" , "" ) + ] , Para - [ Str "http://google.com" ] + [ Link + ( "" , [] , [] ) + [ Str "http://google.com" ] + ( "http://google.com" , "" ) + , Space + , Link + ( "" , [] , [] ) + [ Str "http://yahoo.com" ] + ( "http://yahoo.com" , "" ) + ] , Para - [ Str "info@example.org" ] - , Header 1 - ( "lists", [], [] ) - [ Str "lists" ] + [ Link + ( "" , [] , [] ) + [ Str "email" , Space , Str "me" ] + ( "mailto:info@example.org" , "" ) + ] + , Para [ Str "http://google.com" ] + , Para [ Str "info@example.org" ] + , Header 1 ( "lists" , [] , [] ) [ Str "lists" ] , BulletList - [ - [ Plain [ Str "Start", Space, Str "each", Space, Str "line" ] ] - , - [ Plain - [ Str "with" - , Space - , Str "an" - , Space - , Str "asterisk" - , Space - , Str "(*)." + [ [ Plain + [ Str "Start" , Space , Str "each" , Space , Str "line" ] ] - , BulletList - [ - [ Plain - [ Str "More" + , [ Plain + [ Str "with" , Space - , Str "asterisks" + , Str "an" , Space - , Str "gives" + , Str "asterisk" , Space - , Str "deeper" + , Str "(*)." ] - , BulletList - [ - [ Plain - [ Str "and", Space, Str "deeper", Space, Str "levels." ] + , BulletList + [ [ Plain + [ Str "More" + , Space + , Str "asterisks" + , Space + , Str "gives" + , Space + , Str "deeper" + ] + , BulletList + [ [ 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" + , [ Plain + [ Str "Line" , Space - , Str "do" - , Space - , Str "not" + , Str "breaks" + , LineBreak + , Str "don't" , Space , Str "break" , Space - , Str "the" + , Str "levels." + ] + ] + , [ Plain + [ Str "Continuations" , Space - , Str "list" + , Str "are" + , Space + , Str "also" , Space - , Str "flow" + , Str "possible" + ] + , BulletList + [ [ 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" ] ] ] - , - [ Plain [ Str "Level", Space, Str "one" ] ] - ] , Para - [ Str "Any" - , Space - , Str "other" - , Space - , Str "start" - , Space - , Str "ends" - , Space - , Str "the" - , Space - , Str "list." - ] + [ 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" ] ] - , - [ Plain - [ Str "with" - , Space - , Str "a" - , Space - , Str "number" - , Space - , Str "(1.)." + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Start" , Space , Str "each" , Space , Str "line" ] ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "More" - , Space - , Str "number" + , [ Plain + [ Str "with" , Space - , Str "signs" + , Str "a" , Space - , Str "gives" + , Str "number" , Space - , Str "deeper" + , Str "(1.)." ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "and", Space, Str "deeper" ] ] - , - [ Plain [ Str "levels." ] ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ 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" ] ] + , [ Plain [ Str "levels." ] ] + ] + ] ] - ] ] - ] - , - [ Plain - [ Str "Line" - , Space - , Str "breaks" - , LineBreak - , Str "don't" - , Space - , Str "break" - , Space - , Str "levels." + , [ Plain + [ Str "Line" + , Space + , Str "breaks" + , LineBreak + , Str "don't" + , Space + , Str "break" + , Space + , Str "levels." + ] ] + , [ Plain [ Str "Blank" , Space , Str "lines" ] ] ] - , - [ 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." - ] - ] - ] - , 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" ] ] ] - ) - , - ( - [ Str "item", Space, Str "2" ] - , - [ - [ Plain - [ Str "definition" + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "end" , Space - , Str "2-1" + , Str "the" , Space - , Str "definition" + , Str "list" , Space - , Str "2-2" + , Str "and" + , Space + , Str "start" + , Space + , Str "another." ] - ] - ] - ) - , - ( - [ Str "item", Space, Emph [ Str "3" ] ] - , - [ [ Plain [ Str "definition", Space, Emph [ Str "3" ] ] ] ] - ) - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "one" ] ] - , - [ Plain - [ Str "two" ] - , BulletList - [ - [ 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" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "five" - , Space - , Str "sub" + , 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" ] ] ] + ) + , ( [ Str "item" , Space , Str "2" ] + , [ [ Plain + [ Str "definition" , Space - , Str "1" + , Str "2-1" , Space - , Str "sub" + , Str "definition" , Space - , Str "1" + , Str "2-2" ] - ] ] ] - , - [ Plain [ Str "five", Space, Str "sub", Space, Str "2" ] ] - ] - ] - ] - , Header 1 - ( "tables", [], [] ) - [ Str "tables" ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "" ] ] - ] + ) + , ( [ Str "item" , Space , Emph [ Str "3" ] ] + , [ [ Plain [ Str "definition" , Space , Emph [ Str "3" ] ] + ] + ] + ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Apple" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Bread" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Pie" ] ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "one" ] ] + , [ Plain [ Str "two" ] + , BulletList + [ [ Plain + [ Str "two" + , Space + , Str "point" + , Space + , Str "one" + ] + ] + , [ Plain + [ Str "two" + , Space + , Str "point" + , Space + , Str "two" + ] + ] + ] ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Butter" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Ice", Space, Str "cream" ] ] + , [ Plain [ Str "three" ] ] + , [ Plain [ Str "four" ] ] + , [ Plain [ Str "five" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ 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" + ] + ] + ] + ] + , [ Plain + [ Str "five" , Space , Str "sub" , Space , Str "2" ] + ] + ] ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + , Header 1 ( "tables" , [] , [] ) [ Str "tables" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Apple" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Bread" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Pie" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Strong [ Str "Butter" ] ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Ice", Space, Str "cream" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Apple" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Bread" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Pie" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Butter" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Ice" , Space , Str "cream" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Apple" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Bread" - , LineBreak - , LineBreak - , Str "and" - , Space - , Str "cheese" - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Apple" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Bread" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Pie" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Strong [ Str "Butter" ] ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Ice" , Space , Str "cream" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Pie" - , LineBreak - , LineBreak - , Strong - [ Str "apple" ] - , Space - , Str "and" - , Space - , Emph - [ Str "carrot" ] - , Space - ] + ] + (TableFoot ( "" , [] , [] ) []) + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Apple" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Bread" + , LineBreak + , LineBreak + , Str "and" + , Space + , Str "cheese" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Pie" + , LineBreak + , LineBreak + , Strong [ Str "apple" ] + , Space + , Str "and" + , Space + , Emph [ Str "carrot" ] + , Space + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Space, Str "Orange", Space ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Space, Str "Apple", Space ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Space, Str "more" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Space, Str "Bread", Space ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Space, Str "Pie", Space ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Space, Str "more" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Space, Str "Butter", Space ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Space, Str "Ice", Space, Str "cream", Space ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Space, Str "and", Space, Str "more", Space ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Space , Str "Orange" , Space ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Space , Str "Apple" , Space ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Space , Str "more" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Space , Str "Bread" , Space ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Space , Str "Pie" , Space ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Space , Str "more" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Space , Str "Butter" , Space ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Space + , Str "Ice" + , Space + , Str "cream" + , Space + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Space , Str "and" , Space , Str "more" , Space ] + ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) ] diff --git a/test/twiki-reader.native b/test/twiki-reader.native index d0a225712..e41301966 100644 --- a/test/twiki-reader.native +++ b/test/twiki-reader.native @@ -1,875 +1,863 @@ Pandoc - ( Meta { unMeta = fromList [] } ) - [ Header 1 - ( "header", [], [] ) - [ Str "header" ] - , Header 2 - ( "header-level-two", [], [] ) - [ Str "header", Space, Str "level", Space, Str "two" ] - , Header 3 - ( "header-level-3", [], [] ) - [ Str "header", Space, Str "level", Space, Str "3" ] - , Header 4 - ( "header-level-four", [], [] ) - [ Str "header", Space, Emph [ Str "level" ], Space, Str "four" ] - , Header 5 - ( "header-level-5", [], [] ) - [ Str "header", Space, Str "level", Space, Str "5" ] - , Header 6 - ( "header-level-6", [], [] ) - [ Str "header", Space, Str "level", Space, Str "6" ] - , Para - [ Str "---+++++++" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header" - ] - , Para - [ Str "--++" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header" - ] - , Header 1 - ( "emph-and-strong", [], [] ) - [ Str "emph", Space, Str "and", Space, Str "strong" ] - , Para - [ Emph [ Str "emph" ], Space, Strong [ Str "strong" ] ] - , Para - [ Emph - [ Strong [ Str "strong", Space, Str "and", Space, Str "emph" ] ] - ] - , Para - [ Strong - [ Emph [ Str "emph", Space, Str "inside" ], Space, Str "strong" ] - ] - , Para - [ Strong - [ Str "strong", Space, Str "with", Space, Emph [ Str "emph" ] ] - ] - , Para - [ Emph - [ Strong - [ Str "strong", Space, Str "inside" ] + Meta { unMeta = fromList [] } + [ Header 1 ( "header" , [] , [] ) [ Str "header" ] + , Header + 2 + ( "header-level-two" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "two" ] + , Header + 3 + ( "header-level-3" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "3" ] + , Header + 4 + ( "header-level-four" , [] , [] ) + [ Str "header" + , Space + , Emph [ Str "level" ] , Space - , Str "emph" + , Str "four" ] - ] - , Header 1 - ( "horizontal-rule", [], [] ) - [ Str "horizontal", Space, Str "rule" ] - , Para - [ Str "top" ] - , HorizontalRule - , Para - [ Str "bottom" ] - , HorizontalRule - , Header 1 - ( "nop", [], [] ) - [ Str "nop" ] - , Para - [ Str "_not", Space, Str "emph_" ] - , Header 1 - ( "entities", [], [] ) - [ Str "entities" ] - , Para - [ Str "hi", Space, Str "&", Space, Str "low" ] - , Para - [ Str "hi", Space, Str "&", Space, Str "low" ] - , Para - [ Str "G\246del" ] - , Para - [ Str "\777\2730" ] - , Header 1 - ( "comments", [], [] ) - [ Str "comments" ] - , Para - [ Str "inline", Space, Str "comment" ] - , Para - [ Str "between", Space, Str "blocks" ] - , Header 1 - ( "linebreaks", [], [] ) - [ Str "linebreaks" ] - , Para - [ Str "hi", LineBreak, Str "there" ] - , Para - [ Str "hi", LineBreak, Str "there" ] - , Header 1 - ( "inline-code", [], [] ) - [ Str "inline", Space, Str "code" ] - , Para - [ Code - ( "", [], [] ) "*\8594*" - , Space - , Code - ( "", [], [] ) "typed" - , Space - , Code - ( "", [ "haskell" ], [] ) ">>=" - ] - , Header 1 - ( "code-blocks", [], [] ) - [ Str "code", Space, Str "blocks" ] - , CodeBlock - ( "" - , [] - , [] - ) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" - , CodeBlock - ( "" - , [ "haskell" ] - , [] - ) "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" - , Header 1 - ( "block-quotes", [], [] ) - [ Str "block", Space, Str "quotes" ] - , Para - [ Str "Regular", Space, Str "paragraph" ] - , BlockQuote - [ Para - [ Str "This" + , Header + 5 + ( "header-level-5" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "5" ] + , Header + 6 + ( "header-level-6" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "6" ] + , Para + [ Str "---+++++++" , Space - , Str "is" + , Str "not" , Space , Str "a" , Space - , Str "block" - , Space - , Str "quote." + , Str "header" ] - , Para - [ Str "With", Space, Str "two", Space, Str "paragraphs." ] - ] , Para - [ Str "Nother", Space, Str "paragraph." ] - , Header 1 - ( "external-links", [], [] ) - [ Str "external", Space, Str "links" ] - , Para - [ Link - ( "", [], [] ) - [ Emph - [ Str "Google" ] + [ Str "--++" + , Space + , Str "not" , Space - , Str "search" + , Str "a" , Space - , Str "engine" + , Str "header" ] - ( "http://google.com", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "http://pandoc.org" ] - ( "http://pandoc.org", "" ) - ] + , Header + 1 + ( "emph-and-strong" , [] , [] ) + [ Str "emph" , Space , Str "and" , Space , Str "strong" ] , Para - [ Link - ( "", [], [] ) - [ Str "http://google.com" ] - ( "http://google.com", "" ) - , Space - , Link - ( "", [], [] ) - [ Str "http://yahoo.com" ] - ( "http://yahoo.com", "" ) - ] + [ Emph [ Str "emph" ] , Space , Strong [ Str "strong" ] ] , Para - [ Link - ( "", [], [] ) - [ Str "email", Space, Str "me" ] - ( "mailto:info@example.org", "" ) - ] + [ Emph + [ Strong + [ Str "strong" , Space , Str "and" , Space , Str "emph" ] + ] + ] , Para - [ Str "http://google.com" ] + [ Strong + [ Emph [ Str "emph" , Space , Str "inside" ] + , Space + , Str "strong" + ] + ] , Para - [ Str "http://google.com" ] + [ Strong + [ Str "strong" + , Space + , Str "with" + , Space + , Emph [ Str "emph" ] + ] + ] , Para - [ Str "http://google.com" ] + [ Emph + [ Strong [ Str "strong" , Space , Str "inside" ] + , Space + , Str "emph" + ] + ] + , Header + 1 + ( "horizontal-rule" , [] , [] ) + [ Str "horizontal" , Space , Str "rule" ] + , Para [ Str "top" ] + , HorizontalRule + , Para [ Str "bottom" ] + , HorizontalRule + , Header 1 ( "nop" , [] , [] ) [ Str "nop" ] + , Para [ Str "_not" , Space , Str "emph_" ] + , Header 1 ( "entities" , [] , [] ) [ Str "entities" ] + , Para [ Str "hi" , Space , Str "&" , Space , Str "low" ] + , Para [ Str "hi" , Space , Str "&" , Space , Str "low" ] + , Para [ Str "G\246del" ] + , Para [ Str "\777\2730" ] + , Header 1 ( "comments" , [] , [] ) [ Str "comments" ] + , Para [ Str "inline" , Space , Str "comment" ] + , Para [ Str "between" , Space , Str "blocks" ] + , Header 1 ( "linebreaks" , [] , [] ) [ Str "linebreaks" ] + , Para [ Str "hi" , LineBreak , Str "there" ] + , Para [ Str "hi" , LineBreak , Str "there" ] + , Header + 1 + ( "inline-code" , [] , [] ) + [ Str "inline" , Space , Str "code" ] + , Para + [ Code ( "" , [] , [] ) "*\8594*" + , Space + , Code ( "" , [] , [] ) "typed" + , Space + , Code ( "" , [ "haskell" ] , [] ) ">>=" + ] + , Header + 1 + ( "code-blocks" , [] , [] ) + [ Str "code" , Space , Str "blocks" ] + , CodeBlock + ( "" , [] , [] ) + "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" + , CodeBlock + ( "" , [ "haskell" ] , [] ) + "case xs of\n (_:_) -> reverse xs\n [] -> ['*']" + , Header + 1 + ( "block-quotes" , [] , [] ) + [ Str "block" , Space , Str "quotes" ] + , Para [ Str "Regular" , Space , Str "paragraph" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + ] + , Para + [ Str "With" + , Space + , Str "two" + , Space + , Str "paragraphs." + ] + ] + , Para [ Str "Nother" , Space , Str "paragraph." ] + , Header + 1 + ( "external-links" , [] , [] ) + [ Str "external" , Space , Str "links" ] + , Para + [ Link + ( "" , [] , [] ) + [ Emph [ Str "Google" ] + , Space + , Str "search" + , Space + , Str "engine" + ] + ( "http://google.com" , "" ) + ] , Para - [ Str "info@example.org" ] + [ Link + ( "" , [] , [] ) + [ Str "http://pandoc.org" ] + ( "http://pandoc.org" , "" ) + ] , Para - [ Str "info@example.org" ] + [ Link + ( "" , [] , [] ) + [ Str "http://google.com" ] + ( "http://google.com" , "" ) + , Space + , Link + ( "" , [] , [] ) + [ Str "http://yahoo.com" ] + ( "http://yahoo.com" , "" ) + ] , Para - [ Str "info@example.org" ] - , Header 1 - ( "lists", [], [] ) - [ Str "lists" ] + [ Link + ( "" , [] , [] ) + [ Str "email" , Space , Str "me" ] + ( "mailto:info@example.org" , "" ) + ] + , Para [ Str "http://google.com" ] + , Para [ Str "http://google.com" ] + , Para [ Str "http://google.com" ] + , Para [ Str "info@example.org" ] + , Para [ Str "info@example.org" ] + , Para [ Str "info@example.org" ] + , Header 1 ( "lists" , [] , [] ) [ Str "lists" ] , BulletList - [ - [ Plain [ Str "Start", Space, Str "each", Space, Str "line" ] ] - , - [ Plain - [ Str "with" - , Space - , Str "an" - , Space - , Str "asterisk" - , Space - , Str "(*)." + [ [ Plain + [ Str "Start" , Space , Str "each" , Space , Str "line" ] ] - , BulletList - [ - [ Plain - [ Str "More" + , [ Plain + [ Str "with" , Space - , Str "asterisks" + , Str "an" , Space - , Str "gives" + , Str "asterisk" , Space - , Str "deeper" + , Str "(*)." ] - , BulletList - [ - [ Plain - [ Str "and", Space, Str "deeper", Space, Str "levels." ] + , BulletList + [ [ Plain + [ Str "More" + , Space + , Str "asterisks" + , Space + , Str "gives" + , Space + , Str "deeper" + ] + , BulletList + [ [ 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" + , [ Plain + [ Str "Line" , Space - , Str "not" + , Str "breaks" + , LineBreak + , Str "don't" , Space , Str "break" , Space - , Str "the" + , Str "levels." + ] + ] + , [ Plain + [ Str "Continuations" , Space - , Str "list" + , Str "are" + , Space + , Str "also" , Space - , Str "flow" + , Str "possible" + ] + , BulletList + [ [ 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" ] ] ] - , - [ Plain [ Str "Level", Space, Str "one" ] ] - ] , Para - [ Str "Any" - , Space - , Str "other" - , Space - , Str "start" - , Space - , Str "ends" - , Space - , Str "the" - , Space - , Str "list." - ] + [ 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" ] ] - , - [ Plain - [ Str "with" - , Space - , Str "a" - , Space - , Str "number" - , Space - , Str "(1.)." + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Start" , Space , Str "each" , Space , Str "line" ] ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "More" + , [ Plain + [ Str "with" , Space - , Str "number" - , Space - , Str "signs" + , Str "a" , Space - , Str "gives" + , Str "number" , Space - , Str "deeper" + , Str "(1.)." ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "and", Space, Str "deeper" ] ] - , - [ Plain [ Str "levels." ] ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ 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" ] ] + , [ Plain [ Str "levels." ] ] + ] + ] ] - ] ] - ] - , - [ Plain - [ Str "Line" - , Space - , Str "breaks" - , LineBreak - , Str "don't" - , Space - , Str "break" - , Space - , Str "levels." + , [ Plain + [ Str "Line" + , Space + , Str "breaks" + , LineBreak + , Str "don't" + , Space + , Str "break" + , Space + , Str "levels." + ] ] + , [ Plain [ Str "Blank" , Space , Str "lines" ] ] ] - , - [ 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." - ] - ] - ] - , 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" ] ] ] - ) - , - ( - [ Str "item", Space, Str "2" ] - , - [ - [ Plain - [ Str "definition" + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "end" , Space - , Str "2-1" + , Str "the" , Space - , Str "definition" + , Str "list" , Space - , Str "2-2" + , Str "and" + , Space + , Str "start" + , Space + , Str "another." ] - ] - ] - ) - , - ( - [ Str "item", Space, Emph [ Str "3" ] ] - , - [ [ Plain [ Str "definition", Space, Emph [ Str "3" ] ] ] ] - ) - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "one" ] ] - , - [ Plain - [ Str "two" ] - , BulletList - [ - [ Plain [ Str "two", Space, Str "point", Space, Str "one" ] ] - , - [ Plain [ Str "two", Space, Str "point", Space, Str "two" ] ] ] ] - , - [ Plain - [ Str "three" ] - , DefinitionList - [ - ( - [ Str "three", Space, Str "item", Space, Str "one" ] - , - [ - [ Plain - [ Str "three", Space, Str "def", Space, Str "one" ] - ] - ] - ) - ] + , Para + [ Str "Any" + , Space + , Str "other" + , Space + , Str "start" + , Space + , Str "also" + , Space + , Str "ends" + , Space + , Str "the" + , Space + , Str "list." ] - , - [ Plain - [ Str "four" ] - , DefinitionList - [ - ( - [ Str "four", Space, Str "def", Space, Str "one" ] - , - [ - [ Plain - [ Str "this" + , DefinitionList + [ ( [ Str "item" , Space , Str "1" ] + , [ [ Plain [ Str "definition" , Space , Str "1" ] ] ] + ) + , ( [ Str "item" , Space , Str "2" ] + , [ [ Plain + [ Str "definition" , Space - , Str "is" + , Str "2-1" , Space - , Str "a" + , Str "definition" , Space - , Str "continuation" + , Str "2-2" ] + ] + ] + ) + , ( [ Str "item" , Space , Emph [ Str "3" ] ] + , [ [ Plain [ Str "definition" , Space , Emph [ Str "3" ] ] + ] + ] + ) + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "one" ] ] + , [ Plain [ Str "two" ] + , BulletList + [ [ Plain + [ Str "two" + , Space + , Str "point" + , Space + , Str "one" + ] + ] + , [ Plain + [ Str "two" + , Space + , Str "point" + , Space + , Str "two" + ] ] ] - ) ] - ] - , - [ Plain - [ Str "five" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ 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" + , [ Plain [ Str "three" ] + , DefinitionList + [ ( [ Str "three" , Space , Str "item" , Space , Str "one" ] + , [ [ Plain + [ Str "three" + , Space + , Str "def" + , Space + , Str "one" + ] + ] ] - ] + ) ] - ] - , - [ Plain [ Str "five", Space, Str "sub", Space, Str "2" ] ] ] - ] - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "other" ] - , OrderedList - ( 1, UpperRoman, DefaultDelim ) - [ [ Plain [ Str "list" ] ], [ Plain [ Str "styles" ] ] ] - ] - , - [ Plain - [ Str "are" ] - , OrderedList - ( 1, LowerRoman, DefaultDelim ) - [ [ Plain [ Str "also" ] ], [ Plain [ Str "possible" ] ] ] - ] - , - [ Plain - [ Str "all" ] - , OrderedList - ( 1, LowerAlpha, DefaultDelim ) - [ - [ Plain [ Str "the" ] ] - , - [ Plain [ Str "different" ] ] - , - [ Plain [ Str "styles" ] ] + , [ Plain [ Str "four" ] + , DefinitionList + [ ( [ Str "four" , Space , Str "def" , Space , Str "one" ] + , [ [ Plain + [ Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "continuation" + ] + ] + ] + ) + ] ] - ] - , - [ Plain - [ Str "are" ] - , OrderedList - ( 1, UpperAlpha, DefaultDelim ) - [ - [ Plain [ Str "implemented" ] ] - , - [ Plain [ Str "and" ] ] - , - [ Plain [ Str "supported" ] ] + , [ Plain [ Str "five" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ 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" + ] + ] + ] + ] + , [ Plain + [ Str "five" , Space , Str "sub" , Space , Str "2" ] + ] + ] ] ] - ] - , Header 1 - ( "tables", [], [] ) - [ Str "tables" ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "other" ] + , OrderedList + ( 1 , UpperRoman , DefaultDelim ) + [ [ Plain [ Str "list" ] ] , [ Plain [ Str "styles" ] ] ] ] - ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Apple" ] ] + , [ Plain [ Str "are" ] + , OrderedList + ( 1 , LowerRoman , DefaultDelim ) + [ [ Plain [ Str "also" ] ] , [ Plain [ Str "possible" ] ] ] ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Bread" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Pie" ] ] + , [ Plain [ Str "all" ] + , OrderedList + ( 1 , LowerAlpha , DefaultDelim ) + [ [ Plain [ Str "the" ] ] + , [ Plain [ Str "different" ] ] + , [ Plain [ Str "styles" ] ] + ] ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Butter" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Ice", Space, Str "cream" ] ] + , [ Plain [ Str "are" ] + , OrderedList + ( 1 , UpperAlpha , DefaultDelim ) + [ [ Plain [ Str "implemented" ] ] + , [ Plain [ Str "and" ] ] + , [ Plain [ Str "supported" ] ] + ] ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + , Header 1 ( "tables" , [] , [] ) [ Str "tables" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignLeft, ColWidthDefault ), ( AlignLeft, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Apple" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Bread" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Pie" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Strong [ Str "Butter" ] ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Ice", Space, Str "cream" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Apple" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Bread" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Pie" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Butter" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Ice" , Space , Str "cream" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignLeft, ColWidthDefault ), ( AlignLeft, ColWidthDefault ) ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Apple" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Bread" - , LineBreak - , LineBreak - , Str "and" - , Space - , Str "cheese" - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Apple" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Bread" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Pie" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Strong [ Str "Butter" ] ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Ice" , Space , Str "cream" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "Pie" - , LineBreak - , LineBreak - , Strong - [ Str "apple" ] - , Space - , Str "and" - , Space - , Emph - [ Str "carrot" ] - ] + ] + (TableFoot ( "" , [] , [] ) []) + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignLeft , ColWidthDefault ) + , ( AlignLeft , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Apple" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Bread" + , LineBreak + , LineBreak + , Str "and" + , Space + , Str "cheese" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "Pie" + , LineBreak + , LineBreak + , Strong [ Str "apple" ] + , Space + , Str "and" + , Space + , Emph [ Str "carrot" ] + ] + ] + ] ] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Orange" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Apple" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "more" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Bread" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Pie" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "more" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Butter" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Ice", Space, Str "cream" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "and", Space, Str "more" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Orange" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Apple" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "more" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Bread" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Pie" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "more" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Butter" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Ice" , Space , Str "cream" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "and" , Space , Str "more" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 1 - ( "macros", [], [] ) - [ Str "macros" ] - , Para - [ Span ( "", [ "twiki-macro", "TEST" ], [] ) [] ] + (TableFoot ( "" , [] , [] ) []) + , Header 1 ( "macros" , [] , [] ) [ Str "macros" ] + , Para [ Span ( "" , [ "twiki-macro" , "TEST" ] , [] ) [] ] , Para - [ Span ( "", [ "twiki-macro", "TEST" ], [] ) [ Str "" ] ] + [ Span ( "" , [ "twiki-macro" , "TEST" ] , [] ) [ Str "" ] ] , Para - [ Span - ( "", [ "twiki-macro", "TEST" ], [] ) - [ Str "content with spaces" ] - ] + [ Span + ( "" , [ "twiki-macro" , "TEST" ] , [] ) + [ Str "content with spaces" ] + ] , Para - [ Span - ( "", [ "twiki-macro", "TEST" ], [] ) - [ Str "content with spaces" ] - ] + [ Span + ( "" , [ "twiki-macro" , "TEST" ] , [] ) + [ Str "content with spaces" ] + ] , Para - [ Span - ( "", [ "twiki-macro", "TEST" ], [ ( "ARG1", "test" ) ] ) - [ Str "content with spaces" ] - ] + [ Span + ( "" + , [ "twiki-macro" , "TEST" ] + , [ ( "ARG1" , "test" ) ] + ) + [ Str "content with spaces" ] + ] , Para - [ Span - ( "", [ "twiki-macro", "TEST" ], [] ) - [ Str "content with spaces ARG1=test" ] - ] + [ Span + ( "" , [ "twiki-macro" , "TEST" ] , [] ) + [ Str "content with spaces ARG1=test" ] + ] , Para - [ Span - ( "", [ "twiki-macro", "TEST" ], [ ( "ARG1", "test" ) ] ) - [ Str "content with spaces" ] - ] + [ Span + ( "" + , [ "twiki-macro" , "TEST" ] + , [ ( "ARG1" , "test" ) ] + ) + [ Str "content with spaces" ] + ] , Para - [ Span - ( "" - , - [ "twiki-macro", "TEST" ] - , - [ ( "ARG1", "test" ), ( "ARG2", "test2" ) ] - ) - [ Str "" ] - ] + [ Span + ( "" + , [ "twiki-macro" , "TEST" ] + , [ ( "ARG1" , "test" ) , ( "ARG2" , "test2" ) ] + ) + [ Str "" ] + ] , Para - [ Span - ( "" - , - [ "twiki-macro", "TEST" ] - , - [ ( "ARG1", "test" ), ( "ARG2", "test2" ) ] - ) - [ Str "" ] - ] + [ Span + ( "" + , [ "twiki-macro" , "TEST" ] + , [ ( "ARG1" , "test" ) , ( "ARG2" , "test2" ) ] + ) + [ Str "" ] + ] , Para - [ Span - ( "" - , - [ "twiki-macro", "TEST" ] - , - [ ( "ARG1", "test" ), ( "ARG2", "test2" ) ] - ) - [ Str "multiline\ndoes also work" ] - ] + [ Span + ( "" + , [ "twiki-macro" , "TEST" ] + , [ ( "ARG1" , "test" ) , ( "ARG2" , "test2" ) ] + ) + [ Str "multiline\ndoes also work" ] + ] ] diff --git a/test/txt2tags.native b/test/txt2tags.native index ccc8dd36e..5c60fbb4d 100644 --- a/test/txt2tags.native +++ b/test/txt2tags.native @@ -1,2244 +1,322 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "author", MetaList [ MetaInlines [ Str "author" ] ] ) - , - ( "date", MetaInlines [ Str "date" ] ) - , - ( "includeconf", MetaString "rules.conf" ) - , - ( "title" - , MetaInlines - [ Str "Txt2tags", Space, Str "Markup", Space, Str "Rules" ] - ) - ] + Meta + { unMeta = + fromList + [ ( "author" , MetaList [ MetaInlines [ Str "author" ] ] ) + , ( "date" , MetaInlines [ Str "date" ] ) + , ( "includeconf" , MetaString "rules.conf" ) + , ( "title" + , MetaInlines + [ Str "Txt2tags" + , Space + , Str "Markup" + , Space + , Str "Rules" + ] + ) + ] } - ) [ Para - [ Str "This" - , Space - , Str "document" - , Space - , Str "describes" - , Space - , Str "all" - , Space - , Str "the" - , Space - , Str "details" - , Space - , Str "about" - , Space - , Str "each" - , Space - , Str "txt2tags" - , Space - , Str "mark." - , SoftBreak - , Str "The" - , Space - , Str "target" - , Space - , Str "audience" - , Space - , Str "are" - , Space - , Strong - [ Str "experienced" ] - , Space - , Str "users." - , Space - , Str "You" - , Space - , Str "may" - , Space - , Str "find" - , Space - , Str "it" - , SoftBreak - , Str "useful" - , Space - , Str "if" - , Space - , Str "you" - , Space - , Str "want" - , Space - , Str "to" - , Space - , Str "master" - , Space - , Str "the" - , Space - , Str "marks" - , Space - , Str "or" - , Space - , Str "solve" - , Space - , Str "a" - , Space - , Str "specific" - , Space - , Str "problem" - , SoftBreak - , Str "about" - , Space - , Str "a" - , Space - , Str "mark." - ] - , Para - [ Str "If" - , Space - , Str "you" - , Space - , Str "are" - , Space - , Str "new" - , Space - , Str "to" - , Space - , Str "txt2tags" - , Space - , Str "or" - , Space - , Str "just" - , Space - , Str "want" - , Space - , Str "to" - , Space - , Str "know" - , Space - , Str "which" - , Space - , Str "are" - , Space - , Str "the" - , SoftBreak - , Str "available" - , Space - , Str "marks," - , Space - , Str "please" - , Space - , Str "read" - , Space - , Str "the" - , Space - , Link - ( "", [], [] ) - [ Str "Markup", Space, Str "Demo" ] - ( "MARKUPDEMO", "" ) - , Str "." - ] - , Para - [ Str "Note" - , Space - , Str "1:" - , Space - , Str "This" - , Space - , Str "document" - , Space - , Str "is" - , Space - , Str "generated" - , Space - , Str "directly" - , Space - , Str "from" - , Space - , Str "the" - , Space - , Str "txt2tags" - , SoftBreak - , Str "test-suite." - , Space - , Str "All" - , Space - , Str "the" - , Space - , Str "rules" - , Space - , Str "mentioned" - , Space - , Str "here" - , Space - , Str "are" - , Space - , Str "100%" - , Space - , Str "in" - , Space - , Str "sync" - , Space - , Str "with" - , Space - , Str "the" - , SoftBreak - , Str "current" - , Space - , Str "program" - , Space - , Str "code." - ] - , Para - [ Str "Note" - , Space - , Str "2:" - , Space - , Str "A" - , Space - , Str "good" - , Space - , Str "practice" - , Space - , Str "is" - , Space - , Str "to" - , Space - , Str "consult" - , Space - , Link - ( "", [], [] ) - [ Str "the", Space, Str "sources" ] - ( "rules.t2t", "" ) - , Space - , Str "when" - , SoftBreak - , Str "reading," - , Space - , Str "to" - , Space - , Str "see" - , Space - , Str "how" - , Space - , Str "the" - , Space - , Str "texts" - , Space - , Str "were" - , Space - , Str "made." - ] - , Para - [ Str "Table", Space, Str "of", Space, Str "Contents:" ] - , HorizontalRule - , Header 1 - ( "paragraph", [], [] ) - [ Str "Paragraph" ] - , Para - [ Str "A" - , Space - , Str "paragraph" - , Space - , Str "is" - , Space - , Str "composed" - , Space - , Str "by" - , Space - , Str "one" - , Space - , Str "or" - , Space - , Str "more" - , Space - , Str "lines." - , SoftBreak - , Str "A" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "(or" - , Space - , Str "a" - , Space - , Str "table," - , Space - , Str "or" - , Space - , Str "a" - , Space - , Str "list)" - , Space - , Str "ends" - , Space - , Str "the" - , SoftBreak - , Str "current" - , Space - , Str "paragraph." - ] - , Para - [ Str "Leading" - , Space - , Str "and" - , Space - , Str "trailing" - , Space - , Str "spaces" - , Space - , Str "are" - , Space - , Str "ignored." - ] - , Para - [ Str "A" - , Space - , Str "comment" - , Space - , Str "line" - , Space - , Str "can" - , Space - , Str "be" - , Space - , Str "placed" - , Space - , Str "inside" - , Space - , Str "a" - , Space - , Str "paragraph." - , SoftBreak - , Str "It" - , Space - , Str "will" - , Space - , Str "not" - , Space - , Str "affect" - , Space - , Str "it." - ] - , Para - [ Str "The" - , Space - , Str "end" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "file" - , Space - , Str "(EOF)" - , Space - , Str "closes" - , Space - , Str "the" - , SoftBreak - , Str "currently" - , Space - , Str "open" - , Space - , Str "paragraph." - ] - , Header 1 - ( "comment", [], [] ) - [ Str "Comment" ] - , Para - [ Str "%" - , Space - , Str "not" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "line" - , Space - , Str "beginning" - , Space - , Str "(at" - , Space - , Str "column" - , Space - , Str "2)" - ] - , Para - [ Str "some" - , Space - , Str "text" - , Space - , Str "%" - , Space - , Str "half" - , Space - , Str "line" - , Space - , Str "comments" - , Space - , Str "are" - , Space - , Str "not" - , Space - , Str "allowed" - ] - , Header 1 - ( "line", [], [] ) - [ Str "Line" ] - , HorizontalRule - , HorizontalRule - , HorizontalRule - , HorizontalRule - , HorizontalRule - , HorizontalRule - , HorizontalRule - , HorizontalRule - , HorizontalRule - , HorizontalRule - , HorizontalRule - , Para - [ Strikeout - [ Str "-----" ] - , SoftBreak - , Strikeout - [ Str "-------", Space, Str "--------" ] - ] - , Para - [ Strikeout [ Str "-------+--------" ] ] - , Para - [ Str "(" - , Space - , Strikeout - [ Str "----------------" ] - , Space - , Str ")" - ] - , Header 1 - ( "inline", [], [] ) - [ Str "Inline" ] - , Para - [ Str "i)" - , Space - , Strong - [ Str "b" ] - , Space - , Emph - [ Str "i" ] - , Space - , Underline - [ Str "u" ] - , Space - , Strikeout - [ Str "s" ] - , Space - , Code - ( "", [], [] ) "m" - , Space - , Str "r" - , Space - , RawInline - ( Format "html" ) "t" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "bo" ] - , Space - , Emph - [ Str "it" ] - , Space - , Underline - [ Str "un" ] - , Space - , Strikeout - [ Str "st" ] - , Space - , Code - ( "", [], [] ) "mo" - , Space - , Str "ra" - , Space - , RawInline - ( Format "html" ) "tg" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "bold" ] - , Space - , Emph - [ Str "ital" ] - , Space - , Underline - [ Str "undr" ] - , Space - , Strikeout - [ Str "strk" ] - , Space - , Code - ( "", [], [] ) "mono" - , Space - , Str "raw" - , Space - , RawInline - ( Format "html" ) "tggd" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "bo", Space, Str "ld" ] - , Space - , Emph - [ Str "it", Space, Str "al" ] - , Space - , Underline - [ Str "un", Space, Str "dr" ] - , Space - , Strikeout - [ Str "st", Space, Str "rk" ] - , Space - , Code - ( "", [], [] ) "mo no" - , Space - , Str "r" - , Space - , Str "aw" - , Space - , RawInline - ( Format "html" ) "tg gd" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "bo", Space, Str "*", Space, Str "ld" ] - , Space - , Emph - [ Str "it", Space, Str "/", Space, Str "al" ] - , Space - , Underline - [ Str "un", Space, Str "_", Space, Str "dr" ] - , Space - , Strikeout - [ Str "st", Space, Str "-", Space, Str "rk" ] - , Space - , Code - ( "", [], [] ) "mo ` no" - , Space - , Str "r" - , Space - , Str "\"" - , Space - , Str "aw" - , Space - , RawInline - ( Format "html" ) "tg ' gd" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "bo", Space, Str "**ld" ] - , Space - , Emph - [ Str "it", Space, Str "//al" ] - , Space - , Underline - [ Str "un", Space, Str "__dr" ] - , Space - , Strikeout - [ Str "st", Space, Str "--rk" ] - , Space - , Code - ( "", [], [] ) "mo ``no" - , Space - , Str "r" - , Space - , Str "\"\"aw" - , Space - , RawInline - ( Format "html" ) "tg ''gd" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "bo", Space, Str "**", Space, Str "ld" ] - , Space - , Emph - [ Str "it", Space, Str "//", Space, Str "al" ] - , Space - , Underline - [ Str "un", Space, Str "__", Space, Str "dr" ] - , Space - , Strikeout - [ Str "st", Space, Str "--", Space, Str "rk" ] - , Space - , Code - ( "", [], [] ) "mo `` no" - , Space - , Str "r" - , Space - , Str "\"\"" - , Space - , Str "aw" - , Space - , RawInline - ( Format "html" ) "tg '' gd" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "**bold**" ] - , Space - , Emph - [ Str "//ital//" ] - , Space - , Underline - [ Str "__undr__" ] - , Space - , Strikeout - [ Str "--strk--" ] - , Space - , Code - ( "", [], [] ) "``mono``" - , Space - , Str "\"\"raw\"\"" - , Space - , RawInline - ( Format "html" ) "''tggd''" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "*bold*" ] - , Space - , Emph - [ Str "/ital/" ] - , Space - , Underline - [ Str "_undr_" ] - , Space - , Strikeout - [ Str "-strk-" ] - , Space - , Code - ( "", [], [] ) "`mono`" - , Space - , Str "\"raw\"" - , Space - , RawInline - ( Format "html" ) "'tggd'" - ] - , Para - [ Str "i)" - , Space - , Strong - [ Str "*" ] - , Space - , Emph - [ Str "/" ] - , Space - , Underline - [ Str "_" ] - , Space - , Strikeout - [ Str "-" ] - , Space - , Code - ( "", [], [] ) "`" - , Space - , Str "\"" - , Space - , RawInline - ( Format "html" ) "'" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "**" ] - , Space - , Emph - [ Str "//" ] - , Space - , Underline - [ Str "__" ] - , Space - , Strikeout - [ Str "--" ] - , Space - , Code - ( "", [], [] ) "``" - , Space - , Str "\"\"" - , Space - , RawInline - ( Format "html" ) "''" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "***" ] - , Space - , Emph - [ Str "///" ] - , Space - , Underline - [ Str "___" ] - , Space - , Strikeout - [ Str "---" ] - , Space - , Code - ( "", [], [] ) "```" - , Space - , Str "\"\"\"" - , Space - , RawInline - ( Format "html" ) "'''" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "****" ] - , Space - , Emph - [ Str "////" ] - , Space - , Underline - [ Str "____" ] - , Space - , Strikeout - [ Str "----" ] - , Space - , Code - ( "", [], [] ) "````" - , Space - , Str "\"\"\"\"" - , Space - , RawInline - ( Format "html" ) "''''" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "*****" ] - , Space - , Emph - [ Str "/////" ] - , Space - , Underline - [ Str "_____" ] - , Space - , Strikeout - [ Str "-----" ] - , Space - , Code - ( "", [], [] ) "`````" - , Space - , Str "\"\"\"\"\"" - , Space - , RawInline - ( Format "html" ) "'''''" - , SoftBreak - , Str "i)" - , Space - , Strong - [ Str "******" ] - , Space - , Emph - [ Str "//////" ] - , Space - , Underline - [ Str "______" ] - , Space - , Strikeout - [ Str "------" ] - , Space - , Code - ( "", [], [] ) "``````" - , Space - , Str "\"\"\"\"\"\"" - , Space - , RawInline - ( Format "html" ) "''''''" - ] - , Para - [ Str "i)" - , Space - , Str "****" - , Space - , Str "////" - , Space - , Str "____" - , Space - , Str "----" - , Space - , Str "````" - , Space - , Str "\"\"\"\"" - , Space - , Str "''''" - , SoftBreak - , Str "i)" - , Space - , Str "**" - , Space - , Str "**" - , Space - , Str "//" - , Space - , Str "//" - , Space - , Str "__" - , Space - , Str "__" - , Space - , Str "--" - , Space - , Str "--" - , Space - , Str "``" - , Space - , Str "``" - , Space - , Str "\"\"" - , Space - , Str "\"\"" - , Space - , Str "''" - , Space - , Str "''" - ] - , Para - [ Str "i)" - , Space - , Str "**" - , Space - , Str "bold**" - , Space - , Str "//" - , Space - , Str "ital//" - , Space - , Str "__" - , Space - , Str "undr__" - , Space - , Str "--" - , Space - , Str "strk--" - , Space - , Str "``" - , Space - , Str "mono``" - , Space - , Str "\"\"" - , Space - , Str "raw\"\"" - , Space - , Str "''" - , Space - , Str "tggd''" - , SoftBreak - , Str "i)" - , Space - , Str "**bold" - , Space - , Str "**" - , Space - , Str "//ital" - , Space - , Str "//" - , Space - , Str "__undr" - , Space - , Str "__" - , Space - , Str "--strk" - , Space - , Str "--" - , Space - , Str "``mono" - , Space - , Str "``" - , Space - , Str "\"\"raw" - , Space - , Str "\"\"" - , Space - , Str "''tggd" - , Space - , Str "''" - , SoftBreak - , Str "i)" - , Space - , Str "**" - , Space - , Str "bold" - , Space - , Str "**" - , Space - , Str "//" - , Space - , Str "ital" - , Space - , Str "//" - , Space - , Str "__" - , Space - , Str "undr" - , Space - , Str "__" - , Space - , Str "--" - , Space - , Str "strk" - , Space - , Str "--" - , Space - , Str "``" - , Space - , Str "mono" - , Space - , Str "``" - , Space - , Str "\"\"" - , Space - , Str "raw" - , Space - , Str "\"\"" - , Space - , Str "''" - , Space - , Str "tggd" - , Space - , Str "''" - ] - , Header 1 - ( "link", [], [] ) - [ Str "Link" ] - , Para - [ Link - ( "", [], [] ) - [ Str "mailto:user@domain.com" ] - ( "user@domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "mailto:user@domain.com" ] - ( "user@domain.com", "" ) - , Str "." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "mailto:user@domain.com" ] - ( "user@domain.com", "" ) - , Str "." - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Str "any" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "mailto:user@domain.com" ] - ( "user@domain.com", "" ) - , Str "." - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "label" ] - ( "user@domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "mailto:user@domain.com?subject=bla" ] - ( "user@domain.com?subject=bla", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "mailto:user@domain.com?subject=bla" ] - ( "user@domain.com?subject=bla", "" ) - , Str "." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "mailto:user@domain.com?subject=bla" ] - ( "user@domain.com?subject=bla", "" ) - , Str "," - , SoftBreak - , Link - ( "", [], [] ) - [ Str "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com" ] - ( "user@domain.com?subject=bla&cc=otheruser@domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com" ] - ( "user@domain.com?subject=bla&cc=otheruser@domain.com", "" ) - , Str "." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com" ] - ( "user@domain.com?subject=bla&cc=otheruser@domain.com", "" ) - , Str "," - , SoftBreak - , Link - ( "", [], [] ) - [ Str "label" ] - ( "user@domain.com?subject=bla&cc=otheruser@domain.com", "" ) - , Str "." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "label" ] - ( "user@domain.com?subject=bla&cc=otheruser@domain.com.", "" ) - , Str "." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com" ] - ( "http://www.domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/" ] - ( "http://www.domain.com/dir/", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir///" ] - ( "http://www.domain.com/dir///", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com." ] - ( "http://www.domain.com.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com," ] - ( "http://www.domain.com,", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com." ] - ( "http://www.domain.com.", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com," ] - ( "http://www.domain.com,", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/." ] - ( "http://www.domain.com/dir/.", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Str "any" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.domain.com." ] - ( "http://www.domain.com.", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Str "any" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/." ] - ( "http://www.domain.com/dir/.", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Str "any" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/index.html." ] - ( "http://www.domain.com/dir/index.html.", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Str "any" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/index.html," ] - ( "http://www.domain.com/dir/index.html,", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/#anchor" ] - ( "http://www.domain.com/dir/#anchor", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/index.html#anchor" ] - ( "http://www.domain.com/dir/index.html#anchor", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/index.html#anchor." ] - ( "http://www.domain.com/dir/index.html#anchor.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/#anchor." ] - ( "http://www.domain.com/dir/#anchor.", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/index.html#anchor." ] - ( "http://www.domain.com/dir/index.html#anchor.", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Str "any" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/#anchor." ] - ( "http://www.domain.com/dir/#anchor.", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Str "any" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "http://www.domain.com/dir/index.html#anchor." ] - ( "http://www.domain.com/dir/index.html#anchor.", "" ) - , Space - , Str "any" - , Space - , Str "text." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://domain.com?a=a@a.a&b=a+b+c." ] - ( "http://domain.com?a=a@a.a&b=a+b+c.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://domain.com?a=a@a.a&b=a+b+c," ] - ( "http://domain.com?a=a@a.a&b=a+b+c,", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c." ] - ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@." ] - ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://domain.com?a=a@a.a&b=a+b+c.#anchor" ] - ( "http://domain.com?a=a@a.a&b=a+b+c.#anchor", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" ] - ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor" ] - ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://user:password@domain.com/bla.html." ] - ( "http://user:password@domain.com/bla.html.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://user:password@domain.com/dir/." ] - ( "http://user:password@domain.com/dir/.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://user:password@domain.com." ] - ( "http://user:password@domain.com.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://user:@domain.com." ] - ( "http://user:@domain.com.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://user@domain.com." ] - ( "http://user@domain.com.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" ] - ( "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" - , "" - ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor" ] - ( "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor" - , "" - ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "label" ] - ( "www.domain.com", "" ) - , SoftBreak - , Str "[" - , Space - , Str "label" - , Space - , Link - ( "", [], [] ) - [ Str "www.domain.com" ] - ( "www.domain.com", "" ) - , Str "]" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "label", Space ] - ( "www.domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "anchor", Space ] - ( "http://www.domain.com/dir/index.html#anchor.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "login", Space ] - ( "http://user:password@domain.com/bla.html", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "form", Space ] - ( "http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "form", Space, Str "&", Space, Str "anchor" ] - ( "http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "login", Space, Str "&", Space, Str "form", Space ] - ( "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "local", Space, Str "link", Space, Str "up", Space ] - ( "..", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "local", Space, Str "link", Space, Str "file", Space ] - ( "bla.html", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "local", Space, Str "link", Space, Str "anchor", Space ] - ( "#anchor", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "local", Space, Str "link", Space, Str "file/anchor" ] - ( "bla.html#anchor", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "local", Space, Str "link", Space, Str "file/anchor" ] - ( "bla.html#anchor.", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "local", Space, Str "link", Space, Str "img", Space ] - ( "abc.gif", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "www.fake.com" ] - ( "www.domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm" ] - ( "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm" - , "" - ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-" ] - ( "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-" - , "" - ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" ] - ( "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" - , "" - ) - , Str "-1%." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" ] - ( "http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" - , "" - ) - , Str "-1%." - , SoftBreak - , Link - ( "", [], [] ) - [ Str "http://L1.com" ] - ( "http://L1.com", "" ) - , Space - , Str "!" - , Space - , Link - ( "", [], [] ) - [ Str "mailto:L2@www.com" ] - ( "L2@www.com", "" ) - , Space - , Str "!" - , Space - , Link - ( "", [], [] ) - [ Str "L3" ] - ( "www.com", "" ) - , Space - , Str "!" - , Space - , Link - ( "", [], [] ) - [ Str "L4" ] - ( "w@ww.com", "" ) - , Space - , Str "!" - , Space - , Link - ( "", [], [] ) - [ Str "www.L5.com" ] - ( "www.L5.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "www.domain.com" ] - ( "www.domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "www2.domain.com" ] - ( "www2.domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "ftp.domain.com" ] - ( "ftp.domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "WWW.DOMAIN.COM" ] - ( "WWW.DOMAIN.COM", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "FTP.DOMAIN.COM" ] - ( "FTP.DOMAIN.COM", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "label" ] - ( "www.domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "label" ] - ( "ftp.domain.com", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "label" ] - ( "WWW.DOMAIN.COM", "" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "label" ] - ( "FTP.DOMAIN.COM", "" ) - , SoftBreak - , Str "[label" - , Space - , Link - ( "", [], [] ) - [ Str "www.domain.com" ] - ( "www.domain.com", "" ) - , Space - , Str "]" - , SoftBreak - , Str "[label]" - , Space - , Link - ( "", [], [] ) - [ Str "www.domain.com" ] - ( "www.domain.com", "" ) - , Str "]" - ] - , Header 1 - ( "image", [], [] ) - [ Str "Image" ] - , Para - [ Image ( "", [], [] ) [] ( "img.png", "" ) ] - , Para - [ Link - ( "", [], [] ) - [ Image ( "", [], [] ) [] ( "img.png", "" ) ] - ( "https://txt2tags.org", "" ) - ] - , Para - [ Image - ( "", [], [] ) [] - ( "img.png", "" ) - , Space - , Str "Image" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "line" - , Space - , Str "beginning." - ] - , Para - [ Str "Image" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "middle" - , Space - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "line." - ] - , Para - [ Str "Image" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "line" - , Space - , Str "end." - , Space - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - ] - , Para - [ Image - ( "", [], [] ) [] - ( "img.png", "" ) - , SoftBreak - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - , SoftBreak - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - ] - , Para - [ Image - ( "", [], [] ) [] - ( "img.png", "" ) - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - ] - , Para - [ Str "Images" - , Space - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - , Space - , Str "mixed" - , Space - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - , Space - , Str "with" - , Space - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - , Space - , Str "text." - ] - , Para - [ Str "Images" - , Space - , Str "glued" - , Space - , Str "together:" - , Space - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - , Image - ( "", [], [] ) [] - ( "img.png", "" ) - , Str "." - ] - , Para - [ Str "[img.png", Space, Str "]" ] - , Para - [ Str "[", Space, Str "img.png]" ] - , Para - [ Str "[", Space, Str "img.png", Space, Str "]" ] - , Header 1 - ( "numtitle", [], [] ) - [ Str "Numbered", Space, Str "Title" ] - , Header 1 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "1" ] - , Header 2 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "2" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 4 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "4" ] - , Header 5 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "5" ] - , Header 1 - ( "lab_el-1", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "1" ] - , Header 2 - ( "lab_el-2", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "2" ] - , Header 3 - ( "lab_el-3", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 4 - ( "lab_el-4", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "4" ] - , Header 5 - ( "lab_el-5", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "5" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 3 - ( "lab_el-9", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Para - [ Str "+Not", Space, Str "Title" ] - , Para - [ Str "++Not", Space, Str "Title+" ] - , Para - [ Str "+++Not" - , Space - , Str "Title++++" - , SoftBreak - , Str "++++++Not" - , Space - , Str "Title" - , Space - , Str "6++++++" - ] - , Para - [ Str "+++++++Not" - , Space - , Str "Title" - , Space - , Str "7+++++++" - , SoftBreak - , Str "+Not" - , Space - , Str "Title+" - , Space - , Str "[label1]" - , SoftBreak - , Str "+Not" - , Space - , Str "Title+[" - , Space - , Str "label" - , Space - , Str "]" - , SoftBreak - , Str "+Not" - , Space - , Str "Title+[la/bel]" - ] - , Header 1 - ( "title", [], [] ) - [ Str "Title" ] - , Header 1 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "1" ] - , Header 2 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "2" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 4 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "4" ] - , Header 5 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "5" ] - , Header 1 - ( "lab_el-1", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "1" ] - , Header 2 - ( "lab_el-2", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "2" ] - , Header 3 - ( "lab_el-3", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 4 - ( "lab_el-4", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "4" ] - , Header 5 - ( "lab_el-5", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "5" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 3 - ( "", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Header 3 - ( "lab_el-9", [], [] ) - [ Str "Title", Space, Str "Level", Space, Str "3" ] - , Para - [ Str "=Not", Space, Str "Title" ] - , Para - [ Str "==Not", Space, Str "Title=" ] - , Para - [ Str "===Not" - , Space - , Str "Title====" - , SoftBreak - , Str "======Not" - , Space - , Str "Title" - , Space - , Str "6======" - ] - , Para - [ Str "=======Not" - , Space - , Str "Title" - , Space - , Str "7=======" - , SoftBreak - , Str "=Not" - , Space - , Str "Title=" - , Space - , Str "[label1]" - , SoftBreak - , Str "=Not" - , Space - , Str "Title=[" - , Space - , Str "label" - , Space - , Str "]" - , SoftBreak - , Str "=Not" - , Space - , Str "Title=[la/bel]" - ] - , Header 1 - ( "quote", [], [] ) - [ Str "Quote" ] - , BlockQuote - [ Para - [ Str "To" + [ Str "This" , Space - , Str "quote" + , Str "document" , Space - , Str "a" + , Str "describes" , Space - , Str "paragraph," + , Str "all" , Space - , Str "just" + , Str "the" , Space - , Str "prefix" + , Str "details" , Space - , Str "it" + , Str "about" , Space - , Str "by" + , Str "each" , Space - , Str "a" + , Str "txt2tags" , Space - , Str "TAB" + , Str "mark." , SoftBreak - , Str "character." - , Space - , Str "All" + , Str "The" , Space - , Str "the" + , Str "target" , Space - , Str "lines" + , Str "audience" , Space - , Str "of" + , Str "are" , Space - , Str "the" + , Strong [ Str "experienced" ] , Space - , Str "paragraph" + , Str "users." , Space - , Str "must" - , SoftBreak - , Str "begin" + , Str "You" , Space - , Str "with" + , Str "may" , Space - , Str "a" + , Str "find" , Space - , Str "TAB." - ] - ] - , Para - [ Str "Any" - , Space - , Str "non-tabbed" - , Space - , Str "line" - , Space - , Str "closes" - , Space - , Str "the" - , Space - , Str "quote" - , Space - , Str "block." - ] - , BlockQuote - [ Para - [ Str "The" + , Str "it" + , SoftBreak + , Str "useful" , Space - , Str "number" + , Str "if" , Space - , Str "of" + , Str "you" , Space - , Str "leading" + , Str "want" , Space - , Str "TABs" + , Str "to" , Space - , Str "identifies" + , Str "master" , Space , Str "the" , Space - , Str "quote" - , SoftBreak - , Str "block" + , Str "marks" , Space - , Str "depth." + , Str "or" , Space - , Str "This" + , Str "solve" , Space - , Str "is" + , Str "a" , Space - , Str "quote" + , Str "specific" , Space - , Str "level" + , Str "problem" + , SoftBreak + , Str "about" , Space - , Str "1." - ] - , BlockQuote - [ Para - [ Str "With" - , Space - , Str "two" - , Space - , Str "TABs," - , Space - , Str "we" - , Space - , Str "are" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "quote" - , SoftBreak - , Str "level" - , Space - , Str "2." - ] - , BlockQuote - [ Para - [ Str "The" - , Space - , Str "more" - , Space - , Str "TABs," - , Space - , Str "more" - , Space - , Str "deep" - , Space - , Str "is" - , SoftBreak - , Str "the" - , Space - , Str "quote" - , Space - , Str "level." - ] - , BlockQuote - [ Para - [ Str "There" - , Space - , Str "isn't" - , Space - , Str "a" - , Space - , Str "limit." - ] - ] - ] - ] - ] - , BlockQuote - [ BlockQuote - [ BlockQuote - [ BlockQuote - [ Para - [ Str "This" - , Space - , Str "quote" - , Space - , Str "starts" - , Space - , Str "at" - , SoftBreak - , Str "level" - , Space - , Str "4." - ] - ] - , Para - [ Str "Then" - , Space - , Str "its" - , Space - , Str "depth" - , Space - , Str "is" - , Space - , Str "decreased." - ] - ] - , Para - [ Str "Counting" - , Space - , Str "down," - , Space - , Str "one" - , Space - , Str "by" - , Space - , Str "one." - ] + , Str "a" + , Space + , Str "mark." ] - , Para - [ Str "Until" + , Para + [ Str "If" , Space - , Str "the" + , Str "you" , Space - , Str "level" + , Str "are" , Space - , Str "1." - ] - ] - , BlockQuote - [ BlockQuote - [ BlockQuote - [ Para - [ Str "Unlike" - , Space - , Str "lists," - , Space - , Str "any" - , Space - , Str "quote" - , Space - , Str "block" - , Space - , Str "is" - , SoftBreak - , Str "independent," - , Space - , Str "not" - , Space - , Str "part" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "tree." - ] - ] - ] - , Para - [ Str "The" + , Str "new" , Space - , Str "TAB" + , Str "to" , Space - , Str "count" + , Str "txt2tags" , Space - , Str "don't" + , Str "or" , Space - , Str "need" + , Str "just" , Space - , Str "to" + , Str "want" , Space - , Str "be" + , Str "to" , Space - , Str "incremental" - , SoftBreak - , Str "by" + , Str "know" , Space - , Str "one." - ] - , BlockQuote - [ BlockQuote - [ BlockQuote - [ Para - [ Str "The" - , Space - , Str "nesting" - , Space - , Str "don't" - , Space - , Str "need" - , SoftBreak - , Str "to" - , Space - , Str "follow" - , Space - , Str "any" - , Space - , Str "rule." - ] - ] - ] - , Para - [ Str "Quotes" - , Space - , Str "can" - , Space - , Str "be" - , Space - , Str "opened" - , Space - , Str "and" - , Space - , Str "closed" - , SoftBreak - , Str "in" - , Space - , Str "any" - , Space - , Str "way." - ] - , BlockQuote - [ BlockQuote - [ BlockQuote [ Para [ Str "You", Space, Str "choose." ] ] ] - ] - ] - ] - , BlockQuote - [ Para - [ Str "Some" + , Str "which" , Space - , Str "targets" + , Str "are" , Space - , Str "(as" + , Str "the" + , SoftBreak + , Str "available" , Space - , Str "sgml)" + , Str "marks," , Space - , Str "don't" + , Str "please" , Space - , Str "support" + , Str "read" , Space , Str "the" - , SoftBreak - , Str "nesting" , Space - , Str "of" + , Link + ( "" , [] , [] ) + [ Str "Markup" , Space , Str "Demo" ] + ( "MARKUPDEMO" , "" ) + , Str "." + ] + , Para + [ Str "Note" , Space - , Str "quotes." + , Str "1:" , Space - , Str "There" + , Str "This" + , Space + , Str "document" , Space , Str "is" , Space - , Str "only" + , Str "generated" , Space - , Str "one" + , Str "directly" , Space - , Str "quote" + , Str "from" + , Space + , Str "the" + , Space + , Str "txt2tags" , SoftBreak - , Str "level." - ] - , BlockQuote - [ Para - [ Str "In" - , Space - , Str "this" - , Space - , Str "case," - , Space - , Str "no" - , Space - , Str "matter" - , Space - , Str "how" - , Space - , Str "much" - , SoftBreak - , Str "TABs" - , Space - , Str "are" - , Space - , Str "used" - , Space - , Str "to" - , Space - , Str "define" - , Space - , Str "the" - , Space - , Str "quote" - , SoftBreak - , Str "block," - , Space - , Str "it" - , Space - , Str "always" - , Space - , Str "will" - , Space - , Str "be" - , Space - , Str "level" - , Space - , Str "1." - ] - ] - ] - , BlockQuote - [ Para - [ Str "Spaces" + , Str "test-suite." , Space - , Str "AFTER" + , Str "All" , Space , Str "the" , Space - , Str "TAB" + , Str "rules" , Space - , Str "character" + , Str "mentioned" + , Space + , Str "here" , Space , Str "are" , Space - , Str "allowed." - , SoftBreak - , Str "But" + , Str "100%" , Space - , Str "be" + , Str "in" , Space - , Str "careful," + , Str "sync" , Space - , Str "it" + , Str "with" , Space - , Str "can" + , Str "the" + , SoftBreak + , Str "current" , Space - , Str "be" + , Str "program" , Space - , Str "confusing." + , Str "code." ] - ] , Para - [ Str "Spaces" - , Space - , Str "BEFORE" - , Space - , Str "the" - , Space - , Str "TAB" - , Space - , Str "character" - , SoftBreak - , Str "invalidate" - , Space - , Str "the" - , Space - , Str "mark." - , Space - , Str "It's" - , Space - , Str "not" - , Space - , Str "quote." - ] - , BlockQuote - [ Para - [ Str "Paragraph" + [ Str "Note" , Space - , Str "breaks" - , Space - , Str "inside" + , Str "2:" , Space - , Str "a" + , Str "A" , Space - , Str "quote" + , Str "good" , Space - , Str "aren't" - , SoftBreak - , Str "possible." - ] - , Para - [ Str "This" + , Str "practice" , Space - , Str "sample" + , Str "is" , Space - , Str "are" + , Str "to" , Space - , Str "two" + , Str "consult" , Space - , Str "separated" + , Link + ( "" , [] , [] ) + [ Str "the" , Space , Str "sources" ] + ( "rules.t2t" , "" ) , Space - , Str "quoted" + , Str "when" , SoftBreak - , Str "paragraphs," + , Str "reading," , Space - , Str "not" + , Str "to" , Space - , Str "a" + , Str "see" , Space - , Str "quote" + , Str "how" , Space - , Str "block" + , Str "the" , Space - , Str "with" - , SoftBreak - , Str "two" + , Str "texts" , Space - , Str "paragraphs" + , Str "were" , Space - , Str "inside." + , Str "made." ] - ] - , BlockQuote - [ Para + , Para + [ Str "Table" , Space , Str "of" , Space , Str "Contents:" ] + , HorizontalRule + , Header 1 ( "paragraph" , [] , [] ) [ Str "Paragraph" ] + , Para + [ Str "A" + , Space + , Str "paragraph" + , Space + , Str "is" + , Space + , Str "composed" + , Space + , Str "by" + , Space + , Str "one" + , Space + , Str "or" + , Space + , Str "more" + , Space + , Str "lines." + , SoftBreak + , Str "A" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "(or" + , Space + , Str "a" + , Space + , Str "table," + , Space + , Str "or" + , Space + , Str "a" + , Space + , Str "list)" + , Space + , Str "ends" + , Space + , Str "the" + , SoftBreak + , Str "current" + , Space + , Str "paragraph." + ] + , Para + [ Str "Leading" + , Space + , Str "and" + , Space + , Str "trailing" + , Space + , Str "spaces" + , Space + , Str "are" + , Space + , Str "ignored." + ] + , Para + [ Str "A" + , Space + , Str "comment" + , Space + , Str "line" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "placed" + , Space + , Str "inside" + , Space + , Str "a" + , Space + , Str "paragraph." + , SoftBreak + , Str "It" + , Space + , Str "will" + , Space + , Str "not" + , Space + , Str "affect" + , Space + , Str "it." + ] + , Para [ Str "The" , Space , Str "end" @@ -2259,2942 +337,4963 @@ Pandoc , Space , Str "open" , Space - , Str "quote" - , Space - , Str "block." + , Str "paragraph." ] - ] - , Header 1 - ( "raw", [], [] ) - [ Str "Raw" ] + , Header 1 ( "comment" , [] , [] ) [ Str "Comment" ] , Para - [ Str "A raw line.\n" ] - , Para - [ Str " Another raw line, with leading spaces.\n" ] + [ Str "%" + , Space + , Str "not" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "line" + , Space + , Str "beginning" + , Space + , Str "(at" + , Space + , Str "column" + , Space + , Str "2)" + ] , Para - [ Str "A raw area delimited\n by lines with marks.\n" ] + [ Str "some" + , Space + , Str "text" + , Space + , Str "%" + , Space + , Str "half" + , Space + , Str "line" + , Space + , Str "comments" + , Space + , Str "are" + , Space + , Str "not" + , Space + , Str "allowed" + ] + , Header 1 ( "line" , [] , [] ) [ Str "Line" ] + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule + , HorizontalRule , Para - [ Str "Trailing spaces and TABs after the area marks\nare allowed, but not encouraged nor documented.\n" ] + [ Strikeout [ Str "-----" ] + , SoftBreak + , Strikeout [ Str "-------" , Space , Str "--------" ] + ] + , Para [ Strikeout [ Str "-------+--------" ] ] , Para - [ Str "\"\"\"Not" - , Space - , Str "a" - , Space - , Str "raw" - , Space - , Str "line," - , Space - , Str "need" - , Space - , Str "one" - , Space - , Str "space" - , Space - , Str "after" - , Space - , Str "mark." - ] + [ Str "(" + , Space + , Strikeout [ Str "----------------" ] + , Space + , Str ")" + ] + , Header 1 ( "inline" , [] , [] ) [ Str "Inline" ] , Para - [ Str "\"\"\"" - , SoftBreak - , Str "Not" - , Space - , Str "a" - , Space - , Str "raw" - , Space - , Str "area." - , SoftBreak - , Str "The" - , Space - , Str "marks" - , Space - , Str "must" - , Space - , Str "be" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "line" - , Space - , Str "beginning," - , SoftBreak - , Str "no" - , Space - , Str "leading" - , Space - , Str "spaces." - , SoftBreak - , Str "\"\"\"" - ] + [ Str "i)" + , Space + , Strong [ Str "b" ] + , Space + , Emph [ Str "i" ] + , Space + , Underline [ Str "u" ] + , Space + , Strikeout [ Str "s" ] + , Space + , Code ( "" , [] , [] ) "m" + , Space + , Str "r" + , Space + , RawInline (Format "html") "t" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "bo" ] + , Space + , Emph [ Str "it" ] + , Space + , Underline [ Str "un" ] + , Space + , Strikeout [ Str "st" ] + , Space + , Code ( "" , [] , [] ) "mo" + , Space + , Str "ra" + , Space + , RawInline (Format "html") "tg" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "bold" ] + , Space + , Emph [ Str "ital" ] + , Space + , Underline [ Str "undr" ] + , Space + , Strikeout [ Str "strk" ] + , Space + , Code ( "" , [] , [] ) "mono" + , Space + , Str "raw" + , Space + , RawInline (Format "html") "tggd" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "bo" , Space , Str "ld" ] + , Space + , Emph [ Str "it" , Space , Str "al" ] + , Space + , Underline [ Str "un" , Space , Str "dr" ] + , Space + , Strikeout [ Str "st" , Space , Str "rk" ] + , Space + , Code ( "" , [] , [] ) "mo no" + , Space + , Str "r" + , Space + , Str "aw" + , Space + , RawInline (Format "html") "tg gd" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "bo" , Space , Str "*" , Space , Str "ld" ] + , Space + , Emph [ Str "it" , Space , Str "/" , Space , Str "al" ] + , Space + , Underline + [ Str "un" , Space , Str "_" , Space , Str "dr" ] + , Space + , Strikeout + [ Str "st" , Space , Str "-" , Space , Str "rk" ] + , Space + , Code ( "" , [] , [] ) "mo ` no" + , Space + , Str "r" + , Space + , Str "\"" + , Space + , Str "aw" + , Space + , RawInline (Format "html") "tg ' gd" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "bo" , Space , Str "**ld" ] + , Space + , Emph [ Str "it" , Space , Str "//al" ] + , Space + , Underline [ Str "un" , Space , Str "__dr" ] + , Space + , Strikeout [ Str "st" , Space , Str "--rk" ] + , Space + , Code ( "" , [] , [] ) "mo ``no" + , Space + , Str "r" + , Space + , Str "\"\"aw" + , Space + , RawInline (Format "html") "tg ''gd" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "bo" , Space , Str "**" , Space , Str "ld" ] + , Space + , Emph [ Str "it" , Space , Str "//" , Space , Str "al" ] + , Space + , Underline + [ Str "un" , Space , Str "__" , Space , Str "dr" ] + , Space + , Strikeout + [ Str "st" , Space , Str "--" , Space , Str "rk" ] + , Space + , Code ( "" , [] , [] ) "mo `` no" + , Space + , Str "r" + , Space + , Str "\"\"" + , Space + , Str "aw" + , Space + , RawInline (Format "html") "tg '' gd" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "**bold**" ] + , Space + , Emph [ Str "//ital//" ] + , Space + , Underline [ Str "__undr__" ] + , Space + , Strikeout [ Str "--strk--" ] + , Space + , Code ( "" , [] , [] ) "``mono``" + , Space + , Str "\"\"raw\"\"" + , Space + , RawInline (Format "html") "''tggd''" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "*bold*" ] + , Space + , Emph [ Str "/ital/" ] + , Space + , Underline [ Str "_undr_" ] + , Space + , Strikeout [ Str "-strk-" ] + , Space + , Code ( "" , [] , [] ) "`mono`" + , Space + , Str "\"raw\"" + , Space + , RawInline (Format "html") "'tggd'" + ] , Para - [ Str "The end of the file (EOF) closes\nthe currently open raw area.\n" ] - , Header 1 - ( "verbatim", [], [] ) - [ Str "Verbatim" ] - , CodeBlock - ( "", [], [] ) "A verbatim line.\n" - , CodeBlock - ( "", [], [] ) " Another verbatim line, with leading spaces.\n" - , CodeBlock - ( "" - , [] - , [] - ) "A verbatim area delimited\n by lines with marks.\n" - , CodeBlock - ( "" - , [] - , [] - ) "Trailing spaces and TABs after the area marks\nare allowed, but not encouraged nor documented.\n" + [ Str "i)" + , Space + , Strong [ Str "*" ] + , Space + , Emph [ Str "/" ] + , Space + , Underline [ Str "_" ] + , Space + , Strikeout [ Str "-" ] + , Space + , Code ( "" , [] , [] ) "`" + , Space + , Str "\"" + , Space + , RawInline (Format "html") "'" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "**" ] + , Space + , Emph [ Str "//" ] + , Space + , Underline [ Str "__" ] + , Space + , Strikeout [ Str "--" ] + , Space + , Code ( "" , [] , [] ) "``" + , Space + , Str "\"\"" + , Space + , RawInline (Format "html") "''" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "***" ] + , Space + , Emph [ Str "///" ] + , Space + , Underline [ Str "___" ] + , Space + , Strikeout [ Str "---" ] + , Space + , Code ( "" , [] , [] ) "```" + , Space + , Str "\"\"\"" + , Space + , RawInline (Format "html") "'''" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "****" ] + , Space + , Emph [ Str "////" ] + , Space + , Underline [ Str "____" ] + , Space + , Strikeout [ Str "----" ] + , Space + , Code ( "" , [] , [] ) "````" + , Space + , Str "\"\"\"\"" + , Space + , RawInline (Format "html") "''''" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "*****" ] + , Space + , Emph [ Str "/////" ] + , Space + , Underline [ Str "_____" ] + , Space + , Strikeout [ Str "-----" ] + , Space + , Code ( "" , [] , [] ) "`````" + , Space + , Str "\"\"\"\"\"" + , Space + , RawInline (Format "html") "'''''" + , SoftBreak + , Str "i)" + , Space + , Strong [ Str "******" ] + , Space + , Emph [ Str "//////" ] + , Space + , Underline [ Str "______" ] + , Space + , Strikeout [ Str "------" ] + , Space + , Code ( "" , [] , [] ) "``````" + , Space + , Str "\"\"\"\"\"\"" + , Space + , RawInline (Format "html") "''''''" + ] , Para - [ Str "```Not" - , Space - , Str "a" - , Space - , Str "verbatim" - , Space - , Str "line," - , Space - , Str "need" - , Space - , Str "one" - , Space - , Str "space" - , Space - , Str "after" - , Space - , Str "mark." - ] + [ Str "i)" + , Space + , Str "****" + , Space + , Str "////" + , Space + , Str "____" + , Space + , Str "----" + , Space + , Str "````" + , Space + , Str "\"\"\"\"" + , Space + , Str "''''" + , SoftBreak + , Str "i)" + , Space + , Str "**" + , Space + , Str "**" + , Space + , Str "//" + , Space + , Str "//" + , Space + , Str "__" + , Space + , Str "__" + , Space + , Str "--" + , Space + , Str "--" + , Space + , Str "``" + , Space + , Str "``" + , Space + , Str "\"\"" + , Space + , Str "\"\"" + , Space + , Str "''" + , Space + , Str "''" + ] , Para - [ Str "```" - , SoftBreak - , Str "Not" - , Space - , Str "a" - , Space - , Str "verbatim" - , Space - , Str "area." - , SoftBreak - , Str "The" - , Space - , Str "marks" - , Space - , Str "must" - , Space - , Str "be" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "line" - , Space - , Str "beginning," - , SoftBreak - , Str "no" - , Space - , Str "leading" - , Space - , Str "spaces." - , SoftBreak - , Str "```" - ] + [ Str "i)" + , Space + , Str "**" + , Space + , Str "bold**" + , Space + , Str "//" + , Space + , Str "ital//" + , Space + , Str "__" + , Space + , Str "undr__" + , Space + , Str "--" + , Space + , Str "strk--" + , Space + , Str "``" + , Space + , Str "mono``" + , Space + , Str "\"\"" + , Space + , Str "raw\"\"" + , Space + , Str "''" + , Space + , Str "tggd''" + , SoftBreak + , Str "i)" + , Space + , Str "**bold" + , Space + , Str "**" + , Space + , Str "//ital" + , Space + , Str "//" + , Space + , Str "__undr" + , Space + , Str "__" + , Space + , Str "--strk" + , Space + , Str "--" + , Space + , Str "``mono" + , Space + , Str "``" + , Space + , Str "\"\"raw" + , Space + , Str "\"\"" + , Space + , Str "''tggd" + , Space + , Str "''" + , SoftBreak + , Str "i)" + , Space + , Str "**" + , Space + , Str "bold" + , Space + , Str "**" + , Space + , Str "//" + , Space + , Str "ital" + , Space + , Str "//" + , Space + , Str "__" + , Space + , Str "undr" + , Space + , Str "__" + , Space + , Str "--" + , Space + , Str "strk" + , Space + , Str "--" + , Space + , Str "``" + , Space + , Str "mono" + , Space + , Str "``" + , Space + , Str "\"\"" + , Space + , Str "raw" + , Space + , Str "\"\"" + , Space + , Str "''" + , Space + , Str "tggd" + , Space + , Str "''" + ] + , Header 1 ( "link" , [] , [] ) [ Str "Link" ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "mailto:user@domain.com" ] + ( "user@domain.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "mailto:user@domain.com" ] + ( "user@domain.com" , "" ) + , Str "." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "mailto:user@domain.com" ] + ( "user@domain.com" , "" ) + , Str "." + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "" , [] , [] ) + [ Str "mailto:user@domain.com" ] + ( "user@domain.com" , "" ) + , Str "." + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "label" ] ( "user@domain.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "mailto:user@domain.com?subject=bla" ] + ( "user@domain.com?subject=bla" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "mailto:user@domain.com?subject=bla" ] + ( "user@domain.com?subject=bla" , "" ) + , Str "." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "mailto:user@domain.com?subject=bla" ] + ( "user@domain.com?subject=bla" , "" ) + , Str "," + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str + "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com" + ] + ( "user@domain.com?subject=bla&cc=otheruser@domain.com" + , "" + ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str + "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com" + ] + ( "user@domain.com?subject=bla&cc=otheruser@domain.com" + , "" + ) + , Str "." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str + "mailto:user@domain.com?subject=bla&cc=otheruser@domain.com" + ] + ( "user@domain.com?subject=bla&cc=otheruser@domain.com" + , "" + ) + , Str "," + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "label" ] + ( "user@domain.com?subject=bla&cc=otheruser@domain.com" + , "" + ) + , Str "." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "label" ] + ( "user@domain.com?subject=bla&cc=otheruser@domain.com." + , "" + ) + , Str "." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com" ] + ( "http://www.domain.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/" ] + ( "http://www.domain.com/dir/" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir///" ] + ( "http://www.domain.com/dir///" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com." ] + ( "http://www.domain.com." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com," ] + ( "http://www.domain.com," , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com." ] + ( "http://www.domain.com." , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com," ] + ( "http://www.domain.com," , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/." ] + ( "http://www.domain.com/dir/." , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com." ] + ( "http://www.domain.com." , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/." ] + ( "http://www.domain.com/dir/." , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/index.html." ] + ( "http://www.domain.com/dir/index.html." , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/index.html," ] + ( "http://www.domain.com/dir/index.html," , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/#anchor" ] + ( "http://www.domain.com/dir/#anchor" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/index.html#anchor" ] + ( "http://www.domain.com/dir/index.html#anchor" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/index.html#anchor." ] + ( "http://www.domain.com/dir/index.html#anchor." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/#anchor." ] + ( "http://www.domain.com/dir/#anchor." , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/index.html#anchor." ] + ( "http://www.domain.com/dir/index.html#anchor." , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/#anchor." ] + ( "http://www.domain.com/dir/#anchor." , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Str "any" + , Space + , Str "text:" + , Space + , Link + ( "" , [] , [] ) + [ Str "http://www.domain.com/dir/index.html#anchor." ] + ( "http://www.domain.com/dir/index.html#anchor." , "" ) + , Space + , Str "any" + , Space + , Str "text." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://domain.com?a=a@a.a&b=a+b+c." ] + ( "http://domain.com?a=a@a.a&b=a+b+c." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://domain.com?a=a@a.a&b=a+b+c," ] + ( "http://domain.com?a=a@a.a&b=a+b+c," , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c." ] + ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@." ] + ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://domain.com?a=a@a.a&b=a+b+c.#anchor" ] + ( "http://domain.com?a=a@a.a&b=a+b+c.#anchor" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" ] + ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor" ] + ( "http://domain.com/bla.cgi?a=a@a.a&b=a+b+c@.#anchor" + , "" + ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://user:password@domain.com/bla.html." ] + ( "http://user:password@domain.com/bla.html." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://user:password@domain.com/dir/." ] + ( "http://user:password@domain.com/dir/." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://user:password@domain.com." ] + ( "http://user:password@domain.com." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://user:@domain.com." ] + ( "http://user:@domain.com." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://user@domain.com." ] + ( "http://user@domain.com." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str + "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" + ] + ( "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" + , "" + ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str + "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor" + ] + ( "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c@#anchor" + , "" + ) + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "label" ] ( "www.domain.com" , "" ) + , SoftBreak + , Str "[" + , Space + , Str "label" + , Space + , Link + ( "" , [] , [] ) + [ Str "www.domain.com" ] + ( "www.domain.com" , "" ) + , Str "]" + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "label" , Space ] + ( "www.domain.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "anchor" , Space ] + ( "http://www.domain.com/dir/index.html#anchor." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "login" , Space ] + ( "http://user:password@domain.com/bla.html" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "form" , Space ] + ( "http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "form" , Space , Str "&" , Space , Str "anchor" ] + ( "http://www.domain.com/bla.cgi?a=a@a.a&b=a+b+c.#anchor" + , "" + ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "login" + , Space + , Str "&" + , Space + , Str "form" + , Space + ] + ( "http://user:password@domain.com/bla.cgi?a=a@a.a&b=a+b+c." + , "" + ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "local" + , Space + , Str "link" + , Space + , Str "up" + , Space + ] + ( ".." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "local" + , Space + , Str "link" + , Space + , Str "file" + , Space + ] + ( "bla.html" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "local" + , Space + , Str "link" + , Space + , Str "anchor" + , Space + ] + ( "#anchor" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "local" + , Space + , Str "link" + , Space + , Str "file/anchor" + ] + ( "bla.html#anchor" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "local" + , Space + , Str "link" + , Space + , Str "file/anchor" + ] + ( "bla.html#anchor." , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "local" + , Space + , Str "link" + , Space + , Str "img" + , Space + ] + ( "abc.gif" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "www.fake.com" ] + ( "www.domain.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str + "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm" + ] + ( "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm" + , "" + ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str + "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-" + ] + ( "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-" + , "" + ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str + "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" + ] + ( "http://domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" + , "" + ) + , Str "-1%." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str + "http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" + ] + ( "http://foo._user-9:pass!#$%&*()+word@domain.com:8080/~user/_st-r@a=n$g,e/index%20new.htm?a=/%22&b=+.@*_-#anchor_" + , "" + ) + , Str "-1%." + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "http://L1.com" ] + ( "http://L1.com" , "" ) + , Space + , Str "!" + , Space + , Link + ( "" , [] , [] ) + [ Str "mailto:L2@www.com" ] + ( "L2@www.com" , "" ) + , Space + , Str "!" + , Space + , Link ( "" , [] , [] ) [ Str "L3" ] ( "www.com" , "" ) + , Space + , Str "!" + , Space + , Link ( "" , [] , [] ) [ Str "L4" ] ( "w@ww.com" , "" ) + , Space + , Str "!" + , Space + , Link + ( "" , [] , [] ) [ Str "www.L5.com" ] ( "www.L5.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "www.domain.com" ] + ( "www.domain.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "www2.domain.com" ] + ( "www2.domain.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "ftp.domain.com" ] + ( "ftp.domain.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "WWW.DOMAIN.COM" ] + ( "WWW.DOMAIN.COM" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "FTP.DOMAIN.COM" ] + ( "FTP.DOMAIN.COM" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "label" ] ( "www.domain.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "label" ] ( "ftp.domain.com" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "label" ] ( "WWW.DOMAIN.COM" , "" ) + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "label" ] ( "FTP.DOMAIN.COM" , "" ) + , SoftBreak + , Str "[label" + , Space + , Link + ( "" , [] , [] ) + [ Str "www.domain.com" ] + ( "www.domain.com" , "" ) + , Space + , Str "]" + , SoftBreak + , Str "[label]" + , Space + , Link + ( "" , [] , [] ) + [ Str "www.domain.com" ] + ( "www.domain.com" , "" ) + , Str "]" + ] + , Header 1 ( "image" , [] , [] ) [ Str "Image" ] + , Para [ Image ( "" , [] , [] ) [] ( "img.png" , "" ) ] + , Para + [ Link + ( "" , [] , [] ) + [ Image ( "" , [] , [] ) [] ( "img.png" , "" ) ] + ( "https://txt2tags.org" , "" ) + ] + , Para + [ Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , Space + , Str "Image" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "line" + , Space + , Str "beginning." + ] + , Para + [ Str "Image" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "middle" + , Space + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "line." + ] + , Para + [ Str "Image" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "line" + , Space + , Str "end." + , Space + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + ] + , Para + [ Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , SoftBreak + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , SoftBreak + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + ] + , Para + [ Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + ] + , Para + [ Str "Images" + , Space + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , Space + , Str "mixed" + , Space + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , Space + , Str "with" + , Space + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , Space + , Str "text." + ] + , Para + [ Str "Images" + , Space + , Str "glued" + , Space + , Str "together:" + , Space + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , Image ( "" , [] , [] ) [] ( "img.png" , "" ) + , Str "." + ] + , Para [ Str "[img.png" , Space , Str "]" ] + , Para [ Str "[" , Space , Str "img.png]" ] + , Para [ Str "[" , Space , Str "img.png" , Space , Str "]" ] + , Header + 1 + ( "numtitle" , [] , [] ) + [ Str "Numbered" , Space , Str "Title" ] + , Header + 1 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "1" ] + , Header + 2 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "2" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 4 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "4" ] + , Header + 5 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "5" ] + , Header + 1 + ( "lab_el-1" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "1" ] + , Header + 2 + ( "lab_el-2" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "2" ] + , Header + 3 + ( "lab_el-3" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 4 + ( "lab_el-4" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "4" ] + , Header + 5 + ( "lab_el-5" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "5" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 3 + ( "lab_el-9" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Para [ Str "+Not" , Space , Str "Title" ] + , Para [ Str "++Not" , Space , Str "Title+" ] + , Para + [ Str "+++Not" + , Space + , Str "Title++++" + , SoftBreak + , Str "++++++Not" + , Space + , Str "Title" + , Space + , Str "6++++++" + ] + , Para + [ Str "+++++++Not" + , Space + , Str "Title" + , Space + , Str "7+++++++" + , SoftBreak + , Str "+Not" + , Space + , Str "Title+" + , Space + , Str "[label1]" + , SoftBreak + , Str "+Not" + , Space + , Str "Title+[" + , Space + , Str "label" + , Space + , Str "]" + , SoftBreak + , Str "+Not" + , Space + , Str "Title+[la/bel]" + ] + , Header 1 ( "title" , [] , [] ) [ Str "Title" ] + , Header + 1 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "1" ] + , Header + 2 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "2" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 4 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "4" ] + , Header + 5 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "5" ] + , Header + 1 + ( "lab_el-1" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "1" ] + , Header + 2 + ( "lab_el-2" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "2" ] + , Header + 3 + ( "lab_el-3" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 4 + ( "lab_el-4" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "4" ] + , Header + 5 + ( "lab_el-5" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "5" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 3 + ( "" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Header + 3 + ( "lab_el-9" , [] , [] ) + [ Str "Title" , Space , Str "Level" , Space , Str "3" ] + , Para [ Str "=Not" , Space , Str "Title" ] + , Para [ Str "==Not" , Space , Str "Title=" ] + , Para + [ Str "===Not" + , Space + , Str "Title====" + , SoftBreak + , Str "======Not" + , Space + , Str "Title" + , Space + , Str "6======" + ] + , Para + [ Str "=======Not" + , Space + , Str "Title" + , Space + , Str "7=======" + , SoftBreak + , Str "=Not" + , Space + , Str "Title=" + , Space + , Str "[label1]" + , SoftBreak + , Str "=Not" + , Space + , Str "Title=[" + , Space + , Str "label" + , Space + , Str "]" + , SoftBreak + , Str "=Not" + , Space + , Str "Title=[la/bel]" + ] + , Header 1 ( "quote" , [] , [] ) [ Str "Quote" ] + , BlockQuote + [ Para + [ Str "To" + , Space + , Str "quote" + , Space + , Str "a" + , Space + , Str "paragraph," + , Space + , Str "just" + , Space + , Str "prefix" + , Space + , Str "it" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "TAB" + , SoftBreak + , Str "character." + , Space + , Str "All" + , Space + , Str "the" + , Space + , Str "lines" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "paragraph" + , Space + , Str "must" + , SoftBreak + , Str "begin" + , Space + , Str "with" + , Space + , Str "a" + , Space + , Str "TAB." + ] + ] + , Para + [ Str "Any" + , Space + , Str "non-tabbed" + , Space + , Str "line" + , Space + , Str "closes" + , Space + , Str "the" + , Space + , Str "quote" + , Space + , Str "block." + ] + , BlockQuote + [ Para + [ Str "The" + , Space + , Str "number" + , Space + , Str "of" + , Space + , Str "leading" + , Space + , Str "TABs" + , Space + , Str "identifies" + , Space + , Str "the" + , Space + , Str "quote" + , SoftBreak + , Str "block" + , Space + , Str "depth." + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "quote" + , Space + , Str "level" + , Space + , Str "1." + ] + , BlockQuote + [ Para + [ Str "With" + , Space + , Str "two" + , Space + , Str "TABs," + , Space + , Str "we" + , Space + , Str "are" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "quote" + , SoftBreak + , Str "level" + , Space + , Str "2." + ] + , BlockQuote + [ Para + [ Str "The" + , Space + , Str "more" + , Space + , Str "TABs," + , Space + , Str "more" + , Space + , Str "deep" + , Space + , Str "is" + , SoftBreak + , Str "the" + , Space + , Str "quote" + , Space + , Str "level." + ] + , BlockQuote + [ Para + [ Str "There" + , Space + , Str "isn't" + , Space + , Str "a" + , Space + , Str "limit." + ] + ] + ] + ] + ] + , BlockQuote + [ BlockQuote + [ BlockQuote + [ BlockQuote + [ Para + [ Str "This" + , Space + , Str "quote" + , Space + , Str "starts" + , Space + , Str "at" + , SoftBreak + , Str "level" + , Space + , Str "4." + ] + ] + , Para + [ Str "Then" + , Space + , Str "its" + , Space + , Str "depth" + , Space + , Str "is" + , Space + , Str "decreased." + ] + ] + , Para + [ Str "Counting" + , Space + , Str "down," + , Space + , Str "one" + , Space + , Str "by" + , Space + , Str "one." + ] + ] + , Para + [ Str "Until" + , Space + , Str "the" + , Space + , Str "level" + , Space + , Str "1." + ] + ] + , BlockQuote + [ BlockQuote + [ BlockQuote + [ Para + [ Str "Unlike" + , Space + , Str "lists," + , Space + , Str "any" + , Space + , Str "quote" + , Space + , Str "block" + , Space + , Str "is" + , SoftBreak + , Str "independent," + , Space + , Str "not" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "tree." + ] + ] + ] + , Para + [ Str "The" + , Space + , Str "TAB" + , Space + , Str "count" + , Space + , Str "don't" + , Space + , Str "need" + , Space + , Str "to" + , Space + , Str "be" + , Space + , Str "incremental" + , SoftBreak + , Str "by" + , Space + , Str "one." + ] + , BlockQuote + [ BlockQuote + [ BlockQuote + [ Para + [ Str "The" + , Space + , Str "nesting" + , Space + , Str "don't" + , Space + , Str "need" + , SoftBreak + , Str "to" + , Space + , Str "follow" + , Space + , Str "any" + , Space + , Str "rule." + ] + ] + ] + , Para + [ Str "Quotes" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "opened" + , Space + , Str "and" + , Space + , Str "closed" + , SoftBreak + , Str "in" + , Space + , Str "any" + , Space + , Str "way." + ] + , BlockQuote + [ BlockQuote + [ BlockQuote + [ Para [ Str "You" , Space , Str "choose." ] ] + ] + ] + ] + ] + , BlockQuote + [ Para + [ Str "Some" + , Space + , Str "targets" + , Space + , Str "(as" + , Space + , Str "sgml)" + , Space + , Str "don't" + , Space + , Str "support" + , Space + , Str "the" + , SoftBreak + , Str "nesting" + , Space + , Str "of" + , Space + , Str "quotes." + , Space + , Str "There" + , Space + , Str "is" + , Space + , Str "only" + , Space + , Str "one" + , Space + , Str "quote" + , SoftBreak + , Str "level." + ] + , BlockQuote + [ Para + [ Str "In" + , Space + , Str "this" + , Space + , Str "case," + , Space + , Str "no" + , Space + , Str "matter" + , Space + , Str "how" + , Space + , Str "much" + , SoftBreak + , Str "TABs" + , Space + , Str "are" + , Space + , Str "used" + , Space + , Str "to" + , Space + , Str "define" + , Space + , Str "the" + , Space + , Str "quote" + , SoftBreak + , Str "block," + , Space + , Str "it" + , Space + , Str "always" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "level" + , Space + , Str "1." + ] + ] + ] + , BlockQuote + [ Para + [ Str "Spaces" + , Space + , Str "AFTER" + , Space + , Str "the" + , Space + , Str "TAB" + , Space + , Str "character" + , Space + , Str "are" + , Space + , Str "allowed." + , SoftBreak + , Str "But" + , Space + , Str "be" + , Space + , Str "careful," + , Space + , Str "it" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "confusing." + ] + ] + , Para + [ Str "Spaces" + , Space + , Str "BEFORE" + , Space + , Str "the" + , Space + , Str "TAB" + , Space + , Str "character" + , SoftBreak + , Str "invalidate" + , Space + , Str "the" + , Space + , Str "mark." + , Space + , Str "It's" + , Space + , Str "not" + , Space + , Str "quote." + ] + , BlockQuote + [ Para + [ Str "Paragraph" + , Space + , Str "breaks" + , Space + , Str "inside" + , Space + , Str "a" + , Space + , Str "quote" + , Space + , Str "aren't" + , SoftBreak + , Str "possible." + ] + , Para + [ Str "This" + , Space + , Str "sample" + , Space + , Str "are" + , Space + , Str "two" + , Space + , Str "separated" + , Space + , Str "quoted" + , SoftBreak + , Str "paragraphs," + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "quote" + , Space + , Str "block" + , Space + , Str "with" + , SoftBreak + , Str "two" + , Space + , Str "paragraphs" + , Space + , Str "inside." + ] + ] + , BlockQuote + [ Para + [ Str "The" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "file" + , Space + , Str "(EOF)" + , Space + , Str "closes" + , Space + , Str "the" + , SoftBreak + , Str "currently" + , Space + , Str "open" + , Space + , Str "quote" + , Space + , Str "block." + ] + ] + , Header 1 ( "raw" , [] , [] ) [ Str "Raw" ] + , Para [ Str "A raw line.\n" ] + , Para [ Str " Another raw line, with leading spaces.\n" ] + , Para + [ Str "A raw area delimited\n by lines with marks.\n" + ] + , Para + [ Str + "Trailing spaces and TABs after the area marks\nare allowed, but not encouraged nor documented.\n" + ] + , Para + [ Str "\"\"\"Not" + , Space + , Str "a" + , Space + , Str "raw" + , Space + , Str "line," + , Space + , Str "need" + , Space + , Str "one" + , Space + , Str "space" + , Space + , Str "after" + , Space + , Str "mark." + ] + , Para + [ Str "\"\"\"" + , SoftBreak + , Str "Not" + , Space + , Str "a" + , Space + , Str "raw" + , Space + , Str "area." + , SoftBreak + , Str "The" + , Space + , Str "marks" + , Space + , Str "must" + , Space + , Str "be" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "line" + , Space + , Str "beginning," + , SoftBreak + , Str "no" + , Space + , Str "leading" + , Space + , Str "spaces." + , SoftBreak + , Str "\"\"\"" + ] + , Para + [ Str + "The end of the file (EOF) closes\nthe currently open raw area.\n" + ] + , Header 1 ( "verbatim" , [] , [] ) [ Str "Verbatim" ] + , CodeBlock ( "" , [] , [] ) "A verbatim line.\n" + , CodeBlock + ( "" , [] , [] ) + " Another verbatim line, with leading spaces.\n" + , CodeBlock + ( "" , [] , [] ) + "A verbatim area delimited\n by lines with marks.\n" + , CodeBlock + ( "" , [] , [] ) + "Trailing spaces and TABs after the area marks\nare allowed, but not encouraged nor documented.\n" + , Para + [ Str "```Not" + , Space + , Str "a" + , Space + , Str "verbatim" + , Space + , Str "line," + , Space + , Str "need" + , Space + , Str "one" + , Space + , Str "space" + , Space + , Str "after" + , Space + , Str "mark." + ] + , Para + [ Str "```" + , SoftBreak + , Str "Not" + , Space + , Str "a" + , Space + , Str "verbatim" + , Space + , Str "area." + , SoftBreak + , Str "The" + , Space + , Str "marks" + , Space + , Str "must" + , Space + , Str "be" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "line" + , Space + , Str "beginning," + , SoftBreak + , Str "no" + , Space + , Str "leading" + , Space + , Str "spaces." + , SoftBreak + , Str "```" + ] , CodeBlock - ( "" - , [] - , [] - ) "The end of the file (EOF) closes\nthe currently open verbatim area.\n" - , Header 1 - ( "deflist", [], [] ) - [ Str "Definition", Space, Str "List" ] + ( "" , [] , [] ) + "The end of the file (EOF) closes\nthe currently open verbatim area.\n" + , Header + 1 + ( "deflist" , [] , [] ) + [ Str "Definition" , Space , Str "List" ] , DefinitionList - [ - ( - [ Str "Definition", Space, Str "list" ] - , - [ - [ Plain - [ Str "A" + [ ( [ Str "Definition" , Space , Str "list" ] + , [ [ Plain + [ Str "A" + , Space + , Str "list" + , Space + , Str "with" + , Space + , Str "terms" + ] + ] + ] + ) + , ( [ Str "Start" + , Space + , Str "term" + , Space + , Str "with" + , Space + , Str "colon" + ] + , [ [ Plain + [ Str "And" + , Space + , Str "its" + , Space + , Str "definition" + , Space + , Str "follows" + ] + ] + ] + ) + ] + , Header + 1 + ( "numlist" , [] , [] ) + [ Str "Numbered" , Space , Str "List" ] + , Para + [ Str "See" + , Space + , Link ( "" , [] , [] ) [ Str "List" ] ( "#list" , "" ) + , Str "," + , Space + , Str "the" + , Space + , Str "same" + , Space + , Str "rules" + , Space + , Str "apply." + ] + , Header 1 ( "list" , [] , [] ) [ Str "List" ] + , BulletList + [ [ Plain + [ Str "Use" + , Space + , Str "the" + , Space + , Str "hyphen" + , Space + , Str "to" + , Space + , Str "prefix" + , Space + , Str "list" + , Space + , Str "items." + ] + ] + , [ Plain + [ Str "There" + , Space + , Str "must" + , Space + , Str "be" + , Space + , Str "one" + , Space + , Str "space" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "hyphen." + ] + ] + , [ Plain + [ Str "The" + , Space + , Str "list" + , Space + , Str "is" + , Space + , Str "closed" + , Space + , Str "by" + , Space + , Str "two" + , Space + , Str "consecutive" + , Space + , Str "blank" + , Space + , Str "lines." + ] + ] + ] + , BulletList + [ [ Plain + [ Str "The" + , Space + , Str "list" + , Space + , Str "can" + , Space + , Str "be" + , Space + , Str "indented" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "source" + , Space + , Str "document." + ] + ] + , [ Plain + [ Str "You" + , Space + , Str "can" + , Space + , Str "use" + , Space + , Str "any" + , Space + , Str "number" + , Space + , Str "of" + , Space + , Str "spaces." + ] + ] + , [ Plain + [ Str "The" + , Space + , Str "result" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "the" + , Space + , Str "same." + ] + ] + ] + , BulletList + [ [ Para + [ Str "Let" + , Space + , Str "one" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "between" + , Space + , Str "the" , Space , Str "list" , Space + , Str "items." + ] + ] + , [ Para + [ Str "It" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "maintained" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "conversion." + ] + ] + , [ Para + [ Str "Some" + , Space + , Str "targets" + , Space + , Str "don't" + , Space + , Str "support" + , Space + , Str "this" + , Space + , Str "behavior." + ] + ] + , [ Para + [ Str "This" + , Space + , Str "one" + , Space + , Str "was" + , Space + , Str "separated" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "line" + , Space , Str "with" , Space - , Str "terms" + , Str "blanks." + , SoftBreak + , Str "You" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "put" + , Space + , Str "a" + , Space + , Str "blank" + , Space + , Str "line" + , Space + , Str "inside" + ] + , Para + [ Str "the" + , Space + , Str "item" + , Space + , Str "contents" + , Space + , Str "and" + , Space + , Str "it" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "preserved." + ] + ] + ] + , Para + [ Str "-This" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "(no" + , Space + , Str "space)" + ] + , Para + [ Str "-" + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "(more" + , Space + , Str "than" + , Space + , Str "one" + , Space + , Str "space)" + ] + , Para + [ Str "-" + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "(a" + , Space + , Str "TAB" + , Space + , Str "instead" + , Space + , Str "the" + , Space + , Str "space)" + ] + , BulletList + [ [ BulletList + [ [ Plain + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + ] + ] + ] + ] + , [ OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + ] + ] + ] + ] + , [ DefinitionList + [ ( [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "list" + ] + , [ [] ] + ) + ] + ] + ] + , BulletList + [ [ Plain + [ Str "This" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "\"mother\"" + , Space + , Str "list" + , Space + , Str "first" + , Space + , Str "item." + ] + ] + , [ Plain + [ Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "second," + , Space + , Str "but" + , Space + , Str "inside" + , Space + , Str "this" + , Space + , Str "item," + ] + , BulletList + [ [ Plain + [ Str "there" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "sublist," + , Space + , Str "with" + , Space + , Str "its" + , Space + , Str "own" + , Space + , Str "items." + ] + ] + , [ Plain + [ Str "Note" + , Space + , Str "that" + , Space + , Str "the" + , Space + , Str "items" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "same" + , Space + , Str "sublist" + ] + ] + , [ Plain + [ Str "must" + , Space + , Str "have" + , Space + , Str "the" + , Space + , Str "same" + , Space + , Str "indentation." + ] + , BulletList + [ [ Plain + [ Str "And" + , Space + , Str "this" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "on," + , Space + , Str "opening" + , Space + , Str "sublists." + ] + , BulletList + [ [ Plain + [ Str "Just" + , Space + , Str "add" + , Space + , Str "leading" + , Space + , Str "spaces" + , Space + , Str "before" + , Space + , Str "the" + ] + ] + , [ Plain + [ Str "hyphen" + , Space + , Str "and" + , Space + , Str "sublists" + , Space + , Str "will" + , Space + , Str "be" + , Space + , Str "opened." + ] + ] + , [ Plain + [ Str "The" + , Space + , Str "two" + , Space + , Str "blank" + , Space + , Str "lines" + , Space + , Str "closes" + , Space + , Str "them" + , Space + , Str "all." + ] + ] + ] + ] + ] + ] ] - ] ] - ) - , - ( - [ Str "Start" - , Space - , Str "term" - , Space - , Str "with" - , Space - , Str "colon" + ] + , BulletList + [ [ Plain + [ Str "When" + , Space + , Str "nesting" + , Space + , Str "lists," + , Space + , Str "the" + , Space + , Str "additional" + , Space + , Str "spaces" + , Space + , Str "are" + , Space + , Str "free." + ] ] - , - [ - [ Plain - [ Str "And" + , [ Plain + [ Str "You" , Space - , Str "its" + , Str "can" + , Space + , Str "add" , Space - , Str "definition" + , Str "just" , Space - , Str "follows" + , Str "one," + ] + , BulletList + [ [ Plain [ Str "or" , Space , Str "many." ] + , BulletList + [ [ Plain + [ Str "What" + , Space + , Str "matters" + , Space + , Str "is" + , Space + , Str "to" + , Space + , Str "put" + , Space + , Str "more" + , Space + , Str "than" + , Space + , Str "the" + , Space + , Str "previous." + ] + ] + , [ Plain + [ Str "But" + , Space + , Str "remember" + , Space + , Str "that" + , Space + , Str "the" + , Space + , Str "other" + , Space + , Str "items" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "same" + , Space + , Str "list" + ] + ] + , [ Plain + [ Str "must" + , Space + , Str "use" + , Space + , Str "the" + , Space + , Str "same" + , Space + , Str "indentation." + ] + ] + ] + ] ] - ] - ] - ) - ] - , Header 1 - ( "numlist", [], [] ) - [ Str "Numbered", Space, Str "List" ] - , Para - [ Str "See" - , Space - , Link - ( "", [], [] ) - [ Str "List" ] - ( "#list", "" ) - , Str "," - , Space - , Str "the" - , Space - , Str "same" - , Space - , Str "rules" - , Space - , Str "apply." - ] - , Header 1 - ( "list", [], [] ) - [ Str "List" ] - , BulletList - [ - [ Plain - [ Str "Use" - , Space - , Str "the" - , Space - , Str "hyphen" - , Space - , Str "to" - , Space - , Str "prefix" - , Space - , Str "list" - , Space - , Str "items." - ] - ] - , - [ Plain - [ Str "There" - , Space - , Str "must" - , Space - , Str "be" - , Space - , Str "one" - , Space - , Str "space" - , Space - , Str "after" - , Space - , Str "the" - , Space - , Str "hyphen." - ] - ] - , - [ Plain - [ Str "The" - , Space - , Str "list" - , Space - , Str "is" - , Space - , Str "closed" - , Space - , Str "by" - , Space - , Str "two" - , Space - , Str "consecutive" - , Space - , Str "blank" - , Space - , Str "lines." - ] - ] - ] - , BulletList - [ - [ Plain - [ Str "The" - , Space - , Str "list" - , Space - , Str "can" - , Space - , Str "be" - , Space - , Str "indented" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "source" - , Space - , Str "document." - ] - ] - , - [ Plain - [ Str "You" - , Space - , Str "can" - , Space - , Str "use" - , Space - , Str "any" - , Space - , Str "number" - , Space - , Str "of" - , Space - , Str "spaces." - ] - ] - , - [ Plain - [ Str "The" - , Space - , Str "result" - , Space - , Str "will" - , Space - , Str "be" - , Space - , Str "the" - , Space - , Str "same." - ] - ] - ] - , BulletList - [ - [ Para - [ Str "Let" - , Space - , Str "one" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "between" - , Space - , Str "the" - , Space - , Str "list" - , Space - , Str "items." - ] - ] - , - [ Para - [ Str "It" - , Space - , Str "will" - , Space - , Str "be" - , Space - , Str "maintained" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "conversion." - ] - ] - , - [ Para - [ Str "Some" - , Space - , Str "targets" - , Space - , Str "don't" - , Space - , Str "support" - , Space - , Str "this" - , Space - , Str "behavior." - ] - ] - , - [ Para - [ Str "This" - , Space - , Str "one" - , Space - , Str "was" - , Space - , Str "separated" - , Space - , Str "by" - , Space - , Str "a" - , Space - , Str "line" - , Space - , Str "with" - , Space - , Str "blanks." - , SoftBreak - , Str "You" - , Space - , Str "can" - , Space - , Str "also" - , Space - , Str "put" - , Space - , Str "a" - , Space - , Str "blank" - , Space - , Str "line" - , Space - , Str "inside" - ] - , Para - [ Str "the" - , Space - , Str "item" - , Space - , Str "contents" - , Space - , Str "and" - , Space - , Str "it" - , Space - , Str "will" - , Space - , Str "be" - , Space - , Str "preserved." ] ] - ] - , Para - [ Str "-This" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "(no" - , Space - , Str "space)" - ] - , Para - [ Str "-" - , Space - , Str "This" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "(more" - , Space - , Str "than" - , Space - , Str "one" - , Space - , Str "space)" - ] - , Para - [ Str "-" - , Space - , Str "This" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "(a" - , Space - , Str "TAB" - , Space - , Str "instead" - , Space - , Str "the" - , Space - , Str "space)" - ] , BulletList - [ - [ BulletList - [ - [ Plain - [ Str "This" + [ [ Plain + [ Str "There" , Space , Str "is" , Space + , Str "not" + , Space , Str "a" , Space - , Str "list" + , Str "depth" + , Space + , Str "limit," + ] + , BulletList + [ [ Plain + [ Str "you" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "deeper" + , Space + , Str "and" + , Space + , Str "deeper." + ] + , BulletList + [ [ Plain + [ Str "But" + , Space + , Str "some" + , Space + , Str "targets" + , Space + , Str "may" + , Space + , Str "have" + , Space + , Str "restrictions." + ] + , BulletList + [ [ Plain + [ Str "The" + , Space + , Str "LaTeX" + , Space + , Str "maximum" + , Space + , Str "is" + , Space + , Str "here," + , Space + , Str "4" + , Space + , Str "levels." + ] + ] + ] + ] + ] + ] ] - ] ] ] - , - [ OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "This" + , BulletList + [ [ Plain + [ Str "Reverse" , Space - , Str "is" + , Str "nesting" , Space - , Str "a" + , Str "doesn't" , Space - , Str "list" + , Str "work." ] - ] ] - ] - , - [ DefinitionList - [ - ( - [ Str "This" + , [ Plain + [ Str "Because" , Space - , Str "is" + , Str "a" + , Space + , Str "sublist" + , Space + , Str "*must*" + , Space + , Str "have" , Space , Str "a" , Space - , Str "list" + , Str "mother" + , Space + , Str "list." ] - , [ [] ] - ) - ] - ] - ] - , BulletList - [ - [ Plain - [ Str "This" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "\"mother\"" - , Space - , Str "list" - , Space - , Str "first" - , Space - , Str "item." ] - ] - , - [ Plain - [ Str "Here" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "second," - , Space - , Str "but" - , Space - , Str "inside" - , Space - , Str "this" - , Space - , Str "item," - ] - , BulletList - [ - [ Plain - [ Str "there" + , [ Plain + [ Str "It's" , Space - , Str "is" + , Str "the" , Space - , Str "a" + , Str "list" , Space - , Str "sublist," + , Str "concept," , Space - , Str "with" + , Str "not" , Space - , Str "its" + , Str "a" , Space - , Str "own" + , Str "txt2tags" , Space - , Str "items." + , Str "limitation." ] - ] - , - [ Plain - [ Str "Note" + ] + , [ Plain + [ Str "All" , Space - , Str "that" + , Str "this" , Space - , Str "the" + , Str "sublists" , Space - , Str "items" + , Str "will" , Space - , Str "of" + , Str "be" , Space - , Str "the" + , Str "bumped" , Space - , Str "same" + , Str "to" , Space - , Str "sublist" + , Str "mother" + , Space + , Str "lists." ] - ] - , - [ Plain - [ Str "must" + ] + , [ Plain + [ Str "At" , Space - , Str "have" + , Str "level" , Space - , Str "the" + , Str "1," , Space - , Str "same" + , Str "like" , Space - , Str "indentation." + , Str "this" + , Space + , Str "one." ] - , BulletList - [ - [ Plain - [ Str "And" - , Space - , Str "this" - , Space - , Str "can" - , Space - , Str "go" - , Space - , Str "on," - , Space - , Str "opening" - , Space - , Str "sublists." - ] + ] + ] + , BulletList + [ [ Plain [ Str "Level" , Space , Str "1" ] + , BulletList + [ [ Plain [ Str "Level" , Space , Str "2" ] , BulletList - [ - [ Plain - [ Str "Just" - , Space - , Str "add" - , Space - , Str "leading" - , Space - , Str "spaces" - , Space - , Str "before" - , Space - , Str "the" - ] - ] - , - [ Plain - [ Str "hyphen" - , Space - , Str "and" - , Space - , Str "sublists" - , Space - , Str "will" - , Space - , Str "be" - , Space - , Str "opened." + [ [ Plain [ Str "Level" , Space , Str "3" ] + , BulletList + [ [ Plain [ Str "Level" , Space , Str "4" ] ] ] ] - ] - , - [ Plain - [ Str "The" - , Space - , Str "two" - , Space - , Str "blank" - , Space - , Str "lines" - , Space - , Str "closes" - , Space - , Str "them" - , Space - , Str "all." + , [ Plain + [ Str "Level" + , Space + , Str "3" + , Space + , Str "--" + , Space + , Str "(closed" + , Space + , Str "Level" + , Space + , Str "4)" + ] ] ] - ] - ] - ] - ] - ] - ] - ] - , BulletList - [ - [ Plain - [ Str "When" - , Space - , Str "nesting" - , Space - , Str "lists," - , Space - , Str "the" - , Space - , Str "additional" - , Space - , Str "spaces" - , Space - , Str "are" - , Space - , Str "free." - ] - ] - , - [ Plain - [ Str "You" - , Space - , Str "can" - , Space - , Str "add" - , Space - , Str "just" - , Space - , Str "one," - ] - , BulletList - [ - [ Plain - [ Str "or", Space, Str "many." ] - , BulletList - [ - [ Plain - [ Str "What" - , Space - , Str "matters" - , Space - , Str "is" - , Space - , Str "to" - , Space - , Str "put" - , Space - , Str "more" - , Space - , Str "than" - , Space - , Str "the" - , Space - , Str "previous." - ] - ] - , - [ Plain - [ Str "But" - , Space - , Str "remember" - , Space - , Str "that" - , Space - , Str "the" - , Space - , Str "other" - , Space - , Str "items" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "same" - , Space - , Str "list" - ] ] - , - [ Plain - [ Str "must" - , Space - , Str "use" - , Space - , Str "the" - , Space - , Str "same" - , Space - , Str "indentation." - ] + , [ Plain + [ Str "Level" + , Space + , Str "2" + , Space + , Str "--" + , Space + , Str "(closed" + , Space + , Str "Level" + , Space + , Str "3)" + ] ] ] - ] - ] - ] - ] - , BulletList - [ - [ Plain - [ Str "There" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "depth" - , Space - , Str "limit," ] - , BulletList - [ - [ Plain - [ Str "you" + , [ Plain + [ Str "Level" , Space - , Str "can" + , Str "1" , Space - , Str "go" + , Str "--" , Space - , Str "deeper" + , Str "(closed" , Space - , Str "and" + , Str "Level" , Space - , Str "deeper." + , Str "2)" ] - , BulletList - [ - [ Plain - [ Str "But" - , Space - , Str "some" - , Space - , Str "targets" - , Space - , Str "may" - , Space - , Str "have" - , Space - , Str "restrictions." - ] + ] + ] + , BulletList + [ [ Plain [ Str "Level" , Space , Str "1" ] + , BulletList + [ [ Plain [ Str "Level" , Space , Str "2" ] , BulletList - [ - [ Plain - [ Str "The" - , Space - , Str "LaTeX" - , Space - , Str "maximum" - , Space - , Str "is" - , Space - , Str "here," - , Space - , Str "4" - , Space - , Str "levels." + [ [ Plain [ Str "Level" , Space , Str "3" ] + , BulletList + [ [ Plain [ Str "Level" , Space , Str "4" ] ] ] ] ] - ] ] ] - ] ] - ] - ] - , BulletList - [ - [ Plain - [ Str "Reverse" - , Space - , Str "nesting" - , Space - , Str "doesn't" - , Space - , Str "work." - ] - ] - , - [ Plain - [ Str "Because" - , Space - , Str "a" - , Space - , Str "sublist" - , Space - , Str "*must*" - , Space - , Str "have" - , Space - , Str "a" - , Space - , Str "mother" - , Space - , Str "list." - ] - ] - , - [ Plain - [ Str "It's" - , Space - , Str "the" - , Space - , Str "list" - , Space - , Str "concept," - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "txt2tags" - , Space - , Str "limitation." - ] - ] - , - [ Plain - [ Str "All" - , Space - , Str "this" - , Space - , Str "sublists" - , Space - , Str "will" - , Space - , Str "be" - , Space - , Str "bumped" - , Space - , Str "to" - , Space - , Str "mother" - , Space - , Str "lists." - ] - ] - , - [ Plain - [ Str "At" - , Space - , Str "level" - , Space - , Str "1," - , Space - , Str "like" - , Space - , Str "this" - , Space - , Str "one." + , [ Plain + [ Str "Level" + , Space + , Str "1" + , Space + , Str "--" + , Space + , Str "(closed" + , Space + , Str "Level" + , Space + , Str "4," + , Space + , Str "Level" + , Space + , Str "3" + , Space + , Str "and" + , Space + , Str "Level" + , Space + , Str "2)" + ] ] ] - ] , BulletList - [ - [ Plain - [ Str "Level", Space, Str "1" ] - , BulletList - [ - [ Plain - [ Str "Level", Space, Str "2" ] - , BulletList - [ - [ Plain - [ Str "Level", Space, Str "3" ] + [ [ Para [ Str "Level" , Space , Str "1" ] + , BulletList + [ [ Para + [ Str "Level" + , Space + , Str "2" + , Space + , Str "--" + , Space + , Str "blank" + , Space + , Str "BEFORE" + , Space + , Str "and" + , Space + , Str "AFTER" + , Space + , Str "(in)" + ] , BulletList - [ [ Plain [ Str "Level", Space, Str "4" ] ] ] - ] - , - [ Plain - [ Str "Level" - , Space - , Str "3" - , Space - , Str "--" - , Space - , Str "(closed" - , Space - , Str "Level" - , Space - , Str "4)" - ] + [ [ Plain [ Str "Level" , Space , Str "3" ] ] ] ] ] - ] - , - [ Plain + ] + ] + , BulletList [ [ Plain [ Str "Level" , Space , Str "4" ] ] ] + , BulletList + [ [ Para [ Str "Level" , Space , Str "3" ] ] + , [ Para [ Str "Level" , Space , Str "2" , Space , Str "--" , Space - , Str "(closed" + , Str "blank" , Space - , Str "Level" + , Str "BEFORE" + , Space + , Str "and" + , Space + , Str "AFTER" , Space - , Str "3)" + , Str "(out)" ] - ] ] - ] - , - [ Plain - [ Str "Level" - , Space - , Str "1" - , Space - , Str "--" - , Space - , Str "(closed" - , Space - , Str "Level" - , Space - , Str "2)" + , [ Para [ Str "Level" , Space , Str "1" ] + , BulletList + [ [ Para + [ Str "Level" + , Space + , Str "2" + , Space + , Str "--" + , Space + , Str "blank" + , Space + , Str "BEFORE" + , Space + , Str "(spaces)" + , Space + , Str "and" + , Space + , Str "AFTER" + , Space + , Str "(TAB)" + ] + , BulletList + [ [ Plain [ Str "Level" , Space , Str "3" ] ] ] + ] + ] ] ] - ] , BulletList - [ - [ 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" ] + , BulletList + [ [ Plain [ Str "Level" , Space , Str "2" ] , BulletList - [ [ Plain [ Str "Level", Space, Str "4" ] ] ] + [ [ Plain [ Str "Level" , Space , Str "3" ] + , BulletList + [ [ Plain [ Str "Level" , Space , Str "4" ] ] + , [ Plain + [ Str "Level" + , Space + , Str "3.5" + , Space + , Str "???" + ] + ] + ] + ] + , [ Plain [ Str "Level" , Space , Str "3" ] ] + , [ Plain + [ Str "Level" + , Space + , Str "2.5" + , Space + , Str "???" + ] + ] + ] + ] + , [ Plain [ Str "Level" , Space , Str "2" ] ] + , [ Plain + [ Str "Level" + , Space + , Str "1.5" + , Space + , Str "???" + ] ] ] - ] - ] - ] - , - [ Plain - [ Str "Level" - , Space - , Str "1" - , Space - , Str "--" - , Space - , Str "(closed" - , Space - , Str "Level" - , Space - , Str "4," - , Space - , Str "Level" - , Space - , Str "3" - , Space - , Str "and" - , Space - , Str "Level" - , Space - , Str "2)" + ] + , [ Plain [ Str "Level" , Space , Str "1" ] ] + ] + , BulletList + [ [ Plain + [ Str "This" + , Space + , Str "list" + , Space + , Str "is" + , Space + , Str "closed" + , Space + , Str "by" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "with" + , Space + , Str "spaces" + , Space + , Str "and" + , Space + , Str "other" + , Space + , Str "with" + , Space + , Str "TABs" + ] ] ] - ] , BulletList - [ - [ Para - [ Str "Level", Space, Str "1" ] - , BulletList - [ - [ Para - [ Str "Level" + [ [ Plain + [ Str "This" , Space - , Str "2" + , Str "list" , Space - , Str "--" + , Str "is" , Space - , Str "blank" + , Str "NOT" , Space - , Str "BEFORE" + , Str "closed" , Space - , Str "and" + , Str "by" , Space - , Str "AFTER" + , Str "two" + , Space + , Str "comment" , Space - , Str "(in)" + , Str "lines" ] - , BulletList - [ [ Plain [ Str "Level", Space, Str "3" ] ] ] - ] ] ] - ] - , BulletList - [ [ Plain [ Str "Level", Space, Str "4" ] ] ] , BulletList - [ - [ Para [ Str "Level", Space, Str "3" ] ] - , - [ Para - [ Str "Level" - , Space - , Str "2" - , Space - , Str "--" - , Space - , Str "blank" - , Space - , Str "BEFORE" - , Space - , Str "and" - , Space - , Str "AFTER" - , Space - , Str "(out)" - ] - ] - , - [ Para - [ Str "Level", Space, Str "1" ] - , BulletList - [ - [ Para - [ Str "Level" + [ [ Plain + [ Str "This" , Space - , Str "2" + , Str "list" , Space - , Str "--" + , Str "is" , Space - , Str "blank" + , Str "closed" , Space - , Str "BEFORE" + , Str "by" + , Space + , Str "a" + , Space + , Str "line" , Space - , Str "(spaces)" + , Str "with" + , Space + , Str "spaces" , Space , Str "and" , Space - , Str "AFTER" + , Str "TAB," + ] + ] + , [ Plain + [ Str "then" + , Space + , Str "a" + , Space + , Str "comment" + , Space + , Str "line," + , Space + , Str "then" + , Space + , Str "an" + , Space + , Str "empty" , Space - , Str "(TAB)" + , Str "line." ] - , BulletList - [ [ Plain [ Str "Level", Space, Str "3" ] ] ] - ] ] ] - ] , BulletList - [ - [ 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" ] + , BulletList + [ [ Plain [ Str "Level" , Space , Str "2" ] , BulletList - [ - [ Plain [ Str "Level", Space, Str "4" ] ] - , - [ Plain - [ Str "Level", Space, Str "3.5", Space, Str "???" ] + [ [ Plain [ Str "Level" , Space , Str "3" ] ] ] + , Plain + [ Str "-" + , SoftBreak + , Str "Level" + , Space + , Str "2" ] - ] - ] - , - [ Plain [ Str "Level", Space, Str "3" ] ] - , - [ Plain - [ Str "Level", Space, Str "2.5", Space, Str "???" ] ] ] - ] - , - [ Plain [ Str "Level", Space, Str "2" ] ] - , - [ Plain [ Str "Level", Space, Str "1.5", Space, Str "???" ] ] - ] - ] - , - [ Plain [ Str "Level", Space, Str "1" ] ] - ] - , BulletList - [ - [ Plain - [ Str "This" - , Space - , Str "list" - , Space - , Str "is" - , Space - , Str "closed" - , Space - , Str "by" - , Space - , Str "a" - , Space - , Str "line" - , Space - , Str "with" - , Space - , Str "spaces" - , Space - , Str "and" - , Space - , Str "other" - , Space - , Str "with" - , Space - , Str "TABs" - ] - ] - ] - , BulletList - [ - [ Plain - [ Str "This" - , Space - , Str "list" - , Space - , Str "is" - , Space - , Str "NOT" - , Space - , Str "closed" - , Space - , Str "by" - , Space - , Str "two" - , Space - , Str "comment" - , Space - , Str "lines" - ] - ] - ] - , BulletList - [ - [ Plain - [ Str "This" - , Space - , Str "list" - , Space - , Str "is" - , Space - , Str "closed" - , Space - , Str "by" - , Space - , Str "a" - , Space - , Str "line" - , Space - , Str "with" - , Space - , Str "spaces" - , Space - , Str "and" - , Space - , Str "TAB," - ] - ] - , - [ Plain - [ Str "then" - , Space - , Str "a" - , Space - , Str "comment" - , Space - , Str "line," - , Space - , Str "then" - , Space - , Str "an" - , Space - , Str "empty" - , Space - , Str "line." + , Plain + [ Str "-" , SoftBreak , Str "Level" , Space , Str "1" ] ] ] - ] + , Para [ Str "-" ] , BulletList - [ - [ Plain - [ Str "Level", Space, Str "1" ] - , BulletList - [ - [ Plain - [ Str "Level", Space, Str "2" ] - , BulletList - [ [ Plain [ Str "Level", Space, Str "3" ] ] ] - , Plain - [ Str "-", SoftBreak, Str "Level", Space, Str "2" ] - ] - ] - , Plain - [ Str "-", SoftBreak, Str "Level", Space, Str "1" ] - ] - ] - , Para - [ Str "-" ] - , BulletList - [ - [ Plain - [ Str "Empty" - , Space - , Str "item" - , Space - , Str "with" - , Space - , Str "trailing" - , Space - , Str "spaces." + [ [ Plain + [ Str "Empty" + , Space + , Str "item" + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "spaces." + ] ] ] - ] - , Para - [ Str "-" ] + , Para [ Str "-" ] , BulletList - [ - [ Plain - [ Str "Empty" - , Space - , Str "item" - , Space - , Str "with" - , Space - , Str "trailing" - , Space - , Str "TAB." + [ [ Plain + [ Str "Empty" + , Space + , Str "item" + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "TAB." + ] ] ] - ] - , Para - [ Str "-" ] + , Para [ Str "-" ] , BulletList - [ - [ Plain - [ Str "If" - , Space - , Str "the" - , Space - , Str "end" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "file" - , Space - , Str "(EOF)" - , Space - , Str "is" - , Space - , Str "hit," - ] - , BulletList - [ - [ Plain - [ Str "all" + [ [ Plain + [ Str "If" , Space , Str "the" , Space - , Str "currently" + , Str "end" , Space - , Str "opened" + , Str "of" , Space - , Str "list" + , Str "the" , Space - , Str "are" + , Str "file" , Space - , Str "closed," + , Str "(EOF)" + , Space + , Str "is" + , Space + , Str "hit," ] - , BulletList - [ - [ Plain - [ Str "just" - , Space - , Str "like" - , Space - , Str "when" - , Space - , Str "using" - , Space - , Str "the" - , Space - , Str "two" - , Space - , Str "blank" - , Space - , Str "lines." - ] + , BulletList + [ [ Plain + [ Str "all" + , Space + , Str "the" + , Space + , Str "currently" + , Space + , Str "opened" + , Space + , Str "list" + , Space + , Str "are" + , Space + , Str "closed," + ] + , BulletList + [ [ Plain + [ Str "just" + , Space + , Str "like" + , Space + , Str "when" + , Space + , Str "using" + , Space + , Str "the" + , Space + , Str "two" + , Space + , Str "blank" + , Space + , Str "lines." + ] + ] + ] ] ] - ] ] ] - ] - , Header 1 - ( "table", [], [] ) - [ Str "Table" ] + , Header 1 ( "table" , [] , [] ) [ Str "Table" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignRight, ColWidthDefault ) ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignRight , ColWidthDefault ) ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignRight, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignRight , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) , Para - [ Str "||" - , Space - , Str "Cell" - , Space - , Str "1" - , Space - , Str "|" - , Space - , Str "Cell" - , Space - , Str "2" - , Space - , Str "|" - , Space - , Str "Cell" - , Space - , Str "3" - , Space - , Str "|" - ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Cell", Space, Str "3" ] ] - ] + [ Str "||" + , Space + , Str "Cell" + , Space + , Str "1" + , Space + , Str "|" + , Space + , Str "Cell" + , Space + , Str "2" + , Space + , Str "|" + , Space + , Str "Cell" + , Space + , Str "3" + , Space + , Str "|" ] - ] - ( TableFoot ( "", [], [] ) [] ) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Heading" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Heading" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Heading" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "<-" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "--" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "->" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "--" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "--" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "--" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "->" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "--" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "<-" ] ] - ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Cell" , Space , Str "3" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3+4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1+2+3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2+3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1+2+3+4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Heading" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Heading" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Heading" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "<-" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "--" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "->" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "--" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "--" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "--" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "->" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "--" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "<-" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "7" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "8" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "A" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "B" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "D" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "E" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "F" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3+4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1+2+3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2+3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1+2+3+4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Jan" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Fev" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Mar" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Apr" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "May" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "20%" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "40%" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "60%" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "80%" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "100%" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "7" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "8" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "A" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "B" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "D" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "E" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "F" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "/" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "/" - , Space - , Str "/" - , Space - , Str "/" - , Space - , Str "/" - , Space - , Str "/" - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "/" - , Space - , Str "/" - , Space - , Str "/" - , Space - , Str "/" - , Space - , Str "/" - , Space - , Str "/" - , Space - , Str "/" - , Space - , Str "/" - , Space - , Str "/" - ] + ] + (TableFoot ( "" , [] , [] ) []) + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Jan" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Fev" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Mar" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Apr" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "May" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "20%" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "40%" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "60%" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "80%" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "100%" ] ] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "o" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "o" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "." ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "=", Space, Str "=", Space, Str "=", Space, Str "=" ] + ] + (TableFoot ( "" , [] , [] ) []) + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "/" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + , Space + , Str "/" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "o" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "o" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "." ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "=" + , Space + , Str "=" + , Space + , Str "=" + , Space + , Str "=" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "01" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "02" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "05" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "07" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "11" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "13" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "16" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "17" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "19" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "20" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "23" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "25" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "26" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "29" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "30" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "32" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "35" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "37" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "39" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "40" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "01" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "02" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "05" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "07" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "11" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "13" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "16" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "17" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "19" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "20" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "23" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "25" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "26" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "29" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "30" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "32" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "35" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "37" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "39" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "40" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - , - ( AlignCenter, ColWidthDefault ) - ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "7" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "8" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "9" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "A" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "B" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "C" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "D" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "E" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "F" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "0" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "3" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "4" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "5" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "6" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "7" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "8" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "9" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "A" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "B" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "C" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "D" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "E" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "F" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + , ( AlignCenter , ColWidthDefault ) + ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "7" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "8" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "9" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "A" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "B" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "C" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "D" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "E" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "F" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "0" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "3" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "4" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "5" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "6" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "7" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "8" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "9" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "A" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "B" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "C" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "D" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "E" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "F" ] ] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) + (TableFoot ( "" , [] , [] ) []) , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ ( AlignCenter, ColWidthDefault ) ] - ( TableHead ( "", [], [] ) [] ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignCenter , ColWidthDefault ) ] + (TableHead ( "" , [] , [] ) []) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ] ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Para - [ Str "|this|is|not|a|table|" ] + (TableFoot ( "" , [] , [] ) []) + , Para [ Str "|this|is|not|a|table|" ] , Para - [ Str "|this|" - , Space - , Str "is|" - , Space - , Str "not|" - , Space - , Str "a|" - , Space - , Str "table|" - ] + [ Str "|this|" + , Space + , Str "is|" + , Space + , Str "not|" + , Space + , Str "a|" + , Space + , Str "table|" + ] , Para - [ Str "|this" - , Space - , Str "|is" - , Space - , Str "|not" - , Space - , Str "|a" - , Space - , Str "|table" - , Space - , Str "|" - ] + [ Str "|this" + , Space + , Str "|is" + , Space + , Str "|not" + , Space + , Str "|a" + , Space + , Str "|table" + , Space + , Str "|" + ] , Para - [ Str "|" - , Space - , Str "this\t|" - , Space - , Str "is\t|" - , Space - , Str "not\t|" - , Space - , Str "a\t|" - , Space - , Str "table\t|" - ] + [ Str "|" + , Space + , Str "this\t|" + , Space + , Str "is\t|" + , Space + , Str "not\t|" + , Space + , Str "a\t|" + , Space + , Str "table\t|" + ] , HorizontalRule - , Para - [ Str "The", Space, Str "End." ] + , Para [ Str "The" , Space , Str "End." ] ] diff --git a/test/vimwiki-reader.native b/test/vimwiki-reader.native index 356d1b949..b8f853ce0 100644 --- a/test/vimwiki-reader.native +++ b/test/vimwiki-reader.native @@ -1,2419 +1,2429 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "date", MetaInlines [ Str "2017-05-01" ] ) - , - ( "title", MetaInlines [ Str "title" ] ) - ] + Meta + { unMeta = + fromList + [ ( "date" , MetaInlines [ Str "2017-05-01" ] ) + , ( "title" , MetaInlines [ Str "title" ] ) + ] } - ) - [ Header 1 - ( "implemented", [], [] ) - [ Emph - [ Span - ( "implemented", [], [] ) [] - , Strong - [ Str "implemented" ] - ] - ] - , Header 1 - ( "header", [], [] ) - [ Str "header" ] - , Header 2 - ( "header level two", [], [] ) - [ Str "header", Space, Str "level", Space, Str "two" ] - , Header 3 - ( "header level 3", [], [] ) - [ Str "header", Space, Code ( "", [], [] ) "level", Space, Str "3" ] - , Header 4 - ( "header level four", [], [] ) - [ Str "header" - , Space - , Strikeout - [ Str "level" ] - , Space - , Str "four" - ] - , Header 5 - ( "header level 5", [], [] ) - [ Str "header" - , Space - , Emph - [ Span - ( "level", [], [] ) [] - , Strong - [ Str "level" ] - , Space - , Str "5" - ] - ] - , Header 6 - ( "header level 6", [], [] ) - [ Str "header", Space, Str "level", Space, Str "6" ] - , Para - [ Str "=======" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header" - , Space - , Str "========" - ] - , Para - [ Str "hi==" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header" - , Space - , Str "==" - ] - , Para - [ Str "===" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header" - , Space - , Str "==" - ] - , Para - [ Str "===" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header" - , Space - , Str "===-" - ] - , Para - [ Str "not", Space, Str "a", Space, Str "header:" ] - , Para - [ Str "=n=" ] - , Para - [ Str "===" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "header" - , Space - , Str "====" - ] - , Header 2 - ( "centred header", [ "justcenter" ], [] ) - [ Str "centred", Space, Str "header" ] - , Header 2 - ( "header with some == in between", [], [] ) - [ Str "header" - , Space - , Str "with" - , Space - , Str "some" - , Space - , Code - ( "", [], [] ) "==" - , Space - , Str "in" - , Space - , Str "between" - ] - , Header 2 - ( "header with some == in between", [], [] ) - [ Str "header" - , Space - , Str "with" - , Space - , Str "some" - , Space - , Str "==" - , Space - , Str "in" - , Space - , Str "between" - ] - , Header 2 - ( "header with some ==in between", [], [] ) - [ Str "header" - , Space - , Str "with" - , Space - , Str "some" - , Space - , Str "==in" - , Space - , Str "between" - ] - , Header 2 - ( "emph strong and strikeout", [], [] ) - [ Str "emph" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "strikeout" - ] - , Para - [ Emph - [ Str "emph" ] - , Space - , Span - ( "strong", [], [] ) [] - , Strong - [ Str "strong" ] - ] - , Para - [ Span - ( "strong and emph", [], [] ) [] - , Strong - [ Emph [ Str "strong", Space, Str "and", Space, Str "emph" ] ] - ] - , Para - [ Emph - [ Span - ( "emph and strong", [], [] ) [] - , Strong - [ Str "emph", Space, Str "and", Space, Str "strong" ] + [ Header + 1 + ( "implemented" , [] , [] ) + [ Emph + [ Span ( "implemented" , [] , [] ) [] + , Strong [ Str "implemented" ] + ] ] - ] - , Para - [ Span - ( "emph inside strong", [], [] ) [] - , Strong - [ Emph [ Str "emph", Space, Str "inside" ], Space, Str "strong" ] - ] - , Para - [ Span - ( "strong with emph", [], [] ) [] - , Strong - [ Str "strong", Space, Str "with", Space, Emph [ Str "emph" ] ] - ] - , Para - [ Emph - [ Span - ( "strong inside", [], [] ) [] - , Strong - [ Str "strong", Space, Str "inside" ] + , Header 1 ( "header" , [] , [] ) [ Str "header" ] + , Header + 2 + ( "header level two" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "two" ] + , Header + 3 + ( "header level 3" , [] , [] ) + [ Str "header" + , Space + , Code ( "" , [] , [] ) "level" , Space - , Str "emph" + , Str "3" ] - ] - , Para - [ Emph - [ Strikeout - [ Str "strikeout" ] + , Header + 4 + ( "header level four" , [] , [] ) + [ Str "header" , Space - , Str "inside" + , Strikeout [ Str "level" ] , Space - , Str "emph" + , Str "four" ] - ] - , Para - [ Strikeout - [ Str "This" - , Space - , Str "is" + , Header + 5 + ( "header level 5" , [] , [] ) + [ Str "header" , Space , Emph - [ Str "struck", Space, Str "out" ] - , Space - , Str "with" - , Space - , Str "emph" + [ Span ( "level" , [] , [] ) [] + , Strong [ Str "level" ] + , Space + , Str "5" + ] ] - ] - , Para - [ Str "*not", SoftBreak, Str "strong*" ] - , Para - [ Str "just" - , Space - , Str "two" - , Space - , Str "stars:" - , Space - , Str "**" - ] - , Para - [ Str "just" - , Space - , Str "two" - , Space - , Str "underscores:" - , Space - , Str "__" - ] - , Para - [ Str "just" - , Space - , Str "four" - , Space - , Str "~s:" - , Space - , Str "~~~~" - ] - , Para - [ Str "_not", SoftBreak, Str "emph_" ] - , Para - [ Str "~~not", SoftBreak, Str "strikeout~~" ] - , Header 2 - ( "horizontal rule", [], [] ) - [ Str "horizontal", Space, Str "rule" ] - , Para - [ Str "top" ] - , HorizontalRule - , Para - [ Str "middle" ] - , HorizontalRule - , Para - [ Str "not", Space, Str "a", Space, Str "rule-----" ] - , Para - [ Str "not" - , Space - , Str "a" - , Space - , Str "rule" - , Space - , Str "(trailing" - , Space - , Str "spaces):" - , SoftBreak - , Str "-----" - ] - , Para - [ Str "not" - , Space - , Str "a" - , Space - , Str "rule" - , Space - , Str "(leading" - , Space - , Str "spaces):" - , SoftBreak - , Str "----" - ] - , Header 2 - ( "comments", [], [] ) - [ Str "comments" ] - , Para - [ Str "this" - , SoftBreak - , Str "is" - , Space - , Str "%%" - , Space - , Str "not" - , Space - , Str "secret" - ] - , Header 2 - ( "inline code", [], [] ) - [ Str "inline", Space, Str "code" ] + , Header + 6 + ( "header level 6" , [] , [] ) + [ Str "header" , Space , Str "level" , Space , Str "6" ] , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Code - ( "", [], [] ) "inline code" - , Str "." - ] - , Para - [ Str "Just" - , Space - , Str "two" - , Space - , Str "backticks:" - , Space - , Str "``" - ] - , Header 2 - ( "preformatted text", [], [] ) - [ Str "preformatted", Space, Str "text" ] - , CodeBlock - ( "" - , [] - , [] - ) " Tyger! Tyger! burning bright\n In the forests of the night,\n What immortal hand or eye\n Could frame thy fearful symmetry?\n In what distant deeps or skies\n Burnt the fire of thine eyes?\n On what wings dare he aspire?\n What the hand dare sieze the fire?" - , Header 3 - ( "preformatted text with attributes", [], [] ) - [ Str "preformatted" - , Space - , Str "text" - , Space - , Str "with" - , Space - , Str "attributes" - ] - , CodeBlock - ( "" - , [] - , - [ ( "class", "python" ), ( "style", "color:blue" ) ] - ) " for i in range(1, 5):\n print(i)" - , Header 3 - ( "preformatted text with nested syntax", [], [] ) - [ Str "preformatted" - , Space - , Str "text" - , Space - , Str "with" - , Space - , Str "nested" - , Space - , Str "syntax" - ] - , CodeBlock - ( "", [ "sql" ], [] ) "SELECT * FROM table" - , Header 3 - ( "empty preformatted text", [], [] ) - [ Str "empty", Space, Str "preformatted", Space, Str "text" ] - , CodeBlock - ( "", [], [] ) "" - , Header 2 - ( "block quotes", [], [] ) - [ Str "block", Space, Str "quotes" ] - , BlockQuote - [ Plain - [ Str "(indentation" + [ Str "=======" , Space - , Str "4" + , Str "not" , Space - , Str "spaces)" + , Str "a" , Space - , Str "This" + , Str "header" , Space - , Str "would" + , Str "========" + ] + , Para + [ Str "hi==" , Space - , Str "be" + , Str "not" , Space , Str "a" , Space - , Str "blockquote" - , Space - , Str "in" - , Space - , Str "Vimwiki." - , Space - , Str "It" + , Str "header" , Space - , Str "is" + , Str "==" + ] + , Para + [ Str "===" , Space , Str "not" , Space - , Span - ( "highlighted", [], [] ) [] - , Strong - [ Str "highlighted" ] + , Str "a" , Space - , Str "in" + , Str "header" , Space - , Str "Vim" + , Str "==" + ] + , Para + [ Str "===" , Space - , Str "but" - , SoftBreak - , Str "(indentation" + , Str "not" , Space - , Str "1" + , Str "a" , Space - , Str "space" + , Str "header" + , Space + , Str "===-" + ] + , Para + [ Str "not" , Space , Str "a" , Space , Str "header:" ] + , Para [ Str "=n=" ] + , Para + [ Str "===" , Space - , Str "followed" + , Str "not" , Space - , Str "by" + , Str "a" , Space - , Str "1" + , Str "header" , Space - , Str "tab" + , Str "====" + ] + , Header + 2 + ( "centred header" , [ "justcenter" ] , [] ) + [ Str "centred" , Space , Str "header" ] + , Header + 2 + ( "header with some == in between" , [] , [] ) + [ Str "header" , Space - , Str "of" + , Str "with" , Space - , Str "width" + , Str "some" , Space - , Str "4)" + , Code ( "" , [] , [] ) "==" , Space - , Str "could" + , Str "in" , Space - , Str "be" + , Str "between" + ] + , Header + 2 + ( "header with some == in between" , [] , [] ) + [ Str "header" , Space - , Str "styled" + , Str "with" , Space - , Str "by" + , Str "some" , Space - , Str "CSS" + , Str "==" , Space , Str "in" , Space - , Str "HTML." + , Str "between" + ] + , Header + 2 + ( "header with some ==in between" , [] , [] ) + [ Str "header" , Space - , Str "Blockquotes" + , Str "with" , Space - , Str "are" + , Str "some" , Space - , Str "usually" + , Str "==in" , Space - , Str "used" + , Str "between" + ] + , Header + 2 + ( "emph strong and strikeout" , [] , [] ) + [ Str "emph" , Space - , Str "to" + , Str "strong" , Space - , Str "quote" + , Str "and" , Space - , Str "a" - , SoftBreak - , Str "(indentation" + , Str "strikeout" + ] + , Para + [ Emph [ Str "emph" ] , Space - , Str "1" + , Span ( "strong" , [] , [] ) [] + , Strong [ Str "strong" ] + ] + , Para + [ Span ( "strong and emph" , [] , [] ) [] + , Strong + [ Emph + [ Str "strong" , Space , Str "and" , Space , Str "emph" ] + ] + ] + , Para + [ Emph + [ Span ( "emph and strong" , [] , [] ) [] + , Strong + [ Str "emph" , Space , Str "and" , Space , Str "strong" ] + ] + ] + , Para + [ Span ( "emph inside strong" , [] , [] ) [] + , Strong + [ Emph [ Str "emph" , Space , Str "inside" ] + , Space + , Str "strong" + ] + ] + , Para + [ Span ( "strong with emph" , [] , [] ) [] + , Strong + [ Str "strong" + , Space + , Str "with" + , Space + , Emph [ Str "emph" ] + ] + ] + , Para + [ Emph + [ Span ( "strong inside" , [] , [] ) [] + , Strong [ Str "strong" , Space , Str "inside" ] + , Space + , Str "emph" + ] + ] + , Para + [ Emph + [ Strikeout [ Str "strikeout" ] + , Space + , Str "inside" + , Space + , Str "emph" + ] + ] + , Para + [ Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "struck" , Space , Str "out" ] + , Space + , Str "with" + , Space + , Str "emph" + ] + ] + , Para [ Str "*not" , SoftBreak , Str "strong*" ] + , Para + [ Str "just" , Space - , Str "tab" + , Str "two" , Space - , Str "of" + , Str "stars:" , Space - , Str "width" + , Str "**" + ] + , Para + [ Str "just" , Space - , Str "4)" + , Str "two" , Space - , Str "long" + , Str "underscores:" , Space - , Str "piece" + , Str "__" + ] + , Para + [ Str "just" , Space - , Str "of" + , Str "four" , Space - , Str "text" + , Str "~s:" , Space - , Str "from" + , Str "~~~~" + ] + , Para [ Str "_not" , SoftBreak , Str "emph_" ] + , Para [ Str "~~not" , SoftBreak , Str "strikeout~~" ] + , Header + 2 + ( "horizontal rule" , [] , [] ) + [ Str "horizontal" , Space , Str "rule" ] + , Para [ Str "top" ] + , HorizontalRule + , Para [ Str "middle" ] + , HorizontalRule + , Para + [ Str "not" , Space , Str "a" , Space , Str "rule-----" ] + , Para + [ Str "not" , Space - , Str "another" + , Str "a" , Space - , Str "source." + , Str "rule" , Space - , Strikeout - [ Str "blah", Space, Str "blah" ] + , Str "(trailing" , Space - , Span - ( "-blockquote", [], [] ) - [ Str "" ] - , Span - ( "blockquote", [ "tag" ], [] ) - [ Str "blockquote" ] + , Str "spaces):" + , SoftBreak + , Str "-----" ] - ] - , Header 2 - ( "external links", [], [] ) - [ Str "external", Space, Str "links" ] , Para - [ Link - ( "", [], [] ) - [ Emph - [ Str "Google" ] + [ Str "not" + , Space + , Str "a" + , Space + , Str "rule" , Space - , Str "search" + , Str "(leading" , Space - , Str "engine" + , Str "spaces):" + , SoftBreak + , Str "----" ] - ( "http://google.com", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "http://pandoc.org" ] - ( "http://pandoc.org", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "ftp://vim.org" ] - ( "ftp://vim.org", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "http://google.com" ] - ( "http://google.com", "" ) - ] + , Header 2 ( "comments" , [] , [] ) [ Str "comments" ] , Para - [ Link - ( "", [], [] ) - [ Str "email", Space, Str "me" ] - ( "mailto:info@example.org", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "mailto:hello@bye.com" ] - ( "mailto:hello@bye.com", "" ) - ] - , Header 2 - ( "internal links", [], [] ) - [ Str "internal", Space, Str "links" ] - , Para - [ Link - ( "", [], [] ) - [ Str "This is a link" ] - ( "This is a link", "wikilink" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "Description" + [ Str "this" + , SoftBreak + , Str "is" , Space - , Str "of" + , Str "%%" , Space - , Str "the" + , Str "not" , Space - , Str "link" + , Str "secret" ] - ( "This is a link source", "wikilink" ) - ] + , Header + 2 + ( "inline code" , [] , [] ) + [ Str "inline" , Space , Str "code" ] , Para - [ Link - ( "", [], [] ) - [ Str "projects/Important Project 1" ] - ( "projects/Important Project 1", "wikilink" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "../index" ] - ( "../index", "wikilink" ) - , SoftBreak - , Link - ( "", [], [] ) - [ Str "Other", Space, Str "files" ] - ( "a subdirectory/", "wikilink" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "try" - , Space - , Str "me" + [ Str "Here" , Space - , Str "to" - , Space - , Str "test" + , Str "is" , Space - , Str "tag" + , Str "some" , Space - , Str "anchors" + , Code ( "" , [] , [] ) "inline code" + , Str "." ] - ( "#tag-one", "wikilink" ) - ] , Para - [ Link - ( "", [], [] ) - [ Str "try" + [ Str "Just" , Space - , Str "me" + , Str "two" , Space - , Str "to" + , Str "backticks:" , Space - , Str "test" + , Str "``" + ] + , Header + 2 + ( "preformatted text" , [] , [] ) + [ Str "preformatted" , Space , Str "text" ] + , CodeBlock + ( "" , [] , [] ) + " Tyger! Tyger! burning bright\n In the forests of the night,\n What immortal hand or eye\n Could frame thy fearful symmetry?\n In what distant deeps or skies\n Burnt the fire of thine eyes?\n On what wings dare he aspire?\n What the hand dare sieze the fire?" + , Header + 3 + ( "preformatted text with attributes" , [] , [] ) + [ Str "preformatted" , Space - , Str "header" + , Str "text" + , Space + , Str "with" , Space - , Str "anchors" + , Str "attributes" ] - ( "#block quotes", "wikilink" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "try" + , CodeBlock + ( "" + , [] + , [ ( "class" , "python" ) , ( "style" , "color:blue" ) ] + ) + " for i in range(1, 5):\n print(i)" + , Header + 3 + ( "preformatted text with nested syntax" , [] , [] ) + [ Str "preformatted" + , Space + , Str "text" , Space - , Str "me" + , Str "with" , Space - , Str "to" + , Str "nested" , Space - , Str "test" + , Str "syntax" + ] + , CodeBlock ( "" , [ "sql" ] , [] ) "SELECT * FROM table" + , Header + 3 + ( "empty preformatted text" , [] , [] ) + [ Str "empty" , Space - , Str "strong" + , Str "preformatted" , Space - , Str "anchors" + , Str "text" + ] + , CodeBlock ( "" , [] , [] ) "" + , Header + 2 + ( "block quotes" , [] , [] ) + [ Str "block" , Space , Str "quotes" ] + , BlockQuote + [ Plain + [ Str "(indentation" + , Space + , Str "4" + , Space + , Str "spaces)" + , Space + , Str "This" + , Space + , Str "would" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "blockquote" + , Space + , Str "in" + , Space + , Str "Vimwiki." + , Space + , Str "It" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Span ( "highlighted" , [] , [] ) [] + , Strong [ Str "highlighted" ] + , Space + , Str "in" + , Space + , Str "Vim" + , Space + , Str "but" + , SoftBreak + , Str "(indentation" + , Space + , Str "1" + , Space + , Str "space" + , Space + , Str "followed" + , Space + , Str "by" + , Space + , Str "1" + , Space + , Str "tab" + , Space + , Str "of" + , Space + , Str "width" + , Space + , Str "4)" + , Space + , Str "could" + , Space + , Str "be" + , Space + , Str "styled" + , Space + , Str "by" + , Space + , Str "CSS" + , Space + , Str "in" + , Space + , Str "HTML." + , Space + , Str "Blockquotes" + , Space + , Str "are" + , Space + , Str "usually" + , Space + , Str "used" + , Space + , Str "to" + , Space + , Str "quote" + , Space + , Str "a" + , SoftBreak + , Str "(indentation" + , Space + , Str "1" + , Space + , Str "tab" + , Space + , Str "of" + , Space + , Str "width" + , Space + , Str "4)" + , Space + , Str "long" + , Space + , Str "piece" + , Space + , Str "of" + , Space + , Str "text" + , Space + , Str "from" + , Space + , Str "another" + , Space + , Str "source." + , Space + , Strikeout [ Str "blah" , Space , Str "blah" ] + , Space + , Span ( "-blockquote" , [] , [] ) [ Str "" ] + , Span + ( "blockquote" , [ "tag" ] , [] ) [ Str "blockquote" ] + ] + ] + , Header + 2 + ( "external links" , [] , [] ) + [ Str "external" , Space , Str "links" ] + , Para + [ Link + ( "" , [] , [] ) + [ Emph [ Str "Google" ] + , Space + , Str "search" + , Space + , Str "engine" + ] + ( "http://google.com" , "" ) ] - ( "#strong", "wikilink" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "Tasks", Space, Str "for", Space, Str "tomorrow" ] - ( "Todo List#Tomorrow", "wikilink" ) - ] , Para - [ Link - ( "", [], [] ) - [ Str "diary:2017-05-01" ] - ( "diary/2017-05-01", "wikilink" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "http://pandoc.org" ] + ( "http://pandoc.org" , "" ) + ] , Para - [ Link - ( "", [], [] ) - [ Str "Important", Space, Str "Data" ] - ( "file:../assets/data.csv", "" ) - ] - , Header 3 - ( "links with thumbnails", [], [] ) - [ Str "links", Space, Str "with", Space, Str "thumbnails" ] + [ Link + ( "" , [] , [] ) + [ Str "ftp://vim.org" ] + ( "ftp://vim.org" , "" ) + ] , Para - [ Link - ( "", [], [] ) - [ Image ( "", [], [] ) [ Str "" ] ( "./movie.jpg", "" ) ] - ( "http://www.google.com", "" ) - ] - , Header 2 - ( "images", [], [] ) - [ Str "images" ] + [ Link + ( "" , [] , [] ) + [ Str "http://google.com" ] + ( "http://google.com" , "" ) + ] , Para - [ Image ( "", [], [] ) [ Str "" ] ( "file:./lalune.jpg", "" ) ] + [ Link + ( "" , [] , [] ) + [ Str "email" , Space , Str "me" ] + ( "mailto:info@example.org" , "" ) + ] , Para - [ Image - ( "", [], [] ) - [ Str "Vimwiki" ] - ( "http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png", "" ) - , SoftBreak - , Image - ( "", [], [] ) - [ Str "" ] - ( "file:./movie.jpg", "" ) - ] - , Header 3 - ( "image with attributes", [], [] ) - [ Str "image", Space, Str "with", Space, Str "attributes" ] + [ Link + ( "" , [] , [] ) + [ Str "mailto:hello@bye.com" ] + ( "mailto:hello@bye.com" , "" ) + ] + , Header + 2 + ( "internal links" , [] , [] ) + [ Str "internal" , Space , Str "links" ] , Para - [ Image - ( "", [], [ ( "style", "width:150px;height:120px;" ) ] ) - [ Emph [ Str "cool", Space, Str "stuff" ] ] - ( "lalune.jpg", "" ) - ] + [ Link + ( "" , [] , [] ) + [ Str "This is a link" ] + ( "This is a link" , "wikilink" ) + ] , Para - [ Image - ( "", [], [ ( "style", "font-color:red" ) ] ) - [ Span - ( "Non-existing", [], [] ) [] - , Strong - [ Str "Non-existing" ] - , Space - , Str "image" + [ Link + ( "" , [] , [] ) + [ Str "Description" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "link" + ] + ( "This is a link source" , "wikilink" ) ] - ( "nonexist.jpg", "" ) - ] , Para - [ Image - ( "", [], [ ( "style", "width:150px;height:120px;" ) ] ) - [ Emph [ Str "cool", Space, Str "stuff" ] ] - ( "lalune.jpg", "" ) - ] - , Header 2 - ( "lists", [], [] ) - [ Str "lists" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "ordered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1," - , Space - , Str "and" - , Space - , Str "here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "math" - , Space - , Str "belonging" - , Space - , Str "to" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" - ] - , Para - [ Math DisplayMath "a^2 + b^2 = c^2" ] - , Plain - [ Str "and" - , Space - , Str "some" - , Space - , Str "preformatted" - , Space - , Str "and" - , Space - , Str "tables" - , Space - , Str "belonging" - , Space - , Str "to" - , Space - , Str "item" - , Space - , Str "1" - , Space - , Str "as" - , Space - , Str "well" - ] - , CodeBlock - ( "", [], [] ) "I'm part of item 1." - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + [ Link + ( "" , [] , [] ) + [ Str "projects/Important Project 1" ] + ( "projects/Important Project 1" , "wikilink" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "../index" ] + ( "../index" , "wikilink" ) + , SoftBreak + , Link + ( "" , [] , [] ) + [ Str "Other" , Space , Str "files" ] + ( "a subdirectory/" , "wikilink" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "try" + , Space + , Str "me" + , Space + , Str "to" + , Space + , Str "test" + , Space + , Str "tag" + , Space + , Str "anchors" ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "this", Space, Str "table" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "is" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain - [ Str "also", Space, Str "a", Space, Str "part" ] - ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "of", Space, Str "item", Space, Str "1" ] ] - ] + ( "#tag-one" , "wikilink" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "try" + , Space + , Str "me" + , Space + , Str "to" + , Space + , Str "test" + , Space + , Str "header" + , Space + , Str "anchors" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Plain - [ Str "and" - , Space - , Str "some" - , Space - , Str "more" - , Space - , Str "text" - , Space - , Str "belonging" - , Space - , Str "to" - , Space - , Str "item" - , Space - , Str "1." - ] + ( "#block quotes" , "wikilink" ) + ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "try" + , Space + , Str "me" + , Space + , Str "to" + , Space + , Str "test" + , Space + , Str "strong" + , Space + , Str "anchors" + ] + ( "#strong" , "wikilink" ) ] - , - [ Plain - [ Str "ordered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" - ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "Tasks" , Space , Str "for" , Space , Str "tomorrow" ] + ( "Todo List#Tomorrow" , "wikilink" ) ] - ] - , BulletList - [ - [ Plain - [ Str "Bulleted" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" - ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "diary:2017-05-01" ] + ( "diary/2017-05-01" , "wikilink" ) ] - , - [ Plain - [ Str "Bulleted" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" - ] + , Para + [ Link + ( "" , [] , [] ) + [ Str "Important" , Space , Str "Data" ] + ( "file:../assets/data.csv" , "" ) ] - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "Bulleted" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" - ] + , Header + 3 + ( "links with thumbnails" , [] , [] ) + [ Str "links" + , Space + , Str "with" + , Space + , Str "thumbnails" ] - , - [ Plain - [ Str "the" - , Space - , Str "#" - , Space - , Str "become" - , Space - , Str "numbers" - , Space - , Str "when" - , Space - , Str "converted" - , Space - , Str "to" - , Space - , Str "HTML" - ] + , Para + [ Link + ( "" , [] , [] ) + [ Image ( "" , [] , [] ) [ Str "" ] ( "./movie.jpg" , "" ) ] + ( "http://www.google.com" , "" ) ] - ] - , BulletList - [ - [ Plain - [ Str "Bulleted" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" - ] + , Header 2 ( "images" , [] , [] ) [ Str "images" ] + , Para + [ Image + ( "" , [] , [] ) [ Str "" ] ( "file:./lalune.jpg" , "" ) ] - , - [ Plain - [ Str "Bulleted" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" - ] + , Para + [ Image + ( "" , [] , [] ) + [ Str "Vimwiki" ] + ( "http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png" + , "" + ) + , SoftBreak + , Image + ( "" , [] , [] ) [ Str "" ] ( "file:./movie.jpg" , "" ) ] - ] - , BulletList - [ - [ Plain [ Str "Item", Space, Str "1" ] ] - , - [ Plain - [ Str "Item", Space, Str "2" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "Sub" + , Header + 3 + ( "image with attributes" , [] , [] ) + [ Str "image" + , Space + , Str "with" + , Space + , Str "attributes" + ] + , Para + [ Image + ( "" , [] , [ ( "style" , "width:150px;height:120px;" ) ] ) + [ Emph [ Str "cool" , Space , Str "stuff" ] ] + ( "lalune.jpg" , "" ) + ] + , Para + [ Image + ( "" , [] , [ ( "style" , "font-color:red" ) ] ) + [ Span ( "Non-existing" , [] , [] ) [] + , Strong [ Str "Non-existing" ] + , Space + , Str "image" + ] + ( "nonexist.jpg" , "" ) + ] + , Para + [ Image + ( "" , [] , [ ( "style" , "width:150px;height:120px;" ) ] ) + [ Emph [ Str "cool" , Space , Str "stuff" ] ] + ( "lalune.jpg" , "" ) + ] + , Header 2 ( "lists" , [] , [] ) [ Str "lists" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "ordered" , Space - , Str "item" + , Str "list" , Space - , Str "1" + , Str "item" , Space - , Str "(indentation" + , Str "1," , Space - , Str "4" + , Str "and" , Space - , Str "spaces)" - , SoftBreak - , Str "Sub" + , Str "here" , Space - , Str "item" + , Str "is" , Space - , Str "1" + , Str "some" + , Space + , Str "math" + , Space + , Str "belonging" , Space - , Str "continued" + , Str "to" , Space - , Str "line." - , SoftBreak - , Str "Sub" + , Str "list" , Space , Str "item" , Space , Str "1" + ] + , Para [ Math DisplayMath "a^2 + b^2 = c^2" ] + , Plain + [ Str "and" , Space - , Str "next" + , Str "some" , Space - , Str "continued" + , Str "preformatted" , Space - , Str "line." - ] - ] - , - [ Plain - [ Str "Sub" + , Str "and" + , Space + , Str "tables" + , Space + , Str "belonging" + , Space + , Str "to" , Space , Str "item" , Space - , Str "2," + , Str "1" , Space , Str "as" , Space - , Str "an" - , Space - , Str "ordered" + , Str "well" + ] + , CodeBlock ( "" , [] , [] ) "I'm part of item 1." + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "this" , Space , Str "table" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "is" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "also" + , Space + , Str "a" + , Space + , Str "part" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain + [ Str "of" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) + , Plain + [ Str "and" , Space - , Str "list" + , Str "some" , Space - , Str "item" + , Str "more" , Space - , Str "even" + , Str "text" , Space - , Str "though" + , Str "belonging" , Space - , Str "the" + , Str "to" , Space - , Str "identifier" + , Str "item" , Space - , Str "is" + , Str "1." + ] + ] + , [ Plain + [ Str "ordered" , Space - , Code - ( "", [], [] ) "*" + , Str "list" , Space - , Str "(indentation" + , Str "item" , Space , Str "2" + ] + ] + ] + , BulletList + [ [ Plain + [ Str "Bulleted" + , Space + , Str "list" , Space - , Str "spaces" + , Str "item" , Space - , Str "followed" + , Str "1" + ] + ] + , [ Plain + [ Str "Bulleted" , Space - , Str "by" + , Str "list" , Space - , Str "one" + , Str "item" , Space - , Str "tab" + , Str "2" + ] + ] + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Bulleted" , Space - , Str "of" + , Str "list" , Space - , Str "width" + , Str "item" , Space - , Str "4)" + , Str "1" ] - ] - , - [ Plain - [ Str "etc." - , SoftBreak - , Str "Continuation" + ] + , [ Plain + [ Str "the" , Space - , Str "of" + , Str "#" , Space - , Str "Item" + , Str "become" , Space - , Str "2" - , SoftBreak - , Str "Next" + , Str "numbers" , Space - , Str "continuation" + , Str "when" , Space - , Str "of" + , Str "converted" , Space - , Str "Item" + , Str "to" , Space - , Str "2" + , Str "HTML" ] - ] ] ] - ] - , Para - [ Str "But" - , Space - , Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "new" - , Space - , Str "paragraph." - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "1" ] - , BulletList - [ [ Plain [ Code ( "", [], [] ) "1.1" ] ] ] - ] - , - [ Plain [ Str "2" ], BulletList [ [ Plain [ Str "2.1" ] ] ] ] - ] , BulletList - [ [ Plain [ Str "3" ] ] ] - , Header 3 - ( "ordered lists with non-# identifiers", [], [] ) - [ Str "ordered" - , Space - , Str "lists" - , Space - , Str "with" - , Space - , Str "non-#" - , Space - , Str "identifiers" - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" - ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" - ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "3" + [ [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] ] - ] - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" + , [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] ] ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" + , BulletList + [ [ Plain [ Str "Item" , Space , Str "1" ] ] + , [ Plain [ Str "Item" , Space , Str "2" ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Sub" + , Space + , Str "item" + , Space + , Str "1" + , Space + , Str "(indentation" + , Space + , Str "4" + , Space + , Str "spaces)" + , SoftBreak + , Str "Sub" + , Space + , Str "item" + , Space + , Str "1" + , Space + , Str "continued" + , Space + , Str "line." + , SoftBreak + , Str "Sub" + , Space + , Str "item" + , Space + , Str "1" + , Space + , Str "next" + , Space + , Str "continued" + , Space + , Str "line." + ] + ] + , [ Plain + [ Str "Sub" + , Space + , Str "item" + , Space + , Str "2," + , Space + , Str "as" + , Space + , Str "an" + , Space + , Str "ordered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "even" + , Space + , Str "though" + , Space + , Str "the" + , Space + , Str "identifier" + , Space + , Str "is" + , Space + , Code ( "" , [] , [] ) "*" + , Space + , Str "(indentation" + , Space + , Str "2" + , Space + , Str "spaces" + , Space + , Str "followed" + , Space + , Str "by" + , Space + , Str "one" + , Space + , Str "tab" + , Space + , Str "of" + , Space + , Str "width" + , Space + , Str "4)" + ] + ] + , [ Plain + [ Str "etc." + , SoftBreak + , Str "Continuation" + , Space + , Str "of" + , Space + , Str "Item" + , Space + , Str "2" + , SoftBreak + , Str "Next" + , Space + , Str "continuation" + , Space + , Str "of" + , Space + , Str "Item" + , Space + , Str "2" + ] + ] + ] ] ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "3" - ] + , Para + [ Str "But" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "new" + , Space + , Str "paragraph." ] - ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "1" ] + , BulletList [ [ Plain [ Code ( "" , [] , [] ) "1.1" ] ] ] ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" + , [ Plain [ Str "2" ] + , BulletList [ [ Plain [ Str "2.1" ] ] ] ] ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "3" - ] + , BulletList [ [ Plain [ Str "3" ] ] ] + , Header + 3 + ( "ordered lists with non-# identifiers" , [] , [] ) + [ Str "ordered" + , Space + , Str "lists" + , Space + , Str "with" + , Space + , Str "non-#" + , Space + , Str "identifiers" ] - ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "3" + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] ] ] - ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "3" + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] ] ] - ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "3" + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] ] ] - ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" - ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "3" + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] ] - ] - ] - , BulletList - [ - [ Plain - [ Str "Bulleted" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "1" + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] ] ] - , - [ Plain - [ Str "Bulleted" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "2" - ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Numbered" , Space , Str "list" , Space - , Str "sub" - , Space , Str "item" , Space , Str "1" ] - ] - , - [ Plain - [ Str "more", Space, Str "..." ] - , BulletList - [ - [ Plain - [ Str "and", Space, Str "more", Space, Str "..." ] - ] - , - [ Plain [ Str "..." ] ] - ] - ] - , - [ Plain + ] + , [ Plain [ Str "Numbered" , Space , Str "list" , Space - , Str "sub" + , Str "item" + , Space + , Str "2" + ] + ] + , [ Plain + [ Str "Numbered" + , Space + , Str "list" , Space , Str "item" , Space , Str "3" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "sub" - , Space - , Str "sub" - , Space - , Str "item" - , Space - , Str "1" - ] - ] - , - [ Plain - [ Str "Numbered" - , Space - , Str "list" - , Space - , Str "sub" - , Space - , Str "sub" - , Space - , Str "item" - , Space - , Str "2" - ] - ] + ] + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" ] - ] - , - [ Plain [ Str "etc." ] ] ] ] - , - [ Plain - [ Str "Bulleted" - , Space - , Str "list" - , Space - , Str "item" - , Space - , Str "3" + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] ] ] - ] - , Header 2 - ( "todo lists", [], [] ) - [ Str "todo", Space, Str "lists" ] , BulletList - [ - [ Plain - [ Span ( "", [ "done0" ], [] ) [], Str "task", Space, Str "1" ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Plain [ Span ( "", [ "done1" ], [] ) [], Str "5" ] ] ] - ] - , - [ Plain [ Span ( "", [ "done2" ], [] ) [], Str "3" ] ] - , - [ Plain - [ Str "[]" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "todo" - , Space - , Str "item" + [ [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "1" + ] ] - ] - , - [ Plain - [ Str "[" - , Space - , Str "]not" - , Space - , Str "a" - , Space - , Str "todo" - , Space - , Str "item" + , [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "2" + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "sub" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , [ Plain [ Str "more" , Space , Str "..." ] + , BulletList + [ [ Plain + [ Str "and" + , Space + , Str "more" + , Space + , Str "..." + ] + ] + , [ Plain [ Str "..." ] ] + ] + ] + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "sub" + , Space + , Str "item" + , Space + , Str "3" + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "sub" + , Space + , Str "sub" + , Space + , Str "item" + , Space + , Str "1" + ] + ] + , [ Plain + [ Str "Numbered" + , Space + , Str "list" + , Space + , Str "sub" + , Space + , Str "sub" + , Space + , Str "item" + , Space + , Str "2" + ] + ] + ] + ] + , [ Plain [ Str "etc." ] ] + ] ] - ] - , - [ Plain - [ Str "[r]" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "todo" - , Space - , Str "item" + , [ Plain + [ Str "Bulleted" + , Space + , Str "list" + , Space + , Str "item" + , Space + , Str "3" + ] ] ] - , - [ Plain - [ Str "[" - , Space - , Str "]" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "todo" - , Space - , Str "item" + , Header + 2 + ( "todo lists" , [] , [] ) + [ Str "todo" , Space , Str "lists" ] + , BulletList + [ [ Plain + [ Span ( "" , [ "done0" ] , [] ) [] + , Str "task" + , Space + , Str "1" + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Span ( "" , [ "done1" ] , [] ) [] , Str "5" ] ] + ] ] - ] - , - [ Plain - [ Span - ( "", [ "done2" ], [] ) [] - , Str "a" - , Space - , Str "tab" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "todo" - , Space - , Str "list" - , Space - , Str "marker" - , Space - , Code - ( "", [], [] ) "[ ]" + , [ Plain [ Span ( "" , [ "done2" ] , [] ) [] , Str "3" ] ] + , [ Plain + [ Str "[]" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "todo" + , Space + , Str "item" + ] ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain - [ Span - ( "", [ "done3" ], [] ) [] - , Str "4" - , SoftBreak - , Str "5" + , [ Plain + [ Str "[" + , Space + , Str "]not" + , Space + , Str "a" + , Space + , Str "todo" + , Space + , Str "item" ] - ] - , - [ Plain - [ Span ( "", [ "done4" ], [] ) [] ] - , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) + ] + , [ Plain + [ Str "[r]" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "todo" + , Space + , Str "item" ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ] + , [ Plain + [ Str "[" + , Space + , Str "]" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "todo" + , Space + , Str "item" + ] + ] + , [ Plain + [ Span ( "" , [ "done2" ] , [] ) [] + , Str "a" + , Space + , Str "tab" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "todo" + , Space + , Str "list" + , Space + , Str "marker" + , Space + , Code ( "" , [] , [] ) "[ ]" + ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain + [ Span ( "" , [ "done3" ] , [] ) [] + , Str "4" + , SoftBreak + , Str "5" + ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "a" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b" ] ] - ] + , [ Plain [ Span ( "" , [ "done4" ] , [] ) [] ] + , Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "a" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) ] ] - ( TableFoot ( "", [], [] ) [] ) - ] + ] + , [ Plain + [ Span ( "" , [ "done4" ] , [] ) [] + , Str "task" + , Space + , Str "2" + ] ] ] - , - [ Plain - [ Span ( "", [ "done4" ], [] ) [], Str "task", Space, Str "2" ] - ] - ] - , Header 2 - ( "math", [], [] ) - [ Str "math" ] - , Para - [ Math InlineMath " \\sum_i a_i^2 = 1 " ] - , Para - [ Math DisplayMath "\\sum_i a_i^2\n=\n1" ] + , Header 2 ( "math" , [] , [] ) [ Str "math" ] + , Para [ Math InlineMath " \\sum_i a_i^2 = 1 " ] + , Para [ Math DisplayMath "\\sum_i a_i^2\n=\n1" ] , Para - [ Math DisplayMath "\\begin{aligned}\n\\sum_i a_i^2 &= 1 + 1 \\\\\n&= 2.\n\\end{aligned}" ] + [ Math + DisplayMath + "\\begin{aligned}\n\\sum_i a_i^2 &= 1 + 1 \\\\\n&= 2.\n\\end{aligned}" + ] , Para - [ Str "edge" - , Space - , Str "case" - , Space - , Str "(the" - , Space - , Code - ( "", [], [] ) "c^2 + " - , Space - , Str "after" - , Space - , Str "the" - , Space - , Str "multline" - , Space - , Str "tag" - , Space - , Str "is" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "equation):" - ] + [ Str "edge" + , Space + , Str "case" + , Space + , Str "(the" + , Space + , Code ( "" , [] , [] ) "c^2 + " + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "multline" + , Space + , Str "tag" + , Space + , Str "is" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "equation):" + ] , Para - [ Math DisplayMath "\\begin{gathered}\nc^2 + \na^2 + b^2\n\\end{gathered}" ] + [ Math + DisplayMath + "\\begin{gathered}\nc^2 + \na^2 + b^2\n\\end{gathered}" + ] , Para - [ Str "edge" - , Space - , Str "case" - , Space - , Str "(the" - , Space - , Str "tag" - , Space - , Str "is" - , Space - , Code - ( "", [], [] ) "hello%bye" - , Str ")" - ] + [ Str "edge" + , Space + , Str "case" + , Space + , Str "(the" + , Space + , Str "tag" + , Space + , Str "is" + , Space + , Code ( "" , [] , [] ) "hello%bye" + , Str ")" + ] , Para - [ Math DisplayMath "\\begin{hello%bye}\n\\int_a^b f(x) dx\n\\end{hello%bye}" ] + [ Math + DisplayMath + "\\begin{hello%bye}\n\\int_a^b f(x) dx\n\\end{hello%bye}" + ] , Para - [ Str "Just" - , Space - , Str "two" - , Space - , Str "dollar" - , Space - , Str "signs:" - , Space - , Str "$$" - ] + [ Str "Just" + , Space + , Str "two" + , Space + , Str "dollar" + , Space + , Str "signs:" + , Space + , Str "$$" + ] , Para - [ Str "[not" - , Space - , Str "math]" - , Space - , Str "You" - , Space - , Str "have" - , Space - , Str "$1" - , SoftBreak - , Str "and" - , Space - , Str "I" - , Space - , Str "have" - , Space - , Str "$1." - ] - , Header 2 - ( "tags", [], [] ) - [ Str "tags" ] + [ Str "[not" + , Space + , Str "math]" + , Space + , Str "You" + , Space + , Str "have" + , Space + , Str "$1" + , SoftBreak + , Str "and" + , Space + , Str "I" + , Space + , Str "have" + , Space + , Str "$1." + ] + , Header 2 ( "tags" , [] , [] ) [ Str "tags" ] , Para - [ Span - ( "-tag-one", [], [] ) - [ Str "" ] - , Span - ( "tag-one", [ "tag" ], [] ) - [ Str "tag-one" ] - , Space - , Span - ( "-tag-two", [], [] ) - [ Str "" ] - , Span - ( "tag-two", [ "tag" ], [] ) - [ Str "tag-two" ] - ] - , Header 2 - ( "tables", [], [] ) - [ Str "tables" ] + [ Span ( "-tag-one" , [] , [] ) [ Str "" ] + , Span ( "tag-one" , [ "tag" ] , [] ) [ Str "tag-one" ] + , Space + , Span ( "-tag-two" , [] , [] ) [ Str "" ] + , Span ( "tag-two" , [ "tag" ] , [] ) [ Str "tag-two" ] + ] + , Header 2 ( "tables" , [] , [] ) [ Str "tables" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Year" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Temperature", Space, Str "(low)" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "Temperature", Space, Str "(high)" ] ] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Year" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Temperature" , Space , Str "(low)" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "Temperature" , Space , Str "(high)" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1900" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "-10" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "25" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1910" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "-15" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "30" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1920" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "-10" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "32" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1930" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Emph [ Str "N/A" ] ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Emph [ Str "N/A" ] ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "1940" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "-2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "40" ] ] + ] + ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1900" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "-10" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "25" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1910" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "-15" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "30" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1920" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "-10" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "32" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1930" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Emph [ Str "N/A" ] ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Emph [ Str "N/A" ] ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "1940" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "-2" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "40" ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , Header + 3 + ( "centered headerless tables" , [] , [] ) + [ Str "centered" + , Space + , Str "headerless" + , Space + , Str "tables" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 3 - ( "centered headerless tables", [], [] ) - [ Str "centered", Space, Str "headerless", Space, Str "tables" ] , Div - ( "", [ "center" ], [] ) - [ Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] - ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "a" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b" ] ] + ( "" , [ "center" ] , [] ) + [ Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "d" ] ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "a" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "c" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "d" ] ] + ] + ] ] - ] + (TableFoot ( "" , [] , [] ) []) ] - ( TableFoot ( "", [], [] ) [] ) - ] - , Header 2 - ( "paragraphs", [], [] ) - [ Str "paragraphs" ] + , Header 2 ( "paragraphs" , [] , [] ) [ Str "paragraphs" ] , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "first" - , Space - , Str "paragraph" - , SoftBreak - , Str "with" - , Space - , Str "two" - , Space - , Str "lines." - ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "first" + , Space + , Str "paragraph" + , SoftBreak + , Str "with" + , Space + , Str "two" + , Space + , Str "lines." + ] , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "second" - , Space - , Str "paragraph" - , Space - , Str "with" - , SoftBreak - , Str "two" - , Space - , Str "lines" - , Space - , Str "after" - , Space - , Str "many" - , Space - , Str "blank" - , Space - , Str "lines." - ] - , Header 2 - ( "definition list", [], [] ) - [ Str "definition", Space, Str "list" ] + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "second" + , Space + , Str "paragraph" + , Space + , Str "with" + , SoftBreak + , Str "two" + , Space + , Str "lines" + , Space + , Str "after" + , Space + , Str "many" + , Space + , Str "blank" + , Space + , Str "lines." + ] + , Header + 2 + ( "definition list" , [] , [] ) + [ Str "definition" , Space , Str "list" ] , DefinitionList - [ - ( - [ Str "Term", Space, Str "1" ] - , - [ [ Plain [ Str "Definition", Space, Str "1" ] ] ] - ) - , - ( - [ Str "Term", Space, Str "2" ] - , - [ - [ Plain [ Str "Definition", Space, Str "2" ] ] - , - [ Plain [ Str "Definition", Space, Str "3" ] ] - ] - ) - , - ( - [ Str "Term" - , Space - , Str "::" - , Space - , Span - ( "separated", [], [] ) [] - , Strong - [ Str "separated" ] - , Space - , Str "by" - , Space - , Str "::" - , Space - , Emph - [ Str "double", Space, Str "colons" ] - ] - , - [ [ Plain [ Str "Def1" ] ], [ Plain [ Str "Def2" ] ] ] - ) - , - ( - [ Str "Term" - , Space - , Str "with" - , Space - , Str "lots" - , Space - , Str "of" - , Space - , Str "trailing" - , Space - , Str "colons:::::::" - ] - , - [ [ Plain [ Str "Definition" ] ] ] - ) - , - ( - [ Str "::" - , Space - , Str "This" - , Space - , Str "is" - , Space - , Str "::" - , Space - , Str "A" - , Space - , Str "term" - , Space - , Str "(rather" - , Space - , Str "than" - , Space - , Str "a" - , Space - , Str "definition)" - ] - , - [ - [ Plain - [ Str "and" - , Space - , Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "definition" + [ ( [ Str "Term" , Space , Str "1" ] + , [ [ Plain [ Str "Definition" , Space , Str "1" ] ] ] + ) + , ( [ Str "Term" , Space , Str "2" ] + , [ [ Plain [ Str "Definition" , Space , Str "2" ] ] + , [ Plain [ Str "Definition" , Space , Str "3" ] ] + ] + ) + , ( [ Str "Term" + , Space + , Str "::" + , Space + , Span ( "separated" , [] , [] ) [] + , Strong [ Str "separated" ] + , Space + , Str "by" + , Space + , Str "::" + , Space + , Emph [ Str "double" , Space , Str "colons" ] + ] + , [ [ Plain [ Str "Def1" ] ] , [ Plain [ Str "Def2" ] ] ] + ) + , ( [ Str "Term" + , Space + , Str "with" + , Space + , Str "lots" + , Space + , Str "of" + , Space + , Str "trailing" + , Space + , Str "colons:::::::" + ] + , [ [ Plain [ Str "Definition" ] ] ] + ) + , ( [ Str "::" + , Space + , Str "This" + , Space + , Str "is" + , Space + , Str "::" + , Space + , Str "A" + , Space + , Str "term" + , Space + , Str "(rather" + , Space + , Str "than" + , Space + , Str "a" + , Space + , Str "definition)" + ] + , [ [ Plain + [ Str "and" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "definition" + ] ] ] - ] - ) - , - ( - [ Str "Term", Space, Str "Without", Space, Str "definitions" ] - , [ [] ] - ) - , - ( - [ Str "Part" - , Space - , Str "::" - , Space - , Str "of" - , Space - , Str "::" - , Space - , Str "dt" - ] - , - [ [ Plain [ Str "part", Space, Str "of", Space, Str "::dd" ] ] ] - ) - ] - , DefinitionList - [ - ( [] - , - [ - [ Plain - [ Str "Definition" - , Space - , Str "1" - , Space - , Str "without" - , Space - , Str "a" - , Space - , Str "term" + ) + , ( [ Str "Term" + , Space + , Str "Without" + , Space + , Str "definitions" + ] + , [ [] ] + ) + , ( [ Str "Part" + , Space + , Str "::" + , Space + , Str "of" + , Space + , Str "::" + , Space + , Str "dt" + ] + , [ [ Plain + [ Str "part" , Space , Str "of" , Space , Str "::dd" ] ] ] - , - [ Plain - [ Str "Definition" - , Space - , Str "2" - , Space - , Str "without" - , Space - , Str "a" - , Space - , Str "term" + ) + ] + , DefinitionList + [ ( [] + , [ [ Plain + [ Str "Definition" + , Space + , Str "1" + , Space + , Str "without" + , Space + , Str "a" + , Space + , Str "term" + ] + ] + , [ Plain + [ Str "Definition" + , Space + , Str "2" + , Space + , Str "without" + , Space + , Str "a" + , Space + , Str "term" + ] ] ] - ] - ) - ] + ) + ] , DefinitionList - [ ( [ Str "T1" ], [ [ Plain [ Str "D1" ] ] ] ) ] - , Para - [ Str "new", Space, Str "paragraph" ] + [ ( [ Str "T1" ] , [ [ Plain [ Str "D1" ] ] ] ) ] + , Para [ Str "new" , Space , Str "paragraph" ] , DefinitionList - [ ( [ Str "T1" ], [ [ Plain [ Str "D1" ] ] ] ) ] - , Para - [ Str "Not::Definition" ] - , Para - [ Str "Not", Space, Str "::Definition" ] - , Para - [ Str "::Not", Space, Str "definition" ] + [ ( [ Str "T1" ] , [ [ Plain [ Str "D1" ] ] ] ) ] + , Para [ Str "Not::Definition" ] + , Para [ Str "Not" , Space , Str "::Definition" ] + , Para [ Str "::Not" , Space , Str "definition" ] , BlockQuote - [ Plain [ Str "::", Space, Str "blockquote" ] ] + [ Plain [ Str "::" , Space , Str "blockquote" ] ] , BlockQuote - [ Plain [ Str "block", Space, Str "::", Space, Str "quote" ] ] - , Header 2 - ( "metadata placeholders", [], [] ) - [ Str "metadata", Space, Str "placeholders" ] - , Para - [ Str "%this" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "a" - , Space - , Str "placeholder" - ] - , Para - [ Str "placeholders" - , SoftBreak - , Str "serves" - , Space - , Str "as" - , Space - , Str "space" - , Space - , Str "/" - , Space - , Str "softbreak" - , Space - , Str "in" - , Space - , Str "paragraphs" - ] - , Header 2 - ( "sup, sub", [], [] ) - [ Str "sup,", Space, Str "sub" ] - , Para - [ Str "super", Superscript [ Str "script" ] ] + [ Plain + [ Str "block" , Space , Str "::" , Space , Str "quote" ] + ] + , Header + 2 + ( "metadata placeholders" , [] , [] ) + [ Str "metadata" , Space , Str "placeholders" ] , Para - [ Str "sub", Subscript [ Str "script" ] ] - , Header 2 - ( "the todo mark", [], [] ) - [ Str "the", Space, Str "todo", Space, Str "mark" ] + [ Str "%this" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "a" + , Space + , Str "placeholder" + ] , Para - [ Span ( "", [ "todo" ], [] ) [ Str "TODO:" ] ] - , Header 1 - ( "not implemented yet", [], [] ) - [ Emph - [ Span - ( "not implemented yet", [], [] ) [] - , Strong - [ Str "not", Space, Str "implemented", Space, Str "yet" ] + [ Str "placeholders" + , SoftBreak + , Str "serves" + , Space + , Str "as" + , Space + , Str "space" + , Space + , Str "/" + , Space + , Str "softbreak" + , Space + , Str "in" + , Space + , Str "paragraphs" + ] + , Header + 2 + ( "sup, sub" , [] , [] ) + [ Str "sup," , Space , Str "sub" ] + , Para [ Str "super" , Superscript [ Str "script" ] ] + , Para [ Str "sub" , Subscript [ Str "script" ] ] + , Header + 2 + ( "the todo mark" , [] , [] ) + [ Str "the" , Space , Str "todo" , Space , Str "mark" ] + , Para [ Span ( "" , [ "todo" ] , [] ) [ Str "TODO:" ] ] + , Header + 1 + ( "not implemented yet" , [] , [] ) + [ Emph + [ Span ( "not implemented yet" , [] , [] ) [] + , Strong + [ Str "not" + , Space + , Str "implemented" + , Space + , Str "yet" + ] + ] ] - ] - , Header 2 - ( "tables with spans", [], [] ) - [ Str "tables", Space, Str "with", Space, Str "spans" ] + , Header + 2 + ( "tables with spans" , [] , [] ) + [ Str "tables" , Space , Str "with" , Space , Str "spans" ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "a" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "c" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "d" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\\/" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "e" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str ">" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "f" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\\/" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "\\/" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str ">" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "g" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "h" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str ">" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str ">" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str ">" ] ] + ] + ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "a" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "d" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\\/" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "e" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str ">" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "f" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\\/" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "\\/" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str ">" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "g" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "h" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str ">" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str ">" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str ">" ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , Header + 2 + ( "tables with multiple lines of headers" , [] , [] ) + [ Str "tables" + , Space + , Str "with" + , Space + , Str "multiple" + , Space + , Str "lines" + , Space + , Str "of" + , Space + , Str "headers" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 2 - ( "tables with multiple lines of headers", [], [] ) - [ Str "tables" - , Space - , Str "with" - , Space - , Str "multiple" - , Space - , Str "lines" - , Space - , Str "of" - , Space - , Str "headers" - ] , Table - ( "", [], [] ) - ( Caption Nothing [] ) - [ - ( AlignDefault, ColWidthDefault ) - , - ( AlignDefault, ColWidthDefault ) - ] - ( TableHead - ( "", [], [] ) - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) [] - ] + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "a" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "b" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "c" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "d" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "---" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "---" ] ] + ] + ] ] - ) - [ TableBody - ( "", [], [] ) - ( RowHeadColumns 0 ) [] - [ Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "a" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "b" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "c" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "d" ] ] - ] - , Row - ( "", [], [] ) - [ Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "---" ] ] - , Cell - ( "", [], [] ) AlignDefault - ( RowSpan 1 ) - ( ColSpan 1 ) - [ Plain [ Str "---" ] ] - ] + (TableFoot ( "" , [] , [] ) []) + , Header + 2 + ( "some other placeholders" , [] , [] ) + [ Str "some" + , Space + , Str "other" + , Space + , Str "placeholders" ] - ] - ( TableFoot ( "", [], [] ) [] ) - , Header 2 - ( "some other placeholders", [], [] ) - [ Str "some", Space, Str "other", Space, Str "placeholders" ] , Para - [ Code - ( "", [], [] ) "template" - , Space - , Str "placeholder" - , Space - , Str "is" - , Space - , Str "ignored." - ] + [ Code ( "" , [] , [] ) "template" + , Space + , Str "placeholder" + , Space + , Str "is" + , Space + , Str "ignored." + ] , Para - [ Code - ( "", [], [] ) "nohtml" - , Space - , Str "placeholder" - , Space - , Str "is" - , Space - , Str "ignored." - ] + [ Code ( "" , [] , [] ) "nohtml" + , Space + , Str "placeholder" + , Space + , Str "is" + , Space + , Str "ignored." + ] ] diff --git a/test/writer.native b/test/writer.native index e86464f3e..15971bfff 100644 --- a/test/writer.native +++ b/test/writer.native @@ -1,599 +1,493 @@ Pandoc - ( Meta - { unMeta = fromList - [ - ( "author" - , MetaList - [ MetaInlines - [ Str "John", Space, Str "MacFarlane" ] - , MetaInlines - [ Str "Anonymous" ] + Meta + { unMeta = + fromList + [ ( "author" + , MetaList + [ MetaInlines [ Str "John" , Space , Str "MacFarlane" ] + , MetaInlines [ Str "Anonymous" ] + ] + ) + , ( "date" + , MetaInlines + [ Str "July" , Space , Str "17," , Space , Str "2006" ] + ) + , ( "title" + , MetaInlines + [ Str "Pandoc" , Space , Str "Test" , Space , Str "Suite" ] + ) ] - ) - , - ( "date" - , MetaInlines - [ Str "July", Space, Str "17,", Space, Str "2006" ] - ) - , - ( "title" - , MetaInlines - [ Str "Pandoc", Space, Str "Test", Space, Str "Suite" ] - ) - ] } - ) [ 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 "Most" - , Space - , Str "of" - , Space - , Str "them" - , Space - , Str "are" - , Space - , Str "adapted" - , Space - , Str "from" - , SoftBreak - , 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-embedded-link", [], [] ) - [ Str "Level" - , Space - , Str "2" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "embedded", Space, Str "link" ] - ( "/url", "" ) - ] - , Header 3 - ( "level-3-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "3" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 4 - ( "level-4", [], [] ) - [ Str "Level", Space, Str "4" ] - , Header 5 - ( "level-5", [], [] ) - [ Str "Level", Space, Str "5" ] - , Header 1 - ( "level-1", [], [] ) - [ Str "Level", Space, Str "1" ] - , Header 2 - ( "level-2-with-emphasis", [], [] ) - [ Str "Level" - , Space - , Str "2" - , Space - , Str "with" - , Space - , Emph - [ Str "emphasis" ] - ] - , Header 3 - ( "level-3", [], [] ) - [ Str "Level", Space, Str "3" ] - , Para - [ Str "with", Space, Str "no", Space, Str "blank", Space, Str "line" ] - , Header 2 - ( "level-2", [], [] ) - [ Str "Level", Space, Str "2" ] - , Para - [ Str "with", Space, Str "no", Space, Str "blank", Space, Str "line" ] + [ 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 "Most" + , Space + , Str "of" + , Space + , Str "them" + , Space + , Str "are" + , Space + , Str "adapted" + , Space + , Str "from" + , SoftBreak + , Str "John" + , Space + , Str "Gruber\8217s" + , Space + , Str "markdown" + , Space + , Str "test" + , Space + , Str "suite." + ] , HorizontalRule - , Header 1 - ( "paragraphs", [], [] ) - [ Str "Paragraphs" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "regular" - , Space - , Str "paragraph." - ] - , Para - [ Str "In" - , Space - , Str "Markdown" - , Space - , Str "1.0.0" - , Space - , Str "and" - , Space - , Str "earlier." - , Space - , Str "Version" - , SoftBreak - , Str "8." - , Space - , Str "This" - , Space - , Str "line" - , Space - , Str "turns" - , Space - , Str "into" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item." - , SoftBreak - , Str "Because" - , Space - , Str "a" - , Space - , Str "hard-wrapped" - , Space - , Str "line" - , Space - , Str "in" - , Space - , Str "the" - , SoftBreak - , Str "middle" - , Space - , Str "of" - , Space - , Str "a" - , Space - , Str "paragraph" - , Space - , Str "looked" - , Space - , Str "like" - , Space - , Str "a" - , SoftBreak - , Str "list" - , Space - , Str "item." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "with" - , Space - , Str "a" - , Space - , Str "bullet." - , SoftBreak - , Str "*" - , Space - , Str "criminey." - ] - , Para - [ Str "There" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "hard" - , Space - , Str "line" - , Space - , Str "break" - , LineBreak - , Str "here." - ] + , Header 1 ( "headers" , [] , [] ) [ Str "Headers" ] + , 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" ] + ( "/url" , "" ) + ] + , Header + 3 + ( "level-3-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "3" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 4 ( "level-4" , [] , [] ) [ Str "Level" , Space , Str "4" ] + , Header + 5 ( "level-5" , [] , [] ) [ Str "Level" , Space , Str "5" ] + , Header + 1 ( "level-1" , [] , [] ) [ Str "Level" , Space , Str "1" ] + , Header + 2 + ( "level-2-with-emphasis" , [] , [] ) + [ Str "Level" + , Space + , Str "2" + , Space + , Str "with" + , Space + , Emph [ Str "emphasis" ] + ] + , Header + 3 ( "level-3" , [] , [] ) [ Str "Level" , Space , Str "3" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] + , Header + 2 ( "level-2" , [] , [] ) [ Str "Level" , Space , Str "2" ] + , Para + [ Str "with" + , Space + , Str "no" + , Space + , Str "blank" + , Space + , Str "line" + ] , HorizontalRule - , Header 1 - ( "block-quotes", [], [] ) - [ Str "Block", Space, Str "Quotes" ] + , Header 1 ( "paragraphs" , [] , [] ) [ Str "Paragraphs" ] , Para - [ Str "E-mail", Space, Str "style:" ] - , BlockQuote - [ Para - [ Str "This" + [ Str "Here\8217s" , Space - , Str "is" + , Str "a" + , Space + , Str "regular" + , Space + , Str "paragraph." + ] + , Para + [ Str "In" + , Space + , Str "Markdown" + , Space + , Str "1.0.0" + , Space + , Str "and" + , Space + , Str "earlier." + , Space + , Str "Version" + , SoftBreak + , Str "8." + , Space + , Str "This" + , Space + , Str "line" + , Space + , Str "turns" + , Space + , Str "into" , Space , Str "a" , Space - , Str "block" + , Str "list" , Space - , Str "quote." + , Str "item." , SoftBreak - , Str "It" + , Str "Because" , Space - , Str "is" + , Str "a" + , Space + , Str "hard-wrapped" + , Space + , Str "line" + , Space + , Str "in" + , Space + , Str "the" + , SoftBreak + , Str "middle" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Str "paragraph" + , Space + , Str "looked" + , Space + , Str "like" + , Space + , Str "a" + , SoftBreak + , Str "list" + , Space + , Str "item." + ] + , Para + [ Str "Here\8217s" , Space - , Str "pretty" + , Str "one" , Space - , Str "short." + , Str "with" + , Space + , Str "a" + , Space + , Str "bullet." + , SoftBreak + , Str "*" + , Space + , Str "criminey." + ] + , Para + [ Str "There" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "hard" + , Space + , Str "line" + , Space + , Str "break" + , LineBreak + , Str "here." + ] + , HorizontalRule + , Header + 1 + ( "block-quotes" , [] , [] ) + [ Str "Block" , Space , Str "Quotes" ] + , Para [ Str "E-mail" , Space , Str "style:" ] + , BlockQuote + [ Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote." + , SoftBreak + , Str "It" + , Space + , Str "is" + , Space + , Str "pretty" + , Space + , Str "short." + ] ] - ] , BlockQuote - [ Para - [ Str "Code" + [ Para + [ Str "Code" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "block" + , Space + , Str "quote:" + ] + , CodeBlock + ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + , Para [ Str "A" , Space , Str "list:" ] + , OrderedList + ( 1 , Decimal , Period ) + [ [ Plain [ Str "item" , Space , Str "one" ] ] + , [ Plain [ Str "item" , Space , Str "two" ] ] + ] + , Para + [ Str "Nested" , Space , Str "block" , Space , Str "quotes:" ] + , BlockQuote [ Para [ Str "nested" ] ] + , BlockQuote [ Para [ Str "nested" ] ] + ] + , Para + [ Str "This" , Space - , Str "in" + , Str "should" + , Space + , Str "not" + , Space + , Str "be" , Space , Str "a" , Space , Str "block" , Space , Str "quote:" + , Space + , Str "2" + , SoftBreak + , Str ">" + , Space + , Str "1." ] - , CodeBlock - ( "", [], [] ) "sub status {\n print \"working\";\n}" - , Para - [ Str "A", Space, Str "list:" ] - , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "item", Space, Str "one" ] ] - , - [ Plain [ Str "item", Space, Str "two" ] ] - ] - , Para - [ Str "Nested", Space, Str "block", Space, Str "quotes:" ] - , BlockQuote - [ Para [ Str "nested" ] ] - , BlockQuote - [ Para [ Str "nested" ] ] - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "block" - , Space - , Str "quote:" - , Space - , Str "2" - , SoftBreak - , Str ">" - , Space - , Str "1." - ] - , Para - [ Str "And" - , Space - , Str "a" - , Space - , Str "following" - , Space - , Str "paragraph." - ] - , HorizontalRule - , Header 1 - ( "code-blocks", [], [] ) - [ Str "Code", Space, Str "Blocks" ] , Para - [ Str "Code:" ] + [ Str "And" + , Space + , Str "a" + , Space + , Str "following" + , Space + , Str "paragraph." + ] + , HorizontalRule + , Header + 1 ( "code-blocks" , [] , [] ) [ Str "Code" , Space , Str "Blocks" ] + , Para [ Str "Code:" ] , CodeBlock - ( "" - , [] - , [] - ) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" - , Para - [ Str "And:" ] + ( "" , [] , [] ) + "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n\nthis code block is indented by one tab" + , Para [ Str "And:" ] , CodeBlock - ( "" - , [] - , [] - ) " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" + ( "" , [] , [] ) + " this code block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" , HorizontalRule - , Header 1 - ( "lists", [], [] ) - [ Str "Lists" ] - , Header 2 - ( "unordered", [], [] ) - [ Str "Unordered" ] - , Para - [ Str "Asterisks", Space, Str "tight:" ] + , Header 1 ( "lists" , [] , [] ) [ Str "Lists" ] + , Header 2 ( "unordered" , [] , [] ) [ Str "Unordered" ] + , Para [ Str "Asterisks" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "asterisk", Space, Str "1" ] ] - , - [ Plain [ Str "asterisk", Space, Str "2" ] ] - , - [ Plain [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Asterisks", Space, Str "loose:" ] + [ [ Plain [ Str "asterisk" , Space , Str "1" ] ] + , [ Plain [ Str "asterisk" , Space , Str "2" ] ] + , [ Plain [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Asterisks" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "asterisk", Space, Str "1" ] ] - , - [ Para [ Str "asterisk", Space, Str "2" ] ] - , - [ Para [ Str "asterisk", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "tight:" ] + [ [ Para [ Str "asterisk" , Space , Str "1" ] ] + , [ Para [ Str "asterisk" , Space , Str "2" ] ] + , [ Para [ Str "asterisk" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "Plus", Space, Str "1" ] ] - , - [ Plain [ Str "Plus", Space, Str "2" ] ] - , - [ Plain [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Pluses", Space, Str "loose:" ] + [ [ Plain [ Str "Plus" , Space , Str "1" ] ] + , [ Plain [ Str "Plus" , Space , Str "2" ] ] + , [ Plain [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Pluses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Plus", Space, Str "1" ] ] - , - [ Para [ Str "Plus", Space, Str "2" ] ] - , - [ Para [ Str "Plus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "tight:" ] + [ [ Para [ Str "Plus" , Space , Str "1" ] ] + , [ Para [ Str "Plus" , Space , Str "2" ] ] + , [ Para [ Str "Plus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "tight:" ] , BulletList - [ - [ Plain [ Str "Minus", Space, Str "1" ] ] - , - [ Plain [ Str "Minus", Space, Str "2" ] ] - , - [ Plain [ Str "Minus", Space, Str "3" ] ] - ] - , Para - [ Str "Minuses", Space, Str "loose:" ] + [ [ Plain [ Str "Minus" , Space , Str "1" ] ] + , [ Plain [ Str "Minus" , Space , Str "2" ] ] + , [ Plain [ Str "Minus" , Space , Str "3" ] ] + ] + , Para [ Str "Minuses" , Space , Str "loose:" ] , BulletList - [ - [ Para [ Str "Minus", Space, Str "1" ] ] - , - [ Para [ Str "Minus", Space, Str "2" ] ] - , - [ Para [ Str "Minus", Space, Str "3" ] ] - ] - , Header 2 - ( "ordered", [], [] ) - [ Str "Ordered" ] - , Para - [ Str "Tight:" ] + [ [ Para [ Str "Minus" , Space , Str "1" ] ] + , [ Para [ Str "Minus" , Space , Str "2" ] ] + , [ Para [ Str "Minus" , Space , Str "3" ] ] + ] + , Header 2 ( "ordered" , [] , [] ) [ Str "Ordered" ] + , Para [ Str "Tight:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "First" ] ] - , - [ Plain [ Str "Second" ] ] - , - [ Plain [ Str "Third" ] ] - ] - , Para - [ Str "and:" ] + ( 1 , Decimal , Period ) + [ [ Plain [ Str "First" ] ] + , [ Plain [ Str "Second" ] ] + , [ Plain [ Str "Third" ] ] + ] + , Para [ Str "and:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "One" ] ] - , - [ Plain [ Str "Two" ] ] - , - [ Plain [ Str "Three" ] ] - ] - , Para - [ Str "Loose", Space, Str "using", Space, Str "tabs:" ] + ( 1 , Decimal , Period ) + [ [ Plain [ Str "One" ] ] + , [ Plain [ Str "Two" ] ] + , [ Plain [ Str "Three" ] ] + ] + , Para [ Str "Loose" , Space , Str "using" , Space , Str "tabs:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para [ Str "Second" ] ] - , - [ Para [ Str "Third" ] ] - ] - , Para - [ Str "and", Space, Str "using", Space, Str "spaces:" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second" ] ] + , [ Para [ Str "Third" ] ] + ] + , Para [ Str "and" , Space , Str "using" , Space , Str "spaces:" ] , OrderedList - ( 1, Decimal, Period ) - [ [ Para [ Str "One" ] ], [ Para [ Str "Two" ] ], [ Para [ Str "Three" ] ] ] - , Para - [ Str "Multiple", Space, Str "paragraphs:" ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "One" ] ] + , [ Para [ Str "Two" ] ] + , [ Para [ Str "Three" ] ] + ] + , Para [ Str "Multiple" , Space , Str "paragraphs:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para - [ Str "Item", Space, Str "1,", Space, Str "graf", Space, Str "one." ] - , Para - [ Str "Item" - , Space - , Str "1." - , Space - , Str "graf" - , Space - , Str "two." - , Space - , Str "The" - , Space - , Str "quick" - , Space - , Str "brown" - , Space - , Str "fox" - , Space - , Str "jumped" - , Space - , Str "over" - , Space - , Str "the" - , Space - , Str "lazy" - , Space - , Str "dog\8217s" - , SoftBreak - , Str "back." + ( 1 , Decimal , Period ) + [ [ Para + [ Str "Item" + , Space + , Str "1," + , Space + , Str "graf" + , Space + , Str "one." + ] + , Para + [ Str "Item" + , Space + , Str "1." + , Space + , Str "graf" + , Space + , Str "two." + , Space + , Str "The" + , Space + , Str "quick" + , Space + , Str "brown" + , Space + , Str "fox" + , Space + , Str "jumped" + , Space + , Str "over" + , Space + , Str "the" + , Space + , Str "lazy" + , Space + , Str "dog\8217s" + , SoftBreak + , Str "back." + ] ] + , [ Para [ Str "Item" , Space , Str "2." ] ] + , [ Para [ Str "Item" , Space , Str "3." ] ] ] - , - [ Para [ Str "Item", Space, Str "2." ] ] - , - [ Para [ Str "Item", Space, Str "3." ] ] - ] - , Header 2 - ( "nested", [], [] ) - [ Str "Nested" ] + , Header 2 ( "nested" , [] , [] ) [ Str "Nested" ] , BulletList - [ - [ Plain - [ Str "Tab" ] - , BulletList - [ [ Plain [ Str "Tab" ], BulletList [ [ Plain [ Str "Tab" ] ] ] ] ] + [ [ Plain [ Str "Tab" ] + , BulletList + [ [ Plain [ Str "Tab" ] , BulletList [ [ Plain [ Str "Tab" ] ] ] ] + ] + ] ] - ] - , Para - [ Str "Here\8217s", Space, Str "another:" ] + , Para [ Str "Here\8217s" , Space , Str "another:" ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain [ Str "First" ] ] - , - [ Plain - [ Str "Second:" ] - , BulletList - [ - [ Plain [ Str "Fee" ] ] - , - [ Plain [ Str "Fie" ] ] - , - [ Plain [ Str "Foe" ] ] + ( 1 , Decimal , Period ) + [ [ Plain [ Str "First" ] ] + , [ Plain [ Str "Second:" ] + , BulletList + [ [ Plain [ Str "Fee" ] ] + , [ Plain [ Str "Fie" ] ] + , [ Plain [ Str "Foe" ] ] + ] ] + , [ Plain [ Str "Third" ] ] + ] + , Para + [ Str "Same" + , Space + , Str "thing" + , Space + , Str "but" + , Space + , Str "with" + , Space + , Str "paragraphs:" ] - , - [ Plain [ Str "Third" ] ] - ] - , Para - [ Str "Same" - , Space - , Str "thing" - , Space - , Str "but" - , Space - , Str "with" - , Space - , Str "paragraphs:" - ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Para [ Str "First" ] ] - , - [ Para - [ Str "Second:" ] - , BulletList - [ - [ Plain [ Str "Fee" ] ] - , - [ Plain [ Str "Fie" ] ] - , - [ Plain [ Str "Foe" ] ] + ( 1 , Decimal , Period ) + [ [ Para [ Str "First" ] ] + , [ Para [ Str "Second:" ] + , BulletList + [ [ Plain [ Str "Fee" ] ] + , [ Plain [ Str "Fie" ] ] + , [ Plain [ Str "Foe" ] ] + ] ] + , [ Para [ Str "Third" ] ] ] - , - [ Para [ Str "Third" ] ] - ] - , Header 2 - ( "tabs-and-spaces", [], [] ) - [ Str "Tabs", Space, Str "and", Space, Str "spaces" ] + , Header + 2 + ( "tabs-and-spaces" , [] , [] ) + [ Str "Tabs" , Space , Str "and" , Space , Str "spaces" ] , BulletList - [ - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , SoftBreak - , Str "indented" - , Space - , Str "with" - , Space - , Str "tabs" - ] - ] - , - [ Para - [ Str "this" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item" - , SoftBreak - , Str "indented" - , Space - , Str "with" - , Space - , Str "spaces" - ] - , BulletList - [ - [ Para + [ [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -605,16 +499,13 @@ Pandoc , Space , Str "tabs" ] - ] - , - [ Para + ] + , [ Para [ Str "this" , Space , Str "is" , Space - , Str "an" - , Space - , Str "example" + , Str "a" , Space , Str "list" , Space @@ -626,1760 +517,1650 @@ Pandoc , Space , Str "spaces" ] - ] + , BulletList + [ [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "tabs" + ] + ] + , [ Para + [ Str "this" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "example" + , Space + , Str "list" + , Space + , Str "item" + , SoftBreak + , Str "indented" + , Space + , Str "with" + , Space + , Str "spaces" + ] + ] + ] ] ] - ] - , Header 2 - ( "fancy-list-markers", [], [] ) - [ Str "Fancy", Space, Str "list", Space, Str "markers" ] + , Header + 2 + ( "fancy-list-markers" , [] , [] ) + [ Str "Fancy" , Space , Str "list" , Space , Str "markers" ] , OrderedList - ( 2, Decimal, TwoParens ) - [ - [ Para [ Str "begins", Space, Str "with", Space, Str "2" ] ] - , - [ Para - [ Str "and", Space, Str "now", Space, Str "3" ] - , Para - [ Str "with", Space, Str "a", Space, Str "continuation" ] - , OrderedList - ( 4, LowerRoman, Period ) - [ - [ Plain - [ Str "sublist" - , Space - , Str "with" - , Space - , Str "roman" - , Space - , Str "numerals," - , SoftBreak - , Str "starting" - , Space - , Str "with" - , Space - , Str "4" - ] - ] - , - [ Plain - [ Str "more", Space, Str "items" ] - , OrderedList - ( 1, UpperAlpha, TwoParens ) - [ - [ Plain [ Str "a", Space, Str "subsublist" ] ] - , - [ Plain [ Str "a", Space, Str "subsublist" ] ] + ( 2 , Decimal , TwoParens ) + [ [ Para [ Str "begins" , Space , Str "with" , Space , Str "2" ] ] + , [ Para [ Str "and" , Space , Str "now" , Space , Str "3" ] + , Para + [ Str "with" , Space , Str "a" , Space , Str "continuation" ] + , OrderedList + ( 4 , LowerRoman , Period ) + [ [ Plain + [ Str "sublist" + , Space + , Str "with" + , Space + , Str "roman" + , Space + , Str "numerals," + , SoftBreak + , Str "starting" + , Space + , Str "with" + , Space + , Str "4" + ] + ] + , [ Plain [ Str "more" , Space , Str "items" ] + , OrderedList + ( 1 , UpperAlpha , TwoParens ) + [ [ Plain [ Str "a" , Space , Str "subsublist" ] ] + , [ Plain [ Str "a" , Space , Str "subsublist" ] ] + ] + ] ] - ] ] ] - ] - , Para - [ Str "Nesting:" ] + , Para [ Str "Nesting:" ] , OrderedList - ( 1, UpperAlpha, Period ) - [ - [ Plain - [ Str "Upper", Space, Str "Alpha" ] - , OrderedList - ( 1, UpperRoman, Period ) - [ - [ Plain - [ Str "Upper", Space, Str "Roman." ] - , OrderedList - ( 6, Decimal, TwoParens ) - [ - [ Plain - [ Str "Decimal" - , Space - , Str "start" - , Space - , Str "with" - , Space - , Str "6" - ] + ( 1 , UpperAlpha , Period ) + [ [ Plain [ Str "Upper" , Space , Str "Alpha" ] + , OrderedList + ( 1 , UpperRoman , Period ) + [ [ Plain [ Str "Upper" , Space , Str "Roman." ] , OrderedList - ( 3, LowerAlpha, OneParen ) - [ - [ Plain - [ Str "Lower" - , Space - , Str "alpha" - , Space - , Str "with" - , Space - , Str "paren" + ( 6 , Decimal , TwoParens ) + [ [ Plain + [ Str "Decimal" + , Space + , Str "start" + , Space + , Str "with" + , Space + , Str "6" + ] + , OrderedList + ( 3 , LowerAlpha , OneParen ) + [ [ Plain + [ Str "Lower" + , Space + , Str "alpha" + , Space + , Str "with" + , Space + , Str "paren" + ] + ] + ] ] ] - ] ] ] - ] ] ] - ] - , Para - [ Str "Autonumbering:" ] + , Para [ Str "Autonumbering:" ] , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ - [ Plain [ Str "Autonumber." ] ] - , - [ Plain - [ Str "More." ] - , OrderedList - ( 1, DefaultStyle, DefaultDelim ) - [ [ Plain [ Str "Nested." ] ] ] - ] - ] - , Para - [ Str "Should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "list" - , Space - , Str "item:" - ] - , Para - [ Str "M.A.\160\&2007" ] - , Para - [ Str "B.", Space, Str "Williams" ] + ( 1 , DefaultStyle , DefaultDelim ) + [ [ Plain [ Str "Autonumber." ] ] + , [ Plain [ Str "More." ] + , OrderedList + ( 1 , DefaultStyle , DefaultDelim ) [ [ Plain [ Str "Nested." ] ] ] + ] + ] + , Para + [ Str "Should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "list" + , Space + , Str "item:" + ] + , Para [ Str "M.A.\160\&2007" ] + , Para [ Str "B." , Space , Str "Williams" ] , HorizontalRule - , Header 1 - ( "definition-lists", [], [] ) - [ Str "Definition", Space, Str "Lists" ] + , Header + 1 + ( "definition-lists" , [] , [] ) + [ Str "Definition" , Space , Str "Lists" ] , Para - [ Str "Tight", Space, Str "using", Space, Str "spaces:" ] - , DefinitionList - [ - ( [ Str "apple" ], [ [ Plain [ Str "red", Space, Str "fruit" ] ] ] ) - , - ( [ Str "orange" ], [ [ Plain [ Str "orange", Space, Str "fruit" ] ] ] ) - , - ( [ Str "banana" ], [ [ Plain [ Str "yellow", Space, Str "fruit" ] ] ] ) - ] - , Para - [ Str "Tight", Space, Str "using", Space, Str "tabs:" ] - , DefinitionList - [ - ( [ Str "apple" ], [ [ Plain [ Str "red", Space, Str "fruit" ] ] ] ) - , - ( [ Str "orange" ], [ [ Plain [ Str "orange", Space, Str "fruit" ] ] ] ) - , - ( [ Str "banana" ], [ [ Plain [ Str "yellow", Space, Str "fruit" ] ] ] ) - ] - , Para - [ Str "Loose:" ] + [ Str "Tight" , Space , Str "using" , Space , Str "spaces:" ] , DefinitionList - [ - ( [ Str "apple" ], [ [ Para [ Str "red", Space, Str "fruit" ] ] ] ) - , - ( [ Str "orange" ], [ [ Para [ Str "orange", Space, Str "fruit" ] ] ] ) - , - ( [ Str "banana" ], [ [ Para [ Str "yellow", Space, Str "fruit" ] ] ] ) - ] - , Para - [ Str "Multiple" - , Space - , Str "blocks" - , Space - , Str "with" - , Space - , Str "italics:" - ] + [ ( [ Str "apple" ] + , [ [ Plain [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Plain [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Plain [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para [ Str "Tight" , Space , Str "using" , Space , Str "tabs:" ] , DefinitionList - [ - ( - [ Emph [ Str "apple" ] ] - , - [ - [ Para - [ Str "red", Space, Str "fruit" ] - , Para - [ Str "contains" - , Space - , Str "seeds," - , SoftBreak - , Str "crisp," - , Space - , Str "pleasant" - , Space - , Str "to" - , Space - , Str "taste" + [ ( [ Str "apple" ] + , [ [ Plain [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Plain [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Plain [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para [ Str "Loose:" ] + , DefinitionList + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] ] ] + ) + , ( [ Str "banana" ] + , [ [ Para [ Str "yellow" , Space , Str "fruit" ] ] ] + ) + ] + , Para + [ Str "Multiple" + , Space + , Str "blocks" + , Space + , Str "with" + , Space + , Str "italics:" + ] + , DefinitionList + [ ( [ Emph [ Str "apple" ] ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] + , Para + [ Str "contains" + , Space + , Str "seeds," + , SoftBreak + , Str "crisp," + , Space + , Str "pleasant" + , Space + , Str "to" + , Space + , Str "taste" + ] ] ] - ] - ) - , - ( - [ Emph [ Str "orange" ] ] - , - [ - [ Para - [ Str "orange", Space, Str "fruit" ] - , CodeBlock - ( "", [], [] ) "{ orange code block }" - , BlockQuote - [ Para [ Str "orange", Space, Str "block", Space, Str "quote" ] ] + ) + , ( [ Emph [ Str "orange" ] ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , CodeBlock ( "" , [] , [] ) "{ orange code block }" + , BlockQuote + [ Para + [ Str "orange" , Space , Str "block" , Space , Str "quote" ] + ] + ] ] - ] - ) - ] + ) + ] , Para - [ Str "Multiple", Space, Str "definitions,", Space, Str "tight:" ] + [ Str "Multiple" + , Space + , Str "definitions," + , Space + , Str "tight:" + ] , DefinitionList - [ - ( - [ Str "apple" ] - , - [ - [ Plain [ Str "red", Space, Str "fruit" ] ] - , - [ Plain [ Str "computer" ] ] - ] - ) - , - ( - [ Str "orange" ] - , - [ - [ Plain [ Str "orange", Space, Str "fruit" ] ] - , - [ Plain [ Str "bank" ] ] - ] - ) - ] + [ ( [ Str "apple" ] + , [ [ Plain [ Str "red" , Space , Str "fruit" ] ] + , [ Plain [ Str "computer" ] ] + ] + ) + , ( [ Str "orange" ] + , [ [ Plain [ Str "orange" , Space , Str "fruit" ] ] + , [ Plain [ Str "bank" ] ] + ] + ) + ] , Para - [ Str "Multiple", Space, Str "definitions,", Space, Str "loose:" ] + [ Str "Multiple" + , Space + , Str "definitions," + , Space + , Str "loose:" + ] , DefinitionList - [ - ( - [ Str "apple" ] - , - [ - [ Para [ Str "red", Space, Str "fruit" ] ] - , - [ Para [ Str "computer" ] ] - ] - ) - , - ( - [ Str "orange" ] - , - [ - [ Para [ Str "orange", Space, Str "fruit" ] ] - , - [ Para [ Str "bank" ] ] - ] - ) - ] - , Para - [ Str "Blank" - , Space - , Str "line" - , Space - , Str "after" - , Space - , Str "term," - , Space - , Str "indented" - , Space - , Str "marker," - , Space - , Str "alternate" - , Space - , Str "markers:" - ] + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] + , [ Para [ Str "computer" ] ] + ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] ] + , [ Para [ Str "bank" ] ] + ] + ) + ] + , Para + [ Str "Blank" + , Space + , Str "line" + , Space + , Str "after" + , Space + , Str "term," + , Space + , Str "indented" + , Space + , Str "marker," + , Space + , Str "alternate" + , Space + , Str "markers:" + ] , DefinitionList - [ - ( - [ Str "apple" ] - , - [ - [ Para [ Str "red", Space, Str "fruit" ] ] - , - [ Para [ Str "computer" ] ] - ] - ) - , - ( - [ Str "orange" ] - , - [ - [ Para - [ Str "orange", Space, Str "fruit" ] - , OrderedList - ( 1, Decimal, Period ) - [ [ Plain [ Str "sublist" ] ], [ Plain [ Str "sublist" ] ] ] + [ ( [ Str "apple" ] + , [ [ Para [ Str "red" , Space , Str "fruit" ] ] + , [ Para [ Str "computer" ] ] ] - ] - ) - ] - , Header 1 - ( "html-blocks", [], [] ) - [ Str "HTML", Space, Str "Blocks" ] - , Para - [ Str "Simple" - , Space - , Str "block" - , Space - , Str "on" - , Space - , Str "one" - , Space - , Str "line:" - ] - , Div - ( "", [], [] ) - [ Plain [ Str "foo" ] ] - , Para - [ Str "And" - , Space - , Str "nested" - , Space - , Str "without" - , Space - , Str "indentation:" - ] + ) + , ( [ Str "orange" ] + , [ [ Para [ Str "orange" , Space , Str "fruit" ] + , OrderedList + ( 1 , Decimal , Period ) + [ [ Plain [ Str "sublist" ] ] , [ Plain [ Str "sublist" ] ] ] + ] + ] + ) + ] + , Header + 1 ( "html-blocks" , [] , [] ) [ Str "HTML" , Space , Str "Blocks" ] + , Para + [ Str "Simple" + , Space + , Str "block" + , Space + , Str "on" + , Space + , Str "one" + , Space + , Str "line:" + ] + , Div ( "" , [] , [] ) [ Plain [ Str "foo" ] ] + , Para + [ Str "And" + , Space + , Str "nested" + , Space + , Str "without" + , Space + , Str "indentation:" + ] , Div - ( "", [], [] ) - [ Div - ( "", [], [] ) - [ Div ( "", [], [] ) [ Para [ Str "foo" ] ] ] - , Div - ( "", [], [] ) - [ Plain [ Str "bar" ] ] - ] - , Para - [ Str "Interpreted" - , Space - , Str "markdown" - , Space - , Str "in" - , Space - , Str "a" - , Space - , Str "table:" - ] - , RawBlock - ( Format "html" ) "" - , RawBlock - ( Format "html" ) "" - , RawBlock - ( Format "html" ) "" + , RawBlock (Format "html") "" + , RawBlock (Format "html") "
" + ( "" , [] , [] ) + [ Div + ( "" , [] , [] ) [ Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] ] + , Div ( "" , [] , [] ) [ Plain [ Str "bar" ] ] + ] + , Para + [ Str "Interpreted" + , Space + , Str "markdown" + , Space + , Str "in" + , Space + , Str "a" + , Space + , Str "table:" + ] + , RawBlock (Format "html") "" + , RawBlock (Format "html") "" + , RawBlock (Format "html") "" - , RawBlock - ( Format "html" ) "" + , RawBlock (Format "html") "" - , RawBlock - ( Format "html" ) "" - , RawBlock - ( Format "html" ) "
" , Plain - [ Str "This", Space, Str "is", Space, Emph [ Str "emphasized" ] ] - , RawBlock - ( Format "html" ) "" + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + ] + , RawBlock (Format "html") "" , Plain - [ Str "And" - , Space - , Str "this" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - ] - , RawBlock - ( Format "html" ) "
" + [ Str "And" + , Space + , Str "this" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + ] + , RawBlock (Format "html") "
" , RawBlock - ( Format "html" ) "" - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "simple" - , Space - , Str "block:" - ] - , Div - ( "", [], [] ) - [ Para [ Str "foo" ] ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "code" - , Space - , Str "block," - , Space - , Str "though:" - ] - , CodeBlock - ( "", [], [] ) "
\n foo\n
" + (Format "html") + "" , Para - [ Str "As", Space, Str "should", Space, Str "this:" ] - , CodeBlock - ( "", [], [] ) "
foo
" + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "simple" + , Space + , Str "block:" + ] + , Div ( "" , [] , [] ) [ Para [ Str "foo" ] ] , Para - [ Str "Now,", Space, Str "nested:" ] + [ Str "This" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "code" + , Space + , Str "block," + , Space + , Str "though:" + ] + , CodeBlock ( "" , [] , [] ) "
\n foo\n
" + , Para [ Str "As" , Space , Str "should" , Space , Str "this:" ] + , CodeBlock ( "" , [] , [] ) "
foo
" + , Para [ Str "Now," , Space , Str "nested:" ] , Div - ( "", [], [] ) - [ Div ( "", [], [] ) [ Div ( "", [], [] ) [ Plain [ Str "foo" ] ] ] ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "just" - , Space - , Str "be" - , Space - , Str "an" - , Space - , Str "HTML" - , Space - , Str "comment:" - ] - , RawBlock - ( Format "html" ) "" + ( "" , [] , [] ) + [ Div + ( "" , [] , [] ) [ Div ( "" , [] , [] ) [ Plain [ Str "foo" ] ] ] + ] , Para - [ Str "Multiline:" ] - , RawBlock - ( Format "html" ) "" + [ Str "This" + , Space + , Str "should" + , Space + , Str "just" + , Space + , Str "be" + , Space + , Str "an" + , Space + , Str "HTML" + , Space + , Str "comment:" + ] + , RawBlock (Format "html") "" + , Para [ Str "Multiline:" ] + , RawBlock (Format "html") "" , RawBlock - ( Format "html" ) "" + (Format "html") "" + , Para [ Str "Code" , Space , Str "block:" ] + , CodeBlock ( "" , [] , [] ) "" , Para - [ Str "Code", Space, Str "block:" ] - , CodeBlock - ( "", [], [] ) "" - , Para - [ Str "Just" - , Space - , Str "plain" - , Space - , Str "comment," - , Space - , Str "with" - , Space - , Str "trailing" - , Space - , Str "spaces" - , Space - , Str "on" - , Space - , Str "the" - , Space - , Str "line:" - ] - , RawBlock - ( Format "html" ) "" + [ Str "Just" + , Space + , Str "plain" + , Space + , Str "comment," + , Space + , Str "with" + , Space + , Str "trailing" + , Space + , Str "spaces" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "line:" + ] + , RawBlock (Format "html") "" + , Para [ Str "Code:" ] + , CodeBlock ( "" , [] , [] ) "
" + , Para [ Str "Hr\8217s:" ] + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , RawBlock (Format "html") "
" + , HorizontalRule + , Header + 1 + ( "inline-markup" , [] , [] ) + [ Str "Inline" , Space , Str "Markup" ] , Para - [ Str "Code:" ] - , CodeBlock - ( "", [], [] ) "
" + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "emphasized" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Emph [ Str "is" , Space , Str "this" ] + , Str "." + ] , Para - [ Str "Hr\8217s:" ] - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , RawBlock - ( Format "html" ) "
" - , HorizontalRule - , Header 1 - ( "inline-markup", [], [] ) - [ Str "Inline", Space, Str "Markup" ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Emph - [ Str "emphasized" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Emph - [ Str "is", Space, Str "this" ] - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Strong - [ Str "strong" ] - , Str "," - , Space - , Str "and" - , Space - , Str "so" - , Space - , Strong - [ Str "is", Space, Str "this" ] - , Str "." - ] - , Para - [ Str "An" - , Space - , Emph - [ Link - ( "", [], [] ) - [ Str "emphasized", Space, Str "link" ] - ( "/url", "" ) - ] - , Str "." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] + [ Str "This" + , Space + , Str "is" + , Space + , Strong [ Str "strong" ] + , Str "," + , Space + , Str "and" + , Space + , Str "so" + , Space + , Strong [ Str "is" , Space , Str "this" ] + , Str "." ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Strong - [ Emph - [ Str "This" - , Space - , Str "is" - , Space - , Str "strong" - , Space - , Str "and" - , Space - , Str "em." - ] + , Para + [ Str "An" + , Space + , Emph + [ Link + ( "" , [] , [] ) + [ Str "emphasized" , Space , Str "link" ] + ( "/url" , "" ) + ] + , Str "." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Strong + [ Emph + [ Str "This" + , Space + , Str "is" + , Space + , Str "strong" + , Space + , Str "and" + , Space + , Str "em." + ] + ] + ] + , Para + [ Str "So" + , Space + , Str "is" + , Space + , Strong [ Emph [ Str "this" ] ] + , Space + , Str "word." + ] + , Para + [ Str "This" + , Space + , Str "is" + , Space + , Str "code:" + , Space + , Code ( "" , [] , [] ) ">" + , Str "," + , Space + , Code ( "" , [] , [] ) "$" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\" + , Str "," + , Space + , Code ( "" , [] , [] ) "\\$" + , Str "," + , Space + , Code ( "" , [] , [] ) "" + , Str "." + ] + , Para + [ Strikeout + [ Str "This" + , Space + , Str "is" + , Space + , Emph [ Str "strikeout" ] + , Str "." + ] + ] + , Para + [ Str "Superscripts:" + , Space + , Str "a" + , Superscript [ Str "bc" ] + , Str "d" + , Space + , Str "a" + , Superscript [ Emph [ Str "hello" ] ] + , Space + , Str "a" + , Superscript [ Str "hello\160there" ] + , Str "." + ] + , Para + [ Str "Subscripts:" + , Space + , Str "H" + , Subscript [ Str "2" ] + , Str "O," + , Space + , Str "H" + , Subscript [ Str "23" ] + , Str "O," + , Space + , Str "H" + , Subscript [ Str "many\160of\160them" ] + , Str "O." + ] + , Para + [ Str "These" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "superscripts" + , Space + , Str "or" + , Space + , Str "subscripts," + , SoftBreak + , Str "because" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "unescaped" + , Space + , Str "spaces:" + , Space + , Str "a^b" + , Space + , Str "c^d," + , Space + , Str "a~b" + , Space + , Str "c~d." ] - ] - , Para - [ Str "So" - , Space - , Str "is" - , Space - , Strong - [ Emph [ Str "this" ] ] - , Space - , Str "word." - ] - , Para - [ Str "This" - , Space - , Str "is" - , Space - , Str "code:" - , Space - , Code - ( "", [], [] ) ">" - , Str "," - , Space - , Code - ( "", [], [] ) "$" - , Str "," - , Space - , Code - ( "", [], [] ) "\\" - , Str "," - , Space - , Code - ( "", [], [] ) "\\$" - , Str "," - , Space - , Code - ( "", [], [] ) "" - , Str "." - ] - , Para - [ Strikeout - [ Str "This", Space, Str "is", Space, Emph [ Str "strikeout" ], Str "." ] - ] - , Para - [ Str "Superscripts:" - , Space - , Str "a" - , Superscript - [ Str "bc" ] - , Str "d" - , Space - , Str "a" - , Superscript - [ Emph [ Str "hello" ] ] - , Space - , Str "a" - , Superscript - [ Str "hello\160there" ] - , Str "." - ] - , Para - [ Str "Subscripts:" - , Space - , Str "H" - , Subscript - [ Str "2" ] - , Str "O," - , Space - , Str "H" - , Subscript - [ Str "23" ] - , Str "O," - , Space - , Str "H" - , Subscript - [ Str "many\160of\160them" ] - , Str "O." - ] - , Para - [ Str "These" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "superscripts" - , Space - , Str "or" - , Space - , Str "subscripts," - , SoftBreak - , Str "because" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "unescaped" - , Space - , Str "spaces:" - , Space - , Str "a^b" - , Space - , Str "c^d," - , Space - , Str "a~b" - , Space - , Str "c~d." - ] , HorizontalRule - , Header 1 - ( "smart-quotes-ellipses-dashes", [], [] ) - [ Str "Smart" - , Space - , Str "quotes," - , Space - , Str "ellipses," - , Space - , Str "dashes" - ] - , Para - [ Quoted DoubleQuote - [ Str "Hello," ] - , Space - , Str "said" - , Space - , Str "the" - , Space - , Str "spider." - , Space - , Quoted DoubleQuote - [ Quoted SingleQuote - [ Str "Shelob" ] + , Header + 1 + ( "smart-quotes-ellipses-dashes" , [] , [] ) + [ Str "Smart" + , Space + , Str "quotes," + , Space + , Str "ellipses," + , Space + , Str "dashes" + ] + , Para + [ Quoted DoubleQuote [ Str "Hello," ] + , Space + , Str "said" + , Space + , Str "the" + , Space + , Str "spider." + , Space + , Quoted + DoubleQuote + [ Quoted SingleQuote [ Str "Shelob" ] + , Space + , Str "is" + , Space + , Str "my" + , Space + , Str "name." + ] + ] + , Para + [ Quoted SingleQuote [ Str "A" ] + , Str "," + , Space + , Quoted SingleQuote [ Str "B" ] + , Str "," + , Space + , Str "and" + , Space + , Quoted SingleQuote [ Str "C" ] + , Space + , Str "are" + , Space + , Str "letters." + ] + , Para + [ Quoted SingleQuote [ Str "Oak," ] + , Space + , Quoted SingleQuote [ Str "elm," ] + , Space + , Str "and" + , Space + , Quoted SingleQuote [ Str "beech" ] + , Space + , Str "are" + , Space + , Str "names" + , Space + , Str "of" + , Space + , Str "trees." + , SoftBreak + , Str "So" , Space , Str "is" , Space - , Str "my" + , Quoted SingleQuote [ Str "pine." ] + ] + , Para + [ Quoted + SingleQuote + [ Str "He" + , Space + , Str "said," + , Space + , Quoted + DoubleQuote + [ Str "I" + , Space + , Str "want" + , Space + , Str "to" + , Space + , Str "go." + ] + ] , Space - , Str "name." + , Str "Were" + , Space + , Str "you" + , Space + , Str "alive" + , Space + , Str "in" + , Space + , Str "the" + , SoftBreak + , Str "70\8217s?" ] - ] - , Para - [ Quoted SingleQuote - [ Str "A" ] - , Str "," - , Space - , Quoted SingleQuote - [ Str "B" ] - , Str "," - , Space - , Str "and" - , Space - , Quoted SingleQuote - [ Str "C" ] - , Space - , Str "are" - , Space - , Str "letters." - ] - , Para - [ Quoted SingleQuote - [ Str "Oak," ] - , Space - , Quoted SingleQuote - [ Str "elm," ] - , Space - , Str "and" - , Space - , Quoted SingleQuote - [ Str "beech" ] - , Space - , Str "are" - , Space - , Str "names" - , Space - , Str "of" - , Space - , Str "trees." - , SoftBreak - , Str "So" - , Space - , Str "is" - , Space - , Quoted SingleQuote - [ Str "pine." ] - ] - , Para - [ Quoted SingleQuote - [ Str "He" - , Space - , Str "said," - , Space - , Quoted DoubleQuote - [ Str "I", Space, Str "want", Space, Str "to", Space, Str "go." ] - ] - , Space - , Str "Were" - , Space - , Str "you" - , Space - , Str "alive" - , Space - , Str "in" - , Space - , Str "the" - , SoftBreak - , Str "70\8217s?" - ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "some" - , Space - , Str "quoted" - , Space - , Quoted SingleQuote - [ Code ( "", [], [] ) "code" ] - , Space - , Str "and" - , Space - , Str "a" - , Space - , Quoted DoubleQuote - [ Link - ( "", [], [] ) - [ Str "quoted", Space, Str "link" ] - ( "http://example.com/?foo=1&bar=2", "" ) - ] - , Str "." - ] - , Para - [ Str "Some" - , Space - , Str "dashes:" - , Space - , Str "one\8212two" - , Space - , Str "\8212" - , Space - , Str "three\8212four" - , Space - , Str "\8212" - , Space - , Str "five." - ] - , Para - [ Str "Dashes" - , Space - , Str "between" - , Space - , Str "numbers:" - , Space - , Str "5\8211\&7," - , Space - , Str "255\8211\&66," - , Space - , Str "1987\8211\&1999." - ] - , Para - [ Str "Ellipses\8230and\8230and\8230." ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "quoted" + , Space + , Quoted SingleQuote [ Code ( "" , [] , [] ) "code" ] + , Space + , Str "and" + , Space + , Str "a" + , Space + , Quoted + DoubleQuote + [ Link + ( "" , [] , [] ) + [ Str "quoted" , Space , Str "link" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + ] + , Str "." + ] + , Para + [ Str "Some" + , Space + , Str "dashes:" + , Space + , Str "one\8212two" + , Space + , Str "\8212" + , Space + , Str "three\8212four" + , Space + , Str "\8212" + , Space + , Str "five." + ] + , Para + [ Str "Dashes" + , Space + , Str "between" + , Space + , Str "numbers:" + , Space + , Str "5\8211\&7," + , Space + , Str "255\8211\&66," + , Space + , Str "1987\8211\&1999." + ] + , Para [ Str "Ellipses\8230and\8230and\8230." ] , HorizontalRule - , Header 1 - ( "latex", [], [] ) - [ Str "LaTeX" ] + , Header 1 ( "latex" , [] , [] ) [ Str "LaTeX" ] , BulletList - [ - [ Plain [ RawInline ( Format "tex" ) "\\cite[22-23]{smith.1899}" ] ] - , - [ Plain [ Math InlineMath "2+2=4" ] ] - , - [ Plain [ Math InlineMath "x \\in y" ] ] - , - [ Plain [ Math InlineMath "\\alpha \\wedge \\omega" ] ] - , - [ Plain [ Math InlineMath "223" ] ] - , - [ Plain [ Math InlineMath "p", Str "-Tree" ] ] - , - [ Plain - [ Str "Here\8217s" - , Space - , Str "some" - , Space - , Str "display" - , Space - , Str "math:" - , SoftBreak - , Math DisplayMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}" + [ [ Plain [ RawInline (Format "tex") "\\cite[22-23]{smith.1899}" ] + ] + , [ Plain [ Math InlineMath "2+2=4" ] ] + , [ Plain [ Math InlineMath "x \\in y" ] ] + , [ Plain [ Math InlineMath "\\alpha \\wedge \\omega" ] ] + , [ Plain [ Math InlineMath "223" ] ] + , [ Plain [ Math InlineMath "p" , Str "-Tree" ] ] + , [ Plain + [ Str "Here\8217s" + , Space + , Str "some" + , Space + , Str "display" + , Space + , Str "math:" + , SoftBreak + , Math + DisplayMath + "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}" + ] + ] + , [ Plain + [ Str "Here\8217s" + , Space + , Str "one" + , Space + , Str "that" + , Space + , Str "has" + , Space + , Str "a" + , Space + , Str "line" + , Space + , Str "break" + , Space + , Str "in" + , Space + , Str "it:" + , Space + , Math InlineMath "\\alpha + \\omega \\times x^2" + , Str "." + ] ] ] - , - [ Plain - [ Str "Here\8217s" - , Space - , Str "one" - , Space - , Str "that" - , Space - , Str "has" - , Space - , Str "a" - , Space - , Str "line" - , Space - , Str "break" - , Space - , Str "in" - , Space - , Str "it:" - , Space - , Math InlineMath "\\alpha + \\omega \\times x^2" - , Str "." + , Para + [ Str "These" + , Space + , Str "shouldn\8217t" + , Space + , Str "be" + , Space + , Str "math:" + ] + , BulletList + [ [ Plain + [ Str "To" + , Space + , Str "get" + , Space + , Str "the" + , Space + , Str "famous" + , Space + , Str "equation," + , Space + , Str "write" + , Space + , Code ( "" , [] , [] ) "$e = mc^2$" + , Str "." + ] + ] + , [ Plain + [ Str "$22,000" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Emph [ Str "lot" ] + , Space + , Str "of" + , Space + , Str "money." + , Space + , Str "So" + , Space + , Str "is" + , Space + , Str "$34,000." + , SoftBreak + , Str "(It" + , Space + , Str "worked" + , Space + , Str "if" + , Space + , Quoted DoubleQuote [ Str "lot" ] + , Space + , Str "is" + , Space + , Str "emphasized.)" + ] + ] + , [ Plain + [ Str "Shoes" + , Space + , Str "($20)" + , Space + , Str "and" + , Space + , Str "socks" + , Space + , Str "($5)." + ] ] + , [ Plain + [ Str "Escaped" + , Space + , Code ( "" , [] , [] ) "$" + , Str ":" + , Space + , Str "$73" + , Space + , Emph + [ Str "this" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "emphasized" + ] + , Space + , Str "23$." + ] + ] + ] + , Para + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "LaTeX" + , Space + , Str "table:" + ] + , RawBlock + (Format "tex") + "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" + , HorizontalRule + , Header + 1 + ( "special-characters" , [] , [] ) + [ Str "Special" , Space , Str "Characters" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "some" + , Space + , Str "unicode:" ] - ] - , Para - [ Str "These" - , Space - , Str "shouldn\8217t" - , Space - , Str "be" - , Space - , Str "math:" - ] , BulletList - [ - [ Plain - [ Str "To" - , Space - , Str "get" - , Space - , Str "the" - , Space - , Str "famous" - , Space - , Str "equation," - , Space - , Str "write" - , Space - , Code - ( "", [], [] ) "$e = mc^2$" - , Str "." - ] - ] - , - [ Plain - [ Str "$22,000" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Emph - [ Str "lot" ] - , Space - , Str "of" - , Space - , Str "money." - , Space - , Str "So" - , Space - , Str "is" - , Space - , Str "$34,000." - , SoftBreak - , Str "(It" - , Space - , Str "worked" - , Space - , Str "if" - , Space - , Quoted DoubleQuote - [ Str "lot" ] - , Space - , Str "is" - , Space - , Str "emphasized.)" + [ [ Plain [ Str "I" , Space , Str "hat:" , Space , Str "\206" ] ] + , [ Plain [ Str "o" , Space , Str "umlaut:" , Space , Str "\246" ] ] - ] - , - [ Plain - [ Str "Shoes" - , Space - , Str "($20)" - , Space - , Str "and" - , Space - , Str "socks" - , Space - , Str "($5)." + , [ Plain [ Str "section:" , Space , Str "\167" ] ] + , [ Plain + [ Str "set" , Space , Str "membership:" , Space , Str "\8712" ] ] + , [ Plain [ Str "copyright:" , Space , Str "\169" ] ] ] - , - [ Plain - [ Str "Escaped" - , Space - , Code - ( "", [], [] ) "$" - , Str ":" - , Space - , Str "$73" - , Space - , Emph - [ Str "this" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "emphasized" - ] - , Space - , Str "23$." - ] + , Para + [ Str "AT&T" + , Space + , Str "has" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "their" + , Space + , Str "name." ] - ] , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "LaTeX" - , Space - , Str "table:" - ] - , RawBlock - ( Format "tex" ) "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}" + [ Str "AT&T" + , Space + , Str "is" + , Space + , Str "another" + , Space + , Str "way" + , Space + , Str "to" + , Space + , Str "write" + , Space + , Str "it." + ] + , Para [ Str "This" , Space , Str "&" , Space , Str "that." ] + , Para [ Str "4" , Space , Str "<" , Space , Str "5." ] + , Para [ Str "6" , Space , Str ">" , Space , Str "5." ] + , Para [ Str "Backslash:" , Space , Str "\\" ] + , Para [ Str "Backtick:" , Space , Str "`" ] + , Para [ Str "Asterisk:" , Space , Str "*" ] + , Para [ Str "Underscore:" , Space , Str "_" ] + , Para [ Str "Left" , Space , Str "brace:" , Space , Str "{" ] + , Para [ Str "Right" , Space , Str "brace:" , Space , Str "}" ] + , Para [ Str "Left" , Space , Str "bracket:" , Space , Str "[" ] + , Para [ Str "Right" , Space , Str "bracket:" , Space , Str "]" ] + , Para [ Str "Left" , Space , Str "paren:" , Space , Str "(" ] + , Para [ Str "Right" , Space , Str "paren:" , Space , Str ")" ] + , Para [ Str "Greater-than:" , Space , Str ">" ] + , Para [ Str "Hash:" , Space , Str "#" ] + , Para [ Str "Period:" , Space , Str "." ] + , Para [ Str "Bang:" , Space , Str "!" ] + , Para [ Str "Plus:" , Space , Str "+" ] + , Para [ Str "Minus:" , Space , Str "-" ] , HorizontalRule - , Header 1 - ( "special-characters", [], [] ) - [ Str "Special", Space, Str "Characters" ] - , Para - [ Str "Here", Space, Str "is", Space, Str "some", Space, Str "unicode:" ] - , BulletList - [ - [ Plain [ Str "I", Space, Str "hat:", Space, Str "\206" ] ] - , - [ Plain [ Str "o", Space, Str "umlaut:", Space, Str "\246" ] ] - , - [ Plain [ Str "section:", Space, Str "\167" ] ] - , - [ Plain [ Str "set", Space, Str "membership:", Space, Str "\8712" ] ] - , - [ Plain [ Str "copyright:", Space, Str "\169" ] ] - ] - , Para - [ Str "AT&T" - , Space - , Str "has" - , Space - , Str "an" - , Space - , Str "ampersand" - , Space - , Str "in" - , Space - , Str "their" - , Space - , Str "name." - ] + , Header 1 ( "links" , [] , [] ) [ Str "Links" ] + , Header 2 ( "explicit" , [] , [] ) [ Str "Explicit" ] , Para - [ Str "AT&T" - , Space - , Str "is" - , Space - , Str "another" - , Space - , Str "way" - , Space - , Str "to" - , Space - , Str "write" - , Space - , Str "it." - ] + [ Str "Just" + , Space + , Str "a" + , Space + , Link ( "" , [] , [] ) [ Str "URL" ] ( "/url/" , "" ) + , Str "." + ] , Para - [ Str "This", Space, Str "&", Space, Str "that." ] + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title" ) + , Str "." + ] , Para - [ Str "4", Space, Str "<", Space, Str "5." ] + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title preceded by two spaces" ) + , Str "." + ] , Para - [ Str "6", Space, Str ">", Space, Str "5." ] + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title preceded by a tab" ) + , Str "." + ] , Para - [ Str "Backslash:", Space, Str "\\" ] + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title with \"quotes\" in it" ) + ] , Para - [ Str "Backtick:", Space, Str "`" ] + [ Link + ( "" , [] , [] ) + [ Str "URL" , Space , Str "and" , Space , Str "title" ] + ( "/url/" , "title with single quotes" ) + ] , Para - [ Str "Asterisk:", Space, Str "*" ] + [ Link + ( "" , [] , [] ) + [ Str "with_underscore" ] + ( "/url/with_underscore" , "" ) + ] , Para - [ Str "Underscore:", Space, Str "_" ] + [ Link + ( "" , [] , [] ) + [ Str "Email" , Space , Str "link" ] + ( "mailto:nobody@nowhere.net" , "" ) + ] , Para - [ Str "Left", Space, Str "brace:", Space, Str "{" ] + [ Link ( "" , [] , [] ) [ Str "Empty" ] ( "" , "" ) , Str "." ] + , Header 2 ( "reference" , [] , [] ) [ Str "Reference" ] , Para - [ Str "Right", Space, Str "brace:", Space, Str "}" ] + [ Str "Foo" + , Space + , Link ( "" , [] , [] ) [ Str "bar" ] ( "/url/" , "" ) + , Str "." + ] , Para - [ Str "Left", Space, Str "bracket:", Space, Str "[" ] + [ Str "With" + , Space + , Link + ( "" , [] , [] ) + [ Str "embedded" , Space , Str "[brackets]" ] + ( "/url/" , "" ) + , Str "." + ] , Para - [ Str "Right", Space, Str "bracket:", Space, Str "]" ] + [ Link ( "" , [] , [] ) [ Str "b" ] ( "/url/" , "" ) + , Space + , Str "by" + , Space + , Str "itself" + , Space + , Str "should" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] , Para - [ Str "Left", Space, Str "paren:", Space, Str "(" ] + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "once" ] ( "/url" , "" ) + , Str "." + ] , Para - [ Str "Right", Space, Str "paren:", Space, Str ")" ] + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "twice" ] ( "/url" , "" ) + , Str "." + ] , Para - [ Str "Greater-than:", Space, Str ">" ] + [ Str "Indented" + , Space + , Link ( "" , [] , [] ) [ Str "thrice" ] ( "/url" , "" ) + , Str "." + ] , Para - [ Str "Hash:", Space, Str "#" ] + [ Str "This" + , Space + , Str "should" + , Space + , Str "[not][]" + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "link." + ] + , CodeBlock ( "" , [] , [] ) "[not]: /url" , Para - [ Str "Period:", Space, Str "." ] + [ Str "Foo" + , Space + , Link + ( "" , [] , [] ) + [ Str "bar" ] + ( "/url/" , "Title with \"quotes\" inside" ) + , Str "." + ] , Para - [ Str "Bang:", Space, Str "!" ] + [ Str "Foo" + , Space + , Link + ( "" , [] , [] ) + [ Str "biz" ] + ( "/url/" , "Title with \"quote\" inside" ) + , Str "." + ] + , Header + 2 + ( "with-ampersands" , [] , [] ) + [ Str "With" , Space , Str "ampersands" ] , Para - [ Str "Plus:", Space, Str "+" ] + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Link + ( "" , [] , [] ) + [ Str "link" + , Space + , Str "with" + , Space + , Str "an" + , Space + , Str "ampersand" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "URL" + ] + ( "http://example.com/?foo=1&bar=2" , "" ) + , Str "." + ] , Para - [ Str "Minus:", Space, Str "-" ] - , HorizontalRule - , Header 1 - ( "links", [], [] ) - [ Str "Links" ] - , Header 2 - ( "explicit", [], [] ) - [ Str "Explicit" ] - , Para - [ Str "Just" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "URL" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title preceded by two spaces" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title preceded by a tab" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title with \"quotes\" in it" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "URL", Space, Str "and", Space, Str "title" ] - ( "/url/", "title with single quotes" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "with_underscore" ] - ( "/url/with_underscore", "" ) - ] - , Para - [ Link - ( "", [], [] ) - [ Str "Email", Space, Str "link" ] - ( "mailto:nobody@nowhere.net", "" ) - ] - , Para - [ Link ( "", [], [] ) [ Str "Empty" ] ( "", "" ), Str "." ] - , Header 2 - ( "reference", [], [] ) - [ Str "Reference" ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Str "With" - , Space - , Link - ( "", [], [] ) - [ Str "embedded", Space, Str "[brackets]" ] - ( "/url/", "" ) - , Str "." - ] - , Para - [ Link - ( "", [], [] ) - [ Str "b" ] - ( "/url/", "" ) - , Space - , Str "by" - , Space - , Str "itself" - , Space - , Str "should" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "once" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "twice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "Indented" - , Space - , Link - ( "", [], [] ) - [ Str "thrice" ] - ( "/url", "" ) - , Str "." - ] - , Para - [ Str "This" - , Space - , Str "should" - , Space - , Str "[not][]" - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "link." - ] - , CodeBlock - ( "", [], [] ) "[not]: /url" - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "bar" ] - ( "/url/", "Title with \"quotes\" inside" ) - , Str "." - ] - , Para - [ Str "Foo" - , Space - , Link - ( "", [], [] ) - [ Str "biz" ] - ( "/url/", "Title with \"quote\" inside" ) - , Str "." - ] - , Header 2 - ( "with-ampersands", [], [] ) - [ Str "With", Space, Str "ampersands" ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Link - ( "", [], [] ) - [ Str "link" + [ Str "Here\8217s" + , Space + , Str "a" + , Space + , Str "link" , Space , Str "with" , Space , Str "an" , Space - , Str "ampersand" + , Str "amersand" , Space , Str "in" , Space , Str "the" , Space - , Str "URL" - ] - ( "http://example.com/?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "a" - , Space - , Str "link" - , Space - , Str "with" - , Space - , Str "an" - , Space - , Str "amersand" - , Space - , Str "in" - , Space - , Str "the" - , Space - , Str "link" - , Space - , Str "text:" - , Space - , Link - ( "", [], [] ) - [ Str "AT&T" ] - ( "http://att.com/", "AT&T" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "inline", Space, Str "link" ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Para - [ Str "Here\8217s" - , Space - , Str "an" - , Space - , Link - ( "", [], [] ) - [ Str "inline" - , Space , Str "link" , Space - , Str "in" + , Str "text:" + , Space + , Link + ( "" , [] , [] ) [ Str "AT&T" ] ( "http://att.com/" , "AT&T" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Str "inline" , Space , Str "link" ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Para + [ Str "Here\8217s" + , Space + , Str "an" + , Space + , Link + ( "" , [] , [] ) + [ Str "inline" + , Space + , Str "link" + , Space + , Str "in" + , Space + , Str "pointy" + , Space + , Str "braces" + ] + ( "/script?foo=1&bar=2" , "" ) + , Str "." + ] + , Header 2 ( "autolinks" , [] , [] ) [ Str "Autolinks" ] + , Para + [ Str "With" + , Space + , Str "an" + , Space + , Str "ampersand:" , Space - , Str "pointy" - , Space - , Str "braces" - ] - ( "/script?foo=1&bar=2", "" ) - , Str "." - ] - , Header 2 - ( "autolinks", [], [] ) - [ Str "Autolinks" ] - , Para - [ Str "With" - , Space - , Str "an" - , Space - , Str "ampersand:" - , Space - , Link - ( "", [ "uri" ], [] ) - [ Str "http://example.com/?foo=1&bar=2" ] - ( "http://example.com/?foo=1&bar=2", "" ) - ] + , Link + ( "" , [ "uri" ] , [] ) + [ Str "http://example.com/?foo=1&bar=2" ] + ( "http://example.com/?foo=1&bar=2" , "" ) + ] , BulletList - [ - [ Plain [ Str "In", Space, Str "a", Space, Str "list?" ] ] - , - [ Plain - [ Link - ( "", [ "uri" ], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) + [ [ Plain [ Str "In" , Space , Str "a" , Space , Str "list?" ] ] + , [ Plain + [ Link + ( "" , [ "uri" ] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] ] + , [ Plain [ Str "It" , Space , Str "should." ] ] ] - , - [ Plain [ Str "It", Space, Str "should." ] ] - ] - , Para - [ Str "An" - , Space - , Str "e-mail" - , Space - , Str "address:" - , Space - , Link - ( "", [ "email" ], [] ) - [ Str "nobody@nowhere.net" ] - ( "mailto:nobody@nowhere.net", "" ) - ] - , BlockQuote - [ Para - [ Str "Blockquoted:" + , Para + [ Str "An" + , Space + , Str "e-mail" + , Space + , Str "address:" , Space , Link - ( "", [ "uri" ], [] ) - [ Str "http://example.com/" ] - ( "http://example.com/", "" ) - ] - ] - , Para - [ Str "Auto-links" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "occur" - , Space - , Str "here:" - , Space - , Code - ( "", [], [] ) "" - ] - , CodeBlock - ( "", [], [] ) "or here: " - , HorizontalRule - , Header 1 - ( "images", [], [] ) - [ Str "Images" ] - , Para - [ Str "From" - , Space - , Quoted DoubleQuote - [ Str "Voyage", Space, Str "dans", Space, Str "la", Space, Str "Lune" ] - , Space - , Str "by" - , Space - , Str "Georges" - , Space - , Str "Melies" - , Space - , Str "(1902):" - ] - , Para - [ Image - ( "", [], [] ) - [ Str "lalune" ] - ( "lalune.jpg", "fig:Voyage dans la Lune" ) - ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "movie" - , Space - , Image - ( "", [], [] ) - [ Str "movie" ] - ( "movie.jpg", "" ) - , Space - , Str "icon." - ] - , HorizontalRule - , Header 1 - ( "footnotes", [], [] ) - [ Str "Footnotes" ] - , Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference," - , Note - [ Para - [ Str "Here" - , Space - , Str "is" - , Space - , Str "the" - , Space - , Str "footnote." - , Space - , Str "It" - , Space - , Str "can" - , Space - , Str "go" - , Space - , Str "anywhere" - , Space - , Str "after" - , Space - , Str "the" - , Space - , Str "footnote" - , SoftBreak - , Str "reference." - , Space - , Str "It" - , Space - , Str "need" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "placed" - , Space - , Str "at" - , Space - , Str "the" - , Space - , Str "end" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "document." - ] + ( "" , [ "email" ] , [] ) + [ Str "nobody@nowhere.net" ] + ( "mailto:nobody@nowhere.net" , "" ) ] - , Space - , Str "and" - , Space - , Str "another." - , Note + , BlockQuote [ Para - [ Str "Here\8217s" - , Space - , Str "the" - , Space - , Str "long" - , Space - , Str "note." - , Space - , Str "This" - , Space - , Str "one" - , Space - , Str "contains" - , Space - , Str "multiple" - , SoftBreak - , Str "blocks." - ] - , Para - [ Str "Subsequent" - , Space - , Str "blocks" - , Space - , Str "are" - , Space - , Str "indented" - , Space - , Str "to" - , Space - , Str "show" - , Space - , Str "that" - , Space - , Str "they" - , Space - , Str "belong" - , Space - , Str "to" - , Space - , Str "the" - , SoftBreak - , Str "footnote" - , Space - , Str "(as" - , Space - , Str "with" - , Space - , Str "list" - , Space - , Str "items)." - ] - , CodeBlock - ( "", [], [] ) " { }" - , Para - [ Str "If" - , Space - , Str "you" - , Space - , Str "want," - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "indent" - , Space - , Str "every" - , Space - , Str "line," - , Space - , Str "but" - , Space - , Str "you" - , Space - , Str "can" - , Space - , Str "also" - , Space - , Str "be" - , SoftBreak - , Str "lazy" - , Space - , Str "and" - , Space - , Str "just" - , Space - , Str "indent" - , Space - , Str "the" - , Space - , Str "first" - , Space - , Str "line" - , Space - , Str "of" - , Space - , Str "each" - , Space - , Str "block." - ] + [ Str "Blockquoted:" + , Space + , Link + ( "" , [ "uri" ] , [] ) + [ Str "http://example.com/" ] + ( "http://example.com/" , "" ) + ] ] - , SoftBreak - , Str "This" - , Space - , Str "should" - , Space - , Emph - [ Str "not" ] - , Space - , Str "be" - , Space - , Str "a" - , Space - , Str "footnote" - , Space - , Str "reference," - , Space - , Str "because" - , Space - , Str "it" - , SoftBreak - , Str "contains" - , Space - , Str "a" - , Space - , Str "space.[^my" - , Space - , Str "note]" - , Space - , Str "Here" - , Space - , Str "is" - , Space - , Str "an" - , Space - , Str "inline" - , Space - , Str "note." - , Note - [ Para - [ Str "This" - , SoftBreak - , Str "is" - , Space - , Emph - [ Str "easier" ] - , Space - , Str "to" - , Space - , Str "type." - , Space - , Str "Inline" - , Space - , Str "notes" - , Space - , Str "may" - , Space - , Str "contain" - , SoftBreak - , Link - ( "", [], [] ) - [ Str "links" ] - ( "http://google.com", "" ) - , Space - , Str "and" - , Space - , Code - ( "", [], [] ) "]" - , Space - , Str "verbatim" - , Space - , Str "characters," - , SoftBreak - , Str "as" - , Space - , Str "well" - , Space - , Str "as" - , Space - , Str "[bracketed" - , Space - , Str "text]." - ] + , Para + [ Str "Auto-links" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "occur" + , Space + , Str "here:" + , Space + , Code ( "" , [] , [] ) "" ] - ] - , BlockQuote - [ Para - [ Str "Notes" + , CodeBlock ( "" , [] , [] ) "or here: " + , HorizontalRule + , Header 1 ( "images" , [] , [] ) [ Str "Images" ] + , Para + [ Str "From" , Space - , Str "can" + , Quoted + DoubleQuote + [ Str "Voyage" + , Space + , Str "dans" + , Space + , Str "la" + , Space + , Str "Lune" + ] , Space - , Str "go" + , Str "by" , Space - , Str "in" + , Str "Georges" + , Space + , Str "Melies" + , Space + , Str "(1902):" + ] + , Para + [ Image + ( "" , [] , [] ) + [ Str "lalune" ] + ( "lalune.jpg" , "fig:Voyage dans la Lune" ) + ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "movie" + , Space + , Image ( "" , [] , [] ) [ Str "movie" ] ( "movie.jpg" , "" ) + , Space + , Str "icon." + ] + , HorizontalRule + , Header 1 ( "footnotes" , [] , [] ) [ Str "Footnotes" ] + , Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Note + [ Para + [ Str "Here" + , Space + , Str "is" + , Space + , Str "the" + , Space + , Str "footnote." + , Space + , Str "It" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "anywhere" + , Space + , Str "after" + , Space + , Str "the" + , Space + , Str "footnote" + , SoftBreak + , Str "reference." + , Space + , Str "It" + , Space + , Str "need" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "placed" + , Space + , Str "at" + , Space + , Str "the" + , Space + , Str "end" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "document." + ] + ] + , Space + , Str "and" , Space - , Str "quotes." + , Str "another." , Note - [ Para [ Str "In", Space, Str "quote." ] ] + [ Para + [ Str "Here\8217s" + , Space + , Str "the" + , Space + , Str "long" + , Space + , Str "note." + , Space + , Str "This" + , Space + , Str "one" + , Space + , Str "contains" + , Space + , Str "multiple" + , SoftBreak + , Str "blocks." + ] + , Para + [ Str "Subsequent" + , Space + , Str "blocks" + , Space + , Str "are" + , Space + , Str "indented" + , Space + , Str "to" + , Space + , Str "show" + , Space + , Str "that" + , Space + , Str "they" + , Space + , Str "belong" + , Space + , Str "to" + , Space + , Str "the" + , SoftBreak + , Str "footnote" + , Space + , Str "(as" + , Space + , Str "with" + , Space + , Str "list" + , Space + , Str "items)." + ] + , CodeBlock ( "" , [] , [] ) " { }" + , Para + [ Str "If" + , Space + , Str "you" + , Space + , Str "want," + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "indent" + , Space + , Str "every" + , Space + , Str "line," + , Space + , Str "but" + , Space + , Str "you" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "be" + , SoftBreak + , Str "lazy" + , Space + , Str "and" + , Space + , Str "just" + , Space + , Str "indent" + , Space + , Str "the" + , Space + , Str "first" + , Space + , Str "line" + , Space + , Str "of" + , Space + , Str "each" + , Space + , Str "block." + ] + ] + , SoftBreak + , Str "This" + , Space + , Str "should" + , Space + , Emph [ Str "not" ] + , Space + , Str "be" + , Space + , Str "a" + , Space + , Str "footnote" + , Space + , Str "reference," + , Space + , Str "because" + , Space + , Str "it" + , SoftBreak + , Str "contains" + , Space + , Str "a" + , Space + , Str "space.[^my" + , Space + , Str "note]" + , Space + , Str "Here" + , Space + , Str "is" + , Space + , Str "an" + , Space + , Str "inline" + , Space + , Str "note." + , Note + [ Para + [ Str "This" + , SoftBreak + , Str "is" + , Space + , Emph [ Str "easier" ] + , Space + , Str "to" + , Space + , Str "type." + , Space + , Str "Inline" + , Space + , Str "notes" + , Space + , Str "may" + , Space + , Str "contain" + , SoftBreak + , Link + ( "" , [] , [] ) [ Str "links" ] ( "http://google.com" , "" ) + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "]" + , Space + , Str "verbatim" + , Space + , Str "characters," + , SoftBreak + , Str "as" + , Space + , Str "well" + , Space + , Str "as" + , Space + , Str "[bracketed" + , Space + , Str "text]." + ] + ] + ] + , BlockQuote + [ Para + [ Str "Notes" + , Space + , Str "can" + , Space + , Str "go" + , Space + , Str "in" + , Space + , Str "quotes." + , Note [ Para [ Str "In" , Space , Str "quote." ] ] + ] ] - ] , OrderedList - ( 1, Decimal, Period ) - [ - [ Plain - [ Str "And" - , Space - , Str "in" - , Space - , Str "list" - , Space - , Str "items." - , Note - [ Para [ Str "In", Space, Str "list." ] ] + ( 1 , Decimal , Period ) + [ [ Plain + [ Str "And" + , Space + , Str "in" + , Space + , Str "list" + , Space + , Str "items." + , Note [ Para [ Str "In" , Space , Str "list." ] ] + ] ] ] - ] - , Para - [ Str "This" - , Space - , Str "paragraph" - , Space - , Str "should" - , Space - , Str "not" - , Space - , Str "be" - , Space - , Str "part" - , Space - , Str "of" - , Space - , Str "the" - , Space - , Str "note," - , Space - , Str "as" - , Space - , Str "it" - , Space - , Str "is" - , Space - , Str "not" - , Space - , Str "indented." - ] + , Para + [ Str "This" + , Space + , Str "paragraph" + , Space + , Str "should" + , Space + , Str "not" + , Space + , Str "be" + , Space + , Str "part" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "note," + , Space + , Str "as" + , Space + , Str "it" + , Space + , Str "is" + , Space + , Str "not" + , Space + , Str "indented." + ] ] -- cgit v1.2.3 From 92abe458638d9824725ef8c70eb3613f5cc89217 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 29 Sep 2021 08:28:54 -0700 Subject: Further test updates for switch to pretty-show. --- test/command/3123.md | 2 +- test/command/3537.md | 8 ++++++- test/command/3587.md | 24 ++++++++------------ test/command/3983.md | 6 ++--- test/command/4183.md | 2 +- test/command/4742.md | 21 +++++++++-------- test/command/4819.md | 3 ++- test/command/4848.md | 36 ++++++++++++++--------------- test/command/4928.md | 47 +++++++++++++++++++------------------- test/command/html-read-figure.md | 4 +++- test/command/latex-color.md | 26 ++++++++++----------- test/command/refs.md | 49 ++++++++++++++++++++-------------------- 12 files changed, 114 insertions(+), 114 deletions(-) diff --git a/test/command/3123.md b/test/command/3123.md index 14f207e39..a97165bc8 100644 --- a/test/command/3123.md +++ b/test/command/3123.md @@ -2,7 +2,7 @@ % pandoc -f markdown -t native ^D -[ RawBlock ( Format "html" ) "" ] +[ RawBlock (Format "html") "" ] ``` ``` diff --git a/test/command/3537.md b/test/command/3537.md index 98704c930..3f4445343 100644 --- a/test/command/3537.md +++ b/test/command/3537.md @@ -14,7 +14,13 @@ foo bar % pandoc -t native Hi `there`{=ms}. ^D -[ Para [ Str "Hi", Space, RawInline ( Format "ms" ) "there", Str "." ] ] +[ Para + [ Str "Hi" + , Space + , RawInline (Format "ms") "there" + , Str "." + ] +] ```` ```` diff --git a/test/command/3587.md b/test/command/3587.md index 88f009900..0a3c389b9 100644 --- a/test/command/3587.md +++ b/test/command/3587.md @@ -122,13 +122,11 @@ \SIrange{10}{20}{\cubic\meter} ^D [ Para - [ Str "10\160m" - , Superscript - [ Str "3" ] - , Str "\8211\&20\160m" - , Superscript - [ Str "3" ] - ] + [ Str "10\160m" + , Superscript [ Str "3" ] + , Str "\8211\&20\160m" + , Superscript [ Str "3" ] + ] ] ``` @@ -164,13 +162,11 @@ \SIrange{10}{20}{\meter\cubed} ^D [ Para - [ Str "10\160m" - , Superscript - [ Str "3" ] - , Str "\8211\&20\160m" - , Superscript - [ Str "3" ] - ] + [ Str "10\160m" + , Superscript [ Str "3" ] + , Str "\8211\&20\160m" + , Superscript [ Str "3" ] + ] ] ``` diff --git a/test/command/3983.md b/test/command/3983.md index c13aea850..82c1deef0 100644 --- a/test/command/3983.md +++ b/test/command/3983.md @@ -5,10 +5,8 @@ \graphicspath\expandafter{\expandafter{\filename@area}}% \makeatother ^D -[ RawBlock - ( Format "latex" ) "\\makeatletter" -, RawBlock - ( Format "latex" ) "\\makeatother" +[ RawBlock (Format "latex") "\\makeatletter" +, RawBlock (Format "latex") "\\makeatother" ] ``` diff --git a/test/command/4183.md b/test/command/4183.md index 0fa940a63..8d6c65a01 100644 --- a/test/command/4183.md +++ b/test/command/4183.md @@ -4,7 +4,7 @@ bar ^D -[ Para [ Image ( "", [], [] ) [] ( "foo", "fig:" ) ] ] +[ Para [ Image ( "" , [] , [] ) [] ( "foo" , "fig:" ) ] ] ``` ``` diff --git a/test/command/4742.md b/test/command/4742.md index f3f4bf7ae..a91dffb33 100644 --- a/test/command/4742.md +++ b/test/command/4742.md @@ -5,16 +5,17 @@ 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" - ] +[ Header + 1 + ( "non-ascii--raksmorgas" , [] , [] ) + [ Str "non" + , Space + , Str "ascii" + , Space + , Str "\9888\65039" + , Space + , Str "r\228ksm\246rg\229s" + ] ] ``` diff --git a/test/command/4819.md b/test/command/4819.md index eb964efba..c7cd9a90a 100644 --- a/test/command/4819.md +++ b/test/command/4819.md @@ -38,7 +38,8 @@ foo: FALSE ... ^D Pandoc - ( Meta { unMeta = fromList [ ( "foo", MetaBool False ) ] } ) [] + Meta { unMeta = fromList [ ( "foo" , MetaBool False ) ] } + [] ``` ``` diff --git a/test/command/4848.md b/test/command/4848.md index 54692ff09..c73699a3c 100644 --- a/test/command/4848.md +++ b/test/command/4848.md @@ -50,27 +50,25 @@ Lorem ipsum \blockcquote[198]{Knu86}{dolor sit amet} consectetuer. ^D -[ Para - [ Str "Lorem", Space, Str "ipsum" ] +[ Para [ Str "Lorem" , Space , Str "ipsum" ] , BlockQuote - [ Para - [ Str "dolor", Space, Str "sit", Space, Str "amet" ] - , Para - [ Cite - [ Citation - { citationId = "Knu86" - , citationPrefix = [] - , citationSuffix = - [ Str "198" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - ] [] + [ Para + [ Str "dolor" , Space , Str "sit" , Space , Str "amet" ] + , Para + [ Cite + [ Citation + { citationId = "Knu86" + , citationPrefix = [] + , citationSuffix = [ Str "198" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [] + ] ] - ] -, Para - [ Str "consectetuer." ] +, Para [ Str "consectetuer." ] ] ``` diff --git a/test/command/4928.md b/test/command/4928.md index b35e17d4f..86699aab5 100644 --- a/test/command/4928.md +++ b/test/command/4928.md @@ -128,31 +128,30 @@ \cites(multipostnote)[23][42]{Knu86}[65]{Nie72} ^D [ Para - [ Cite - [ Citation - { citationId = "Knu86" - , citationPrefix = - [ Str "23" ] - , citationSuffix = - [ Str "42" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - , Citation - { citationId = "Nie72" - , citationPrefix = [] - , citationSuffix = - [ Str "65", Str ",", Space, Str "multipostnote" ] - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - ] - [ RawInline - ( Format "latex" ) "\\cites(multipostnote)[23][42]{Knu86}[65]{Nie72}" + [ Cite + [ Citation + { citationId = "Knu86" + , citationPrefix = [ Str "23" ] + , citationSuffix = [ Str "42" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + , Citation + { citationId = "Nie72" + , citationPrefix = [] + , citationSuffix = + [ Str "65" , Str "," , Space , Str "multipostnote" ] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + [ RawInline + (Format "latex") + "\\cites(multipostnote)[23][42]{Knu86}[65]{Nie72}" + ] ] - ] ] ``` diff --git a/test/command/html-read-figure.md b/test/command/html-read-figure.md index dd9c8d9d9..d7eb96bb4 100644 --- a/test/command/html-read-figure.md +++ b/test/command/html-read-figure.md @@ -20,7 +20,9 @@ ^D [ Para - [ Image ( "", [], [] ) [ Str "bar" ] ( "foo.png", "fig:voyage" ) ] + [ Image + ( "" , [] , [] ) [ Str "bar" ] ( "foo.png" , "fig:voyage" ) + ] ] ``` diff --git a/test/command/latex-color.md b/test/command/latex-color.md index a1f2c3f2a..97d7f84c0 100644 --- a/test/command/latex-color.md +++ b/test/command/latex-color.md @@ -85,16 +85,14 @@ Hello \textcolor{blue}{\textbf{World}}. } some more text ^D [ Div - ( "", [], [ ( "style", "color: blue" ) ] ) - [ BulletList - [ - [ Para [ Str "Item", Space, Str "1" ] ] - , - [ Para [ Str "Item", Space, Str "2" ] ] + ( "" , [] , [ ( "style" , "color: blue" ) ] ) + [ BulletList + [ [ Para [ Str "Item" , Space , Str "1" ] ] + , [ Para [ Str "Item" , Space , Str "2" ] ] + ] ] - ] , Para - [ Str "some", Space, Str "more", Space, Str "text" ] + [ Str "some" , Space , Str "more" , Space , Str "text" ] ] ``` @@ -120,12 +118,12 @@ Hello \colorbox{red}{World} \colorbox{red}{Hello} World ^D [ Para - [ Span - ( "", [], [ ( "style", "background-color: red" ) ] ) - [ Str "Hello" ] - , Space - , Str "World" - ] + [ Span + ( "" , [] , [ ( "style" , "background-color: red" ) ] ) + [ Str "Hello" ] + , Space + , Str "World" + ] ] ``` diff --git a/test/command/refs.md b/test/command/refs.md index d89e745ff..fb362febe 100644 --- a/test/command/refs.md +++ b/test/command/refs.md @@ -116,31 +116,32 @@ Accuracy~\eqref{eq:Accuracy} is the proportion, measuring true results among all Figure \ref{fig:Logo} illustrated the SVG logo ^D [ Para - [ Image - ( "fig:Logo", [], [] ) - [ Str "Logo" ] - ( "command/SVG_logo.svg", "fig:" ) - ] + [ Image + ( "fig:Logo" , [] , [] ) + [ Str "Logo" ] + ( "command/SVG_logo.svg" , "fig:" ) + ] , Para - [ Str "Figure" - , Space - , Link - ( "" - , [] - , - [ ( "reference-type", "ref" ), ( "reference", "fig:Logo" ) ] - ) - [ Str "1" ] - ( "#fig:Logo", "" ) - , Space - , Str "illustrated" - , Space - , Str "the" - , Space - , Str "SVG" - , Space - , Str "logo" - ] + [ Str "Figure" + , Space + , Link + ( "" + , [] + , [ ( "reference-type" , "ref" ) + , ( "reference" , "fig:Logo" ) + ] + ) + [ Str "1" ] + ( "#fig:Logo" , "" ) + , Space + , Str "illustrated" + , Space + , Str "the" + , Space + , Str "SVG" + , Space + , Str "logo" + ] ] ``` -- cgit v1.2.3 From 45db998b397b7d8b38bf28d73f4e6455be420ea4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 29 Sep 2021 08:29:14 -0700 Subject: EPUB writer: treat epub:type "frontispiece" as front matter. This allows you to include a frontispiece using ``` ![](yourimage.jpg) etc. ``` Closes #7600. --- MANUAL.txt | 1 + src/Text/Pandoc/Writers/EPUB.hs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/MANUAL.txt b/MANUAL.txt index 7793b509c..54eb96467 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -6278,6 +6278,7 @@ halftitlepage frontmatter seriespage frontmatter foreword frontmatter preface frontmatter +frontispiece frontmatter appendix backmatter colophon backmatter bibliography backmatter diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index d77a038ba..86a7646e6 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -659,7 +659,7 @@ pandocToEPUB version opts doc = do "contributors", "other-credits", "errata", "revision-history", "titlepage", "halftitlepage", "seriespage", - "foreword", "preface", + "foreword", "preface", "frontispiece", "seriespage", "titlepage"] backMatterTypes = ["appendix", "colophon", "bibliography", "index"] -- cgit v1.2.3 From 472b33095e1feb42fa96e32271888a3152e36cea Mon Sep 17 00:00:00 2001 From: Ezwal <15009992+Ezwal@users.noreply.github.com> Date: Wed, 29 Sep 2021 15:42:37 +0200 Subject: Docx reader: Add placeholder for word diagram --- src/Text/Pandoc/Readers/Docx.hs | 3 +++ src/Text/Pandoc/Readers/Docx/Parse.hs | 14 ++++++++++++++ test/docx/diagram.docx | Bin 0 -> 22716 bytes test/docx/diagram.native | 2 ++ 4 files changed, 19 insertions(+) create mode 100644 test/docx/diagram.docx create mode 100644 test/docx/diagram.native diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index c06adf7e3..dd6f39431 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -322,6 +322,7 @@ runToInlines (InlineDrawing fp title alt bs ext) = do (lift . lift) $ P.insertMedia fp Nothing bs return $ imageWith (extentToAttr ext) (T.pack fp) title $ text alt runToInlines InlineChart = return $ spanWith ("", ["chart"], []) $ text "[CHART]" +runToInlines InlineDiagram = return $ spanWith ("", ["diagram"], []) $ text "[DIAGRAM]" extentToAttr :: Extent -> Attr extentToAttr (Just (w, h)) = @@ -434,6 +435,8 @@ parPartToInlines' (Drawing fp title alt bs ext) = do return $ imageWith (extentToAttr ext) (T.pack fp) title $ text alt parPartToInlines' Chart = return $ spanWith ("", ["chart"], []) $ text "[CHART]" +parPartToInlines' Diagram = + return $ spanWith ("", ["diagram"], []) $ text "[DIAGRAM]" parPartToInlines' (InternalHyperLink anchor runs) = do ils <- smushInlines <$> mapM runToInlines runs return $ link ("#" <> anchor) "" ils diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index eb048ab14..5f29ac41a 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -322,6 +322,7 @@ data ParPart = PlainRun Run | ExternalHyperLink URL [Run] | Drawing FilePath T.Text T.Text B.ByteString Extent -- title, alt | Chart -- placeholder for now + | Diagram -- placeholder for now | PlainOMath [Exp] | Field FieldInfo [Run] | NullParPart -- when we need to return nothing, but @@ -333,6 +334,7 @@ data Run = Run RunStyle [RunElem] | Endnote [BodyPart] | InlineDrawing FilePath T.Text T.Text B.ByteString Extent -- title, alt | InlineChart -- placeholder + | InlineDiagram -- placeholder deriving Show data RunElem = TextRun T.Text | LnBrk | Tab | SoftHyphen | NoBreakHyphen @@ -821,6 +823,13 @@ elemToParPart ns element , Just imagedataElem <- findChildByName ns "v" "imagedata" shapeElem , Just drawingId <- findAttrByName ns "r" "id" imagedataElem = expandDrawingId drawingId >>= (\(fp, bs) -> return $ Drawing fp "" "" bs Nothing) +-- Diagram +elemToParPart ns element + | isElem ns "w" "r" element + , Just drawingElem <- findChildByName ns "w" "drawing" element + , d_ns <- "http://schemas.openxmlformats.org/drawingml/2006/diagram" + , Just _ <- findElement (QName "relIds" (Just d_ns) (Just "dgm")) drawingElem + = return Diagram -- Chart elemToParPart ns element | isElem ns "w" "r" element @@ -987,6 +996,11 @@ childElemToRun ns element , c_ns <- "http://schemas.openxmlformats.org/drawingml/2006/chart" , Just _ <- findElement (QName "chart" (Just c_ns) (Just "c")) element = return InlineChart +childElemToRun ns element + | isElem ns "w" "drawing" element + , c_ns <- "http://schemas.openxmlformats.org/drawingml/2006/diagram" + , Just _ <- findElement (QName "relIds" (Just c_ns) (Just "dgm")) element + = return InlineDiagram childElemToRun ns element | isElem ns "w" "footnoteReference" element , Just fnId <- findAttrByName ns "w" "id" element = do diff --git a/test/docx/diagram.docx b/test/docx/diagram.docx new file mode 100644 index 000000000..462cf8028 Binary files /dev/null and b/test/docx/diagram.docx differ diff --git a/test/docx/diagram.native b/test/docx/diagram.native new file mode 100644 index 000000000..0510497dc --- /dev/null +++ b/test/docx/diagram.native @@ -0,0 +1,2 @@ +[Header 1 ("diagram-after",[],[]) [Str "Diagram",Space,Str "after:"] +,Para [Span ("",["diagram"],[]) [Str "[DIAGRAM]"]]] -- cgit v1.2.3 From 75d551f65b8bc63671bf3bdeeb9cb9f7dd00de8a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 30 Sep 2021 13:08:13 -0700 Subject: Add `footnotes` to default `gfm` etxensions. Now that `gfm` supports footnotes. https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/ --- src/Text/Pandoc/Extensions.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index b6d496eec..831190e33 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -353,6 +353,7 @@ getDefaultExtensions "gfm" = extensionsFromList , Ext_task_lists , Ext_emoji , Ext_yaml_metadata_block + , Ext_footnotes ] getDefaultExtensions "commonmark" = extensionsFromList [Ext_raw_html] -- cgit v1.2.3 From 021cdb543b00995f86eefd5d84314d9e1f5abf82 Mon Sep 17 00:00:00 2001 From: nuew Date: Fri, 11 Jun 2021 20:09:06 -0400 Subject: epub: Add EPUB3 subject metadata (authority/term) This adds the ability to specify EPUB 3 `authority` and `term` specific refinements to the `subject` tag. Specifying a plain `subject` tag in metadata will function as before. --- MANUAL.txt | 10 ++++++++-- src/Text/Pandoc/Writers/EPUB.hs | 41 +++++++++++++++++++++++++++++++---------- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 54eb96467..7caedc94a 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -2189,7 +2189,7 @@ Currently the following pipes are predefined: and AsciiDoc metadata; repeat as for `author`, above `subject` -: document subject, included in ODT, PDF, docx and pptx metadata +: document subject, included in ODT, PDF, docx, EPUB, and pptx metadata `description` : document description, included in ODT, docx and pptx metadata. Some @@ -6189,7 +6189,12 @@ The following fields are recognized: language if nothing is specified. `subject` - ~ A string value or a list of such values. + ~ Either a string value, or an object with fields `text`, `authority`, + and `term`, or a list of such objects. Valid values for `authority` + are either a [reserved authority value] (currently `AAT`, `BIC`, + `BISAC`, `CLC`, `DDC`, `CLIL`, `EuroVoc`, `MEDTOP`, `LCSH`, `NDC`, + `Thema`, `UDC`, and `WGS`) or an absolute IRI identifying a custom + scheme. Valid values for `term` are defined by the scheme. `description` ~ A string value. @@ -6239,6 +6244,7 @@ The following fields are recognized: - `scroll-axis`: `vertical`|`horizontal`|`default` [MARC relators]: https://loc.gov/marc/relators/relaterm.html +[reserved authority value]: https://idpf.github.io/epub-registries/authorities/ [`spine` element]: http://idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem ## The `epub:type` attribute diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 86a7646e6..d1417ff48 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -79,7 +79,7 @@ data EPUBMetadata = EPUBMetadata{ , epubLanguage :: Text , epubCreator :: [Creator] , epubContributor :: [Creator] - , epubSubject :: [Text] + , epubSubject :: [Subject] , epubDescription :: Maybe Text , epubType :: Maybe Text , epubFormat :: Maybe Text @@ -121,6 +121,12 @@ data Title = Title{ data ProgressionDirection = LTR | RTL deriving Show +data Subject = Subject{ + subjectText :: Text + , subjectAuthority :: Maybe Text + , subjectTerm :: Maybe Text + } deriving Show + dcName :: Text -> QName dcName n = QName n Nothing (Just "dc") @@ -232,7 +238,11 @@ addMetadataFromXML e@(Element (QName name _ (Just "dc")) attrs _ _) md , creatorRole = getAttr "role" , creatorFileAs = getAttr "file-as" } : epubContributor md } - | name == "subject" = md{ epubSubject = strContent e : epubSubject md } + | name == "subject" = md{ epubSubject = + Subject { subjectText = strContent e + , subjectAuthority = getAttr "authority" + , subjectTerm = getAttr "term" + } : epubSubject md } | name == "description" = md { epubDescription = Just $ strContent e } | name == "type" = md { epubType = Just $ strContent e } | name == "format" = md { epubFormat = Just $ strContent e } @@ -313,12 +323,13 @@ getDate s meta = getList s meta handleMetaValue handleMetaValue mv = Date { dateText = fromMaybe "" $ normalizeDate' $ metaValueToString mv , dateEvent = Nothing } -simpleList :: T.Text -> Meta -> [Text] -simpleList s meta = - case lookupMeta s meta of - Just (MetaList xs) -> map metaValueToString xs - Just x -> [metaValueToString x] - Nothing -> [] +getSubject :: T.Text -> Meta -> [Subject] +getSubject s meta = getList s meta handleMetaValue + where handleMetaValue (MetaMap m) = + Subject{ subjectText = maybe "" metaValueToString $ M.lookup "text" m + , subjectAuthority = metaValueToString <$> M.lookup "authority" m + , subjectTerm = metaValueToString <$> M.lookup "term" m } + handleMetaValue mv = Subject (metaValueToString mv) Nothing Nothing metadataFromMeta :: WriterOptions -> Meta -> EPUBMetadata metadataFromMeta opts meta = EPUBMetadata{ @@ -352,7 +363,7 @@ metadataFromMeta opts meta = EPUBMetadata{ lookupMeta "language" meta `mplus` lookupMeta "lang" meta creators = getCreator "creator" meta contributors = getCreator "contributor" meta - subjects = simpleList "subject" meta + subjects = getSubject "subject" meta description = metaValueToString <$> lookupMeta "description" meta epubtype = metaValueToString <$> lookupMeta "type" meta format = metaValueToString <$> lookupMeta "format" meta @@ -974,7 +985,7 @@ metadataElement version md currentTime = epubCreator md contributorNodes = withIds "epub-contributor" (toCreatorNode "contributor") $ epubContributor md - subjectNodes = map (dcTag "subject") $ epubSubject md + subjectNodes = withIds "subject" toSubjectNode $ epubSubject md descriptionNodes = maybe [] (dcTag' "description") $ epubDescription md typeNodes = maybe [] (dcTag' "type") $ epubType md formatNodes = maybe [] (dcTag' "format") $ epubFormat md @@ -1046,6 +1057,16 @@ metadataElement version md currentTime = (("id",id') : maybe [] (\x -> [("opf:event",x)]) (dateEvent date)) $ dateText date] + toSubjectNode id' subject + | version == EPUB2 = [dcNode "subject" ! + [("id",id')] $ subjectText subject] + | otherwise = (dcNode "subject" ! [("id",id')] $ subjectText subject) + : maybe [] (\x -> (unode "meta" ! + [("refines", "#" <> id'),("property","authority")] $ x) : + maybe [] (\y -> [unode "meta" ! + [("refines", "#" <> id'),("property","term")] $ y]) + (subjectTerm subject)) + (subjectAuthority subject) schemeToOnix :: Text -> Text schemeToOnix "ISBN-10" = "02" schemeToOnix "GTIN-13" = "03" -- cgit v1.2.3 From fb0d6c7cb63a791fa72becf21ed493282e65ea91 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 1 Oct 2021 15:42:00 -0700 Subject: Depend on pandoc-types 1.23, remove Null constructor on Block. --- pandoc.cabal | 4 ++-- src/Text/Pandoc/Lua/Marshaling/AST.hs | 2 -- src/Text/Pandoc/Shared.hs | 1 - src/Text/Pandoc/Writers/AsciiDoc.hs | 1 - src/Text/Pandoc/Writers/ConTeXt.hs | 1 - src/Text/Pandoc/Writers/Custom.hs | 2 -- src/Text/Pandoc/Writers/Docbook.hs | 1 - src/Text/Pandoc/Writers/Docx.hs | 1 - src/Text/Pandoc/Writers/DokuWiki.hs | 2 -- src/Text/Pandoc/Writers/FB2.hs | 1 - src/Text/Pandoc/Writers/HTML.hs | 1 - src/Text/Pandoc/Writers/Haddock.hs | 1 - src/Text/Pandoc/Writers/ICML.hs | 1 - src/Text/Pandoc/Writers/JATS.hs | 1 - src/Text/Pandoc/Writers/Jira.hs | 1 - src/Text/Pandoc/Writers/LaTeX.hs | 1 - src/Text/Pandoc/Writers/Man.hs | 1 - src/Text/Pandoc/Writers/Markdown.hs | 3 +-- src/Text/Pandoc/Writers/MediaWiki.hs | 2 -- src/Text/Pandoc/Writers/Ms.hs | 1 - src/Text/Pandoc/Writers/Muse.hs | 1 - src/Text/Pandoc/Writers/OpenDocument.hs | 1 - src/Text/Pandoc/Writers/Org.hs | 1 - src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 1 - src/Text/Pandoc/Writers/RST.hs | 1 - src/Text/Pandoc/Writers/RTF.hs | 1 - src/Text/Pandoc/Writers/TEI.hs | 1 - src/Text/Pandoc/Writers/Texinfo.hs | 2 -- src/Text/Pandoc/Writers/Textile.hs | 2 -- src/Text/Pandoc/Writers/XWiki.hs | 2 -- src/Text/Pandoc/Writers/ZimWiki.hs | 2 -- stack.yaml | 9 +++++++-- 32 files changed, 10 insertions(+), 43 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index f317c3302..a55dbcc22 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -561,7 +561,7 @@ library mtl >= 2.2 && < 2.3, network >= 2.6, network-uri >= 2.6 && < 2.8, - pandoc-types >= 1.22 && < 1.23, + pandoc-types >= 1.23 && < 1.24, parsec >= 3.1 && < 3.2, process >= 1.2.3 && < 1.7, random >= 1 && < 1.3, @@ -848,7 +848,7 @@ test-suite test-pandoc filepath >= 1.1 && < 1.5, hslua >= 1.1 && < 1.4, mtl >= 2.2 && < 2.3, - pandoc-types >= 1.22 && < 1.23, + pandoc-types >= 1.23 && < 1.24, process >= 1.2.3 && < 1.7, tasty >= 0.11 && < 1.5, tasty-golden >= 2.3 && < 2.4, diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 8e12d232c..a1ad2cda3 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -165,7 +165,6 @@ pushBlock = \case LineBlock blcks -> pushViaConstructor "LineBlock" blcks OrderedList lstAttr list -> pushViaConstructor "OrderedList" list (LuaListAttributes lstAttr) - Null -> pushViaConstructor "Null" Para blcks -> pushViaConstructor "Para" blcks Plain blcks -> pushViaConstructor "Plain" blcks RawBlock f cs -> pushViaConstructor "RawBlock" f cs @@ -189,7 +188,6 @@ peekBlock idx = defineHowTo "get Block value" $! do "OrderedList" -> (\(LuaListAttributes lstAttr, lst) -> OrderedList lstAttr lst) <$!> elementContent - "Null" -> return Null "Para" -> Para <$!> elementContent "Plain" -> Plain <$!> elementContent "RawBlock" -> uncurry RawBlock <$!> elementContent diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 920edca7b..7bb830d0e 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -948,7 +948,6 @@ blockToInlines (Table _ _ _ (TableHead _ hbd) bodies (TableFoot _ fbd)) = unTableBody (TableBody _ _ hd bd) = hd <> bd unTableBodies = concatMap unTableBody blockToInlines (Div _ blks) = blocksToInlines' blks -blockToInlines Null = mempty blocksToInlinesWithSep :: Inlines -> [Block] -> Inlines blocksToInlinesWithSep sep = diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index bcef4a089..f0973178e 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -140,7 +140,6 @@ blockToAsciiDoc :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> ADW m (Doc Text) -blockToAsciiDoc _ Null = return empty blockToAsciiDoc opts (Div (id',"section":_,_) (Header level (_,cls,kvs) ils : xs)) = do hdr <- blockToAsciiDoc opts (Header level (id',cls,kvs) ils) diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index 3cafcefba..0150f7dff 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -154,7 +154,6 @@ toLabel z = T.concatMap go z -- | Convert Pandoc block element to ConTeXt. blockToConTeXt :: PandocMonad m => Block -> WM m (Doc Text) -blockToConTeXt Null = return empty blockToConTeXt (Div attr@(_,"section":_,_) (Header level _ title' : xs)) = do header' <- sectionHeader attr level title' diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs index 1e9f37d2f..d207f5093 100644 --- a/src/Text/Pandoc/Writers/Custom.hs +++ b/src/Text/Pandoc/Writers/Custom.hs @@ -116,8 +116,6 @@ docToCustom opts (Pandoc (Meta metamap) blocks) = do blockToCustom :: Block -- ^ Block element -> Lua String -blockToCustom Null = return "" - blockToCustom (Plain inlines) = Lua.callFunc "Plain" (Stringify inlines) blockToCustom (Para [Image attr txt (src,tit)]) = diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index 33a6f5f0c..3cb68c311 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -165,7 +165,6 @@ imageToDocbook _ attr src = selfClosingTag "imagedata" $ -- | Convert a Pandoc block element to Docbook. blockToDocbook :: PandocMonad m => WriterOptions -> Block -> DB m (Doc Text) -blockToDocbook _ Null = return empty -- Add ids to paragraphs in divs with ids - this is needed for -- pandoc-citeproc to get link anchors in bibliographies: blockToDocbook opts (Div (id',"section":_,_) (Header lvl (_,_,attrs) ils : xs)) = do diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 686a2f662..a3949792d 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -800,7 +800,6 @@ blockToOpenXML :: (PandocMonad m) => WriterOptions -> Block -> WS m [Content] blockToOpenXML opts blk = withDirection $ blockToOpenXML' opts blk blockToOpenXML' :: (PandocMonad m) => WriterOptions -> Block -> WS m [Content] -blockToOpenXML' _ Null = return [] blockToOpenXML' opts (Div (ident,_classes,kvs) bs) = do stylemod <- case lookup dynamicStyleKey kvs of Just (fromString . T.unpack -> sty) -> do diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index 602c70ebe..5fe64717a 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -98,8 +98,6 @@ blockToDokuWiki :: PandocMonad m -> Block -- ^ Block element -> DokuWiki m Text -blockToDokuWiki _ Null = return "" - blockToDokuWiki opts (Div _attrs bs) = do contents <- blockListToDokuWiki opts bs return $ contents <> "\n" diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs index 6bad37404..f393f031f 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -358,7 +358,6 @@ blockToXml (Table _ blkCapt specs thead tbody tfoot) = do align_str AlignCenter = "center" align_str AlignRight = "right" align_str AlignDefault = "left" -blockToXml Null = return [] -- Replace plain text with paragraphs and add line break after paragraphs. -- It is used to convert plain text from tight list items to paragraphs. diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 8fc81ed24..5992c994f 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -730,7 +730,6 @@ adjustNumbers opts doc = showSecNum = T.intercalate "." . map tshow blockToHtmlInner :: PandocMonad m => WriterOptions -> Block -> StateT WriterState m Html -blockToHtmlInner _ Null = return mempty blockToHtmlInner opts (Plain lst) = inlineListToHtml opts lst blockToHtmlInner opts (Para [Image attr@(_,classes,_) txt (src,tit)]) | "stretch" `elem` classes = do diff --git a/src/Text/Pandoc/Writers/Haddock.hs b/src/Text/Pandoc/Writers/Haddock.hs index 75e14714b..9a61c339a 100644 --- a/src/Text/Pandoc/Writers/Haddock.hs +++ b/src/Text/Pandoc/Writers/Haddock.hs @@ -90,7 +90,6 @@ blockToHaddock :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> StateT WriterState m (Doc Text) -blockToHaddock _ Null = return empty blockToHaddock opts (Div _ ils) = do contents <- blockListToHaddock opts ils return $ contents <> blankline diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs index c254fbc58..8da931406 100644 --- a/src/Text/Pandoc/Writers/ICML.hs +++ b/src/Text/Pandoc/Writers/ICML.hs @@ -381,7 +381,6 @@ blockToICML opts style (Table _ blkCapt specs thead tbody tfoot) = blockToICML opts style (Div (_ident, _, kvs) lst) = let dynamicStyle = maybeToList $ lookup dynamicStyleKey kvs in blocksToICML opts (dynamicStyle <> style) lst -blockToICML _ _ Null = return empty -- | Convert a list of lists of blocks to ICML list items. listItemsToICML :: PandocMonad m => WriterOptions -> Text -> Style -> Maybe ListAttributes -> [[Block]] -> WS m (Doc Text) diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs index 9db8723d1..f20178bd1 100644 --- a/src/Text/Pandoc/Writers/JATS.hs +++ b/src/Text/Pandoc/Writers/JATS.hs @@ -251,7 +251,6 @@ codeAttr opts (ident,classes,kvs) = (lang, attr) -- | Convert a Pandoc block element to JATS. blockToJATS :: PandocMonad m => WriterOptions -> Block -> JATS m (Doc Text) -blockToJATS _ Null = return empty blockToJATS opts (Div (id',"section":_,kvs) (Header _lvl _ ils : xs)) = do let idAttr = [ ("id", writerIdentifierPrefix opts <> escapeNCName id') | not (T.null id')] diff --git a/src/Text/Pandoc/Writers/Jira.hs b/src/Text/Pandoc/Writers/Jira.hs index 1351814e9..709064270 100644 --- a/src/Text/Pandoc/Writers/Jira.hs +++ b/src/Text/Pandoc/Writers/Jira.hs @@ -103,7 +103,6 @@ toJiraBlocks blocks = do Para xs -> singleton . Jira.Para <$> toJiraInlines xs Plain xs -> singleton . Jira.Para <$> toJiraInlines xs RawBlock fmt cs -> rawBlockToJira fmt cs - Null -> return mempty Table _ blkCapt specs thead tbody tfoot -> singleton <$> do let (_, _, _, hd, body) = toLegacyTable blkCapt specs thead tbody tfoot headerRow <- if all null hd diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 8c45c8db5..144c3d579 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -253,7 +253,6 @@ isListBlock _ = False blockToLaTeX :: PandocMonad m => Block -- ^ Block to convert -> LW m (Doc Text) -blockToLaTeX Null = return empty blockToLaTeX (Div attr@(identifier,"block":dclasses,_) (Header _ _ ils : bs)) = do let blockname diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 87b2d8d21..45516ea06 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -106,7 +106,6 @@ blockToMan :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> StateT WriterState m (Doc Text) -blockToMan _ Null = return empty blockToMan opts (Div _ bs) = blockListToMan opts bs blockToMan opts (Plain inlines) = liftM vcat $ mapM (inlineListToMan opts) $ splitSentences inlines diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index fda2bbcef..49fb873a9 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -313,7 +313,6 @@ blockToMarkdown' :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> MD m (Doc Text) -blockToMarkdown' _ Null = return empty blockToMarkdown' opts (Div attrs ils) = do contents <- blockListToMarkdown opts ils variant <- asks envVariant @@ -812,7 +811,7 @@ blockListToMarkdown opts blocks = do isListBlock (DefinitionList _) = True isListBlock _ = False commentSep - | variant == PlainText = Null + | variant == PlainText = RawBlock "html" "\n" | isEnabled Ext_raw_html opts = RawBlock "html" "\n" | otherwise = RawBlock "markdown" " \n" mconcat <$> mapM (blockToMarkdown opts) (fixBlocks blocks) diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index 5029be69f..899e40418 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -81,8 +81,6 @@ blockToMediaWiki :: PandocMonad m => Block -- ^ Block element -> MediaWikiWriter m Text -blockToMediaWiki Null = return "" - blockToMediaWiki (Div attrs bs) = do contents <- blockListToMediaWiki bs return $ render Nothing (tagWithAttrs "div" attrs) <> "\n\n" <> diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs index 97c23f24d..055324448 100644 --- a/src/Text/Pandoc/Writers/Ms.hs +++ b/src/Text/Pandoc/Writers/Ms.hs @@ -110,7 +110,6 @@ blockToMs :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> MS m (Doc Text) -blockToMs _ Null = return empty blockToMs opts (Div (ident,cls,kvs) bs) = do let anchor = if T.null ident then empty diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index d5100f43f..329522a48 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -275,7 +275,6 @@ blockToMuse (Table _ blkCapt specs thead tbody tfoot) = (length aligns :| length widths : map length (headers:rows)) isSimple = onlySimpleTableCells (headers : rows) && all (== 0) widths blockToMuse (Div _ bs) = flatBlockListToMuse bs -blockToMuse Null = return empty -- | Return Muse representation of notes collected so far. currentNotesToMuse :: PandocMonad m diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 5f3224c2f..27473775b 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -398,7 +398,6 @@ blockToOpenDocument o = \case b@(RawBlock f s) -> if f == Format "opendocument" then return $ text $ T.unpack s else empty <$ report (BlockNotRendered b) - Null -> return empty where defList b = do setInDefinitionList True r <- vcat <$> mapM (deflistItemToOpenDocument o) b diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index f4a22695c..aae6fe0ef 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -102,7 +102,6 @@ isRawFormat f = blockToOrg :: PandocMonad m => Block -- ^ Block element -> Org m (Doc Text) -blockToOrg Null = return empty blockToOrg (Div attr bs) = divToOrg attr bs blockToOrg (Plain inlines) = inlineListToOrg inlines -- title beginning with fig: indicates that the image is a figure diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 327774cd8..e3d31d099 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -1041,7 +1041,6 @@ blockIsBlank HorizontalRule -> True Table{} -> False Div _ bls -> all blockIsBlank bls - Null -> True textIsBlank :: T.Text -> Bool textIsBlank = T.all isSpace diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 8b2002851..88e185897 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -197,7 +197,6 @@ bordered contents c = blockToRST :: PandocMonad m => Block -- ^ Block element -> RST m (Doc Text) -blockToRST Null = return empty blockToRST (Div ("",["title"],[]) _) = return empty -- this is generated by the rst reader and can safely be -- omitted when we're generating rst diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index 063371ebc..7e3e770ba 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -229,7 +229,6 @@ blockToRTF :: PandocMonad m -> Alignment -- ^ alignment -> Block -- ^ block to convert -> m Text -blockToRTF _ _ Null = return "" blockToRTF indent alignment (Div _ bs) = blocksToRTF indent alignment bs blockToRTF indent alignment (Plain lst) = diff --git a/src/Text/Pandoc/Writers/TEI.hs b/src/Text/Pandoc/Writers/TEI.hs index 18015259d..e8682018b 100644 --- a/src/Text/Pandoc/Writers/TEI.hs +++ b/src/Text/Pandoc/Writers/TEI.hs @@ -97,7 +97,6 @@ imageToTEI opts attr src = return $ selfClosingTag "graphic" $ -- | Convert a Pandoc block element to TEI. blockToTEI :: PandocMonad m => WriterOptions -> Block -> m (Doc Text) -blockToTEI _ Null = return empty blockToTEI opts (Div attr@(_,"section":_,_) (Header lvl _ ils : xs)) = do -- TEI doesn't allow sections with no content, so insert some if needed diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs index 6a33b4283..f817900e5 100644 --- a/src/Text/Pandoc/Writers/Texinfo.hs +++ b/src/Text/Pandoc/Writers/Texinfo.hs @@ -115,8 +115,6 @@ blockToTexinfo :: PandocMonad m => Block -- ^ Block to convert -> TI m (Doc Text) -blockToTexinfo Null = return empty - blockToTexinfo (Div _ bs) = blockListToTexinfo bs blockToTexinfo (Plain lst) = diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs index 03d030477..b1a4ed4a0 100644 --- a/src/Text/Pandoc/Writers/Textile.hs +++ b/src/Text/Pandoc/Writers/Textile.hs @@ -100,8 +100,6 @@ blockToTextile :: PandocMonad m -> Block -- ^ Block element -> TW m Text -blockToTextile _ Null = return "" - blockToTextile opts (Div attr bs) = do let startTag = render Nothing $ tagWithAttrs "div" attr let endTag = "" diff --git a/src/Text/Pandoc/Writers/XWiki.hs b/src/Text/Pandoc/Writers/XWiki.hs index c35235650..0d7387eaa 100644 --- a/src/Text/Pandoc/Writers/XWiki.hs +++ b/src/Text/Pandoc/Writers/XWiki.hs @@ -74,8 +74,6 @@ blockListToXWiki blocks = blockToXWiki :: PandocMonad m => Block -> XWikiReader m Text -blockToXWiki Null = return "" - blockToXWiki (Div (id', _, _) blocks) = do content <- blockListToXWiki blocks return $ genAnchor id' <> content diff --git a/src/Text/Pandoc/Writers/ZimWiki.hs b/src/Text/Pandoc/Writers/ZimWiki.hs index df914f590..651da4e46 100644 --- a/src/Text/Pandoc/Writers/ZimWiki.hs +++ b/src/Text/Pandoc/Writers/ZimWiki.hs @@ -78,8 +78,6 @@ escapeText = T.replace "__" "''__''" . -- | Convert Pandoc block element to ZimWiki. blockToZimWiki :: PandocMonad m => WriterOptions -> Block -> ZW m Text -blockToZimWiki _ Null = return "" - blockToZimWiki opts (Div _attrs bs) = do contents <- blockListToZimWiki opts bs return $ contents <> "\n" diff --git a/stack.yaml b/stack.yaml index 40704814b..674bc357f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -10,10 +10,15 @@ extra-deps: - skylighting-core-0.12 - skylighting-0.12 - doctemplates-0.10 +- git: https://github.com/jgm/pandoc-types.git + commit: f796401eaaab780f83c562e97dbb8c8d4b9974d1 - git: https://github.com/jgm/texmath.git - commit: 19700530733707284bb41f24add757f19ca23430 + commit: c046e6e5a93510f2c37dbc700f82a2c53ed87b5f - git: https://github.com/jgm/citeproc.git - commit: 4a7b98afabebd7a074489ba500d68ee6aa75d3a8 + commit: 673a7fb643d24a3bb0f60f8f29e189c0ba7ef15b +- git: https://github.com/jgm/commonmark-hs.git + commit: 3cba9f874db7516f49d221a94171b4af010b5bea + subdirs: [commonmark-pandoc] ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From 6ff04ac52de07ef1de7d9ccba0d74db5aa12dda8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 2 Oct 2021 06:51:21 -0700 Subject: Fix compareXML helper in Tests.Writers.OOXML. Given how it is used, we were getting "mine" and "good" flipped in the test results. --- test/Tests/Writers/OOXML.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Tests/Writers/OOXML.hs b/test/Tests/Writers/OOXML.hs index f2957f7a6..fea7fa70f 100644 --- a/test/Tests/Writers/OOXML.hs +++ b/test/Tests/Writers/OOXML.hs @@ -23,15 +23,15 @@ compareXML :: Content -> Content -> Maybe XMLDifference -- We make a special exception for times at the moment, and just pass -- them because we can't control the utctime when running IO. Besides, -- so long as we have two times, we're okay. -compareXML (Elem myElem) (Elem goodElem) +compareXML (Elem goodElem) (Elem myElem) | (QName "created" _ (Just "dcterms")) <- elName myElem , (QName "created" _ (Just "dcterms")) <- elName goodElem = Nothing -compareXML (Elem myElem) (Elem goodElem) +compareXML (Elem goodElem) (Elem myElem) | (QName "modified" _ (Just "dcterms")) <- elName myElem , (QName "modified" _ (Just "dcterms")) <- elName goodElem = Nothing -compareXML (Elem myElem) (Elem goodElem) = +compareXML (Elem goodElem) (Elem myElem) = (if elName myElem == elName goodElem then Nothing else Just @@ -46,16 +46,16 @@ compareXML (Elem myElem) (Elem goodElem) = , good = sort (elAttribs goodElem) }))) <|> asum (zipWith compareXML (elContent myElem) (elContent goodElem)) -compareXML (Text myCData) (Text goodCData) = +compareXML (Text goodCData) (Text myCData) = (if cdVerbatim myCData == cdVerbatim goodCData && cdData myCData == cdData goodCData then Nothing else Just (CDatasDiffer (Comparison { mine = myCData, good = goodCData }))) -compareXML (CRef myStr) (CRef goodStr) = +compareXML (CRef goodStr) (CRef myStr) = if myStr == goodStr then Nothing else Just (CRefsDiffer (Comparison { mine = myStr, good = goodStr })) -compareXML m g = Just (OtherContentsDiffer (Comparison {mine = m, good = g})) +compareXML g m = Just (OtherContentsDiffer (Comparison {mine = m, good = g})) data XMLDifference = ElemNamesDiffer (Comparison QName) -- cgit v1.2.3 From 6742e77d1ee10247c3fd2344381b52df5d4baba0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 2 Oct 2021 11:02:28 -0700 Subject: Update cabal.project --- cabal.project | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cabal.project b/cabal.project index 7c94a74af..930db65e8 100644 --- a/cabal.project +++ b/cabal.project @@ -5,10 +5,21 @@ flags: +embed_data_files source-repository-package type: git location: https://github.com/jgm/citeproc.git - tag: b27201c3ac48ffd2853f77152df19b6e2cf36987 + tag: 673a7fb643d24a3bb0f60f8f29e189c0ba7ef15b source-repository-package type: git location: https://github.com/jgm/texmath.git - tag: 19700530733707284bb41f24add757f19ca23430 + tag: c046e6e5a93510f2c37dbc700f82a2c53ed87b5f + +source-repository-package + type: git + location: https://github.com/jgm/pandoc-types.git + tag: f796401eaaab780f83c562e97dbb8c8d4b9974d1 + +source-repository-package + type: git + location: https://github.com/jgm/commonmark-hs.git + tag: 3cba9f874db7516f49d221a94171b4af010b5bea + subdir: commonmark-pandoc -- cgit v1.2.3 From da8bcb783b1f5fc99be86617762eca42ab2db6ad Mon Sep 17 00:00:00 2001 From: hseg Date: Mon, 4 Oct 2021 02:34:59 +0300 Subject: Make babel use more idiomatic * Use `babel`'s bidi implementation * Remove global `lang` option -- it broke eg hebrew * Import babel languages individually instead of as package options -- was broken for greek, hebrew * Move `header-includes` to after `babel` setup Closes #7604 --- data/templates/default.latex | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/data/templates/default.latex b/data/templates/default.latex index 27a3fc877..10377f2cd 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -4,11 +4,6 @@ $if(colorlinks)$ \PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor} $endif$ -$if(dir)$ -$if(latex-dir-rtl)$ -\PassOptionsToPackage{RTLdocument}{bidi} -$endif$ -$endif$ $if(CJKmainfont)$ \PassOptionsToPackage{space}{xeCJK} $endif$ @@ -17,9 +12,6 @@ $endif$ $if(fontsize)$ $fontsize$, $endif$ -$if(lang)$ - $babel-lang$, -$endif$ $if(papersize)$ $papersize$paper, $endif$ @@ -370,23 +362,28 @@ $if(csl-refs)$ \newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break} \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} $endif$ -$for(header-includes)$ -$header-includes$ -$endfor$ $if(lang)$ -\usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} +\ifXeTeX +\usepackage[bidi=default]{babel} +\fi +\ifLuaTeX +\usepackage[bidi=basic]{babel} +\fi +\babelprovide[main,import]{$babel-lang$} +$for(babel-otherlangs)$ +\babelprovide[import]{$babel-otherlangs$} +$endfor$ % get rid of language-specific shorthands (see #6817): \let\LanguageShortHands\languageshorthands \def\languageshorthands#1{} $endif$ +$for(header-includes)$ +$header-includes$ +$endfor$ \ifLuaTeX \usepackage{selnolig} % disable illegal ligatures \fi $if(dir)$ -\ifXeTeX - % Load bidi as late as possible as it modifies e.g. graphicx - \usepackage{bidi} -\fi \ifPDFTeX \TeXXeTstate=1 \newcommand{\RL}[1]{\beginR #1\endR} -- cgit v1.2.3 From 0088e79cf57fb9586e1596e2b97bdebb12667f6d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 3 Oct 2021 19:27:37 -0700 Subject: Update tests for babel-related changes in latex template. --- test/writers-lang-and-dir.latex | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index e7e5aa876..c8a1c0338 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -3,7 +3,6 @@ \PassOptionsToPackage{hyphens}{url} % \documentclass[ - english, ]{article} \usepackage{amsmath,amssymb} \usepackage{lmodern} @@ -45,17 +44,24 @@ \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \setcounter{secnumdepth}{-\maxdimen} % remove section numbering -\usepackage[ngerman,british,nswissgerman,spanish,french,main=english]{babel} +\ifXeTeX +\usepackage[bidi=default]{babel} +\fi +\ifLuaTeX +\usepackage[bidi=basic]{babel} +\fi +\babelprovide[main,import]{english} +\babelprovide[import]{ngerman} +\babelprovide[import]{british} +\babelprovide[import]{nswissgerman} +\babelprovide[import]{spanish} +\babelprovide[import]{french} % get rid of language-specific shorthands (see #6817): \let\LanguageShortHands\languageshorthands \def\languageshorthands#1{} \ifLuaTeX \usepackage{selnolig} % disable illegal ligatures \fi -\ifXeTeX - % Load bidi as late as possible as it modifies e.g. graphicx - \usepackage{bidi} -\fi \ifPDFTeX \TeXXeTstate=1 \newcommand{\RL}[1]{\beginR #1\endR} -- cgit v1.2.3 From 62f83aa48633af477913bde6f615fe9f8793901a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 4 Oct 2021 11:45:01 -0700 Subject: Powerpoint writer: consolidate text run nodes. This should reduce the size of the generated files. --- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 10 +++++++++- test/pptx/background-image/deleted-layouts.pptx | Bin 56282 -> 56266 bytes test/pptx/background-image/moved-layouts.pptx | Bin 66987 -> 66972 bytes test/pptx/background-image/output.pptx | Bin 53408 -> 53393 bytes test/pptx/background-image/templated.pptx | Bin 66487 -> 66472 bytes .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35178 -> 35171 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45870 -> 45863 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32297 -> 32291 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 45365 -> 45358 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 32092 -> 32090 bytes test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 42780 -> 42778 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 29211 -> 29210 bytes test/pptx/blanks/nbsp-in-body/templated.pptx | Bin 42280 -> 42278 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 32092 -> 32090 bytes test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 42780 -> 42778 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 29211 -> 29210 bytes test/pptx/blanks/nbsp-in-heading/templated.pptx | Bin 42280 -> 42278 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 32717 -> 32711 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 43405 -> 43398 bytes test/pptx/code-custom/output.pptx | Bin 29836 -> 29831 bytes test/pptx/code-custom/templated.pptx | Bin 42905 -> 42897 bytes test/pptx/code/deleted-layouts.pptx | Bin 32716 -> 32709 bytes test/pptx/code/moved-layouts.pptx | Bin 43405 -> 43398 bytes test/pptx/code/output.pptx | Bin 29835 -> 29829 bytes test/pptx/code/templated.pptx | Bin 42905 -> 42897 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 47453 -> 47449 bytes .../pptx/comparison/both-columns/moved-layouts.pptx | Bin 58172 -> 58169 bytes test/pptx/comparison/both-columns/output.pptx | Bin 44581 -> 44578 bytes test/pptx/comparison/both-columns/templated.pptx | Bin 57674 -> 57671 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 47482 -> 47481 bytes test/pptx/comparison/extra-image/moved-layouts.pptx | Bin 58200 -> 58196 bytes test/pptx/comparison/extra-image/output.pptx | Bin 44610 -> 44610 bytes test/pptx/comparison/extra-image/templated.pptx | Bin 57702 -> 57699 bytes .../pptx/comparison/extra-text/deleted-layouts.pptx | Bin 47453 -> 47449 bytes test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 58172 -> 58168 bytes test/pptx/comparison/extra-text/output.pptx | Bin 44581 -> 44578 bytes test/pptx/comparison/extra-text/templated.pptx | Bin 57674 -> 57671 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 47366 -> 47370 bytes .../comparison/non-text-first/moved-layouts.pptx | Bin 58065 -> 58063 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 44494 -> 44499 bytes test/pptx/comparison/non-text-first/templated.pptx | Bin 57567 -> 57566 bytes .../pptx/comparison/one-column/deleted-layouts.pptx | Bin 30785 -> 30785 bytes test/pptx/comparison/one-column/moved-layouts.pptx | Bin 41506 -> 41506 bytes test/pptx/comparison/one-column/output.pptx | Bin 27906 -> 27907 bytes test/pptx/comparison/one-column/templated.pptx | Bin 41006 -> 41006 bytes .../heading-text-image/deleted-layouts.pptx | Bin 47198 -> 47199 bytes .../heading-text-image/moved-layouts.pptx | Bin 57896 -> 57896 bytes .../heading-text-image/output.pptx | Bin 44326 -> 44328 bytes .../heading-text-image/templated.pptx | Bin 57398 -> 57399 bytes .../image-text/deleted-layouts.pptx | Bin 47896 -> 47896 bytes .../image-text/moved-layouts.pptx | Bin 58584 -> 58584 bytes .../content-with-caption/image-text/output.pptx | Bin 45022 -> 45023 bytes .../content-with-caption/image-text/templated.pptx | Bin 58084 -> 58084 bytes .../text-image/deleted-layouts.pptx | Bin 47137 -> 47136 bytes .../text-image/moved-layouts.pptx | Bin 57836 -> 57836 bytes .../content-with-caption/text-image/output.pptx | Bin 44265 -> 44265 bytes .../content-with-caption/text-image/templated.pptx | Bin 57338 -> 57338 bytes .../deleted-layouts.pptx | Bin 31490 -> 31489 bytes .../moved-layouts.pptx | Bin 42178 -> 42177 bytes .../pptx/document-properties-short-desc/output.pptx | Bin 28619 -> 28620 bytes .../document-properties-short-desc/templated.pptx | Bin 41678 -> 41677 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 31894 -> 31896 bytes test/pptx/document-properties/moved-layouts.pptx | Bin 42582 -> 42583 bytes test/pptx/document-properties/output.pptx | Bin 29025 -> 29026 bytes test/pptx/document-properties/templated.pptx | Bin 42082 -> 42083 bytes test/pptx/footer/basic/output.pptx | Bin 52775 -> 52757 bytes test/pptx/footer/fixed-date/output.pptx | Bin 51397 -> 51376 bytes test/pptx/footer/higher-slide-number/output.pptx | Bin 52790 -> 52771 bytes test/pptx/footer/no-title-slide/output.pptx | Bin 52362 -> 52343 bytes test/pptx/images/deleted-layouts.pptx | Bin 49121 -> 49120 bytes test/pptx/images/moved-layouts.pptx | Bin 59809 -> 59808 bytes test/pptx/images/output.pptx | Bin 46244 -> 46243 bytes test/pptx/images/templated.pptx | Bin 59308 -> 59308 bytes .../with-flag/deleted-layouts.pptx | Bin 80172 -> 80140 bytes .../incremental-lists/with-flag/moved-layouts.pptx | Bin 90917 -> 90883 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77298 -> 77267 bytes .../pptx/incremental-lists/with-flag/templated.pptx | Bin 90414 -> 90380 bytes .../without-flag/deleted-layouts.pptx | Bin 78405 -> 78375 bytes .../without-flag/moved-layouts.pptx | Bin 89148 -> 89115 bytes .../pptx/incremental-lists/without-flag/output.pptx | Bin 75533 -> 75504 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88645 -> 88612 bytes test/pptx/lists/deleted-layouts.pptx | Bin 31545 -> 31545 bytes test/pptx/lists/moved-layouts.pptx | Bin 42233 -> 42233 bytes test/pptx/lists/output.pptx | Bin 28667 -> 28668 bytes test/pptx/lists/templated.pptx | Bin 41733 -> 41734 bytes .../slide-breaks-slide-level-1/deleted-layouts.pptx | Bin 32238 -> 32238 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 42926 -> 42926 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 29357 -> 29358 bytes test/pptx/slide-breaks-slide-level-1/templated.pptx | Bin 42426 -> 42427 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 34012 -> 34013 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 44701 -> 44702 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31133 -> 31135 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 44201 -> 44203 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 33062 -> 33063 bytes test/pptx/slide-breaks/moved-layouts.pptx | Bin 43751 -> 43752 bytes test/pptx/slide-breaks/output.pptx | Bin 30183 -> 30185 bytes test/pptx/slide-breaks/templated.pptx | Bin 43250 -> 43252 bytes .../h1-with-image/deleted-layouts.pptx | Bin 47118 -> 47119 bytes .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 57804 -> 57805 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 44245 -> 44247 bytes .../pptx/slide-level-0/h1-with-image/templated.pptx | Bin 57306 -> 57306 bytes .../h2-with-image/deleted-layouts.pptx | Bin 47118 -> 47119 bytes .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 57804 -> 57805 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 44245 -> 44247 bytes .../pptx/slide-level-0/h2-with-image/templated.pptx | Bin 57306 -> 57306 bytes .../deleted-layouts.pptx | Bin 34504 -> 34500 bytes .../speaker-notes-after-metadata/moved-layouts.pptx | Bin 45193 -> 45189 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31634 -> 31632 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 44690 -> 44685 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33532 -> 33524 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44220 -> 44212 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30653 -> 30646 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 43719 -> 43710 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54429 -> 54414 bytes .../pptx/speaker-notes-afterseps/moved-layouts.pptx | Bin 65119 -> 65104 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51548 -> 51534 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64614 -> 64598 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38236 -> 38227 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 48929 -> 48920 bytes test/pptx/speaker-notes/output.pptx | Bin 35358 -> 35350 bytes test/pptx/speaker-notes/templated.pptx | Bin 48423 -> 48413 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 31521 -> 31517 bytes test/pptx/start-numbering-at/moved-layouts.pptx | Bin 42209 -> 42205 bytes test/pptx/start-numbering-at/output.pptx | Bin 28643 -> 28640 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41709 -> 41706 bytes test/pptx/tables/deleted-layouts.pptx | Bin 32065 -> 32059 bytes test/pptx/tables/moved-layouts.pptx | Bin 42753 -> 42747 bytes test/pptx/tables/output.pptx | Bin 29184 -> 29179 bytes test/pptx/tables/templated.pptx | Bin 42253 -> 42248 bytes test/pptx/two-column/all-text/deleted-layouts.pptx | Bin 30568 -> 30569 bytes test/pptx/two-column/all-text/moved-layouts.pptx | Bin 41256 -> 41257 bytes test/pptx/two-column/all-text/output.pptx | Bin 27689 -> 27691 bytes test/pptx/two-column/all-text/templated.pptx | Bin 40756 -> 40758 bytes .../two-column/text-and-image/deleted-layouts.pptx | Bin 48392 -> 48389 bytes .../two-column/text-and-image/moved-layouts.pptx | Bin 59086 -> 59084 bytes test/pptx/two-column/text-and-image/output.pptx | Bin 45520 -> 45518 bytes test/pptx/two-column/text-and-image/templated.pptx | Bin 58586 -> 58585 bytes 137 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index e3d31d099..1680bc7ac 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -348,7 +348,15 @@ instance Default PicProps where -------------------------------------------------- inlinesToParElems :: [Inline] -> Pres [ParaElem] -inlinesToParElems ils = concatMapM inlineToParElems ils +inlinesToParElems = concatMapM inlineToParElems . consolidateStrs + where + -- we combine Str + Space combinations, because this makes + -- the resulting ooxml much more compact, with fewer independent + -- text run elements + consolidateStrs [] = [] + consolidateStrs (Str t : Space : ils) = consolidateStrs (Str (t <> " ") : ils) + consolidateStrs (Space : Str t : ils) = consolidateStrs (Str (" " <> t) : ils) + consolidateStrs (il : ils) = il : consolidateStrs ils inlineToParElems :: Inline -> Pres [ParaElem] inlineToParElems (Str s) = do diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx index 05d4104b7..41f13db87 100644 Binary files a/test/pptx/background-image/deleted-layouts.pptx and b/test/pptx/background-image/deleted-layouts.pptx differ diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx index 73b69e1d6..ca7a8a9d5 100644 Binary files a/test/pptx/background-image/moved-layouts.pptx and b/test/pptx/background-image/moved-layouts.pptx differ diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx index 9738eefb8..f3c2c7606 100644 Binary files a/test/pptx/background-image/output.pptx and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/background-image/templated.pptx b/test/pptx/background-image/templated.pptx index 52d304957..442fe3bdd 100644 Binary files a/test/pptx/background-image/templated.pptx and b/test/pptx/background-image/templated.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx index 5038f2aaf..3dcc1d444 100644 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx index 90353a560..c63d94774 100644 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 799c0f14a..9377013a0 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx index 5e3afb5f8..ed65b8f32 100644 Binary files a/test/pptx/blanks/just-speaker-notes/templated.pptx and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx index 7716e1cbf..650da51db 100644 Binary files a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx index 3dc6c817e..45cf168a9 100644 Binary files a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx index 1df3f9574..57c6e3b6e 100644 Binary files a/test/pptx/blanks/nbsp-in-body/output.pptx and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/templated.pptx b/test/pptx/blanks/nbsp-in-body/templated.pptx index 1cf58a1bb..8cc5d053a 100644 Binary files a/test/pptx/blanks/nbsp-in-body/templated.pptx and b/test/pptx/blanks/nbsp-in-body/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx index 7716e1cbf..8b1d0a37b 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx index 3dc6c817e..45cf168a9 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx index e528091d7..57c6e3b6e 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/output.pptx and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/templated.pptx b/test/pptx/blanks/nbsp-in-heading/templated.pptx index 1f2d91399..8cc5d053a 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/templated.pptx and b/test/pptx/blanks/nbsp-in-heading/templated.pptx differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx index b49cd4896..04e6dadd1 100644 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx index c6806f37f..caacdab47 100644 Binary files a/test/pptx/code-custom/moved-layouts.pptx and b/test/pptx/code-custom/moved-layouts.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index a72bebbe2..f5aa05b41 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 2bdb526fa..160f85bdf 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx index df7814599..bbfabede2 100644 Binary files a/test/pptx/code/deleted-layouts.pptx and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx index 71e8560bd..7950abbad 100644 Binary files a/test/pptx/code/moved-layouts.pptx and b/test/pptx/code/moved-layouts.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index 4b70df2c7..ce08a9c64 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index 1285a9273..2a37db25a 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx index 27f9d9ac7..03ee6c408 100644 Binary files a/test/pptx/comparison/both-columns/deleted-layouts.pptx and b/test/pptx/comparison/both-columns/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx index a658045ef..bb5f046fd 100644 Binary files a/test/pptx/comparison/both-columns/moved-layouts.pptx and b/test/pptx/comparison/both-columns/moved-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx index 560c7d41a..345833b8b 100644 Binary files a/test/pptx/comparison/both-columns/output.pptx and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx index 2fb38880d..3dcc6274f 100644 Binary files a/test/pptx/comparison/both-columns/templated.pptx and b/test/pptx/comparison/both-columns/templated.pptx differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx index 267c7cb69..0ad383194 100644 Binary files a/test/pptx/comparison/extra-image/deleted-layouts.pptx and b/test/pptx/comparison/extra-image/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx index b7023026c..30bf2450b 100644 Binary files a/test/pptx/comparison/extra-image/moved-layouts.pptx and b/test/pptx/comparison/extra-image/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx index 06d632ee7..464a07d88 100644 Binary files a/test/pptx/comparison/extra-image/output.pptx and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx index af84388c4..771b16cda 100644 Binary files a/test/pptx/comparison/extra-image/templated.pptx and b/test/pptx/comparison/extra-image/templated.pptx differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx index 27f9d9ac7..03ee6c408 100644 Binary files a/test/pptx/comparison/extra-text/deleted-layouts.pptx and b/test/pptx/comparison/extra-text/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx index a658045ef..2541e97d3 100644 Binary files a/test/pptx/comparison/extra-text/moved-layouts.pptx and b/test/pptx/comparison/extra-text/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx index 560c7d41a..345833b8b 100644 Binary files a/test/pptx/comparison/extra-text/output.pptx and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx index 2fb38880d..8d78e715a 100644 Binary files a/test/pptx/comparison/extra-text/templated.pptx and b/test/pptx/comparison/extra-text/templated.pptx differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx index be30d8368..d2fab6c94 100644 Binary files a/test/pptx/comparison/non-text-first/deleted-layouts.pptx and b/test/pptx/comparison/non-text-first/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx index c4879b7d5..16d59be78 100644 Binary files a/test/pptx/comparison/non-text-first/moved-layouts.pptx and b/test/pptx/comparison/non-text-first/moved-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx index 099cf6729..5f5d12d2f 100644 Binary files a/test/pptx/comparison/non-text-first/output.pptx and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx index 31ac01f18..520021af3 100644 Binary files a/test/pptx/comparison/non-text-first/templated.pptx and b/test/pptx/comparison/non-text-first/templated.pptx differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx index 27620f05f..5a31c333a 100644 Binary files a/test/pptx/comparison/one-column/deleted-layouts.pptx and b/test/pptx/comparison/one-column/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx index fc64d3af5..cce84cc9f 100644 Binary files a/test/pptx/comparison/one-column/moved-layouts.pptx and b/test/pptx/comparison/one-column/moved-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx index 854a968af..cc690844f 100644 Binary files a/test/pptx/comparison/one-column/output.pptx and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx index 9e671af1d..309a25d6e 100644 Binary files a/test/pptx/comparison/one-column/templated.pptx and b/test/pptx/comparison/one-column/templated.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx index 3cd09a916..1a94474ea 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx index 8e76bc94c..32d76ca3d 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx index 5c680e878..aea085efc 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/output.pptx and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx index bdde384a4..07becc7f8 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/templated.pptx and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx index 376880b41..4e834f056 100644 Binary files a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx index 9e33d3163..44a689c30 100644 Binary files a/test/pptx/content-with-caption/image-text/moved-layouts.pptx and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx index c88030b94..e1595c428 100644 Binary files a/test/pptx/content-with-caption/image-text/output.pptx and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx index a22e9ae3e..58264a92d 100644 Binary files a/test/pptx/content-with-caption/image-text/templated.pptx and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx index 2dcb8b78e..e548a7798 100644 Binary files a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx index 7d187a168..ca0e74a18 100644 Binary files a/test/pptx/content-with-caption/text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx index 751121cf2..3fdf9ea07 100644 Binary files a/test/pptx/content-with-caption/text-image/output.pptx and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx index 4f0aaaa7a..bd96bd723 100644 Binary files a/test/pptx/content-with-caption/text-image/templated.pptx and b/test/pptx/content-with-caption/text-image/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx index 79517481a..f8903bbd4 100644 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx index 51608c2e9..59674d5dd 100644 Binary files a/test/pptx/document-properties-short-desc/moved-layouts.pptx and b/test/pptx/document-properties-short-desc/moved-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx index 02c241b89..2c1ef0faa 100644 Binary files a/test/pptx/document-properties-short-desc/output.pptx and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/templated.pptx b/test/pptx/document-properties-short-desc/templated.pptx index 82ccc072c..3e004942c 100644 Binary files a/test/pptx/document-properties-short-desc/templated.pptx and b/test/pptx/document-properties-short-desc/templated.pptx differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx index 12f6570cf..229cfc5a7 100644 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx index 9a9d4ac3e..18d35eb26 100644 Binary files a/test/pptx/document-properties/moved-layouts.pptx and b/test/pptx/document-properties/moved-layouts.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx index cfd3261bc..51f7a5116 100644 Binary files a/test/pptx/document-properties/output.pptx and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/document-properties/templated.pptx b/test/pptx/document-properties/templated.pptx index 3d52d22df..6e37cd4a1 100644 Binary files a/test/pptx/document-properties/templated.pptx and b/test/pptx/document-properties/templated.pptx differ diff --git a/test/pptx/footer/basic/output.pptx b/test/pptx/footer/basic/output.pptx index db8814418..8a2595016 100644 Binary files a/test/pptx/footer/basic/output.pptx and b/test/pptx/footer/basic/output.pptx differ diff --git a/test/pptx/footer/fixed-date/output.pptx b/test/pptx/footer/fixed-date/output.pptx index 85854a744..b6857e8cf 100644 Binary files a/test/pptx/footer/fixed-date/output.pptx and b/test/pptx/footer/fixed-date/output.pptx differ diff --git a/test/pptx/footer/higher-slide-number/output.pptx b/test/pptx/footer/higher-slide-number/output.pptx index c5bc3d047..1e3bfc5aa 100644 Binary files a/test/pptx/footer/higher-slide-number/output.pptx and b/test/pptx/footer/higher-slide-number/output.pptx differ diff --git a/test/pptx/footer/no-title-slide/output.pptx b/test/pptx/footer/no-title-slide/output.pptx index d1475bf1f..a36a80406 100644 Binary files a/test/pptx/footer/no-title-slide/output.pptx and b/test/pptx/footer/no-title-slide/output.pptx differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx index 9f0f41c37..5da21f29c 100644 Binary files a/test/pptx/images/deleted-layouts.pptx and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx index f26ac9e8f..a394237ca 100644 Binary files a/test/pptx/images/moved-layouts.pptx and b/test/pptx/images/moved-layouts.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx index 993209a45..0c4a774b1 100644 Binary files a/test/pptx/images/output.pptx and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/images/templated.pptx b/test/pptx/images/templated.pptx index 06b337538..9bb4567cf 100644 Binary files a/test/pptx/images/templated.pptx and b/test/pptx/images/templated.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx index 5a74826a4..180ac47b7 100644 Binary files a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx index f20dd2906..1b6fc81b2 100644 Binary files a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index d4f76f1e7..2cfffc0e9 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index f5ee2ff5f..7d9292f5c 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx index 16bd85ffd..6d68aafef 100644 Binary files a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx index 054fe918e..5bb33a6b4 100644 Binary files a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 1b326461d..4afae23d9 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index dee6e9b06..62b0ab802 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx index 1670eada1..d8fd26264 100644 Binary files a/test/pptx/lists/deleted-layouts.pptx and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx index f7590c5f9..30319c6b8 100644 Binary files a/test/pptx/lists/moved-layouts.pptx and b/test/pptx/lists/moved-layouts.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index 95510e92e..7a7c9488b 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 7af437bfe..9cece3499 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx index 334fdea9c..5f672b9d8 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx index 3faabfd93..159a8bb0f 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx index 96b9907cc..f1c8c8f46 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/output.pptx and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/templated.pptx b/test/pptx/slide-breaks-slide-level-1/templated.pptx index 9f23f1d9f..7baaf5791 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/templated.pptx and b/test/pptx/slide-breaks-slide-level-1/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx index 0492ee2ec..cd0372c89 100644 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx index f3e56652c..dc94f201b 100644 Binary files a/test/pptx/slide-breaks-toc/moved-layouts.pptx and b/test/pptx/slide-breaks-toc/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index b3063b15e..c9df30e6b 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index bcb2f8276..36ae13623 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx index 827c7dfda..b6cd32a04 100644 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx index 241605754..48c50a709 100644 Binary files a/test/pptx/slide-breaks/moved-layouts.pptx and b/test/pptx/slide-breaks/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx index 55c09a80e..30c3c1a8e 100644 Binary files a/test/pptx/slide-breaks/output.pptx and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-breaks/templated.pptx b/test/pptx/slide-breaks/templated.pptx index f60f7da06..84581a358 100644 Binary files a/test/pptx/slide-breaks/templated.pptx and b/test/pptx/slide-breaks/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx index 7bc7cfeee..8903ff6fa 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx index 602df1c77..65491db8c 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx index f725760dc..bdada1cad 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/output.pptx and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/templated.pptx b/test/pptx/slide-level-0/h1-with-image/templated.pptx index b203ff671..e1c85d948 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/templated.pptx and b/test/pptx/slide-level-0/h1-with-image/templated.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx index 7bc7cfeee..8903ff6fa 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx index 602df1c77..65491db8c 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx index f725760dc..bdada1cad 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/output.pptx and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/templated.pptx b/test/pptx/slide-level-0/h2-with-image/templated.pptx index b203ff671..e1c85d948 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/templated.pptx and b/test/pptx/slide-level-0/h2-with-image/templated.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 9010ba04a..30bd36e5d 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx index ca53605b7..b05079ef2 100644 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index 607115858..41e3148cb 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx index 3be3ed0af..9cdc0ef9f 100644 Binary files a/test/pptx/speaker-notes-after-metadata/templated.pptx and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 2c2a0936b..54de85128 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx index a9c8bfa0a..4e4a854e5 100644 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index ff403aa1c..96b136ef9 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx index 15435c45a..abdc71ebc 100644 Binary files a/test/pptx/speaker-notes-afterheader/templated.pptx and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index f6abb0b27..99e499f4d 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx index 6a770fc75..49f7360c7 100644 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 7e56147f1..3a426d29a 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index 3184ff74e..8e26e7581 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index 5429b88e0..a8014c666 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx index 13e34698d..be5c383c3 100644 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index 74041a40d..0fe2b7783 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx index 80a3e3dea..70e1a2c88 100644 Binary files a/test/pptx/speaker-notes/templated.pptx and b/test/pptx/speaker-notes/templated.pptx differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx index 7bfe9868f..8692da129 100644 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx index 0100365ec..7e1a68a0d 100644 Binary files a/test/pptx/start-numbering-at/moved-layouts.pptx and b/test/pptx/start-numbering-at/moved-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index 3ba9a236a..95a0c8ef4 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index 8a144d601..b4302f6d5 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx index 163d4ca5e..ebad0c49b 100644 Binary files a/test/pptx/tables/deleted-layouts.pptx and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx index 1b0e606da..2ad4646a6 100644 Binary files a/test/pptx/tables/moved-layouts.pptx and b/test/pptx/tables/moved-layouts.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx index 1c89d8032..81f7a21c1 100644 Binary files a/test/pptx/tables/output.pptx and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/tables/templated.pptx b/test/pptx/tables/templated.pptx index 5755bfe9d..538bec0fb 100644 Binary files a/test/pptx/tables/templated.pptx and b/test/pptx/tables/templated.pptx differ diff --git a/test/pptx/two-column/all-text/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx index 1d7bd87d3..58400da56 100644 Binary files a/test/pptx/two-column/all-text/deleted-layouts.pptx and b/test/pptx/two-column/all-text/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx index 71760268c..7e94ede93 100644 Binary files a/test/pptx/two-column/all-text/moved-layouts.pptx and b/test/pptx/two-column/all-text/moved-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/output.pptx b/test/pptx/two-column/all-text/output.pptx index 396dc2a74..f5d871c53 100644 Binary files a/test/pptx/two-column/all-text/output.pptx and b/test/pptx/two-column/all-text/output.pptx differ diff --git a/test/pptx/two-column/all-text/templated.pptx b/test/pptx/two-column/all-text/templated.pptx index 8901695b1..d5f563006 100644 Binary files a/test/pptx/two-column/all-text/templated.pptx and b/test/pptx/two-column/all-text/templated.pptx differ diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx index 297fd6bad..43ced4431 100644 Binary files a/test/pptx/two-column/text-and-image/deleted-layouts.pptx and b/test/pptx/two-column/text-and-image/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx index c9a6e577e..231723f10 100644 Binary files a/test/pptx/two-column/text-and-image/moved-layouts.pptx and b/test/pptx/two-column/text-and-image/moved-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx index bfd532ed9..bb6af0d74 100644 Binary files a/test/pptx/two-column/text-and-image/output.pptx and b/test/pptx/two-column/text-and-image/output.pptx differ diff --git a/test/pptx/two-column/text-and-image/templated.pptx b/test/pptx/two-column/text-and-image/templated.pptx index 23e6b283f..4014b0bf1 100644 Binary files a/test/pptx/two-column/text-and-image/templated.pptx and b/test/pptx/two-column/text-and-image/templated.pptx differ -- cgit v1.2.3 From 82d587493d97536a64110902f647d953b5f28dd4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 4 Oct 2021 11:50:32 -0700 Subject: Revert "Powerpoint writer: consolidate text run nodes." This reverts commit 62f83aa48633af477913bde6f615fe9f8793901a. This was already being done, it seems. I misidentified the problem; it is really with `Str ""` nodes. --- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 10 +--------- test/pptx/background-image/deleted-layouts.pptx | Bin 56266 -> 56282 bytes test/pptx/background-image/moved-layouts.pptx | Bin 66972 -> 66987 bytes test/pptx/background-image/output.pptx | Bin 53393 -> 53408 bytes test/pptx/background-image/templated.pptx | Bin 66472 -> 66487 bytes .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35171 -> 35178 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45863 -> 45870 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32291 -> 32297 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 45358 -> 45365 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 32090 -> 32092 bytes test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 42778 -> 42780 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 29210 -> 29211 bytes test/pptx/blanks/nbsp-in-body/templated.pptx | Bin 42278 -> 42280 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 32090 -> 32092 bytes test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 42778 -> 42780 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 29210 -> 29211 bytes test/pptx/blanks/nbsp-in-heading/templated.pptx | Bin 42278 -> 42280 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 32711 -> 32717 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 43398 -> 43405 bytes test/pptx/code-custom/output.pptx | Bin 29831 -> 29836 bytes test/pptx/code-custom/templated.pptx | Bin 42897 -> 42905 bytes test/pptx/code/deleted-layouts.pptx | Bin 32709 -> 32716 bytes test/pptx/code/moved-layouts.pptx | Bin 43398 -> 43405 bytes test/pptx/code/output.pptx | Bin 29829 -> 29835 bytes test/pptx/code/templated.pptx | Bin 42897 -> 42905 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 47449 -> 47453 bytes .../pptx/comparison/both-columns/moved-layouts.pptx | Bin 58169 -> 58172 bytes test/pptx/comparison/both-columns/output.pptx | Bin 44578 -> 44581 bytes test/pptx/comparison/both-columns/templated.pptx | Bin 57671 -> 57674 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 47481 -> 47482 bytes test/pptx/comparison/extra-image/moved-layouts.pptx | Bin 58196 -> 58200 bytes test/pptx/comparison/extra-image/output.pptx | Bin 44610 -> 44610 bytes test/pptx/comparison/extra-image/templated.pptx | Bin 57699 -> 57702 bytes .../pptx/comparison/extra-text/deleted-layouts.pptx | Bin 47449 -> 47453 bytes test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 58168 -> 58172 bytes test/pptx/comparison/extra-text/output.pptx | Bin 44578 -> 44581 bytes test/pptx/comparison/extra-text/templated.pptx | Bin 57671 -> 57674 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 47370 -> 47366 bytes .../comparison/non-text-first/moved-layouts.pptx | Bin 58063 -> 58065 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 44499 -> 44494 bytes test/pptx/comparison/non-text-first/templated.pptx | Bin 57566 -> 57567 bytes .../pptx/comparison/one-column/deleted-layouts.pptx | Bin 30785 -> 30785 bytes test/pptx/comparison/one-column/moved-layouts.pptx | Bin 41506 -> 41506 bytes test/pptx/comparison/one-column/output.pptx | Bin 27907 -> 27906 bytes test/pptx/comparison/one-column/templated.pptx | Bin 41006 -> 41006 bytes .../heading-text-image/deleted-layouts.pptx | Bin 47199 -> 47198 bytes .../heading-text-image/moved-layouts.pptx | Bin 57896 -> 57896 bytes .../heading-text-image/output.pptx | Bin 44328 -> 44326 bytes .../heading-text-image/templated.pptx | Bin 57399 -> 57398 bytes .../image-text/deleted-layouts.pptx | Bin 47896 -> 47896 bytes .../image-text/moved-layouts.pptx | Bin 58584 -> 58584 bytes .../content-with-caption/image-text/output.pptx | Bin 45023 -> 45022 bytes .../content-with-caption/image-text/templated.pptx | Bin 58084 -> 58084 bytes .../text-image/deleted-layouts.pptx | Bin 47136 -> 47137 bytes .../text-image/moved-layouts.pptx | Bin 57836 -> 57836 bytes .../content-with-caption/text-image/output.pptx | Bin 44265 -> 44265 bytes .../content-with-caption/text-image/templated.pptx | Bin 57338 -> 57338 bytes .../deleted-layouts.pptx | Bin 31489 -> 31490 bytes .../moved-layouts.pptx | Bin 42177 -> 42178 bytes .../pptx/document-properties-short-desc/output.pptx | Bin 28620 -> 28619 bytes .../document-properties-short-desc/templated.pptx | Bin 41677 -> 41678 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 31896 -> 31894 bytes test/pptx/document-properties/moved-layouts.pptx | Bin 42583 -> 42582 bytes test/pptx/document-properties/output.pptx | Bin 29026 -> 29025 bytes test/pptx/document-properties/templated.pptx | Bin 42083 -> 42082 bytes test/pptx/footer/basic/output.pptx | Bin 52757 -> 52775 bytes test/pptx/footer/fixed-date/output.pptx | Bin 51376 -> 51397 bytes test/pptx/footer/higher-slide-number/output.pptx | Bin 52771 -> 52790 bytes test/pptx/footer/no-title-slide/output.pptx | Bin 52343 -> 52362 bytes test/pptx/images/deleted-layouts.pptx | Bin 49120 -> 49121 bytes test/pptx/images/moved-layouts.pptx | Bin 59808 -> 59809 bytes test/pptx/images/output.pptx | Bin 46243 -> 46244 bytes test/pptx/images/templated.pptx | Bin 59308 -> 59308 bytes .../with-flag/deleted-layouts.pptx | Bin 80140 -> 80172 bytes .../incremental-lists/with-flag/moved-layouts.pptx | Bin 90883 -> 90917 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77267 -> 77298 bytes .../pptx/incremental-lists/with-flag/templated.pptx | Bin 90380 -> 90414 bytes .../without-flag/deleted-layouts.pptx | Bin 78375 -> 78405 bytes .../without-flag/moved-layouts.pptx | Bin 89115 -> 89148 bytes .../pptx/incremental-lists/without-flag/output.pptx | Bin 75504 -> 75533 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88612 -> 88645 bytes test/pptx/lists/deleted-layouts.pptx | Bin 31545 -> 31545 bytes test/pptx/lists/moved-layouts.pptx | Bin 42233 -> 42233 bytes test/pptx/lists/output.pptx | Bin 28668 -> 28667 bytes test/pptx/lists/templated.pptx | Bin 41734 -> 41733 bytes .../slide-breaks-slide-level-1/deleted-layouts.pptx | Bin 32238 -> 32238 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 42926 -> 42926 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 29358 -> 29357 bytes test/pptx/slide-breaks-slide-level-1/templated.pptx | Bin 42427 -> 42426 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 34013 -> 34012 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 44702 -> 44701 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31135 -> 31133 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 44203 -> 44201 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 33063 -> 33062 bytes test/pptx/slide-breaks/moved-layouts.pptx | Bin 43752 -> 43751 bytes test/pptx/slide-breaks/output.pptx | Bin 30185 -> 30183 bytes test/pptx/slide-breaks/templated.pptx | Bin 43252 -> 43250 bytes .../h1-with-image/deleted-layouts.pptx | Bin 47119 -> 47118 bytes .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 57805 -> 57804 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 44247 -> 44245 bytes .../pptx/slide-level-0/h1-with-image/templated.pptx | Bin 57306 -> 57306 bytes .../h2-with-image/deleted-layouts.pptx | Bin 47119 -> 47118 bytes .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 57805 -> 57804 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 44247 -> 44245 bytes .../pptx/slide-level-0/h2-with-image/templated.pptx | Bin 57306 -> 57306 bytes .../deleted-layouts.pptx | Bin 34500 -> 34504 bytes .../speaker-notes-after-metadata/moved-layouts.pptx | Bin 45189 -> 45193 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31632 -> 31634 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 44685 -> 44690 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33524 -> 33532 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44212 -> 44220 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30646 -> 30653 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 43710 -> 43719 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54414 -> 54429 bytes .../pptx/speaker-notes-afterseps/moved-layouts.pptx | Bin 65104 -> 65119 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51534 -> 51548 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64598 -> 64614 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38227 -> 38236 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 48920 -> 48929 bytes test/pptx/speaker-notes/output.pptx | Bin 35350 -> 35358 bytes test/pptx/speaker-notes/templated.pptx | Bin 48413 -> 48423 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 31517 -> 31521 bytes test/pptx/start-numbering-at/moved-layouts.pptx | Bin 42205 -> 42209 bytes test/pptx/start-numbering-at/output.pptx | Bin 28640 -> 28643 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41706 -> 41709 bytes test/pptx/tables/deleted-layouts.pptx | Bin 32059 -> 32065 bytes test/pptx/tables/moved-layouts.pptx | Bin 42747 -> 42753 bytes test/pptx/tables/output.pptx | Bin 29179 -> 29184 bytes test/pptx/tables/templated.pptx | Bin 42248 -> 42253 bytes test/pptx/two-column/all-text/deleted-layouts.pptx | Bin 30569 -> 30568 bytes test/pptx/two-column/all-text/moved-layouts.pptx | Bin 41257 -> 41256 bytes test/pptx/two-column/all-text/output.pptx | Bin 27691 -> 27689 bytes test/pptx/two-column/all-text/templated.pptx | Bin 40758 -> 40756 bytes .../two-column/text-and-image/deleted-layouts.pptx | Bin 48389 -> 48392 bytes .../two-column/text-and-image/moved-layouts.pptx | Bin 59084 -> 59086 bytes test/pptx/two-column/text-and-image/output.pptx | Bin 45518 -> 45520 bytes test/pptx/two-column/text-and-image/templated.pptx | Bin 58585 -> 58586 bytes 137 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 1680bc7ac..e3d31d099 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -348,15 +348,7 @@ instance Default PicProps where -------------------------------------------------- inlinesToParElems :: [Inline] -> Pres [ParaElem] -inlinesToParElems = concatMapM inlineToParElems . consolidateStrs - where - -- we combine Str + Space combinations, because this makes - -- the resulting ooxml much more compact, with fewer independent - -- text run elements - consolidateStrs [] = [] - consolidateStrs (Str t : Space : ils) = consolidateStrs (Str (t <> " ") : ils) - consolidateStrs (Space : Str t : ils) = consolidateStrs (Str (" " <> t) : ils) - consolidateStrs (il : ils) = il : consolidateStrs ils +inlinesToParElems ils = concatMapM inlineToParElems ils inlineToParElems :: Inline -> Pres [ParaElem] inlineToParElems (Str s) = do diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx index 41f13db87..05d4104b7 100644 Binary files a/test/pptx/background-image/deleted-layouts.pptx and b/test/pptx/background-image/deleted-layouts.pptx differ diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx index ca7a8a9d5..73b69e1d6 100644 Binary files a/test/pptx/background-image/moved-layouts.pptx and b/test/pptx/background-image/moved-layouts.pptx differ diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx index f3c2c7606..9738eefb8 100644 Binary files a/test/pptx/background-image/output.pptx and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/background-image/templated.pptx b/test/pptx/background-image/templated.pptx index 442fe3bdd..52d304957 100644 Binary files a/test/pptx/background-image/templated.pptx and b/test/pptx/background-image/templated.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx index 3dcc1d444..5038f2aaf 100644 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx index c63d94774..90353a560 100644 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 9377013a0..799c0f14a 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx index ed65b8f32..5e3afb5f8 100644 Binary files a/test/pptx/blanks/just-speaker-notes/templated.pptx and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx index 650da51db..7716e1cbf 100644 Binary files a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx index 45cf168a9..3dc6c817e 100644 Binary files a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx index 57c6e3b6e..1df3f9574 100644 Binary files a/test/pptx/blanks/nbsp-in-body/output.pptx and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/templated.pptx b/test/pptx/blanks/nbsp-in-body/templated.pptx index 8cc5d053a..1cf58a1bb 100644 Binary files a/test/pptx/blanks/nbsp-in-body/templated.pptx and b/test/pptx/blanks/nbsp-in-body/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx index 8b1d0a37b..7716e1cbf 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx index 45cf168a9..3dc6c817e 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx index 57c6e3b6e..e528091d7 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/output.pptx and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/templated.pptx b/test/pptx/blanks/nbsp-in-heading/templated.pptx index 8cc5d053a..1f2d91399 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/templated.pptx and b/test/pptx/blanks/nbsp-in-heading/templated.pptx differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx index 04e6dadd1..b49cd4896 100644 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx index caacdab47..c6806f37f 100644 Binary files a/test/pptx/code-custom/moved-layouts.pptx and b/test/pptx/code-custom/moved-layouts.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index f5aa05b41..a72bebbe2 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 160f85bdf..2bdb526fa 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx index bbfabede2..df7814599 100644 Binary files a/test/pptx/code/deleted-layouts.pptx and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx index 7950abbad..71e8560bd 100644 Binary files a/test/pptx/code/moved-layouts.pptx and b/test/pptx/code/moved-layouts.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index ce08a9c64..4b70df2c7 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index 2a37db25a..1285a9273 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx index 03ee6c408..27f9d9ac7 100644 Binary files a/test/pptx/comparison/both-columns/deleted-layouts.pptx and b/test/pptx/comparison/both-columns/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx index bb5f046fd..a658045ef 100644 Binary files a/test/pptx/comparison/both-columns/moved-layouts.pptx and b/test/pptx/comparison/both-columns/moved-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx index 345833b8b..560c7d41a 100644 Binary files a/test/pptx/comparison/both-columns/output.pptx and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx index 3dcc6274f..2fb38880d 100644 Binary files a/test/pptx/comparison/both-columns/templated.pptx and b/test/pptx/comparison/both-columns/templated.pptx differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx index 0ad383194..267c7cb69 100644 Binary files a/test/pptx/comparison/extra-image/deleted-layouts.pptx and b/test/pptx/comparison/extra-image/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx index 30bf2450b..b7023026c 100644 Binary files a/test/pptx/comparison/extra-image/moved-layouts.pptx and b/test/pptx/comparison/extra-image/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx index 464a07d88..06d632ee7 100644 Binary files a/test/pptx/comparison/extra-image/output.pptx and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx index 771b16cda..af84388c4 100644 Binary files a/test/pptx/comparison/extra-image/templated.pptx and b/test/pptx/comparison/extra-image/templated.pptx differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx index 03ee6c408..27f9d9ac7 100644 Binary files a/test/pptx/comparison/extra-text/deleted-layouts.pptx and b/test/pptx/comparison/extra-text/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx index 2541e97d3..a658045ef 100644 Binary files a/test/pptx/comparison/extra-text/moved-layouts.pptx and b/test/pptx/comparison/extra-text/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx index 345833b8b..560c7d41a 100644 Binary files a/test/pptx/comparison/extra-text/output.pptx and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx index 8d78e715a..2fb38880d 100644 Binary files a/test/pptx/comparison/extra-text/templated.pptx and b/test/pptx/comparison/extra-text/templated.pptx differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx index d2fab6c94..be30d8368 100644 Binary files a/test/pptx/comparison/non-text-first/deleted-layouts.pptx and b/test/pptx/comparison/non-text-first/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx index 16d59be78..c4879b7d5 100644 Binary files a/test/pptx/comparison/non-text-first/moved-layouts.pptx and b/test/pptx/comparison/non-text-first/moved-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx index 5f5d12d2f..099cf6729 100644 Binary files a/test/pptx/comparison/non-text-first/output.pptx and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx index 520021af3..31ac01f18 100644 Binary files a/test/pptx/comparison/non-text-first/templated.pptx and b/test/pptx/comparison/non-text-first/templated.pptx differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx index 5a31c333a..27620f05f 100644 Binary files a/test/pptx/comparison/one-column/deleted-layouts.pptx and b/test/pptx/comparison/one-column/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx index cce84cc9f..fc64d3af5 100644 Binary files a/test/pptx/comparison/one-column/moved-layouts.pptx and b/test/pptx/comparison/one-column/moved-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx index cc690844f..854a968af 100644 Binary files a/test/pptx/comparison/one-column/output.pptx and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx index 309a25d6e..9e671af1d 100644 Binary files a/test/pptx/comparison/one-column/templated.pptx and b/test/pptx/comparison/one-column/templated.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx index 1a94474ea..3cd09a916 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx index 32d76ca3d..8e76bc94c 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx index aea085efc..5c680e878 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/output.pptx and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx index 07becc7f8..bdde384a4 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/templated.pptx and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx index 4e834f056..376880b41 100644 Binary files a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx index 44a689c30..9e33d3163 100644 Binary files a/test/pptx/content-with-caption/image-text/moved-layouts.pptx and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx index e1595c428..c88030b94 100644 Binary files a/test/pptx/content-with-caption/image-text/output.pptx and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx index 58264a92d..a22e9ae3e 100644 Binary files a/test/pptx/content-with-caption/image-text/templated.pptx and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx index e548a7798..2dcb8b78e 100644 Binary files a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx index ca0e74a18..7d187a168 100644 Binary files a/test/pptx/content-with-caption/text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx index 3fdf9ea07..751121cf2 100644 Binary files a/test/pptx/content-with-caption/text-image/output.pptx and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx index bd96bd723..4f0aaaa7a 100644 Binary files a/test/pptx/content-with-caption/text-image/templated.pptx and b/test/pptx/content-with-caption/text-image/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx index f8903bbd4..79517481a 100644 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx index 59674d5dd..51608c2e9 100644 Binary files a/test/pptx/document-properties-short-desc/moved-layouts.pptx and b/test/pptx/document-properties-short-desc/moved-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx index 2c1ef0faa..02c241b89 100644 Binary files a/test/pptx/document-properties-short-desc/output.pptx and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/templated.pptx b/test/pptx/document-properties-short-desc/templated.pptx index 3e004942c..82ccc072c 100644 Binary files a/test/pptx/document-properties-short-desc/templated.pptx and b/test/pptx/document-properties-short-desc/templated.pptx differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx index 229cfc5a7..12f6570cf 100644 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx index 18d35eb26..9a9d4ac3e 100644 Binary files a/test/pptx/document-properties/moved-layouts.pptx and b/test/pptx/document-properties/moved-layouts.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx index 51f7a5116..cfd3261bc 100644 Binary files a/test/pptx/document-properties/output.pptx and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/document-properties/templated.pptx b/test/pptx/document-properties/templated.pptx index 6e37cd4a1..3d52d22df 100644 Binary files a/test/pptx/document-properties/templated.pptx and b/test/pptx/document-properties/templated.pptx differ diff --git a/test/pptx/footer/basic/output.pptx b/test/pptx/footer/basic/output.pptx index 8a2595016..db8814418 100644 Binary files a/test/pptx/footer/basic/output.pptx and b/test/pptx/footer/basic/output.pptx differ diff --git a/test/pptx/footer/fixed-date/output.pptx b/test/pptx/footer/fixed-date/output.pptx index b6857e8cf..85854a744 100644 Binary files a/test/pptx/footer/fixed-date/output.pptx and b/test/pptx/footer/fixed-date/output.pptx differ diff --git a/test/pptx/footer/higher-slide-number/output.pptx b/test/pptx/footer/higher-slide-number/output.pptx index 1e3bfc5aa..c5bc3d047 100644 Binary files a/test/pptx/footer/higher-slide-number/output.pptx and b/test/pptx/footer/higher-slide-number/output.pptx differ diff --git a/test/pptx/footer/no-title-slide/output.pptx b/test/pptx/footer/no-title-slide/output.pptx index a36a80406..d1475bf1f 100644 Binary files a/test/pptx/footer/no-title-slide/output.pptx and b/test/pptx/footer/no-title-slide/output.pptx differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx index 5da21f29c..9f0f41c37 100644 Binary files a/test/pptx/images/deleted-layouts.pptx and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx index a394237ca..f26ac9e8f 100644 Binary files a/test/pptx/images/moved-layouts.pptx and b/test/pptx/images/moved-layouts.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx index 0c4a774b1..993209a45 100644 Binary files a/test/pptx/images/output.pptx and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/images/templated.pptx b/test/pptx/images/templated.pptx index 9bb4567cf..06b337538 100644 Binary files a/test/pptx/images/templated.pptx and b/test/pptx/images/templated.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx index 180ac47b7..5a74826a4 100644 Binary files a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx index 1b6fc81b2..f20dd2906 100644 Binary files a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index 2cfffc0e9..d4f76f1e7 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index 7d9292f5c..f5ee2ff5f 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx index 6d68aafef..16bd85ffd 100644 Binary files a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx index 5bb33a6b4..054fe918e 100644 Binary files a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 4afae23d9..1b326461d 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index 62b0ab802..dee6e9b06 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx index d8fd26264..1670eada1 100644 Binary files a/test/pptx/lists/deleted-layouts.pptx and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx index 30319c6b8..f7590c5f9 100644 Binary files a/test/pptx/lists/moved-layouts.pptx and b/test/pptx/lists/moved-layouts.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index 7a7c9488b..95510e92e 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 9cece3499..7af437bfe 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx index 5f672b9d8..334fdea9c 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx index 159a8bb0f..3faabfd93 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx index f1c8c8f46..96b9907cc 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/output.pptx and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/templated.pptx b/test/pptx/slide-breaks-slide-level-1/templated.pptx index 7baaf5791..9f23f1d9f 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/templated.pptx and b/test/pptx/slide-breaks-slide-level-1/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx index cd0372c89..0492ee2ec 100644 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx index dc94f201b..f3e56652c 100644 Binary files a/test/pptx/slide-breaks-toc/moved-layouts.pptx and b/test/pptx/slide-breaks-toc/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index c9df30e6b..b3063b15e 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index 36ae13623..bcb2f8276 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx index b6cd32a04..827c7dfda 100644 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx index 48c50a709..241605754 100644 Binary files a/test/pptx/slide-breaks/moved-layouts.pptx and b/test/pptx/slide-breaks/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx index 30c3c1a8e..55c09a80e 100644 Binary files a/test/pptx/slide-breaks/output.pptx and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-breaks/templated.pptx b/test/pptx/slide-breaks/templated.pptx index 84581a358..f60f7da06 100644 Binary files a/test/pptx/slide-breaks/templated.pptx and b/test/pptx/slide-breaks/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx index 8903ff6fa..7bc7cfeee 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx index 65491db8c..602df1c77 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx index bdada1cad..f725760dc 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/output.pptx and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/templated.pptx b/test/pptx/slide-level-0/h1-with-image/templated.pptx index e1c85d948..b203ff671 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/templated.pptx and b/test/pptx/slide-level-0/h1-with-image/templated.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx index 8903ff6fa..7bc7cfeee 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx index 65491db8c..602df1c77 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx index bdada1cad..f725760dc 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/output.pptx and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/templated.pptx b/test/pptx/slide-level-0/h2-with-image/templated.pptx index e1c85d948..b203ff671 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/templated.pptx and b/test/pptx/slide-level-0/h2-with-image/templated.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 30bd36e5d..9010ba04a 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx index b05079ef2..ca53605b7 100644 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index 41e3148cb..607115858 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx index 9cdc0ef9f..3be3ed0af 100644 Binary files a/test/pptx/speaker-notes-after-metadata/templated.pptx and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 54de85128..2c2a0936b 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx index 4e4a854e5..a9c8bfa0a 100644 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index 96b136ef9..ff403aa1c 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx index abdc71ebc..15435c45a 100644 Binary files a/test/pptx/speaker-notes-afterheader/templated.pptx and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index 99e499f4d..f6abb0b27 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx index 49f7360c7..6a770fc75 100644 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 3a426d29a..7e56147f1 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index 8e26e7581..3184ff74e 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index a8014c666..5429b88e0 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx index be5c383c3..13e34698d 100644 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index 0fe2b7783..74041a40d 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx index 70e1a2c88..80a3e3dea 100644 Binary files a/test/pptx/speaker-notes/templated.pptx and b/test/pptx/speaker-notes/templated.pptx differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx index 8692da129..7bfe9868f 100644 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx index 7e1a68a0d..0100365ec 100644 Binary files a/test/pptx/start-numbering-at/moved-layouts.pptx and b/test/pptx/start-numbering-at/moved-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index 95a0c8ef4..3ba9a236a 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index b4302f6d5..8a144d601 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx index ebad0c49b..163d4ca5e 100644 Binary files a/test/pptx/tables/deleted-layouts.pptx and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx index 2ad4646a6..1b0e606da 100644 Binary files a/test/pptx/tables/moved-layouts.pptx and b/test/pptx/tables/moved-layouts.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx index 81f7a21c1..1c89d8032 100644 Binary files a/test/pptx/tables/output.pptx and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/tables/templated.pptx b/test/pptx/tables/templated.pptx index 538bec0fb..5755bfe9d 100644 Binary files a/test/pptx/tables/templated.pptx and b/test/pptx/tables/templated.pptx differ diff --git a/test/pptx/two-column/all-text/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx index 58400da56..1d7bd87d3 100644 Binary files a/test/pptx/two-column/all-text/deleted-layouts.pptx and b/test/pptx/two-column/all-text/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx index 7e94ede93..71760268c 100644 Binary files a/test/pptx/two-column/all-text/moved-layouts.pptx and b/test/pptx/two-column/all-text/moved-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/output.pptx b/test/pptx/two-column/all-text/output.pptx index f5d871c53..396dc2a74 100644 Binary files a/test/pptx/two-column/all-text/output.pptx and b/test/pptx/two-column/all-text/output.pptx differ diff --git a/test/pptx/two-column/all-text/templated.pptx b/test/pptx/two-column/all-text/templated.pptx index d5f563006..8901695b1 100644 Binary files a/test/pptx/two-column/all-text/templated.pptx and b/test/pptx/two-column/all-text/templated.pptx differ diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx index 43ced4431..297fd6bad 100644 Binary files a/test/pptx/two-column/text-and-image/deleted-layouts.pptx and b/test/pptx/two-column/text-and-image/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx index 231723f10..c9a6e577e 100644 Binary files a/test/pptx/two-column/text-and-image/moved-layouts.pptx and b/test/pptx/two-column/text-and-image/moved-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx index bb6af0d74..bfd532ed9 100644 Binary files a/test/pptx/two-column/text-and-image/output.pptx and b/test/pptx/two-column/text-and-image/output.pptx differ diff --git a/test/pptx/two-column/text-and-image/templated.pptx b/test/pptx/two-column/text-and-image/templated.pptx index 4014b0bf1..23e6b283f 100644 Binary files a/test/pptx/two-column/text-and-image/templated.pptx and b/test/pptx/two-column/text-and-image/templated.pptx differ -- cgit v1.2.3 From 11baeb88505342c580cc3dd0263c4ba97e6ddb8a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 2 Oct 2021 07:03:22 -0700 Subject: OOXML tests: use pretty-printed form to display diffs. Otherwise everything is on one line and the diff is uninformative. --- test/Tests/Writers/OOXML.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Tests/Writers/OOXML.hs b/test/Tests/Writers/OOXML.hs index fea7fa70f..43543954c 100644 --- a/test/Tests/Writers/OOXML.hs +++ b/test/Tests/Writers/OOXML.hs @@ -68,10 +68,10 @@ data XMLDifference data Comparison a = Comparison { good :: a, mine :: a } deriving (Show) -displayDiff :: Content -> Content -> String +displayDiff :: Element -> Element -> String displayDiff elemA elemB = showDiff (1,1) - (getDiff (lines $ showContent elemA) (lines $ showContent elemB)) + (getDiff (lines $ ppElement elemA) (lines $ ppElement elemB)) goldenArchive :: FilePath -> IO Archive goldenArchive fp = toArchive . BL.fromStrict <$> BS.readFile fp @@ -137,7 +137,7 @@ compareXMLFile' fp goldenArch testArch = do display difference = "Non-matching xml in " ++ fp ++ ":\n" ++ "* " ++ show difference ++ "\n" - ++ displayDiff testContent goldenContent + ++ displayDiff testXMLDoc goldenXMLDoc maybe (Right ()) (Left . display) (compareXML goldenContent testContent) -- cgit v1.2.3 From b8d460eeabe97756d49e4bc5f00c6bb084b69aa5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 4 Oct 2021 12:18:18 -0700 Subject: Powerpoint writer: consolidate text runs when possible. This slims down the output files by avoiding unnecessary text run elements. Updated golden tests. --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 11 ++++++++--- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 2 +- test/pptx/background-image/deleted-layouts.pptx | Bin 56282 -> 56230 bytes test/pptx/background-image/moved-layouts.pptx | Bin 66987 -> 66932 bytes test/pptx/background-image/output.pptx | Bin 53408 -> 53358 bytes test/pptx/background-image/templated.pptx | Bin 66487 -> 66433 bytes .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35178 -> 35147 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45870 -> 45837 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32297 -> 32267 bytes test/pptx/blanks/just-speaker-notes/templated.pptx | Bin 45365 -> 45333 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 32092 -> 32085 bytes test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 42780 -> 42772 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 29211 -> 29205 bytes test/pptx/blanks/nbsp-in-body/templated.pptx | Bin 42280 -> 42273 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 32092 -> 32085 bytes test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 42780 -> 42772 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 29211 -> 29205 bytes test/pptx/blanks/nbsp-in-heading/templated.pptx | Bin 42280 -> 42273 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 32717 -> 32697 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 43405 -> 43385 bytes test/pptx/code-custom/output.pptx | Bin 29836 -> 29817 bytes test/pptx/code-custom/templated.pptx | Bin 42905 -> 42884 bytes test/pptx/code/deleted-layouts.pptx | Bin 32716 -> 32695 bytes test/pptx/code/moved-layouts.pptx | Bin 43405 -> 43383 bytes test/pptx/code/output.pptx | Bin 29835 -> 29815 bytes test/pptx/code/templated.pptx | Bin 42905 -> 42882 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 47453 -> 47441 bytes .../pptx/comparison/both-columns/moved-layouts.pptx | Bin 58172 -> 58159 bytes test/pptx/comparison/both-columns/output.pptx | Bin 44581 -> 44570 bytes test/pptx/comparison/both-columns/templated.pptx | Bin 57674 -> 57662 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 47482 -> 47470 bytes test/pptx/comparison/extra-image/moved-layouts.pptx | Bin 58200 -> 58185 bytes test/pptx/comparison/extra-image/output.pptx | Bin 44610 -> 44599 bytes test/pptx/comparison/extra-image/templated.pptx | Bin 57702 -> 57688 bytes .../pptx/comparison/extra-text/deleted-layouts.pptx | Bin 47453 -> 47441 bytes test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 58172 -> 58159 bytes test/pptx/comparison/extra-text/output.pptx | Bin 44581 -> 44570 bytes test/pptx/comparison/extra-text/templated.pptx | Bin 57674 -> 57662 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 47366 -> 47355 bytes .../comparison/non-text-first/moved-layouts.pptx | Bin 58065 -> 58050 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 44494 -> 44484 bytes test/pptx/comparison/non-text-first/templated.pptx | Bin 57567 -> 57553 bytes .../pptx/comparison/one-column/deleted-layouts.pptx | Bin 30785 -> 30780 bytes test/pptx/comparison/one-column/moved-layouts.pptx | Bin 41506 -> 41499 bytes test/pptx/comparison/one-column/output.pptx | Bin 27906 -> 27902 bytes test/pptx/comparison/one-column/templated.pptx | Bin 41006 -> 41000 bytes .../heading-text-image/deleted-layouts.pptx | Bin 47198 -> 47189 bytes .../heading-text-image/moved-layouts.pptx | Bin 57896 -> 57887 bytes .../heading-text-image/output.pptx | Bin 44326 -> 44318 bytes .../heading-text-image/templated.pptx | Bin 57398 -> 57390 bytes .../image-text/deleted-layouts.pptx | Bin 47896 -> 47891 bytes .../image-text/moved-layouts.pptx | Bin 58584 -> 58578 bytes .../content-with-caption/image-text/output.pptx | Bin 45022 -> 45019 bytes .../content-with-caption/image-text/templated.pptx | Bin 58084 -> 58079 bytes .../text-image/deleted-layouts.pptx | Bin 47137 -> 47129 bytes .../text-image/moved-layouts.pptx | Bin 57836 -> 57827 bytes .../content-with-caption/text-image/output.pptx | Bin 44265 -> 44258 bytes .../content-with-caption/text-image/templated.pptx | Bin 57338 -> 57330 bytes .../deleted-layouts.pptx | Bin 31490 -> 31483 bytes .../moved-layouts.pptx | Bin 42178 -> 42171 bytes .../pptx/document-properties-short-desc/output.pptx | Bin 28619 -> 28613 bytes .../document-properties-short-desc/templated.pptx | Bin 41678 -> 41671 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 31894 -> 31886 bytes test/pptx/document-properties/moved-layouts.pptx | Bin 42582 -> 42573 bytes test/pptx/document-properties/output.pptx | Bin 29025 -> 29015 bytes test/pptx/document-properties/templated.pptx | Bin 42082 -> 42073 bytes test/pptx/footer/basic/output.pptx | Bin 52775 -> 52727 bytes test/pptx/footer/fixed-date/output.pptx | Bin 51397 -> 51354 bytes test/pptx/footer/higher-slide-number/output.pptx | Bin 52790 -> 52740 bytes test/pptx/footer/no-title-slide/output.pptx | Bin 52362 -> 52314 bytes test/pptx/images/deleted-layouts.pptx | Bin 49121 -> 49113 bytes test/pptx/images/moved-layouts.pptx | Bin 59809 -> 59801 bytes test/pptx/images/output.pptx | Bin 46244 -> 46235 bytes test/pptx/images/templated.pptx | Bin 59308 -> 59299 bytes .../with-flag/deleted-layouts.pptx | Bin 80172 -> 80042 bytes .../incremental-lists/with-flag/moved-layouts.pptx | Bin 90917 -> 90782 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77298 -> 77169 bytes .../pptx/incremental-lists/with-flag/templated.pptx | Bin 90414 -> 90280 bytes .../without-flag/deleted-layouts.pptx | Bin 78405 -> 78282 bytes .../without-flag/moved-layouts.pptx | Bin 89148 -> 89020 bytes .../pptx/incremental-lists/without-flag/output.pptx | Bin 75533 -> 75411 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88645 -> 88518 bytes test/pptx/lists/deleted-layouts.pptx | Bin 31545 -> 31540 bytes test/pptx/lists/moved-layouts.pptx | Bin 42233 -> 42230 bytes test/pptx/lists/output.pptx | Bin 28667 -> 28664 bytes test/pptx/lists/templated.pptx | Bin 41733 -> 41729 bytes .../slide-breaks-slide-level-1/deleted-layouts.pptx | Bin 32238 -> 32233 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 42926 -> 42923 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 29357 -> 29354 bytes test/pptx/slide-breaks-slide-level-1/templated.pptx | Bin 42426 -> 42422 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 34012 -> 34006 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 44701 -> 44696 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31133 -> 31129 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 44201 -> 44195 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 33062 -> 33056 bytes test/pptx/slide-breaks/moved-layouts.pptx | Bin 43751 -> 43746 bytes test/pptx/slide-breaks/output.pptx | Bin 30183 -> 30179 bytes test/pptx/slide-breaks/templated.pptx | Bin 43250 -> 43244 bytes .../h1-with-image/deleted-layouts.pptx | Bin 47118 -> 47114 bytes .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 57804 -> 57800 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 44245 -> 44242 bytes .../pptx/slide-level-0/h1-with-image/templated.pptx | Bin 57306 -> 57302 bytes .../h2-with-image/deleted-layouts.pptx | Bin 47118 -> 47114 bytes .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 57804 -> 57800 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 44245 -> 44242 bytes .../pptx/slide-level-0/h2-with-image/templated.pptx | Bin 57306 -> 57302 bytes .../deleted-layouts.pptx | Bin 34504 -> 34486 bytes .../speaker-notes-after-metadata/moved-layouts.pptx | Bin 45193 -> 45176 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31634 -> 31617 bytes .../speaker-notes-after-metadata/templated.pptx | Bin 44690 -> 44673 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33532 -> 33507 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44220 -> 44195 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30653 -> 30629 bytes test/pptx/speaker-notes-afterheader/templated.pptx | Bin 43719 -> 43693 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54429 -> 54374 bytes .../pptx/speaker-notes-afterseps/moved-layouts.pptx | Bin 65119 -> 65064 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51548 -> 51494 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64614 -> 64558 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38236 -> 38206 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 48929 -> 48899 bytes test/pptx/speaker-notes/output.pptx | Bin 35358 -> 35329 bytes test/pptx/speaker-notes/templated.pptx | Bin 48423 -> 48392 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 31521 -> 31502 bytes test/pptx/start-numbering-at/moved-layouts.pptx | Bin 42209 -> 42192 bytes test/pptx/start-numbering-at/output.pptx | Bin 28643 -> 28626 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41709 -> 41691 bytes test/pptx/tables/deleted-layouts.pptx | Bin 32065 -> 32040 bytes test/pptx/tables/moved-layouts.pptx | Bin 42753 -> 42729 bytes test/pptx/tables/output.pptx | Bin 29184 -> 29160 bytes test/pptx/tables/templated.pptx | Bin 42253 -> 42228 bytes test/pptx/two-column/all-text/deleted-layouts.pptx | Bin 30568 -> 30567 bytes test/pptx/two-column/all-text/moved-layouts.pptx | Bin 41256 -> 41255 bytes test/pptx/two-column/all-text/output.pptx | Bin 27689 -> 27689 bytes test/pptx/two-column/all-text/templated.pptx | Bin 40756 -> 40754 bytes .../two-column/text-and-image/deleted-layouts.pptx | Bin 48392 -> 48381 bytes .../two-column/text-and-image/moved-layouts.pptx | Bin 59086 -> 59075 bytes test/pptx/two-column/text-and-image/output.pptx | Bin 45520 -> 45510 bytes test/pptx/two-column/text-and-image/templated.pptx | Bin 58586 -> 58574 bytes 138 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index f4700e8c1..42ce780fa 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -1088,6 +1088,12 @@ makePicElements layout picProps mInfo titleText alt = do return [picShape, cap] else return [picShape] +consolidateRuns :: [ParaElem] -> [ParaElem] +consolidateRuns [] = [] +consolidateRuns (Run pr1 s1 : Run pr2 s2 : xs) + | pr1 == pr2 = consolidateRuns (Run pr1 (s1 <> s2) : xs) +consolidateRuns (x:xs) = x : consolidateRuns xs + paraElemToElements :: PandocMonad m => ParaElem -> P m [Content] paraElemToElements Break = return [Elem $ mknode "a:br" [] ()] @@ -1223,9 +1229,8 @@ paragraphToElement par = do [mknode "a:buAutoNum" (autoNumAttrs attrs') ()] Nothing -> [mknode "a:buNone" [] ()] ) - paras <- mapM paraElemToElements (paraElems par) - return $ mknode "a:p" [] $ - [Elem $ mknode "a:pPr" attrs props] <> concat paras + paras <- mconcat <$> mapM paraElemToElements (consolidateRuns (paraElems par)) + return $ mknode "a:p" [] $ [Elem $ mknode "a:pPr" attrs props] <> paras shapeToElement :: PandocMonad m => Element -> Shape -> P m (Maybe ShapeId, Element) shapeToElement layout (TextBox paras) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index e3d31d099..99b016a63 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -348,7 +348,7 @@ instance Default PicProps where -------------------------------------------------- inlinesToParElems :: [Inline] -> Pres [ParaElem] -inlinesToParElems ils = concatMapM inlineToParElems ils +inlinesToParElems = concatMapM inlineToParElems inlineToParElems :: Inline -> Pres [ParaElem] inlineToParElems (Str s) = do diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx index 05d4104b7..e46a58ad7 100644 Binary files a/test/pptx/background-image/deleted-layouts.pptx and b/test/pptx/background-image/deleted-layouts.pptx differ diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx index 73b69e1d6..98fe33095 100644 Binary files a/test/pptx/background-image/moved-layouts.pptx and b/test/pptx/background-image/moved-layouts.pptx differ diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx index 9738eefb8..abe82ebc2 100644 Binary files a/test/pptx/background-image/output.pptx and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/background-image/templated.pptx b/test/pptx/background-image/templated.pptx index 52d304957..0f2879022 100644 Binary files a/test/pptx/background-image/templated.pptx and b/test/pptx/background-image/templated.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx index 5038f2aaf..f729c3ce6 100644 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx index 90353a560..dfae6a645 100644 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 799c0f14a..0c4ed20fa 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/templated.pptx b/test/pptx/blanks/just-speaker-notes/templated.pptx index 5e3afb5f8..f9eca6f8c 100644 Binary files a/test/pptx/blanks/just-speaker-notes/templated.pptx and b/test/pptx/blanks/just-speaker-notes/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx index 7716e1cbf..dcd88cb24 100644 Binary files a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx index 3dc6c817e..0a69853fa 100644 Binary files a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx index 1df3f9574..6265c842f 100644 Binary files a/test/pptx/blanks/nbsp-in-body/output.pptx and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/templated.pptx b/test/pptx/blanks/nbsp-in-body/templated.pptx index 1cf58a1bb..758502dd0 100644 Binary files a/test/pptx/blanks/nbsp-in-body/templated.pptx and b/test/pptx/blanks/nbsp-in-body/templated.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx index 7716e1cbf..dcd88cb24 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx index 3dc6c817e..0a69853fa 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx and b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx index e528091d7..6265c842f 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/output.pptx and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/templated.pptx b/test/pptx/blanks/nbsp-in-heading/templated.pptx index 1f2d91399..758502dd0 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/templated.pptx and b/test/pptx/blanks/nbsp-in-heading/templated.pptx differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx index b49cd4896..f8b1c789e 100644 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and b/test/pptx/code-custom/deleted-layouts.pptx differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx index c6806f37f..810b46dd1 100644 Binary files a/test/pptx/code-custom/moved-layouts.pptx and b/test/pptx/code-custom/moved-layouts.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index a72bebbe2..ded8f1125 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 2bdb526fa..8bb0df1ff 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx index df7814599..3127e20e5 100644 Binary files a/test/pptx/code/deleted-layouts.pptx and b/test/pptx/code/deleted-layouts.pptx differ diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx index 71e8560bd..7a2e3b7ac 100644 Binary files a/test/pptx/code/moved-layouts.pptx and b/test/pptx/code/moved-layouts.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index 4b70df2c7..e700bc268 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index 1285a9273..44f34cd64 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx index 27f9d9ac7..6d80e275f 100644 Binary files a/test/pptx/comparison/both-columns/deleted-layouts.pptx and b/test/pptx/comparison/both-columns/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx index a658045ef..2840e0535 100644 Binary files a/test/pptx/comparison/both-columns/moved-layouts.pptx and b/test/pptx/comparison/both-columns/moved-layouts.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx index 560c7d41a..47f807754 100644 Binary files a/test/pptx/comparison/both-columns/output.pptx and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/both-columns/templated.pptx b/test/pptx/comparison/both-columns/templated.pptx index 2fb38880d..945bc6dc4 100644 Binary files a/test/pptx/comparison/both-columns/templated.pptx and b/test/pptx/comparison/both-columns/templated.pptx differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx index 267c7cb69..771ad409a 100644 Binary files a/test/pptx/comparison/extra-image/deleted-layouts.pptx and b/test/pptx/comparison/extra-image/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx index b7023026c..2418e98c1 100644 Binary files a/test/pptx/comparison/extra-image/moved-layouts.pptx and b/test/pptx/comparison/extra-image/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx index 06d632ee7..f700e09a8 100644 Binary files a/test/pptx/comparison/extra-image/output.pptx and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-image/templated.pptx b/test/pptx/comparison/extra-image/templated.pptx index af84388c4..2e48ffe87 100644 Binary files a/test/pptx/comparison/extra-image/templated.pptx and b/test/pptx/comparison/extra-image/templated.pptx differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx index 27f9d9ac7..c87b3f3ee 100644 Binary files a/test/pptx/comparison/extra-text/deleted-layouts.pptx and b/test/pptx/comparison/extra-text/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx index a658045ef..2840e0535 100644 Binary files a/test/pptx/comparison/extra-text/moved-layouts.pptx and b/test/pptx/comparison/extra-text/moved-layouts.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx index 560c7d41a..47f807754 100644 Binary files a/test/pptx/comparison/extra-text/output.pptx and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/extra-text/templated.pptx b/test/pptx/comparison/extra-text/templated.pptx index 2fb38880d..debb62d52 100644 Binary files a/test/pptx/comparison/extra-text/templated.pptx and b/test/pptx/comparison/extra-text/templated.pptx differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx index be30d8368..95b2e3a3c 100644 Binary files a/test/pptx/comparison/non-text-first/deleted-layouts.pptx and b/test/pptx/comparison/non-text-first/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx index c4879b7d5..5a60028d4 100644 Binary files a/test/pptx/comparison/non-text-first/moved-layouts.pptx and b/test/pptx/comparison/non-text-first/moved-layouts.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx index 099cf6729..c8a2bd0e3 100644 Binary files a/test/pptx/comparison/non-text-first/output.pptx and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/templated.pptx b/test/pptx/comparison/non-text-first/templated.pptx index 31ac01f18..a19b469b1 100644 Binary files a/test/pptx/comparison/non-text-first/templated.pptx and b/test/pptx/comparison/non-text-first/templated.pptx differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx index 27620f05f..6a705c735 100644 Binary files a/test/pptx/comparison/one-column/deleted-layouts.pptx and b/test/pptx/comparison/one-column/deleted-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx index fc64d3af5..f456151a5 100644 Binary files a/test/pptx/comparison/one-column/moved-layouts.pptx and b/test/pptx/comparison/one-column/moved-layouts.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx index 854a968af..e70dd2326 100644 Binary files a/test/pptx/comparison/one-column/output.pptx and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/comparison/one-column/templated.pptx b/test/pptx/comparison/one-column/templated.pptx index 9e671af1d..fa5c2dc87 100644 Binary files a/test/pptx/comparison/one-column/templated.pptx and b/test/pptx/comparison/one-column/templated.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx index 3cd09a916..d01a8f9d8 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx index 8e76bc94c..69cb830a9 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx index 5c680e878..0677879aa 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/output.pptx and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/templated.pptx b/test/pptx/content-with-caption/heading-text-image/templated.pptx index bdde384a4..059d4f460 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/templated.pptx and b/test/pptx/content-with-caption/heading-text-image/templated.pptx differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx index 376880b41..e9aebd579 100644 Binary files a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx and b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx index 9e33d3163..c27f1e1cf 100644 Binary files a/test/pptx/content-with-caption/image-text/moved-layouts.pptx and b/test/pptx/content-with-caption/image-text/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx index c88030b94..f461b6ed3 100644 Binary files a/test/pptx/content-with-caption/image-text/output.pptx and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/templated.pptx b/test/pptx/content-with-caption/image-text/templated.pptx index a22e9ae3e..a9c6aa43d 100644 Binary files a/test/pptx/content-with-caption/image-text/templated.pptx and b/test/pptx/content-with-caption/image-text/templated.pptx differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx index 2dcb8b78e..f15e674c7 100644 Binary files a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx and b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx index 7d187a168..39566cd7f 100644 Binary files a/test/pptx/content-with-caption/text-image/moved-layouts.pptx and b/test/pptx/content-with-caption/text-image/moved-layouts.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx index 751121cf2..be376c1ed 100644 Binary files a/test/pptx/content-with-caption/text-image/output.pptx and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/templated.pptx b/test/pptx/content-with-caption/text-image/templated.pptx index 4f0aaaa7a..185314bf4 100644 Binary files a/test/pptx/content-with-caption/text-image/templated.pptx and b/test/pptx/content-with-caption/text-image/templated.pptx differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx index 79517481a..a6da0c338 100644 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and b/test/pptx/document-properties-short-desc/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx index 51608c2e9..4cff1d486 100644 Binary files a/test/pptx/document-properties-short-desc/moved-layouts.pptx and b/test/pptx/document-properties-short-desc/moved-layouts.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx index 02c241b89..737ca7e8d 100644 Binary files a/test/pptx/document-properties-short-desc/output.pptx and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/templated.pptx b/test/pptx/document-properties-short-desc/templated.pptx index 82ccc072c..4feccdac7 100644 Binary files a/test/pptx/document-properties-short-desc/templated.pptx and b/test/pptx/document-properties-short-desc/templated.pptx differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx index 12f6570cf..a2a58af34 100644 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and b/test/pptx/document-properties/deleted-layouts.pptx differ diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx index 9a9d4ac3e..e24d904a2 100644 Binary files a/test/pptx/document-properties/moved-layouts.pptx and b/test/pptx/document-properties/moved-layouts.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx index cfd3261bc..ef05c01b5 100644 Binary files a/test/pptx/document-properties/output.pptx and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/document-properties/templated.pptx b/test/pptx/document-properties/templated.pptx index 3d52d22df..df6acb70c 100644 Binary files a/test/pptx/document-properties/templated.pptx and b/test/pptx/document-properties/templated.pptx differ diff --git a/test/pptx/footer/basic/output.pptx b/test/pptx/footer/basic/output.pptx index db8814418..2af46108c 100644 Binary files a/test/pptx/footer/basic/output.pptx and b/test/pptx/footer/basic/output.pptx differ diff --git a/test/pptx/footer/fixed-date/output.pptx b/test/pptx/footer/fixed-date/output.pptx index 85854a744..678ecdb87 100644 Binary files a/test/pptx/footer/fixed-date/output.pptx and b/test/pptx/footer/fixed-date/output.pptx differ diff --git a/test/pptx/footer/higher-slide-number/output.pptx b/test/pptx/footer/higher-slide-number/output.pptx index c5bc3d047..651491107 100644 Binary files a/test/pptx/footer/higher-slide-number/output.pptx and b/test/pptx/footer/higher-slide-number/output.pptx differ diff --git a/test/pptx/footer/no-title-slide/output.pptx b/test/pptx/footer/no-title-slide/output.pptx index d1475bf1f..c470cbb94 100644 Binary files a/test/pptx/footer/no-title-slide/output.pptx and b/test/pptx/footer/no-title-slide/output.pptx differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx index 9f0f41c37..3c3ed787f 100644 Binary files a/test/pptx/images/deleted-layouts.pptx and b/test/pptx/images/deleted-layouts.pptx differ diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx index f26ac9e8f..b22f3652a 100644 Binary files a/test/pptx/images/moved-layouts.pptx and b/test/pptx/images/moved-layouts.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx index 993209a45..9b04881f3 100644 Binary files a/test/pptx/images/output.pptx and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/images/templated.pptx b/test/pptx/images/templated.pptx index 06b337538..cad0b2f04 100644 Binary files a/test/pptx/images/templated.pptx and b/test/pptx/images/templated.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx index 5a74826a4..3e92d4dab 100644 Binary files a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx index f20dd2906..050842865 100644 Binary files a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index d4f76f1e7..1ca1dbf17 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index f5ee2ff5f..4ddf6bb75 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx index 16bd85ffd..4816c0b39 100644 Binary files a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx and b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx index 054fe918e..4f27db07b 100644 Binary files a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx and b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 1b326461d..6f7261ba3 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index dee6e9b06..ca5c9fdab 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx index 1670eada1..d064b7fd5 100644 Binary files a/test/pptx/lists/deleted-layouts.pptx and b/test/pptx/lists/deleted-layouts.pptx differ diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx index f7590c5f9..8a9c9ec59 100644 Binary files a/test/pptx/lists/moved-layouts.pptx and b/test/pptx/lists/moved-layouts.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index 95510e92e..94a424f42 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 7af437bfe..52097489f 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx index 334fdea9c..b6b004cd6 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx index 3faabfd93..229e4c32a 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx and b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx index 96b9907cc..cb65ab335 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/output.pptx and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/templated.pptx b/test/pptx/slide-breaks-slide-level-1/templated.pptx index 9f23f1d9f..ca2e844cc 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/templated.pptx and b/test/pptx/slide-breaks-slide-level-1/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx index 0492ee2ec..e3b3b2807 100644 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and b/test/pptx/slide-breaks-toc/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx index f3e56652c..ecc942803 100644 Binary files a/test/pptx/slide-breaks-toc/moved-layouts.pptx and b/test/pptx/slide-breaks-toc/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index b3063b15e..788cdf148 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index bcb2f8276..d11744079 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx index 827c7dfda..ada3453b0 100644 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and b/test/pptx/slide-breaks/deleted-layouts.pptx differ diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx index 241605754..0fe10f443 100644 Binary files a/test/pptx/slide-breaks/moved-layouts.pptx and b/test/pptx/slide-breaks/moved-layouts.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx index 55c09a80e..7c2c7db5e 100644 Binary files a/test/pptx/slide-breaks/output.pptx and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-breaks/templated.pptx b/test/pptx/slide-breaks/templated.pptx index f60f7da06..5bf186f4e 100644 Binary files a/test/pptx/slide-breaks/templated.pptx and b/test/pptx/slide-breaks/templated.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx index 7bc7cfeee..478dde788 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx index 602df1c77..63b411888 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx index f725760dc..70fc6aee2 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/output.pptx and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/templated.pptx b/test/pptx/slide-level-0/h1-with-image/templated.pptx index b203ff671..7a023480f 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/templated.pptx and b/test/pptx/slide-level-0/h1-with-image/templated.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx index 7bc7cfeee..478dde788 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx index 602df1c77..63b411888 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx and b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx index f725760dc..70fc6aee2 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/output.pptx and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/templated.pptx b/test/pptx/slide-level-0/h2-with-image/templated.pptx index b203ff671..7a023480f 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/templated.pptx and b/test/pptx/slide-level-0/h2-with-image/templated.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx index 9010ba04a..07e21ef02 100644 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx index ca53605b7..d6673aac0 100644 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index 607115858..f68d6f0ef 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/templated.pptx b/test/pptx/speaker-notes-after-metadata/templated.pptx index 3be3ed0af..fd95c935e 100644 Binary files a/test/pptx/speaker-notes-after-metadata/templated.pptx and b/test/pptx/speaker-notes-after-metadata/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx index 2c2a0936b..0ccdd72b7 100644 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx index a9c8bfa0a..81f0a56cb 100644 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index ff403aa1c..9df78756b 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/templated.pptx b/test/pptx/speaker-notes-afterheader/templated.pptx index 15435c45a..b85f22961 100644 Binary files a/test/pptx/speaker-notes-afterheader/templated.pptx and b/test/pptx/speaker-notes-afterheader/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx index f6abb0b27..33dedf2c3 100644 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx index 6a770fc75..28bcf3887 100644 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 7e56147f1..99110d3ca 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index 3184ff74e..daf8e2175 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx index 5429b88e0..5f407086a 100644 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and b/test/pptx/speaker-notes/deleted-layouts.pptx differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx index 13e34698d..83d5ed0af 100644 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and b/test/pptx/speaker-notes/moved-layouts.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index 74041a40d..6ae003d7a 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/speaker-notes/templated.pptx b/test/pptx/speaker-notes/templated.pptx index 80a3e3dea..f35bf5d88 100644 Binary files a/test/pptx/speaker-notes/templated.pptx and b/test/pptx/speaker-notes/templated.pptx differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx index 7bfe9868f..d99fedfa6 100644 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and b/test/pptx/start-numbering-at/deleted-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx index 0100365ec..98db3ec74 100644 Binary files a/test/pptx/start-numbering-at/moved-layouts.pptx and b/test/pptx/start-numbering-at/moved-layouts.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index 3ba9a236a..bc74ec599 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index 8a144d601..4f191a06e 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx index 163d4ca5e..7ad714058 100644 Binary files a/test/pptx/tables/deleted-layouts.pptx and b/test/pptx/tables/deleted-layouts.pptx differ diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx index 1b0e606da..9628717d7 100644 Binary files a/test/pptx/tables/moved-layouts.pptx and b/test/pptx/tables/moved-layouts.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx index 1c89d8032..4398e35be 100644 Binary files a/test/pptx/tables/output.pptx and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/tables/templated.pptx b/test/pptx/tables/templated.pptx index 5755bfe9d..7259e15dd 100644 Binary files a/test/pptx/tables/templated.pptx and b/test/pptx/tables/templated.pptx differ diff --git a/test/pptx/two-column/all-text/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx index 1d7bd87d3..a321128b5 100644 Binary files a/test/pptx/two-column/all-text/deleted-layouts.pptx and b/test/pptx/two-column/all-text/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx index 71760268c..90b1d9254 100644 Binary files a/test/pptx/two-column/all-text/moved-layouts.pptx and b/test/pptx/two-column/all-text/moved-layouts.pptx differ diff --git a/test/pptx/two-column/all-text/output.pptx b/test/pptx/two-column/all-text/output.pptx index 396dc2a74..45f651ceb 100644 Binary files a/test/pptx/two-column/all-text/output.pptx and b/test/pptx/two-column/all-text/output.pptx differ diff --git a/test/pptx/two-column/all-text/templated.pptx b/test/pptx/two-column/all-text/templated.pptx index 8901695b1..01a3cdb0c 100644 Binary files a/test/pptx/two-column/all-text/templated.pptx and b/test/pptx/two-column/all-text/templated.pptx differ diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx index 297fd6bad..46274ffac 100644 Binary files a/test/pptx/two-column/text-and-image/deleted-layouts.pptx and b/test/pptx/two-column/text-and-image/deleted-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx index c9a6e577e..c25331e23 100644 Binary files a/test/pptx/two-column/text-and-image/moved-layouts.pptx and b/test/pptx/two-column/text-and-image/moved-layouts.pptx differ diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx index bfd532ed9..aab0b3b59 100644 Binary files a/test/pptx/two-column/text-and-image/output.pptx and b/test/pptx/two-column/text-and-image/output.pptx differ diff --git a/test/pptx/two-column/text-and-image/templated.pptx b/test/pptx/two-column/text-and-image/templated.pptx index 23e6b283f..5cae9b43b 100644 Binary files a/test/pptx/two-column/text-and-image/templated.pptx and b/test/pptx/two-column/text-and-image/templated.pptx differ -- cgit v1.2.3 From 6c507a66cf007ee0d7739ef4c4217f6984db49ef Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 3 Oct 2021 19:11:12 -0700 Subject: Avoid bad wraps in markdown writer at the Doc Text level. Previously we tried to do this at the Inline list level, but it makes more sense to intervene on breaking spaces at the Doc Text level. --- src/Text/Pandoc/Writers/Markdown/Inline.hs | 45 +++++++++++++++--------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs index 31c816e36..ab9674026 100644 --- a/src/Text/Pandoc/Writers/Markdown/Inline.hs +++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs @@ -190,11 +190,13 @@ getReference attr label target = do (stKeys s) }) return lab' + + -- | Convert list of Pandoc inline elements to markdown. inlineListToMarkdown :: PandocMonad m => WriterOptions -> [Inline] -> MD m (Doc Text) -inlineListToMarkdown opts lst = do - inlist <- asks envInList - go (if inlist then avoidBadWrapsInList lst else lst) +inlineListToMarkdown opts ils = do + inlist <- asks envInList + avoidBadWraps inlist <$> go ils where go [] = return empty go (x@Math{}:y@(Str t):zs) | T.all isDigit (T.take 1 t) -- starts with digit -- see #7058 @@ -235,26 +237,25 @@ inlineListToMarkdown opts lst = do fmap (iMark <>) (go is) thead = fmap fst . T.uncons -isSp :: Inline -> Bool -isSp Space = True -isSp SoftBreak = True -isSp _ = False +-- Remove breaking spaces that might cause bad wraps. +avoidBadWraps :: Bool -> Doc Text -> Doc Text +avoidBadWraps inListItem = go . toList + where + go [] = mempty + go (BreakingSpace : Text len t : BreakingSpace : xs) + = case T.uncons t of + Just (c,t') + | c == '>' + || ((c == '-' || c == '*' || c == '+') && T.null t') + || (inListItem && isOrderedListMarker t) + || (t == "1." || t == "1)") + -> Text (len + 1) (" " <> t) <> go (BreakingSpace : xs) + _ -> BreakingSpace <> Text len t <> go (BreakingSpace : xs) + go (x:xs) = x <> go xs -avoidBadWrapsInList :: [Inline] -> [Inline] -avoidBadWrapsInList [] = [] -avoidBadWrapsInList (s:Str (T.uncons -> Just ('>',cs)):xs) | isSp s = - Str (" >" <> cs) : avoidBadWrapsInList xs -avoidBadWrapsInList [s, Str (T.uncons -> Just (c, cs))] - | T.null cs && isSp s && c `elem` ['-','*','+'] = [Str $ T.pack [' ', c]] -avoidBadWrapsInList (s:Str (T.uncons -> Just (c, cs)):Space:xs) - | T.null cs && isSp s && c `elem` ['-','*','+'] = - Str (T.pack [' ', c]) : Space : avoidBadWrapsInList xs -avoidBadWrapsInList (s:Str cs:Space:xs) - | isSp s && isOrderedListMarker cs = - Str (" " <> cs) : Space : avoidBadWrapsInList xs -avoidBadWrapsInList [s, Str cs] - | isSp s && isOrderedListMarker cs = [Str $ " " <> cs] -avoidBadWrapsInList (x:xs) = x : avoidBadWrapsInList xs + toList (Concat (Concat a b) c) = toList (Concat a (Concat b c)) + toList (Concat a b) = a : toList b + toList x = [x] isOrderedListMarker :: Text -> Bool isOrderedListMarker xs = not (T.null xs) && (T.last xs `elem` ['.',')']) && -- cgit v1.2.3 From 72c4064f1e20322de3b53509eed18bc035a14ee4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 5 Oct 2021 08:45:41 -0700 Subject: Improve quick-cabal target --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f8fea8028..77d4c81ab 100644 --- a/Makefile +++ b/Makefile @@ -26,8 +26,8 @@ quick: quick-cabal: cabal v2-build -j8 --ghc-options '$(GHCOPTS)' --disable-optimization --enable-tests - cabal v2-test --test-option=--hide-successes --test-option=--ansi-tricks=false $(TESTARGS) - cabal v2-install --disable-optimization + cabal v2-test --disable-optimization --test-options="--hide-successes --ansi-tricks=false $(TESTARGS)" + echo "Path to built executable:" && cabal exec -- sh -c 'command -v pandoc' full-cabal: cabal v2-configure . --ghc-options '$(GHCOPTS)' --flags '+embed_data_files +trypandoc' --enable-tests --enable-benchmarks -- cgit v1.2.3 From 57734628e570acfe0cceac57862b89d33ddf57ca Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 5 Oct 2021 08:46:29 -0700 Subject: Allow time 1.12. --- pandoc.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index a55dbcc22..9b59c8c98 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -576,7 +576,7 @@ library texmath >= 0.12.3.1 && < 0.12.4, text >= 1.1.1.0 && < 1.3, text-conversions >= 0.3 && < 0.4, - time >= 1.5 && < 1.12, + time >= 1.5 && < 1.13, unicode-transforms >= 0.3 && < 0.4, unordered-containers >= 0.2 && < 0.3, xml >= 1.3.12 && < 1.4, @@ -856,7 +856,7 @@ test-suite test-pandoc tasty-lua >= 0.2 && < 0.3, tasty-quickcheck >= 0.8 && < 0.11, text >= 1.1.1.0 && < 1.3, - time >= 1.5 && < 1.12, + time >= 1.5 && < 1.13, xml >= 1.3.12 && < 1.4, zip-archive >= 0.2.3.4 && < 0.5 other-modules: Tests.Old -- cgit v1.2.3 From 5a1bd526776a9c75a1f348f42415d15d78969e8b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 6 Oct 2021 12:33:22 -0700 Subject: Don't prepend `file://` to `--syntax-definition` on Windows. This was a fix for a problem in skylighting, but this problem doesn't exist now that we've moved from HXT to xml-conduit. Cf. #6374. --- src/Text/Pandoc/App/CommandLineOptions.hs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index 99017000a..0d3c12c30 100644 --- a/src/Text/Pandoc/App/CommandLineOptions.hs +++ b/src/Text/Pandoc/App/CommandLineOptions.hs @@ -337,14 +337,8 @@ options = , Option "" ["syntax-definition"] (ReqArg - (\arg opt -> do - let tr c d = map (\x -> if x == c then d else x) - let arg' = case arg of -- see #4836 - -- HXT confuses Windows path with URI - _:':':'\\':_ -> - "file:///" ++ tr '\\' '/' arg - _ -> normalizePath arg - return opt{ optSyntaxDefinitions = arg' : + (\arg opt -> + return opt{ optSyntaxDefinitions = normalizePath arg : optSyntaxDefinitions opt }) "FILE") "" -- "Syntax definition (xml) file" -- cgit v1.2.3 From aa78765bf9d21b3a617a9eafba59dd59e362aa6b Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 7 Oct 2021 15:25:15 +0100 Subject: pptx: Remove excessive layout tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When I added the tests for moved layouts and deleted layouts, I added them to all tests. However, this doesn’t really give a lot more info than having single tests, and the extra tests take up time and disk space. This commit removes the moved-layouts and deleted-layouts tests, in favour of a single test for each of those scenarios. --- test/Tests/Writers/Powerpoint.hs | 35 +++++++++------------ test/pptx/background-image/deleted-layouts.pptx | Bin 56230 -> 0 bytes test/pptx/background-image/moved-layouts.pptx | Bin 66932 -> 0 bytes .../blanks/just-speaker-notes/deleted-layouts.pptx | Bin 35147 -> 0 bytes .../blanks/just-speaker-notes/moved-layouts.pptx | Bin 45837 -> 0 bytes test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx | Bin 32085 -> 0 bytes test/pptx/blanks/nbsp-in-body/moved-layouts.pptx | Bin 42772 -> 0 bytes .../blanks/nbsp-in-heading/deleted-layouts.pptx | Bin 32085 -> 0 bytes .../pptx/blanks/nbsp-in-heading/moved-layouts.pptx | Bin 42772 -> 0 bytes test/pptx/code-custom/deleted-layouts.pptx | Bin 32697 -> 0 bytes test/pptx/code-custom/moved-layouts.pptx | Bin 43385 -> 0 bytes test/pptx/code/deleted-layouts.pptx | Bin 32695 -> 0 bytes test/pptx/code/moved-layouts.pptx | Bin 43383 -> 0 bytes .../comparison/both-columns/deleted-layouts.pptx | Bin 47441 -> 0 bytes .../comparison/both-columns/moved-layouts.pptx | Bin 58159 -> 0 bytes .../comparison/extra-image/deleted-layouts.pptx | Bin 47470 -> 0 bytes .../pptx/comparison/extra-image/moved-layouts.pptx | Bin 58185 -> 0 bytes .../comparison/extra-text/deleted-layouts.pptx | Bin 47441 -> 0 bytes test/pptx/comparison/extra-text/moved-layouts.pptx | Bin 58159 -> 0 bytes .../comparison/non-text-first/deleted-layouts.pptx | Bin 47355 -> 0 bytes .../comparison/non-text-first/moved-layouts.pptx | Bin 58050 -> 0 bytes .../comparison/one-column/deleted-layouts.pptx | Bin 30780 -> 0 bytes test/pptx/comparison/one-column/moved-layouts.pptx | Bin 41499 -> 0 bytes .../heading-text-image/deleted-layouts.pptx | Bin 47189 -> 0 bytes .../heading-text-image/moved-layouts.pptx | Bin 57887 -> 0 bytes .../image-text/deleted-layouts.pptx | Bin 47891 -> 0 bytes .../image-text/moved-layouts.pptx | Bin 58578 -> 0 bytes .../text-image/deleted-layouts.pptx | Bin 47129 -> 0 bytes .../text-image/moved-layouts.pptx | Bin 57827 -> 0 bytes .../deleted-layouts.pptx | Bin 31483 -> 0 bytes .../moved-layouts.pptx | Bin 42171 -> 0 bytes test/pptx/document-properties/deleted-layouts.pptx | Bin 31886 -> 0 bytes test/pptx/document-properties/moved-layouts.pptx | Bin 42573 -> 0 bytes test/pptx/endnotes-toc/deleted-layouts.pptx | Bin 32280 -> 0 bytes test/pptx/endnotes-toc/moved-layouts.pptx | Bin 42967 -> 0 bytes test/pptx/endnotes/deleted-layouts.pptx | Bin 31458 -> 0 bytes test/pptx/endnotes/moved-layouts.pptx | Bin 42146 -> 0 bytes test/pptx/images/deleted-layouts.pptx | Bin 49113 -> 0 bytes test/pptx/images/moved-layouts.pptx | Bin 59801 -> 0 bytes .../with-flag/deleted-layouts.pptx | Bin 80042 -> 0 bytes .../incremental-lists/with-flag/moved-layouts.pptx | Bin 90782 -> 0 bytes .../without-flag/deleted-layouts.pptx | Bin 78282 -> 0 bytes .../without-flag/moved-layouts.pptx | Bin 89020 -> 0 bytes test/pptx/inline-formatting/deleted-layouts.pptx | Bin 30651 -> 0 bytes test/pptx/inline-formatting/moved-layouts.pptx | Bin 41339 -> 0 bytes test/pptx/layouts/deleted.pptx | Bin 0 -> 55694 bytes test/pptx/layouts/input.native | 23 ++++++++++++++ test/pptx/layouts/moved.pptx | Bin 0 -> 66430 bytes test/pptx/lists/deleted-layouts.pptx | Bin 31540 -> 0 bytes test/pptx/lists/moved-layouts.pptx | Bin 42230 -> 0 bytes test/pptx/raw-ooxml/deleted-layouts.pptx | Bin 31438 -> 0 bytes test/pptx/raw-ooxml/moved-layouts.pptx | Bin 42126 -> 0 bytes test/pptx/remove-empty-slides/deleted-layouts.pptx | Bin 47866 -> 0 bytes test/pptx/remove-empty-slides/moved-layouts.pptx | Bin 58553 -> 0 bytes .../deleted-layouts.pptx | Bin 32233 -> 0 bytes .../slide-breaks-slide-level-1/moved-layouts.pptx | Bin 42923 -> 0 bytes test/pptx/slide-breaks-toc/deleted-layouts.pptx | Bin 34006 -> 0 bytes test/pptx/slide-breaks-toc/moved-layouts.pptx | Bin 44696 -> 0 bytes test/pptx/slide-breaks/deleted-layouts.pptx | Bin 33056 -> 0 bytes test/pptx/slide-breaks/moved-layouts.pptx | Bin 43746 -> 0 bytes .../h1-h2-with-table/deleted-layouts.pptx | Bin 30786 -> 0 bytes .../h1-h2-with-table/moved-layouts.pptx | Bin 41479 -> 0 bytes .../h1-with-image/deleted-layouts.pptx | Bin 47114 -> 0 bytes .../slide-level-0/h1-with-image/moved-layouts.pptx | Bin 57800 -> 0 bytes .../h1-with-table/deleted-layouts.pptx | Bin 30693 -> 0 bytes .../slide-level-0/h1-with-table/moved-layouts.pptx | Bin 41381 -> 0 bytes .../h2-with-image/deleted-layouts.pptx | Bin 47114 -> 0 bytes .../slide-level-0/h2-with-image/moved-layouts.pptx | Bin 57800 -> 0 bytes .../deleted-layouts.pptx | Bin 34486 -> 0 bytes .../moved-layouts.pptx | Bin 45176 -> 0 bytes .../speaker-notes-afterheader/deleted-layouts.pptx | Bin 33507 -> 0 bytes .../speaker-notes-afterheader/moved-layouts.pptx | Bin 44195 -> 0 bytes .../speaker-notes-afterseps/deleted-layouts.pptx | Bin 54374 -> 0 bytes .../speaker-notes-afterseps/moved-layouts.pptx | Bin 65064 -> 0 bytes test/pptx/speaker-notes/deleted-layouts.pptx | Bin 38206 -> 0 bytes test/pptx/speaker-notes/moved-layouts.pptx | Bin 48899 -> 0 bytes test/pptx/start-numbering-at/deleted-layouts.pptx | Bin 31502 -> 0 bytes test/pptx/start-numbering-at/moved-layouts.pptx | Bin 42192 -> 0 bytes test/pptx/tables/deleted-layouts.pptx | Bin 32040 -> 0 bytes test/pptx/tables/moved-layouts.pptx | Bin 42729 -> 0 bytes test/pptx/two-column/all-text/deleted-layouts.pptx | Bin 30567 -> 0 bytes test/pptx/two-column/all-text/moved-layouts.pptx | Bin 41255 -> 0 bytes .../two-column/text-and-image/deleted-layouts.pptx | Bin 48381 -> 0 bytes .../two-column/text-and-image/moved-layouts.pptx | Bin 59075 -> 0 bytes 84 files changed, 38 insertions(+), 20 deletions(-) delete mode 100644 test/pptx/background-image/deleted-layouts.pptx delete mode 100644 test/pptx/background-image/moved-layouts.pptx delete mode 100644 test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx delete mode 100644 test/pptx/blanks/just-speaker-notes/moved-layouts.pptx delete mode 100644 test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx delete mode 100644 test/pptx/blanks/nbsp-in-body/moved-layouts.pptx delete mode 100644 test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx delete mode 100644 test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx delete mode 100644 test/pptx/code-custom/deleted-layouts.pptx delete mode 100644 test/pptx/code-custom/moved-layouts.pptx delete mode 100644 test/pptx/code/deleted-layouts.pptx delete mode 100644 test/pptx/code/moved-layouts.pptx delete mode 100644 test/pptx/comparison/both-columns/deleted-layouts.pptx delete mode 100644 test/pptx/comparison/both-columns/moved-layouts.pptx delete mode 100644 test/pptx/comparison/extra-image/deleted-layouts.pptx delete mode 100644 test/pptx/comparison/extra-image/moved-layouts.pptx delete mode 100644 test/pptx/comparison/extra-text/deleted-layouts.pptx delete mode 100644 test/pptx/comparison/extra-text/moved-layouts.pptx delete mode 100644 test/pptx/comparison/non-text-first/deleted-layouts.pptx delete mode 100644 test/pptx/comparison/non-text-first/moved-layouts.pptx delete mode 100644 test/pptx/comparison/one-column/deleted-layouts.pptx delete mode 100644 test/pptx/comparison/one-column/moved-layouts.pptx delete mode 100644 test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx delete mode 100644 test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx delete mode 100644 test/pptx/content-with-caption/image-text/deleted-layouts.pptx delete mode 100644 test/pptx/content-with-caption/image-text/moved-layouts.pptx delete mode 100644 test/pptx/content-with-caption/text-image/deleted-layouts.pptx delete mode 100644 test/pptx/content-with-caption/text-image/moved-layouts.pptx delete mode 100644 test/pptx/document-properties-short-desc/deleted-layouts.pptx delete mode 100644 test/pptx/document-properties-short-desc/moved-layouts.pptx delete mode 100644 test/pptx/document-properties/deleted-layouts.pptx delete mode 100644 test/pptx/document-properties/moved-layouts.pptx delete mode 100644 test/pptx/endnotes-toc/deleted-layouts.pptx delete mode 100644 test/pptx/endnotes-toc/moved-layouts.pptx delete mode 100644 test/pptx/endnotes/deleted-layouts.pptx delete mode 100644 test/pptx/endnotes/moved-layouts.pptx delete mode 100644 test/pptx/images/deleted-layouts.pptx delete mode 100644 test/pptx/images/moved-layouts.pptx delete mode 100644 test/pptx/incremental-lists/with-flag/deleted-layouts.pptx delete mode 100644 test/pptx/incremental-lists/with-flag/moved-layouts.pptx delete mode 100644 test/pptx/incremental-lists/without-flag/deleted-layouts.pptx delete mode 100644 test/pptx/incremental-lists/without-flag/moved-layouts.pptx delete mode 100644 test/pptx/inline-formatting/deleted-layouts.pptx delete mode 100644 test/pptx/inline-formatting/moved-layouts.pptx create mode 100644 test/pptx/layouts/deleted.pptx create mode 100644 test/pptx/layouts/input.native create mode 100644 test/pptx/layouts/moved.pptx delete mode 100644 test/pptx/lists/deleted-layouts.pptx delete mode 100644 test/pptx/lists/moved-layouts.pptx delete mode 100644 test/pptx/raw-ooxml/deleted-layouts.pptx delete mode 100644 test/pptx/raw-ooxml/moved-layouts.pptx delete mode 100644 test/pptx/remove-empty-slides/deleted-layouts.pptx delete mode 100644 test/pptx/remove-empty-slides/moved-layouts.pptx delete mode 100644 test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx delete mode 100644 test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx delete mode 100644 test/pptx/slide-breaks-toc/deleted-layouts.pptx delete mode 100644 test/pptx/slide-breaks-toc/moved-layouts.pptx delete mode 100644 test/pptx/slide-breaks/deleted-layouts.pptx delete mode 100644 test/pptx/slide-breaks/moved-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx delete mode 100644 test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx delete mode 100644 test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx delete mode 100644 test/pptx/speaker-notes-after-metadata/moved-layouts.pptx delete mode 100644 test/pptx/speaker-notes-afterheader/deleted-layouts.pptx delete mode 100644 test/pptx/speaker-notes-afterheader/moved-layouts.pptx delete mode 100644 test/pptx/speaker-notes-afterseps/deleted-layouts.pptx delete mode 100644 test/pptx/speaker-notes-afterseps/moved-layouts.pptx delete mode 100644 test/pptx/speaker-notes/deleted-layouts.pptx delete mode 100644 test/pptx/speaker-notes/moved-layouts.pptx delete mode 100644 test/pptx/start-numbering-at/deleted-layouts.pptx delete mode 100644 test/pptx/start-numbering-at/moved-layouts.pptx delete mode 100644 test/pptx/tables/deleted-layouts.pptx delete mode 100644 test/pptx/tables/moved-layouts.pptx delete mode 100644 test/pptx/two-column/all-text/deleted-layouts.pptx delete mode 100644 test/pptx/two-column/all-text/moved-layouts.pptx delete mode 100644 test/pptx/two-column/text-and-image/deleted-layouts.pptx delete mode 100644 test/pptx/two-column/text-and-image/moved-layouts.pptx diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index b2df80e5f..84bdd7476 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -7,7 +7,6 @@ import System.FilePath import Text.DocTemplates (ToContext(toVal), Context(..)) import qualified Data.Map as M import Data.Text (pack) -import Data.List (unzip4) -- templating is important enough, and can break enough things, that -- we want to run all our tests with both default formatting and a @@ -17,11 +16,9 @@ modifyPptxName :: FilePath -> String -> FilePath modifyPptxName fp suffix = addExtension (takeDirectory fp ++ suffix) "pptx" -pptxTests :: String -> WriterOptions -> FilePath -> FilePath -> (TestTree, TestTree, TestTree, TestTree) +pptxTests :: String -> WriterOptions -> FilePath -> FilePath -> (TestTree, TestTree) pptxTests name opts native pptx = let referenceDoc = "pptx/reference-depth.pptx" - movedLayoutsReferenceDoc = "pptx/reference-moved-layouts.pptx" - deletedLayoutsReferenceDoc = "pptx/reference-deleted-layouts.pptx" in ( ooxmlTest writePowerpoint @@ -35,28 +32,14 @@ pptxTests name opts native pptx = opts{writerReferenceDoc=Just referenceDoc} native (modifyPptxName pptx "/templated") - , ooxmlTest - writePowerpoint - name - opts{writerReferenceDoc=Just movedLayoutsReferenceDoc} - native - (modifyPptxName pptx "/moved-layouts") - , ooxmlTest - writePowerpoint - name - opts{writerReferenceDoc=Just deletedLayoutsReferenceDoc} - native - (modifyPptxName pptx "/deleted-layouts") ) -groupPptxTests :: [(TestTree, TestTree, TestTree, TestTree)] -> [TestTree] +groupPptxTests :: [(TestTree, TestTree)] -> [TestTree] groupPptxTests pairs = - let (noRefs, refs, movedLayouts, deletedLayouts) = unzip4 pairs + let (noRefs, refs) = unzip pairs in [ testGroup "Default slide formatting" noRefs , testGroup "With `--reference-doc` pptx file" refs - , testGroup "With layouts in reference doc moved" movedLayouts - , testGroup "With layouts in reference doc deleted" deletedLayouts ] @@ -272,5 +255,17 @@ tests = let def { writerReferenceDoc = Just "pptx/footer/higher-slide-number/reference.pptx"} "pptx/footer/input.native" "pptx/footer/higher-slide-number/output.pptx" + , ooxmlTest + writePowerpoint + "Layouts can be moved around in reference doc" + def {writerReferenceDoc = Just "pptx/reference-moved-layouts.pptx"} + "pptx/layouts/input.native" + "pptx/layouts/moved.pptx" + , ooxmlTest + writePowerpoint + "Layouts can be missing from the reference doc" + def {writerReferenceDoc = Just "pptx/reference-deleted-layouts.pptx"} + "pptx/layouts/input.native" + "pptx/layouts/deleted.pptx" ] in regularTests <> referenceSpecificTests diff --git a/test/pptx/background-image/deleted-layouts.pptx b/test/pptx/background-image/deleted-layouts.pptx deleted file mode 100644 index e46a58ad7..000000000 Binary files a/test/pptx/background-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/background-image/moved-layouts.pptx b/test/pptx/background-image/moved-layouts.pptx deleted file mode 100644 index 98fe33095..000000000 Binary files a/test/pptx/background-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx b/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx deleted file mode 100644 index f729c3ce6..000000000 Binary files a/test/pptx/blanks/just-speaker-notes/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx b/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx deleted file mode 100644 index dfae6a645..000000000 Binary files a/test/pptx/blanks/just-speaker-notes/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx deleted file mode 100644 index dcd88cb24..000000000 Binary files a/test/pptx/blanks/nbsp-in-body/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx deleted file mode 100644 index 0a69853fa..000000000 Binary files a/test/pptx/blanks/nbsp-in-body/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx deleted file mode 100644 index dcd88cb24..000000000 Binary files a/test/pptx/blanks/nbsp-in-heading/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx b/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx deleted file mode 100644 index 0a69853fa..000000000 Binary files a/test/pptx/blanks/nbsp-in-heading/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/code-custom/deleted-layouts.pptx b/test/pptx/code-custom/deleted-layouts.pptx deleted file mode 100644 index f8b1c789e..000000000 Binary files a/test/pptx/code-custom/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/code-custom/moved-layouts.pptx b/test/pptx/code-custom/moved-layouts.pptx deleted file mode 100644 index 810b46dd1..000000000 Binary files a/test/pptx/code-custom/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/code/deleted-layouts.pptx b/test/pptx/code/deleted-layouts.pptx deleted file mode 100644 index 3127e20e5..000000000 Binary files a/test/pptx/code/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/code/moved-layouts.pptx b/test/pptx/code/moved-layouts.pptx deleted file mode 100644 index 7a2e3b7ac..000000000 Binary files a/test/pptx/code/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/both-columns/deleted-layouts.pptx b/test/pptx/comparison/both-columns/deleted-layouts.pptx deleted file mode 100644 index 6d80e275f..000000000 Binary files a/test/pptx/comparison/both-columns/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/both-columns/moved-layouts.pptx b/test/pptx/comparison/both-columns/moved-layouts.pptx deleted file mode 100644 index 2840e0535..000000000 Binary files a/test/pptx/comparison/both-columns/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/extra-image/deleted-layouts.pptx b/test/pptx/comparison/extra-image/deleted-layouts.pptx deleted file mode 100644 index 771ad409a..000000000 Binary files a/test/pptx/comparison/extra-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/extra-image/moved-layouts.pptx b/test/pptx/comparison/extra-image/moved-layouts.pptx deleted file mode 100644 index 2418e98c1..000000000 Binary files a/test/pptx/comparison/extra-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/extra-text/deleted-layouts.pptx b/test/pptx/comparison/extra-text/deleted-layouts.pptx deleted file mode 100644 index c87b3f3ee..000000000 Binary files a/test/pptx/comparison/extra-text/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/extra-text/moved-layouts.pptx b/test/pptx/comparison/extra-text/moved-layouts.pptx deleted file mode 100644 index 2840e0535..000000000 Binary files a/test/pptx/comparison/extra-text/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/non-text-first/deleted-layouts.pptx b/test/pptx/comparison/non-text-first/deleted-layouts.pptx deleted file mode 100644 index 95b2e3a3c..000000000 Binary files a/test/pptx/comparison/non-text-first/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/non-text-first/moved-layouts.pptx b/test/pptx/comparison/non-text-first/moved-layouts.pptx deleted file mode 100644 index 5a60028d4..000000000 Binary files a/test/pptx/comparison/non-text-first/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/one-column/deleted-layouts.pptx b/test/pptx/comparison/one-column/deleted-layouts.pptx deleted file mode 100644 index 6a705c735..000000000 Binary files a/test/pptx/comparison/one-column/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/comparison/one-column/moved-layouts.pptx b/test/pptx/comparison/one-column/moved-layouts.pptx deleted file mode 100644 index f456151a5..000000000 Binary files a/test/pptx/comparison/one-column/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx deleted file mode 100644 index d01a8f9d8..000000000 Binary files a/test/pptx/content-with-caption/heading-text-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx b/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx deleted file mode 100644 index 69cb830a9..000000000 Binary files a/test/pptx/content-with-caption/heading-text-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx b/test/pptx/content-with-caption/image-text/deleted-layouts.pptx deleted file mode 100644 index e9aebd579..000000000 Binary files a/test/pptx/content-with-caption/image-text/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/image-text/moved-layouts.pptx b/test/pptx/content-with-caption/image-text/moved-layouts.pptx deleted file mode 100644 index c27f1e1cf..000000000 Binary files a/test/pptx/content-with-caption/image-text/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx b/test/pptx/content-with-caption/text-image/deleted-layouts.pptx deleted file mode 100644 index f15e674c7..000000000 Binary files a/test/pptx/content-with-caption/text-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/content-with-caption/text-image/moved-layouts.pptx b/test/pptx/content-with-caption/text-image/moved-layouts.pptx deleted file mode 100644 index 39566cd7f..000000000 Binary files a/test/pptx/content-with-caption/text-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc/deleted-layouts.pptx b/test/pptx/document-properties-short-desc/deleted-layouts.pptx deleted file mode 100644 index a6da0c338..000000000 Binary files a/test/pptx/document-properties-short-desc/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties-short-desc/moved-layouts.pptx b/test/pptx/document-properties-short-desc/moved-layouts.pptx deleted file mode 100644 index 4cff1d486..000000000 Binary files a/test/pptx/document-properties-short-desc/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties/deleted-layouts.pptx b/test/pptx/document-properties/deleted-layouts.pptx deleted file mode 100644 index a2a58af34..000000000 Binary files a/test/pptx/document-properties/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/document-properties/moved-layouts.pptx b/test/pptx/document-properties/moved-layouts.pptx deleted file mode 100644 index e24d904a2..000000000 Binary files a/test/pptx/document-properties/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes-toc/deleted-layouts.pptx b/test/pptx/endnotes-toc/deleted-layouts.pptx deleted file mode 100644 index 3e613e038..000000000 Binary files a/test/pptx/endnotes-toc/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes-toc/moved-layouts.pptx b/test/pptx/endnotes-toc/moved-layouts.pptx deleted file mode 100644 index e64cd9c77..000000000 Binary files a/test/pptx/endnotes-toc/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes/deleted-layouts.pptx b/test/pptx/endnotes/deleted-layouts.pptx deleted file mode 100644 index 1d7ccb928..000000000 Binary files a/test/pptx/endnotes/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/endnotes/moved-layouts.pptx b/test/pptx/endnotes/moved-layouts.pptx deleted file mode 100644 index 0f071207c..000000000 Binary files a/test/pptx/endnotes/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/images/deleted-layouts.pptx b/test/pptx/images/deleted-layouts.pptx deleted file mode 100644 index 3c3ed787f..000000000 Binary files a/test/pptx/images/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/images/moved-layouts.pptx b/test/pptx/images/moved-layouts.pptx deleted file mode 100644 index b22f3652a..000000000 Binary files a/test/pptx/images/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx deleted file mode 100644 index 3e92d4dab..000000000 Binary files a/test/pptx/incremental-lists/with-flag/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx b/test/pptx/incremental-lists/with-flag/moved-layouts.pptx deleted file mode 100644 index 050842865..000000000 Binary files a/test/pptx/incremental-lists/with-flag/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx b/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx deleted file mode 100644 index 4816c0b39..000000000 Binary files a/test/pptx/incremental-lists/without-flag/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx b/test/pptx/incremental-lists/without-flag/moved-layouts.pptx deleted file mode 100644 index 4f27db07b..000000000 Binary files a/test/pptx/incremental-lists/without-flag/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/inline-formatting/deleted-layouts.pptx b/test/pptx/inline-formatting/deleted-layouts.pptx deleted file mode 100644 index ac9fa4725..000000000 Binary files a/test/pptx/inline-formatting/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/inline-formatting/moved-layouts.pptx b/test/pptx/inline-formatting/moved-layouts.pptx deleted file mode 100644 index 49a2409d1..000000000 Binary files a/test/pptx/inline-formatting/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/layouts/deleted.pptx b/test/pptx/layouts/deleted.pptx new file mode 100644 index 000000000..f7116b2f4 Binary files /dev/null and b/test/pptx/layouts/deleted.pptx differ diff --git a/test/pptx/layouts/input.native b/test/pptx/layouts/input.native new file mode 100644 index 000000000..0cee2d14e --- /dev/null +++ b/test/pptx/layouts/input.native @@ -0,0 +1,23 @@ +Pandoc (Meta {unMeta = fromList [("title",MetaInlines [Str "Testing",Space,Str "Layouts"])]}) +[Header 2 ("slide-1",[],[]) [Str "Slide",Space,Str "1"] +,Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "title",Space,Str "and",Space,Str "content",Space,Str "slide"] +,Header 2 ("slide-2",[],[]) [Str "Slide",Space,Str "2"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "This"]] + ,Div ("",["column"],[]) + [Para [Str "\8230is",Space,Str "a",Space,Str "two-column",Space,Str "slide"]]] +,Header 2 ("slide-3",[],[]) [Str "Slide",Space,Str "3"] +,Para [Str "This",Space,Str "slide",Space,Str "is",Space,Str "a",Space,Str "Content",Space,Str "with",Space,Str "Caption",Space,Str "slide"] +,Para [Image ("",[],[]) [Str "Content"] ("lalune.jpg","fig:")] +,Header 2 ("slide-4",[],[]) [Str "Slide",Space,Str "4"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "This",Space,Str "slide",Space,Str "is",Space,Str "a",Space,Str "Comparison",Space,Str "slide:"] + ,Para [Image ("",[],[]) [Str "Content"] ("lalune.jpg","fig:")]] + ,Div ("",["column"],[]) + [Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "other",Space,Str "text"]]] +,Header 1 ("section-header",[],[]) [Str "Section",Space,Str "header"] +,Header 2 ("section",[],[]) [] +,Div ("",["notes"],[]) + [Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "blank",Space,Str "slide"]]] diff --git a/test/pptx/layouts/moved.pptx b/test/pptx/layouts/moved.pptx new file mode 100644 index 000000000..e41465a86 Binary files /dev/null and b/test/pptx/layouts/moved.pptx differ diff --git a/test/pptx/lists/deleted-layouts.pptx b/test/pptx/lists/deleted-layouts.pptx deleted file mode 100644 index d064b7fd5..000000000 Binary files a/test/pptx/lists/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/lists/moved-layouts.pptx b/test/pptx/lists/moved-layouts.pptx deleted file mode 100644 index 8a9c9ec59..000000000 Binary files a/test/pptx/lists/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/raw-ooxml/deleted-layouts.pptx b/test/pptx/raw-ooxml/deleted-layouts.pptx deleted file mode 100644 index a7bd12281..000000000 Binary files a/test/pptx/raw-ooxml/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/raw-ooxml/moved-layouts.pptx b/test/pptx/raw-ooxml/moved-layouts.pptx deleted file mode 100644 index 614682671..000000000 Binary files a/test/pptx/raw-ooxml/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/remove-empty-slides/deleted-layouts.pptx b/test/pptx/remove-empty-slides/deleted-layouts.pptx deleted file mode 100644 index 488abc02a..000000000 Binary files a/test/pptx/remove-empty-slides/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/remove-empty-slides/moved-layouts.pptx b/test/pptx/remove-empty-slides/moved-layouts.pptx deleted file mode 100644 index 1e1cf1e44..000000000 Binary files a/test/pptx/remove-empty-slides/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx deleted file mode 100644 index b6b004cd6..000000000 Binary files a/test/pptx/slide-breaks-slide-level-1/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx b/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx deleted file mode 100644 index 229e4c32a..000000000 Binary files a/test/pptx/slide-breaks-slide-level-1/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks-toc/deleted-layouts.pptx b/test/pptx/slide-breaks-toc/deleted-layouts.pptx deleted file mode 100644 index e3b3b2807..000000000 Binary files a/test/pptx/slide-breaks-toc/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks-toc/moved-layouts.pptx b/test/pptx/slide-breaks-toc/moved-layouts.pptx deleted file mode 100644 index ecc942803..000000000 Binary files a/test/pptx/slide-breaks-toc/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks/deleted-layouts.pptx b/test/pptx/slide-breaks/deleted-layouts.pptx deleted file mode 100644 index ada3453b0..000000000 Binary files a/test/pptx/slide-breaks/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-breaks/moved-layouts.pptx b/test/pptx/slide-breaks/moved-layouts.pptx deleted file mode 100644 index 0fe10f443..000000000 Binary files a/test/pptx/slide-breaks/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx deleted file mode 100644 index c315a7a7a..000000000 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx deleted file mode 100644 index 81b49936d..000000000 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx deleted file mode 100644 index 478dde788..000000000 Binary files a/test/pptx/slide-level-0/h1-with-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx deleted file mode 100644 index 63b411888..000000000 Binary files a/test/pptx/slide-level-0/h1-with-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx deleted file mode 100644 index 9d58c2c52..000000000 Binary files a/test/pptx/slide-level-0/h1-with-table/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx b/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx deleted file mode 100644 index 62424de73..000000000 Binary files a/test/pptx/slide-level-0/h1-with-table/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx deleted file mode 100644 index 478dde788..000000000 Binary files a/test/pptx/slide-level-0/h2-with-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx b/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx deleted file mode 100644 index 63b411888..000000000 Binary files a/test/pptx/slide-level-0/h2-with-image/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx b/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx deleted file mode 100644 index 07e21ef02..000000000 Binary files a/test/pptx/speaker-notes-after-metadata/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx b/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx deleted file mode 100644 index d6673aac0..000000000 Binary files a/test/pptx/speaker-notes-after-metadata/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx b/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx deleted file mode 100644 index 0ccdd72b7..000000000 Binary files a/test/pptx/speaker-notes-afterheader/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx b/test/pptx/speaker-notes-afterheader/moved-layouts.pptx deleted file mode 100644 index 81f0a56cb..000000000 Binary files a/test/pptx/speaker-notes-afterheader/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx b/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx deleted file mode 100644 index 33dedf2c3..000000000 Binary files a/test/pptx/speaker-notes-afterseps/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx b/test/pptx/speaker-notes-afterseps/moved-layouts.pptx deleted file mode 100644 index 28bcf3887..000000000 Binary files a/test/pptx/speaker-notes-afterseps/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes/deleted-layouts.pptx b/test/pptx/speaker-notes/deleted-layouts.pptx deleted file mode 100644 index 5f407086a..000000000 Binary files a/test/pptx/speaker-notes/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/speaker-notes/moved-layouts.pptx b/test/pptx/speaker-notes/moved-layouts.pptx deleted file mode 100644 index 83d5ed0af..000000000 Binary files a/test/pptx/speaker-notes/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/start-numbering-at/deleted-layouts.pptx b/test/pptx/start-numbering-at/deleted-layouts.pptx deleted file mode 100644 index d99fedfa6..000000000 Binary files a/test/pptx/start-numbering-at/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/start-numbering-at/moved-layouts.pptx b/test/pptx/start-numbering-at/moved-layouts.pptx deleted file mode 100644 index 98db3ec74..000000000 Binary files a/test/pptx/start-numbering-at/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/tables/deleted-layouts.pptx b/test/pptx/tables/deleted-layouts.pptx deleted file mode 100644 index 7ad714058..000000000 Binary files a/test/pptx/tables/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/tables/moved-layouts.pptx b/test/pptx/tables/moved-layouts.pptx deleted file mode 100644 index 9628717d7..000000000 Binary files a/test/pptx/tables/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/all-text/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx deleted file mode 100644 index a321128b5..000000000 Binary files a/test/pptx/two-column/all-text/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/all-text/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx deleted file mode 100644 index 90b1d9254..000000000 Binary files a/test/pptx/two-column/all-text/moved-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx deleted file mode 100644 index 46274ffac..000000000 Binary files a/test/pptx/two-column/text-and-image/deleted-layouts.pptx and /dev/null differ diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx deleted file mode 100644 index c25331e23..000000000 Binary files a/test/pptx/two-column/text-and-image/moved-layouts.pptx and /dev/null differ -- cgit v1.2.3 From d80aaee42b5563df3a647830639bdd3b090a22ee Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 10 Oct 2021 08:43:45 -0700 Subject: Translations: don't depend on the fact that Aeson Object is... implemented internally as a HashMap. This is no longer public as of aeson 2.0.0.0. --- pandoc.cabal | 1 - src/Text/Pandoc/Translations.hs | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 9b59c8c98..50f33c937 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -578,7 +578,6 @@ library text-conversions >= 0.3 && < 0.4, time >= 1.5 && < 1.13, unicode-transforms >= 0.3 && < 0.4, - unordered-containers >= 0.2 && < 0.3, xml >= 1.3.12 && < 1.4, xml-conduit >= 1.9.1.1 && < 1.10, unicode-collation >= 0.1.1 && < 0.2, diff --git a/src/Text/Pandoc/Translations.hs b/src/Text/Pandoc/Translations.hs index 0c7d7ab23..000d1091b 100644 --- a/src/Text/Pandoc/Translations.hs +++ b/src/Text/Pandoc/Translations.hs @@ -31,7 +31,6 @@ module Text.Pandoc.Translations ( where 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 qualified Data.Text as T import qualified Data.YAML as YAML @@ -83,8 +82,8 @@ instance YAML.FromYAML Term where parseYAML invalid = YAML.typeMismatch "Term" invalid instance FromJSON Translations where - parseJSON (Object hm) = do - xs <- mapM addItem (HM.toList hm) + parseJSON o@(Object hm) = do + xs <- parseJSON o >>= mapM addItem . M.toList return $ Translations (M.fromList xs) where addItem (k,v) = case safeRead k of -- cgit v1.2.3 From 90106c300a424349f2be5787c82fd17ccf66983f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 10 Oct 2021 11:24:20 -0700 Subject: Makefile; fix quick-cabal executable path report --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 77d4c81ab..a880da12d 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ quick: quick-cabal: cabal v2-build -j8 --ghc-options '$(GHCOPTS)' --disable-optimization --enable-tests cabal v2-test --disable-optimization --test-options="--hide-successes --ansi-tricks=false $(TESTARGS)" - echo "Path to built executable:" && cabal exec -- sh -c 'command -v pandoc' + echo "Path to built executable:" && cabal exec -- sh -c 'command -v pandoc' | sed -e 's!x/pandoc/build!x/pandoc/noopt/build!' full-cabal: cabal v2-configure . --ghc-options '$(GHCOPTS)' --flags '+embed_data_files +trypandoc' --enable-tests --enable-benchmarks -- cgit v1.2.3 From c72277e98683544759d966fc88012b4f6d0fa8ec Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 10 Oct 2021 11:24:28 -0700 Subject: LaTeX reader: Properly handle `\^` followed by group closing. Closes #7615. --- src/Text/Pandoc/Readers/LaTeX/Inline.hs | 6 +++--- test/command/7615.md | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 test/command/7615.md diff --git a/src/Text/Pandoc/Readers/LaTeX/Inline.hs b/src/Text/Pandoc/Readers/LaTeX/Inline.hs index 7b8bca4af..0fd14017b 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Inline.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Inline.hs @@ -35,7 +35,7 @@ import Text.Pandoc.Readers.LaTeX.Parsing import Text.Pandoc.Extensions (extensionEnabled, Extension(..)) import Text.Pandoc.Parsing (getOption, updateState, getState, notFollowedBy, manyTill, getInput, setInput, incSourceColumn, - option, many1, try) + option, many1) import Data.Char (isDigit) import Text.Pandoc.Highlighting (fromListingsLanguage,) import Data.Maybe (maybeToList, fromMaybe) @@ -160,8 +160,8 @@ romanNumeralArg = spaces *> (parser <|> inBraces) accentWith :: PandocMonad m => LP m Inlines -> Char -> Maybe Char -> LP m Inlines -accentWith tok combiningAccent fallBack = try $ do - ils <- tok +accentWith tok combiningAccent fallBack = do + ils <- option mempty tok case toList ils of (Str (T.uncons -> Just (x, xs)) : ys) -> return $ fromList $ -- try to normalize to the combined character: diff --git a/test/command/7615.md b/test/command/7615.md new file mode 100644 index 000000000..9235b0a17 --- /dev/null +++ b/test/command/7615.md @@ -0,0 +1,6 @@ +``` +% pandoc -f latex -t native +\texttt{\^} +^D +[ Para [ Code ( "" , [] , [] ) "^" ] ] +``` -- cgit v1.2.3 From a76d5f620b5daf3260670d8cf6290c11bbe4ad3f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 10 Oct 2021 13:39:10 -0700 Subject: Use latest emojis. --- stack.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/stack.yaml b/stack.yaml index 674bc357f..c2b0f2e0a 100644 --- a/stack.yaml +++ b/stack.yaml @@ -10,6 +10,7 @@ extra-deps: - skylighting-core-0.12 - skylighting-0.12 - doctemplates-0.10 +- emojis-0.1.2 - git: https://github.com/jgm/pandoc-types.git commit: f796401eaaab780f83c562e97dbb8c8d4b9974d1 - git: https://github.com/jgm/texmath.git -- cgit v1.2.3 From 0ec16d151f4e7d3355fb6b6c9ead845a19b49dbc Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 10 Oct 2021 14:02:28 -0700 Subject: Stack: use latest doclayout --- stack.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/stack.yaml b/stack.yaml index c2b0f2e0a..ea06a6437 100644 --- a/stack.yaml +++ b/stack.yaml @@ -11,6 +11,7 @@ extra-deps: - skylighting-0.12 - doctemplates-0.10 - emojis-0.1.2 +- doclayout-0.3.1 - git: https://github.com/jgm/pandoc-types.git commit: f796401eaaab780f83c562e97dbb8c8d4b9974d1 - git: https://github.com/jgm/texmath.git -- cgit v1.2.3 From 0f98cbff4b61b8e79f386f77d18b3218f1214b25 Mon Sep 17 00:00:00 2001 From: Milan Bracke Date: Fri, 1 Oct 2021 11:34:14 +0200 Subject: Avoid blockquote when parent style has more indent When a paragraph has an indentation different from the parent (named) style, it used to be considered a blockquote. But this only makes sense when the paragraph has more indentation. So this commit adds a check for the indentation of the parent style. --- src/Text/Pandoc/Readers/Docx.hs | 66 +++++++++++----------- src/Text/Pandoc/Readers/Docx/Parse.hs | 27 ++------- src/Text/Pandoc/Readers/Docx/Parse/Styles.hs | 26 +++++++++ test/Tests/Readers/Docx.hs | 4 ++ test/docx/image_vml.native | 5 +- test/docx/relative_indentation_blockquotes.docx | Bin 0 -> 12492 bytes test/docx/relative_indentation_blockquotes.native | 4 ++ 7 files changed, 76 insertions(+), 56 deletions(-) create mode 100644 test/docx/relative_indentation_blockquotes.docx create mode 100644 test/docx/relative_indentation_blockquotes.native diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index dd6f39431..66cd84291 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -535,34 +535,36 @@ trimSps (Many ils) = Many $ Seq.dropWhileL isSp $Seq.dropWhileR isSp ils extraAttr :: (Eq (StyleName a), HasStyleName a) => a -> Attr extraAttr s = ("", [], [("custom-style", fromStyleName $ getStyleName s)]) -parStyleToTransform :: PandocMonad m => ParagraphStyle -> DocxContext m (Blocks -> Blocks) -parStyleToTransform pPr = case pStyle pPr of - c@(getStyleName -> styleName):cs - | styleName `elem` divsToKeep -> do - let pPr' = pPr { pStyle = cs } - transform <- parStyleToTransform pPr' - return $ divWith ("", [normalizeToClassName styleName], []) . transform - | styleName `elem` listParagraphStyles -> do - let pPr' = pPr { pStyle = cs, indentation = Nothing} - transform <- parStyleToTransform pPr' - return $ divWith ("", [normalizeToClassName styleName], []) . transform - | otherwise -> do - let pPr' = pPr { pStyle = cs } - transform <- parStyleToTransform pPr' - styles <- asks (isEnabled Ext_styles . docxOptions) - return $ - (if styles then divWith (extraAttr c) else id) - . (if isBlockQuote c then blockQuote else id) - . transform - [] - | Just left <- indentation pPr >>= leftParIndent -> do - let pPr' = pPr { indentation = Nothing } - hang = fromMaybe 0 $ indentation pPr >>= hangingParIndent - transform <- parStyleToTransform pPr' - return $ if (left - hang) > 0 - then blockQuote . transform - else transform - | otherwise -> return id +paragraphStyleToTransform :: PandocMonad m => ParagraphStyle -> DocxContext m (Blocks -> Blocks) +paragraphStyleToTransform pPr = + let stylenames = map getStyleName (pStyle pPr) + transform = if (`elem` listParagraphStyles) `any` stylenames || relativeIndent pPr <= 0 + then id + else blockQuote + in do + extStylesEnabled <- asks (isEnabled Ext_styles . docxOptions) + return $ foldr (\parStyle transform' -> + (parStyleToTransform extStylesEnabled parStyle) . transform' + ) transform (pStyle pPr) + +parStyleToTransform :: Bool -> ParStyle -> Blocks -> Blocks +parStyleToTransform extStylesEnabled parStyle@(getStyleName -> styleName) + | (styleName `elem` divsToKeep) || (styleName `elem` listParagraphStyles) = + divWith ("", [normalizeToClassName styleName], []) + | otherwise = + (if extStylesEnabled then divWith (extraAttr parStyle) else id) + . (if isBlockQuote parStyle then blockQuote else id) + +-- The relative indent is the indentation minus the indentation of the parent style. +-- This tells us whether this paragraph in particular was indented more and thus +-- should be considered a block quote. +relativeIndent :: ParagraphStyle -> Integer +relativeIndent pPr = + let pStyleLeft = fromMaybe 0 $ pStyleIndentation pPr >>= leftParIndent + pStyleHang = fromMaybe 0 $ pStyleIndentation pPr >>= hangingParIndent + left = fromMaybe pStyleLeft $ indentation pPr >>= leftParIndent + hang = fromMaybe pStyleHang $ indentation pPr >>= hangingParIndent + in (left - hang) - (pStyleLeft - pStyleHang) normalizeToClassName :: (FromStyleName a) => a -> T.Text normalizeToClassName = T.map go . fromStyleName @@ -581,7 +583,7 @@ bodyPartToBlocks (Paragraph pPr parparts) local (\s -> s{ docxInBidi = True }) (bodyPartToBlocks (Paragraph pPr' parparts)) | isCodeDiv pPr = do - transform <- parStyleToTransform pPr + transform <- paragraphStyleToTransform pPr return $ transform $ codeBlock $ @@ -608,7 +610,7 @@ bodyPartToBlocks (Paragraph pPr parparts) else prevParaIls <> space) <> ils' handleInsertion = do modify $ \s -> s {docxPrevPara = mempty} - transform <- parStyleToTransform pPr' + transform <- paragraphStyleToTransform pPr' return $ transform $ paraOrPlain ils'' opts <- asks docxOptions case (pChange pPr', readerTrackChanges opts) of @@ -623,7 +625,7 @@ bodyPartToBlocks (Paragraph pPr parparts) , AllChanges) -> do let attr = ("", ["paragraph-insertion"], addAuthorAndDate cAuthor cDate) insertMark = spanWith attr mempty - transform <- parStyleToTransform pPr' + transform <- paragraphStyleToTransform pPr' return $ transform $ paraOrPlain $ ils'' <> insertMark (Just (TrackedChange Deletion _), AcceptChanges) -> do @@ -635,7 +637,7 @@ bodyPartToBlocks (Paragraph pPr parparts) , AllChanges) -> do let attr = ("", ["paragraph-deletion"], addAuthorAndDate cAuthor cDate) insertMark = spanWith attr mempty - transform <- parStyleToTransform pPr' + transform <- paragraphStyleToTransform pPr' return $ transform $ paraOrPlain $ ils'' <> insertMark _ -> handleInsertion diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index 5f29ac41a..e4d3ea6f8 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -50,6 +50,7 @@ module Text.Pandoc.Readers.Docx.Parse ( Docx(..) , archiveToDocxWithWarnings , getStyleNames , pHeading + , pStyleIndentation , constructBogusParStyleData , leftBiasedMergeRunStyle , rowsToRowspans @@ -194,11 +195,6 @@ data Notes = Notes NameSpaces data Comments = Comments NameSpaces (M.Map T.Text Element) deriving Show -data ParIndentation = ParIndentation { leftParIndent :: Maybe Integer - , rightParIndent :: Maybe Integer - , hangingParIndent :: Maybe Integer} - deriving Show - data ChangeType = Insertion | Deletion deriving Show @@ -439,6 +435,7 @@ getStyleNames = fmap getStyleName constructBogusParStyleData :: ParaStyleName -> ParStyle constructBogusParStyleData stName = ParStyle { headingLev = Nothing + , indent = Nothing , numInfo = Nothing , psParentStyle = Nothing , pStyleName = stName @@ -673,20 +670,6 @@ elemToCell ns element | isElem ns "w" "tc" element = return $ Cell (fromMaybe 1 gridSpan) vMerge cellContents elemToCell _ _ = throwError WrongElem -elemToParIndentation :: NameSpaces -> Element -> Maybe ParIndentation -elemToParIndentation ns element | isElem ns "w" "ind" element = - Just ParIndentation { - leftParIndent = - findAttrByName ns "w" "left" element >>= - stringToInteger - , rightParIndent = - findAttrByName ns "w" "right" element >>= - stringToInteger - , hangingParIndent = - findAttrByName ns "w" "hanging" element >>= - stringToInteger } -elemToParIndentation _ _ = Nothing - testBitMask :: Text -> Int -> Bool testBitMask bitMaskS n = case (reads ("0x" ++ T.unpack bitMaskS) :: [(Int, String)]) of @@ -699,6 +682,9 @@ pHeading = getParStyleField headingLev . pStyle pNumInfo :: ParagraphStyle -> Maybe (T.Text, T.Text) pNumInfo = getParStyleField numInfo . pStyle +pStyleIndentation :: ParagraphStyle -> Maybe ParIndentation +pStyleIndentation style = (getParStyleField indent . pStyle) style + elemToBodyPart :: NameSpaces -> Element -> D BodyPart elemToBodyPart ns element | isElem ns "w" "p" element @@ -1086,8 +1072,7 @@ elemToParagraphStyle ns element sty in ParagraphStyle {pStyle = mapMaybe (`M.lookup` sty) style , indentation = - findChildByName ns "w" "ind" pPr >>= - elemToParIndentation ns + getIndentation ns element , dropCap = case findChildByName ns "w" "framePr" pPr >>= diff --git a/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs b/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs index 0d7271d6a..bb28b3009 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs @@ -21,6 +21,7 @@ module Text.Pandoc.Readers.Docx.Parse.Styles ( , CharStyle , ParaStyleId(..) , ParStyle(..) + , ParIndentation(..) , RunStyle(..) , HasStyleName , StyleName @@ -37,6 +38,7 @@ module Text.Pandoc.Readers.Docx.Parse.Styles ( , fromStyleName , fromStyleId , stringToInteger + , getIndentation , getNumInfo , elemToRunStyle , defaultRunStyle @@ -115,7 +117,13 @@ data RunStyle = RunStyle { isBold :: Maybe Bool } deriving Show +data ParIndentation = ParIndentation { leftParIndent :: Maybe Integer + , rightParIndent :: Maybe Integer + , hangingParIndent :: Maybe Integer} + deriving Show + data ParStyle = ParStyle { headingLev :: Maybe (ParaStyleName, Int) + , indent :: Maybe ParIndentation , numInfo :: Maybe (T.Text, T.Text) , psParentStyle :: Maybe ParStyle , pStyleName :: ParaStyleName @@ -290,6 +298,23 @@ getHeaderLevel ns element , n > 0 = Just (styleName, fromInteger n) getHeaderLevel _ _ = Nothing +getIndentation :: NameSpaces -> Element -> Maybe ParIndentation +getIndentation ns el = do + indElement <- findChildByName ns "w" "pPr" el >>= + findChildByName ns "w" "ind" + return $ ParIndentation + { + leftParIndent = findAttrByName ns "w" "left" indElement <|> + findAttrByName ns "w" "start" indElement >>= + stringToInteger + , rightParIndent = findAttrByName ns "w" "right" indElement <|> + findAttrByName ns "w" "end" indElement >>= + stringToInteger + , hangingParIndent = (findAttrByName ns "w" "hanging" indElement >>= stringToInteger) <|> + fmap negate + (findAttrByName ns "w" "firstLine" indElement >>= stringToInteger) + } + getElementStyleName :: Coercible T.Text a => NameSpaces -> Element -> Maybe a getElementStyleName ns el = coerce <$> ((findChildByName ns "w" "name" el >>= findAttrByName ns "w" "val") @@ -314,6 +339,7 @@ elemToParStyleData ns element parentStyle = Just $ ParStyle { headingLev = getHeaderLevel ns element + , indent = getIndentation ns element , numInfo = getNumInfo ns element , psParentStyle = parentStyle , pStyleName = styleName diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs index 220c7d9c5..2f28af317 100644 --- a/test/Tests/Readers/Docx.hs +++ b/test/Tests/Readers/Docx.hs @@ -305,6 +305,10 @@ tests = [ testGroup "document" "blockquotes (parsing indent as blockquote)" "docx/block_quotes.docx" "docx/block_quotes_parse_indent.native" + , testCompare + "blockquotes (parsing indent relative to the indent of the parent style as blockquote)" + "docx/relative_indentation_blockquotes.docx" + "docx/relative_indentation_blockquotes.native" , testCompare "hanging indents" "docx/hanging_indent.docx" diff --git a/test/docx/image_vml.native b/test/docx/image_vml.native index e9fded614..5991f333c 100644 --- a/test/docx/image_vml.native +++ b/test/docx/image_vml.native @@ -1,4 +1,3 @@ [Header 1 ("vml-image",[],[]) [Strong [Str "VML",Space,Str "Image"]] -,BlockQuote - [Para [Str "It",Space,Str "should",Space,Str "follow",Space,Str "below:"] - ,Para [Image ("",[],[]) [] ("media/image4.jpeg","")]]] +,Para [Str "It",Space,Str "should",Space,Str "follow",Space,Str "below:"] +,Para [Image ("",[],[]) [] ("media/image4.jpeg","")]] diff --git a/test/docx/relative_indentation_blockquotes.docx b/test/docx/relative_indentation_blockquotes.docx new file mode 100644 index 000000000..f318a8509 Binary files /dev/null and b/test/docx/relative_indentation_blockquotes.docx differ diff --git a/test/docx/relative_indentation_blockquotes.native b/test/docx/relative_indentation_blockquotes.native new file mode 100644 index 000000000..37806f289 --- /dev/null +++ b/test/docx/relative_indentation_blockquotes.native @@ -0,0 +1,4 @@ +[Header 1 ("indentation-blockquotes",[],[]) [Str "Indentation",Space,Str "blockquotes"] +,Para [Str "Normal",Space,Str "list",Space,Str "paragraph"] +,Para [Str "List",Space,Str "paragraph",Space,Str "with",Space,Str "less",Space,Str "indent"] +,BlockQuote [Para [Str "List",Space,Str "paragraph",Space,Str "with",Space,Str "more",Space,Str "indent"]]] -- cgit v1.2.3 From 84d68b92a211a14f5f6f2e08118e107fab5591de Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 11 Oct 2021 08:54:45 -0700 Subject: LaTeX reader: Implement siunitx v3 commands. We support `\unit`, `\qty`, `\qtyrange`, and `\qtylist` as synonynms of `\si`, `\SI`, `\SIrange`, and `\SIlist`. Closes #7614. --- src/Text/Pandoc/Readers/LaTeX/SIunitx.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs index b8bf0ce7f..e4738a763 100644 --- a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs +++ b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs @@ -23,11 +23,15 @@ siunitxCommands :: PandocMonad m => LP m Inlines -> M.Map Text (LP m Inlines) siunitxCommands tok = M.fromList [ ("si", dosi tok) + , ("unit", dosi tok) -- v3 version of si , ("SI", doSI tok) + , ("qty", doSI tok) -- v3 version of SI , ("SIrange", doSIrange True tok) + , ("qtyrange", doSIrange True tok) -- v3 version of SIrange + , ("SIlist", doSIlist tok) + , ("qtylist", doSIlist tok) -- v3 version of SIlist , ("numrange", doSIrange False tok) , ("numlist", doSInumlist) - , ("SIlist", doSIlist tok) , ("num", doSInum) , ("ang", doSIang) ] -- cgit v1.2.3 From 4ba4533d70e08b4979bedbd962668a493578c25d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 3 Oct 2021 21:21:05 -0700 Subject: Update wasteland tests. When we trimmed it down we left out some notes. --- test/epub/wasteland.epub | Bin 24352 -> 26051 bytes test/epub/wasteland.native | 1098 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 1078 insertions(+), 20 deletions(-) diff --git a/test/epub/wasteland.epub b/test/epub/wasteland.epub index 5eec66454..3a542ef83 100644 Binary files a/test/epub/wasteland.epub and b/test/epub/wasteland.epub differ diff --git a/test/epub/wasteland.native b/test/epub/wasteland.native index eb0c1d2e7..cd3347f4e 100644 --- a/test/epub/wasteland.native +++ b/test/epub/wasteland.native @@ -411,7 +411,20 @@ , Str "of" , Space , Str "man," - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "Line" , Space , Str "20." ] + ( "#wasteland-content.xhtml#ln20" , "" ) + , Space + , Str "Cf." + , Space + , Str "Ezekiel" + , Space + , Str "2:1." + ] + ] , Span ( "" , [ "lnum" ] , [] ) [ Str "20" ] ] ] @@ -483,7 +496,20 @@ , Str "no" , Space , Str "relief," - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "23." ] + ( "#wasteland-content.xhtml#ln23" , "" ) + , Space + , Str "Cf." + , Space + , Str "Ecclesiastes" + , Space + , Str "12:5." + ] + ] ] ] , Div @@ -648,7 +674,30 @@ , Str "der" , Space , Str "Wind" - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "31." ] + ( "#wasteland-content.xhtml#ln31" + , "" + ) + , Space + , Str "V." + , Space + , Str "Tristan" + , Space + , Str "und" + , Space + , Str "Isolde," + , Space + , Str "i," + , Space + , Str "verses" + , Space + , Str "5-8." + ] + ] ] ] , Div @@ -844,7 +893,22 @@ , Str "Meer" ] , Str "." - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "42." ] + ( "#wasteland-content.xhtml#ln42" , "" ) + , Space + , Str "Id." + , Space + , Str "iii," + , Space + , Str "verse" + , Space + , Str "24." + ] + ] ] ] ] @@ -918,7 +982,246 @@ , Str "said" , Space , Str "she," - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "46." ] + ( "#wasteland-content.xhtml#ln46" , "" ) + , Space + , Str "I" + , Space + , Str "am" + , Space + , Str "not" + , Space + , Str "familiar" + , Space + , Str "with" + , Space + , Str "the" + , Space + , Str "exact" + , Space + , Str "constitution" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "Tarot" + , Space + , Str "pack" + , Space + , Str "of" + , SoftBreak + , Str "cards," + , Space + , Str "from" + , Space + , Str "which" + , Space + , Str "I" + , Space + , Str "have" + , Space + , Str "obviously" + , Space + , Str "departed" + , Space + , Str "to" + , Space + , Str "suit" + , Space + , Str "my" + , Space + , Str "own" + , Space + , Str "convenience." + , SoftBreak + , Str "The" + , Space + , Str "Hanged" + , Space + , Str "Man," + , Space + , Str "a" + , Space + , Str "member" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "traditional" + , Space + , Str "pack," + , Space + , Str "fits" + , Space + , Str "my" + , Space + , Str "purpose" + , Space + , Str "in" + , Space + , Str "two" + , SoftBreak + , Str "ways:" + , Space + , Str "because" + , Space + , Str "he" + , Space + , Str "is" + , Space + , Str "associated" + , Space + , Str "in" + , Space + , Str "my" + , Space + , Str "mind" + , Space + , Str "with" + , Space + , Str "the" + , Space + , Str "Hanged" + , Space + , Str "God" + , Space + , Str "of" + , Space + , Str "Frazer," + , SoftBreak + , Str "and" + , Space + , Str "because" + , Space + , Str "I" + , Space + , Str "associate" + , Space + , Str "him" + , Space + , Str "with" + , Space + , Str "the" + , Space + , Str "hooded" + , Space + , Str "figure" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "passage" + , Space + , Str "of" + , Space + , Str "the" + , SoftBreak + , Str "disciples" + , Space + , Str "to" + , Space + , Str "Emmaus" + , Space + , Str "in" + , Space + , Str "Part" + , Space + , Str "V." + , Space + , Str "The" + , Space + , Str "Phoenician" + , Space + , Str "Sailor" + , Space + , Str "and" + , Space + , Str "the" + , Space + , Str "Merchant" + , SoftBreak + , Str "appear" + , Space + , Str "later;" + , Space + , Str "also" + , Space + , Str "the" + , Space + , Str "\"crowds" + , Space + , Str "of" + , Space + , Str "people,\"" + , Space + , Str "and" + , Space + , Str "Death" + , Space + , Str "by" + , Space + , Str "Water" + , Space + , Str "is" + , SoftBreak + , Str "executed" + , Space + , Str "in" + , Space + , Str "Part" + , Space + , Str "IV." + , Space + , Str "The" + , Space + , Str "Man" + , Space + , Str "with" + , Space + , Str "Three" + , Space + , Str "Staves" + , Space + , Str "(an" + , Space + , Str "authentic" + , Space + , Str "member" + , Space + , Str "of" + , SoftBreak + , Str "the" + , Space + , Str "Tarot" + , Space + , Str "pack)" + , Space + , Str "I" + , Space + , Str "associate," + , Space + , Str "quite" + , Space + , Str "arbitrarily," + , Space + , Str "with" + , Space + , Str "the" + , Space + , Str "Fisher" + , Space + , Str "King" + , SoftBreak + , Str "himself." + ] + ] ] ] , Div @@ -1195,7 +1498,51 @@ [ Str "Unreal" , Space , Str "City," - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "60." ] + ( "#wasteland-content.xhtml#ln60" , "" ) + , Space + , Str "Cf." + , Space + , Str "Baudelaire:" + ] + , BlockQuote + [ Para + [ Str "\"Fourmillante" + , Space + , Str "cite;," + , Space + , Str "cite;" + , Space + , Str "pleine" + , Space + , Str "de" + , Space + , Str "reves," + , LineBreak + , Str "Ou" + , Space + , Str "le" + , Space + , Str "spectre" + , Space + , Str "en" + , SoftBreak + , Str "plein" + , Space + , Str "jour" + , Space + , Str "raccroche" + , Space + , Str "le" + , Space + , Str "passant.\"" + ] + ] + ] , Span ( "" , [ "lnum" ] , [] ) [ Str "60" ] ] ] @@ -1259,7 +1606,55 @@ , Str "so" , Space , Str "many." - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "63." ] + ( "#wasteland-content.xhtml#ln63" , "" ) + , Space + , Str "Cf." + , Space + , Str "Inferno," + , Space + , Str "iii." + , Space + , Str "55-7." + ] + , BlockQuote + [ Para + [ Str "\"si" + , Space + , Str "lunga" + , Space + , Str "tratta" + , LineBreak + , Str "di" + , Space + , Str "gente," + , Space + , Str "ch'io" + , Space + , Str "non" + , Space + , Str "avrei" + , Space + , Str "mai" + , Space + , Str "creduto" + , LineBreak + , Str "che" + , SoftBreak + , Str "morte" + , Space + , Str "tanta" + , Space + , Str "n'avesse" + , Space + , Str "disfatta.\"" + ] + ] + ] ] ] , Div @@ -1276,7 +1671,59 @@ , Str "were" , Space , Str "exhaled," - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "64." ] + ( "#wasteland-content.xhtml#ln64" , "" ) + , Space + , Str "Cf." + , Space + , Str "Inferno," + , Space + , Str "iv." + , Space + , Str "25-7:" + ] + , BlockQuote + [ Para + [ Str "\"Quivi," + , Space + , Str "secondo" + , Space + , Str "che" + , Space + , Str "per" + , Space + , Str "ascoltahre," + , LineBreak + , Str "\"non" + , Space + , Str "avea" + , Space + , Str "pianto," + , Space + , Str "ma'" + , Space + , Str "che" + , Space + , Str "di" + , SoftBreak + , Str "sospiri," + , LineBreak + , Str "\"che" + , Space + , Str "l'aura" + , Space + , Str "eterna" + , Space + , Str "facevan" + , Space + , Str "tremare.\"" + ] + ] + ] ] ] , Div @@ -1365,7 +1812,28 @@ , Str "of" , Space , Str "nine." - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "68." ] + ( "#wasteland-content.xhtml#ln68" , "" ) + , Space + , Str "A" + , Space + , Str "phenomenon" + , Space + , Str "which" + , Space + , Str "I" + , Space + , Str "have" + , Space + , Str "often" + , Space + , Str "noticed." + ] + ] ] ] , Div @@ -1510,7 +1978,30 @@ , Str "to" , Space , Str "men," - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "74." ] + ( "#wasteland-content.xhtml#ln74" , "" ) + , Space + , Str "Cf." + , Space + , Str "the" + , Space + , Str "Dirge" + , Space + , Str "in" + , Space + , Str "Webster's" + , Space + , Str "White" + , Space + , Str "Devil" + , Space + , Str "." + ] + ] ] ] , Div @@ -1560,7 +2051,28 @@ ] , Space , Str "!\"" - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "76." ] + ( "#wasteland-content.xhtml#ln76" , "" ) + , Space + , Str "V." + , Space + , Str "Baudelaire," + , Space + , Str "Preface" + , Space + , Str "to" + , Space + , Str "Fleurs" + , Space + , Str "du" + , Space + , Str "Mal." + ] + ] ] ] ] @@ -1602,7 +2114,30 @@ , Str "burnished" , Space , Str "throne," - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "77." ] + ( "#wasteland-content.xhtml#ln77" , "" ) + , Space + , Str "Cf." + , Space + , Str "Antony" + , Space + , Str "and" + , Space + , Str "Cleopatra," + , Space + , Str "II." + , Space + , Str "ii.," + , Space + , Str "l." + , Space + , Str "190." + ] + ] ] ] , Div @@ -1875,7 +2410,47 @@ , Str "the" , Space , Str "laquearia," - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "92." ] + ( "#wasteland-content.xhtml#ln92" , "" ) + , Space + , Str "Laquearia." + , Space + , Str "V." + , Space + , Str "Aeneid," + , Space + , Str "I." + , Space + , Str "726:" + ] + , BlockQuote + [ Para + [ Str "dependent" + , Space + , Str "lychni" + , Space + , Str "laquearibus" + , Space + , Str "aureis" + , Space + , Str "incensi," + , Space + , Str "et" + , Space + , Str "noctem" + , SoftBreak + , Str "flammis" + , LineBreak + , Str "funalia" + , Space + , Str "vincunt." + ] + ] + ] ] ] , Div @@ -1988,7 +2563,30 @@ , Str "sylvan" , Space , Str "scene" - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "98." ] + ( "#wasteland-content.xhtml#ln98" , "" ) + , Space + , Str "Sylvan" + , Space + , Str "scene." + , Space + , Str "V." + , Space + , Str "Milton," + , Space + , Str "Paradise" + , Space + , Str "Lost," + , Space + , Str "iv." + , Space + , Str "140." + ] + ] ] ] , Div @@ -2009,7 +2607,24 @@ , Str "barbarous" , Space , Str "king" - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "99." ] + ( "#wasteland-content.xhtml#ln99" , "" ) + , Space + , Str "V." + , Space + , Str "Ovid," + , Space + , Str "Metamorphoses," + , Space + , Str "vi," + , Space + , Str "Philomela." + ] + ] ] ] , Div @@ -2028,7 +2643,26 @@ , Str "the" , Space , Str "nightingale" - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "100." ] + ( "#wasteland-content.xhtml#ln100" + , "" + ) + , Space + , Str "Cf." + , Space + , Str "Part" + , Space + , Str "III," + , Space + , Str "l." + , Space + , Str "204." + ] + ] , SoftBreak , Span ( "" , [ "lnum" ] , [] ) [ Str "100" ] ] @@ -2318,7 +2952,26 @@ , Str "rats'" , Space , Str "alley" - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "115." ] + ( "#wasteland-content.xhtml#ln115" + , "" + ) + , Space + , Str "Cf." + , Space + , Str "Part" + , Space + , Str "III," + , Space + , Str "l." + , Space + , Str "195." + ] + ] ] ] , Div @@ -2367,7 +3020,37 @@ , Str "the" , Space , Str "door." - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "118." ] + ( "#wasteland-content.xhtml#ln118" + , "" + ) + , Space + , Str "Cf." + , Space + , Str "Webster:" + ] + , BlockQuote + [ Para + [ Str "\"Is" + , Space + , Str "the" + , Space + , Str "wind" + , Space + , Str "in" + , Space + , Str "that" + , Space + , Str "door" + , Space + , Str "still?\"" + ] + ] + ] ] ] , Div @@ -2482,7 +3165,28 @@ , Str "your" , Space , Str "head?\"" - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "126." ] + ( "#wasteland-content.xhtml#ln126" + , "" + ) + , Space + , Str "Cf." + , Space + , Str "Part" + , Space + , Str "I," + , Space + , Str "l." + , Space + , Str "37," + , Space + , Str "48." + ] + ] ] ] , Div ( "" , [] , [] ) [ Plain [ Str "But" ] ] @@ -2689,7 +3393,36 @@ , Str "the" , Space , Str "door." - , Str "" + , Note + [ Para + [ Link + ( "" , [] , [] ) + [ Str "138." ] + ( "#wasteland-content.xhtml#ln138" + , "" + ) + , Space + , Str "Cf." + , Space + , Str "the" + , Space + , Str "game" + , Space + , Str "of" + , Space + , Str "chess" + , Space + , Str "in" + , Space + , Str "Middleton's" + , Space + , Str "Women" + , Space + , Str "beware" + , Space + , Str "Women." + ] + ] ] ] ] @@ -3490,4 +4223,329 @@ ] ] ] +, Div + ( "wasteland-content.xhtml#backmatter" + , [ "section" , "backmatter" ] + , [] + ) + [ Div + ( "wasteland-content.xhtml#rearnotes" + , [ "section" , "rearnotes" ] + , [] + ) + [ Header + 2 + ( "" , [] , [] ) + [ Str "NOTES" + , Space + , Str "ON" + , Space + , Str "\"THE" + , Space + , Str "WASTE" + , Space + , Str "LAND\"" + ] + , Para + [ Str "Not" + , Space + , Str "only" + , Space + , Str "the" + , Space + , Str "title," + , Space + , Str "but" + , Space + , Str "the" + , Space + , Str "plan" + , Space + , Str "and" + , Space + , Str "a" + , Space + , Str "good" + , Space + , Str "deal" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "incidental" + , Space + , Str "symbolism" + , Space + , Str "of" + , SoftBreak + , Str "the" + , Space + , Str "poem" + , Space + , Str "were" + , Space + , Str "suggested" + , Space + , Str "by" + , Space + , Str "Miss" + , Space + , Str "Jessie" + , Space + , Str "L." + , Space + , Str "Weston's" + , Space + , Str "book" + , Space + , Str "on" + , Space + , Str "the" + , Space + , Str "Grail" + , Space + , Str "legend:" + , SoftBreak + , Str "From" + , Space + , Str "Ritual" + , Space + , Str "to" + , Space + , Str "Romance" + ] + , Para + [ Str "Indeed," + , Space + , Str "so" + , Space + , Str "deeply" + , Space + , Str "am" + , Space + , Str "I" + , Space + , Str "indebted," + , Space + , Str "Miss" + , Space + , Str "Weston's" + , Space + , Str "book" + , Space + , Str "will" + , Space + , Str "elucidate" + , Space + , Str "the" + , SoftBreak + , Str "difficulties" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "poem" + , Space + , Str "much" + , Space + , Str "better" + , Space + , Str "than" + , Space + , Str "my" + , Space + , Str "notes" + , Space + , Str "can" + , Space + , Str "do;" + , Space + , Str "and" + , Space + , Str "I" + , Space + , Str "recommend" + , Space + , Str "it" + , SoftBreak + , Str "(apart" + , Space + , Str "from" + , Space + , Str "the" + , Space + , Str "great" + , Space + , Str "interest" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "book" + , Space + , Str "itself)" + , Space + , Str "to" + , Space + , Str "any" + , Space + , Str "who" + , Space + , Str "think" + , Space + , Str "such" + , SoftBreak + , Str "elucidation" + , Space + , Str "of" + , Space + , Str "the" + , Space + , Str "poem" + , Space + , Str "worth" + , Space + , Str "the" + , Space + , Str "trouble." + , Space + , Str "To" + , Space + , Str "another" + , Space + , Str "work" + , Space + , Str "of" + , Space + , Str "anthropology" + , Space + , Str "I" + , Space + , Str "am" + , SoftBreak + , Str "indebted" + , Space + , Str "in" + , Space + , Str "general," + , Space + , Str "one" + , Space + , Str "which" + , Space + , Str "has" + , Space + , Str "influenced" + , Space + , Str "our" + , Space + , Str "generation" + , Space + , Str "profoundly;" + , Space + , Str "I" + , Space + , Str "mean" + , SoftBreak + , Str "The" + , Space + , Str "Golden" + , Space + , Str "Bough;" + , Space + , Str "I" + , Space + , Str "have" + , Space + , Str "used" + , Space + , Str "especially" + , Space + , Str "the" + , Space + , Str "two" + , Space + , Str "volumes" + , Space + , Str "Adonis," + , Space + , Str "Attis," + , Space + , Str "Osiris." + , SoftBreak + , Str "Anyone" + , Space + , Str "who" + , Space + , Str "is" + , Space + , Str "acquainted" + , Space + , Str "with" + , Space + , Str "these" + , Space + , Str "works" + , Space + , Str "will" + , Space + , Str "immediately" + , Space + , Str "recognise" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "poem" + , SoftBreak + , Str "certain" + , Space + , Str "references" + , Space + , Str "to" + , Space + , Str "vegetation" + , Space + , Str "ceremonies." + ] + , Div + ( "" , [ "section" ] , [] ) + [ Header + 3 + ( "" , [] , [] ) + [ Str "I." + , Space + , Str "THE" + , Space + , Str "BURIAL" + , Space + , Str "OF" + , Space + , Str "THE" + , Space + , Str "DEAD" + ] + ] + , Div + ( "" , [ "section" ] , [] ) + [ Header + 3 + ( "" , [] , [] ) + [ Str "II." + , Space + , Str "A" + , Space + , Str "GAME" + , Space + , Str "OF" + , Space + , Str "CHESS" + ] + ] + ] + ] ] -- cgit v1.2.3 From 63ea754b49612bb89317b3aa30b756a7cd52d2ac Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 11 Oct 2021 09:24:31 -0700 Subject: Fix warning --- src/Text/Pandoc/Translations.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Translations.hs b/src/Text/Pandoc/Translations.hs index 000d1091b..17d56f262 100644 --- a/src/Text/Pandoc/Translations.hs +++ b/src/Text/Pandoc/Translations.hs @@ -82,7 +82,7 @@ instance YAML.FromYAML Term where parseYAML invalid = YAML.typeMismatch "Term" invalid instance FromJSON Translations where - parseJSON o@(Object hm) = do + parseJSON o@(Object{}) = do xs <- parseJSON o >>= mapM addItem . M.toList return $ Translations (M.fromList xs) where addItem (k,v) = -- cgit v1.2.3 From 2befeaa29f9589f81a3d6cd394d88f29089e7338 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 2 Oct 2021 22:13:03 -0700 Subject: Remove splitSentences from T.P.Shared [API change]. We used to attempt automatic sentence splitting in man and ms output, since sentence-ending periods need to be followed by two spaces or a newline in these formats. But it's difficult to do this reliably at the level of `[Inline]`. --- src/Text/Pandoc/Shared.hs | 28 ---------------------------- src/Text/Pandoc/Writers/Man.hs | 5 ++--- src/Text/Pandoc/Writers/Ms.hs | 5 ++--- 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 7bb830d0e..6e1f29fb1 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -68,7 +68,6 @@ module Text.Pandoc.Shared ( makeMeta, eastAsianLineBreakFilter, htmlSpanLikeElements, - splitSentences, filterIpynbOutput, -- * TagSoup HTML handling renderTags', @@ -709,33 +708,6 @@ eastAsianLineBreakFilter = bottomUp go htmlSpanLikeElements :: Set.Set T.Text htmlSpanLikeElements = Set.fromList ["kbd", "mark", "dfn"] --- | Returns the first sentence in a list of inlines, and the rest. -breakSentence :: [Inline] -> ([Inline], [Inline]) -breakSentence [] = ([],[]) -breakSentence xs = - let isSentenceEndInline (Str ys) - | Just (_, c) <- T.unsnoc ys = c == '.' || c == '?' - isSentenceEndInline LineBreak = True - isSentenceEndInline _ = False - (as, bs) = break isSentenceEndInline xs - in case bs of - [] -> (as, []) - [c] -> (as ++ [c], []) - (c:Space:cs) -> (as ++ [c], cs) - (c:SoftBreak:cs) -> (as ++ [c], cs) - (Str ".":Str s@(T.uncons -> Just (')',_)):cs) - -> (as ++ [Str ".", Str s], cs) - (x@(Str (T.stripPrefix ".)" -> Just _)):cs) -> (as ++ [x], cs) - (LineBreak:x@(Str (T.uncons -> Just ('.',_))):cs) -> (as ++[LineBreak], x:cs) - (c:cs) -> (as ++ [c] ++ ds, es) - where (ds, es) = breakSentence cs - --- | Split a list of inlines into sentences. -splitSentences :: [Inline] -> [[Inline]] -splitSentences xs = - let (sent, rest) = breakSentence xs - in if null rest then [sent] else sent : splitSentences rest - -- | Process ipynb output cells. If mode is Nothing, -- remove all output. If mode is Just format, select -- best output for the format. If format is not ipynb, diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 45516ea06..89789d3c5 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -108,10 +108,9 @@ blockToMan :: PandocMonad m -> StateT WriterState m (Doc Text) blockToMan opts (Div _ bs) = blockListToMan opts bs blockToMan opts (Plain inlines) = - liftM vcat $ mapM (inlineListToMan opts) $ splitSentences inlines + inlineListToMan opts inlines blockToMan opts (Para inlines) = do - contents <- liftM vcat $ mapM (inlineListToMan opts) $ - splitSentences inlines + contents <- inlineListToMan opts inlines return $ text ".PP" $$ contents blockToMan opts (LineBlock lns) = blockToMan opts $ linesToPara lns diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs index 055324448..719407ac1 100644 --- a/src/Text/Pandoc/Writers/Ms.hs +++ b/src/Text/Pandoc/Writers/Ms.hs @@ -142,7 +142,7 @@ blockToMs opts (Div (ident,cls,kvs) bs) = do setFirstPara return $ anchor $$ res blockToMs opts (Plain inlines) = - liftM vcat $ mapM (inlineListToMs' opts) $ splitSentences inlines + inlineListToMs' opts inlines blockToMs opts (Para [Image attr alt (src,_tit)]) | let ext = takeExtension (T.unpack src) in (ext == ".ps" || ext == ".eps") = do let (mbW,mbH) = (inPoints opts <$> dimension Width attr, @@ -165,8 +165,7 @@ blockToMs opts (Para [Image attr alt (src,_tit)]) blockToMs opts (Para inlines) = do firstPara <- gets stFirstPara resetFirstPara - contents <- liftM vcat $ mapM (inlineListToMs' opts) $ - splitSentences inlines + contents <- inlineListToMs' opts inlines return $ literal (if firstPara then ".LP" else ".PP") $$ contents blockToMs _ b@(RawBlock f str) | f == Format "ms" = return $ literal str -- cgit v1.2.3 From 5d17020a20543a5c4864ecb81b0caa5b64c280a9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 2 Oct 2021 22:56:55 -0700 Subject: T.P.Writers.Shared: Export splitSentences as a Doc Text transform. [API change] Use this in man/ms. --- src/Text/Pandoc/Writers/Man.hs | 4 +-- src/Text/Pandoc/Writers/Ms.hs | 7 +++-- src/Text/Pandoc/Writers/Shared.hs | 66 ++++++++++++++++++++++++++++++++------- 3 files changed, 61 insertions(+), 16 deletions(-) diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 89789d3c5..9514a1ce7 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -108,10 +108,10 @@ blockToMan :: PandocMonad m -> StateT WriterState m (Doc Text) blockToMan opts (Div _ bs) = blockListToMan opts bs blockToMan opts (Plain inlines) = - inlineListToMan opts inlines + splitSentences <$> inlineListToMan opts inlines blockToMan opts (Para inlines) = do contents <- inlineListToMan opts inlines - return $ text ".PP" $$ contents + return $ text ".PP" $$ splitSentences contents blockToMan opts (LineBlock lns) = blockToMan opts $ linesToPara lns blockToMan _ b@(RawBlock f str) diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs index 719407ac1..332368a67 100644 --- a/src/Text/Pandoc/Writers/Ms.hs +++ b/src/Text/Pandoc/Writers/Ms.hs @@ -142,7 +142,7 @@ blockToMs opts (Div (ident,cls,kvs) bs) = do setFirstPara return $ anchor $$ res blockToMs opts (Plain inlines) = - inlineListToMs' opts inlines + splitSentences <$> inlineListToMs' opts inlines blockToMs opts (Para [Image attr alt (src,_tit)]) | let ext = takeExtension (T.unpack src) in (ext == ".ps" || ext == ".eps") = do let (mbW,mbH) = (inPoints opts <$> dimension Width attr, @@ -155,7 +155,7 @@ blockToMs opts (Para [Image attr alt (src,_tit)]) space <> doubleQuotes (literal (tshow (floor hp :: Int))) _ -> empty - capt <- inlineListToMs' opts alt + capt <- splitSentences <$> inlineListToMs' opts alt return $ nowrap (literal ".PSPIC -C " <> doubleQuotes (literal (escapeStr opts src)) <> sizeAttrs) $$ @@ -166,7 +166,8 @@ blockToMs opts (Para inlines) = do firstPara <- gets stFirstPara resetFirstPara contents <- inlineListToMs' opts inlines - return $ literal (if firstPara then ".LP" else ".PP") $$ contents + return $ literal (if firstPara then ".LP" else ".PP") $$ + splitSentences contents blockToMs _ b@(RawBlock f str) | f == Format "ms" = return $ literal str | otherwise = do diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs index 0b7c6bee0..34c4ebfba 100644 --- a/src/Text/Pandoc/Writers/Shared.hs +++ b/src/Text/Pandoc/Writers/Shared.hs @@ -36,6 +36,8 @@ module Text.Pandoc.Writers.Shared ( , toTableOfContents , endsWithPlain , toLegacyTable + , breakable + , splitSentences ) where import Safe (lastMay) @@ -49,6 +51,7 @@ import Data.List.NonEmpty (NonEmpty(..), nonEmpty) import Data.Text.Conversions (FromText(..)) import qualified Data.Map as M import qualified Data.Text as T +import Data.Text (Text) import qualified Text.Pandoc.Builder as Builder import Text.Pandoc.Definition import Text.Pandoc.Options @@ -119,13 +122,13 @@ metaValueToVal _ inlineWriter (MetaInlines is) = SimpleVal <$> inlineWriter is -- | Retrieve a field value from a template context. -getField :: FromContext a b => T.Text -> Context a -> Maybe b +getField :: FromContext a b => Text -> Context a -> Maybe b getField field (Context m) = M.lookup field m >>= fromVal -- | Set a field of a template context. If the field already has a value, -- convert it into a list with the new value appended to the old value(s). -- This is a utility function to be used in preparing template contexts. -setField :: ToContext a b => T.Text -> b -> Context a -> Context a +setField :: ToContext a b => Text -> b -> Context a -> Context a setField field val (Context m) = Context $ M.insertWith combine field (toVal val) m where @@ -135,21 +138,21 @@ setField field val (Context m) = -- | Reset a field of a template context. If the field already has a -- value, the new value replaces it. -- This is a utility function to be used in preparing template contexts. -resetField :: ToContext a b => T.Text -> b -> Context a -> Context a +resetField :: ToContext a b => Text -> b -> Context a -> Context a resetField field val (Context m) = Context (M.insert field (toVal val) m) -- | Set a field of a template context if it currently has no value. -- If it has a value, do nothing. -- This is a utility function to be used in preparing template contexts. -defField :: ToContext a b => T.Text -> b -> Context a -> Context a +defField :: ToContext a b => Text -> b -> Context a -> Context a defField field val (Context m) = Context (M.insertWith f field (toVal val) m) where f _newval oldval = oldval -- | Get the contents of the `lang` metadata field or variable. -getLang :: WriterOptions -> Meta -> Maybe T.Text +getLang :: WriterOptions -> Meta -> Maybe Text getLang opts meta = case lookupContext "lang" (writerVariables opts) of Just s -> Just s @@ -162,7 +165,7 @@ getLang opts meta = _ -> Nothing -- | Produce an HTML tag with the given pandoc attributes. -tagWithAttrs :: HasChars a => T.Text -> Attr -> Doc a +tagWithAttrs :: HasChars a => Text -> Attr -> Doc a tagWithAttrs tag (ident,classes,kvs) = hsep ["<" <> text (T.unpack tag) ,if T.null ident @@ -213,7 +216,7 @@ fixDisplayMath x = x -- | Converts a Unicode character into the ASCII sequence used to -- represent the character in "smart" Markdown. -unsmartify :: WriterOptions -> T.Text -> T.Text +unsmartify :: WriterOptions -> Text -> Text unsmartify opts = T.concatMap $ \c -> case c of '\8217' -> "'" '\8230' -> "..." @@ -345,7 +348,7 @@ gridTable opts blocksToDoc headless aligns widths headers rows = do -- | Retrieve the metadata value for a given @key@ -- and convert to Bool. -lookupMetaBool :: T.Text -> Meta -> Bool +lookupMetaBool :: Text -> Meta -> Bool lookupMetaBool key meta = case lookupMeta key meta of Just (MetaBlocks _) -> True @@ -356,7 +359,7 @@ lookupMetaBool key meta = -- | Retrieve the metadata value for a given @key@ -- and extract blocks. -lookupMetaBlocks :: T.Text -> Meta -> [Block] +lookupMetaBlocks :: Text -> Meta -> [Block] lookupMetaBlocks key meta = case lookupMeta key meta of Just (MetaBlocks bs) -> bs @@ -366,7 +369,7 @@ lookupMetaBlocks key meta = -- | Retrieve the metadata value for a given @key@ -- and extract inlines. -lookupMetaInlines :: T.Text -> Meta -> [Inline] +lookupMetaInlines :: Text -> Meta -> [Inline] lookupMetaInlines key meta = case lookupMeta key meta of Just (MetaString s) -> [Str s] @@ -377,7 +380,7 @@ lookupMetaInlines key meta = -- | Retrieve the metadata value for a given @key@ -- and convert to String. -lookupMetaString :: T.Text -> Meta -> T.Text +lookupMetaString :: Text -> Meta -> Text lookupMetaString key meta = case lookupMeta key meta of Just (MetaString s) -> s @@ -519,3 +522,44 @@ toLegacyTable (Caption _ cbody) specs thead tbodies tfoot getComponents (Cell _ _ (RowSpan h) (ColSpan w) body) = (h, w, body) + +-- | Create a breakable 'Doc' from a text. Only regular spaces +-- are break points (not tabs or nonbreaking spaces). +breakable :: Text -> Doc Text +breakable t + | T.any (== ' ') t = mconcat $ foldr go mempty (T.split (==' ') t) + | otherwise = Text (realLength t) t + where + go "" xs = + case xs of + BreakingSpace : _ -> xs + _ -> BreakingSpace : xs + go t' xs = Text (realLength t') t' : + case xs of + [] -> xs + BreakingSpace : _ -> xs + _ -> BreakingSpace : xs + +splitSentences :: Doc Text -> Doc Text +splitSentences = go . toList + where + go [] = mempty + go (Text len t : BreakingSpace : xs) = + if isSentenceEnding t + then Text len t <> NewLine <> go xs + else Text len t <> BreakingSpace <> go xs + go (x:xs) = x <> go xs + + toList (Concat (Concat a b) c) = toList (Concat a (Concat b c)) + toList (Concat a b) = a : toList b + toList x = [x] + + isSentenceEnding t = + case T.unsnoc t of + Just (t',c) + | c == '.' || c == '!' || c == '?' -> True + | c == ')' || c == ']' || c == '"' || c == '\x201D' -> + case T.unsnoc t' of + Just (_,d) -> d == '.' || d == '!' || d == '?' + _ -> False + _ -> False -- cgit v1.2.3 From 906e6016bb33aa1d5a20edc45c91836289caf52f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 11 Oct 2021 15:08:33 -0700 Subject: T.P.Writers.Shared: remove 'breakable'... which was introduced in the cherry-pick'd commit that added splitSentences, but isn't needed here. (It is for the nospace branch.) --- src/Text/Pandoc/Writers/Shared.hs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs index 34c4ebfba..6b8be3c8b 100644 --- a/src/Text/Pandoc/Writers/Shared.hs +++ b/src/Text/Pandoc/Writers/Shared.hs @@ -36,7 +36,6 @@ module Text.Pandoc.Writers.Shared ( , toTableOfContents , endsWithPlain , toLegacyTable - , breakable , splitSentences ) where @@ -523,23 +522,6 @@ toLegacyTable (Caption _ cbody) specs thead tbodies tfoot getComponents (Cell _ _ (RowSpan h) (ColSpan w) body) = (h, w, body) --- | Create a breakable 'Doc' from a text. Only regular spaces --- are break points (not tabs or nonbreaking spaces). -breakable :: Text -> Doc Text -breakable t - | T.any (== ' ') t = mconcat $ foldr go mempty (T.split (==' ') t) - | otherwise = Text (realLength t) t - where - go "" xs = - case xs of - BreakingSpace : _ -> xs - _ -> BreakingSpace : xs - go t' xs = Text (realLength t') t' : - case xs of - [] -> xs - BreakingSpace : _ -> xs - _ -> BreakingSpace : xs - splitSentences :: Doc Text -> Doc Text splitSentences = go . toList where -- cgit v1.2.3 From 972012a42a92351efa156f836c7899ca886ab068 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 11 Oct 2021 21:05:27 -0700 Subject: Require doclayout >= 0.3.1.1. This fixes recognition of "real widths" of emoji characters, which is important for tabular layout. --- pandoc.cabal | 2 +- stack.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 50f33c937..82938c085 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -542,7 +542,7 @@ library data-default >= 0.4 && < 0.8, deepseq >= 1.3 && < 1.5, directory >= 1.2.3 && < 1.4, - doclayout >= 0.3.0.1 && < 0.4, + doclayout >= 0.3.1.1 && < 0.4, doctemplates >= 0.10 && < 0.11, emojis >= 0.1 && < 0.2, exceptions >= 0.8 && < 0.11, diff --git a/stack.yaml b/stack.yaml index ea06a6437..f4c42c6d1 100644 --- a/stack.yaml +++ b/stack.yaml @@ -11,7 +11,7 @@ extra-deps: - skylighting-0.12 - doctemplates-0.10 - emojis-0.1.2 -- doclayout-0.3.1 +- doclayout-0.3.1.1 - git: https://github.com/jgm/pandoc-types.git commit: f796401eaaab780f83c562e97dbb8c8d4b9974d1 - git: https://github.com/jgm/texmath.git -- cgit v1.2.3 From 051c366029eb7c18ac57126eba0d5c534be1230e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 12 Oct 2021 17:44:59 -0700 Subject: Depend on latest dev version of commonmark. --- cabal.project | 8 +++++++- stack.yaml | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cabal.project b/cabal.project index 930db65e8..d91fe2879 100644 --- a/cabal.project +++ b/cabal.project @@ -20,6 +20,12 @@ source-repository-package source-repository-package type: git location: https://github.com/jgm/commonmark-hs.git - tag: 3cba9f874db7516f49d221a94171b4af010b5bea + tag: 7d34a747cd2d8668451909a722eb9ce16d1f4852 + subdir: commonmark + +source-repository-package + type: git + location: https://github.com/jgm/commonmark-hs.git + tag: 7d34a747cd2d8668451909a722eb9ce16d1f4852 subdir: commonmark-pandoc diff --git a/stack.yaml b/stack.yaml index f4c42c6d1..78f5f63de 100644 --- a/stack.yaml +++ b/stack.yaml @@ -19,8 +19,8 @@ extra-deps: - git: https://github.com/jgm/citeproc.git commit: 673a7fb643d24a3bb0f60f8f29e189c0ba7ef15b - git: https://github.com/jgm/commonmark-hs.git - commit: 3cba9f874db7516f49d221a94171b4af010b5bea - subdirs: [commonmark-pandoc] + commit: 7d34a747cd2d8668451909a722eb9ce16d1f4852 + subdirs: [commonmark, commonmark-pandoc] ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From bc95721754a8d082de250dd545088f92e86b5c11 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 12 Oct 2021 19:39:21 -0700 Subject: Allow aeson 2.0 --- pandoc.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandoc.cabal b/pandoc.cabal index 82938c085..c13c768f4 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -523,7 +523,7 @@ library HsYAML >= 0.2 && < 0.3, JuicyPixels >= 3.1.6.1 && < 3.4, SHA >= 1.6 && < 1.7, - aeson >= 0.7 && < 1.6, + aeson >= 0.7 && < 2.1, aeson-pretty >= 0.8.5 && < 0.9, array >= 0.5 && < 0.6, attoparsec >= 0.12 && < 0.15, -- cgit v1.2.3 From 6593f9638e7b53c2b5d738c27ff9dfccdbf2ce39 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 12 Oct 2021 19:39:47 -0700 Subject: cabal.project: Dependencies to build with aeson 2. --- cabal.project | 13 ++++++++++++- stack.yaml | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cabal.project b/cabal.project index d91fe2879..64ab70164 100644 --- a/cabal.project +++ b/cabal.project @@ -1,6 +1,7 @@ packages: pandoc.cabal tests: True flags: +embed_data_files +constraints: aeson >= 2.0.1.0 source-repository-package type: git @@ -15,7 +16,7 @@ source-repository-package source-repository-package type: git location: https://github.com/jgm/pandoc-types.git - tag: f796401eaaab780f83c562e97dbb8c8d4b9974d1 + tag: 87711e7e60a3981da0f1cc3df9e57f1134f1b82e source-repository-package type: git @@ -29,3 +30,13 @@ source-repository-package tag: 7d34a747cd2d8668451909a722eb9ce16d1f4852 subdir: commonmark-pandoc +source-repository-package + type: git + location: https://github.com/hasufell/aeson-pretty.git + tag: e902ab866bb41d990b66af3644aeb352ff7aaf6f + +source-repository-package + type: git + location: https://github.com/jgm/ipynb.git + tag: 1f1ddb29227335091a3a158b9aeeeb47a372c683 + diff --git a/stack.yaml b/stack.yaml index 78f5f63de..3d99d80b5 100644 --- a/stack.yaml +++ b/stack.yaml @@ -13,7 +13,7 @@ extra-deps: - emojis-0.1.2 - doclayout-0.3.1.1 - git: https://github.com/jgm/pandoc-types.git - commit: f796401eaaab780f83c562e97dbb8c8d4b9974d1 + commit: 87711e7e60a3981da0f1cc3df9e57f1134f1b82e - git: https://github.com/jgm/texmath.git commit: c046e6e5a93510f2c37dbc700f82a2c53ed87b5f - git: https://github.com/jgm/citeproc.git -- cgit v1.2.3 From c636b5dd1640c1f13f21bb2828c817213455229f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 12 Oct 2021 20:08:35 -0700 Subject: Revert "Depend on pandoc-types 1.23, remove Null constructor on Block." This reverts commit fb0d6c7cb63a791fa72becf21ed493282e65ea91. --- cabal.project | 2 +- pandoc.cabal | 4 ++-- src/Text/Pandoc/Lua/Marshaling/AST.hs | 2 ++ src/Text/Pandoc/Shared.hs | 1 + src/Text/Pandoc/Writers/AsciiDoc.hs | 1 + src/Text/Pandoc/Writers/ConTeXt.hs | 1 + src/Text/Pandoc/Writers/Custom.hs | 2 ++ src/Text/Pandoc/Writers/Docbook.hs | 1 + src/Text/Pandoc/Writers/Docx.hs | 1 + src/Text/Pandoc/Writers/DokuWiki.hs | 2 ++ src/Text/Pandoc/Writers/FB2.hs | 1 + src/Text/Pandoc/Writers/HTML.hs | 1 + src/Text/Pandoc/Writers/Haddock.hs | 1 + src/Text/Pandoc/Writers/ICML.hs | 1 + src/Text/Pandoc/Writers/JATS.hs | 1 + src/Text/Pandoc/Writers/Jira.hs | 1 + src/Text/Pandoc/Writers/LaTeX.hs | 1 + src/Text/Pandoc/Writers/Man.hs | 1 + src/Text/Pandoc/Writers/Markdown.hs | 3 ++- src/Text/Pandoc/Writers/MediaWiki.hs | 2 ++ src/Text/Pandoc/Writers/Ms.hs | 1 + src/Text/Pandoc/Writers/Muse.hs | 1 + src/Text/Pandoc/Writers/OpenDocument.hs | 1 + src/Text/Pandoc/Writers/Org.hs | 1 + src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 1 + src/Text/Pandoc/Writers/RST.hs | 1 + src/Text/Pandoc/Writers/RTF.hs | 1 + src/Text/Pandoc/Writers/TEI.hs | 1 + src/Text/Pandoc/Writers/Texinfo.hs | 2 ++ src/Text/Pandoc/Writers/Textile.hs | 2 ++ src/Text/Pandoc/Writers/XWiki.hs | 2 ++ src/Text/Pandoc/Writers/ZimWiki.hs | 2 ++ stack.yaml | 4 ++-- 33 files changed, 44 insertions(+), 6 deletions(-) diff --git a/cabal.project b/cabal.project index 64ab70164..04b79c0a7 100644 --- a/cabal.project +++ b/cabal.project @@ -16,7 +16,7 @@ source-repository-package source-repository-package type: git location: https://github.com/jgm/pandoc-types.git - tag: 87711e7e60a3981da0f1cc3df9e57f1134f1b82e + tag: 99402a46361a3e52805935b1fbe9dfe54f852d6a source-repository-package type: git diff --git a/pandoc.cabal b/pandoc.cabal index c13c768f4..615feaccb 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -561,7 +561,7 @@ library mtl >= 2.2 && < 2.3, network >= 2.6, network-uri >= 2.6 && < 2.8, - pandoc-types >= 1.23 && < 1.24, + pandoc-types >= 1.22 && < 1.23, parsec >= 3.1 && < 3.2, process >= 1.2.3 && < 1.7, random >= 1 && < 1.3, @@ -847,7 +847,7 @@ test-suite test-pandoc filepath >= 1.1 && < 1.5, hslua >= 1.1 && < 1.4, mtl >= 2.2 && < 2.3, - pandoc-types >= 1.23 && < 1.24, + pandoc-types >= 1.22 && < 1.23, process >= 1.2.3 && < 1.7, tasty >= 0.11 && < 1.5, tasty-golden >= 2.3 && < 2.4, diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index a1ad2cda3..8e12d232c 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -165,6 +165,7 @@ pushBlock = \case LineBlock blcks -> pushViaConstructor "LineBlock" blcks OrderedList lstAttr list -> pushViaConstructor "OrderedList" list (LuaListAttributes lstAttr) + Null -> pushViaConstructor "Null" Para blcks -> pushViaConstructor "Para" blcks Plain blcks -> pushViaConstructor "Plain" blcks RawBlock f cs -> pushViaConstructor "RawBlock" f cs @@ -188,6 +189,7 @@ peekBlock idx = defineHowTo "get Block value" $! do "OrderedList" -> (\(LuaListAttributes lstAttr, lst) -> OrderedList lstAttr lst) <$!> elementContent + "Null" -> return Null "Para" -> Para <$!> elementContent "Plain" -> Plain <$!> elementContent "RawBlock" -> uncurry RawBlock <$!> elementContent diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 6e1f29fb1..06fd052b9 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -920,6 +920,7 @@ blockToInlines (Table _ _ _ (TableHead _ hbd) bodies (TableFoot _ fbd)) = unTableBody (TableBody _ _ hd bd) = hd <> bd unTableBodies = concatMap unTableBody blockToInlines (Div _ blks) = blocksToInlines' blks +blockToInlines Null = mempty blocksToInlinesWithSep :: Inlines -> [Block] -> Inlines blocksToInlinesWithSep sep = diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index f0973178e..bcef4a089 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -140,6 +140,7 @@ blockToAsciiDoc :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> ADW m (Doc Text) +blockToAsciiDoc _ Null = return empty blockToAsciiDoc opts (Div (id',"section":_,_) (Header level (_,cls,kvs) ils : xs)) = do hdr <- blockToAsciiDoc opts (Header level (id',cls,kvs) ils) diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index 0150f7dff..3cafcefba 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -154,6 +154,7 @@ toLabel z = T.concatMap go z -- | Convert Pandoc block element to ConTeXt. blockToConTeXt :: PandocMonad m => Block -> WM m (Doc Text) +blockToConTeXt Null = return empty blockToConTeXt (Div attr@(_,"section":_,_) (Header level _ title' : xs)) = do header' <- sectionHeader attr level title' diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs index d207f5093..1e9f37d2f 100644 --- a/src/Text/Pandoc/Writers/Custom.hs +++ b/src/Text/Pandoc/Writers/Custom.hs @@ -116,6 +116,8 @@ docToCustom opts (Pandoc (Meta metamap) blocks) = do blockToCustom :: Block -- ^ Block element -> Lua String +blockToCustom Null = return "" + blockToCustom (Plain inlines) = Lua.callFunc "Plain" (Stringify inlines) blockToCustom (Para [Image attr txt (src,tit)]) = diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index 3cb68c311..33a6f5f0c 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -165,6 +165,7 @@ imageToDocbook _ attr src = selfClosingTag "imagedata" $ -- | Convert a Pandoc block element to Docbook. blockToDocbook :: PandocMonad m => WriterOptions -> Block -> DB m (Doc Text) +blockToDocbook _ Null = return empty -- Add ids to paragraphs in divs with ids - this is needed for -- pandoc-citeproc to get link anchors in bibliographies: blockToDocbook opts (Div (id',"section":_,_) (Header lvl (_,_,attrs) ils : xs)) = do diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index a3949792d..686a2f662 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -800,6 +800,7 @@ blockToOpenXML :: (PandocMonad m) => WriterOptions -> Block -> WS m [Content] blockToOpenXML opts blk = withDirection $ blockToOpenXML' opts blk blockToOpenXML' :: (PandocMonad m) => WriterOptions -> Block -> WS m [Content] +blockToOpenXML' _ Null = return [] blockToOpenXML' opts (Div (ident,_classes,kvs) bs) = do stylemod <- case lookup dynamicStyleKey kvs of Just (fromString . T.unpack -> sty) -> do diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index 5fe64717a..602c70ebe 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -98,6 +98,8 @@ blockToDokuWiki :: PandocMonad m -> Block -- ^ Block element -> DokuWiki m Text +blockToDokuWiki _ Null = return "" + blockToDokuWiki opts (Div _attrs bs) = do contents <- blockListToDokuWiki opts bs return $ contents <> "\n" diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs index f393f031f..6bad37404 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -358,6 +358,7 @@ blockToXml (Table _ blkCapt specs thead tbody tfoot) = do align_str AlignCenter = "center" align_str AlignRight = "right" align_str AlignDefault = "left" +blockToXml Null = return [] -- Replace plain text with paragraphs and add line break after paragraphs. -- It is used to convert plain text from tight list items to paragraphs. diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 5992c994f..8fc81ed24 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -730,6 +730,7 @@ adjustNumbers opts doc = showSecNum = T.intercalate "." . map tshow blockToHtmlInner :: PandocMonad m => WriterOptions -> Block -> StateT WriterState m Html +blockToHtmlInner _ Null = return mempty blockToHtmlInner opts (Plain lst) = inlineListToHtml opts lst blockToHtmlInner opts (Para [Image attr@(_,classes,_) txt (src,tit)]) | "stretch" `elem` classes = do diff --git a/src/Text/Pandoc/Writers/Haddock.hs b/src/Text/Pandoc/Writers/Haddock.hs index 9a61c339a..75e14714b 100644 --- a/src/Text/Pandoc/Writers/Haddock.hs +++ b/src/Text/Pandoc/Writers/Haddock.hs @@ -90,6 +90,7 @@ blockToHaddock :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> StateT WriterState m (Doc Text) +blockToHaddock _ Null = return empty blockToHaddock opts (Div _ ils) = do contents <- blockListToHaddock opts ils return $ contents <> blankline diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs index 8da931406..c254fbc58 100644 --- a/src/Text/Pandoc/Writers/ICML.hs +++ b/src/Text/Pandoc/Writers/ICML.hs @@ -381,6 +381,7 @@ blockToICML opts style (Table _ blkCapt specs thead tbody tfoot) = blockToICML opts style (Div (_ident, _, kvs) lst) = let dynamicStyle = maybeToList $ lookup dynamicStyleKey kvs in blocksToICML opts (dynamicStyle <> style) lst +blockToICML _ _ Null = return empty -- | Convert a list of lists of blocks to ICML list items. listItemsToICML :: PandocMonad m => WriterOptions -> Text -> Style -> Maybe ListAttributes -> [[Block]] -> WS m (Doc Text) diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs index f20178bd1..9db8723d1 100644 --- a/src/Text/Pandoc/Writers/JATS.hs +++ b/src/Text/Pandoc/Writers/JATS.hs @@ -251,6 +251,7 @@ codeAttr opts (ident,classes,kvs) = (lang, attr) -- | Convert a Pandoc block element to JATS. blockToJATS :: PandocMonad m => WriterOptions -> Block -> JATS m (Doc Text) +blockToJATS _ Null = return empty blockToJATS opts (Div (id',"section":_,kvs) (Header _lvl _ ils : xs)) = do let idAttr = [ ("id", writerIdentifierPrefix opts <> escapeNCName id') | not (T.null id')] diff --git a/src/Text/Pandoc/Writers/Jira.hs b/src/Text/Pandoc/Writers/Jira.hs index 709064270..1351814e9 100644 --- a/src/Text/Pandoc/Writers/Jira.hs +++ b/src/Text/Pandoc/Writers/Jira.hs @@ -103,6 +103,7 @@ toJiraBlocks blocks = do Para xs -> singleton . Jira.Para <$> toJiraInlines xs Plain xs -> singleton . Jira.Para <$> toJiraInlines xs RawBlock fmt cs -> rawBlockToJira fmt cs + Null -> return mempty Table _ blkCapt specs thead tbody tfoot -> singleton <$> do let (_, _, _, hd, body) = toLegacyTable blkCapt specs thead tbody tfoot headerRow <- if all null hd diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 144c3d579..8c45c8db5 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -253,6 +253,7 @@ isListBlock _ = False blockToLaTeX :: PandocMonad m => Block -- ^ Block to convert -> LW m (Doc Text) +blockToLaTeX Null = return empty blockToLaTeX (Div attr@(identifier,"block":dclasses,_) (Header _ _ ils : bs)) = do let blockname diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 9514a1ce7..8a34bf47f 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -106,6 +106,7 @@ blockToMan :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> StateT WriterState m (Doc Text) +blockToMan _ Null = return empty blockToMan opts (Div _ bs) = blockListToMan opts bs blockToMan opts (Plain inlines) = splitSentences <$> inlineListToMan opts inlines diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 49fb873a9..fda2bbcef 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -313,6 +313,7 @@ blockToMarkdown' :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> MD m (Doc Text) +blockToMarkdown' _ Null = return empty blockToMarkdown' opts (Div attrs ils) = do contents <- blockListToMarkdown opts ils variant <- asks envVariant @@ -811,7 +812,7 @@ blockListToMarkdown opts blocks = do isListBlock (DefinitionList _) = True isListBlock _ = False commentSep - | variant == PlainText = RawBlock "html" "\n" + | variant == PlainText = Null | isEnabled Ext_raw_html opts = RawBlock "html" "\n" | otherwise = RawBlock "markdown" " \n" mconcat <$> mapM (blockToMarkdown opts) (fixBlocks blocks) diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index 899e40418..5029be69f 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -81,6 +81,8 @@ blockToMediaWiki :: PandocMonad m => Block -- ^ Block element -> MediaWikiWriter m Text +blockToMediaWiki Null = return "" + blockToMediaWiki (Div attrs bs) = do contents <- blockListToMediaWiki bs return $ render Nothing (tagWithAttrs "div" attrs) <> "\n\n" <> diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs index 332368a67..eeb8eca62 100644 --- a/src/Text/Pandoc/Writers/Ms.hs +++ b/src/Text/Pandoc/Writers/Ms.hs @@ -110,6 +110,7 @@ blockToMs :: PandocMonad m => WriterOptions -- ^ Options -> Block -- ^ Block element -> MS m (Doc Text) +blockToMs _ Null = return empty blockToMs opts (Div (ident,cls,kvs) bs) = do let anchor = if T.null ident then empty diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index 329522a48..d5100f43f 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -275,6 +275,7 @@ blockToMuse (Table _ blkCapt specs thead tbody tfoot) = (length aligns :| length widths : map length (headers:rows)) isSimple = onlySimpleTableCells (headers : rows) && all (== 0) widths blockToMuse (Div _ bs) = flatBlockListToMuse bs +blockToMuse Null = return empty -- | Return Muse representation of notes collected so far. currentNotesToMuse :: PandocMonad m diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 27473775b..5f3224c2f 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -398,6 +398,7 @@ blockToOpenDocument o = \case b@(RawBlock f s) -> if f == Format "opendocument" then return $ text $ T.unpack s else empty <$ report (BlockNotRendered b) + Null -> return empty where defList b = do setInDefinitionList True r <- vcat <$> mapM (deflistItemToOpenDocument o) b diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index aae6fe0ef..f4a22695c 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -102,6 +102,7 @@ isRawFormat f = blockToOrg :: PandocMonad m => Block -- ^ Block element -> Org m (Doc Text) +blockToOrg Null = return empty blockToOrg (Div attr bs) = divToOrg attr bs blockToOrg (Plain inlines) = inlineListToOrg inlines -- title beginning with fig: indicates that the image is a figure diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 99b016a63..fe34d24dc 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -1041,6 +1041,7 @@ blockIsBlank HorizontalRule -> True Table{} -> False Div _ bls -> all blockIsBlank bls + Null -> True textIsBlank :: T.Text -> Bool textIsBlank = T.all isSpace diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 88e185897..8b2002851 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -197,6 +197,7 @@ bordered contents c = blockToRST :: PandocMonad m => Block -- ^ Block element -> RST m (Doc Text) +blockToRST Null = return empty blockToRST (Div ("",["title"],[]) _) = return empty -- this is generated by the rst reader and can safely be -- omitted when we're generating rst diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index 7e3e770ba..063371ebc 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -229,6 +229,7 @@ blockToRTF :: PandocMonad m -> Alignment -- ^ alignment -> Block -- ^ block to convert -> m Text +blockToRTF _ _ Null = return "" blockToRTF indent alignment (Div _ bs) = blocksToRTF indent alignment bs blockToRTF indent alignment (Plain lst) = diff --git a/src/Text/Pandoc/Writers/TEI.hs b/src/Text/Pandoc/Writers/TEI.hs index e8682018b..18015259d 100644 --- a/src/Text/Pandoc/Writers/TEI.hs +++ b/src/Text/Pandoc/Writers/TEI.hs @@ -97,6 +97,7 @@ imageToTEI opts attr src = return $ selfClosingTag "graphic" $ -- | Convert a Pandoc block element to TEI. blockToTEI :: PandocMonad m => WriterOptions -> Block -> m (Doc Text) +blockToTEI _ Null = return empty blockToTEI opts (Div attr@(_,"section":_,_) (Header lvl _ ils : xs)) = do -- TEI doesn't allow sections with no content, so insert some if needed diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs index f817900e5..6a33b4283 100644 --- a/src/Text/Pandoc/Writers/Texinfo.hs +++ b/src/Text/Pandoc/Writers/Texinfo.hs @@ -115,6 +115,8 @@ blockToTexinfo :: PandocMonad m => Block -- ^ Block to convert -> TI m (Doc Text) +blockToTexinfo Null = return empty + blockToTexinfo (Div _ bs) = blockListToTexinfo bs blockToTexinfo (Plain lst) = diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs index b1a4ed4a0..03d030477 100644 --- a/src/Text/Pandoc/Writers/Textile.hs +++ b/src/Text/Pandoc/Writers/Textile.hs @@ -100,6 +100,8 @@ blockToTextile :: PandocMonad m -> Block -- ^ Block element -> TW m Text +blockToTextile _ Null = return "" + blockToTextile opts (Div attr bs) = do let startTag = render Nothing $ tagWithAttrs "div" attr let endTag = "" diff --git a/src/Text/Pandoc/Writers/XWiki.hs b/src/Text/Pandoc/Writers/XWiki.hs index 0d7387eaa..c35235650 100644 --- a/src/Text/Pandoc/Writers/XWiki.hs +++ b/src/Text/Pandoc/Writers/XWiki.hs @@ -74,6 +74,8 @@ blockListToXWiki blocks = blockToXWiki :: PandocMonad m => Block -> XWikiReader m Text +blockToXWiki Null = return "" + blockToXWiki (Div (id', _, _) blocks) = do content <- blockListToXWiki blocks return $ genAnchor id' <> content diff --git a/src/Text/Pandoc/Writers/ZimWiki.hs b/src/Text/Pandoc/Writers/ZimWiki.hs index 651da4e46..df914f590 100644 --- a/src/Text/Pandoc/Writers/ZimWiki.hs +++ b/src/Text/Pandoc/Writers/ZimWiki.hs @@ -78,6 +78,8 @@ escapeText = T.replace "__" "''__''" . -- | Convert Pandoc block element to ZimWiki. blockToZimWiki :: PandocMonad m => WriterOptions -> Block -> ZW m Text +blockToZimWiki _ Null = return "" + blockToZimWiki opts (Div _attrs bs) = do contents <- blockListToZimWiki opts bs return $ contents <> "\n" diff --git a/stack.yaml b/stack.yaml index 3d99d80b5..d12ab3587 100644 --- a/stack.yaml +++ b/stack.yaml @@ -13,9 +13,9 @@ extra-deps: - emojis-0.1.2 - doclayout-0.3.1.1 - git: https://github.com/jgm/pandoc-types.git - commit: 87711e7e60a3981da0f1cc3df9e57f1134f1b82e + commit: 99402a46361a3e52805935b1fbe9dfe54f852d6a - git: https://github.com/jgm/texmath.git - commit: c046e6e5a93510f2c37dbc700f82a2c53ed87b5f + commit: 19700530733707284bb41f24add757f19ca23430 - git: https://github.com/jgm/citeproc.git commit: 673a7fb643d24a3bb0f60f8f29e189c0ba7ef15b - git: https://github.com/jgm/commonmark-hs.git -- cgit v1.2.3 From afc16f2f4bbff941370310e637a0ab5feaea7879 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 12 Oct 2021 21:00:26 -0700 Subject: cabal build: go back to using aeson < 2 for now. --- cabal.project | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cabal.project b/cabal.project index 04b79c0a7..2b19ad28e 100644 --- a/cabal.project +++ b/cabal.project @@ -1,7 +1,7 @@ packages: pandoc.cabal tests: True flags: +embed_data_files -constraints: aeson >= 2.0.1.0 +-- constraints: aeson >= 2.0.1.0 source-repository-package type: git @@ -30,13 +30,15 @@ source-repository-package tag: 7d34a747cd2d8668451909a722eb9ce16d1f4852 subdir: commonmark-pandoc -source-repository-package - type: git - location: https://github.com/hasufell/aeson-pretty.git - tag: e902ab866bb41d990b66af3644aeb352ff7aaf6f +-- Needed to build with aeson 2 -source-repository-package - type: git - location: https://github.com/jgm/ipynb.git - tag: 1f1ddb29227335091a3a158b9aeeeb47a372c683 +-- source-repository-package +-- type: git +-- location: https://github.com/hasufell/aeson-pretty.git +-- tag: e902ab866bb41d990b66af3644aeb352ff7aaf6f + +-- source-repository-package +-- type: git +-- location: https://github.com/jgm/ipynb.git +-- tag: 1f1ddb29227335091a3a158b9aeeeb47a372c683 -- cgit v1.2.3 From 49c4e1d014f90a10e7ed87a8fa5f1c0e9b8dbc8a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 13 Oct 2021 08:59:37 -0700 Subject: Fix markdown parsing bug for math in bracketed spans and links. This affects math with unbalanced brackets (e.g. `$(0,1]$`) inside links, images, bracketed spans. Closes #7623. --- src/Text/Pandoc/Readers/Markdown.hs | 1 + test/command/7623.md | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 test/command/7623.md diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 85599abe4..42ca16c92 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -198,6 +198,7 @@ inlinesInBalancedBrackets = go openBrackets = (() <$ (escapedChar <|> code <|> + math <|> rawHtmlInline <|> rawLaTeXInline') >> go openBrackets) <|> diff --git a/test/command/7623.md b/test/command/7623.md new file mode 100644 index 000000000..1c4c8a0c1 --- /dev/null +++ b/test/command/7623.md @@ -0,0 +1,12 @@ +``` +% pandoc -t native +[link $(0,1]$](url) +^D +[ Para + [ Link + ( "" , [] , [] ) + [ Str "link" , Space , Math InlineMath "(0,1]" ] + ( "url" , "" ) + ] +] +``` -- cgit v1.2.3 From ed8877bd687333657b82864d609f4db69743c165 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 14 Oct 2021 16:42:21 +0200 Subject: Remove redundant $ Found by hlint 3.3.1 --- src/Text/Pandoc/Citeproc/BibTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs index 5c7bdd9b5..9dcefb8d3 100644 --- a/src/Text/Pandoc/Citeproc/BibTeX.hs +++ b/src/Text/Pandoc/Citeproc/BibTeX.hs @@ -985,7 +985,7 @@ getTitle f = do lang <- gets localeLang let ils' = if f == "series" - then resolveKey lang $ ils + then resolveKey lang ils else ils let processTitle = if utc then unTitlecase (Just lang) else id return $ processTitle ils' -- cgit v1.2.3 From 628cde48cf54d806508869a9d6f4307efc266ef2 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 14 Oct 2021 15:15:25 +0200 Subject: DocBook reader: honor linenumbering attribute The attribute DocBook linenumbering="numbered" attribute on code blocks maps to "numberLines" internally. --- src/Text/Pandoc/Readers/DocBook.hs | 1 + test/docbook-reader.docbook | 5 +++++ test/docbook-reader.native | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index c49b82ccf..1c13e597b 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -907,6 +907,7 @@ parseBlock (Elem e) = let classes' = case attrValue "language" e of "" -> [] x -> [x] + ++ ["numberLines" | attrValue "linenumbering" e == "numbered"] return $ codeBlockWith (attrValue "id" e, classes', []) $ trimNl $ strContentRecursive e parseBlockquote = do diff --git a/test/docbook-reader.docbook b/test/docbook-reader.docbook index f021dc8be..c38abda82 100644 --- a/test/docbook-reader.docbook +++ b/test/docbook-reader.docbook @@ -101,6 +101,11 @@ sub status { print "working"; } + + +sub status { + print "working with line numbers"; +} % ls diff --git a/test/docbook-reader.native b/test/docbook-reader.native index c8d59ca82..be3819336 100644 --- a/test/docbook-reader.native +++ b/test/docbook-reader.native @@ -266,6 +266,9 @@ Pandoc ] , CodeBlock ( "" , [] , [] ) "sub status {\n print \"working\";\n}" + , CodeBlock + ( "" , [ "numberLines" ] , [] ) + "sub status {\n print \"working with line numbers\";\n}" , CodeBlock ( "" , [] , [] ) "% ls" , Para [ Str "A" , Space , Str "list:" ] , OrderedList -- cgit v1.2.3 From a41c1fe0bbdf912f3585c7eb91b59340c35b9b77 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 14 Oct 2021 16:16:25 +0200 Subject: asciidoc writer: translate numberLines attribute to linesnum switch AsciiDoctor allows to request line numbering on code blocks by using a switch on the `source` block, such as in: ``` [source%linesnum,haskell] ---- some Haskell code here ---- ``` --- src/Text/Pandoc/Writers/AsciiDoc.hs | 7 +++++-- test/Tests/Writers/AsciiDoc.hs | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index bcef4a089..4d3906c5f 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -21,7 +21,7 @@ AsciiDoc: module Text.Pandoc.Writers.AsciiDoc (writeAsciiDoc, writeAsciiDoctor) where import Control.Monad.State.Strict import Data.Char (isPunctuation, isSpace) -import Data.List (intercalate, intersperse) +import Data.List (delete, intercalate, intersperse) import Data.List.NonEmpty (NonEmpty(..)) import Data.Maybe (fromMaybe, isJust) import qualified Data.Set as Set @@ -193,7 +193,10 @@ blockToAsciiDoc _ (CodeBlock (_,classes,_) str) = return $ flush ( then "...." $$ literal str $$ "...." else attrs $$ "----" $$ literal str $$ "----") <> blankline - where attrs = "[" <> literal (T.intercalate "," ("source" : classes)) <> "]" + where attrs = "[" <> literal (T.intercalate "," classes') <> "]" + classes' = if "numberLines" `elem` classes + then "source%linesnum" : delete "numberLines" classes + else "source" : classes blockToAsciiDoc opts (BlockQuote blocks) = do contents <- blockListToAsciiDoc opts blocks let isBlock (BlockQuote _) = True diff --git a/test/Tests/Writers/AsciiDoc.hs b/test/Tests/Writers/AsciiDoc.hs index 04655635f..7b2dd11e8 100644 --- a/test/Tests/Writers/AsciiDoc.hs +++ b/test/Tests/Writers/AsciiDoc.hs @@ -38,6 +38,22 @@ tests = [ testGroup "emphasis" para (singleQuoted (strong (text "foo"))) =?> "`**foo**'" ] + , testGroup "blocks" + [ testAsciidoc "code block without line numbers" $ + codeBlockWith ("", [ "haskell" ], []) "foo" =?> unlines + [ "[source,haskell]" + , "----" + , "foo" + , "----" + ] + , testAsciidoc "code block with line numbers" $ + codeBlockWith ("", [ "haskell", "numberLines" ], []) "foo" =?> unlines + [ "[source%linesnum,haskell]" + , "----" + , "foo" + , "----" + ] + ] , testGroup "tables" [ testAsciidoc "empty cells" $ simpleTable [] [[mempty],[mempty]] =?> unlines -- cgit v1.2.3 From fb804a375d6716f00d1987a2da2b0e4361fd7223 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 16 Oct 2021 22:33:56 -0700 Subject: CI: add workflow to test pdf production... with xelatex, pdflatex, lualatex. --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c75fcd213..17b77834e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,6 +125,62 @@ jobs: ! grep -q ": *[Ww]arning:" build.log || exit 1 cabal ${{ matrix.versions.prefix }}test ${{ matrix.versions.cabalopts }} --disable-optimization ${{ matrix.versions.testopts }} + linux-pdf: + + runs-on: ubuntu-18.04 + strategy: + fail-fast: true + matrix: + - pdfengine: xelatex + - pdfengine: lualatex + - pdfengine: pdflatex + + steps: + - uses: actions/checkout@v2 + + - name: Install recent cabal/ghc + uses: haskell/actions/setup@v1 + with: + ghc-version: 8.10.4 + cabal-version: 3.2 + + # needed by memory + - name: Install numa + run: sudo apt-get install libnuma-dev + + # needed by memory + - name: Install texlive + run: sudo apt-get install texlive-latex-recommended + + # declare/restore cached things + # caching doesn't work for scheduled runs yet + # https://github.com/actions/cache/issues/63 + + - name: Cache cabal global package db + id: cabal-global + uses: actions/cache@v2 + with: + path: | + ~/.cabal + key: ${{ runner.os }}-8.10.4-3.2-cabal-global-${{ hashFiles('cabal.project') }} + + - name: Cache cabal work + id: cabal-local + uses: actions/cache@v2 + with: + path: | + dist-newstyle + key: ${{ runner.os }}-8.10.4-3.2-cabal-local + + - name: Install dependencies + run: | + cabal v2-update + cabal v2-build --dependencies-only --enable-tests --disable-optimization + + - name: Test pdf creation with pdf-engine + run: | + cabal v2-run --disable-optimization pandoc -- --pdf-engine=${{ matrix.pdfengine }} -o out.pdf + windows: runs-on: windows-2019 -- cgit v1.2.3 From b65951fa7385a9b612a0a0765375e05e415f68a8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 16 Oct 2021 22:37:27 -0700 Subject: CI: fix yaml workflow. --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17b77834e..25ec82a0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,9 +131,10 @@ jobs: strategy: fail-fast: true matrix: - - pdfengine: xelatex - - pdfengine: lualatex - - pdfengine: pdflatex + pdfengine: + - xelatex + - lualatex + - pdflatex steps: - uses: actions/checkout@v2 -- cgit v1.2.3 From 9d5dd8219e987bb4ca0249270ecac817bdf1362b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 16 Oct 2021 22:43:53 -0700 Subject: CI: pdf test: need an input file! --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25ec82a0d..697025a2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,7 +180,7 @@ jobs: - name: Test pdf creation with pdf-engine run: | - cabal v2-run --disable-optimization pandoc -- --pdf-engine=${{ matrix.pdfengine }} -o out.pdf + cabal v2-run --disable-optimization pandoc -- --pdf-engine=${{ matrix.pdfengine }} -o out.pdf doc/getting-started.md windows: -- cgit v1.2.3 From 3ddfb4cd6c41aede9f26db4cbfa2e73fa70aa473 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 16 Oct 2021 22:57:10 -0700 Subject: CI: more tweaks to pdf tests. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 697025a2f..16821547d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,7 @@ jobs: runs-on: ubuntu-18.04 strategy: - fail-fast: true + fail-fast: false matrix: pdfengine: - xelatex @@ -149,9 +149,9 @@ jobs: - name: Install numa run: sudo apt-get install libnuma-dev - # needed by memory + # needed to test pdf creation - name: Install texlive - run: sudo apt-get install texlive-latex-recommended + run: sudo apt-get install texlive-base texlive-latex-recommended texlive-xetex # declare/restore cached things # caching doesn't work for scheduled runs yet -- cgit v1.2.3 From fcbfc8cd390da64817190e2feb3412aeaf54e911 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 16 Oct 2021 23:14:12 -0700 Subject: CI: remove linux-pdf for now. I don't know what is going on with lmodern and lualatex. --- .github/workflows/ci.yml | 57 ------------------------------------------------ 1 file changed, 57 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16821547d..c75fcd213 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,63 +125,6 @@ jobs: ! grep -q ": *[Ww]arning:" build.log || exit 1 cabal ${{ matrix.versions.prefix }}test ${{ matrix.versions.cabalopts }} --disable-optimization ${{ matrix.versions.testopts }} - linux-pdf: - - runs-on: ubuntu-18.04 - strategy: - fail-fast: false - matrix: - pdfengine: - - xelatex - - lualatex - - pdflatex - - steps: - - uses: actions/checkout@v2 - - - name: Install recent cabal/ghc - uses: haskell/actions/setup@v1 - with: - ghc-version: 8.10.4 - cabal-version: 3.2 - - # needed by memory - - name: Install numa - run: sudo apt-get install libnuma-dev - - # needed to test pdf creation - - name: Install texlive - run: sudo apt-get install texlive-base texlive-latex-recommended texlive-xetex - - # declare/restore cached things - # caching doesn't work for scheduled runs yet - # https://github.com/actions/cache/issues/63 - - - name: Cache cabal global package db - id: cabal-global - uses: actions/cache@v2 - with: - path: | - ~/.cabal - key: ${{ runner.os }}-8.10.4-3.2-cabal-global-${{ hashFiles('cabal.project') }} - - - name: Cache cabal work - id: cabal-local - uses: actions/cache@v2 - with: - path: | - dist-newstyle - key: ${{ runner.os }}-8.10.4-3.2-cabal-local - - - name: Install dependencies - run: | - cabal v2-update - cabal v2-build --dependencies-only --enable-tests --disable-optimization - - - name: Test pdf creation with pdf-engine - run: | - cabal v2-run --disable-optimization pandoc -- --pdf-engine=${{ matrix.pdfengine }} -o out.pdf doc/getting-started.md - windows: runs-on: windows-2019 -- cgit v1.2.3 From 3f489bcb5897898d453bef549d6eba5f5d2120bf Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 16 Oct 2021 23:34:53 -0700 Subject: Ensure that babel is loaded also with pdflatex. This fixes a regression in #7604, which modernized babel usage but omitted to load babel for pdflatex, with the result that even simple documents could no longer be produced. Closes #7627. --- data/templates/default.latex | 5 ++--- test/writers-lang-and-dir.latex | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/data/templates/default.latex b/data/templates/default.latex index 10377f2cd..3874813c7 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -363,11 +363,10 @@ $if(csl-refs)$ \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} $endif$ $if(lang)$ -\ifXeTeX -\usepackage[bidi=default]{babel} -\fi \ifLuaTeX \usepackage[bidi=basic]{babel} +\else +\usepackage[bidi=default]{babel} \fi \babelprovide[main,import]{$babel-lang$} $for(babel-otherlangs)$ diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index c8a1c0338..1f7ce262b 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -44,11 +44,10 @@ \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \setcounter{secnumdepth}{-\maxdimen} % remove section numbering -\ifXeTeX -\usepackage[bidi=default]{babel} -\fi \ifLuaTeX \usepackage[bidi=basic]{babel} +\else +\usepackage[bidi=default]{babel} \fi \babelprovide[main,import]{english} \babelprovide[import]{ngerman} -- cgit v1.2.3 From 8af15ab345bb0790cc3442722673d9da9f23a79c Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Fri, 17 Sep 2021 16:05:06 +0100 Subject: pptx: Fix list level numbering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In PowerPoint, the content of a top-level list is at the same level as the content of a top-level paragraph – the only difference is that a list style has been applied. At the moment, the pptx writer increments the paragraph level on each list, turning what should be top-level lists into second-level lists. This commit changes that logic, only incrementing the paragraph level on continuation paragraphs of lists. - Fixes https://github.com/jgm/pandoc/issues/4828 - Fixes https://github.com/jgm/pandoc/issues/4663 --- pandoc.cabal | 2 ++ src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 31 +++++++++++---------- test/Tests/Writers/Powerpoint.hs | 4 +++ test/pptx/code-custom/output.pptx | Bin 29817 -> 29807 bytes test/pptx/code-custom/templated.pptx | Bin 42884 -> 42877 bytes test/pptx/code/output.pptx | Bin 29815 -> 29806 bytes test/pptx/code/templated.pptx | Bin 42882 -> 42876 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77169 -> 77136 bytes .../incremental-lists/with-flag/templated.pptx | Bin 90280 -> 90251 bytes .../incremental-lists/without-flag/output.pptx | Bin 75411 -> 75386 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88518 -> 88495 bytes test/pptx/list-level/input.native | 20 +++++++++++++ test/pptx/list-level/output.pptx | Bin 0 -> 28635 bytes test/pptx/list-level/templated.pptx | Bin 0 -> 41701 bytes test/pptx/lists/output.pptx | Bin 28664 -> 28657 bytes test/pptx/lists/templated.pptx | Bin 41729 -> 41724 bytes test/pptx/pauses/without-incremental/output.pptx | Bin 0 -> 50083 bytes .../pptx/pauses/without-incremental/templated.pptx | Bin 0 -> 63157 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31129 -> 31123 bytes test/pptx/slide-breaks-toc/templated.pptx | Bin 44195 -> 44191 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51494 -> 51486 bytes test/pptx/speaker-notes-afterseps/templated.pptx | Bin 64558 -> 64552 bytes test/pptx/start-numbering-at/output.pptx | Bin 28626 -> 28620 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41691 -> 41686 bytes 24 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 test/pptx/list-level/input.native create mode 100644 test/pptx/list-level/output.pptx create mode 100644 test/pptx/list-level/templated.pptx create mode 100644 test/pptx/pauses/without-incremental/output.pptx create mode 100644 test/pptx/pauses/without-incremental/templated.pptx diff --git a/pandoc.cabal b/pandoc.cabal index 615feaccb..ac6cb8121 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -429,6 +429,8 @@ extra-source-files: test/pptx/inline-formatting/*.pptx test/pptx/lists/input.native test/pptx/lists/*.pptx + test/pptx/list-level/input.native + test/pptx/list-level/*.pptx test/pptx/raw-ooxml/input.native test/pptx/raw-ooxml/*.pptx test/pptx/remove-empty-slides/input.native diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index fe34d24dc..2f94dcc17 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -500,27 +500,23 @@ blockToParagraphs (Header _ (ident, _, _) ils) = do blockToParagraphs (BulletList blksLst) = do pProps <- asks envParaProps incremental <- listShouldBeIncremental - let lvl = pPropLevel pProps local (\env -> env{ envInList = True - , envParaProps = pProps{ pPropLevel = lvl + 1 - , pPropBullet = Just Bullet + , envParaProps = pProps{ pPropBullet = Just Bullet , pPropMarginLeft = Nothing , pPropIndent = Nothing , pPropIncremental = incremental }}) $ - concatMapM multiParBullet blksLst + concatMapM multiParList blksLst blockToParagraphs (OrderedList listAttr blksLst) = do pProps <- asks envParaProps incremental <- listShouldBeIncremental - let lvl = pPropLevel pProps local (\env -> env{ envInList = True - , envParaProps = pProps{ pPropLevel = lvl + 1 - , pPropBullet = Just (AutoNumbering listAttr) + , envParaProps = pProps{ pPropBullet = Just (AutoNumbering listAttr) , pPropMarginLeft = Nothing , pPropIndent = Nothing , pPropIncremental = incremental }}) $ - concatMapM multiParBullet blksLst + concatMapM multiParList blksLst blockToParagraphs (DefinitionList entries) = do incremental <- listShouldBeIncremental let go :: ([Inline], [[Block]]) -> Pres [Paragraph] @@ -545,14 +541,21 @@ blockToParagraphs blk = do addLogMessage $ BlockNotRendered blk return [] --- Make sure the bullet env gets turned off after the first para. -multiParBullet :: [Block] -> Pres [Paragraph] -multiParBullet [] = return [] -multiParBullet (b:bs) = do +-- | Make sure the bullet env gets turned off after the first paragraph, and +-- indent any continuation paragraphs. +multiParList :: [Block] -> Pres [Paragraph] +multiParList [] = return [] +multiParList (b:bs) = do pProps <- asks envParaProps p <- blockToParagraphs b - ps <- local (\env -> env{envParaProps = pProps{pPropBullet = Nothing}}) $ - concatMapM blockToParagraphs bs + let level = pPropLevel pProps + ps <- local (\env -> env + { envParaProps = pProps + { pPropBullet = Nothing + , pPropLevel = level + 1 + } + }) + $ concatMapM blockToParagraphs bs return $ p ++ ps cellToParagraphs :: Alignment -> SimpleCell -> Pres [Paragraph] diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index 84bdd7476..f3663efbb 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -66,6 +66,10 @@ tests = let def "pptx/start-numbering-at/input.native" "pptx/start-numbering-at/output.pptx" + , pptxTests "List continuation paragraph indentation" + def + "pptx/list-level/input.native" + "pptx/list-level/output.pptx" , pptxTests "tables" def "pptx/tables/input.native" diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index ded8f1125..6c7a1a9ab 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code-custom/templated.pptx b/test/pptx/code-custom/templated.pptx index 8bb0df1ff..116865c1f 100644 Binary files a/test/pptx/code-custom/templated.pptx and b/test/pptx/code-custom/templated.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index e700bc268..8fd00ff74 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/code/templated.pptx b/test/pptx/code/templated.pptx index 44f34cd64..0d7db048f 100644 Binary files a/test/pptx/code/templated.pptx and b/test/pptx/code/templated.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index 1ca1dbf17..82f5f926f 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index 4ddf6bb75..e8482b25f 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 6f7261ba3..62e66e1fe 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index ca5c9fdab..ac7be9564 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/list-level/input.native b/test/pptx/list-level/input.native new file mode 100644 index 000000000..e0b36b8e5 --- /dev/null +++ b/test/pptx/list-level/input.native @@ -0,0 +1,20 @@ +[Header 1 ("slide",[],[]) [Str "Slide"] +,BulletList + [[Para [Str "Top-level"] + ,Para [Str "With",Space,Str "continuation",Space,Str "paragraph"]] + ,[Para [Str "Then:"] + ,BulletList + [[Plain [Str "nested"]] + ,[Plain [Str "list"]] + ,[Plain [Str "items"]]]]] +,Header 1 ("slide-1",[],[]) [Str "Slide"] +,Para [Str "Paragraph."] +,OrderedList (1,Decimal,Period) + [[Para [Str "Top-level"] + ,Para [Str "Continuation"] + ,OrderedList (1,Decimal,Period) + [[Para [Str "Sub-list"] + ,Para [Str "With",Space,Str "Continuation"]] + ,[Para [Str "(still",Space,Str "sub-list)"]]]] + ,[Para [Str "(back",Space,Str "to",Space,Str "top-level)"]]] +,Para [Str "Paragraph."]] diff --git a/test/pptx/list-level/output.pptx b/test/pptx/list-level/output.pptx new file mode 100644 index 000000000..5e3506958 Binary files /dev/null and b/test/pptx/list-level/output.pptx differ diff --git a/test/pptx/list-level/templated.pptx b/test/pptx/list-level/templated.pptx new file mode 100644 index 000000000..8853a3082 Binary files /dev/null and b/test/pptx/list-level/templated.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index 94a424f42..e23f47218 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 52097489f..290b5b519 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/pauses/without-incremental/output.pptx b/test/pptx/pauses/without-incremental/output.pptx new file mode 100644 index 000000000..9085db330 Binary files /dev/null and b/test/pptx/pauses/without-incremental/output.pptx differ diff --git a/test/pptx/pauses/without-incremental/templated.pptx b/test/pptx/pauses/without-incremental/templated.pptx new file mode 100644 index 000000000..6662e2451 Binary files /dev/null and b/test/pptx/pauses/without-incremental/templated.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index 788cdf148..f2660ef93 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/templated.pptx b/test/pptx/slide-breaks-toc/templated.pptx index d11744079..0a2bdb857 100644 Binary files a/test/pptx/slide-breaks-toc/templated.pptx and b/test/pptx/slide-breaks-toc/templated.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index 99110d3ca..b54ba4465 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/templated.pptx b/test/pptx/speaker-notes-afterseps/templated.pptx index daf8e2175..3b272ab1b 100644 Binary files a/test/pptx/speaker-notes-afterseps/templated.pptx and b/test/pptx/speaker-notes-afterseps/templated.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index bc74ec599..ecfc6901a 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index 4f191a06e..f3f46ef30 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ -- cgit v1.2.3 From 8981872bcab239145518c7ca0567fb9031d1c422 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 23 Sep 2021 12:28:24 +0100 Subject: pptx: Remove outdated comment I removed the field this comment refers to recently, missed the comment. --- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 42ce780fa..487dcad2e 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -117,9 +117,6 @@ data WriterEnv = WriterEnv { envRefArchive :: Archive , envInList :: Bool , envInNoteSlide :: Bool , envCurSlideId :: Int - -- the difference between the number at - -- the end of the slide file name and - -- the rId number , envPlaceholder :: Placeholder , envSlideIdMap :: M.Map SlideId Int -- maps the slide number to the -- cgit v1.2.3 From 8de261ba4e1e03f9dd5f78297d7299e9d78bbcfd Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Thu, 23 Sep 2021 16:01:38 +0100 Subject: pptx: Line up continuation paragraphs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit changes the `marL` and `indent` values used for plain paragraphs and numbered lists, and changes the spacing defined in the reference doc master for bulleted lists. For paragraphs, there is now a left-indent taken from the `otherStyle` in the master. For numbered lists, the number is positioned where the text would be if this were a plain paragraph, and the text is indented to the next level. This means that continuation paragraphs line up nicely with numbered lists. It also /mostly/ matches the observed PowerPoint behaviour when inserting paragraphs and numbered lists: the only difference is that PowerPoint was using a different margin value for the first level numbered lists – I’ve changed this to match the other levels, as I don’t think it makes the spacing unappealing and it allows continuation paragraphs at any level to line up. With bulleted lists, I’m keeping the observed PowerPoint behaviour of specifying only a level, letting `marL` and `indent` be automatically taken from `bodyStyle`. To that end, this commit changes the `bodyStyle` spacing in the master of the default reference doc, to: - line up the text of the first paragraph in each bullet with any continuation paragraphs - line up nested bullet markers in any continuation paragraphs with the first paragraph, matching lists and plain paragraphs This does mean the continuation paragraphs still won’t line up for anyone using their own reference doc where they haven’t matched the `otherStyle` and `bodyStyle` indent levels, but I think people in that situation will be able to troubleshoot. --- data/pptx/ppt/slideMasters/slideMaster1.xml | 2 +- src/Text/Pandoc/Writers/Powerpoint/Output.hs | 100 +++++++++++++++++++-- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 3 +- test/pptx/background-image/output.pptx | Bin 53358 -> 53318 bytes test/pptx/blanks/just-speaker-notes/output.pptx | Bin 32267 -> 32227 bytes test/pptx/blanks/nbsp-in-body/output.pptx | Bin 29205 -> 29165 bytes test/pptx/blanks/nbsp-in-heading/output.pptx | Bin 29205 -> 29165 bytes test/pptx/code-custom/output.pptx | Bin 29807 -> 29776 bytes test/pptx/code/output.pptx | Bin 29806 -> 29773 bytes test/pptx/comparison/both-columns/output.pptx | Bin 44570 -> 44530 bytes test/pptx/comparison/extra-image/output.pptx | Bin 44599 -> 44559 bytes test/pptx/comparison/extra-text/output.pptx | Bin 44570 -> 44530 bytes test/pptx/comparison/non-text-first/output.pptx | Bin 44484 -> 44444 bytes test/pptx/comparison/one-column/output.pptx | Bin 27902 -> 27862 bytes .../heading-text-image/output.pptx | Bin 44318 -> 44278 bytes .../content-with-caption/image-text/output.pptx | Bin 45019 -> 44979 bytes .../content-with-caption/text-image/output.pptx | Bin 44258 -> 44218 bytes .../document-properties-short-desc/output.pptx | Bin 28613 -> 28573 bytes test/pptx/document-properties/output.pptx | Bin 29015 -> 28976 bytes test/pptx/endnotes-toc/output.pptx | Bin 29399 -> 29363 bytes test/pptx/endnotes/output.pptx | Bin 28580 -> 28544 bytes test/pptx/images/output.pptx | Bin 46235 -> 46195 bytes test/pptx/incremental-lists/with-flag/output.pptx | Bin 77136 -> 77125 bytes .../incremental-lists/with-flag/templated.pptx | Bin 90251 -> 90277 bytes .../incremental-lists/without-flag/output.pptx | Bin 75386 -> 75374 bytes .../incremental-lists/without-flag/templated.pptx | Bin 88495 -> 88522 bytes test/pptx/inline-formatting/output.pptx | Bin 27772 -> 27736 bytes test/pptx/list-level/output.pptx | Bin 28635 -> 28632 bytes test/pptx/list-level/templated.pptx | Bin 41701 -> 41735 bytes test/pptx/lists/output.pptx | Bin 28657 -> 28639 bytes test/pptx/lists/templated.pptx | Bin 41724 -> 41742 bytes test/pptx/raw-ooxml/output.pptx | Bin 28560 -> 28524 bytes test/pptx/remove-empty-slides/output.pptx | Bin 44994 -> 44958 bytes test/pptx/slide-breaks-slide-level-1/output.pptx | Bin 29354 -> 29314 bytes test/pptx/slide-breaks-toc/output.pptx | Bin 31123 -> 31087 bytes test/pptx/slide-breaks/output.pptx | Bin 30179 -> 30139 bytes .../slide-level-0/h1-h2-with-table/output.pptx | Bin 27907 -> 27871 bytes test/pptx/slide-level-0/h1-with-image/output.pptx | Bin 44242 -> 44202 bytes test/pptx/slide-level-0/h1-with-table/output.pptx | Bin 27814 -> 27778 bytes test/pptx/slide-level-0/h2-with-image/output.pptx | Bin 44242 -> 44202 bytes test/pptx/speaker-notes-after-metadata/output.pptx | Bin 31617 -> 31577 bytes test/pptx/speaker-notes-afterheader/output.pptx | Bin 30629 -> 30589 bytes test/pptx/speaker-notes-afterseps/output.pptx | Bin 51486 -> 51450 bytes test/pptx/speaker-notes/output.pptx | Bin 35329 -> 35289 bytes test/pptx/start-numbering-at/output.pptx | Bin 28620 -> 28605 bytes test/pptx/start-numbering-at/templated.pptx | Bin 41686 -> 41707 bytes test/pptx/tables/output.pptx | Bin 29160 -> 29122 bytes test/pptx/two-column/all-text/output.pptx | Bin 27689 -> 27649 bytes test/pptx/two-column/text-and-image/output.pptx | Bin 45510 -> 45470 bytes 49 files changed, 94 insertions(+), 11 deletions(-) diff --git a/data/pptx/ppt/slideMasters/slideMaster1.xml b/data/pptx/ppt/slideMasters/slideMaster1.xml index 69f0af019..2e0425358 100644 --- a/data/pptx/ppt/slideMasters/slideMaster1.xml +++ b/data/pptx/ppt/slideMasters/slideMaster1.xml @@ -1,2 +1,2 @@ -Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level4/5/2019‹#› \ No newline at end of file +Click to edit Master title styleClick to edit Master text stylesSecond levelThird levelFourth levelFifth level4/5/2019‹#› diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs index 487dcad2e..e799297de 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs @@ -126,6 +126,7 @@ data WriterEnv = WriterEnv { envRefArchive :: Archive , envSpeakerNotesIdMap :: M.Map Int Int , envInSpeakerNotes :: Bool , envSlideLayouts :: Maybe SlideLayouts + , envOtherStyleIndents :: Maybe Indents } deriving (Show) @@ -145,6 +146,7 @@ instance Default WriterEnv where , envSpeakerNotesIdMap = mempty , envInSpeakerNotes = False , envSlideLayouts = Nothing + , envOtherStyleIndents = Nothing } type SlideLayouts = SlideLayoutsOf SlideLayout @@ -183,6 +185,39 @@ data Placeholder = Placeholder , index :: Int } deriving (Show, Eq) +-- | Paragraph indentation info. +data Indents = Indents + { level1 :: Maybe LevelIndents + , level2 :: Maybe LevelIndents + , level3 :: Maybe LevelIndents + , level4 :: Maybe LevelIndents + , level5 :: Maybe LevelIndents + , level6 :: Maybe LevelIndents + , level7 :: Maybe LevelIndents + , level8 :: Maybe LevelIndents + , level9 :: Maybe LevelIndents + } deriving (Show, Eq) + +levelIndent :: Indents -> Int -> Maybe LevelIndents +levelIndent is index = getter is + where + getter = case index of + 0 -> level1 + 1 -> level2 + 2 -> level3 + 3 -> level4 + 4 -> level5 + 5 -> level6 + 6 -> level7 + 7 -> level8 + 8 -> level9 + _ -> const Nothing + +data LevelIndents = LevelIndents + { marL :: EMU + , indent :: EMU + } deriving (Show, Eq) + data MediaInfo = MediaInfo { mInfoFilePath :: FilePath , mInfoLocalId :: Int , mInfoGlobalId :: Int @@ -580,6 +615,33 @@ presentationToArchive opts meta pres = do , slInReferenceDoc = True } + master <- getMaster' refArchive distArchive + + let otherStyleIndents = do + let ns = elemToNameSpaces master + txStyles <- findChild (elemName ns "p" "txStyles") master + otherStyle <- findChild (elemName ns "p" "otherStyle") txStyles + let makeLevelIndents name = do + e <- findChild (elemName ns "a" name) otherStyle + pure LevelIndents + { indent = fromMaybe (-342900) + (findAttr (QName "indent" Nothing Nothing) e + >>= readTextAsInteger) + , marL = fromMaybe 347663 + (findAttr (QName "marL" Nothing Nothing) e + >>= readTextAsInteger) + } + pure Indents + { level1 = makeLevelIndents "lvl1pPr" + , level2 = makeLevelIndents "lvl2pPr" + , level3 = makeLevelIndents "lvl3pPr" + , level4 = makeLevelIndents "lvl4pPr" + , level5 = makeLevelIndents "lvl5pPr" + , level6 = makeLevelIndents "lvl6pPr" + , level7 = makeLevelIndents "lvl7pPr" + , level8 = makeLevelIndents "lvl8pPr" + , level9 = makeLevelIndents "lvl9pPr" + } utctime <- P.getTimestamp @@ -605,6 +667,7 @@ presentationToArchive opts meta pres = do , envSlideIdMap = makeSlideIdMap pres , envSpeakerNotesIdMap = makeSpeakerNotesMap pres , envSlideLayouts = Just layouts + , envOtherStyleIndents = otherStyleIndents } let st = def { stMediaGlobalIds = initialGlobalIds refArchive distArchive @@ -910,6 +973,10 @@ getMaster :: PandocMonad m => P m Element getMaster = do refArchive <- asks envRefArchive distArchive <- asks envDistArchive + getMaster' refArchive distArchive + +getMaster' :: PandocMonad m => Archive -> Archive -> m Element +getMaster' refArchive distArchive = parseXml refArchive distArchive "ppt/slideMasters/slideMaster1.xml" getMasterRels :: PandocMonad m => P m Element @@ -1196,15 +1263,32 @@ surroundWithMathAlternate element = paragraphToElement :: PandocMonad m => Paragraph -> P m Element paragraphToElement par = do + indents <- asks envOtherStyleIndents let - attrs = [("lvl", tshow $ pPropLevel $ paraProps par)] <> - (case pPropMarginLeft (paraProps par) of - Just px -> [("marL", tshow $ pixelsToEmu px)] - Nothing -> [] - ) <> - (case pPropIndent (paraProps par) of - Just px -> [("indent", tshow $ pixelsToEmu px)] - Nothing -> [] + lvl = pPropLevel (paraProps par) + attrs = [("lvl", tshow lvl)] <> + (case (pPropIndent (paraProps par), pPropMarginLeft (paraProps par)) of + (Just px1, Just px2) -> [ ("indent", tshow $ pixelsToEmu px1) + , ("marL", tshow $ pixelsToEmu px2) + ] + (Just px1, Nothing) -> [("indent", tshow $ pixelsToEmu px1)] + (Nothing, Just px2) -> [("marL", tshow $ pixelsToEmu px2)] + (Nothing, Nothing) -> fromMaybe [] $ do + indents' <- indents + thisLevel <- levelIndent indents' lvl + nextLevel <- levelIndent indents' (lvl + 1) + let (m, i) = + case pPropBullet (paraProps par) of + Nothing -> + (Just (marL thisLevel), Just 0) + Just (AutoNumbering _) -> + ( Just (marL nextLevel) + , Just (marL thisLevel - marL nextLevel) + ) + Just Bullet -> (Nothing, Nothing) + pure ( toList ((,) "indent" . tshow <$> i) + <> toList ((,) "marL" . tshow <$> m) + ) ) <> (case pPropAlign (paraProps par) of Just AlgnLeft -> [("algn", "l")] diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 2f94dcc17..fd6b83120 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -541,8 +541,7 @@ blockToParagraphs blk = do addLogMessage $ BlockNotRendered blk return [] --- | Make sure the bullet env gets turned off after the first paragraph, and --- indent any continuation paragraphs. +-- | Make sure the bullet env gets turned off after the first para. multiParList :: [Block] -> Pres [Paragraph] multiParList [] = return [] multiParList (b:bs) = do diff --git a/test/pptx/background-image/output.pptx b/test/pptx/background-image/output.pptx index abe82ebc2..1e678e0a4 100644 Binary files a/test/pptx/background-image/output.pptx and b/test/pptx/background-image/output.pptx differ diff --git a/test/pptx/blanks/just-speaker-notes/output.pptx b/test/pptx/blanks/just-speaker-notes/output.pptx index 0c4ed20fa..9a36ccf1f 100644 Binary files a/test/pptx/blanks/just-speaker-notes/output.pptx and b/test/pptx/blanks/just-speaker-notes/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-body/output.pptx b/test/pptx/blanks/nbsp-in-body/output.pptx index 6265c842f..08c764feb 100644 Binary files a/test/pptx/blanks/nbsp-in-body/output.pptx and b/test/pptx/blanks/nbsp-in-body/output.pptx differ diff --git a/test/pptx/blanks/nbsp-in-heading/output.pptx b/test/pptx/blanks/nbsp-in-heading/output.pptx index 6265c842f..08c764feb 100644 Binary files a/test/pptx/blanks/nbsp-in-heading/output.pptx and b/test/pptx/blanks/nbsp-in-heading/output.pptx differ diff --git a/test/pptx/code-custom/output.pptx b/test/pptx/code-custom/output.pptx index 6c7a1a9ab..1e5085e9c 100644 Binary files a/test/pptx/code-custom/output.pptx and b/test/pptx/code-custom/output.pptx differ diff --git a/test/pptx/code/output.pptx b/test/pptx/code/output.pptx index 8fd00ff74..a3f31dfdc 100644 Binary files a/test/pptx/code/output.pptx and b/test/pptx/code/output.pptx differ diff --git a/test/pptx/comparison/both-columns/output.pptx b/test/pptx/comparison/both-columns/output.pptx index 47f807754..efb67f2e7 100644 Binary files a/test/pptx/comparison/both-columns/output.pptx and b/test/pptx/comparison/both-columns/output.pptx differ diff --git a/test/pptx/comparison/extra-image/output.pptx b/test/pptx/comparison/extra-image/output.pptx index f700e09a8..e26e5b49c 100644 Binary files a/test/pptx/comparison/extra-image/output.pptx and b/test/pptx/comparison/extra-image/output.pptx differ diff --git a/test/pptx/comparison/extra-text/output.pptx b/test/pptx/comparison/extra-text/output.pptx index 47f807754..efb67f2e7 100644 Binary files a/test/pptx/comparison/extra-text/output.pptx and b/test/pptx/comparison/extra-text/output.pptx differ diff --git a/test/pptx/comparison/non-text-first/output.pptx b/test/pptx/comparison/non-text-first/output.pptx index c8a2bd0e3..f36c53ddb 100644 Binary files a/test/pptx/comparison/non-text-first/output.pptx and b/test/pptx/comparison/non-text-first/output.pptx differ diff --git a/test/pptx/comparison/one-column/output.pptx b/test/pptx/comparison/one-column/output.pptx index e70dd2326..8d9031ac8 100644 Binary files a/test/pptx/comparison/one-column/output.pptx and b/test/pptx/comparison/one-column/output.pptx differ diff --git a/test/pptx/content-with-caption/heading-text-image/output.pptx b/test/pptx/content-with-caption/heading-text-image/output.pptx index 0677879aa..6802b7361 100644 Binary files a/test/pptx/content-with-caption/heading-text-image/output.pptx and b/test/pptx/content-with-caption/heading-text-image/output.pptx differ diff --git a/test/pptx/content-with-caption/image-text/output.pptx b/test/pptx/content-with-caption/image-text/output.pptx index f461b6ed3..0bd64e340 100644 Binary files a/test/pptx/content-with-caption/image-text/output.pptx and b/test/pptx/content-with-caption/image-text/output.pptx differ diff --git a/test/pptx/content-with-caption/text-image/output.pptx b/test/pptx/content-with-caption/text-image/output.pptx index be376c1ed..a0d8806c0 100644 Binary files a/test/pptx/content-with-caption/text-image/output.pptx and b/test/pptx/content-with-caption/text-image/output.pptx differ diff --git a/test/pptx/document-properties-short-desc/output.pptx b/test/pptx/document-properties-short-desc/output.pptx index 737ca7e8d..418d158ca 100644 Binary files a/test/pptx/document-properties-short-desc/output.pptx and b/test/pptx/document-properties-short-desc/output.pptx differ diff --git a/test/pptx/document-properties/output.pptx b/test/pptx/document-properties/output.pptx index ef05c01b5..55ca48b5d 100644 Binary files a/test/pptx/document-properties/output.pptx and b/test/pptx/document-properties/output.pptx differ diff --git a/test/pptx/endnotes-toc/output.pptx b/test/pptx/endnotes-toc/output.pptx index bb431f511..a6cc2db24 100644 Binary files a/test/pptx/endnotes-toc/output.pptx and b/test/pptx/endnotes-toc/output.pptx differ diff --git a/test/pptx/endnotes/output.pptx b/test/pptx/endnotes/output.pptx index e4e661804..ea29cbcf8 100644 Binary files a/test/pptx/endnotes/output.pptx and b/test/pptx/endnotes/output.pptx differ diff --git a/test/pptx/images/output.pptx b/test/pptx/images/output.pptx index 9b04881f3..098547e87 100644 Binary files a/test/pptx/images/output.pptx and b/test/pptx/images/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/output.pptx b/test/pptx/incremental-lists/with-flag/output.pptx index 82f5f926f..230d29253 100644 Binary files a/test/pptx/incremental-lists/with-flag/output.pptx and b/test/pptx/incremental-lists/with-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/with-flag/templated.pptx b/test/pptx/incremental-lists/with-flag/templated.pptx index e8482b25f..263d9c355 100644 Binary files a/test/pptx/incremental-lists/with-flag/templated.pptx and b/test/pptx/incremental-lists/with-flag/templated.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/output.pptx b/test/pptx/incremental-lists/without-flag/output.pptx index 62e66e1fe..450cd16ea 100644 Binary files a/test/pptx/incremental-lists/without-flag/output.pptx and b/test/pptx/incremental-lists/without-flag/output.pptx differ diff --git a/test/pptx/incremental-lists/without-flag/templated.pptx b/test/pptx/incremental-lists/without-flag/templated.pptx index ac7be9564..e7ab48aa0 100644 Binary files a/test/pptx/incremental-lists/without-flag/templated.pptx and b/test/pptx/incremental-lists/without-flag/templated.pptx differ diff --git a/test/pptx/inline-formatting/output.pptx b/test/pptx/inline-formatting/output.pptx index f1a4a0a36..7744b7d2e 100644 Binary files a/test/pptx/inline-formatting/output.pptx and b/test/pptx/inline-formatting/output.pptx differ diff --git a/test/pptx/list-level/output.pptx b/test/pptx/list-level/output.pptx index 5e3506958..02c609b40 100644 Binary files a/test/pptx/list-level/output.pptx and b/test/pptx/list-level/output.pptx differ diff --git a/test/pptx/list-level/templated.pptx b/test/pptx/list-level/templated.pptx index 8853a3082..a7b23ccf9 100644 Binary files a/test/pptx/list-level/templated.pptx and b/test/pptx/list-level/templated.pptx differ diff --git a/test/pptx/lists/output.pptx b/test/pptx/lists/output.pptx index e23f47218..857a3e28c 100644 Binary files a/test/pptx/lists/output.pptx and b/test/pptx/lists/output.pptx differ diff --git a/test/pptx/lists/templated.pptx b/test/pptx/lists/templated.pptx index 290b5b519..5510a7123 100644 Binary files a/test/pptx/lists/templated.pptx and b/test/pptx/lists/templated.pptx differ diff --git a/test/pptx/raw-ooxml/output.pptx b/test/pptx/raw-ooxml/output.pptx index 841495315..1813bbd28 100644 Binary files a/test/pptx/raw-ooxml/output.pptx and b/test/pptx/raw-ooxml/output.pptx differ diff --git a/test/pptx/remove-empty-slides/output.pptx b/test/pptx/remove-empty-slides/output.pptx index e2871a882..d0d5e824c 100644 Binary files a/test/pptx/remove-empty-slides/output.pptx and b/test/pptx/remove-empty-slides/output.pptx differ diff --git a/test/pptx/slide-breaks-slide-level-1/output.pptx b/test/pptx/slide-breaks-slide-level-1/output.pptx index cb65ab335..d443bc04e 100644 Binary files a/test/pptx/slide-breaks-slide-level-1/output.pptx and b/test/pptx/slide-breaks-slide-level-1/output.pptx differ diff --git a/test/pptx/slide-breaks-toc/output.pptx b/test/pptx/slide-breaks-toc/output.pptx index f2660ef93..e24b45e12 100644 Binary files a/test/pptx/slide-breaks-toc/output.pptx and b/test/pptx/slide-breaks-toc/output.pptx differ diff --git a/test/pptx/slide-breaks/output.pptx b/test/pptx/slide-breaks/output.pptx index 7c2c7db5e..a5208ecf8 100644 Binary files a/test/pptx/slide-breaks/output.pptx and b/test/pptx/slide-breaks/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx index 3f815d830..bd772d44e 100644 Binary files a/test/pptx/slide-level-0/h1-h2-with-table/output.pptx and b/test/pptx/slide-level-0/h1-h2-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-image/output.pptx b/test/pptx/slide-level-0/h1-with-image/output.pptx index 70fc6aee2..1102f549c 100644 Binary files a/test/pptx/slide-level-0/h1-with-image/output.pptx and b/test/pptx/slide-level-0/h1-with-image/output.pptx differ diff --git a/test/pptx/slide-level-0/h1-with-table/output.pptx b/test/pptx/slide-level-0/h1-with-table/output.pptx index d30fd88c3..c0bc6b162 100644 Binary files a/test/pptx/slide-level-0/h1-with-table/output.pptx and b/test/pptx/slide-level-0/h1-with-table/output.pptx differ diff --git a/test/pptx/slide-level-0/h2-with-image/output.pptx b/test/pptx/slide-level-0/h2-with-image/output.pptx index 70fc6aee2..1102f549c 100644 Binary files a/test/pptx/slide-level-0/h2-with-image/output.pptx and b/test/pptx/slide-level-0/h2-with-image/output.pptx differ diff --git a/test/pptx/speaker-notes-after-metadata/output.pptx b/test/pptx/speaker-notes-after-metadata/output.pptx index f68d6f0ef..4e5635e0c 100644 Binary files a/test/pptx/speaker-notes-after-metadata/output.pptx and b/test/pptx/speaker-notes-after-metadata/output.pptx differ diff --git a/test/pptx/speaker-notes-afterheader/output.pptx b/test/pptx/speaker-notes-afterheader/output.pptx index 9df78756b..f59b29f6a 100644 Binary files a/test/pptx/speaker-notes-afterheader/output.pptx and b/test/pptx/speaker-notes-afterheader/output.pptx differ diff --git a/test/pptx/speaker-notes-afterseps/output.pptx b/test/pptx/speaker-notes-afterseps/output.pptx index b54ba4465..aad79e3dc 100644 Binary files a/test/pptx/speaker-notes-afterseps/output.pptx and b/test/pptx/speaker-notes-afterseps/output.pptx differ diff --git a/test/pptx/speaker-notes/output.pptx b/test/pptx/speaker-notes/output.pptx index 6ae003d7a..7b44c50c2 100644 Binary files a/test/pptx/speaker-notes/output.pptx and b/test/pptx/speaker-notes/output.pptx differ diff --git a/test/pptx/start-numbering-at/output.pptx b/test/pptx/start-numbering-at/output.pptx index ecfc6901a..e08d300e5 100644 Binary files a/test/pptx/start-numbering-at/output.pptx and b/test/pptx/start-numbering-at/output.pptx differ diff --git a/test/pptx/start-numbering-at/templated.pptx b/test/pptx/start-numbering-at/templated.pptx index f3f46ef30..30a097eb8 100644 Binary files a/test/pptx/start-numbering-at/templated.pptx and b/test/pptx/start-numbering-at/templated.pptx differ diff --git a/test/pptx/tables/output.pptx b/test/pptx/tables/output.pptx index 4398e35be..407062ca3 100644 Binary files a/test/pptx/tables/output.pptx and b/test/pptx/tables/output.pptx differ diff --git a/test/pptx/two-column/all-text/output.pptx b/test/pptx/two-column/all-text/output.pptx index 45f651ceb..8a1dce949 100644 Binary files a/test/pptx/two-column/all-text/output.pptx and b/test/pptx/two-column/all-text/output.pptx differ diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx index aab0b3b59..e45bf3d58 100644 Binary files a/test/pptx/two-column/text-and-image/output.pptx and b/test/pptx/two-column/text-and-image/output.pptx differ -- cgit v1.2.3 From 193f6bfebaa43d0d6749d10a4e7ca78a0d31361d Mon Sep 17 00:00:00 2001 From: Milan Bracke Date: Mon, 14 Jun 2021 15:00:36 +0200 Subject: Docx reader: fix handling of nested fields Fields delimited by fldChar elements can contain other fields. Before, the nested fields would be ignored, except for the end, which would be considered the end of the parent field. To fix this issue, fields needed to be considered containing ParParts instead of Runs, since a Run can't represent complex enough structures. This also impacted Hyperlinks since they can originate from a field. --- src/Text/Pandoc/Readers/Docx.hs | 18 +-- src/Text/Pandoc/Readers/Docx/Parse.hs | 247 +++++++++++++++++++--------------- test/Tests/Readers/Docx.hs | 4 + test/docx/nested_instrText.docx | Bin 0 -> 14112 bytes test/docx/nested_instrText.native | 5 + 5 files changed, 159 insertions(+), 115 deletions(-) create mode 100644 test/docx/nested_instrText.docx create mode 100644 test/docx/nested_instrText.native diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index 66cd84291..462e3c679 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -246,8 +246,8 @@ runToText _ = "" parPartToText :: ParPart -> T.Text parPartToText (PlainRun run) = runToText run -parPartToText (InternalHyperLink _ runs) = T.concat $ map runToText runs -parPartToText (ExternalHyperLink _ runs) = T.concat $ map runToText runs +parPartToText (InternalHyperLink _ children) = T.concat $ map parPartToText children +parPartToText (ExternalHyperLink _ children) = T.concat $ map parPartToText children parPartToText _ = "" blacklistedCharStyles :: [CharStyleName] @@ -437,18 +437,18 @@ parPartToInlines' Chart = return $ spanWith ("", ["chart"], []) $ text "[CHART]" parPartToInlines' Diagram = return $ spanWith ("", ["diagram"], []) $ text "[DIAGRAM]" -parPartToInlines' (InternalHyperLink anchor runs) = do - ils <- smushInlines <$> mapM runToInlines runs +parPartToInlines' (InternalHyperLink anchor children) = do + ils <- smushInlines <$> mapM parPartToInlines' children return $ link ("#" <> anchor) "" ils -parPartToInlines' (ExternalHyperLink target runs) = do - ils <- smushInlines <$> mapM runToInlines runs +parPartToInlines' (ExternalHyperLink target children) = do + ils <- smushInlines <$> mapM parPartToInlines' children return $ link target "" ils parPartToInlines' (PlainOMath exps) = return $ math $ writeTeX exps -parPartToInlines' (Field info runs) = +parPartToInlines' (Field info children) = case info of - HyperlinkField url -> parPartToInlines' $ ExternalHyperLink url runs - UnknownField -> smushInlines <$> mapM runToInlines runs + HyperlinkField url -> parPartToInlines' $ ExternalHyperLink url children + _ -> smushInlines <$> mapM parPartToInlines' children parPartToInlines' NullParPart = return mempty isAnchorSpan :: Inline -> Bool diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index e4d3ea6f8..a97d4b3d1 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -93,14 +93,13 @@ data ReaderEnv = ReaderEnv { envNotes :: Notes deriving Show data ReaderState = ReaderState { stateWarnings :: [T.Text] - , stateFldCharState :: FldCharState + , stateFldCharState :: [FldCharState] } deriving Show data FldCharState = FldCharOpen | FldCharFieldInfo FieldInfo - | FldCharContent FieldInfo [Run] - | FldCharClosed + | FldCharContent FieldInfo [ParPart] deriving (Show) data DocxError = DocxError @@ -314,13 +313,13 @@ data ParPart = PlainRun Run | CommentStart CommentId Author (Maybe CommentDate) [BodyPart] | CommentEnd CommentId | BookMark BookMarkId Anchor - | InternalHyperLink Anchor [Run] - | ExternalHyperLink URL [Run] + | InternalHyperLink Anchor [ParPart] + | ExternalHyperLink URL [ParPart] | Drawing FilePath T.Text T.Text B.ByteString Extent -- title, alt | Chart -- placeholder for now | Diagram -- placeholder for now | PlainOMath [Exp] - | Field FieldInfo [Run] + | Field FieldInfo [ParPart] | NullParPart -- when we need to return nothing, but -- not because of an error. deriving Show @@ -373,7 +372,7 @@ archiveToDocxWithWarnings archive = do , envDocXmlPath = docXmlPath } rState = ReaderState { stateWarnings = [] - , stateFldCharState = FldCharClosed + , stateFldCharState = [] } (eitherDoc, st) = runD (archiveToDocument archive) rEnv rState case eitherDoc of @@ -701,28 +700,31 @@ elemToBodyPart ns element elemToBodyPart ns element | isElem ns "w" "p" element = do parstyle <- elemToParagraphStyle ns element <$> asks envParStyles - parparts <- mapD (elemToParPart ns) (elChildren element) + parparts' <- mapD (elemToParPart ns) (elChildren element) + fldCharState <- gets stateFldCharState + modify $ \st -> st {stateFldCharState = emptyFldCharContents fldCharState} -- Word uses list enumeration for numbered headings, so we only -- want to infer a list from the styles if it is NOT a heading. - case pHeading parstyle of - Nothing | Just (numId, lvl) <- pNumInfo parstyle -> do - levelInfo <- lookupLevel numId lvl <$> asks envNumbering - return $ ListItem parstyle numId lvl levelInfo parparts - _ -> let - hasCaptionStyle = elem "Caption" (pStyleId <$> pStyle parstyle) - - hasSimpleTableField = fromMaybe False $ do - fldSimple <- findChildByName ns "w" "fldSimple" element - instr <- findAttrByName ns "w" "instr" fldSimple - pure ("Table" `elem` T.words instr) - - hasComplexTableField = fromMaybe False $ do - instrText <- findElementByName ns "w" "instrText" element - pure ("Table" `elem` T.words (strContent instrText)) - - in if hasCaptionStyle && (hasSimpleTableField || hasComplexTableField) - then return $ TblCaption parstyle parparts - else return $ Paragraph parstyle parparts + let parparts = parparts' ++ (openFldCharsToParParts fldCharState) in + case pHeading parstyle of + Nothing | Just (numId, lvl) <- pNumInfo parstyle -> do + levelInfo <- lookupLevel numId lvl <$> asks envNumbering + return $ ListItem parstyle numId lvl levelInfo parparts + _ -> let + hasCaptionStyle = elem "Caption" (pStyleId <$> pStyle parstyle) + + hasSimpleTableField = fromMaybe False $ do + fldSimple <- findChildByName ns "w" "fldSimple" element + instr <- findAttrByName ns "w" "instr" fldSimple + pure ("Table" `elem` T.words instr) + + hasComplexTableField = fromMaybe False $ do + instrText <- findElementByName ns "w" "instrText" element + pure ("Table" `elem` T.words (strContent instrText)) + + in if hasCaptionStyle && (hasSimpleTableField || hasComplexTableField) + then return $ TblCaption parstyle parparts + else return $ Paragraph parstyle parparts elemToBodyPart ns element | isElem ns "w" "tbl" element = do @@ -754,6 +756,19 @@ lookupRelationship docLocation relid rels = where pairs = map (\(Relationship loc relid' target) -> ((loc, relid'), target)) rels +openFldCharsToParParts :: [FldCharState] -> [ParPart] +openFldCharsToParParts [] = [] +openFldCharsToParParts (FldCharContent info children : ancestors) = case openFldCharsToParParts ancestors of + Field parentInfo siblings : _ -> [Field parentInfo $ siblings ++ [Field info $ reverse children]] + _ -> [Field info $ reverse children] +openFldCharsToParParts (_ : ancestors) = openFldCharsToParParts ancestors + +emptyFldCharContents :: [FldCharState] -> [FldCharState] +emptyFldCharContents = map + (\x -> case x of + FldCharContent info _ -> FldCharContent info [] + _ -> x) + expandDrawingId :: T.Text -> D (FilePath, B.ByteString) expandDrawingId s = do location <- asks envLocation @@ -778,51 +793,6 @@ getTitleAndAlt ns element = in (title, alt) elemToParPart :: NameSpaces -> Element -> D ParPart -elemToParPart ns element - | isElem ns "w" "r" element - , Just drawingElem <- findChildByName ns "w" "drawing" element - , pic_ns <- "http://schemas.openxmlformats.org/drawingml/2006/picture" - , Just picElem <- findElement (QName "pic" (Just pic_ns) (Just "pic")) drawingElem - = let (title, alt) = getTitleAndAlt ns drawingElem - a_ns = "http://schemas.openxmlformats.org/drawingml/2006/main" - drawing = findElement (QName "blip" (Just a_ns) (Just "a")) picElem - >>= findAttrByName ns "r" "embed" - in - case drawing of - Just s -> expandDrawingId s >>= (\(fp, bs) -> return $ Drawing fp title alt bs $ elemToExtent drawingElem) - Nothing -> throwError WrongElem --- The two cases below are an attempt to deal with images in deprecated vml format. --- Todo: check out title and attr for deprecated format. -elemToParPart ns element - | isElem ns "w" "r" element - , Just _ <- findChildByName ns "w" "pict" element = - let drawing = findElement (elemName ns "v" "imagedata") element - >>= findAttrByName ns "r" "id" - in - case drawing of - Just s -> expandDrawingId s >>= (\(fp, bs) -> return $ Drawing fp "" "" bs Nothing) - Nothing -> throwError WrongElem -elemToParPart ns element - | isElem ns "w" "r" element - , Just objectElem <- findChildByName ns "w" "object" element - , Just shapeElem <- findChildByName ns "v" "shape" objectElem - , Just imagedataElem <- findChildByName ns "v" "imagedata" shapeElem - , Just drawingId <- findAttrByName ns "r" "id" imagedataElem - = expandDrawingId drawingId >>= (\(fp, bs) -> return $ Drawing fp "" "" bs Nothing) --- Diagram -elemToParPart ns element - | isElem ns "w" "r" element - , Just drawingElem <- findChildByName ns "w" "drawing" element - , d_ns <- "http://schemas.openxmlformats.org/drawingml/2006/diagram" - , Just _ <- findElement (QName "relIds" (Just d_ns) (Just "dgm")) drawingElem - = return Diagram --- Chart -elemToParPart ns element - | isElem ns "w" "r" element - , Just drawingElem <- findChildByName ns "w" "drawing" element - , c_ns <- "http://schemas.openxmlformats.org/drawingml/2006/chart" - , Just _ <- findElement (QName "chart" (Just c_ns) (Just "c")) drawingElem - = return Chart {- The next one is a bit complicated. fldChar fields work by first having a in a run, then a run with @@ -854,8 +824,13 @@ example (omissions and my comments in brackets): So we do this in a number of steps. If we encounter the fldchar begin 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 appropriate FieldInfo and Runs. +the children when we get to separate. Then when we get to end, we produce +the Field type with appropriate FieldInfo and ParParts. + +Since there can be nested fields, the fldchar state needs to be a stack, +so we can have multiple fldchars open at the same time. When a fldchar is +closed, we either add the resulting field to its parent or we return it if +there is no parent. -} elemToParPart ns element | isElem ns "w" "r" element @@ -863,78 +838,138 @@ elemToParPart ns element , Just fldCharType <- findAttrByName ns "w" "fldCharType" fldChar = do fldCharState <- gets stateFldCharState case fldCharState of - FldCharClosed | fldCharType == "begin" -> do - modify $ \st -> st {stateFldCharState = FldCharOpen} + _ | fldCharType == "begin" -> do + modify $ \st -> st {stateFldCharState = FldCharOpen : fldCharState} return NullParPart - FldCharFieldInfo info | fldCharType == "separate" -> do - modify $ \st -> st {stateFldCharState = FldCharContent info []} + FldCharFieldInfo info : ancestors | fldCharType == "separate" -> do + modify $ \st -> st {stateFldCharState = FldCharContent info [] : ancestors} return NullParPart - FldCharContent info runs | fldCharType == "end" -> do - modify $ \st -> st {stateFldCharState = FldCharClosed} - return $ Field info $ reverse runs + [FldCharContent info children] | fldCharType == "end" -> do + modify $ \st -> st {stateFldCharState = []} + return $ Field info $ reverse children + FldCharContent info children : FldCharContent parentInfo siblings : ancestors | fldCharType == "end" -> + let parent = FldCharContent parentInfo $ (Field info (reverse children)) : siblings in do + modify $ \st -> st {stateFldCharState = parent : ancestors} + return NullParPart _ -> throwError WrongElem elemToParPart ns element | isElem ns "w" "r" element , Just instrText <- findChildByName ns "w" "instrText" element = do fldCharState <- gets stateFldCharState case fldCharState of - FldCharOpen -> do + FldCharOpen : ancestors -> do info <- eitherToD $ parseFieldInfo $ strContent instrText - modify $ \st -> st{stateFldCharState = FldCharFieldInfo info} + modify $ \st -> st {stateFldCharState = FldCharFieldInfo info : ancestors} return NullParPart _ -> return NullParPart -elemToParPart ns element +{- +There is an open fldchar, so we calculate the element and add it to the +children. For this we need to first change the fldchar state to an empty +stack to avoid descendants of children simply being added to the state instead +of to their direct parent element. This would happen in the case of a +w:hyperlink element for example. +-} +elemToParPart ns element = do + fldCharState <- gets stateFldCharState + case fldCharState of + FldCharContent info children : ancestors -> do + modify $ \st -> st {stateFldCharState = []} + parPart <- elemToParPart' ns element `catchError` \_ -> return NullParPart + modify $ \st -> st{stateFldCharState = FldCharContent info (parPart : children) : ancestors} + return NullParPart + _ -> elemToParPart' ns element + +elemToParPart' :: NameSpaces -> Element -> D ParPart +elemToParPart' ns element + | isElem ns "w" "r" element + , Just drawingElem <- findChildByName ns "w" "drawing" element + , pic_ns <- "http://schemas.openxmlformats.org/drawingml/2006/picture" + , Just picElem <- findElement (QName "pic" (Just pic_ns) (Just "pic")) drawingElem + = let (title, alt) = getTitleAndAlt ns drawingElem + a_ns = "http://schemas.openxmlformats.org/drawingml/2006/main" + drawing = findElement (QName "blip" (Just a_ns) (Just "a")) picElem + >>= findAttrByName ns "r" "embed" + in + case drawing of + Just s -> expandDrawingId s >>= (\(fp, bs) -> return $ Drawing fp title alt bs $ elemToExtent drawingElem) + Nothing -> throwError WrongElem +-- The two cases below are an attempt to deal with images in deprecated vml format. +-- Todo: check out title and attr for deprecated format. +elemToParPart' ns element + | isElem ns "w" "r" element + , Just _ <- findChildByName ns "w" "pict" element = + let drawing = findElement (elemName ns "v" "imagedata") element + >>= findAttrByName ns "r" "id" + in + case drawing of + Just s -> expandDrawingId s >>= (\(fp, bs) -> return $ Drawing fp "" "" bs Nothing) + Nothing -> throwError WrongElem +elemToParPart' ns element + | isElem ns "w" "r" element + , Just objectElem <- findChildByName ns "w" "object" element + , Just shapeElem <- findChildByName ns "v" "shape" objectElem + , Just imagedataElem <- findChildByName ns "v" "imagedata" shapeElem + , Just drawingId <- findAttrByName ns "r" "id" imagedataElem + = expandDrawingId drawingId >>= (\(fp, bs) -> return $ Drawing fp "" "" bs Nothing) +-- Diagram +elemToParPart' ns element + | isElem ns "w" "r" element + , Just drawingElem <- findChildByName ns "w" "drawing" element + , d_ns <- "http://schemas.openxmlformats.org/drawingml/2006/diagram" + , Just _ <- findElement (QName "relIds" (Just d_ns) (Just "dgm")) drawingElem + = return Diagram +-- Chart +elemToParPart' ns element + | isElem ns "w" "r" element + , Just drawingElem <- findChildByName ns "w" "drawing" element + , c_ns <- "http://schemas.openxmlformats.org/drawingml/2006/chart" + , Just _ <- findElement (QName "chart" (Just c_ns) (Just "c")) drawingElem + = return Chart +elemToParPart' ns element | isElem ns "w" "r" element = do run <- elemToRun ns element - -- we check to see if we have an open FldChar in state that we're - -- recording. - fldCharState <- gets stateFldCharState - case fldCharState of - FldCharContent info runs -> do - modify $ \st -> st{stateFldCharState = FldCharContent info (run : runs)} - return NullParPart - _ -> return $ PlainRun run -elemToParPart ns element + return $ PlainRun run +elemToParPart' ns element | Just change <- getTrackedChange ns element = do runs <- mapD (elemToRun ns) (elChildren element) return $ ChangedRuns change runs -elemToParPart ns element +elemToParPart' ns element | isElem ns "w" "bookmarkStart" element , Just bmId <- findAttrByName ns "w" "id" element , Just bmName <- findAttrByName ns "w" "name" element = return $ BookMark bmId bmName -elemToParPart ns element +elemToParPart' ns element | isElem ns "w" "hyperlink" element , Just relId <- findAttrByName ns "r" "id" element = do location <- asks envLocation - runs <- mapD (elemToRun ns) (elChildren element) + children <- mapD (elemToParPart ns) (elChildren element) rels <- asks envRelationships case lookupRelationship location relId rels of Just target -> case findAttrByName ns "w" "anchor" element of - Just anchor -> return $ ExternalHyperLink (target <> "#" <> anchor) runs - Nothing -> return $ ExternalHyperLink target runs - Nothing -> return $ ExternalHyperLink "" runs -elemToParPart ns element + Just anchor -> return $ ExternalHyperLink (target <> "#" <> anchor) children + Nothing -> return $ ExternalHyperLink target children + Nothing -> return $ ExternalHyperLink "" children +elemToParPart' ns element | isElem ns "w" "hyperlink" element , Just anchor <- findAttrByName ns "w" "anchor" element = do - runs <- mapD (elemToRun ns) (elChildren element) - return $ InternalHyperLink anchor runs -elemToParPart ns element + children <- mapD (elemToParPart ns) (elChildren element) + return $ InternalHyperLink anchor children +elemToParPart' ns element | isElem ns "w" "commentRangeStart" element , Just cmtId <- findAttrByName ns "w" "id" element = do (Comments _ commentMap) <- asks envComments case M.lookup cmtId commentMap of Just cmtElem -> elemToCommentStart ns cmtElem Nothing -> throwError WrongElem -elemToParPart ns element +elemToParPart' ns element | isElem ns "w" "commentRangeEnd" element , Just cmtId <- findAttrByName ns "w" "id" element = return $ CommentEnd cmtId -elemToParPart ns element +elemToParPart' ns element | isElem ns "m" "oMath" element = fmap PlainOMath (eitherToD $ readOMML $ showElement element) -elemToParPart _ _ = throwError WrongElem +elemToParPart' _ _ = throwError WrongElem elemToCommentStart :: NameSpaces -> Element -> D ParPart elemToCommentStart ns element diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs index 2f28af317..af6023836 100644 --- a/test/Tests/Readers/Docx.hs +++ b/test/Tests/Readers/Docx.hs @@ -147,6 +147,10 @@ tests = [ testGroup "document" "hyperlinks in tag" "docx/instrText_hyperlink.docx" "docx/instrText_hyperlink.native" + , testCompare + "nested fields with tag" + "docx/nested_instrText.docx" + "docx/nested_instrText.native" , testCompare "inline image" "docx/image.docx" diff --git a/test/docx/nested_instrText.docx b/test/docx/nested_instrText.docx new file mode 100644 index 000000000..532584193 Binary files /dev/null and b/test/docx/nested_instrText.docx differ diff --git a/test/docx/nested_instrText.native b/test/docx/nested_instrText.native new file mode 100644 index 000000000..730b041f5 --- /dev/null +++ b/test/docx/nested_instrText.native @@ -0,0 +1,5 @@ +[Para [Str "\24076\26395\28145\20837\20102\35299\30340\35835\32773\21487\20197\21435\30475David",Space,Str "French",Space,Str "Belding\21644Kevin",Space,Str "J.",Space,Str "Mitchell\30340" + ,Link ("",[],[]) [Str "Foundations",Space,Str "of",Space,Str "Analysis,",Space,Str "1/16/18",Space,Str "8:40:00",Space,Str "AM,",Space,Str "2nd",Space,Str "Edition"] ("https://books.google.com/books?id=sp_Zcb9ot90C&lpg=PR4&hl=zh-CN&pg=PA19#v=onepage&q&f=true","") + ,Str ",\21487\20174\&19\39029\30475\36215\65292\25110D.C.",Space,Str "Goldrei\30340",Space + ,Link ("",[],[]) [Str "Classic",Space,Str "Set",Space,Str "Theory:",Space,Str "For",Space,Str "Guided",Space,Str "Independent",Space,Str "Study"] ("https://books.google.ae/books?id=dlc0DwAAQBAJ&lpg=PT29&hl=zh-CN&pg=PT26#v=onepage&q&f=true","") + ,Str "\65292\20174\31532\20108\31456\30475\36215\65292\38405\35835\26102\35201\27880\24847\26412\25991\19982\36825\20123\20070\25152\19981\21516\30340\26159\24182\27809\26377\25226\23454\25968\30475\20316\26159\26377\29702\25968\38598\30340\20998\21106\12290"]] -- cgit v1.2.3 From 6acc82c5d2885c596c52e6c35bed8fe08f535066 Mon Sep 17 00:00:00 2001 From: Milan Bracke Date: Fri, 11 Jun 2021 09:26:09 +0200 Subject: Docx parser: implement PAGEREF fields These fields, often used in tables of contents, can be a hyperlink. --- src/Text/Pandoc/Readers/Docx.hs | 1 + src/Text/Pandoc/Readers/Docx/Fields.hs | 25 +++++++++++++++++++++++++ test/Tests/Readers/Docx.hs | 4 ++++ test/docx/0_level_headers.native | 6 +++--- test/docx/golden/nested_anchors_in_header.docx | Bin 10126 -> 10163 bytes test/docx/nested_anchors_in_header.native | 8 ++++---- test/docx/pageref.docx | Bin 0 -> 14431 bytes test/docx/pageref.native | 4 ++++ 8 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 test/docx/pageref.docx create mode 100644 test/docx/pageref.native diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index 462e3c679..5c8f20c18 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -448,6 +448,7 @@ parPartToInlines' (PlainOMath exps) = parPartToInlines' (Field info children) = case info of HyperlinkField url -> parPartToInlines' $ ExternalHyperLink url children + PagerefField fieldAnchor True -> parPartToInlines' $ InternalHyperLink fieldAnchor children _ -> smushInlines <$> mapM parPartToInlines' children parPartToInlines' NullParPart = return mempty diff --git a/src/Text/Pandoc/Readers/Docx/Fields.hs b/src/Text/Pandoc/Readers/Docx/Fields.hs index 442bc3466..5f090b6be 100644 --- a/src/Text/Pandoc/Readers/Docx/Fields.hs +++ b/src/Text/Pandoc/Readers/Docx/Fields.hs @@ -21,8 +21,11 @@ import Text.Parsec import Text.Parsec.Text (Parser) type URL = T.Text +type Anchor = T.Text data FieldInfo = HyperlinkField URL + -- The boolean indicates whether the field is a hyperlink. + | PagerefField Anchor Bool | UnknownField deriving (Show) @@ -33,6 +36,8 @@ fieldInfo :: Parser FieldInfo fieldInfo = try (HyperlinkField <$> hyperlink) <|> + try ((uncurry PagerefField) <$> pageref) + <|> return UnknownField escapedQuote :: Parser T.Text @@ -72,3 +77,23 @@ hyperlink = do ("\\l", s) : _ -> farg <> "#" <> s _ -> farg return url + +-- See §17.16.5.45 +pagerefSwitch :: Parser (T.Text, T.Text) +pagerefSwitch = do + sw <- string "\\h" + spaces + farg <- fieldArgument + return (T.pack sw, farg) + +pageref :: Parser (Anchor, Bool) +pageref = do + many space + string "PAGEREF" + spaces + farg <- fieldArgument + switches <- spaces *> many pagerefSwitch + let isLink = case switches of + ("\\h", _) : _ -> True + _ -> False + return (farg, isLink) diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs index af6023836..ea4094c82 100644 --- a/test/Tests/Readers/Docx.hs +++ b/test/Tests/Readers/Docx.hs @@ -151,6 +151,10 @@ tests = [ testGroup "document" "nested fields with tag" "docx/nested_instrText.docx" "docx/nested_instrText.native" + , testCompare + "pageref hyperlinks in tag" + "docx/pageref.docx" + "docx/pageref.native" , testCompare "inline image" "docx/image.docx" diff --git a/test/docx/0_level_headers.native b/test/docx/0_level_headers.native index ed589b029..7080063f9 100644 --- a/test/docx/0_level_headers.native +++ b/test/docx/0_level_headers.native @@ -39,9 +39,9 @@ []) ,Para [Str "CONTENTS"] ,Para [Strong [Str "Section",Space,Str "Page"]] -,Para [Str "FIGURES",Space,Str "iv"] -,Para [Str "TABLES",Space,Str "v"] -,Para [Str "SECTION",Space,Str "1",Space,Str "Introduction",Space,Str "2"] +,Para [Str "FIGURES",Space,Link ("",[],[]) [Str "iv"] ("#figures","")] +,Para [Str "TABLES",Space,Link ("",[],[]) [Str "v"] ("#tables","")] +,Para [Str "SECTION",Space,Str "1",Space,Str "Introduction",Space,Link ("",[],[]) [Str "2"] ("#introduction","")] ,Header 1 ("figures",["Heading-0"],[]) [Str "FIGURES"] ,Para [Strong [Str "Figure",Space,Str "Page"]] ,Para [Strong [Str "No",Space,Str "table",Space,Str "of",Space,Str "figures",Space,Str "entries",Space,Str "found."]] diff --git a/test/docx/golden/nested_anchors_in_header.docx b/test/docx/golden/nested_anchors_in_header.docx index 88dd21abd..9d89070d9 100644 Binary files a/test/docx/golden/nested_anchors_in_header.docx and b/test/docx/golden/nested_anchors_in_header.docx differ diff --git a/test/docx/nested_anchors_in_header.native b/test/docx/nested_anchors_in_header.native index 314b31663..9cc256d28 100644 --- a/test/docx/nested_anchors_in_header.native +++ b/test/docx/nested_anchors_in_header.native @@ -1,8 +1,8 @@ [Header 1 ("\1086\1075\1083\1072\1074\1083\1077\1085\1080\1077",["TOC-Heading"],[]) [Str "\1054\1075\1083\1072\1074\1083\1077\1085\1080\1077"] -,Para [Link ("",[],[]) [Str "Short",Space,Str "instructions",Space,Str "1"] ("#short-instructions","")] -,Para [Link ("",[],[]) [Str "Some",Space,Str "instructions",Space,Str "1"] ("#some-instructions","")] -,Para [Link ("",[],[]) [Str "Remote",Space,Str "folder",Space,Str "or",Space,Str "longlonglonglonglong",Space,Str "file",Space,Str "with",Space,Str "manymanymanymany",Space,Str "letters",Space,Str "inside",Space,Str "opening",Space,Str "2"] ("#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-opening","")] -,Para [Link ("",[],[]) [Str "Remote",Space,Str "folder",Space,Str "or",Space,Str "longlonglonglonglong",Space,Str "file",Space,Str "with",Space,Str "manymanymanymany",Space,Str "letters",Space,Str "inside",Space,Str "closing",Space,Str "2"] ("#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-closing","")] +,Para [Link ("",[],[]) [Str "Short",Space,Str "instructions",Space,Link ("",[],[]) [Str "1"] ("#short-instructions","")] ("#short-instructions","")] +,Para [Link ("",[],[]) [Str "Some",Space,Str "instructions",Space,Link ("",[],[]) [Str "1"] ("#some-instructions","")] ("#some-instructions","")] +,Para [Link ("",[],[]) [Str "Remote",Space,Str "folder",Space,Str "or",Space,Str "longlonglonglonglong",Space,Str "file",Space,Str "with",Space,Str "manymanymanymany",Space,Str "letters",Space,Str "inside",Space,Str "opening",Space,Link ("",[],[]) [Str "2"] ("#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-opening","")] ("#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-opening","")] +,Para [Link ("",[],[]) [Str "Remote",Space,Str "folder",Space,Str "or",Space,Str "longlonglonglonglong",Space,Str "file",Space,Str "with",Space,Str "manymanymanymany",Space,Str "letters",Space,Str "inside",Space,Str "closing",Space,Link ("",[],[]) [Str "2"] ("#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-closing","")] ("#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-closing","")] ,Header 1 ("short-instructions",[],[]) [Str "Short",Space,Str "instructions"] ,Para [Link ("",[],[]) [Str "Open",Space,Str "remote",Space,Str "folder"] ("#remote-folder-or-longlonglonglonglong-file-with-manymanymanymany-letters-inside-opening","")] ,Para [Str "Do",Space,Str "staff"] diff --git a/test/docx/pageref.docx b/test/docx/pageref.docx new file mode 100644 index 000000000..0a9159cab Binary files /dev/null and b/test/docx/pageref.docx differ diff --git a/test/docx/pageref.native b/test/docx/pageref.native new file mode 100644 index 000000000..6c683de67 --- /dev/null +++ b/test/docx/pageref.native @@ -0,0 +1,4 @@ +[Para [Str "Title",Space,Link ("",[],[]) [Str "2"] ("#title","")] +,Para [Str "Title2",Space,Link ("",[],[]) [Str "2"] ("#title2","")] +,Header 1 ("title", [],[]) [Str "Title"] +,Header 1 ("title2",[],[]) [Str "Title2"]] -- cgit v1.2.3 From 465c28d28e1017040a41653edb6248056f178d3b Mon Sep 17 00:00:00 2001 From: Milan Bracke Date: Thu, 24 Jun 2021 09:27:28 +0200 Subject: Docx reader: fix handling of empty fields Some fields only have an instrText and no content, Pandoc didn't understand these, causing other fields to be misunderstood because it seemed like a field was still open when it wasn't. --- src/Text/Pandoc/Readers/Docx/Parse.hs | 4 ++++ test/Tests/Readers/Docx.hs | 4 ++++ test/docx/empty_field.docx | Bin 0 -> 14312 bytes test/docx/empty_field.native | 7 +++++++ 4 files changed, 15 insertions(+) create mode 100644 test/docx/empty_field.docx create mode 100644 test/docx/empty_field.native diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index a97d4b3d1..0021741ed 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -844,6 +844,10 @@ elemToParPart ns element FldCharFieldInfo info : ancestors | fldCharType == "separate" -> do modify $ \st -> st {stateFldCharState = FldCharContent info [] : ancestors} return NullParPart + -- Some fields have no content, since Pandoc doesn't understand any of those fields, we can just close it. + FldCharFieldInfo _ : ancestors | fldCharType == "end" -> do + modify $ \st -> st {stateFldCharState = ancestors} + return NullParPart [FldCharContent info children] | fldCharType == "end" -> do modify $ \st -> st {stateFldCharState = []} return $ Field info $ reverse children diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs index ea4094c82..be5b89b88 100644 --- a/test/Tests/Readers/Docx.hs +++ b/test/Tests/Readers/Docx.hs @@ -151,6 +151,10 @@ tests = [ testGroup "document" "nested fields with tag" "docx/nested_instrText.docx" "docx/nested_instrText.native" + , testCompare + "empty fields with tag" + "docx/empty_field.docx" + "docx/empty_field.native" , testCompare "pageref hyperlinks in tag" "docx/pageref.docx" diff --git a/test/docx/empty_field.docx b/test/docx/empty_field.docx new file mode 100644 index 000000000..fb3830b0d Binary files /dev/null and b/test/docx/empty_field.docx differ diff --git a/test/docx/empty_field.native b/test/docx/empty_field.native new file mode 100644 index 000000000..18d892454 --- /dev/null +++ b/test/docx/empty_field.native @@ -0,0 +1,7 @@ +[Para + [Str "\24076\26395\28145\20837\20102\35299\30340\35835\32773\21487\20197\21435\30475David",Space,Str "French",Space,Str "Belding\21644Kevin",Space,Str "J.",Space,Str "Mitchell\30340" + ,Link ("",[],[]) [Str "Foundations",Space,Str "of",Space,Str "Analysis,",Space,Str "2nd",Space,Str "Edition"] ("https://books.google.com/books?id=sp_Zcb9ot90C&lpg=PR4&hl=zh-CN&pg=PA19#v=onepage&q&f=true",""),Str ",\21487\20174\&19\39029\30475\36215\65292\25110D.C.",Space,Str "Goldrei\30340",Space + ,Link ("",[],[]) [Str "Classic",Space,Str "Set",Space,Str "Theory:",Space,Str "For",Space,Str "Guided",Space,Str "Independent",Space,Str "Study"] ("https://books.google.ae/books?id=dlc0DwAAQBAJ&lpg=PT29&hl=zh-CN&pg=PT26#v=onepage&q&f=true","") + ,Str "\65292\20174\31532\20108\31456\30475\36215\65292\38405\35835\26102\35201\27880\24847\26412\25991\19982\36825\20123\20070\25152\19981\21516\30340\26159\24182\27809\26377\25226\23454\25968\30475\20316\26159\26377\29702\25968\38598\30340\20998\21106\12290"] +,Para [Str "Index:"] +,Para [Str "French,",Space,Str "1"]] -- cgit v1.2.3 From 7754b7f2ddd8b188de66b4c0f0b4a87d2a2045c6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 19 Oct 2021 08:04:18 -0700 Subject: FormatHeuristics: remove `.tei.xml` extension for TEI. As noted in #7630, this never worked, because `takeExtension` only returns `.xml`. So it won't be missed if we remove it. Closes #7630. --- src/Text/Pandoc/App/FormatHeuristics.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Text/Pandoc/App/FormatHeuristics.hs b/src/Text/Pandoc/App/FormatHeuristics.hs index bdf8c6667..a2acfc6d6 100644 --- a/src/Text/Pandoc/App/FormatHeuristics.hs +++ b/src/Text/Pandoc/App/FormatHeuristics.hs @@ -74,7 +74,6 @@ formatFromFilePath x = ".s5" -> Just "s5" ".t2t" -> Just "t2t" ".tei" -> Just "tei" - ".tei.xml" -> Just "tei" ".tex" -> Just "latex" ".texi" -> Just "texinfo" ".texinfo" -> Just "texinfo" -- cgit v1.2.3 From 0a93acf91a116911f2c6c6add4f153cc80d15181 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 20 Oct 2021 10:14:42 -0700 Subject: Markdown reader: don't parse links or bracketed spans as citations. Previously pandoc would parse [link to (@a)](url) as a citation; similarly [(@a)]{#ident} This is undesirable. One should be able to use example references in citations, and even if `@a` is not defined as an example reference, `[@a](url)` should be a link containing an author-in-text citation rather than a normal citation followed by literal `(url)`. Closes #7632. --- src/Text/Pandoc/Readers/Markdown.hs | 6 ++-- test/command/7632.md | 66 +++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 test/command/7632.md diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 42ca16c92..03becd144 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -327,6 +327,7 @@ referenceKey :: PandocMonad m => MarkdownParser m (F Blocks) referenceKey = try $ do pos <- getPosition skipNonindentSpaces + notFollowedBy (void cite) (_,raw) <- reference char ':' skipSpaces >> optional newline >> skipSpaces >> notFollowedBy (char '[') @@ -1781,8 +1782,8 @@ endline = try $ do -- a reference label for a link reference :: PandocMonad m => MarkdownParser m (F Inlines, Text) reference = do - guardDisabled Ext_footnotes <|> notFollowedBy' (string "[^") - guardDisabled Ext_citations <|> notFollowedBy' (string "[@") + -- guardDisabled Ext_footnotes <|> notFollowedBy' (string "[^") + -- guardDisabled Ext_citations <|> notFollowedBy' (string "[@") withRaw $ trimInlinesF <$> inlinesInBalancedBrackets parenthesizedChars :: PandocMonad m => MarkdownParser m Text @@ -2201,6 +2202,7 @@ normalCite = try $ do citations <- citeList spnl char ']' + notFollowedBy (oneOf "{([") -- not a link or a bracketed span return citations suffix :: PandocMonad m => MarkdownParser m (F Inlines) diff --git a/test/command/7632.md b/test/command/7632.md new file mode 100644 index 000000000..4256bc207 --- /dev/null +++ b/test/command/7632.md @@ -0,0 +1,66 @@ +``` +% pandoc -t native +(@a) First case + +[link to (@a)](url) +^D +[ OrderedList + ( 1 , Example , TwoParens ) + [ [ Plain [ Str "First" , Space , Str "case" ] ] ] +, Para + [ Link + ( "" , [] , [] ) + [ Str "link" , Space , Str "to" , Space , Str "(1)" ] + ( "url" , "" ) + ] +] +``` + +``` +% pandoc -t native +[@a]{.class} +^D +[ Para + [ Span + ( "" , [ "class" ] , [] ) + [ Cite + [ Citation + { citationId = "a" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "@a" ] + ] + ] +] + +``` + +``` +% pandoc -t native +[@a](url) +^D +[ Para + [ Link + ( "" , [] , [] ) + [ Cite + [ Citation + { citationId = "a" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = AuthorInText + , citationNoteNum = 1 + , citationHash = 0 + } + ] + [ Str "@a" ] + ] + ( "url" , "" ) + ] +] + +``` -- cgit v1.2.3 From fcd3384f9f058cf199f4fd10a25b6c700fd12a44 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 21 Oct 2021 08:57:00 -0700 Subject: Fix line numbers in source code with reveal.js We need "overflow: visible" for these to work, and reveal's default css disables this. So this modifies the default template to add this. Closes #7634. Thanks to @cderv for diagnosing the issue. --- data/templates/default.revealjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/templates/default.revealjs b/data/templates/default.revealjs index 203983522..45727e2d2 100644 --- a/data/templates/default.revealjs +++ b/data/templates/default.revealjs @@ -19,6 +19,9 @@ $endif$ $if(theme)$ -- cgit v1.2.3 From ef7b769fa07e2cbf4e9b8004484828628f548409 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 21 Oct 2021 21:51:53 -0700 Subject: SelfContained: fix bug that caused everything to be made a data uri. All the code we needed to put most styles and scripts into inline style and script tags was there, but because of the order of pattern matching, it was never being called. Putting the catch-all clause at the end fixes the bug. Closes #7635, closes #7367. See also #3423. --- src/Text/Pandoc/SelfContained.hs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Text/Pandoc/SelfContained.hs b/src/Text/Pandoc/SelfContained.hs index 3bbab4bbe..bd73c37dc 100644 --- a/src/Text/Pandoc/SelfContained.hs +++ b/src/Text/Pandoc/SelfContained.hs @@ -60,18 +60,6 @@ convertTags :: PandocMonad m => [Tag T.Text] -> m [Tag T.Text] convertTags [] = return [] convertTags (t@TagOpen{}:ts) | fromAttrib "data-external" t == "1" = (t:) <$> convertTags ts -convertTags (t@(TagOpen tagname as):ts) - | any (isSourceAttribute tagname) as - = do - as' <- mapM processAttribute as - rest <- convertTags ts - return $ TagOpen tagname as' : rest - where processAttribute (x,y) = - if isSourceAttribute tagname (x,y) - then do - enc <- getDataURI (fromAttrib "type" t) y - return (x, enc) - else return (x,y) convertTags (t@(TagOpen "script" as):TagClose "script":ts) = case fromAttrib "src" t of "" -> (t:) <$> convertTags ts @@ -125,6 +113,18 @@ convertTags (t@(TagOpen "link" as):ts) = return $ TagOpen "link" (("href",makeDataURI (mime, bs)) : [(x,y) | (x,y) <- as, x /= "href"]) : rest +convertTags (t@(TagOpen tagname as):ts) + | any (isSourceAttribute tagname) as + = do + as' <- mapM processAttribute as + rest <- convertTags ts + return $ TagOpen tagname as' : rest + where processAttribute (x,y) = + if isSourceAttribute tagname (x,y) + then do + enc <- getDataURI (fromAttrib "type" t) y + return (x, enc) + else return (x,y) convertTags (t:ts) = (t:) <$> convertTags ts cssURLs :: PandocMonad m -- cgit v1.2.3 From ee34252219cca23fd180e4602318ca264f8efa06 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 21 Oct 2021 22:27:07 -0700 Subject: Move splitStrWhen to T.P.Citeproc.Util. Previously there were two copies, in BibTeX and Locator. --- src/Text/Pandoc/Citeproc/BibTeX.hs | 11 +---------- src/Text/Pandoc/Citeproc/Locator.hs | 13 +------------ src/Text/Pandoc/Citeproc/Util.hs | 14 +++++++++++++- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs index 9dcefb8d3..75990f0a7 100644 --- a/src/Text/Pandoc/Citeproc/BibTeX.hs +++ b/src/Text/Pandoc/Citeproc/BibTeX.hs @@ -34,7 +34,7 @@ import Text.Pandoc.Class (runPure) import qualified Text.Pandoc.Walk as Walk import Citeproc.Types import Citeproc.Pandoc () -import Text.Pandoc.Citeproc.Util (toIETF) +import Text.Pandoc.Citeproc.Util (toIETF, splitStrWhen) import Text.Pandoc.Citeproc.Data (biblatexStringMap) import Data.Default import Data.Text (Text) @@ -1256,15 +1256,6 @@ toName opts ils = do , nameStaticOrdering = False } --- Split Str elements so that characters satisfying the --- predicate each have their own Str. -splitStrWhen :: (Char -> Bool) -> [Inline] -> [Inline] -splitStrWhen p = foldr go [] - where - go (Str t) = (map Str (T.groupBy goesTogether t) ++) - go x = (x :) - goesTogether c d = not (p c || p d) - ordinalize :: Locale -> Text -> Text ordinalize locale n = let terms = localeTerms locale diff --git a/src/Text/Pandoc/Citeproc/Locator.hs b/src/Text/Pandoc/Citeproc/Locator.hs index f8931d7b5..ce606197b 100644 --- a/src/Text/Pandoc/Citeproc/Locator.hs +++ b/src/Text/Pandoc/Citeproc/Locator.hs @@ -5,6 +5,7 @@ module Text.Pandoc.Citeproc.Locator ( parseLocator ) where import Citeproc.Types +import Text.Pandoc.Citeproc.Util (splitStrWhen) import Data.Text (Text) import qualified Data.Text as T import Data.List (foldl') @@ -247,18 +248,6 @@ isLocatorSep ',' = True isLocatorSep ';' = True isLocatorSep _ = False -splitStrWhen :: (Char -> Bool) -> [Inline] -> [Inline] -splitStrWhen _ [] = [] -splitStrWhen p (Str xs : ys) = go (T.unpack xs) ++ splitStrWhen p ys - where - go [] = [] - go s = case break p s of - ([],[]) -> [] - (zs,[]) -> [Str $ T.pack zs] - ([],w:ws) -> Str (T.singleton w) : go ws - (zs,w:ws) -> Str (T.pack zs) : Str (T.singleton w) : go ws -splitStrWhen p (x : ys) = x : splitStrWhen p ys - -- -- Locator Map -- diff --git a/src/Text/Pandoc/Citeproc/Util.hs b/src/Text/Pandoc/Citeproc/Util.hs index 6d8e01bc9..8bffc0f32 100644 --- a/src/Text/Pandoc/Citeproc/Util.hs +++ b/src/Text/Pandoc/Citeproc/Util.hs @@ -1,9 +1,21 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module Text.Pandoc.Citeproc.Util - ( toIETF ) + ( splitStrWhen + , toIETF ) where +import qualified Data.Text as T import Data.Text (Text) +import Text.Pandoc.Definition + +-- Split Str elements so that characters satisfying the +-- predicate each have their own Str. +splitStrWhen :: (Char -> Bool) -> [Inline] -> [Inline] +splitStrWhen p = foldr go [] + where + go (Str t) = (map Str (T.groupBy goesTogether t) ++) + go x = (x :) + goesTogether c d = not (p c || p d) toIETF :: Text -> Text toIETF "english" = "en-US" -- "en-EN" unavailable in CSL -- cgit v1.2.3 From e10f495a0163738a09c3fd18fce11788832c82b7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Oct 2021 09:43:11 -0700 Subject: Provisional changelog updates. There's still some time before a new release, but this is a start. --- changelog.md | 414 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 413 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 3b7f5b270..2dcf75e3f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,416 @@ -# Revision history for pandoc +[#](#) Revision history for pandoc + +## pandoc 2.15 (NODATE) + + * Add `--sandbox` option (#5045). + + + Add sandbox feature for readers. When this option is used, + readers and writers only have access to input files (and + other files specified directly on command line). This restriction + is enforced in the type system. + + Filters, PDF production, custom writers are unaffected. This + feature only insulates the actual readers and writers, not + the pipeline around them in Text.Pandoc.App. + + Note that when `--sandboxed` is specified, readers won't have + access to the resource path, nor will anything have access to + the user data directory. + + * `--self-contained`: Fix bug that caused everything to be made a data + URI (#7635, #7367). We only need to use data URIs in certain cases, but + due to a bug they were being used always. + + * Pandoc will now fall back to latin1 encoding for inputs that can't be + read as UTF-8. This is what it did previously for content fetched + from the web and not marked as to content type. It makes sense to do + the same for local files. In this case a `NotUTF8Encoded` warning + will be issued, indicating that pandoc is interpreting the input as latin1. + + * Markdown reader: + + + Don't parse links or bracketed spans as citations (#7632). + Previously pandoc would parse `[link to (@a)](url)` as a + citation; similarly `[(@a)]{#ident}`. This is undesirable. One should + be able to use example references in citations, and even if `@a` is + not defined as an example reference, `[@a](url)` should be a link + containing an author-in-text citation rather than a normal citation + followed by literal `(url)`. + + Fix interaction of `--strip-comments` and list parsing (#7521). + Use of `--strip-comments` was causing tight lists to be rendered as + loose (as if the comment were a blank line). + + Fix parsing bug for math in bracketed spans and links (#7623). + This affects math with unbalanced brackets (e.g. `$(0,1]$`) + inside links, images, bracketed spans. + + Fix code blocks using `--preserve-tabs` (#7573). Previously they + did not behave as the equivalent input with spaces would. + + * DocBook reader: + + + Honor linenumbering attribute (Samuel Tardieu). + The attribute DocBook `linenumbering="numbered"` on code blocks + maps to the `numberLines` class internally. + + * LaTeX reader: + + + Implement siunitx v3 commands (#7614). + We support `\unit`, `\qty`, `\qtyrange`, and `\qtylist` + as synonynms of `\si`, `\SI`, `\SIrange`, and `\SIlist`. + + Properly handle `\^` followed by group closing (#7615). + + Recognize that `\vadjust` sometimes takes "pre" (#7531). + + Ignore (and gobble parameters of) CSLReferences environment (#7531). + Otherwise we get the parameters as numbers in the output. + + Restrict `\endinput` to current file (Simun Schuster). + + * RST reader: handle escaped colons in reference definitions (#7568). + + * HTML reader: + + + Handle empty tbody element in table (#7589). + + * Ipynb reader (Kolen Cheung): + + + Get cell output mime from `raw_mimetype` in addition to `format`. + (`format` is what the spec calls for, but `raw_mimetype` is + often used in practice; see jupyter/nbformat#229). + + Add more formats that can be handled as "raw" cells. + + Fix mime type for `rst`. + + Support `text/markdown`, which is now a supported mime type for raw + output (#7561). + + * RTF reader: + + + Support `\binN` for binary image data. + + If doc begins with {\rtf1 ... } only parse its contents. + Some documents seem to have non-RTF (e.g. XML) material after the + `{\rtf1 ... }` group. + + Ignore `\pgdsc` group. Otherwise we get style names treated as test. + + Better handling of `\*` and bookmarks. We now ensure that groups + starting with `\*` never cause text to be added to the document. + In addition, bookmarks now create a span between the start + and end of the bookmark, rather than an empty span. + + * Docx reader: + + + Avoid blockquote when parent style has more indent (Milan Bracke). + When a paragraph has an indentation different from the parent (named) + style, it used to be considered a blockquote. But this only makes sense + when the paragraph has more indentation. So this commit adds a check + for the indentation of the parent style. + + Fix handling of empty fields (Milan Bracke). Some fields only + have an `instrText` and no content, Pandoc didn't understand these, + causing other fields to be misunderstood because it seemed like + a field was still open when it wasn't. + + Implement PAGEREF fields (Milan Bracke). These fields, often used + in tables of contents, can be a hyperlink. + + Fix handling of nested fields (Milan Bracke). Fields delimited by + `fldChar` elements can contain other fields. Before, the nested + fields would be ignored, except for the end, which would be + considered the end of the parent field. + + Add placeholder for word diagram instead of just omitting it (Ezwal). + + * Org reader: don't parse a list as first item in a list item (#7557). + + * Docx writer: + + + Make id used in `native_numbering` predictable (#7551). + If the image has the id IMAGEID, then we use the id ref_IMAGEID + for the figure number. This allows one to create a filter that + adds a figure number with figure name, e.g. + `Figure X + `. + If an image lack an id, an id of the form `ref_fig1` is used. + + Ensure we have unique ids for `wp:docPr` and `pic:cNvPr` elements + (#7527, #7503). + + Handle SVG images (#4058). This change has several parts: + - In Text.Pandoc.App, if the writer is docx, we fill the media + bag and attempt to convert any SVG images to PNG, adding these + to the media bag. The PNG backups have the same filenames as + the SVG images, but with an added .png extension. If the conversion + cannot be done (e.g. because rsvg-convert is not present), + a warning is omitted. + - In Text.Pandoc.Writers.Docx, we now use Word 2016's syntax for + including SVG images. If a PNG fallback is present in the media bag, + we include a link to that too. + + * Powerpoint writer (Emily Bourke): + + + Add support for more layouts (#5097). Up til now, four layouts + were supported: "Title Slide" (used for the automatically generated + metadata slide), "Section Header" (used for headings above slide + level), "Two Column" (used when there's a columns div), "Title and + Content" (used for all other slides). We now support three + additional layouts: "Comparison", "Content with Caption", and + "Blank". The manual describes the logic that determines which + layout is used for a slide. Layouts may be customized in the + reference doc. + + Support specifying slide background images using a `background-image` + attribute on the slide's heading. Only the "stretch" mode is supported, + and the background image is centred around the slide in the image's + larger axis, matching the observed default behaviour of PowerPoint. + + Add support for incremental lists (through same methods as in + other slide writers) (#5689). + + Copy embedded fonts from reference doc. + + Include all themes in output archive. + + Fix list level numbering (#4828, #4663). In PowerPoint, + the content of a top-level list is at the same level as the content + of a top-level paragraph: the only difference is that a list style + has been applied. Previously, the writer incremented the paragrap + h level on each list, turning what should be top-level lists into + second-level lists. + + Line up list continuation paragraphs. This commit + changes the `marL` and `indent` values used for plain paragraphs + and numbered lists, and changes the spacing defined in the + reference doc master for bulleted lists. For paragraphs, there is + now a left-indent taken from the `otherStyle` in the master. + For numbered lists, the number is positioned where the text would be + if this were a plain paragraph, and the text is indented to the next + level. This means that continuation paragraphs line up nicely with + numbered lists. Existing reference docs may need to be modified so + that `otherStyle` and `bodyStyle` indent levels match, for this + feature to work with them. + + Consolidate text runs when possible (jgm). This slims down the output + files by avoiding unnecessary text run elements. + + Support footers in the reference doc. + There is one behaviour which may not be immediately obvious: if the + reference doc specifies a fixed date (i.e. not automatically updating), + and there’s a date specified in the metadata for the document, the + footer date is replaced by the metadata date. + + Fix presentation rel numbering. Before now, the numbering of `rId`s + was inconsistent when making the presentation XML and when making + the presentation relationships XML. + + Don’t add relationships unnecessarily. Before now, for any layouts + added to the output from the default reference doc, the relationships + were unconditionally added to the output. However, if there was already + a layout in slideMaster1 at the same index then that results in + duplicate relationships. + + If slide level is 0, don't insert a slide break between a heading + and a following table, "columns" div, or paragraph starting + with an image. + + Fix capitalisation of `notesMasterId`. + + Restructure tests. + + * Asciidoc writer: + + + Translate numberLines attribute to `linesnum` switch (Samuel Tardieu). + + Improve escaping for `--` in URLs (#7529). + + * LaTeX writer: + + + Make babel use more idiomatic (#7604, hseg). Use babel's + bidi implementation. Import babel languages individually instead + of as package options. Move `header-includes` to after + `babel` setup so it can be modified. + + Use babel, not polyglossia, with xelatex. Previously polyglossia + worked better with xelatex, but that is no longer the case, so + we simplify the code so that babel is used with all latex + engines. This involves a change to the default LaTeX template. + + * Markdown writer: + + + Avoid bad wraps at the Doc Text level. Previously we tried to + do this at the Inline list level, but it makes more sense to + intervene on breaking spaces at the Doc Text level. + + Use `underline` class rather than `ul` for underline. + This only affects output with `bracketed_spans` enabled. + The markdown reader parses spans with either `.ul` or `.underline` as + Underline elements, but we're moving towards preferring the latter. + + * RST writer: + + + Properly handle anchors to ids with spaces or leading underscore + (#7593). In this cases we need the quoted form, e.g. + ``` + .. _`foo bar`: + + .. _`_foo`: + ``` + Side note: rST will "normalize" these identifiers anyway, + ignoring the underscore. + + * HTML writer: + + + Render `\ref` and `\eqref` as inline math, not display (see #7589). + + Pass through `\ref` and `\eqref` if MathJax is used (#7587). + + Pass through inline math environments with KaTeX. + + Support `--reference-location` for HTML output (#7461, + Francesco Mazzoli). + + Set "hash" to True by default (for reveal.js) (#7574). See #6968 + where the motivation for setting "hash" to True is explained. + + * Native writer: Use pretty-show to format native output (#7580). + Previously we used our own homespun formatting. But this produces + over-long lines that aren't ideal for diffs in tests. + Performance is slower by about a factor of 10, but this isn't + really a problem because native isn't suitable as a serialization + format. (For serialization you should use json, because the reader + is so much faster than native.) + + * Org writer: + + + Don't indent contents of code blocks. We previously indented them + by two spaces, following a common convention. Since the convention + is fading, and the indentation is inconvenient for copy/paste, we are + discontinuing this practice. + + Update list of supported source languages in org writer (#5440). + + * Ipynb writer (Kolen Cheung): + + + Improve round trip identity for raw cell output. + See jupyter/nbformat#229. The Jupyter ecosystem, including nbconvert, + lab and notebook, deviated from their own spec in nbformat, where + they used the key `raw_mimetype` instead of `format`. Moreover, + the mime-type of rst used in Jupyter deviated from that suggested by + https://docutils.sourceforge.io/FAQ.html and is defined as + `text/restructuredtext` when chosen from "Raw NBConvert Format" in + Jupyter. The new behavior should matche the real world usage better, + hence improving the round-trip "identity" in raw-cell. + + Add more formats that can be handled as "raw" cells. + + * EPUB writer: + + + Add EPUB3 subject metadata (authority/term) (nuew). + This adds the ability to specify EPUB 3 `authority` and `term` specific + refinements to the `subject` tag. Specifying a plain `subject` tag in + metadata will function as before. + + Treat epub:type "frontispiece" as front matter (#7600). + + * reveal.js template: Fix line numbers in source code (#7634). + We need `overflow: visible` for these to work, and reveal's + default css disables this. So we re-enable it in the default template. + + * Text.Pandoc.Writers.Shared: + + + Export `splitSentences` as a Doc Text transform [API change]. + Use this in man/ms. + + We used to attempt automatic sentence splitting in man and ms + output, since sentence-ending periods need to be followed by + two spaces or a newline in these formats. But it's difficult + to do this reliably at the level of `[Inline]`. + + * Text.Pandoc.Translations: small revisions for compatibility + with aeson 2. + + * Don't prepend `file://` to `--syntax-definition` on Windows (#6374). + This was a fix for a problem in skylighting, but this + problem doesn't exist now that we've moved from HXT to xml-conduit. + + * Text.Pandoc.Extensions: + + + Add `Ext_footnotes` to default `gfm` etxensions. Now `gfm` + supports footnotes. + + Alphabetize Extension constructors (also affects `--list-extensions`). + + * Text.Pandoc.Citeproc.Util: Better implementation of `splitStrWhen`. + Previously the citeproc code had two less efficient + implementations. + + * Update documentation for definition_list extension (#7594). + In 2015, we relaxed indentation requirements for the first + line of a definition (see commit d3544dc and issue #2087), but + the documnentation wasn't updated to reflect the change. + + * Text.Pandoc.Citeproc.BibTeX: Fix expansion of special strings in series + e.g. `newseries` or `library` (#7591). Expansion should not happen + when these strings are protected in braces, or when they're + capitalized. + + * Text.Pandoc.Logging: add `NotUTF8Encoded` constructor to `LogMessage` + [API change]. + + * Text.Pandoc.App.FormatHeuristics: remove `.tei.xml` extension for TEI + (#7630). This never worked, because `takeExtension` + only returns `.xml`. So it won't be missed if we remove it. + + * Text.Pandoc.Image: + + + Generalize `svgToPng` to MonadIO. + + `svgToPng`, change first parameter from WriterOptions to Int. + + * Text.Pandoc.Class: + + + Add `readStdinStrict` method to PandocMonad [API change]. + + Generalize type of `extractMedia` [API change]. + It was uselessly restricted to PandocIO, instead of any + instance of PandocMonad and MonadIO. + + * Text.Pandoc.Class.PandocIO: derive MonadCatch, MonadThrow, MonadMask. + This allows us to use `withTempDir` [API change]. + + * Add module Text.Pandoc.Class.Sandbox, defining + `sandbox`. Exported via Text.Pandoc.Class. [API change] + + * Text.Pandoc.Filter: Generalize type of `applyFilters` + from PandocIO to any instance of MonadIO and PandocMonad [API change]. + + * Text.Pandoc.PDF: generalize type of `makePDF`: + instead of PandocIO, it can be used in any instance of + PandocMonad, MonadIO, and MonadMask [API change]. + + * Lua subsystem and custom writers: generalize types from PandocIO + to any instance of PandocMonad and MonadIO [API change]. + The type of `runLua` is now + + (PandocMonad m, MonadIO m) => Lua a -> m (Either PandocError a) + + * Text.Pandoc.PDF: Previously we had to run `runIOorExplode` inside + `withTempDir`. Now that PandocIO is an instance of MonadMask, this is + no longer necessary. + + * Text.Pandoc.App: + + + Reorganize to make it easier to limit IO in main loop. + Previously we used liftIO fairly liberally. The code has + been restructured to avoid this. + + Move output-file writing out of PandocMonad action. + + * Text.Pandoc.App.OutputSettings: Generalize some types + so we can run this with any instance of PandocMonad and MonadIO, + not just PandocIO. + + * Allow time 1.12. + + * Use skylighting-0.12, skylighting-core-0.12. + This fixes highlighting issues with typescript, scala, and other + syntaxes that include keyword lists from different syntaxes. + + * Use latest dev version of texmath. + + * Use dev version of citeproc. + + * Require doclayout >= 0.3.1.1. This fixes recognition of "real widths" + of emoji characters, which is important for tabular layout. + + * Cut out over 100K of fat in epub test golden files. + + * Make `test/epub/wasteland.epub` valid. + + * Add missing `%` on some command tests. + This prevented `--accept` from working properly. + + * Command tests: raise error if command doesn't begin with `%`. + + * OOXML tests: use pretty-printed form to display diffs. + Otherwise everything is on one line and the diff is uninformative. + + * Fix compareXML helper in Tests.Writers.OOXML. + Given how it is used, we were getting "mine" and "good" + flipped in the test results. + + * MANUAL.txt: + + + Clarify `attributes` extension support (William Lupton). + + Document formats affected by `--reference-location`. + + Document error code 25 + + Add some more info regarding `--slide-level=0` (Salim B). + + Add more to security section of manual. + + Mention support of `title-toc` (#7171, Christophe Dervieux). + + * doc/lua-filters.md: + + + Add missing type for Image title (Quinn). + + Improve order of Image fields (Quinn). + + Rephrase pandoc.path docs (#7548, Quinn). + + Do not leak working directory in TikZ filter (Jeroen de Haas). ## pandoc 2.14.2 (2021-08-21) -- cgit v1.2.3 From 9e74826ba9ce4139bfdd3f057a79efa8b644e85a Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 20 Oct 2021 21:40:07 +0200 Subject: Switch to hslua-2.0 The new HsLua version takes a somewhat different approach to marshalling and unmarshalling, relying less on typeclasses and more on specialized types. This allows for better performance and improved error messages. Furthermore, new abstractions allow to document the code and exposed functions. --- cabal.project | 1 - pandoc.cabal | 15 +- src/Text/Pandoc/Lua/ErrorConversion.hs | 71 ++-- src/Text/Pandoc/Lua/Filter.hs | 180 ++++---- src/Text/Pandoc/Lua/Global.hs | 45 +- src/Text/Pandoc/Lua/Init.hs | 37 +- src/Text/Pandoc/Lua/Marshaling.hs | 1 + src/Text/Pandoc/Lua/Marshaling/AST.hs | 543 +++++++++++++----------- src/Text/Pandoc/Lua/Marshaling/AnyValue.hs | 24 -- src/Text/Pandoc/Lua/Marshaling/CommonState.hs | 122 ++---- src/Text/Pandoc/Lua/Marshaling/Context.hs | 4 +- src/Text/Pandoc/Lua/Marshaling/List.hs | 30 +- src/Text/Pandoc/Lua/Marshaling/MediaBag.hs | 73 ---- src/Text/Pandoc/Lua/Marshaling/PandocError.hs | 62 ++- src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs | 106 +++-- src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs | 37 +- src/Text/Pandoc/Lua/Marshaling/Version.hs | 168 +++----- src/Text/Pandoc/Lua/Module/MediaBag.hs | 19 +- src/Text/Pandoc/Lua/Module/Pandoc.hs | 87 ++-- src/Text/Pandoc/Lua/Module/System.hs | 39 +- src/Text/Pandoc/Lua/Module/Types.hs | 66 ++- src/Text/Pandoc/Lua/Module/Utils.hs | 227 ++++++---- src/Text/Pandoc/Lua/Packages.hs | 34 +- src/Text/Pandoc/Lua/PandocLua.hs | 33 +- src/Text/Pandoc/Lua/Util.hs | 120 +++--- src/Text/Pandoc/Writers/Custom.hs | 154 +++---- stack.yaml | 15 +- test/Tests/Lua.hs | 63 +-- test/lua/module/pandoc-types.lua | 25 -- 29 files changed, 1152 insertions(+), 1249 deletions(-) delete mode 100644 src/Text/Pandoc/Lua/Marshaling/AnyValue.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling/MediaBag.hs diff --git a/cabal.project b/cabal.project index 2b19ad28e..b5cef10cb 100644 --- a/cabal.project +++ b/cabal.project @@ -41,4 +41,3 @@ source-repository-package -- type: git -- location: https://github.com/jgm/ipynb.git -- tag: 1f1ddb29227335091a3a158b9aeeeb47a372c683 - diff --git a/pandoc.cabal b/pandoc.cabal index ac6cb8121..886d3fa9d 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -551,10 +551,11 @@ library file-embed >= 0.0 && < 0.1, filepath >= 1.1 && < 1.5, haddock-library >= 1.10 && < 1.11, - hslua >= 1.1 && < 1.4, - hslua-module-path >= 0.1.0 && < 0.2.0, - hslua-module-system >= 0.2 && < 0.3, - hslua-module-text >= 0.2.1 && < 0.4, + hslua >= 2.0 && < 2.1, + hslua-marshalling >= 2.0 && < 2.1, + hslua-module-path >= 1.0 && < 1.1, + hslua-module-system >= 1.0 && < 1.1, + hslua-module-text >= 1.0 && < 1.1, http-client >= 0.4.30 && < 0.8, http-client-tls >= 0.2.4 && < 0.4, http-types >= 0.8 && < 0.13, @@ -775,11 +776,9 @@ library Text.Pandoc.Lua.Init, Text.Pandoc.Lua.Marshaling, Text.Pandoc.Lua.Marshaling.AST, - Text.Pandoc.Lua.Marshaling.AnyValue, Text.Pandoc.Lua.Marshaling.CommonState, Text.Pandoc.Lua.Marshaling.Context, Text.Pandoc.Lua.Marshaling.List, - Text.Pandoc.Lua.Marshaling.MediaBag, Text.Pandoc.Lua.Marshaling.PandocError, Text.Pandoc.Lua.Marshaling.ReaderOptions, Text.Pandoc.Lua.Marshaling.SimpleTable, @@ -847,14 +846,14 @@ test-suite test-pandoc doctemplates >= 0.10 && < 0.11, exceptions >= 0.8 && < 0.11, filepath >= 1.1 && < 1.5, - hslua >= 1.1 && < 1.4, + hslua >= 2.0 && < 2.1, mtl >= 2.2 && < 2.3, pandoc-types >= 1.22 && < 1.23, process >= 1.2.3 && < 1.7, tasty >= 0.11 && < 1.5, tasty-golden >= 2.3 && < 2.4, tasty-hunit >= 0.9 && < 0.11, - tasty-lua >= 0.2 && < 0.3, + tasty-lua >= 1.0 && < 1.1, tasty-quickcheck >= 0.8 && < 0.11, text >= 1.1.1.0 && < 1.3, time >= 1.5 && < 1.13, diff --git a/src/Text/Pandoc/Lua/ErrorConversion.hs b/src/Text/Pandoc/Lua/ErrorConversion.hs index 4e6880722..9c4c990a3 100644 --- a/src/Text/Pandoc/Lua/ErrorConversion.hs +++ b/src/Text/Pandoc/Lua/ErrorConversion.hs @@ -1,6 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE LambdaCase #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} {- | Module : Text.Pandoc.Lua.ErrorConversion Copyright : © 2020-2021 Albert Krewinkel @@ -13,49 +12,37 @@ Define how Lua errors are converted into @'PandocError'@ Haskell exceptions, and /vice versa/. -} module Text.Pandoc.Lua.ErrorConversion - ( errorConversion + ( addContextToException ) where -import Foreign.Lua (Lua (..), NumResults) +import HsLua (LuaError, LuaE, top) +import HsLua.Marshalling (resultToEither, runPeek) +import HsLua.Class.Peekable (PeekError (..)) import Text.Pandoc.Error (PandocError (PandocLuaError)) import Text.Pandoc.Lua.Marshaling.PandocError (pushPandocError, peekPandocError) -import qualified Control.Monad.Catch as Catch import qualified Data.Text as T -import qualified Foreign.Lua as Lua - --- | Conversions between Lua errors and Haskell exceptions, assuming --- that all exceptions are of type @'PandocError'@. -errorConversion :: Lua.ErrorConversion -errorConversion = Lua.ErrorConversion - { Lua.addContextToException = addContextToException - , Lua.alternative = alternative - , Lua.errorToException = errorToException - , Lua.exceptionToError = exceptionToError - } - --- | Convert a Lua error, which must be at the top of the stack, into a --- @'PandocError'@, popping the value from the stack. -errorToException :: forall a . Lua.State -> IO a -errorToException l = Lua.unsafeRunWith l $ do - err <- peekPandocError Lua.stackTop - Lua.pop 1 - Catch.throwM err - --- | Try the first op -- if it doesn't succeed, run the second. -alternative :: forall a . Lua a -> Lua a -> Lua a -alternative x y = Catch.try x >>= \case - Left (_ :: PandocError) -> y - Right x' -> return x' - --- | Add more context to an error -addContextToException :: forall a . String -> Lua a -> Lua a -addContextToException ctx op = op `Catch.catch` \case - PandocLuaError msg -> Catch.throwM $ PandocLuaError (T.pack ctx <> msg) - e -> Catch.throwM e - --- | Catch a @'PandocError'@ exception and raise it as a Lua error. -exceptionToError :: Lua NumResults -> Lua NumResults -exceptionToError op = op `Catch.catch` \e -> do - pushPandocError e - Lua.error +import qualified HsLua as Lua + +addContextToException :: () +addContextToException = undefined + +-- | Retrieve a @'PandocError'@ from the Lua stack. +popPandocError :: LuaE PandocError PandocError +popPandocError = do + errResult <- runPeek $ peekPandocError top + case resultToEither errResult of + Right x -> return x + Left err -> return $ PandocLuaError (T.pack err) + +-- Ensure conversions between Lua errors and 'PandocError' exceptions +-- are possible. +instance LuaError PandocError where + popException = popPandocError + pushException = pushPandocError + luaException = PandocLuaError . T.pack + +instance PeekError PandocError where + messageFromException = \case + PandocLuaError m -> T.unpack m + err -> show err diff --git a/src/Text/Pandoc/Lua/Filter.hs b/src/Text/Pandoc/Lua/Filter.hs index 01bf90efa..9a06dcac6 100644 --- a/src/Text/Pandoc/Lua/Filter.hs +++ b/src/Text/Pandoc/Lua/Filter.hs @@ -1,4 +1,7 @@ -{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE IncoherentInstances #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} {- | Module : Text.Pandoc.Lua.Filter Copyright : © 2012-2021 John MacFarlane, @@ -19,43 +22,42 @@ module Text.Pandoc.Lua.Filter ( LuaFilterFunction , module Text.Pandoc.Lua.Walk ) where import Control.Applicative ((<|>)) -import Control.Monad (mplus, (>=>)) -import Control.Monad.Catch (finally, try) +import Control.Monad (mplus, (>=>), (<$!>)) import Data.Data (Data, DataType, dataTypeConstrs, dataTypeName, dataTypeOf, showConstr, toConstr, tyconUQname) import Data.Foldable (foldrM) import Data.List (foldl') import Data.Map (Map) -import Data.Maybe (fromMaybe) -import Foreign.Lua (Lua, Peekable, Pushable, StackIndex) +import Data.String (IsString (fromString)) +import HsLua as Lua import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshaling () -import Text.Pandoc.Lua.Marshaling.List (List (..)) +import Text.Pandoc.Lua.Marshaling.AST +import Text.Pandoc.Lua.Marshaling.List (List (..), peekList') import Text.Pandoc.Lua.Walk (SingletonsList (..)) import Text.Pandoc.Walk (Walkable (walkM)) import qualified Data.Map.Strict as Map -import qualified Foreign.Lua as Lua import qualified Text.Pandoc.Lua.Util as LuaUtil -- | Transform document using the filter defined in the given file. -runFilterFile :: FilePath -> Pandoc -> Lua Pandoc +runFilterFile :: FilePath -> Pandoc -> LuaE PandocError Pandoc runFilterFile filterPath doc = do - top <- Lua.gettop + oldtop <- Lua.gettop stat <- LuaUtil.dofileWithTraceback filterPath if stat /= Lua.OK - then Lua.throwTopMessage + then Lua.throwErrorAsException else do newtop <- Lua.gettop -- Use the returned filters, or the implicitly defined global -- filter if nothing was returned. - luaFilters <- if newtop - top >= 1 - then Lua.peek Lua.stackTop + luaFilters <- if newtop - oldtop >= 1 + then Lua.peek Lua.top else Lua.pushglobaltable *> fmap (:[]) Lua.popValue runAll luaFilters doc -runAll :: [LuaFilter] -> Pandoc -> Lua Pandoc +runAll :: [LuaFilter] -> Pandoc -> LuaE PandocError Pandoc runAll = foldr ((>=>) . walkMWithLuaFilter) return -- | Filter function stored in the registry @@ -63,7 +65,7 @@ newtype LuaFilterFunction = LuaFilterFunction Lua.Reference -- | Collection of filter functions (at most one function per element -- constructor) -newtype LuaFilter = LuaFilter (Map String LuaFilterFunction) +newtype LuaFilter = LuaFilter (Map Name LuaFilterFunction) instance Peekable LuaFilter where peek idx = do @@ -79,19 +81,19 @@ instance Peekable LuaFilter where return $ case filterFn of Nothing -> acc Just fn -> Map.insert constr fn acc - LuaFilter <$> foldrM go Map.empty constrs + LuaFilter <$!> foldrM go Map.empty constrs -- | Register the function at the top of the stack as a filter function in the -- registry. -registerFilterFunction :: Lua (Maybe LuaFilterFunction) +registerFilterFunction :: LuaError e => LuaE e (Maybe LuaFilterFunction) registerFilterFunction = do - isFn <- Lua.isfunction Lua.stackTop + isFn <- Lua.isfunction Lua.top if isFn then Just . LuaFilterFunction <$> Lua.ref Lua.registryindex else Nothing <$ Lua.pop 1 -- | Retrieve filter function from registry and push it to the top of the stack. -pushFilterFunction :: LuaFilterFunction -> Lua () +pushFilterFunction :: LuaFilterFunction -> LuaE PandocError () pushFilterFunction (LuaFilterFunction fnRef) = Lua.getref Lua.registryindex fnRef @@ -99,58 +101,66 @@ pushFilterFunction (LuaFilterFunction fnRef) = -- element instead of a list, fetch that element as a singleton list. If the top -- of the stack is nil, return the default element that was passed to this -- function. If none of these apply, raise an error. -elementOrList :: Peekable a => a -> Lua [a] -elementOrList x = do - let topOfStack = Lua.stackTop - elementUnchanged <- Lua.isnil topOfStack +elementOrList :: Peeker PandocError a -> a -> LuaE PandocError [a] +elementOrList p x = do + elementUnchanged <- Lua.isnil top if elementUnchanged - then [x] <$ Lua.pop 1 - else do - mbres <- peekEither topOfStack - case mbres of - Right res -> [res] <$ Lua.pop 1 - Left _ -> Lua.peekList topOfStack `finally` Lua.pop 1 + then [x] <$ pop 1 + else forcePeek . (`lastly` pop 1) $ (((:[]) <$!> p top) <|> peekList p top) + +-- | Fetches a single element; returns the fallback if the value is @nil@. +singleElement :: forall a e. (LuaError e) => Peeker e a -> a -> LuaE e a +singleElement p x = do + elementUnchanged <- Lua.isnil top + if elementUnchanged + then x <$ Lua.pop 1 + else forcePeek $ p top `lastly` pop 1 -- | Pop and return a value from the stack; if the value at the top of -- the stack is @nil@, return the fallback element. -popOption :: Peekable a => a -> Lua a -popOption fallback = fromMaybe fallback . Lua.fromOptional <$> Lua.popValue +popOption :: Peeker PandocError a -> a -> LuaE PandocError a +popOption peeker fallback = forcePeek . (`lastly` pop 1) $ + (fallback <$ peekNil top) <|> peeker top -- | Apply filter on a sequence of AST elements. Both lists and single -- value are accepted as filter function return values. -runOnSequence :: (Data a, Peekable a, Pushable a) - => LuaFilter -> SingletonsList a -> Lua (SingletonsList a) -runOnSequence (LuaFilter fnMap) (SingletonsList xs) = +runOnSequence :: forall a. (Data a, Pushable a) + => Peeker PandocError a -> LuaFilter -> SingletonsList a + -> LuaE PandocError (SingletonsList a) +runOnSequence peeker (LuaFilter fnMap) (SingletonsList xs) = SingletonsList <$> mconcatMapM tryFilter xs where - tryFilter :: (Data a, Peekable a, Pushable a) => a -> Lua [a] + tryFilter :: a -> LuaE PandocError [a] tryFilter x = - let filterFnName = showConstr (toConstr x) - catchAllName = tyconUQname $ dataTypeName (dataTypeOf x) + let filterFnName = fromString $ showConstr (toConstr x) + catchAllName = fromString . tyconUQname $ dataTypeName (dataTypeOf x) in case Map.lookup filterFnName fnMap <|> Map.lookup catchAllName fnMap of - Just fn -> runFilterFunction fn x *> elementOrList x + Just fn -> runFilterFunction fn x *> elementOrList peeker x Nothing -> return [x] -- | Try filtering the given value without type error corrections on -- the return value. -runOnValue :: (Data a, Peekable a, Pushable a) - => String -> LuaFilter -> a -> Lua a -runOnValue filterFnName (LuaFilter fnMap) x = +runOnValue :: (Data a, Pushable a) + => Name -> Peeker PandocError a + -> LuaFilter -> a + -> LuaE PandocError a +runOnValue filterFnName peeker (LuaFilter fnMap) x = case Map.lookup filterFnName fnMap of - Just fn -> runFilterFunction fn x *> popOption x + Just fn -> runFilterFunction fn x *> popOption peeker x Nothing -> return x --- | Push a value to the stack via a lua filter function. The filter function is --- called with given element as argument and is expected to return an element. --- Alternatively, the function can return nothing or nil, in which case the --- element is left unchanged. -runFilterFunction :: Pushable a => LuaFilterFunction -> a -> Lua () +-- | Push a value to the stack via a Lua filter function. The filter +-- function is called with the given element as argument and is expected +-- to return an element. Alternatively, the function can return nothing +-- or nil, in which case the element is left unchanged. +runFilterFunction :: Pushable a + => LuaFilterFunction -> a -> LuaE PandocError () runFilterFunction lf x = do pushFilterFunction lf Lua.push x LuaUtil.callWithTraceback 1 1 -walkMWithLuaFilter :: LuaFilter -> Pandoc -> Lua Pandoc +walkMWithLuaFilter :: LuaFilter -> Pandoc -> LuaE PandocError Pandoc walkMWithLuaFilter f = walkInlines f >=> walkInlineLists f @@ -162,92 +172,76 @@ walkMWithLuaFilter f = mconcatMapM :: (Monad m) => (a -> m [a]) -> [a] -> m [a] mconcatMapM f = fmap mconcat . mapM f -hasOneOf :: LuaFilter -> [String] -> Bool +hasOneOf :: LuaFilter -> [Name] -> Bool hasOneOf (LuaFilter fnMap) = any (`Map.member` fnMap) -contains :: LuaFilter -> String -> Bool +contains :: LuaFilter -> Name -> Bool contains (LuaFilter fnMap) = (`Map.member` fnMap) -walkInlines :: Walkable (SingletonsList Inline) a => LuaFilter -> a -> Lua a +walkInlines :: Walkable (SingletonsList Inline) a + => LuaFilter -> a -> LuaE PandocError a walkInlines lf = - let f :: SingletonsList Inline -> Lua (SingletonsList Inline) - f = runOnSequence lf + let f :: SingletonsList Inline -> LuaE PandocError (SingletonsList Inline) + f = runOnSequence peekInline lf in if lf `hasOneOf` inlineElementNames then walkM f else return -walkInlineLists :: Walkable (List Inline) a => LuaFilter -> a -> Lua a +walkInlineLists :: Walkable (List Inline) a + => LuaFilter -> a -> LuaE PandocError a walkInlineLists lf = - let f :: List Inline -> Lua (List Inline) - f = runOnValue listOfInlinesFilterName lf + let f :: List Inline -> LuaE PandocError (List Inline) + f = runOnValue listOfInlinesFilterName (peekList' peekInline) lf in if lf `contains` listOfInlinesFilterName then walkM f else return -walkBlocks :: Walkable (SingletonsList Block) a => LuaFilter -> a -> Lua a +walkBlocks :: Walkable (SingletonsList Block) a + => LuaFilter -> a -> LuaE PandocError a walkBlocks lf = - let f :: SingletonsList Block -> Lua (SingletonsList Block) - f = runOnSequence lf + let f :: SingletonsList Block -> LuaE PandocError (SingletonsList Block) + f = runOnSequence peekBlock lf in if lf `hasOneOf` blockElementNames then walkM f else return -walkBlockLists :: Walkable (List Block) a => LuaFilter -> a -> Lua a +walkBlockLists :: Walkable (List Block) a + => LuaFilter -> a -> LuaE PandocError a walkBlockLists lf = - let f :: List Block -> Lua (List Block) - f = runOnValue listOfBlocksFilterName lf + let f :: List Block -> LuaE PandocError (List Block) + f = runOnValue listOfBlocksFilterName (peekList' peekBlock) lf in if lf `contains` listOfBlocksFilterName then walkM f else return -walkMeta :: LuaFilter -> Pandoc -> Lua Pandoc +walkMeta :: LuaFilter -> Pandoc -> LuaE PandocError Pandoc walkMeta lf (Pandoc m bs) = do - m' <- runOnValue "Meta" lf m + m' <- runOnValue "Meta" peekMeta lf m return $ Pandoc m' bs -walkPandoc :: LuaFilter -> Pandoc -> Lua Pandoc +walkPandoc :: LuaFilter -> Pandoc -> LuaE PandocError Pandoc walkPandoc (LuaFilter fnMap) = case foldl' mplus Nothing (map (`Map.lookup` fnMap) pandocFilterNames) of - Just fn -> \x -> runFilterFunction fn x *> singleElement x + Just fn -> \x -> runFilterFunction fn x *> singleElement peekPandoc x Nothing -> return -constructorsFor :: DataType -> [String] -constructorsFor x = map show (dataTypeConstrs x) +constructorsFor :: DataType -> [Name] +constructorsFor x = map (fromString . show) (dataTypeConstrs x) -inlineElementNames :: [String] +inlineElementNames :: [Name] inlineElementNames = "Inline" : constructorsFor (dataTypeOf (Str mempty)) -blockElementNames :: [String] +blockElementNames :: [Name] blockElementNames = "Block" : constructorsFor (dataTypeOf (Para [])) -listOfInlinesFilterName :: String +listOfInlinesFilterName :: Name listOfInlinesFilterName = "Inlines" -listOfBlocksFilterName :: String +listOfBlocksFilterName :: Name listOfBlocksFilterName = "Blocks" -metaFilterName :: String +metaFilterName :: Name metaFilterName = "Meta" -pandocFilterNames :: [String] +pandocFilterNames :: [Name] pandocFilterNames = ["Pandoc", "Doc"] - -singleElement :: Peekable a => a -> Lua a -singleElement x = do - elementUnchanged <- Lua.isnil (-1) - if elementUnchanged - then x <$ Lua.pop 1 - else do - mbres <- peekEither (-1) - case mbres of - Right res -> res <$ Lua.pop 1 - Left err -> do - Lua.pop 1 - Lua.throwMessage - ("Error while trying to get a filter's return " <> - "value from Lua stack.\n" <> show err) - --- | Try to convert the value at the given stack index to a Haskell value. --- Returns @Left@ with an error message on failure. -peekEither :: Peekable a => StackIndex -> Lua (Either PandocError a) -peekEither = try . Lua.peek diff --git a/src/Text/Pandoc/Lua/Global.hs b/src/Text/Pandoc/Lua/Global.hs index 29b788f04..df300a8c6 100644 --- a/src/Text/Pandoc/Lua/Global.hs +++ b/src/Text/Pandoc/Lua/Global.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Lua Copyright : Copyright © 2017-2021 Albert Krewinkel @@ -14,19 +14,17 @@ module Text.Pandoc.Lua.Global , setGlobals ) where -import Data.Data (Data) -import Foreign.Lua (Lua, Peekable, Pushable) -import Foreign.Lua.Userdata ( ensureUserdataMetatable, pushAnyWithMetatable - , metatableName) +import HsLua as Lua import Paths_pandoc (version) import Text.Pandoc.Class.CommonState (CommonState) import Text.Pandoc.Definition (Pandoc (Pandoc), pandocTypesVersion) +import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshaling () -import Text.Pandoc.Lua.Util (addFunction) +import Text.Pandoc.Lua.Marshaling.CommonState (pushCommonState) +import Text.Pandoc.Lua.Marshaling.ReaderOptions (pushReaderOptions) import Text.Pandoc.Options (ReaderOptions) import qualified Data.Text as Text -import qualified Foreign.Lua as Lua -- | Permissible global Lua variables. data Global = @@ -40,10 +38,10 @@ data Global = -- Cannot derive instance of Data because of CommonState -- | Set all given globals. -setGlobals :: [Global] -> Lua () +setGlobals :: [Global] -> LuaE PandocError () setGlobals = mapM_ setGlobal -setGlobal :: Global -> Lua () +setGlobal :: Global -> LuaE PandocError () setGlobal global = case global of -- This could be simplified if Global was an instance of Data. FORMAT format -> do @@ -53,37 +51,24 @@ setGlobal global = case global of Lua.push pandocTypesVersion Lua.setglobal "PANDOC_API_VERSION" PANDOC_DOCUMENT doc -> do - Lua.push (LazyPandoc doc) + pushUD typePandocLazy doc Lua.setglobal "PANDOC_DOCUMENT" PANDOC_READER_OPTIONS ropts -> do - Lua.push ropts + pushReaderOptions ropts Lua.setglobal "PANDOC_READER_OPTIONS" PANDOC_SCRIPT_FILE filePath -> do Lua.push filePath Lua.setglobal "PANDOC_SCRIPT_FILE" PANDOC_STATE commonState -> do - Lua.push commonState + pushCommonState commonState Lua.setglobal "PANDOC_STATE" PANDOC_VERSION -> do Lua.push version Lua.setglobal "PANDOC_VERSION" -- | Readonly and lazy pandoc objects. -newtype LazyPandoc = LazyPandoc Pandoc - deriving (Data) - -instance Pushable LazyPandoc where - push lazyDoc = pushAnyWithMetatable pushPandocMetatable lazyDoc - where - pushPandocMetatable = ensureUserdataMetatable (metatableName lazyDoc) $ - addFunction "__index" indexLazyPandoc - -instance Peekable LazyPandoc where - peek = Lua.peekAny - -indexLazyPandoc :: LazyPandoc -> String -> Lua Lua.NumResults -indexLazyPandoc (LazyPandoc (Pandoc meta blks)) field = 1 <$ - case field of - "blocks" -> Lua.push blks - "meta" -> Lua.push meta - _ -> Lua.pushnil +typePandocLazy :: LuaError e => DocumentedType e Pandoc +typePandocLazy = deftype "Pandoc (lazy)" [] + [ readonly "meta" "document metadata" (push, \(Pandoc meta _) -> meta) + , readonly "blocks" "content blocks" (push, \(Pandoc _ blocks) -> blocks) + ] diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index 94691666c..a9c3695a4 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Lua Copyright : Copyright © 2017-2021 Albert Krewinkel @@ -13,23 +14,23 @@ module Text.Pandoc.Lua.Init ) where import Control.Monad (when) -import Control.Monad.Catch (try) +import Control.Monad.Catch (throwM, try) import Control.Monad.Trans (MonadIO (..)) import Data.Data (Data, dataTypeConstrs, dataTypeOf, showConstr) -import Foreign.Lua (Lua) +import HsLua as Lua hiding (status, try) import GHC.IO.Encoding (getForeignEncoding, setForeignEncoding, utf8) -import Text.Pandoc.Class.PandocMonad (readDataFile, PandocMonad) -import Text.Pandoc.Error (PandocError) +import Text.Pandoc.Class.PandocMonad (PandocMonad, readDataFile) +import Text.Pandoc.Error (PandocError (PandocLuaError)) import Text.Pandoc.Lua.Packages (installPandocPackageSearcher) import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, runPandocLua) -import Text.Pandoc.Lua.Util (throwTopMessageAsError') -import qualified Foreign.Lua as Lua +import qualified Data.Text as T import qualified Text.Pandoc.Definition as Pandoc import qualified Text.Pandoc.Lua.Module.Pandoc as ModulePandoc -- | Run the lua interpreter, using pandoc's default way of environment -- initialization. -runLua :: (PandocMonad m, MonadIO m) => Lua a -> m (Either PandocError a) +runLua :: (PandocMonad m, MonadIO m) + => LuaE PandocError a -> m (Either PandocError a) runLua luaOp = do enc <- liftIO $ getForeignEncoding <* setForeignEncoding utf8 res <- runPandocLua . try $ do @@ -52,9 +53,9 @@ initLuaState = do ModulePandoc.pushModule -- register as loaded module liftPandocLua $ do - Lua.pushvalue Lua.stackTop - Lua.getfield Lua.registryindex Lua.loadedTableRegistryField - Lua.setfield (Lua.nthFromTop 2) "pandoc" + Lua.pushvalue Lua.top + Lua.getfield Lua.registryindex Lua.loaded + Lua.setfield (Lua.nth 2) "pandoc" Lua.pop 1 -- copy constructors into registry putConstructorsInRegistry @@ -65,10 +66,12 @@ initLuaState = do loadInitScript scriptFile = do script <- readDataFile scriptFile status <- liftPandocLua $ Lua.dostring script - when (status /= Lua.OK) . liftPandocLua $ - throwTopMessageAsError' - (("Couldn't load '" ++ scriptFile ++ "'.\n") ++) - + when (status /= Lua.OK) . liftPandocLua $ do + err <- popException + let prefix = "Couldn't load '" <> T.pack scriptFile <> "':\n" + throwM . PandocLuaError . (prefix <>) $ case err of + PandocLuaError msg -> msg + _ -> T.pack $ show err -- | AST elements are marshaled via normal constructor functions in the -- @pandoc@ module. However, accessing Lua globals from Haskell is @@ -91,12 +94,12 @@ putConstructorsInRegistry = liftPandocLua $ do putInReg "List" -- pandoc.List putInReg "SimpleTable" -- helper for backward-compatible table handling where - constrsToReg :: Data a => a -> Lua () + constrsToReg :: Data a => a -> LuaE PandocError () constrsToReg = mapM_ (putInReg . showConstr) . dataTypeConstrs . dataTypeOf - putInReg :: String -> Lua () + putInReg :: String -> LuaE PandocError () putInReg name = do Lua.push ("pandoc." ++ name) -- name in registry Lua.push name -- in pandoc module - Lua.rawget (Lua.nthFromTop 3) + Lua.rawget (Lua.nth 3) Lua.rawset Lua.registryindex diff --git a/src/Text/Pandoc/Lua/Marshaling.hs b/src/Text/Pandoc/Lua/Marshaling.hs index f517c7c27..8fde94958 100644 --- a/src/Text/Pandoc/Lua/Marshaling.hs +++ b/src/Text/Pandoc/Lua/Marshaling.hs @@ -17,3 +17,4 @@ import Text.Pandoc.Lua.Marshaling.Context () import Text.Pandoc.Lua.Marshaling.PandocError() import Text.Pandoc.Lua.Marshaling.ReaderOptions () import Text.Pandoc.Lua.Marshaling.Version () +import Text.Pandoc.Lua.ErrorConversion () diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 8e12d232c..eedf00a94 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -1,6 +1,8 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -{-# LANGUAGE BangPatterns #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Marshaling.AST Copyright : © 2012-2021 John MacFarlane @@ -13,223 +15,254 @@ Marshaling/unmarshaling instances for document AST elements. -} module Text.Pandoc.Lua.Marshaling.AST - ( LuaAttr (..) - , LuaListAttributes (..) + ( peekAttr + , peekBlock + , peekBlocks + , peekCaption + , peekCitation + , peekInline + , peekInlines + , peekListAttributes + , peekMeta + , peekMetaValue + , peekPandoc + + , pushAttr + , pushBlock + , pushInline + , pushListAttributes + , pushMetaValue + , pushPandoc ) where -import Control.Applicative ((<|>)) -import Control.Monad ((<$!>)) -import Foreign.Lua (Lua, Peekable, Pushable, StackIndex) +import Control.Applicative ((<|>), optional) +import Control.Monad ((<$!>), (>=>)) +import HsLua hiding (Operation (Div)) import Text.Pandoc.Definition -import Text.Pandoc.Error (PandocError) -import Text.Pandoc.Lua.Util (defineHowTo, pushViaConstructor) +import Text.Pandoc.Lua.Util (pushViaConstr', pushViaConstructor) import Text.Pandoc.Lua.Marshaling.CommonState () -import qualified Control.Monad.Catch as Catch -import qualified Foreign.Lua as Lua +import qualified HsLua as Lua import qualified Text.Pandoc.Lua.Util as LuaUtil instance Pushable Pandoc where - push (Pandoc meta blocks) = - pushViaConstructor "Pandoc" blocks meta + push = pushPandoc -instance Peekable Pandoc where - peek idx = defineHowTo "get Pandoc value" $! Pandoc - <$!> LuaUtil.rawField idx "meta" - <*> LuaUtil.rawField idx "blocks" +pushPandoc :: LuaError e => Pusher e Pandoc +pushPandoc (Pandoc meta blocks) = + pushViaConstr' "Pandoc" [pushList pushBlock blocks, push meta] + +peekPandoc :: LuaError e => Peeker e Pandoc +peekPandoc = fmap (retrieving "Pandoc value") + . typeChecked "table" Lua.istable $ \idx -> do + meta <- peekFieldRaw peekMeta "meta" idx + blks <- peekFieldRaw peekBlocks "blocks" idx + return $ Pandoc meta blks instance Pushable Meta where push (Meta mmap) = - pushViaConstructor "Meta" mmap -instance Peekable Meta where - peek idx = defineHowTo "get Meta value" $! - Meta <$!> Lua.peek idx + pushViaConstr' "Meta" [push mmap] + +peekMeta :: LuaError e => Peeker e Meta +peekMeta idx = retrieving "Meta" $ + Meta <$!> peekMap peekText peekMetaValue idx instance Pushable MetaValue where push = pushMetaValue -instance Peekable MetaValue where - peek = peekMetaValue instance Pushable Block where push = pushBlock -instance Peekable Block where - peek = peekBlock - -- Inline instance Pushable Inline where push = pushInline -instance Peekable Inline where - peek = peekInline - -- Citation instance Pushable Citation where push (Citation cid prefix suffix mode noteNum hash) = - pushViaConstructor "Citation" cid mode prefix suffix noteNum hash + pushViaConstr' "Citation" + [ push cid, push mode, push prefix, push suffix, push noteNum, push hash + ] + +peekCitation :: LuaError e => Peeker e Citation +peekCitation = fmap (retrieving "Citation") + . typeChecked "table" Lua.istable $ \idx -> do + idx' <- liftLua $ absindex idx + Citation + <$!> peekFieldRaw peekText "id" idx' + <*> peekFieldRaw (peekList peekInline) "prefix" idx' + <*> peekFieldRaw (peekList peekInline) "suffix" idx' + <*> peekFieldRaw peekRead "mode" idx' + <*> peekFieldRaw peekIntegral "note_num" idx' + <*> peekFieldRaw peekIntegral "hash" idx' -instance Peekable Citation where - peek idx = Citation - <$!> LuaUtil.rawField idx "id" - <*> LuaUtil.rawField idx "prefix" - <*> LuaUtil.rawField idx "suffix" - <*> LuaUtil.rawField idx "mode" - <*> LuaUtil.rawField idx "note_num" - <*> LuaUtil.rawField idx "hash" instance Pushable Alignment where - push = Lua.push . show -instance Peekable Alignment where - peek = Lua.peekRead + push = Lua.pushString . show instance Pushable CitationMode where push = Lua.push . show -instance Peekable CitationMode where - peek = Lua.peekRead instance Pushable Format where push (Format f) = Lua.push f -instance Peekable Format where - peek idx = Format <$!> Lua.peek idx + +peekFormat :: LuaError e => Peeker e Format +peekFormat idx = Format <$!> peekText idx instance Pushable ListNumberDelim where push = Lua.push . show -instance Peekable ListNumberDelim where - peek = Lua.peekRead instance Pushable ListNumberStyle where push = Lua.push . show -instance Peekable ListNumberStyle where - peek = Lua.peekRead instance Pushable MathType where push = Lua.push . show -instance Peekable MathType where - peek = Lua.peekRead instance Pushable QuoteType where push = Lua.push . show -instance Peekable QuoteType where - peek = Lua.peekRead -- | Push an meta value element to the top of the lua stack. -pushMetaValue :: MetaValue -> Lua () +pushMetaValue :: LuaError e => MetaValue -> LuaE e () pushMetaValue = \case - MetaBlocks blcks -> pushViaConstructor "MetaBlocks" blcks + MetaBlocks blcks -> pushViaConstr' "MetaBlocks" [pushList pushBlock blcks] MetaBool bool -> Lua.push bool - MetaInlines inlns -> pushViaConstructor "MetaInlines" inlns - MetaList metalist -> pushViaConstructor "MetaList" metalist - MetaMap metamap -> pushViaConstructor "MetaMap" metamap + MetaInlines inlns -> pushViaConstr' "MetaInlines" + [pushList pushInline inlns] + MetaList metalist -> pushViaConstr' "MetaList" + [pushList pushMetaValue metalist] + MetaMap metamap -> pushViaConstr' "MetaMap" + [pushMap pushText pushMetaValue metamap] MetaString str -> Lua.push str -- | Interpret the value at the given stack index as meta value. -peekMetaValue :: StackIndex -> Lua MetaValue -peekMetaValue idx = defineHowTo "get MetaValue" $ do +peekMetaValue :: forall e. LuaError e => Peeker e MetaValue +peekMetaValue = retrieving "MetaValue $ " . \idx -> do -- Get the contents of an AST element. - let elementContent :: Peekable a => Lua a - elementContent = Lua.peek idx - luatype <- Lua.ltype idx + let mkMV :: (a -> MetaValue) -> Peeker e a -> Peek e MetaValue + mkMV f p = f <$!> p idx + + peekTagged = \case + "MetaBlocks" -> mkMV MetaBlocks $ + retrieving "MetaBlocks" . peekBlocks + "MetaBool" -> mkMV MetaBool $ + retrieving "MetaBool" . peekBool + "MetaMap" -> mkMV MetaMap $ + retrieving "MetaMap" . peekMap peekText peekMetaValue + "MetaInlines" -> mkMV MetaInlines $ + retrieving "MetaInlines" . peekInlines + "MetaList" -> mkMV MetaList $ + retrieving "MetaList" . peekList peekMetaValue + "MetaString" -> mkMV MetaString $ + retrieving "MetaString" . peekText + (Name t) -> failPeek ("Unknown meta tag: " <> t) + + peekUntagged = do + -- no meta value tag given, try to guess. + len <- liftLua $ Lua.rawlen idx + if len <= 0 + then MetaMap <$!> peekMap peekText peekMetaValue idx + else (MetaInlines <$!> peekInlines idx) + <|> (MetaBlocks <$!> peekBlocks idx) + <|> (MetaList <$!> peekList peekMetaValue idx) + luatype <- liftLua $ Lua.ltype idx case luatype of - Lua.TypeBoolean -> MetaBool <$!> Lua.peek idx - Lua.TypeString -> MetaString <$!> Lua.peek idx + Lua.TypeBoolean -> MetaBool <$!> peekBool idx + Lua.TypeString -> MetaString <$!> peekText idx Lua.TypeTable -> do - tag <- try $ LuaUtil.getTag idx - case tag of - Right "MetaBlocks" -> MetaBlocks <$!> elementContent - Right "MetaBool" -> MetaBool <$!> elementContent - Right "MetaMap" -> MetaMap <$!> elementContent - Right "MetaInlines" -> MetaInlines <$!> elementContent - Right "MetaList" -> MetaList <$!> elementContent - Right "MetaString" -> MetaString <$!> elementContent - Right t -> Lua.throwMessage ("Unknown meta tag: " <> t) - Left _ -> do - -- no meta value tag given, try to guess. - len <- Lua.rawlen idx - if len <= 0 - then MetaMap <$!> Lua.peek idx - else (MetaInlines <$!> Lua.peek idx) - <|> (MetaBlocks <$!> Lua.peek idx) - <|> (MetaList <$!> Lua.peek idx) - _ -> Lua.throwMessage "could not get meta value" + optional (LuaUtil.getTag idx) >>= \case + Just tag -> peekTagged tag + Nothing -> peekUntagged + _ -> failPeek "could not get meta value" -- | Push a block element to the top of the Lua stack. -pushBlock :: Block -> Lua () +pushBlock :: forall e. LuaError e => Block -> LuaE e () pushBlock = \case - BlockQuote blcks -> pushViaConstructor "BlockQuote" blcks - BulletList items -> pushViaConstructor "BulletList" items - CodeBlock attr code -> pushViaConstructor "CodeBlock" code (LuaAttr attr) - DefinitionList items -> pushViaConstructor "DefinitionList" items - Div attr blcks -> pushViaConstructor "Div" blcks (LuaAttr attr) - Header lvl attr inlns -> pushViaConstructor "Header" lvl inlns (LuaAttr attr) - HorizontalRule -> pushViaConstructor "HorizontalRule" - LineBlock blcks -> pushViaConstructor "LineBlock" blcks - OrderedList lstAttr list -> pushViaConstructor "OrderedList" list - (LuaListAttributes lstAttr) - Null -> pushViaConstructor "Null" - Para blcks -> pushViaConstructor "Para" blcks - Plain blcks -> pushViaConstructor "Plain" blcks - RawBlock f cs -> pushViaConstructor "RawBlock" f cs + BlockQuote blcks -> pushViaConstructor @e "BlockQuote" blcks + BulletList items -> pushViaConstructor @e "BulletList" items + CodeBlock attr code -> pushViaConstr' @e "CodeBlock" + [ push code, pushAttr attr ] + DefinitionList items -> pushViaConstructor @e "DefinitionList" items + Div attr blcks -> pushViaConstr' @e "Div" + [push blcks, pushAttr attr] + Header lvl attr inlns -> pushViaConstr' @e "Header" + [push lvl, push inlns, pushAttr attr] + HorizontalRule -> pushViaConstructor @e "HorizontalRule" + LineBlock blcks -> pushViaConstructor @e "LineBlock" blcks + OrderedList lstAttr list -> pushViaConstr' @e "OrderedList" + [ push list, pushListAttributes @e lstAttr ] + Null -> pushViaConstructor @e "Null" + Para blcks -> pushViaConstructor @e "Para" blcks + Plain blcks -> pushViaConstructor @e "Plain" blcks + RawBlock f cs -> pushViaConstructor @e "RawBlock" f cs Table attr blkCapt specs thead tbody tfoot -> - pushViaConstructor "Table" blkCapt specs thead tbody tfoot attr + pushViaConstr' @e "Table" + [ pushCaption blkCapt, push specs, push thead, push tbody + , push tfoot, pushAttr attr] -- | Return the value at the given index as block if possible. -peekBlock :: StackIndex -> Lua Block -peekBlock idx = defineHowTo "get Block value" $! do - tag <- LuaUtil.getTag idx - case tag of - "BlockQuote" -> BlockQuote <$!> elementContent - "BulletList" -> BulletList <$!> elementContent - "CodeBlock" -> withAttr CodeBlock <$!> elementContent - "DefinitionList" -> DefinitionList <$!> elementContent - "Div" -> withAttr Div <$!> elementContent - "Header" -> (\(lvl, LuaAttr attr, lst) -> Header lvl attr lst) - <$!> elementContent +peekBlock :: forall e. LuaError e => Peeker e Block +peekBlock = fmap (retrieving "Block") + . typeChecked "table" Lua.istable + $ \idx -> do + -- Get the contents of an AST element. + let mkBlock :: (a -> Block) -> Peeker e a -> Peek e Block + mkBlock f p = f <$!> peekFieldRaw p "c" idx + LuaUtil.getTag idx >>= \case + "BlockQuote" -> mkBlock BlockQuote peekBlocks + "BulletList" -> mkBlock BulletList (peekList peekBlocks) + "CodeBlock" -> mkBlock (uncurry CodeBlock) + (peekPair peekAttr peekText) + "DefinitionList" -> mkBlock DefinitionList + (peekList (peekPair peekInlines (peekList peekBlocks))) + "Div" -> mkBlock (uncurry Div) (peekPair peekAttr peekBlocks) + "Header" -> mkBlock (\(lvl, attr, lst) -> Header lvl attr lst) + (peekTriple peekIntegral peekAttr peekInlines) "HorizontalRule" -> return HorizontalRule - "LineBlock" -> LineBlock <$!> elementContent - "OrderedList" -> (\(LuaListAttributes lstAttr, lst) -> - OrderedList lstAttr lst) - <$!> elementContent + "LineBlock" -> mkBlock LineBlock (peekList peekInlines) + "OrderedList" -> mkBlock (uncurry OrderedList) + (peekPair peekListAttributes (peekList peekBlocks)) "Null" -> return Null - "Para" -> Para <$!> elementContent - "Plain" -> Plain <$!> elementContent - "RawBlock" -> uncurry RawBlock <$!> elementContent - "Table" -> (\(attr, capt, colSpecs, thead, tbodies, tfoot) -> - Table (fromLuaAttr attr) - capt - colSpecs - thead - tbodies - tfoot) - <$!> elementContent - _ -> Lua.throwMessage ("Unknown block type: " <> tag) - where - -- Get the contents of an AST element. - elementContent :: Peekable a => Lua a - elementContent = LuaUtil.rawField idx "c" - -instance Pushable Caption where - push = pushCaption - -instance Peekable Caption where - peek = peekCaption + "Para" -> mkBlock Para peekInlines + "Plain" -> mkBlock Plain peekInlines + "RawBlock" -> mkBlock (uncurry RawBlock) + (peekPair peekFormat peekText) + "Table" -> mkBlock id + (retrieving "Table" . (liftLua . absindex >=> (\idx' -> cleanup $ do + attr <- liftLua (rawgeti idx' 1) *> peekAttr top + capt <- liftLua (rawgeti idx' 2) *> peekCaption top + cs <- liftLua (rawgeti idx' 3) *> peekList peekColSpec top + thead <- liftLua (rawgeti idx' 4) *> peekTableHead top + tbods <- liftLua (rawgeti idx' 5) *> peekList peekTableBody top + tfoot <- liftLua (rawgeti idx' 6) *> peekTableFoot top + return $! Table attr capt cs thead tbods tfoot))) + Name tag -> failPeek ("Unknown block type: " <> tag) + +peekBlocks :: LuaError e => Peeker e [Block] +peekBlocks = peekList peekBlock + +peekInlines :: LuaError e => Peeker e [Inline] +peekInlines = peekList peekInline -- | Push Caption element -pushCaption :: Caption -> Lua () +pushCaption :: LuaError e => Caption -> LuaE e () pushCaption (Caption shortCaption longCaption) = do Lua.newtable LuaUtil.addField "short" (Lua.Optional shortCaption) LuaUtil.addField "long" longCaption -- | Peek Caption element -peekCaption :: StackIndex -> Lua Caption -peekCaption idx = Caption - <$!> (Lua.fromOptional <$!> LuaUtil.rawField idx "short") - <*> LuaUtil.rawField idx "long" +peekCaption :: LuaError e => Peeker e Caption +peekCaption = retrieving "Caption" . \idx -> do + short <- optional $ peekFieldRaw peekInlines "short" idx + long <- peekFieldRaw peekBlocks "long" idx + return $! Caption short long -instance Peekable ColWidth where - peek idx = do - width <- Lua.fromOptional <$!> Lua.peek idx - return $! maybe ColWidthDefault ColWidth width +peekColWidth :: LuaError e => Peeker e ColWidth +peekColWidth = retrieving "ColWidth" . \idx -> do + maybe ColWidthDefault ColWidth <$!> optional (peekRealFloat idx) + +peekColSpec :: LuaError e => Peeker e ColSpec +peekColSpec = peekPair peekRead peekColWidth instance Pushable ColWidth where push = \case @@ -240,7 +273,12 @@ instance Pushable Row where push (Row attr cells) = Lua.push (attr, cells) instance Peekable Row where - peek = fmap (uncurry Row) . Lua.peek + peek = forcePeek . peekRow + +peekRow :: LuaError e => Peeker e Row +peekRow = ((uncurry Row) <$!>) + . retrieving "Row" + . peekPair peekAttr (peekList peekCell) instance Pushable TableBody where push (TableBody attr (RowHeadColumns rowHeadColumns) head' body) = do @@ -250,32 +288,38 @@ instance Pushable TableBody where LuaUtil.addField "head" head' LuaUtil.addField "body" body -instance Peekable TableBody where - peek idx = TableBody - <$!> LuaUtil.rawField idx "attr" - <*> (RowHeadColumns <$!> LuaUtil.rawField idx "row_head_columns") - <*> LuaUtil.rawField idx "head" - <*> LuaUtil.rawField idx "body" +peekTableBody :: LuaError e => Peeker e TableBody +peekTableBody = fmap (retrieving "TableBody") + . typeChecked "table" Lua.istable + $ \idx -> TableBody + <$!> peekFieldRaw peekAttr "attr" idx + <*> peekFieldRaw ((fmap RowHeadColumns) . peekIntegral) "row_head_columns" idx + <*> peekFieldRaw (peekList peekRow) "head" idx + <*> peekFieldRaw (peekList peekRow) "body" idx instance Pushable TableHead where push (TableHead attr rows) = Lua.push (attr, rows) -instance Peekable TableHead where - peek = fmap (uncurry TableHead) . Lua.peek +peekTableHead :: LuaError e => Peeker e TableHead +peekTableHead = ((uncurry TableHead) <$!>) + . retrieving "TableHead" + . peekPair peekAttr (peekList peekRow) instance Pushable TableFoot where push (TableFoot attr cells) = Lua.push (attr, cells) -instance Peekable TableFoot where - peek = fmap (uncurry TableFoot) . Lua.peek +peekTableFoot :: LuaError e => Peeker e TableFoot +peekTableFoot = ((uncurry TableFoot) <$!>) + . retrieving "TableFoot" + . peekPair peekAttr (peekList peekRow) instance Pushable Cell where push = pushCell instance Peekable Cell where - peek = peekCell + peek = forcePeek . peekCell -pushCell :: Cell -> Lua () +pushCell :: LuaError e => Cell -> LuaE e () pushCell (Cell attr align (RowSpan rowSpan) (ColSpan colSpan) contents) = do Lua.newtable LuaUtil.addField "attr" attr @@ -284,95 +328,112 @@ pushCell (Cell attr align (RowSpan rowSpan) (ColSpan colSpan) contents) = do LuaUtil.addField "col_span" colSpan LuaUtil.addField "contents" contents -peekCell :: StackIndex -> Lua Cell -peekCell idx = Cell - <$!> (fromLuaAttr <$!> LuaUtil.rawField idx "attr") - <*> LuaUtil.rawField idx "alignment" - <*> (RowSpan <$!> LuaUtil.rawField idx "row_span") - <*> (ColSpan <$!> LuaUtil.rawField idx "col_span") - <*> LuaUtil.rawField idx "contents" +peekCell :: LuaError e => Peeker e Cell +peekCell = fmap (retrieving "Cell") + . typeChecked "table" Lua.istable + $ \idx -> do + attr <- peekFieldRaw peekAttr "attr" idx + algn <- peekFieldRaw peekRead "alignment" idx + rs <- RowSpan <$!> peekFieldRaw peekIntegral "row_span" idx + cs <- ColSpan <$!> peekFieldRaw peekIntegral "col_span" idx + blks <- peekFieldRaw peekBlocks "contents" idx + return $! Cell attr algn rs cs blks -- | Push an inline element to the top of the lua stack. -pushInline :: Inline -> Lua () +pushInline :: forall e. LuaError e => Inline -> LuaE e () pushInline = \case - Cite citations lst -> pushViaConstructor "Cite" lst citations - Code attr lst -> pushViaConstructor "Code" lst (LuaAttr attr) - Emph inlns -> pushViaConstructor "Emph" inlns - Underline inlns -> pushViaConstructor "Underline" inlns - Image attr alt (src,tit) -> pushViaConstructor "Image" alt src tit (LuaAttr attr) - LineBreak -> pushViaConstructor "LineBreak" - Link attr lst (src,tit) -> pushViaConstructor "Link" lst src tit (LuaAttr attr) - Note blcks -> pushViaConstructor "Note" blcks - Math mty str -> pushViaConstructor "Math" mty str - Quoted qt inlns -> pushViaConstructor "Quoted" qt inlns - RawInline f cs -> pushViaConstructor "RawInline" f cs - SmallCaps inlns -> pushViaConstructor "SmallCaps" inlns - SoftBreak -> pushViaConstructor "SoftBreak" - Space -> pushViaConstructor "Space" - Span attr inlns -> pushViaConstructor "Span" inlns (LuaAttr attr) - Str str -> pushViaConstructor "Str" str - Strikeout inlns -> pushViaConstructor "Strikeout" inlns - Strong inlns -> pushViaConstructor "Strong" inlns - Subscript inlns -> pushViaConstructor "Subscript" inlns - Superscript inlns -> pushViaConstructor "Superscript" inlns + Cite citations lst -> pushViaConstructor @e "Cite" lst citations + Code attr lst -> pushViaConstr' @e "Code" + [push lst, pushAttr attr] + Emph inlns -> pushViaConstructor @e "Emph" inlns + Underline inlns -> pushViaConstructor @e "Underline" inlns + Image attr alt (src,tit) -> pushViaConstr' @e "Image" + [push alt, push src, push tit, pushAttr attr] + LineBreak -> pushViaConstructor @e "LineBreak" + Link attr lst (src,tit) -> pushViaConstr' @e "Link" + [push lst, push src, push tit, pushAttr attr] + Note blcks -> pushViaConstructor @e "Note" blcks + Math mty str -> pushViaConstructor @e "Math" mty str + Quoted qt inlns -> pushViaConstructor @e "Quoted" qt inlns + RawInline f cs -> pushViaConstructor @e "RawInline" f cs + SmallCaps inlns -> pushViaConstructor @e "SmallCaps" inlns + SoftBreak -> pushViaConstructor @e "SoftBreak" + Space -> pushViaConstructor @e "Space" + Span attr inlns -> pushViaConstr' @e "Span" + [push inlns, pushAttr attr] + Str str -> pushViaConstructor @e "Str" str + Strikeout inlns -> pushViaConstructor @e "Strikeout" inlns + Strong inlns -> pushViaConstructor @e "Strong" inlns + Subscript inlns -> pushViaConstructor @e "Subscript" inlns + Superscript inlns -> pushViaConstructor @e "Superscript" inlns -- | Return the value at the given index as inline if possible. -peekInline :: StackIndex -> Lua Inline -peekInline idx = defineHowTo "get Inline value" $ do - tag <- LuaUtil.getTag idx - case tag of - "Cite" -> uncurry Cite <$!> elementContent - "Code" -> withAttr Code <$!> elementContent - "Emph" -> Emph <$!> elementContent - "Underline" -> Underline <$!> elementContent - "Image" -> (\(LuaAttr !attr, !lst, !tgt) -> Image attr lst tgt) - <$!> elementContent - "Link" -> (\(LuaAttr !attr, !lst, !tgt) -> Link attr lst tgt) - <$!> elementContent +peekInline :: forall e. LuaError e => Peeker e Inline +peekInline = retrieving "Inline" . \idx -> do + -- Get the contents of an AST element. + let mkBlock :: (a -> Inline) -> Peeker e a -> Peek e Inline + mkBlock f p = f <$!> peekFieldRaw p "c" idx + LuaUtil.getTag idx >>= \case + "Cite" -> mkBlock (uncurry Cite) $ + peekPair (peekList peekCitation) peekInlines + "Code" -> mkBlock (uncurry Code) (peekPair peekAttr peekText) + "Emph" -> mkBlock Emph peekInlines + "Underline" -> mkBlock Underline peekInlines + "Image" -> mkBlock (\(attr, lst, tgt) -> Image attr lst tgt) + $ peekTriple peekAttr peekInlines + (peekPair peekText peekText) + "Link" -> mkBlock (\(attr, lst, tgt) -> Link attr lst tgt) $ + peekTriple peekAttr peekInlines (peekPair peekText peekText) "LineBreak" -> return LineBreak - "Note" -> Note <$!> elementContent - "Math" -> uncurry Math <$!> elementContent - "Quoted" -> uncurry Quoted <$!> elementContent - "RawInline" -> uncurry RawInline <$!> elementContent - "SmallCaps" -> SmallCaps <$!> elementContent + "Note" -> mkBlock Note peekBlocks + "Math" -> mkBlock (uncurry Math) (peekPair peekRead peekText) + "Quoted" -> mkBlock (uncurry Quoted) (peekPair peekRead peekInlines) + "RawInline" -> mkBlock (uncurry RawInline) (peekPair peekFormat peekText) + "SmallCaps" -> mkBlock SmallCaps peekInlines "SoftBreak" -> return SoftBreak "Space" -> return Space - "Span" -> withAttr Span <$!> elementContent - -- strict to Lua string is copied before gc - "Str" -> Str <$!> elementContent - "Strikeout" -> Strikeout <$!> elementContent - "Strong" -> Strong <$!> elementContent - "Subscript" -> Subscript <$!> elementContent - "Superscript"-> Superscript <$!> elementContent - _ -> Lua.throwMessage ("Unknown inline type: " <> tag) - where - -- Get the contents of an AST element. - elementContent :: Peekable a => Lua a - elementContent = LuaUtil.rawField idx "c" - -try :: Lua a -> Lua (Either PandocError a) -try = Catch.try - -withAttr :: (Attr -> a -> b) -> (LuaAttr, a) -> b -withAttr f (attributes, x) = f (fromLuaAttr attributes) x - --- | Wrapper for Attr -newtype LuaAttr = LuaAttr { fromLuaAttr :: Attr } - -instance Pushable LuaAttr where - push (LuaAttr (id', classes, kv)) = - pushViaConstructor "Attr" id' classes kv - -instance Peekable LuaAttr where - peek idx = defineHowTo "get Attr value" $! (LuaAttr <$!> Lua.peek idx) - --- | Wrapper for ListAttributes -newtype LuaListAttributes = LuaListAttributes ListAttributes - -instance Pushable LuaListAttributes where - push (LuaListAttributes (start, style, delimiter)) = - pushViaConstructor "ListAttributes" start style delimiter - -instance Peekable LuaListAttributes where - peek = defineHowTo "get ListAttributes value" . - fmap LuaListAttributes . Lua.peek + "Span" -> mkBlock (uncurry Span) (peekPair peekAttr peekInlines) + "Str" -> mkBlock Str peekText + "Strikeout" -> mkBlock Strikeout peekInlines + "Strong" -> mkBlock Strong peekInlines + "Subscript" -> mkBlock Subscript peekInlines + "Superscript"-> mkBlock Superscript peekInlines + Name tag -> Lua.failPeek ("Unknown inline type: " <> tag) + +pushAttr :: forall e. LuaError e => Attr -> LuaE e () +pushAttr (id', classes, kv) = pushViaConstr' @e "Attr" + [ pushText id' + , pushList pushText classes + , pushList (pushPair pushText pushText) kv + ] + +peekAttr :: LuaError e => Peeker e Attr +peekAttr = retrieving "Attr" . peekTriple + peekText + (peekList peekText) + (peekList (peekPair peekText peekText)) + +pushListAttributes :: forall e. LuaError e => ListAttributes -> LuaE e () +pushListAttributes (start, style, delimiter) = + pushViaConstr' "ListAttributes" + [ push start, push style, push delimiter ] + +peekListAttributes :: LuaError e => Peeker e ListAttributes +peekListAttributes = retrieving "ListAttributes" . peekTriple + peekIntegral + peekRead + peekRead + +-- These instances exist only for testing. It's a hack to avoid making +-- the marshalling modules public. +instance Peekable Inline where + peek = forcePeek . peekInline + +instance Peekable Block where + peek = forcePeek . peekBlock + +instance Peekable Meta where + peek = forcePeek . peekMeta + +instance Peekable Pandoc where + peek = forcePeek . peekPandoc diff --git a/src/Text/Pandoc/Lua/Marshaling/AnyValue.hs b/src/Text/Pandoc/Lua/Marshaling/AnyValue.hs deleted file mode 100644 index 82e26b963..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/AnyValue.hs +++ /dev/null @@ -1,24 +0,0 @@ -{- | - Module : Text.Pandoc.Lua.Marshaling.AnyValue - Copyright : © 2017-2021 Albert Krewinkel - License : GNU GPL, version 2 or above - - Maintainer : Albert Krewinkel - Stability : alpha - -Helper type to work with raw Lua stack indices instead of unmarshaled -values. - -TODO: Most of this module should be abstracted, factored out, and go -into HsLua. --} -module Text.Pandoc.Lua.Marshaling.AnyValue (AnyValue (..)) where - -import Foreign.Lua (Peekable (peek), StackIndex) - --- | Dummy type to allow values of arbitrary Lua type. This just wraps --- stack indices, using it requires extra care. -newtype AnyValue = AnyValue StackIndex - -instance Peekable AnyValue where - peek = return . AnyValue diff --git a/src/Text/Pandoc/Lua/Marshaling/CommonState.hs b/src/Text/Pandoc/Lua/Marshaling/CommonState.hs index 147197c5d..857551598 100644 --- a/src/Text/Pandoc/Lua/Marshaling/CommonState.hs +++ b/src/Text/Pandoc/Lua/Marshaling/CommonState.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-orphans #-} -{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Lua.Marshaling.CommonState @@ -11,92 +9,62 @@ Instances to marshal (push) and unmarshal (peek) the common state. -} -module Text.Pandoc.Lua.Marshaling.CommonState () where +module Text.Pandoc.Lua.Marshaling.CommonState + ( typeCommonState + , peekCommonState + , pushCommonState + ) where -import Foreign.Lua (Lua, Peekable, Pushable) -import Foreign.Lua.Types.Peekable (reportValueOnFailure) -import Foreign.Lua.Userdata (ensureUserdataMetatable, pushAnyWithMetatable, - toAnyWithName) +import HsLua.Core +import HsLua.Marshalling +import HsLua.Packaging import Text.Pandoc.Class (CommonState (..)) import Text.Pandoc.Logging (LogMessage, showLogMessage) -import Text.Pandoc.Lua.Marshaling.AnyValue (AnyValue (..)) +import Text.Pandoc.Lua.Marshaling.List (pushPandocList) -import qualified Data.Map as Map -import qualified Data.Text as Text -import qualified Foreign.Lua as Lua -import qualified Text.Pandoc.Lua.Util as LuaUtil +-- | Lua type used for the @CommonState@ object. +typeCommonState :: LuaError e => DocumentedType e CommonState +typeCommonState = deftype "pandoc CommonState" [] + [ readonly "input_files" "input files passed to pandoc" + (pushPandocList pushString, stInputFiles) --- | Name used by Lua for the @CommonState@ type. -commonStateTypeName :: String -commonStateTypeName = "Pandoc CommonState" + , readonly "output_file" "the file to which pandoc will write" + (maybe pushnil pushString, stOutputFile) -instance Peekable CommonState where - peek idx = reportValueOnFailure commonStateTypeName - (`toAnyWithName` commonStateTypeName) idx + , readonly "log" "list of log messages" + (pushPandocList (pushUD typeLogMessage), stLog) -instance Pushable CommonState where - push st = pushAnyWithMetatable pushCommonStateMetatable st - where - pushCommonStateMetatable = ensureUserdataMetatable commonStateTypeName $ do - LuaUtil.addFunction "__index" indexCommonState - LuaUtil.addFunction "__pairs" pairsCommonState + , readonly "request_headers" "headers to add for HTTP requests" + (pushPandocList (pushPair pushText pushText), stRequestHeaders) -indexCommonState :: CommonState -> AnyValue -> Lua Lua.NumResults -indexCommonState st (AnyValue idx) = Lua.ltype idx >>= \case - Lua.TypeString -> 1 <$ (Lua.peek idx >>= pushField) - _ -> 1 <$ Lua.pushnil - where - pushField :: Text.Text -> Lua () - pushField name = case lookup name commonStateFields of - Just pushValue -> pushValue st - Nothing -> Lua.pushnil + , readonly "resource_path" + "path to search for resources like included images" + (pushPandocList pushString, stResourcePath) -pairsCommonState :: CommonState -> Lua Lua.NumResults -pairsCommonState st = do - Lua.pushHaskellFunction nextFn - Lua.pushnil - Lua.pushnil - return 3 - where - nextFn :: AnyValue -> AnyValue -> Lua Lua.NumResults - nextFn _ (AnyValue idx) = - Lua.ltype idx >>= \case - Lua.TypeNil -> case commonStateFields of - [] -> 2 <$ (Lua.pushnil *> Lua.pushnil) - (key, pushValue):_ -> 2 <$ (Lua.push key *> pushValue st) - Lua.TypeString -> do - key <- Lua.peek idx - case tail $ dropWhile ((/= key) . fst) commonStateFields of - [] -> 2 <$ (Lua.pushnil *> Lua.pushnil) - (nextKey, pushValue):_ -> 2 <$ (Lua.push nextKey *> pushValue st) - _ -> 2 <$ (Lua.pushnil *> Lua.pushnil) + , readonly "source_url" "absolute URL + dir of 1st source file" + (maybe pushnil pushText, stSourceURL) -commonStateFields :: [(Text.Text, CommonState -> Lua ())] -commonStateFields = - [ ("input_files", Lua.push . stInputFiles) - , ("output_file", Lua.push . Lua.Optional . stOutputFile) - , ("log", Lua.push . stLog) - , ("request_headers", Lua.push . Map.fromList . stRequestHeaders) - , ("resource_path", Lua.push . stResourcePath) - , ("source_url", Lua.push . Lua.Optional . stSourceURL) - , ("user_data_dir", Lua.push . Lua.Optional . stUserDataDir) - , ("trace", Lua.push . stTrace) - , ("verbosity", Lua.push . show . stVerbosity) - ] + , readonly "user_data_dir" "directory to search for data files" + (maybe pushnil pushString, stUserDataDir) + + , readonly "trace" "controls whether tracing messages are issued" + (pushBool, stTrace) --- | Name used by Lua for the @CommonState@ type. -logMessageTypeName :: String -logMessageTypeName = "Pandoc LogMessage" + , readonly "verbosity" "verbosity level" + (pushString . show, stVerbosity) + ] -instance Peekable LogMessage where - peek idx = reportValueOnFailure logMessageTypeName - (`toAnyWithName` logMessageTypeName) idx +peekCommonState :: LuaError e => Peeker e CommonState +peekCommonState = peekUD typeCommonState -instance Pushable LogMessage where - push msg = pushAnyWithMetatable pushLogMessageMetatable msg - where - pushLogMessageMetatable = ensureUserdataMetatable logMessageTypeName $ - LuaUtil.addFunction "__tostring" tostringLogMessage +pushCommonState :: LuaError e => Pusher e CommonState +pushCommonState = pushUD typeCommonState -tostringLogMessage :: LogMessage -> Lua Text.Text -tostringLogMessage = return . showLogMessage +typeLogMessage :: LuaError e => DocumentedType e LogMessage +typeLogMessage = deftype "pandoc LogMessage" + [ operation Index $ defun "__tostring" + ### liftPure showLogMessage + <#> udparam typeLogMessage "msg" "object" + =#> functionResult pushText "string" "stringified log message" + ] + mempty -- no members diff --git a/src/Text/Pandoc/Lua/Marshaling/Context.hs b/src/Text/Pandoc/Lua/Marshaling/Context.hs index 606bdcfb2..8ee25565e 100644 --- a/src/Text/Pandoc/Lua/Marshaling/Context.hs +++ b/src/Text/Pandoc/Lua/Marshaling/Context.hs @@ -12,8 +12,8 @@ Marshaling instance for doctemplates Context and its components. -} module Text.Pandoc.Lua.Marshaling.Context () where -import qualified Foreign.Lua as Lua -import Foreign.Lua (Pushable) +import qualified HsLua as Lua +import HsLua (Pushable) import Text.DocTemplates (Context(..), Val(..), TemplateTarget) import Text.DocLayout (render) diff --git a/src/Text/Pandoc/Lua/Marshaling/List.hs b/src/Text/Pandoc/Lua/Marshaling/List.hs index 0446302a1..57ccd4501 100644 --- a/src/Text/Pandoc/Lua/Marshaling/List.hs +++ b/src/Text/Pandoc/Lua/Marshaling/List.hs @@ -1,7 +1,8 @@ -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE UndecidableInstances #-} {- | Module : Text.Pandoc.Lua.Marshaling.List Copyright : © 2012-2021 John MacFarlane @@ -14,27 +15,30 @@ Marshaling/unmarshaling instances for @pandoc.List@s. -} module Text.Pandoc.Lua.Marshaling.List ( List (..) + , peekList' + , pushPandocList ) where +import Control.Monad ((<$!>)) import Data.Data (Data) -import Foreign.Lua (Peekable, Pushable) +import HsLua (LuaError, Peeker, Pusher, Pushable (push), peekList, pushList) import Text.Pandoc.Walk (Walkable (..)) -import Text.Pandoc.Lua.Util (defineHowTo, pushViaConstructor) - -import qualified Foreign.Lua as Lua +import Text.Pandoc.Lua.Util (pushViaConstr') -- | List wrapper which is marshalled as @pandoc.List@. newtype List a = List { fromList :: [a] } deriving (Data, Eq, Show) instance Pushable a => Pushable (List a) where - push (List xs) = - pushViaConstructor "List" xs + push (List xs) = pushPandocList push xs + +-- | Pushes a list as a numerical Lua table, setting a metatable that offers a +-- number of convenience functions. +pushPandocList :: LuaError e => Pusher e a -> Pusher e [a] +pushPandocList pushItem xs = pushViaConstr' "List" [pushList pushItem xs] -instance Peekable a => Peekable (List a) where - peek idx = defineHowTo "get List" $ do - xs <- Lua.peek idx - return $ List xs +peekList' :: LuaError e => Peeker e a -> Peeker e (List a) +peekList' p = (List <$!>) . peekList p -- List is just a wrapper, so we can reuse the walk instance for -- unwrapped Hasekll lists. diff --git a/src/Text/Pandoc/Lua/Marshaling/MediaBag.hs b/src/Text/Pandoc/Lua/Marshaling/MediaBag.hs deleted file mode 100644 index 70bd010a0..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/MediaBag.hs +++ /dev/null @@ -1,73 +0,0 @@ -{- | - Module : Text.Pandoc.Lua.Marshaling.MediaBag - Copyright : © 2012-2021 John MacFarlane - © 2017-2021 Albert Krewinkel - License : GNU GPL, version 2 or above - Maintainer : Albert Krewinkel - Stability : alpha - -Instances to marshal (push) and unmarshal (peek) media data. --} -module Text.Pandoc.Lua.Marshaling.MediaBag (pushIterator) where - -import Foreign.Ptr (Ptr) -import Foreign.StablePtr (StablePtr, deRefStablePtr, newStablePtr) -import Foreign.Lua (Lua, NumResults, Peekable, Pushable, StackIndex) -import Foreign.Lua.Types.Peekable (reportValueOnFailure) -import Foreign.Lua.Userdata (ensureUserdataMetatable, pushAnyWithMetatable, - toAnyWithName) -import Text.Pandoc.MediaBag (MediaBag, mediaItems) -import Text.Pandoc.MIME (MimeType) -import Text.Pandoc.Lua.Marshaling.AnyValue (AnyValue (..)) - -import qualified Data.ByteString.Lazy as BL -import qualified Foreign.Lua as Lua -import qualified Foreign.Storable as Storable - --- | A list of 'MediaBag' items. -newtype MediaItems = MediaItems [(String, MimeType, BL.ByteString)] - -instance Pushable MediaItems where - push = pushMediaItems - -instance Peekable MediaItems where - peek = peekMediaItems - --- | Push an iterator triple to be used with Lua's @for@ loop construct. --- Each iterator invocation returns a triple containing the item's --- filename, MIME type, and content. -pushIterator :: MediaBag -> Lua NumResults -pushIterator mb = do - Lua.pushHaskellFunction nextItem - Lua.push (MediaItems $ mediaItems mb) - Lua.pushnil - return 3 - --- | Lua type name for @'MediaItems'@. -mediaItemsTypeName :: String -mediaItemsTypeName = "pandoc MediaItems" - --- | Push a @MediaItems@ element to the stack. -pushMediaItems :: MediaItems -> Lua () -pushMediaItems xs = pushAnyWithMetatable pushMT xs - where - pushMT = ensureUserdataMetatable mediaItemsTypeName (return ()) - --- | Retrieve a @MediaItems@ element from the stack. -peekMediaItems :: StackIndex -> Lua MediaItems -peekMediaItems = reportValueOnFailure mediaItemsTypeName - (`toAnyWithName` mediaItemsTypeName) - --- | Retrieve a list of items from an iterator state, return the first --- item (if present), and advance the state. -nextItem :: Ptr (StablePtr MediaItems) -> AnyValue -> Lua NumResults -nextItem ptr _ = do - (MediaItems items) <- Lua.liftIO $ deRefStablePtr =<< Storable.peek ptr - case items of - [] -> 2 <$ (Lua.pushnil *> Lua.pushnil) - (key, mt, content):xs -> do - Lua.liftIO $ Storable.poke ptr =<< newStablePtr (MediaItems xs) - Lua.push key - Lua.push mt - Lua.push content - return 3 diff --git a/src/Text/Pandoc/Lua/Marshaling/PandocError.hs b/src/Text/Pandoc/Lua/Marshaling/PandocError.hs index f698704e0..6f29a5c89 100644 --- a/src/Text/Pandoc/Lua/Marshaling/PandocError.hs +++ b/src/Text/Pandoc/Lua/Marshaling/PandocError.hs @@ -1,7 +1,7 @@ -{-# OPTIONS_GHC -fno-warn-orphans #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Marshaling.PandocError Copyright : © 2020-2021 Albert Krewinkel @@ -15,51 +15,37 @@ Marshaling of @'PandocError'@ values. module Text.Pandoc.Lua.Marshaling.PandocError ( peekPandocError , pushPandocError + , typePandocError ) where -import Foreign.Lua (Lua, Peekable, Pushable, StackIndex) +import HsLua.Core (LuaError) +import HsLua.Marshalling (Peeker, Pusher, pushString, liftLua) +import HsLua.Packaging import Text.Pandoc.Error (PandocError (PandocLuaError)) -import qualified Foreign.Lua as Lua -import qualified Foreign.Lua.Userdata as Lua -import qualified Text.Pandoc.Lua.Util as LuaUtil +import qualified HsLua as Lua import qualified Text.Pandoc.UTF8 as UTF8 --- | Userdata name used by Lua for the @PandocError@ type. -pandocErrorName :: String -pandocErrorName = "pandoc error" +-- | Lua userdata type definition for PandocError. +typePandocError :: LuaError e => DocumentedType e PandocError +typePandocError = deftype "PandocError" + [ operation Tostring $ defun "__tostring" + ### liftPure (show @PandocError) + <#> udparam typePandocError "obj" "PandocError object" + =#> functionResult pushString "string" "string representation of error." + ] + mempty -- no members -- | Peek a @'PandocError'@ element to the Lua stack. -pushPandocError :: PandocError -> Lua () -pushPandocError = Lua.pushAnyWithMetatable pushPandocErrorMT - where - pushPandocErrorMT = Lua.ensureUserdataMetatable pandocErrorName $ - LuaUtil.addFunction "__tostring" __tostring +pushPandocError :: LuaError e => Pusher e PandocError +pushPandocError = pushUD typePandocError -- | Retrieve a @'PandocError'@ from the Lua stack. -peekPandocError :: StackIndex -> Lua PandocError -peekPandocError idx = Lua.ltype idx >>= \case - Lua.TypeUserdata -> do - errMb <- Lua.toAnyWithName idx pandocErrorName - return $ case errMb of - Just err -> err - Nothing -> PandocLuaError "could not retrieve original error" - _ -> do - Lua.pushvalue idx - msg <- Lua.state >>= \l -> Lua.liftIO (Lua.errorMessage l) - return $ PandocLuaError (UTF8.toText msg) - --- | Convert to string. -__tostring :: PandocError -> Lua String -__tostring = return . show - --- --- Instances --- - -instance Pushable PandocError where - push = pushPandocError - -instance Peekable PandocError where - peek = peekPandocError +peekPandocError :: LuaError e => Peeker e PandocError +peekPandocError idx = Lua.retrieving "PandocError" $ + liftLua (Lua.ltype idx) >>= \case + Lua.TypeUserdata -> peekUD typePandocError idx + _ -> do + msg <- liftLua $ Lua.state >>= \l -> Lua.liftIO (Lua.popErrorMessage l) + return $ PandocLuaError (UTF8.toText msg) diff --git a/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs b/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs index dd7bf2e61..2cc39ee3a 100644 --- a/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs +++ b/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-} @@ -13,67 +12,60 @@ Marshaling instance for ReaderOptions and its components. -} -module Text.Pandoc.Lua.Marshaling.ReaderOptions () where +module Text.Pandoc.Lua.Marshaling.ReaderOptions + ( peekReaderOptions + , pushReaderOptions + ) where -import Data.Data (showConstr, toConstr) -import Foreign.Lua (Lua, Pushable) -import Text.Pandoc.Extensions (Extensions) -import Text.Pandoc.Lua.Marshaling.AnyValue (AnyValue (..)) -import Text.Pandoc.Lua.Marshaling.CommonState () -import Text.Pandoc.Options (ReaderOptions (..), TrackChanges) - -import qualified Data.Set as Set -import qualified Data.Text as Text -import qualified Foreign.Lua as Lua -import qualified Text.Pandoc.Lua.Util as LuaUtil +import HsLua as Lua +import Text.Pandoc.Lua.Marshaling.List (pushPandocList) +import Text.Pandoc.Options (ReaderOptions (..)) -- -- Reader Options -- -instance Pushable Extensions where - push exts = Lua.push (show exts) -instance Pushable TrackChanges where - push = Lua.push . showConstr . toConstr +peekReaderOptions :: LuaError e => Peeker e ReaderOptions +peekReaderOptions = peekUD typeReaderOptions + +pushReaderOptions :: LuaError e => Pusher e ReaderOptions +pushReaderOptions = pushUD typeReaderOptions -instance Pushable ReaderOptions where - push ro = do - let ReaderOptions - (extensions :: Extensions) - (standalone :: Bool) - (columns :: Int) - (tabStop :: Int) - (indentedCodeClasses :: [Text.Text]) - (abbreviations :: Set.Set Text.Text) - (defaultImageExtension :: Text.Text) - (trackChanges :: TrackChanges) - (stripComments :: Bool) - = ro - Lua.newtable - LuaUtil.addField "extensions" extensions - LuaUtil.addField "standalone" standalone - LuaUtil.addField "columns" columns - LuaUtil.addField "tab_stop" tabStop - LuaUtil.addField "indented_code_classes" indentedCodeClasses - LuaUtil.addField "abbreviations" abbreviations - LuaUtil.addField "default_image_extension" defaultImageExtension - LuaUtil.addField "track_changes" trackChanges - LuaUtil.addField "strip_comments" stripComments +typeReaderOptions :: LuaError e => DocumentedType e ReaderOptions +typeReaderOptions = deftype "pandoc ReaderOptions" + [ operation Tostring luaShow + ] + [ readonly "extensions" "" + ( pushString . show + , readerExtensions) + , readonly "standalone" "" + ( pushBool + , readerStandalone) + , readonly "columns" "" + ( pushIntegral + , readerColumns) + , readonly "tab_stop" "" + ( pushIntegral + , readerTabStop) + , readonly "indented_code_classes" "" + ( pushPandocList pushText + , readerIndentedCodeClasses) + , readonly "abbreviations" "" + ( pushSet pushText + , readerAbbreviations) + , readonly "track_changes" "" + ( pushString . show + , readerTrackChanges) + , readonly "strip_comments" "" + ( pushBool + , readerStripComments) + , readonly "default_image_extension" "" + ( pushText + , readerDefaultImageExtension) + ] - -- add metatable - let indexReaderOptions :: AnyValue -> AnyValue -> Lua Lua.NumResults - indexReaderOptions _tbl (AnyValue key) = do - Lua.ltype key >>= \case - Lua.TypeString -> Lua.peek key >>= \case - ("defaultImageExtension" :: Text.Text) - -> Lua.push defaultImageExtension - "indentedCodeClasses" -> Lua.push indentedCodeClasses - "stripComments" -> Lua.push stripComments - "tabStop" -> Lua.push tabStop - "trackChanges" -> Lua.push trackChanges - _ -> Lua.pushnil - _ -> Lua.pushnil - return 1 - Lua.newtable - LuaUtil.addFunction "__index" indexReaderOptions - Lua.setmetatable (Lua.nthFromTop 2) +luaShow :: LuaError e => DocumentedFunction e +luaShow = defun "__tostring" + ### liftPure show + <#> udparam typeReaderOptions "state" "object to print in native format" + =#> functionResult pushString "string" "Haskell representation" diff --git a/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs b/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs index 6d43039fa..e9c169dc0 100644 --- a/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs +++ b/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs @@ -1,3 +1,6 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Marshaling.SimpleTable Copyright : © 2020-2021 Albert Krewinkel @@ -16,12 +19,11 @@ module Text.Pandoc.Lua.Marshaling.SimpleTable ) where -import Foreign.Lua (Lua, Peekable, Pushable, StackIndex) +import Control.Monad ((<$!>)) +import HsLua as Lua import Text.Pandoc.Definition -import Text.Pandoc.Lua.Util (defineHowTo, pushViaConstructor, rawField) -import Text.Pandoc.Lua.Marshaling.AST () - -import qualified Foreign.Lua as Lua +import Text.Pandoc.Lua.Util (pushViaConstructor) +import Text.Pandoc.Lua.Marshaling.AST -- | A simple (legacy-style) table. data SimpleTable = SimpleTable @@ -32,16 +34,10 @@ data SimpleTable = SimpleTable , simpleTableBody :: [[[Block]]] } -instance Pushable SimpleTable where - push = pushSimpleTable - -instance Peekable SimpleTable where - peek = peekSimpleTable - -- | Push a simple table to the stack by calling the -- @pandoc.SimpleTable@ constructor. -pushSimpleTable :: SimpleTable -> Lua () -pushSimpleTable tbl = pushViaConstructor "SimpleTable" +pushSimpleTable :: forall e. LuaError e => SimpleTable -> LuaE e () +pushSimpleTable tbl = pushViaConstructor @e "SimpleTable" (simpleTableCaption tbl) (simpleTableAlignments tbl) (simpleTableColumnWidths tbl) @@ -49,11 +45,10 @@ pushSimpleTable tbl = pushViaConstructor "SimpleTable" (simpleTableBody tbl) -- | Retrieve a simple table from the stack. -peekSimpleTable :: StackIndex -> Lua SimpleTable -peekSimpleTable idx = defineHowTo "get SimpleTable" $ - SimpleTable - <$> rawField idx "caption" - <*> rawField idx "aligns" - <*> rawField idx "widths" - <*> rawField idx "headers" - <*> rawField idx "rows" +peekSimpleTable :: forall e. LuaError e => Peeker e SimpleTable +peekSimpleTable idx = retrieving "SimpleTable" $ SimpleTable + <$!> peekFieldRaw peekInlines "caption" idx + <*> peekFieldRaw (peekList peekRead) "aligns" idx + <*> peekFieldRaw (peekList peekRealFloat) "widths" idx + <*> peekFieldRaw (peekList peekBlocks) "headers" idx + <*> peekFieldRaw (peekList (peekList peekBlocks)) "rows" idx diff --git a/src/Text/Pandoc/Lua/Marshaling/Version.hs b/src/Text/Pandoc/Lua/Marshaling/Version.hs index 4f4ffac51..2af36e5c8 100644 --- a/src/Text/Pandoc/Lua/Marshaling/Version.hs +++ b/src/Text/Pandoc/Lua/Marshaling/Version.hs @@ -16,133 +16,92 @@ default comparison operators (like @>@ and @<=@). module Text.Pandoc.Lua.Marshaling.Version ( peekVersion , pushVersion + , peekVersionFuzzy ) where -import Data.Text (Text) import Data.Maybe (fromMaybe) import Data.Version (Version (..), makeVersion, parseVersion, showVersion) -import Foreign.Lua (Lua, Optional (..), NumResults, - Peekable, Pushable, StackIndex) -import Foreign.Lua.Types.Peekable (reportValueOnFailure) -import Foreign.Lua.Userdata (ensureUserdataMetatable, pushAnyWithMetatable, - toAnyWithName) -import Safe (atMay, lastMay) -import Text.Pandoc.Lua.Marshaling.AnyValue (AnyValue (..)) +import HsLua as Lua +import Safe (lastMay) import Text.ParserCombinators.ReadP (readP_to_S) +import qualified Text.Pandoc.UTF8 as UTF8 -import qualified Foreign.Lua as Lua -import qualified Text.Pandoc.Lua.Util as LuaUtil - --- | Push a @'Version'@ element to the Lua stack. -pushVersion :: Version -> Lua () -pushVersion version = pushAnyWithMetatable pushVersionMT version - where - pushVersionMT = ensureUserdataMetatable versionTypeName $ do - LuaUtil.addFunction "__eq" __eq - LuaUtil.addFunction "__le" __le - LuaUtil.addFunction "__lt" __lt - LuaUtil.addFunction "__len" __len - LuaUtil.addFunction "__index" __index - LuaUtil.addFunction "__pairs" __pairs - LuaUtil.addFunction "__tostring" __tostring +instance Peekable Version where + peek = forcePeek . peekVersionFuzzy instance Pushable Version where push = pushVersion -peekVersion :: StackIndex -> Lua Version -peekVersion idx = Lua.ltype idx >>= \case +-- | Push a @'Version'@ element to the Lua stack. +pushVersion :: LuaError e => Pusher e Version +pushVersion = pushUD typeVersion + +peekVersionFuzzy :: LuaError e => Peeker e Version +peekVersionFuzzy idx = retrieving "Version" $ liftLua (Lua.ltype idx) >>= \case + Lua.TypeUserdata -> peekVersion idx Lua.TypeString -> do - versionStr <- Lua.peek idx + versionStr <- peekString idx let parses = readP_to_S parseVersion versionStr case lastMay parses of Just (v, "") -> return v - _ -> Lua.throwMessage $ "could not parse as Version: " ++ versionStr + _ -> Lua.failPeek $ + UTF8.fromString $ "could not parse as Version: " ++ versionStr - Lua.TypeUserdata -> - reportValueOnFailure versionTypeName - (`toAnyWithName` versionTypeName) - idx Lua.TypeNumber -> do - n <- Lua.peek idx - return (makeVersion [n]) + (makeVersion . (:[])) <$> peekIntegral idx Lua.TypeTable -> - makeVersion <$> Lua.peek idx + makeVersion <$> peekList peekIntegral idx _ -> - Lua.throwMessage "could not peek Version" - -instance Peekable Version where - peek = peekVersion - --- | Name used by Lua for the @CommonState@ type. -versionTypeName :: String -versionTypeName = "HsLua Version" - -__eq :: Version -> Version -> Lua Bool -__eq v1 v2 = return (v1 == v2) - -__le :: Version -> Version -> Lua Bool -__le v1 v2 = return (v1 <= v2) - -__lt :: Version -> Version -> Lua Bool -__lt v1 v2 = return (v1 < v2) - --- | Get number of version components. -__len :: Version -> Lua Int -__len = return . length . versionBranch - --- | Access fields. -__index :: Version -> AnyValue -> Lua NumResults -__index v (AnyValue k) = do - ty <- Lua.ltype k - case ty of - Lua.TypeNumber -> do - n <- Lua.peek k - let versionPart = atMay (versionBranch v) (n - 1) - Lua.push (Lua.Optional versionPart) - return 1 - Lua.TypeString -> do - (str :: Text) <- Lua.peek k - if str == "must_be_at_least" - then 1 <$ Lua.pushHaskellFunction must_be_at_least - else 1 <$ Lua.pushnil - _ -> 1 <$ Lua.pushnil - --- | Create iterator. -__pairs :: Version -> Lua NumResults -__pairs v = do - Lua.pushHaskellFunction nextFn - Lua.pushnil - Lua.pushnil - return 3 - where - nextFn :: AnyValue -> Optional Int -> Lua Lua.NumResults - nextFn _ (Optional key) = - case key of - Nothing -> case versionBranch v of - [] -> 2 <$ (Lua.pushnil *> Lua.pushnil) - n:_ -> 2 <$ (Lua.push (1 :: Int) *> Lua.push n) - Just n -> case atMay (versionBranch v) n of - Nothing -> 2 <$ (Lua.pushnil *> Lua.pushnil) - Just b -> 2 <$ (Lua.push (n + 1) *> Lua.push b) - --- | Convert to string. -__tostring :: Version -> Lua String -__tostring v = return (showVersion v) - --- | Default error message when a version is too old. This message is --- formatted in Lua with the expected and actual versions as arguments. -versionTooOldMessage :: String -versionTooOldMessage = "expected version %s or newer, got %s" + Lua.failPeek "could not peek Version" + +peekVersion :: LuaError e => Peeker e Version +peekVersion = peekUD typeVersion + +typeVersion :: LuaError e => DocumentedType e Version +typeVersion = deftype "Version" + [ operation Eq $ defun "__eq" + ### liftPure2 (==) + <#> parameter peekVersionFuzzy "Version" "v1" "" + <#> parameter peekVersionFuzzy "Version" "v2" "" + =#> functionResult pushBool "boolean" "true iff v1 == v2" + , operation Lt $ defun "__lt" + ### liftPure2 (<) + <#> parameter peekVersionFuzzy "Version" "v1" "" + <#> parameter peekVersionFuzzy "Version" "v2" "" + =#> functionResult pushBool "boolean" "true iff v1 < v2" + , operation Le $ defun "__le" + ### liftPure2 (<=) + <#> parameter peekVersionFuzzy "Version" "v1" "" + <#> parameter peekVersionFuzzy "Version" "v2" "" + =#> functionResult pushBool "boolean" "true iff v1 <= v2" + , operation Len $ defun "__len" + ### liftPure (length . versionBranch) + <#> parameter peekVersionFuzzy "Version" "v1" "" + =#> functionResult pushIntegral "integer" "number of version components" + , operation Tostring $ defun "__tostring" + ### liftPure showVersion + <#> parameter peekVersionFuzzy "Version" "version" "" + =#> functionResult pushString "string" "stringified version" + ] + [ method $ defun "must_be_at_least" + ### must_be_at_least + <#> parameter peekVersionFuzzy "Version" "self" "version to check" + <#> parameter peekVersionFuzzy "Version" "reference" "minimum version" + <#> optionalParameter peekString "string" "msg" "alternative message" + =?> "Returns no result, and throws an error if this version is older than reference" + ] -- | Throw an error if this version is older than the given version. -- FIXME: This function currently requires the string library to be -- loaded. -must_be_at_least :: Version -> Version -> Optional String -> Lua NumResults -must_be_at_least actual expected optMsg = do - let msg = fromMaybe versionTooOldMessage (fromOptional optMsg) +must_be_at_least :: LuaError e + => Version -> Version -> Maybe String + -> LuaE e NumResults +must_be_at_least actual expected mMsg = do + let msg = fromMaybe versionTooOldMessage mMsg if expected <= actual then return 0 else do @@ -152,3 +111,8 @@ must_be_at_least actual expected optMsg = do Lua.push (showVersion actual) Lua.call 3 1 Lua.error + +-- | Default error message when a version is too old. This message is +-- formatted in Lua with the expected and actual versions as arguments. +versionTooOldMessage :: String +versionTooOldMessage = "expected version %s or newer, got %s" diff --git a/src/Text/Pandoc/Lua/Module/MediaBag.hs b/src/Text/Pandoc/Lua/Module/MediaBag.hs index 3eed50fca..a1fc40732 100644 --- a/src/Text/Pandoc/Lua/Module/MediaBag.hs +++ b/src/Text/Pandoc/Lua/Module/MediaBag.hs @@ -15,18 +15,19 @@ module Text.Pandoc.Lua.Module.MediaBag import Prelude hiding (lookup) import Control.Monad (zipWithM_) -import Foreign.Lua (Lua, NumResults, Optional) +import HsLua (LuaE, NumResults, Optional) +import HsLua.Marshalling (pushIterator) import Text.Pandoc.Class.CommonState (CommonState (..)) import Text.Pandoc.Class.PandocMonad (fetchItem, getMediaBag, modifyCommonState, setMediaBag) +import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshaling () -import Text.Pandoc.Lua.Marshaling.MediaBag (pushIterator) import Text.Pandoc.Lua.PandocLua (PandocLua (..), liftPandocLua, addFunction) import Text.Pandoc.MIME (MimeType) import qualified Data.ByteString.Lazy as BL import qualified Data.Text as T -import qualified Foreign.Lua as Lua +import qualified HsLua as Lua import qualified Text.Pandoc.MediaBag as MB -- @@ -65,7 +66,15 @@ insert fp optionalMime contents = do -- | Returns iterator values to be used with a Lua @for@ loop. items :: PandocLua NumResults -items = getMediaBag >>= liftPandocLua . pushIterator +items = do + mb <- getMediaBag + liftPandocLua $ do + let pushItem (fp, mimetype, contents) = do + Lua.pushString fp + Lua.pushText mimetype + Lua.pushByteString $ BL.toStrict contents + return (Lua.NumResults 3) + pushIterator pushItem (MB.mediaItems mb) lookup :: FilePath -> PandocLua NumResults @@ -86,7 +95,7 @@ list = do zipWithM_ addEntry [1..] dirContents return 1 where - addEntry :: Lua.Integer -> (FilePath, MimeType, Int) -> Lua () + addEntry :: Lua.Integer -> (FilePath, MimeType, Int) -> LuaE PandocError () addEntry idx (fp, mimeType, contentLength) = do Lua.newtable Lua.push ("path" :: T.Text) *> Lua.push fp *> Lua.rawset (-3) diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 5c14b3a30..0a9ebaec5 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -15,29 +15,30 @@ module Text.Pandoc.Lua.Module.Pandoc ) where import Prelude hiding (read) -import Control.Monad (when) +import Control.Monad ((>=>), when) import Control.Monad.Except (throwError) import Data.Default (Default (..)) import Data.Maybe (fromMaybe) -import Foreign.Lua (Lua, NumResults, Optional, Peekable, Pushable) +import HsLua as Lua hiding (pushModule) +import HsLua.Class.Peekable (PeekError) import System.Exit (ExitCode (..)) import Text.Pandoc.Class.PandocIO (runIO) import Text.Pandoc.Definition (Block, Inline) -import Text.Pandoc.Lua.Filter (LuaFilter, SingletonsList (..), walkInlines, +import Text.Pandoc.Lua.Filter (SingletonsList (..), walkInlines, walkInlineLists, walkBlocks, walkBlockLists) import Text.Pandoc.Lua.Marshaling () +import Text.Pandoc.Lua.Marshaling.AST import Text.Pandoc.Lua.Marshaling.List (List (..)) import Text.Pandoc.Lua.PandocLua (PandocLua, addFunction, liftPandocLua, loadDefaultModule) -import Text.Pandoc.Walk (Walkable) import Text.Pandoc.Options (ReaderOptions (readerExtensions)) import Text.Pandoc.Process (pipeProcess) import Text.Pandoc.Readers (Reader (..), getReader) +import Text.Pandoc.Walk (Walkable) import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy.Char8 as BSL import qualified Data.Text as T -import qualified Foreign.Lua as Lua import qualified Text.Pandoc.Lua.Util as LuaUtil import Text.Pandoc.Error @@ -48,23 +49,25 @@ pushModule = do loadDefaultModule "pandoc" addFunction "read" read addFunction "pipe" pipe - addFunction "walk_block" walk_block - addFunction "walk_inline" walk_inline + addFunction "walk_block" (walkElement peekBlock pushBlock) + addFunction "walk_inline" (walkElement peekInline pushInline) return 1 walkElement :: (Walkable (SingletonsList Inline) a, Walkable (SingletonsList Block) a, Walkable (List Inline) a, Walkable (List Block) a) - => a -> LuaFilter -> PandocLua a -walkElement x f = liftPandocLua $ - walkInlines f x >>= walkInlineLists f >>= walkBlocks f >>= walkBlockLists f - -walk_inline :: Inline -> LuaFilter -> PandocLua Inline -walk_inline = walkElement - -walk_block :: Block -> LuaFilter -> PandocLua Block -walk_block = walkElement + => Peeker PandocError a -> Pusher PandocError a + -> LuaE PandocError NumResults +walkElement peek' push' = do + x <- forcePeek $ peek' (nthBottom 1) + f <- peek (nthBottom 2) + let walk' = walkInlines f + >=> walkInlineLists f + >=> walkBlocks f + >=> walkBlockLists f + walk' x >>= push' + return (NumResults 1) read :: T.Text -> Optional T.Text -> PandocLua NumResults read content formatSpecOrNil = liftPandocLua $ do @@ -93,7 +96,9 @@ pipe command args input = liftPandocLua $ do (ec, output) <- Lua.liftIO $ pipeProcess Nothing command args input case ec of ExitSuccess -> 1 <$ Lua.push output - ExitFailure n -> Lua.raiseError (PipeError (T.pack command) n output) + ExitFailure n -> do + pushPipeError (PipeError (T.pack command) n output) + Lua.error data PipeError = PipeError { pipeErrorCommand :: T.Text @@ -101,29 +106,34 @@ data PipeError = PipeError , pipeErrorOutput :: BL.ByteString } -instance Peekable PipeError where - peek idx = - PipeError - <$> (Lua.getfield idx "command" *> Lua.peek (-1) <* Lua.pop 1) - <*> (Lua.getfield idx "error_code" *> Lua.peek (-1) <* Lua.pop 1) - <*> (Lua.getfield idx "output" *> Lua.peek (-1) <* Lua.pop 1) +peekPipeError :: PeekError e => StackIndex -> LuaE e PipeError +peekPipeError idx = + PipeError + <$> (Lua.getfield idx "command" *> Lua.peek (-1) <* Lua.pop 1) + <*> (Lua.getfield idx "error_code" *> Lua.peek (-1) <* Lua.pop 1) + <*> (Lua.getfield idx "output" *> Lua.peek (-1) <* Lua.pop 1) -instance Pushable PipeError where - push pipeErr = do - Lua.newtable - LuaUtil.addField "command" (pipeErrorCommand pipeErr) - LuaUtil.addField "error_code" (pipeErrorCode pipeErr) - LuaUtil.addField "output" (pipeErrorOutput pipeErr) - pushPipeErrorMetaTable - Lua.setmetatable (-2) - where - pushPipeErrorMetaTable :: Lua () - pushPipeErrorMetaTable = do - v <- Lua.newmetatable "pandoc pipe error" - when v $ LuaUtil.addFunction "__tostring" pipeErrorMessage +pushPipeError :: PeekError e => Pusher e PipeError +pushPipeError pipeErr = do + Lua.newtable + LuaUtil.addField "command" (pipeErrorCommand pipeErr) + LuaUtil.addField "error_code" (pipeErrorCode pipeErr) + LuaUtil.addField "output" (pipeErrorOutput pipeErr) + pushPipeErrorMetaTable + Lua.setmetatable (-2) + where + pushPipeErrorMetaTable :: PeekError e => LuaE e () + pushPipeErrorMetaTable = do + v <- Lua.newmetatable "pandoc pipe error" + when v $ do + pushName "__tostring" + pushHaskellFunction pipeErrorMessage + rawset (nth 3) - pipeErrorMessage :: PipeError -> Lua BL.ByteString - pipeErrorMessage (PipeError cmd errorCode output) = return $ mconcat + pipeErrorMessage :: PeekError e => LuaE e NumResults + pipeErrorMessage = do + (PipeError cmd errorCode output) <- peekPipeError (nthBottom 1) + pushByteString . BSL.toStrict . BSL.concat $ [ BSL.pack "Error running " , BSL.pack $ T.unpack cmd , BSL.pack " (error code " @@ -131,3 +141,4 @@ instance Pushable PipeError where , BSL.pack "): " , if output == mempty then BSL.pack "" else output ] + return (NumResults 1) diff --git a/src/Text/Pandoc/Lua/Module/System.hs b/src/Text/Pandoc/Lua/Module/System.hs index bd35babaf..8589f672c 100644 --- a/src/Text/Pandoc/Lua/Module/System.hs +++ b/src/Text/Pandoc/Lua/Module/System.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} {- | Module : Text.Pandoc.Lua.Module.System Copyright : © 2019-2021 Albert Krewinkel @@ -12,22 +14,31 @@ module Text.Pandoc.Lua.Module.System ( pushModule ) where -import Foreign.Lua (Lua, NumResults) -import Foreign.Lua.Module.System (arch, env, getwd, os, - with_env, with_tmpdir, with_wd) -import Text.Pandoc.Lua.Util (addFunction, addField) +import HsLua hiding (pushModule) +import HsLua.Module.System + (arch, env, getwd, os, with_env, with_tmpdir, with_wd) +import Text.Pandoc.Error (PandocError) +import Text.Pandoc.Lua.ErrorConversion () -import qualified Foreign.Lua as Lua +import qualified HsLua as Lua -- | Push the pandoc.system module on the Lua stack. -pushModule :: Lua NumResults +pushModule :: LuaE PandocError NumResults pushModule = do - Lua.newtable - addField "arch" arch - addField "os" os - addFunction "environment" env - addFunction "get_working_directory" getwd - addFunction "with_environment" with_env - addFunction "with_temporary_directory" with_tmpdir - addFunction "with_working_directory" with_wd + Lua.pushModule $ Module + { moduleName = "system" + , moduleDescription = "system functions" + , moduleFields = + [ arch + , os + ] + , moduleFunctions = + [ setName "environment" env + , setName "get_working_directory" getwd + , setName "with_environment" with_env + , setName "with_temporary_directory" with_tmpdir + , setName "with_working_directory" with_wd + ] + , moduleOperations = [] + } return 1 diff --git a/src/Text/Pandoc/Lua/Module/Types.hs b/src/Text/Pandoc/Lua/Module/Types.hs index bb4f02c3c..a9ce14ce7 100644 --- a/src/Text/Pandoc/Lua/Module/Types.hs +++ b/src/Text/Pandoc/Lua/Module/Types.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Lua.Module.Types Copyright : © 2019-2021 Albert Krewinkel @@ -13,56 +14,41 @@ module Text.Pandoc.Lua.Module.Types ) where import Data.Version (Version) -import Foreign.Lua (Lua, NumResults) -import Text.Pandoc.Definition -import Text.Pandoc.Lua.Marshaling.AST (LuaAttr, LuaListAttributes) +import HsLua (LuaE, NumResults, Peeker, Pusher) +import Text.Pandoc.Error (PandocError) +import Text.Pandoc.Lua.ErrorConversion () +import Text.Pandoc.Lua.Marshaling.AST import Text.Pandoc.Lua.Marshaling.Version () import Text.Pandoc.Lua.Util (addFunction) -import qualified Foreign.Lua as Lua +import qualified HsLua as Lua --- | Push the pandoc.system module on the Lua stack. -pushModule :: Lua NumResults +-- | Push the pandoc.types module on the Lua stack. +pushModule :: LuaE PandocError NumResults pushModule = do Lua.newtable - addFunction "Version" (return :: Version -> Lua Version) + addFunction "Version" (return :: Version -> LuaE PandocError Version) pushCloneTable - Lua.setfield (Lua.nthFromTop 2) "clone" + Lua.setfield (Lua.nth 2) "clone" return 1 -pushCloneTable :: Lua NumResults +pushCloneTable :: LuaE PandocError NumResults pushCloneTable = do Lua.newtable - addFunction "Attr" cloneAttr - addFunction "Block" cloneBlock - addFunction "Citation" cloneCitation - addFunction "Inline" cloneInline - addFunction "Meta" cloneMeta - addFunction "MetaValue" cloneMetaValue - addFunction "ListAttributes" cloneListAttributes - addFunction "Pandoc" clonePandoc + addFunction "Attr" $ cloneWith peekAttr pushAttr + addFunction "Block" $ cloneWith peekBlock pushBlock + addFunction "Citation" $ cloneWith peekCitation Lua.push + addFunction "Inline" $ cloneWith peekInline pushInline + addFunction "Meta" $ cloneWith peekMeta Lua.push + addFunction "MetaValue" $ cloneWith peekMetaValue pushMetaValue + addFunction "ListAttributes" $ cloneWith peekListAttributes pushListAttributes + addFunction "Pandoc" $ cloneWith peekPandoc pushPandoc return 1 -cloneAttr :: LuaAttr -> Lua LuaAttr -cloneAttr = return - -cloneBlock :: Block -> Lua Block -cloneBlock = return - -cloneCitation :: Citation -> Lua Citation -cloneCitation = return - -cloneInline :: Inline -> Lua Inline -cloneInline = return - -cloneListAttributes :: LuaListAttributes -> Lua LuaListAttributes -cloneListAttributes = return - -cloneMeta :: Meta -> Lua Meta -cloneMeta = return - -cloneMetaValue :: MetaValue -> Lua MetaValue -cloneMetaValue = return - -clonePandoc :: Pandoc -> Lua Pandoc -clonePandoc = return +cloneWith :: Peeker PandocError a + -> Pusher PandocError a + -> LuaE PandocError NumResults +cloneWith peeker pusher = do + x <- Lua.forcePeek $ peeker (Lua.nthBottom 1) + pusher x + return (Lua.NumResults 1) diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 3ec3afc26..8b6e31b43 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -1,5 +1,7 @@ -{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Module.Utils Copyright : Copyright © 2017-2021 Albert Krewinkel @@ -15,82 +17,137 @@ module Text.Pandoc.Lua.Module.Utils ) where import Control.Applicative ((<|>)) -import Control.Monad.Catch (try) +import Control.Monad ((<$!>)) import Data.Data (showConstr, toConstr) import Data.Default (def) import Data.Version (Version) -import Foreign.Lua (Peekable, Lua, NumResults (..)) +import HsLua as Lua hiding (pushModule) +import HsLua.Class.Peekable (PeekError) import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshaling () +import Text.Pandoc.Lua.Marshaling.AST + ( peekBlock, peekInline, peekPandoc, pushBlock, pushInline, pushPandoc + , peekAttr, peekListAttributes, peekMeta, peekMetaValue) +import Text.Pandoc.Lua.Marshaling.List (pushPandocList) import Text.Pandoc.Lua.Marshaling.SimpleTable - ( SimpleTable (..) - , pushSimpleTable - ) -import Text.Pandoc.Lua.PandocLua (PandocLua, addFunction, liftPandocLua) + ( SimpleTable (..), peekSimpleTable, pushSimpleTable ) +import Text.Pandoc.Lua.Marshaling.Version (peekVersionFuzzy, pushVersion) +import Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua)) import qualified Data.Digest.Pure.SHA as SHA import qualified Data.ByteString.Lazy as BSL import qualified Data.Text as T -import qualified Foreign.Lua as Lua +import qualified HsLua.Packaging as Lua import qualified Text.Pandoc.Builder as B import qualified Text.Pandoc.Filter.JSON as JSONFilter import qualified Text.Pandoc.Shared as Shared +import qualified Text.Pandoc.UTF8 as UTF8 import qualified Text.Pandoc.Writers.Shared as Shared -- | Push the "pandoc.utils" module to the Lua stack. -pushModule :: PandocLua NumResults -pushModule = do - liftPandocLua Lua.newtable - addFunction "blocks_to_inlines" blocksToInlines - addFunction "equals" equals - addFunction "from_simple_table" from_simple_table - addFunction "make_sections" makeSections - addFunction "normalize_date" normalizeDate - addFunction "run_json_filter" runJSONFilter - addFunction "sha1" sha1 - addFunction "stringify" stringify - addFunction "to_roman_numeral" toRomanNumeral - addFunction "to_simple_table" to_simple_table - addFunction "Version" (return :: Version -> Lua Version) - return 1 - --- | Squashes a list of blocks into inlines. -blocksToInlines :: [Block] -> Lua.Optional [Inline] -> PandocLua [Inline] -blocksToInlines blks optSep = liftPandocLua $ do - let sep = maybe Shared.defaultBlocksSeparator B.fromList - $ Lua.fromOptional optSep - return $ B.toList (Shared.blocksToInlinesWithSep sep blks) - --- | Convert list of Pandoc blocks into sections using Divs. -makeSections :: Bool -> Lua.Optional Int -> [Block] -> Lua [Block] -makeSections number baselevel = - return . Shared.makeSections number (Lua.fromOptional baselevel) - --- | Parse a date and convert (if possible) to "YYYY-MM-DD" format. We --- limit years to the range 1601-9999 (ISO 8601 accepts greater than --- or equal to 1583, but MS Word only accepts dates starting 1601). --- Returns nil instead of a string if the conversion failed. -normalizeDate :: T.Text -> Lua (Lua.Optional T.Text) -normalizeDate = return . Lua.Optional . Shared.normalizeDate - --- | Run a JSON filter on the given document. -runJSONFilter :: Pandoc - -> FilePath - -> Lua.Optional [String] - -> PandocLua Pandoc -runJSONFilter doc filterFile optArgs = do - args <- case Lua.fromOptional optArgs of - Just x -> return x - Nothing -> liftPandocLua $ do - Lua.getglobal "FORMAT" - (:[]) <$> Lua.popValue - JSONFilter.apply def args filterFile doc - --- | Calculate the hash of the given contents. -sha1 :: BSL.ByteString - -> Lua T.Text -sha1 = return . T.pack . SHA.showDigest . SHA.sha1 +pandocUtilsModule :: Module PandocError +pandocUtilsModule = Module + { moduleName = "pandoc.utils" + , moduleDescription = "pandoc utility functions" + , moduleFields = [] + , moduleOperations = [] + , moduleFunctions = + [ defun "blocks_to_inlines" + ### (\blks mSep -> do + let sep = maybe Shared.defaultBlocksSeparator B.fromList mSep + return $ B.toList (Shared.blocksToInlinesWithSep sep blks)) + <#> parameter (peekList peekBlock) "list of blocks" + "blocks" "" + <#> optionalParameter (peekList peekInline) "list of inlines" + "inline" "" + =#> functionResult (pushPandocList pushInline) "list of inlines" "" + + , defun "equals" + ### liftPure2 (==) + <#> parameter peekAstElement "AST element" "elem1" "" + <#> parameter peekAstElement "AST element" "elem2" "" + =#> functionResult pushBool "boolean" "true iff elem1 == elem2" + + , defun "make_sections" + ### liftPure3 Shared.makeSections + <#> parameter peekBool "boolean" "numbering" "add header numbers" + <#> parameter (\i -> (Nothing <$ peekNil i) <|> (Just <$!> peekIntegral i)) + "integer or nil" "baselevel" "" + <#> parameter (peekList peekBlock) "list of blocks" + "blocks" "document blocks to process" + =#> functionResult (pushPandocList pushBlock) "list of Blocks" + "processes blocks" + + , defun "normalize_date" + ### liftPure Shared.normalizeDate + <#> parameter peekText "string" "date" "the date string" + =#> functionResult (maybe pushnil pushText) "string or nil" + "normalized date, or nil if normalization failed." + #? T.unwords + [ "Parse a date and convert (if possible) to \"YYYY-MM-DD\" format. We" + , "limit years to the range 1601-9999 (ISO 8601 accepts greater than" + , "or equal to 1583, but MS Word only accepts dates starting 1601)." + , "Returns nil instead of a string if the conversion failed." + ] + + , defun "sha1" + ### liftPure (SHA.showDigest . SHA.sha1) + <#> parameter (fmap BSL.fromStrict . peekByteString) "string" + "input" "" + =#> functionResult pushString "string" "hexadecimal hash value" + #? "Compute the hash of the given string value." + + , defun "Version" + ### liftPure (id @Version) + <#> parameter peekVersionFuzzy + "version string, list of integers, or integer" + "v" "version description" + =#> functionResult pushVersion "Version" "new Version object" + #? "Creates a Version object." + + , defun "run_json_filter" + ### (\doc filterPath margs -> do + args <- case margs of + Just xs -> return xs + Nothing -> do + Lua.getglobal "FORMAT" + (forcePeek ((:[]) <$!> peekString top) <* pop 1) + JSONFilter.apply def args filterPath doc + ) + <#> parameter peekPandoc "Pandoc" "doc" "input document" + <#> parameter peekString "filepath" "filter_path" "path to filter" + <#> optionalParameter (peekList peekString) "list of strings" + "args" "arguments to pass to the filter" + =#> functionResult pushPandoc "Pandoc" "filtered document" + + , defun "stringify" + ### unPandocLua . stringify + <#> parameter peekAstElement "AST element" "elem" "some pandoc AST element" + =#> functionResult pushText "string" "stringified element" + + , defun "from_simple_table" + ### from_simple_table + <#> parameter peekSimpleTable "SimpleTable" "simple_tbl" "" + =?> "Simple table" + + , defun "to_roman_numeral" + ### liftPure Shared.toRomanNumeral + <#> parameter (peekIntegral @Int) "integer" "n" "number smaller than 4000" + =#> functionResult pushText "string" "roman numeral" + #? "Converts a number < 4000 to uppercase roman numeral." + + , defun "to_simple_table" + ### to_simple_table + <#> parameter peekTable "Block" "tbl" "a table" + =#> functionResult pushSimpleTable "SimpleTable" "SimpleTable object" + #? "Converts a table into an old/simple table." + ] + } + +pushModule :: LuaE PandocError NumResults +pushModule = 1 <$ Lua.pushModule pandocUtilsModule + -- | Convert pandoc structure to a string with formatting removed. -- Footnotes are skipped (since we don't want their contents in link @@ -111,9 +168,6 @@ stringifyMetaValue mv = case mv of MetaString s -> s _ -> Shared.stringify mv -equals :: AstElement -> AstElement -> PandocLua Bool -equals e1 e2 = return (e1 == e2) - data AstElement = PandocElement Pandoc | MetaElement Meta @@ -125,22 +179,19 @@ data AstElement | CitationElement Citation deriving (Eq, Show) -instance Peekable AstElement where - peek idx = do - res <- try $ (PandocElement <$> Lua.peek idx) - <|> (InlineElement <$> Lua.peek idx) - <|> (BlockElement <$> Lua.peek idx) - <|> (AttrElement <$> Lua.peek idx) - <|> (ListAttributesElement <$> Lua.peek idx) - <|> (MetaElement <$> Lua.peek idx) - <|> (MetaValueElement <$> Lua.peek idx) - case res of - Right x -> return x - Left (_ :: PandocError) -> Lua.throwMessage - "Expected an AST element, but could not parse value as such." +peekAstElement :: PeekError e => Peeker e AstElement +peekAstElement = retrieving "pandoc AST element" . choice + [ (fmap PandocElement . peekPandoc) + , (fmap InlineElement . peekInline) + , (fmap BlockElement . peekBlock) + , (fmap AttrElement . peekAttr) + , (fmap ListAttributesElement . peekListAttributes) + , (fmap MetaElement . peekMeta) + , (fmap MetaValueElement . peekMetaValue) + ] -- | Converts an old/simple table into a normal table block element. -from_simple_table :: SimpleTable -> Lua NumResults +from_simple_table :: SimpleTable -> LuaE PandocError NumResults from_simple_table (SimpleTable capt aligns widths head' body) = do Lua.push $ Table nullAttr @@ -159,17 +210,19 @@ from_simple_table (SimpleTable capt aligns widths head' body) = do toColWidth w = ColWidth w -- | Converts a table into an old/simple table. -to_simple_table :: Block -> Lua NumResults +to_simple_table :: Block -> LuaE PandocError SimpleTable to_simple_table = \case Table _attr caption specs thead tbodies tfoot -> do let (capt, aligns, widths, headers, rows) = Shared.toLegacyTable caption specs thead tbodies tfoot - pushSimpleTable $ SimpleTable capt aligns widths headers rows - return (NumResults 1) - blk -> - Lua.throwMessage $ - "Expected Table, got " <> showConstr (toConstr blk) <> "." - --- | Convert a number < 4000 to uppercase roman numeral. -toRomanNumeral :: Lua.Integer -> PandocLua T.Text -toRomanNumeral = return . Shared.toRomanNumeral . fromIntegral + return $ SimpleTable capt aligns widths headers rows + blk -> Lua.failLua $ mconcat + [ "Expected Table, got ", showConstr (toConstr blk), "." ] + +peekTable :: LuaError e => Peeker e Block +peekTable idx = peekBlock idx >>= \case + t@(Table {}) -> return t + b -> Lua.failPeek $ mconcat + [ "Expected Table, got " + , UTF8.fromString $ showConstr (toConstr b) + , "." ] diff --git a/src/Text/Pandoc/Lua/Packages.hs b/src/Text/Pandoc/Lua/Packages.hs index 2f1c139db..f9bd7abe8 100644 --- a/src/Text/Pandoc/Lua/Packages.hs +++ b/src/Text/Pandoc/Lua/Packages.hs @@ -1,3 +1,6 @@ +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Packages Copyright : Copyright © 2017-2021 Albert Krewinkel @@ -13,12 +16,13 @@ module Text.Pandoc.Lua.Packages ) where import Control.Monad (forM_) -import Foreign.Lua (NumResults) +import HsLua (NumResults) +import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, loadDefaultModule) -import qualified Foreign.Lua as Lua -import qualified Foreign.Lua.Module.Path as Path -import qualified Foreign.Lua.Module.Text as Text +import qualified HsLua as Lua +import qualified HsLua.Module.Path as Path +import qualified HsLua.Module.Text as Text import qualified Text.Pandoc.Lua.Module.Pandoc as Pandoc import qualified Text.Pandoc.Lua.Module.MediaBag as MediaBag import qualified Text.Pandoc.Lua.Module.System as System @@ -30,8 +34,8 @@ installPandocPackageSearcher :: PandocLua () installPandocPackageSearcher = liftPandocLua $ do Lua.getglobal' "package.searchers" shiftArray - Lua.pushHaskellFunction pandocPackageSearcher - Lua.rawseti (Lua.nthFromTop 2) 1 + Lua.pushHaskellFunction $ Lua.toHaskellFunction pandocPackageSearcher + Lua.rawseti (Lua.nth 2) 1 Lua.pop 1 -- remove 'package.searchers' from stack where shiftArray = forM_ [4, 3, 2, 1] $ \i -> do @@ -42,14 +46,16 @@ installPandocPackageSearcher = liftPandocLua $ do pandocPackageSearcher :: String -> PandocLua NumResults pandocPackageSearcher pkgName = case pkgName of - "pandoc" -> pushWrappedHsFun Pandoc.pushModule - "pandoc.mediabag" -> pushWrappedHsFun MediaBag.pushModule - "pandoc.path" -> pushWrappedHsFun Path.pushModule - "pandoc.system" -> pushWrappedHsFun System.pushModule - "pandoc.types" -> pushWrappedHsFun Types.pushModule - "pandoc.utils" -> pushWrappedHsFun Utils.pushModule - "text" -> pushWrappedHsFun Text.pushModule - "pandoc.List" -> pushWrappedHsFun (loadDefaultModule pkgName) + "pandoc" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError Pandoc.pushModule + "pandoc.mediabag" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError MediaBag.pushModule + "pandoc.path" -> pushWrappedHsFun + (Lua.NumResults 1 <$ Lua.pushModule @PandocError Path.documentedModule) + "pandoc.system" -> pushWrappedHsFun $ Lua.toHaskellFunction System.pushModule + "pandoc.types" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError Types.pushModule + "pandoc.utils" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError Utils.pushModule + "text" -> pushWrappedHsFun + (Lua.NumResults 1 <$ Lua.pushModule @PandocError Text.documentedModule) + "pandoc.List" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError (loadDefaultModule pkgName) _ -> reportPandocSearcherFailure where pushWrappedHsFun f = liftPandocLua $ do diff --git a/src/Text/Pandoc/Lua/PandocLua.hs b/src/Text/Pandoc/Lua/PandocLua.hs index b7f084957..12511d088 100644 --- a/src/Text/Pandoc/Lua/PandocLua.hs +++ b/src/Text/Pandoc/Lua/PandocLua.hs @@ -28,20 +28,19 @@ module Text.Pandoc.Lua.PandocLua import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow) import Control.Monad.Except (MonadError (catchError, throwError)) -import Control.Monad.IO.Class (MonadIO (liftIO)) -import Foreign.Lua (Lua (..), NumResults, Pushable, ToHaskellFunction) +import Control.Monad.IO.Class (MonadIO) +import HsLua as Lua import Text.Pandoc.Class.PandocMonad (PandocMonad (..), readDefaultDataFile) import Text.Pandoc.Error (PandocError (PandocLuaError)) import Text.Pandoc.Lua.Global (Global (..), setGlobals) -import Text.Pandoc.Lua.ErrorConversion (errorConversion) +import Text.Pandoc.Lua.Marshaling.CommonState (peekCommonState) import qualified Control.Monad.Catch as Catch import qualified Data.Text as T -import qualified Foreign.Lua as Lua import qualified Text.Pandoc.Class.IO as IO -- | Type providing access to both, pandoc and Lua operations. -newtype PandocLua a = PandocLua { unPandocLua :: Lua a } +newtype PandocLua a = PandocLua { unPandocLua :: LuaE PandocError a } deriving ( Applicative , Functor @@ -53,7 +52,7 @@ newtype PandocLua a = PandocLua { unPandocLua :: Lua a } ) -- | Lift a @'Lua'@ operation into the @'PandocLua'@ type. -liftPandocLua :: Lua a -> PandocLua a +liftPandocLua :: LuaE PandocError a -> PandocLua a liftPandocLua = PandocLua -- | Evaluate a @'PandocLua'@ computation, running all contained Lua @@ -62,7 +61,7 @@ runPandocLua :: (PandocMonad m, MonadIO m) => PandocLua a -> m a runPandocLua pLua = do origState <- getCommonState globals <- defaultGlobals - (result, newState) <- liftIO . Lua.run' errorConversion . unPandocLua $ do + (result, newState) <- liftIO . Lua.run . unPandocLua $ do putCommonState origState liftPandocLua $ setGlobals globals r <- pLua @@ -71,17 +70,17 @@ runPandocLua pLua = do putCommonState newState return result -instance {-# OVERLAPPING #-} ToHaskellFunction (PandocLua NumResults) where - toHsFun _narg = unPandocLua +instance {-# OVERLAPPING #-} Exposable PandocError (PandocLua NumResults) where + partialApply _narg = unPandocLua -instance Pushable a => ToHaskellFunction (PandocLua a) where - toHsFun _narg x = 1 <$ (unPandocLua x >>= Lua.push) +instance Pushable a => Exposable PandocError (PandocLua a) where + partialApply _narg x = 1 <$ (unPandocLua x >>= Lua.push) -- | Add a function to the table at the top of the stack, using the given name. -addFunction :: ToHaskellFunction a => String -> a -> PandocLua () +addFunction :: Exposable PandocError a => Name -> a -> PandocLua () addFunction name fn = liftPandocLua $ do - Lua.push name - Lua.pushHaskellFunction fn + Lua.pushName name + Lua.pushHaskellFunction $ toHaskellFunction fn Lua.rawset (-3) -- | Load a pure Lua module included with pandoc. Leaves the result on @@ -93,8 +92,8 @@ addFunction name fn = liftPandocLua $ do loadDefaultModule :: String -> PandocLua NumResults loadDefaultModule name = do script <- readDefaultDataFile (name <> ".lua") - status <- liftPandocLua $ Lua.dostring script - if status == Lua.OK + result <- liftPandocLua $ Lua.dostring script + if result == Lua.OK then return (1 :: NumResults) else do msg <- liftPandocLua Lua.popValue @@ -135,7 +134,7 @@ instance PandocMonad PandocLua where getCommonState = PandocLua $ do Lua.getglobal "PANDOC_STATE" - Lua.peek Lua.stackTop + forcePeek $ peekCommonState Lua.top putCommonState = PandocLua . setGlobals . (:[]) . PANDOC_STATE logOutput = IO.logOutput diff --git a/src/Text/Pandoc/Lua/Util.hs b/src/Text/Pandoc/Lua/Util.hs index 70a8a6d47..50157189f 100644 --- a/src/Text/Pandoc/Lua/Util.hs +++ b/src/Text/Pandoc/Lua/Util.hs @@ -1,6 +1,9 @@ -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Util Copyright : © 2012-2021 John MacFarlane, @@ -14,114 +17,91 @@ Lua utility functions. -} module Text.Pandoc.Lua.Util ( getTag - , rawField , addField , addFunction - , addValue , pushViaConstructor - , defineHowTo - , throwTopMessageAsError' , callWithTraceback , dofileWithTraceback + , pushViaConstr' ) where import Control.Monad (unless, when) -import Data.Text (Text) -import Foreign.Lua ( Lua, NumArgs, NumResults, Peekable, Pushable, StackIndex - , Status, ToHaskellFunction ) -import qualified Foreign.Lua as Lua -import qualified Text.Pandoc.UTF8 as UTF8 - --- | Get value behind key from table at given index. -rawField :: Peekable a => StackIndex -> String -> Lua a -rawField idx key = do - absidx <- Lua.absindex idx - Lua.push key - Lua.rawget absidx - Lua.popValue +import HsLua +import qualified HsLua as Lua -- | Add a value to the table at the top of the stack at a string-index. -addField :: Pushable a => String -> a -> Lua () -addField = addValue - --- | Add a key-value pair to the table at the top of the stack. -addValue :: (Pushable a, Pushable b) => a -> b -> Lua () -addValue key value = do +addField :: (LuaError e, Pushable a) => String -> a -> LuaE e () +addField key value = do Lua.push key Lua.push value - Lua.rawset (Lua.nthFromTop 3) + Lua.rawset (Lua.nth 3) --- | Add a function to the table at the top of the stack, using the given name. -addFunction :: ToHaskellFunction a => String -> a -> Lua () +-- | Add a function to the table at the top of the stack, using the +-- given name. +addFunction :: Exposable e a => String -> a -> LuaE e () addFunction name fn = do Lua.push name - Lua.pushHaskellFunction fn + Lua.pushHaskellFunction $ toHaskellFunction fn Lua.rawset (-3) --- | Helper class for pushing a single value to the stack via a lua function. --- See @pushViaCall@. -class PushViaCall a where - pushViaCall' :: String -> Lua () -> NumArgs -> a +-- | Helper class for pushing a single value to the stack via a lua +-- function. See @pushViaCall@. +class LuaError e => PushViaCall e a where + pushViaCall' :: LuaError e => Name -> LuaE e () -> NumArgs -> a -instance PushViaCall (Lua ()) where +instance LuaError e => PushViaCall e (LuaE e ()) where pushViaCall' fn pushArgs num = do - Lua.push fn + Lua.pushName @e fn Lua.rawget Lua.registryindex pushArgs Lua.call num 1 -instance (Pushable a, PushViaCall b) => PushViaCall (a -> b) where +instance (LuaError e, Pushable a, PushViaCall e b) => + PushViaCall e (a -> b) where pushViaCall' fn pushArgs num x = - pushViaCall' fn (pushArgs *> Lua.push x) (num + 1) + pushViaCall' @e fn (pushArgs *> Lua.push x) (num + 1) -- | Push an value to the stack via a lua function. The lua function is called -- with all arguments that are passed to this function and is expected to return -- a single value. -pushViaCall :: PushViaCall a => String -> a -pushViaCall fn = pushViaCall' fn (return ()) 0 +pushViaCall :: forall e a. LuaError e => PushViaCall e a => Name -> a +pushViaCall fn = pushViaCall' @e fn (return ()) 0 -- | Call a pandoc element constructor within Lua, passing all given arguments. -pushViaConstructor :: PushViaCall a => String -> a -pushViaConstructor pandocFn = pushViaCall ("pandoc." ++ pandocFn) +pushViaConstructor :: forall e a. LuaError e => PushViaCall e a => Name -> a +pushViaConstructor pandocFn = pushViaCall @e ("pandoc." <> pandocFn) -- | Get the tag of a value. This is an optimized and specialized version of -- @Lua.getfield idx "tag"@. It only checks for the field on the table at index -- @idx@ and on its metatable, also ignoring any @__index@ value on the -- metatable. -getTag :: StackIndex -> Lua String +getTag :: LuaError e => Peeker e Name getTag idx = do -- push metatable or just the table - Lua.getmetatable idx >>= \hasMT -> unless hasMT (Lua.pushvalue idx) - Lua.push ("tag" :: Text) - Lua.rawget (Lua.nthFromTop 2) - Lua.tostring Lua.stackTop <* Lua.pop 2 >>= \case - Nothing -> Lua.throwMessage "untagged value" - Just x -> return (UTF8.toString x) - --- | Modify the message at the top of the stack before throwing it as an --- Exception. -throwTopMessageAsError' :: (String -> String) -> Lua a -throwTopMessageAsError' modifier = do - msg <- Lua.tostring' Lua.stackTop - Lua.pop 2 -- remove error and error string pushed by tostring' - Lua.throwMessage (modifier (UTF8.toString msg)) - --- | Mark the context of a Lua computation for better error reporting. -defineHowTo :: String -> Lua a -> Lua a -defineHowTo ctx op = Lua.errorConversion >>= \ec -> - Lua.addContextToException ec ("Could not " <> ctx <> ": ") op + liftLua $ do + Lua.getmetatable idx >>= \hasMT -> unless hasMT (Lua.pushvalue idx) + Lua.pushName "tag" + Lua.rawget (Lua.nth 2) + Lua.peekName Lua.top `lastly` Lua.pop 2 -- table/metatable and `tag` field + +pushViaConstr' :: forall e. LuaError e => Name -> [LuaE e ()] -> LuaE e () +pushViaConstr' fnname pushArgs = do + pushName @e ("pandoc." <> fnname) + rawget @e registryindex + sequence_ pushArgs + call @e (fromIntegral (length pushArgs)) 1 -- | Like @'Lua.pcall'@, but uses a predefined error handler which adds a -- traceback on error. -pcallWithTraceback :: NumArgs -> NumResults -> Lua Status +pcallWithTraceback :: LuaError e => NumArgs -> NumResults -> LuaE e Status pcallWithTraceback nargs nresults = do - let traceback' :: Lua NumResults + let traceback' :: LuaError e => LuaE e NumResults traceback' = do l <- Lua.state - msg <- Lua.tostring' (Lua.nthFromBottom 1) - Lua.traceback l (Just (UTF8.toString msg)) 2 + msg <- Lua.tostring' (Lua.nthBottom 1) + Lua.traceback l (Just msg) 2 return 1 - tracebackIdx <- Lua.absindex (Lua.nthFromTop (Lua.fromNumArgs nargs + 1)) + tracebackIdx <- Lua.absindex (Lua.nth (Lua.fromNumArgs nargs + 1)) Lua.pushHaskellFunction traceback' Lua.insert tracebackIdx result <- Lua.pcall nargs nresults (Just tracebackIdx) @@ -129,15 +109,15 @@ pcallWithTraceback nargs nresults = do return result -- | Like @'Lua.call'@, but adds a traceback to the error message (if any). -callWithTraceback :: NumArgs -> NumResults -> Lua () +callWithTraceback :: LuaError e => NumArgs -> NumResults -> LuaE e () callWithTraceback nargs nresults = do result <- pcallWithTraceback nargs nresults when (result /= Lua.OK) - Lua.throwTopMessage + Lua.throwErrorAsException -- | Run the given string as a Lua program, while also adding a traceback to the -- error message if an error occurs. -dofileWithTraceback :: FilePath -> Lua Status +dofileWithTraceback :: LuaError e => FilePath -> LuaE e Status dofileWithTraceback fp = do loadRes <- Lua.loadfile fp case loadRes of diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs index 1e9f37d2f..da212ab4e 100644 --- a/src/Text/Pandoc/Writers/Custom.hs +++ b/src/Text/Pandoc/Writers/Custom.hs @@ -1,5 +1,8 @@ -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Writers.Custom Copyright : Copyright (C) 2012-2021 John MacFarlane @@ -10,7 +13,7 @@ Portability : portable Conversion of 'Pandoc' documents to custom markup using -a lua writer. +a Lua writer. -} module Text.Pandoc.Writers.Custom ( writeCustom ) where import Control.Arrow ((***)) @@ -20,7 +23,8 @@ import Data.List (intersperse) import qualified Data.Map as M import qualified Data.Text as T import Data.Text (Text, pack) -import Foreign.Lua (Lua, Pushable) +import HsLua as Lua hiding (Operation (Div), render) +import HsLua.Class.Peekable (PeekError) import Text.DocLayout (render, literal) import Control.Monad.IO.Class (MonadIO) import Text.Pandoc.Definition @@ -31,39 +35,39 @@ import Text.Pandoc.Class (PandocMonad) import Text.Pandoc.Templates (renderTemplate) import Text.Pandoc.Writers.Shared -import qualified Foreign.Lua as Lua - attrToMap :: Attr -> M.Map T.Text T.Text attrToMap (id',classes,keyvals) = M.fromList $ ("id", id') : ("class", T.unwords classes) : keyvals -newtype Stringify a = Stringify a +newtype Stringify e a = Stringify a -instance Pushable (Stringify Format) where +instance Pushable (Stringify e Format) where push (Stringify (Format f)) = Lua.push (T.toLower f) -instance Pushable (Stringify [Inline]) where - push (Stringify ils) = Lua.push =<< inlineListToCustom ils +instance PeekError e => Pushable (Stringify e [Inline]) where + push (Stringify ils) = Lua.push =<< + changeErrorType ((inlineListToCustom @e) ils) -instance Pushable (Stringify [Block]) where - push (Stringify blks) = Lua.push =<< blockListToCustom blks +instance PeekError e => Pushable (Stringify e [Block]) where + push (Stringify blks) = Lua.push =<< + changeErrorType ((blockListToCustom @e) blks) -instance Pushable (Stringify MetaValue) where - push (Stringify (MetaMap m)) = Lua.push (fmap Stringify m) - push (Stringify (MetaList xs)) = Lua.push (map Stringify xs) +instance PeekError e => Pushable (Stringify e MetaValue) where + push (Stringify (MetaMap m)) = Lua.push (fmap (Stringify @e) m) + push (Stringify (MetaList xs)) = Lua.push (map (Stringify @e) xs) push (Stringify (MetaBool x)) = Lua.push x push (Stringify (MetaString s)) = Lua.push s - push (Stringify (MetaInlines ils)) = Lua.push (Stringify ils) - push (Stringify (MetaBlocks bs)) = Lua.push (Stringify bs) + push (Stringify (MetaInlines ils)) = Lua.push (Stringify @e ils) + push (Stringify (MetaBlocks bs)) = Lua.push (Stringify @e bs) -instance Pushable (Stringify Citation) where +instance PeekError e => Pushable (Stringify e Citation) where push (Stringify cit) = do Lua.createtable 6 0 addField "citationId" $ citationId cit - addField "citationPrefix" . Stringify $ citationPrefix cit - addField "citationSuffix" . Stringify $ citationSuffix cit + addField "citationPrefix" . Stringify @e $ citationPrefix cit + addField "citationSuffix" . Stringify @e $ citationSuffix cit addField "citationMode" $ show (citationMode cit) addField "citationNoteNum" $ citationNoteNum cit addField "citationHash" $ citationHash cit @@ -77,7 +81,7 @@ instance (Pushable a, Pushable b) => Pushable (KeyValue a b) where Lua.newtable Lua.push k Lua.push v - Lua.rawset (Lua.nthFromTop 3) + Lua.rawset (Lua.nth 3) -- | Convert Pandoc to custom markup. writeCustom :: (PandocMonad m, MonadIO m) @@ -92,7 +96,7 @@ writeCustom luaFile opts doc@(Pandoc meta _) = do -- check for error in lua script (later we'll change the return type -- to handle this more gracefully): when (stat /= Lua.OK) - Lua.throwTopMessage + Lua.throwErrorAsException rendered <- docToCustom opts doc context <- metaToContext opts (fmap (literal . pack) . blockListToCustom) @@ -107,126 +111,132 @@ writeCustom luaFile opts doc@(Pandoc meta _) = do Just tpl -> render Nothing $ renderTemplate tpl $ setField "body" body context -docToCustom :: WriterOptions -> Pandoc -> Lua String +docToCustom :: forall e. PeekError e + => WriterOptions -> Pandoc -> LuaE e String docToCustom opts (Pandoc (Meta metamap) blocks) = do body <- blockListToCustom blocks - Lua.callFunc "Doc" body (fmap Stringify metamap) (writerVariables opts) + invoke @e "Doc" body (fmap (Stringify @e) metamap) (writerVariables opts) -- | Convert Pandoc block element to Custom. -blockToCustom :: Block -- ^ Block element - -> Lua String +blockToCustom :: forall e. PeekError e + => Block -- ^ Block element + -> LuaE e String blockToCustom Null = return "" -blockToCustom (Plain inlines) = Lua.callFunc "Plain" (Stringify inlines) +blockToCustom (Plain inlines) = invoke @e "Plain" (Stringify @e inlines) blockToCustom (Para [Image attr txt (src,tit)]) = - Lua.callFunc "CaptionedImage" src tit (Stringify txt) (attrToMap attr) + invoke @e "CaptionedImage" src tit (Stringify @e txt) (attrToMap attr) -blockToCustom (Para inlines) = Lua.callFunc "Para" (Stringify inlines) +blockToCustom (Para inlines) = invoke @e "Para" (Stringify @e inlines) blockToCustom (LineBlock linesList) = - Lua.callFunc "LineBlock" (map Stringify linesList) + invoke @e "LineBlock" (map (Stringify @e) linesList) blockToCustom (RawBlock format str) = - Lua.callFunc "RawBlock" (Stringify format) str + invoke @e "RawBlock" (Stringify @e format) str -blockToCustom HorizontalRule = Lua.callFunc "HorizontalRule" +blockToCustom HorizontalRule = invoke @e "HorizontalRule" blockToCustom (Header level attr inlines) = - Lua.callFunc "Header" level (Stringify inlines) (attrToMap attr) + invoke @e "Header" level (Stringify @e inlines) (attrToMap attr) blockToCustom (CodeBlock attr str) = - Lua.callFunc "CodeBlock" str (attrToMap attr) + invoke @e "CodeBlock" str (attrToMap attr) blockToCustom (BlockQuote blocks) = - Lua.callFunc "BlockQuote" (Stringify blocks) + invoke @e "BlockQuote" (Stringify @e blocks) blockToCustom (Table _ blkCapt specs thead tbody tfoot) = let (capt, aligns, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot aligns' = map show aligns - capt' = Stringify capt - headers' = map Stringify headers - rows' = map (map Stringify) rows - in Lua.callFunc "Table" capt' aligns' widths headers' rows' + capt' = Stringify @e capt + headers' = map (Stringify @e) headers + rows' = map (map (Stringify @e)) rows + in invoke @e "Table" capt' aligns' widths headers' rows' blockToCustom (BulletList items) = - Lua.callFunc "BulletList" (map Stringify items) + invoke @e "BulletList" (map (Stringify @e) items) blockToCustom (OrderedList (num,sty,delim) items) = - Lua.callFunc "OrderedList" (map Stringify items) num (show sty) (show delim) + invoke @e "OrderedList" (map (Stringify @e) items) num (show sty) (show delim) blockToCustom (DefinitionList items) = - Lua.callFunc "DefinitionList" - (map (KeyValue . (Stringify *** map Stringify)) items) + invoke @e "DefinitionList" + (map (KeyValue . (Stringify @e *** map (Stringify @e))) items) blockToCustom (Div attr items) = - Lua.callFunc "Div" (Stringify items) (attrToMap attr) + invoke @e "Div" (Stringify @e items) (attrToMap attr) -- | Convert list of Pandoc block elements to Custom. -blockListToCustom :: [Block] -- ^ List of block elements - -> Lua String +blockListToCustom :: forall e. PeekError e + => [Block] -- ^ List of block elements + -> LuaE e String blockListToCustom xs = do - blocksep <- Lua.callFunc "Blocksep" + blocksep <- invoke @e "Blocksep" bs <- mapM blockToCustom xs return $ mconcat $ intersperse blocksep bs -- | Convert list of Pandoc inline elements to Custom. -inlineListToCustom :: [Inline] -> Lua String +inlineListToCustom :: forall e. PeekError e => [Inline] -> LuaE e String inlineListToCustom lst = do - xs <- mapM inlineToCustom lst + xs <- mapM (inlineToCustom @e) lst return $ mconcat xs -- | Convert Pandoc inline element to Custom. -inlineToCustom :: Inline -> Lua String +inlineToCustom :: forall e. PeekError e => Inline -> LuaE e String -inlineToCustom (Str str) = Lua.callFunc "Str" str +inlineToCustom (Str str) = invoke @e "Str" str -inlineToCustom Space = Lua.callFunc "Space" +inlineToCustom Space = invoke @e "Space" -inlineToCustom SoftBreak = Lua.callFunc "SoftBreak" +inlineToCustom SoftBreak = invoke @e "SoftBreak" -inlineToCustom (Emph lst) = Lua.callFunc "Emph" (Stringify lst) +inlineToCustom (Emph lst) = invoke @e "Emph" (Stringify @e lst) -inlineToCustom (Underline lst) = Lua.callFunc "Underline" (Stringify lst) +inlineToCustom (Underline lst) = invoke @e "Underline" (Stringify @e lst) -inlineToCustom (Strong lst) = Lua.callFunc "Strong" (Stringify lst) +inlineToCustom (Strong lst) = invoke @e "Strong" (Stringify @e lst) -inlineToCustom (Strikeout lst) = Lua.callFunc "Strikeout" (Stringify lst) +inlineToCustom (Strikeout lst) = invoke @e "Strikeout" (Stringify @e lst) -inlineToCustom (Superscript lst) = Lua.callFunc "Superscript" (Stringify lst) +inlineToCustom (Superscript lst) = invoke @e "Superscript" (Stringify @e lst) -inlineToCustom (Subscript lst) = Lua.callFunc "Subscript" (Stringify lst) +inlineToCustom (Subscript lst) = invoke @e "Subscript" (Stringify @e lst) -inlineToCustom (SmallCaps lst) = Lua.callFunc "SmallCaps" (Stringify lst) +inlineToCustom (SmallCaps lst) = invoke @e "SmallCaps" (Stringify @e lst) -inlineToCustom (Quoted SingleQuote lst) = Lua.callFunc "SingleQuoted" (Stringify lst) +inlineToCustom (Quoted SingleQuote lst) = + invoke @e "SingleQuoted" (Stringify @e lst) -inlineToCustom (Quoted DoubleQuote lst) = Lua.callFunc "DoubleQuoted" (Stringify lst) +inlineToCustom (Quoted DoubleQuote lst) = + invoke @e "DoubleQuoted" (Stringify @e lst) -inlineToCustom (Cite cs lst) = Lua.callFunc "Cite" (Stringify lst) (map Stringify cs) +inlineToCustom (Cite cs lst) = + invoke @e "Cite" (Stringify @e lst) (map (Stringify @e) cs) inlineToCustom (Code attr str) = - Lua.callFunc "Code" str (attrToMap attr) + invoke @e "Code" str (attrToMap attr) inlineToCustom (Math DisplayMath str) = - Lua.callFunc "DisplayMath" str + invoke @e "DisplayMath" str inlineToCustom (Math InlineMath str) = - Lua.callFunc "InlineMath" str + invoke @e "InlineMath" str inlineToCustom (RawInline format str) = - Lua.callFunc "RawInline" (Stringify format) str + invoke @e "RawInline" (Stringify @e format) str -inlineToCustom LineBreak = Lua.callFunc "LineBreak" +inlineToCustom LineBreak = invoke @e "LineBreak" inlineToCustom (Link attr txt (src,tit)) = - Lua.callFunc "Link" (Stringify txt) src tit (attrToMap attr) + invoke @e "Link" (Stringify @e txt) src tit (attrToMap attr) inlineToCustom (Image attr alt (src,tit)) = - Lua.callFunc "Image" (Stringify alt) src tit (attrToMap attr) + invoke @e "Image" (Stringify @e alt) src tit (attrToMap attr) -inlineToCustom (Note contents) = Lua.callFunc "Note" (Stringify contents) +inlineToCustom (Note contents) = invoke @e "Note" (Stringify @e contents) inlineToCustom (Span attr items) = - Lua.callFunc "Span" (Stringify items) (attrToMap attr) + invoke @e "Span" (Stringify @e items) (attrToMap attr) diff --git a/stack.yaml b/stack.yaml index d12ab3587..932f90d34 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,6 +12,19 @@ extra-deps: - doctemplates-0.10 - emojis-0.1.2 - doclayout-0.3.1.1 +- hslua-2.0.0 +- hslua-classes-2.0.0 +- hslua-core-2.0.0 +- hslua-marshalling-2.0.0 +- hslua-module-path-1.0.0 +- hslua-module-system-1.0.0 +- hslua-module-text-1.0.0 +- hslua-module-version-1.0.0 +- hslua-objectorientation-2.0.0 +- hslua-packaging-2.0.0 +- lua-2.0.0 +- tasty-hslua-1.0.0 +- tasty-lua-1.0.0 - git: https://github.com/jgm/pandoc-types.git commit: 99402a46361a3e52805935b1fbe9dfe54f852d6a - git: https://github.com/jgm/texmath.git @@ -26,5 +39,3 @@ ghc-options: resolver: lts-18.10 nix: packages: [zlib] - - diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index 31c011900..e19f6f9e8 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -1,5 +1,6 @@ -{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} {- | Module : Tests.Lua Copyright : © 2017-2021 Albert Krewinkel @@ -14,9 +15,10 @@ Unit and integration tests for pandoc's Lua subsystem. module Tests.Lua ( runLuaTest, tests ) where import Control.Monad (when) +import HsLua as Lua hiding (Operation (Div), error) import System.FilePath (()) import Test.Tasty (TestTree, localOption) -import Test.Tasty.HUnit (Assertion, assertEqual, testCase) +import Test.Tasty.HUnit (Assertion, HasCallStack, assertEqual, testCase) import Test.Tasty.QuickCheck (QuickCheckTests (..), ioProperty, testProperty) import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder (bulletList, definitionList, displayMath, divWith, @@ -25,8 +27,8 @@ import Text.Pandoc.Builder (bulletList, definitionList, displayMath, divWith, singleQuoted, space, str, strong, HasMeta (setMeta)) import Text.Pandoc.Class (runIOorExplode, setUserDataDir) -import Text.Pandoc.Definition (Block (BlockQuote, Div, Para), Inline (Emph, Str), - Attr, Meta, Pandoc, pandocTypesVersion) +import Text.Pandoc.Definition (Attr, Block (BlockQuote, Div, Para), Pandoc, + Inline (Emph, Str), Meta, pandocTypesVersion) import Text.Pandoc.Error (PandocError (PandocLuaError)) import Text.Pandoc.Filter (Filter (LuaFilter), applyFilters) import Text.Pandoc.Lua (runLua) @@ -34,23 +36,22 @@ import Text.Pandoc.Options (def) import Text.Pandoc.Shared (pandocVersion) import qualified Control.Monad.Catch as Catch -import qualified Foreign.Lua as Lua import qualified Data.Text as T import qualified Data.Text.Encoding as TE tests :: [TestTree] tests = map (localOption (QuickCheckTests 20)) [ testProperty "inline elements can be round-tripped through the lua stack" $ - \x -> ioProperty (roundtripEqual (x::Inline)) + ioProperty . roundtripEqual @Inline , testProperty "block elements can be round-tripped through the lua stack" $ - \x -> ioProperty (roundtripEqual (x::Block)) + ioProperty . roundtripEqual @Block , testProperty "meta blocks can be round-tripped through the lua stack" $ - \x -> ioProperty (roundtripEqual (x::Meta)) + ioProperty . roundtripEqual @Meta , testProperty "documents can be round-tripped through the lua stack" $ - \x -> ioProperty (roundtripEqual (x::Pandoc)) + ioProperty . roundtripEqual @Pandoc , testCase "macro expansion via filter" $ assertFilterConversion "a '{{helloworld}}' string is expanded" @@ -163,12 +164,12 @@ tests = map (localOption (QuickCheckTests 20)) Lua.getglobal "PANDOC_VERSION" Lua.liftIO . assertEqual "pandoc version is wrong" (TE.encodeUtf8 pandocVersion) - =<< Lua.tostring' Lua.stackTop + =<< Lua.tostring' Lua.top , testCase "Pandoc types version is set" . runLuaTest $ do Lua.getglobal "PANDOC_API_VERSION" Lua.liftIO . assertEqual "pandoc-types version is wrong" pandocTypesVersion - =<< Lua.peek Lua.stackTop + =<< Lua.peek Lua.top , testCase "require file" $ assertFilterConversion "requiring file failed" @@ -177,38 +178,47 @@ tests = map (localOption (QuickCheckTests 20)) (doc $ para (str . T.pack $ "lua" "require-file.lua")) , testCase "Allow singleton inline in constructors" . runLuaTest $ do - Lua.liftIO . assertEqual "Not the expected Emph" (Emph [Str "test"]) - =<< Lua.callFunc "pandoc.Emph" (Str "test") - Lua.liftIO . assertEqual "Unexpected element" (Para [Str "test"]) - =<< Lua.callFunc "pandoc.Para" ("test" :: String) + Lua.liftIO . assertEqual "Not the expected Emph" + (Emph [Str "test"]) =<< do + Lua.OK <- Lua.dostring "return pandoc.Emph" + Lua.push @Inline (Str "test") + Lua.call 1 1 + Lua.peek @Inline top + Lua.liftIO . assertEqual "Unexpected element" + (Para [Str "test"]) =<< do + Lua.getglobal' "pandoc.Para" + Lua.pushString "test" + Lua.call 1 1 + Lua.peek @Block top Lua.liftIO . assertEqual "Unexptected element" (BlockQuote [Para [Str "foo"]]) =<< ( do Lua.getglobal' "pandoc.BlockQuote" Lua.push (Para [Str "foo"]) _ <- Lua.call 1 1 - Lua.peek Lua.stackTop + Lua.peek @Block Lua.top ) , testCase "Elements with Attr have `attr` accessor" . runLuaTest $ do Lua.push (Div ("hi", ["moin"], []) [Para [Str "ignored"]]) - Lua.getfield Lua.stackTop "attr" + Lua.getfield Lua.top "attr" Lua.liftIO . assertEqual "no accessor" (("hi", ["moin"], []) :: Attr) - =<< Lua.peek Lua.stackTop + =<< Lua.peek Lua.top , testCase "module `pandoc.system` is present" . runLuaTest $ do Lua.getglobal' "pandoc.system" - ty <- Lua.ltype Lua.stackTop + ty <- Lua.ltype Lua.top Lua.liftIO $ assertEqual "module should be a table" Lua.TypeTable ty , testCase "informative error messages" . runLuaTest $ do Lua.pushboolean True - eitherPandoc <- Catch.try (Lua.peek Lua.stackTop :: Lua.Lua Pandoc) + -- Lua.newtable + eitherPandoc <- Catch.try (peek @Pandoc Lua.top) case eitherPandoc of Left (PandocLuaError msg) -> do - let expectedMsg = "Could not get Pandoc value: " - <> "table expected, got boolean" + let expectedMsg = "table expected, got boolean\n" + <> "\twhile retrieving Pandoc value" Lua.liftIO $ assertEqual "unexpected error message" expectedMsg msg Left e -> error ("Expected a Lua error, but got " <> show e) Right _ -> error "Getting a Pandoc element from a bool should fail." @@ -221,19 +231,20 @@ assertFilterConversion msg filterPath docIn expectedDoc = do applyFilters def [LuaFilter ("lua" filterPath)] ["HTML"] docIn assertEqual msg expectedDoc actualDoc -roundtripEqual :: (Eq a, Lua.Peekable a, Lua.Pushable a) => a -> IO Bool +roundtripEqual :: forall a. (Eq a, Lua.Pushable a, Lua.Peekable a) + => a -> IO Bool roundtripEqual x = (x ==) <$> roundtripped where - roundtripped :: Lua.Peekable a => IO a + roundtripped :: IO a roundtripped = runLuaTest $ do oldSize <- Lua.gettop Lua.push x size <- Lua.gettop when (size - oldSize /= 1) $ error ("not exactly one additional element on the stack: " ++ show size) - Lua.peek (-1) + Lua.peek Lua.top -runLuaTest :: Lua.Lua a -> IO a +runLuaTest :: HasCallStack => Lua.LuaE PandocError a -> IO a runLuaTest op = runIOorExplode $ do setUserDataDir (Just "../data") res <- runLua op diff --git a/test/lua/module/pandoc-types.lua b/test/lua/module/pandoc-types.lua index d4e063a5c..d9c9f82ac 100644 --- a/test/lua/module/pandoc-types.lua +++ b/test/lua/module/pandoc-types.lua @@ -55,31 +55,6 @@ return { end), }, - group 'list-like behavior' { - test('can access version component numbers', function () - local version = Version '2.7.3' - assert.is_nil(version[0]) - assert.are_equal(version[1], 2) - assert.are_equal(version[2], 7) - assert.are_equal(version[3], 3) - end), - test('can be iterated over', function () - local version_list = {2, 7, 3} - local final_index = 0 - for i, v in pairs(Version(version_list)) do - assert.are_equal(v, version_list[i]) - final_index = i - end - assert.are_equal(final_index, 3) - end), - test('length is the number of components', function () - assert.are_equal(#(Version '0'), 1) - assert.are_equal(#(Version '1.6'), 2) - assert.are_equal(#(Version '8.7.5'), 3) - assert.are_equal(#(Version '2.9.1.5'), 4) - end) - }, - group 'conversion to string' { test('converting from and to string is a noop', function () local version_string = '1.19.4' -- cgit v1.2.3 From e4287e6c950745ad78954b791bc87f322cd05530 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 20 Oct 2021 21:40:07 +0200 Subject: Lua: marshal Pandoc values as userdata --- data/pandoc.lua | 20 -------------------- src/Text/Pandoc/Lua/Marshaling/AST.hs | 33 +++++++++++++++++++++++---------- src/Text/Pandoc/Lua/Module/Pandoc.hs | 14 +++++++++++++- test/Tests/Lua.hs | 2 +- 4 files changed, 37 insertions(+), 32 deletions(-) diff --git a/data/pandoc.lua b/data/pandoc.lua index 35ca20a84..173c8c179 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -310,26 +310,6 @@ local function ensureAttr(attr) error('Could not convert to Attr') end ------------------------------------------------------------------------- ---- Pandoc Document --- @section document - ---- A complete pandoc document --- @function Pandoc --- @tparam {Block,...} blocks document content --- @tparam[opt] Meta meta document meta data -M.Pandoc = AstElement:make_subtype'Pandoc' -M.Pandoc.behavior.clone = M.types.clone.Pandoc -function M.Pandoc:new (blocks, meta) - return { - blocks = ensureList(blocks), - meta = meta or {}, - } -end - --- DEPRECATED synonym: -M.Doc = M.Pandoc - ------------------------------------------------------------------------ -- Meta -- @section Meta diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index eedf00a94..6f97bdd36 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -40,7 +40,7 @@ import Control.Monad ((<$!>), (>=>)) import HsLua hiding (Operation (Div)) import Text.Pandoc.Definition import Text.Pandoc.Lua.Util (pushViaConstr', pushViaConstructor) -import Text.Pandoc.Lua.Marshaling.CommonState () +import Text.Pandoc.Lua.Marshaling.List (pushPandocList) import qualified HsLua as Lua import qualified Text.Pandoc.Lua.Util as LuaUtil @@ -49,19 +49,32 @@ instance Pushable Pandoc where push = pushPandoc pushPandoc :: LuaError e => Pusher e Pandoc -pushPandoc (Pandoc meta blocks) = - pushViaConstr' "Pandoc" [pushList pushBlock blocks, push meta] +pushPandoc = pushUD typePandoc peekPandoc :: LuaError e => Peeker e Pandoc -peekPandoc = fmap (retrieving "Pandoc value") - . typeChecked "table" Lua.istable $ \idx -> do - meta <- peekFieldRaw peekMeta "meta" idx - blks <- peekFieldRaw peekBlocks "blocks" idx - return $ Pandoc meta blks +peekPandoc = retrieving "Pandoc value" . peekUD typePandoc + +typePandoc :: LuaError e => DocumentedType e Pandoc +typePandoc = deftype "Pandoc" + [ operation Eq $ defun "__eq" + ### liftPure2 (==) + <#> parameter (optional . peekPandoc) "doc1" "pandoc" "" + <#> parameter (optional . peekPandoc) "doc2" "pandoc" "" + =#> functionResult pushBool "boolean" "true iff the two values are equal" + ] + [ property "blocks" "list of blocks" + (pushPandocList pushBlock, \(Pandoc _ blks) -> blks) + (peekList peekBlock, \(Pandoc m _) blks -> Pandoc m blks) + , property "meta" "document metadata" + (pushMeta, \(Pandoc meta _) -> meta) + (peekMeta, \(Pandoc _ blks) meta -> Pandoc meta blks) + ] instance Pushable Meta where - push (Meta mmap) = - pushViaConstr' "Meta" [push mmap] + push = pushMeta + +pushMeta :: LuaError e => Pusher e Meta +pushMeta (Meta mmap) = pushViaConstr' "Meta" [push mmap] peekMeta :: LuaError e => Peeker e Meta peekMeta idx = retrieving "Meta" $ diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 0a9ebaec5..84d6be360 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -15,6 +15,7 @@ module Text.Pandoc.Lua.Module.Pandoc ) where import Prelude hiding (read) +import Control.Applicative (optional) import Control.Monad ((>=>), when) import Control.Monad.Except (throwError) import Data.Default (Default (..)) @@ -23,7 +24,7 @@ import HsLua as Lua hiding (pushModule) import HsLua.Class.Peekable (PeekError) import System.Exit (ExitCode (..)) import Text.Pandoc.Class.PandocIO (runIO) -import Text.Pandoc.Definition (Block, Inline) +import Text.Pandoc.Definition import Text.Pandoc.Lua.Filter (SingletonsList (..), walkInlines, walkInlineLists, walkBlocks, walkBlockLists) import Text.Pandoc.Lua.Marshaling () @@ -51,6 +52,8 @@ pushModule = do addFunction "pipe" pipe addFunction "walk_block" (walkElement peekBlock pushBlock) addFunction "walk_inline" (walkElement peekInline pushInline) + -- Constructors + addFunction "Pandoc" mkPandoc return 1 walkElement :: (Walkable (SingletonsList Inline) a, @@ -142,3 +145,12 @@ pushPipeError pipeErr = do , if output == mempty then BSL.pack "" else output ] return (NumResults 1) + +mkPandoc :: PandocLua NumResults +mkPandoc = liftPandocLua $ do + doc <- forcePeek $ do + blks <- peekBlocks (nthBottom 1) + mMeta <- optional $ peekMeta (nthBottom 2) + pure $ Pandoc (fromMaybe nullMeta mMeta) blks + pushPandoc doc + return 1 diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index e19f6f9e8..5538915a7 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -217,7 +217,7 @@ tests = map (localOption (QuickCheckTests 20)) eitherPandoc <- Catch.try (peek @Pandoc Lua.top) case eitherPandoc of Left (PandocLuaError msg) -> do - let expectedMsg = "table expected, got boolean\n" + let expectedMsg = "Pandoc expected, got boolean\n" <> "\twhile retrieving Pandoc value" Lua.liftIO $ assertEqual "unexpected error message" expectedMsg msg Left e -> error ("Expected a Lua error, but got " <> show e) -- cgit v1.2.3 From 8523bb01b24424249aa409ea577388a1ea10d70a Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 20 Oct 2021 21:40:07 +0200 Subject: Lua: marshal Attr values as userdata - Adds a new `pandoc.AttributeList()` constructor, which creates the associative attribute list that is used as the third component of `Attr` values. Values of this type can often be passed to constructors instead of `Attr` values. - `AttributeList` values can no longer be indexed numerically. --- data/pandoc.lua | 155 +---------------------- pandoc.cabal | 1 + src/Text/Pandoc/Lua/Init.hs | 1 - src/Text/Pandoc/Lua/Marshaling/AST.hs | 18 +-- src/Text/Pandoc/Lua/Marshaling/Attr.hs | 225 +++++++++++++++++++++++++++++++++ src/Text/Pandoc/Lua/Module/Pandoc.hs | 3 + test/Tests/Lua.hs | 2 +- test/lua/module/pandoc.lua | 55 +++++--- 8 files changed, 272 insertions(+), 188 deletions(-) create mode 100644 src/Text/Pandoc/Lua/Marshaling/Attr.hs diff --git a/data/pandoc.lua b/data/pandoc.lua index 173c8c179..059ff9a3a 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -281,33 +281,12 @@ local function ensureDefinitionPairs (pair) return {inlines, blocks} end ---- Split a string into it's words, using whitespace as separators. -local function words (str) - local ws = {} - for w in str:gmatch("([^%s]+)") do ws[#ws + 1] = w end - return ws -end - --- Try hard to turn the arguments into an Attr object. local function ensureAttr(attr) - if type(attr) == 'table' then - if #attr > 0 then return M.Attr(table.unpack(attr)) end - - -- assume HTML-like key-value pairs - local ident = attr.id or '' - local classes = words(attr.class or '') - local attributes = attr - attributes.id = nil - attributes.class = nil - return M.Attr(ident, classes, attributes) - elseif attr == nil then - return M.Attr() - elseif type(attr) == 'string' then - -- treat argument as ID - return M.Attr(attr) + if type(attr) == 'userdata' then + return attr end - -- print(arg, ...) - error('Could not convert to Attr') + return M.Attr(attr) end ------------------------------------------------------------------------ @@ -831,134 +810,6 @@ M.Underline = M.Inline:create_constructor( -- Element components -- @section components ---- Check if the first element of a pair matches the given value. --- @param x key value to be checked --- @return function returning true iff first element of its argument matches x --- @local -local function assoc_key_equals (x) - return function (y) return y[1] == x end -end - ---- Lookup a value in an associative list --- @function lookup --- @local --- @tparam {{key, value},...} alist associative list --- @param key key for which the associated value is to be looked up -local function lookup(alist, key) - return (List.find_if(alist, assoc_key_equals(key)) or {})[2] -end - ---- Return an iterator which returns key-value pairs of an associative list. --- @function apairs --- @local --- @tparam {{key, value},...} alist associative list -local apairs = function (alist) - local i = 1 - local cur - function nxt () - cur = rawget(alist, i) - if cur then - i = i + 1 - return cur[1], cur[2] - end - return nil - end - return nxt, nil, nil -end - ---- AttributeList, a metatable to allow table-like access to attribute lists --- represented by associative lists. --- @local -local AttributeList = { - __index = function (t, k) - if type(k) == "number" then - return rawget(t, k) - else - return lookup(t, k) - end - end, - - __newindex = function (t, k, v) - local cur, idx = List.find_if(t, assoc_key_equals(k)) - if v == nil and not cur then - -- deleted key does not exists in list - return - elseif v == nil then - table.remove(t, idx) - elseif cur then - cur[2] = v - elseif type(k) == "number" then - rawset(t, k, v) - else - rawset(t, #t + 1, {k, v}) - end - end, - - __pairs = apairs -} - ---- Convert a table to an associative list. The order of key-value pairs in the --- alist is undefined. The table should either contain no numeric keys or --- already be an associative list. --- @local --- @tparam table tbl associative list or table without numeric keys. --- @treturn table associative list -local to_alist = function (tbl) - if #tbl ~= 0 or next(tbl) == nil then - -- probably already an alist - return tbl - end - local alist = {} - local i = 1 - for k, v in pairs(tbl) do - alist[i] = {k, v} - i = i + 1 - end - return alist -end - --- Attr - ---- Create a new set of attributes (Attr). --- @function Attr --- @tparam[opt] string identifier element identifier --- @tparam[opt] {string,...} classes element classes --- @tparam[opt] table attributes table containing string keys and values --- @return element attributes -M.Attr = AstElement:make_subtype'Attr' -function M.Attr:new (identifier, classes, attributes) - identifier = identifier or '' - classes = ensureList(classes or {}) - attributes = setmetatable(to_alist(attributes or {}), AttributeList) - return setmetatable({identifier, classes, attributes}, self.behavior) -end -M.Attr.behavior.clone = M.types.clone.Attr -M.Attr.behavior.tag = 'Attr' -M.Attr.behavior._field_names = {identifier = 1, classes = 2, attributes = 3} -M.Attr.behavior.__eq = utils.equals -M.Attr.behavior.__index = function(t, k) - return (k == 't' and t.tag) or - rawget(t, getmetatable(t)._field_names[k]) or - getmetatable(t)[k] -end -M.Attr.behavior.__newindex = function(t, k, v) - if k == 'attributes' then - rawset(t, 3, setmetatable(to_alist(v or {}), AttributeList)) - elseif getmetatable(t)._field_names[k] then - rawset(t, getmetatable(t)._field_names[k], v) - else - rawset(t, k, v) - end -end -M.Attr.behavior.__pairs = function(t) - local field_names = M.Attr.behavior._field_names - local fields = {} - for name, i in pairs(field_names) do - fields[i] = name - end - return make_next_function(fields), t, nil -end - -- Monkey-patch setters for `attr` fields to be more forgiving in the input that -- results in a valid Attr value. function augment_attr_setter (setters) diff --git a/pandoc.cabal b/pandoc.cabal index 886d3fa9d..9cf609049 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -776,6 +776,7 @@ library Text.Pandoc.Lua.Init, Text.Pandoc.Lua.Marshaling, Text.Pandoc.Lua.Marshaling.AST, + Text.Pandoc.Lua.Marshaling.Attr, Text.Pandoc.Lua.Marshaling.CommonState, Text.Pandoc.Lua.Marshaling.Context, Text.Pandoc.Lua.Marshaling.List, diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index a9c3695a4..d9b210c55 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -89,7 +89,6 @@ putConstructorsInRegistry = liftPandocLua $ do constrsToReg $ Pandoc.Meta mempty constrsToReg $ Pandoc.MetaList mempty constrsToReg $ Pandoc.Citation mempty mempty mempty Pandoc.AuthorInText 0 0 - putInReg "Attr" -- used for Attr type alias putInReg "ListAttributes" -- used for ListAttributes type alias putInReg "List" -- pandoc.List putInReg "SimpleTable" -- helper for backward-compatible table handling diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 6f97bdd36..9bb956ba2 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -40,6 +41,7 @@ import Control.Monad ((<$!>), (>=>)) import HsLua hiding (Operation (Div)) import Text.Pandoc.Definition import Text.Pandoc.Lua.Util (pushViaConstr', pushViaConstructor) +import Text.Pandoc.Lua.Marshaling.Attr (peekAttr, pushAttr) import Text.Pandoc.Lua.Marshaling.List (pushPandocList) import qualified HsLua as Lua @@ -413,19 +415,6 @@ peekInline = retrieving "Inline" . \idx -> do "Superscript"-> mkBlock Superscript peekInlines Name tag -> Lua.failPeek ("Unknown inline type: " <> tag) -pushAttr :: forall e. LuaError e => Attr -> LuaE e () -pushAttr (id', classes, kv) = pushViaConstr' @e "Attr" - [ pushText id' - , pushList pushText classes - , pushList (pushPair pushText pushText) kv - ] - -peekAttr :: LuaError e => Peeker e Attr -peekAttr = retrieving "Attr" . peekTriple - peekText - (peekList peekText) - (peekList (peekPair peekText peekText)) - pushListAttributes :: forall e. LuaError e => ListAttributes -> LuaE e () pushListAttributes (start, style, delimiter) = pushViaConstr' "ListAttributes" @@ -450,3 +439,6 @@ instance Peekable Meta where instance Peekable Pandoc where peek = forcePeek . peekPandoc + +instance {-# OVERLAPPING #-} Peekable Attr where + peek = forcePeek . peekAttr diff --git a/src/Text/Pandoc/Lua/Marshaling/Attr.hs b/src/Text/Pandoc/Lua/Marshaling/Attr.hs new file mode 100644 index 000000000..1b35e40ad --- /dev/null +++ b/src/Text/Pandoc/Lua/Marshaling/Attr.hs @@ -0,0 +1,225 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TupleSections #-} +{-# LANGUAGE TypeApplications #-} +{- | +Module : Text.Pandoc.Lua.Marshaling.Attr +Copyright : © 2012-2021 John MacFarlane + © 2017-2021 Albert Krewinkel +License : GNU GPL, version 2 or above + +Maintainer : Albert Krewinkel +Stability : alpha + +Marshaling/unmarshaling instances for document AST elements. +-} +module Text.Pandoc.Lua.Marshaling.Attr + ( typeAttr + , peekAttr + , pushAttr + , mkAttr + , mkAttributeList + ) where + +import Control.Applicative ((<|>), optional) +import Control.Monad ((<$!>)) +import Data.Maybe (fromMaybe) +import Data.Text (Text) +import HsLua +import HsLua.Marshalling.Peekers (peekIndexRaw) +import Safe (atMay) +import Text.Pandoc.Definition (Attr, nullAttr) +import Text.Pandoc.Lua.Marshaling.List (pushPandocList) + +import qualified Data.Text as T + +typeAttr :: LuaError e => DocumentedType e Attr +typeAttr = deftype "Attr" + [ operation Eq $ lambda + ### liftPure2 (==) + <#> parameter peekAttr "a1" "Attr" "" + <#> parameter peekAttr "a2" "Attr" "" + =#> functionResult pushBool "boolean" "whether the two are equal" + ] + [ property "identifier" "element identifier" + (pushText, \(ident,_,_) -> ident) + (peekText, \(_,cls,kv) -> (,cls,kv)) + , property "classes" "element classes" + (pushPandocList pushText, \(_,classes,_) -> classes) + (peekList peekText, \(ident,_,kv) -> (ident,,kv)) + , property "attributes" "various element attributes" + (pushAttribs, \(_,_,attribs) -> attribs) + (peekAttribs, \(ident,cls,_) -> (ident,cls,)) + , method $ defun "clone" + ### return + <#> parameter peekAttr "attr" "Attr" "" + =#> functionResult pushAttr "Attr" "new Attr element" + ] + +pushAttr :: LuaError e => Pusher e Attr +pushAttr = pushUD typeAttr + +peekAttribs :: LuaError e => Peeker e [(Text,Text)] +peekAttribs idx = liftLua (ltype idx) >>= \case + TypeUserdata -> peekUD typeAttributeList idx + TypeTable -> liftLua (rawlen idx) >>= \case + 0 -> peekKeyValuePairs peekText peekText idx + _ -> peekList (peekPair peekText peekText) idx + _ -> fail "unsupported type" + +pushAttribs :: LuaError e => Pusher e [(Text, Text)] +pushAttribs = pushUD typeAttributeList + +typeAttributeList :: LuaError e => DocumentedType e [(Text, Text)] +typeAttributeList = deftype "AttributeList" + [ operation Eq $ lambda + ### liftPure2 (==) + <#> parameter peekAttribs "a1" "AttributeList" "" + <#> parameter peekAttribs "a2" "AttributeList" "" + =#> functionResult pushBool "boolean" "whether the two are equal" + + , operation Index $ lambda + ### liftPure2 lookupKey + <#> udparam typeAttributeList "t" "attributes list" + <#> parameter peekKey "string|integer" "key" "lookup key" + =#> functionResult (maybe pushnil pushAttribute) "string|table" + "attribute value" + + , operation Newindex $ lambda + ### setKey + <#> udparam typeAttributeList "t" "attributes list" + <#> parameter peekKey "string|integer" "key" "lookup key" + <#> optionalParameter peekAttribute "string|nil" "value" "new value" + =#> [] + + , operation Len $ lambda + ### liftPure length + <#> udparam typeAttributeList "t" "attributes list" + =#> functionResult pushIntegral "integer" "number of attributes in list" + + , operation Pairs $ lambda + ### pushIterator (\(k, v) -> 2 <$ pushText k <* pushText v) + <#> udparam typeAttributeList "t" "attributes list" + =?> "iterator triple" + + , operation Tostring $ lambda + ### liftPure show + <#> udparam typeAttributeList "t" "attributes list" + =#> functionResult pushString "string" "" + ] + [] + +data Key = StringKey Text | IntKey Int + +peekKey :: LuaError e => Peeker e (Maybe Key) +peekKey idx = liftLua (ltype idx) >>= \case + TypeNumber -> Just . IntKey <$!> peekIntegral idx + TypeString -> Just . StringKey <$!> peekText idx + _ -> return Nothing + +data Attribute + = AttributePair (Text, Text) + | AttributeValue Text + +pushAttribute :: LuaError e => Pusher e Attribute +pushAttribute = \case + (AttributePair kv) -> pushPair pushText pushText kv + (AttributeValue v) -> pushText v + +-- | Retrieve an 'Attribute'. +peekAttribute :: LuaError e => Peeker e Attribute +peekAttribute idx = (AttributeValue <$!> peekText idx) + <|> (AttributePair <$!> peekPair peekText peekText idx) + +lookupKey :: [(Text,Text)] -> Maybe Key -> Maybe Attribute +lookupKey !kvs = \case + Just (StringKey str) -> AttributeValue <$> lookup str kvs + Just (IntKey n) -> AttributePair <$!> atMay kvs (n - 1) + Nothing -> Nothing + +setKey :: forall e. LuaError e + => [(Text, Text)] -> Maybe Key -> Maybe Attribute + -> LuaE e () +setKey kvs mbKey mbValue = case mbKey of + Just (StringKey str) -> + case break ((== str) . fst) kvs of + (prefix, _:suffix) -> case mbValue of + Nothing -> setNew $ prefix ++ suffix + Just (AttributeValue value) -> setNew $ prefix ++ (str, value):suffix + _ -> failLua "invalid attribute value" + _ -> case mbValue of + Nothing -> return () + Just (AttributeValue value) -> setNew (kvs ++ [(str, value)]) + _ -> failLua "invalid attribute value" + Just (IntKey idx) -> + case splitAt (idx - 1) kvs of + (prefix, (k,_):suffix) -> setNew $ case mbValue of + Nothing -> prefix ++ suffix + Just (AttributePair kv) -> prefix ++ kv : suffix + Just (AttributeValue v) -> prefix ++ (k, v) : suffix + (prefix, []) -> case mbValue of + Nothing -> setNew prefix + Just (AttributePair kv) -> setNew $ prefix ++ [kv] + _ -> failLua $ "trying to set an attribute key-value pair, " + ++ "but got a single string instead." + + _ -> failLua "invalid attribute key" + where + setNew :: [(Text, Text)] -> LuaE e () + setNew new = + putuserdata (nthBottom 1) (udName @e typeAttributeList) new >>= \case + True -> return () + False -> failLua "failed to modify attributes list" + +peekAttr :: LuaError e => Peeker e Attr +peekAttr idx = retrieving "Attr" $ liftLua (ltype idx) >>= \case + TypeString -> (,[],[]) <$!> peekText idx -- treat string as ID + TypeUserdata -> peekUD typeAttr idx + TypeTable -> peekAttrTable idx + x -> liftLua . failLua $ "Cannot get Attr from " ++ show x + +-- | Helper function which gets an Attr from a Lua table. +peekAttrTable :: LuaError e => Peeker e Attr +peekAttrTable idx = do + len' <- liftLua $ rawlen idx + let peekClasses = peekList peekText + if len' > 0 + then do + ident <- peekIndexRaw 1 peekText idx + classes <- fromMaybe [] <$!> optional (peekIndexRaw 2 peekClasses idx) + attribs <- fromMaybe [] <$!> optional (peekIndexRaw 3 peekAttribs idx) + return $ ident `seq` classes `seq` attribs `seq` + (ident, classes, attribs) + else retrieving "HTML-like attributes" $ do + kvs <- peekKeyValuePairs peekText peekText idx + let ident = fromMaybe "" $ lookup "id" kvs + let classes = maybe [] T.words $ lookup "class" kvs + let attribs = filter ((`notElem` ["id", "class"]) . fst) kvs + return $ ident `seq` classes `seq` attribs `seq` + (ident, classes, attribs) + +mkAttr :: LuaError e => LuaE e NumResults +mkAttr = do + attr <- ltype (nthBottom 1) >>= \case + TypeString -> forcePeek $ do + mident <- optional (peekText (nthBottom 1)) + mclass <- optional (peekList peekText (nthBottom 2)) + mattribs <- optional (peekAttribs (nthBottom 3)) + return (fromMaybe "" mident, fromMaybe [] mclass, fromMaybe [] mattribs) + TypeTable -> forcePeek $ peekAttrTable (nthBottom 1) + TypeUserdata -> forcePeek $ peekUD typeAttr (nthBottom 1) <|> do + attrList <- peekUD typeAttributeList (nthBottom 1) + return ("", [], attrList) + TypeNil -> pure nullAttr + TypeNone -> pure nullAttr + x -> failLua $ "Cannot create Attr from " ++ show x + pushAttr attr + return 1 + +mkAttributeList :: LuaError e => LuaE e NumResults +mkAttributeList = do + attribs <- forcePeek $ peekAttribs (nthBottom 1) + pushUD typeAttributeList attribs + return 1 diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 84d6be360..34317276d 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -29,6 +29,7 @@ import Text.Pandoc.Lua.Filter (SingletonsList (..), walkInlines, walkInlineLists, walkBlocks, walkBlockLists) import Text.Pandoc.Lua.Marshaling () import Text.Pandoc.Lua.Marshaling.AST +import Text.Pandoc.Lua.Marshaling.Attr (mkAttr, mkAttributeList) import Text.Pandoc.Lua.Marshaling.List (List (..)) import Text.Pandoc.Lua.PandocLua (PandocLua, addFunction, liftPandocLua, loadDefaultModule) @@ -54,6 +55,8 @@ pushModule = do addFunction "walk_inline" (walkElement peekInline pushInline) -- Constructors addFunction "Pandoc" mkPandoc + addFunction "Attr" (liftPandocLua mkAttr) + addFunction "AttributeList" (liftPandocLua mkAttributeList) return 1 walkElement :: (Walkable (SingletonsList Inline) a, diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index 5538915a7..d3694d8a9 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -204,7 +204,7 @@ tests = map (localOption (QuickCheckTests 20)) [Para [Str "ignored"]]) Lua.getfield Lua.top "attr" Lua.liftIO . assertEqual "no accessor" (("hi", ["moin"], []) :: Attr) - =<< Lua.peek Lua.top + =<< Lua.peek @Attr Lua.top , testCase "module `pandoc.system` is present" . runLuaTest $ do Lua.getglobal' "pandoc.system" diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index fa1748c18..a1bcd53fe 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -11,34 +11,32 @@ end return { group 'Attr' { group 'Constructor' { + test('pandoc.Attr is a function', function () + assert.are_equal(type(pandoc.Attr), 'function') + end), test('returns null-Attr if no arguments are given', function () local attr = pandoc.Attr() assert.are_equal(attr.identifier, '') assert.are_same(attr.classes, {}) - assert.are_same(attr.attributes, {}) + assert.are_same(#attr.attributes, 0) end), test( 'accepts string-indexed table or list of pairs as attributes', function () - local attributes_list = pandoc.List:new {{'one', '1'}, {'two', '2'}} - local attr_from_list = pandoc.Attr('', {}, attributes_list:clone()) + local attributes_list = {{'one', '1'}, {'two', '2'}} + local attr_from_list = pandoc.Attr('', {}, attributes_list) - assert.are_same( - pandoc.List:new(attr_from_list.attributes), - attributes_list - ) + assert.are_equal(attr_from_list.attributes.one, '1') + assert.are_equal(attr_from_list.attributes.two, '2') local attributes_table = {one = '1', two = '2'} local attr_from_table = pandoc.Attr('', {}, attributes_table) - - local assoc_list_from_table = - pandoc.List:new(attr_from_table.attributes) - -- won't work in general, but does in this special case - table.sort(assoc_list_from_table, function(x, y) return x[1] Date: Wed, 20 Oct 2021 21:40:07 +0200 Subject: Lua: marshal Inline elements as userdata This includes the following user-facing changes: - Deprecated inline constructors are removed. These are `DoubleQuoted`, `SingleQuoted`, `DisplayMath`, and `InlineMath`. - Attr values are no longer normalized when assigned to an Inline element property. - It's no longer possible to access parts of Inline elements via numerical indexes. E.g., `pandoc.Span('test')[2]` used to give `pandoc.Str 'test'`, but yields `nil` now. This was undocumented behavior not intended to be used in user scripts. Use named properties instead. - Accessing `.c` to get a JSON-like tuple of all components no longer works. This was undocumented behavior. - Only known properties can be set on an element value. Trying to set a different property will now raise an error. --- data/pandoc.lua | 271 ------------------------------- src/Text/Pandoc/Lua/Marshaling/AST.hs | 298 +++++++++++++++++++++++++++------- src/Text/Pandoc/Lua/Module/Pandoc.hs | 110 ++++++++++++- 3 files changed, 345 insertions(+), 334 deletions(-) diff --git a/data/pandoc.lua b/data/pandoc.lua index 059ff9a3a..8fbd2259b 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -539,273 +539,6 @@ M.Table = M.Block:create_constructor( ) ------------------------------------------------------------------------- --- Inline --- @section Inline - ---- Inline element class -M.Inline = AstElement:make_subtype'Inline' -M.Inline.behavior.clone = M.types.clone.Inline - ---- Creates a Cite inline element --- @function Cite --- @tparam {Inline,...} content List of inlines --- @tparam {Citation,...} citations List of citations --- @treturn Inline citations element -M.Cite = M.Inline:create_constructor( - "Cite", - function(content, citations) - return {c = {ensureList(citations), ensureInlineList(content)}} - end, - {"citations", "content"} -) - ---- Creates a Code inline element --- @function Code --- @tparam string text code string --- @tparam[opt] Attr attr additional attributes --- @treturn Inline code element -M.Code = M.Inline:create_constructor( - "Code", - function(text, attr) return {c = {ensureAttr(attr), text}} end, - {{attr = {"identifier", "classes", "attributes"}}, "text"} -) - ---- Creates an inline element representing emphasised text. --- @function Emph --- @tparam {Inline,..} content inline content --- @treturn Inline emphasis element -M.Emph = M.Inline:create_constructor( - "Emph", - function(content) return {c = ensureInlineList(content)} end, - "content" -) - ---- Creates a Image inline element --- @function Image --- @tparam {Inline,..} caption text used to describe the image --- @tparam string src path to the image file --- @tparam[opt] string title brief image description --- @tparam[opt] Attr attr additional attributes --- @treturn Inline image element -M.Image = M.Inline:create_constructor( - "Image", - function(caption, src, title, attr) - title = title or "" - return {c = {ensureAttr(attr), ensureInlineList(caption), {src, title}}} - end, - {{attr = {"identifier", "classes", "attributes"}}, "caption", {"src", "title"}} -) - ---- Create a LineBreak inline element --- @function LineBreak --- @treturn Inline linebreak element -M.LineBreak = M.Inline:create_constructor( - "LineBreak", - function() return {} end -) - ---- Creates a link inline element, usually a hyperlink. --- @function Link --- @tparam {Inline,..} content text for this link --- @tparam string target the link target --- @tparam[opt] string title brief link description --- @tparam[opt] Attr attr additional attributes --- @treturn Inline image element -M.Link = M.Inline:create_constructor( - "Link", - function(content, target, title, attr) - title = title or "" - attr = ensureAttr(attr) - return {c = {attr, ensureInlineList(content), {target, title}}} - end, - {{attr = {"identifier", "classes", "attributes"}}, "content", {"target", "title"}} -) - ---- Creates a Math element, either inline or displayed. --- @function Math --- @tparam "InlineMath"|"DisplayMath" mathtype rendering specifier --- @tparam string text Math content --- @treturn Inline Math element -M.Math = M.Inline:create_constructor( - "Math", - function(mathtype, text) - return {c = {mathtype, text}} - end, - {"mathtype", "text"} -) ---- Creates a DisplayMath element (DEPRECATED). --- @function DisplayMath --- @tparam string text Math content --- @treturn Inline Math element -M.DisplayMath = M.Inline:create_constructor( - "DisplayMath", - function(text) return M.Math("DisplayMath", text) end, - {"mathtype", "text"} -) ---- Creates an InlineMath inline element (DEPRECATED). --- @function InlineMath --- @tparam string text Math content --- @treturn Inline Math element -M.InlineMath = M.Inline:create_constructor( - "InlineMath", - function(text) return M.Math("InlineMath", text) end, - {"mathtype", "text"} -) - ---- Creates a Note inline element --- @function Note --- @tparam {Block,...} content footnote block content -M.Note = M.Inline:create_constructor( - "Note", - function(content) return {c = ensureList(content)} end, - "content" -) - ---- Creates a Quoted inline element given the quote type and quoted content. --- @function Quoted --- @tparam "DoubleQuote"|"SingleQuote" quotetype type of quotes to be used --- @tparam {Inline,..} content inline content --- @treturn Inline quoted element -M.Quoted = M.Inline:create_constructor( - "Quoted", - function(quotetype, content) - return {c = {quotetype, ensureInlineList(content)}} - end, - {"quotetype", "content"} -) ---- Creates a single-quoted inline element (DEPRECATED). --- @function SingleQuoted --- @tparam {Inline,..} content inline content --- @treturn Inline quoted element --- @see Quoted -M.SingleQuoted = M.Inline:create_constructor( - "SingleQuoted", - function(content) return M.Quoted(M.SingleQuote, content) end, - {"quotetype", "content"} -) ---- Creates a single-quoted inline element (DEPRECATED). --- @function DoubleQuoted --- @tparam {Inline,..} content inline content --- @treturn Inline quoted element --- @see Quoted -M.DoubleQuoted = M.Inline:create_constructor( - "DoubleQuoted", - function(content) return M.Quoted("DoubleQuote", content) end, - {"quotetype", "content"} -) - ---- Creates a RawInline inline element --- @function RawInline --- @tparam string format format of the contents --- @tparam string text string content --- @treturn Inline raw inline element -M.RawInline = M.Inline:create_constructor( - "RawInline", - function(format, text) return {c = {format, text}} end, - {"format", "text"} -) - ---- Creates text rendered in small caps --- @function SmallCaps --- @tparam {Inline,..} content inline content --- @treturn Inline smallcaps element -M.SmallCaps = M.Inline:create_constructor( - "SmallCaps", - function(content) return {c = ensureInlineList(content)} end, - "content" -) - ---- Creates a SoftBreak inline element. --- @function SoftBreak --- @treturn Inline softbreak element -M.SoftBreak = M.Inline:create_constructor( - "SoftBreak", - function() return {} end -) - ---- Create a Space inline element --- @function Space --- @treturn Inline space element -M.Space = M.Inline:create_constructor( - "Space", - function() return {} end -) - ---- Creates a Span inline element --- @function Span --- @tparam {Inline,..} content inline content --- @tparam[opt] Attr attr additional attributes --- @treturn Inline span element -M.Span = M.Inline:create_constructor( - "Span", - function(content, attr) - return {c = {ensureAttr(attr), ensureInlineList(content)}} - end, - {{attr = {"identifier", "classes", "attributes"}}, "content"} -) - ---- Creates a Str inline element --- @function Str --- @tparam string text content --- @treturn Inline string element -M.Str = M.Inline:create_constructor( - "Str", - function(text) return {c = text} end, - "text" -) - ---- Creates text which is striked out. --- @function Strikeout --- @tparam {Inline,..} content inline content --- @treturn Inline strikeout element -M.Strikeout = M.Inline:create_constructor( - "Strikeout", - function(content) return {c = ensureInlineList(content)} end, - "content" -) - ---- Creates a Strong element, whose text is usually displayed in a bold font. --- @function Strong --- @tparam {Inline,..} content inline content --- @treturn Inline strong element -M.Strong = M.Inline:create_constructor( - "Strong", - function(content) return {c = ensureInlineList(content)} end, - "content" -) - ---- Creates a Subscript inline element --- @function Subscript --- @tparam {Inline,..} content inline content --- @treturn Inline subscript element -M.Subscript = M.Inline:create_constructor( - "Subscript", - function(content) return {c = ensureInlineList(content)} end, - "content" -) - ---- Creates a Superscript inline element --- @function Superscript --- @tparam {Inline,..} content inline content --- @treturn Inline superscript element -M.Superscript = M.Inline:create_constructor( - "Superscript", - function(content) return {c = ensureInlineList(content)} end, - "content" -) - ---- Creates an Underline inline element --- @function Underline --- @tparam {Inline,..} content inline content --- @treturn Inline underline element -M.Underline = M.Inline:create_constructor( - "Underline", - function(content) return {c = ensureInlineList(content)} end, - "content" -) - - ------------------------------------------------------------------------ -- Element components -- @section components @@ -823,10 +556,6 @@ end for _, blk in pairs(M.Block.constructor) do augment_attr_setter(blk.behavior.setters) end -for _, inln in pairs(M.Inline.constructor) do - augment_attr_setter(inln.behavior.setters) -end - -- Citation M.Citation = AstElement:make_subtype'Citation' diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 9bb956ba2..1e635483c 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -3,6 +3,7 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Marshaling.AST @@ -21,12 +22,18 @@ module Text.Pandoc.Lua.Marshaling.AST , peekBlocks , peekCaption , peekCitation + , peekFormat , peekInline , peekInlines , peekListAttributes , peekMeta , peekMetaValue , peekPandoc + , peekMathType + , peekQuoteType + + , peekFuzzyInlines + , peekFuzzyBlocks , pushAttr , pushBlock @@ -37,9 +44,13 @@ module Text.Pandoc.Lua.Marshaling.AST ) where import Control.Applicative ((<|>), optional) +import Control.Monad.Catch (throwM) import Control.Monad ((<$!>), (>=>)) +import Data.Data (showConstr, toConstr) +import Data.Text (Text) import HsLua hiding (Operation (Div)) import Text.Pandoc.Definition +import Text.Pandoc.Error (PandocError (PandocLuaError)) import Text.Pandoc.Lua.Util (pushViaConstr', pushViaConstructor) import Text.Pandoc.Lua.Marshaling.Attr (peekAttr, pushAttr) import Text.Pandoc.Lua.Marshaling.List (pushPandocList) @@ -94,10 +105,13 @@ instance Pushable Inline where -- Citation instance Pushable Citation where - push (Citation cid prefix suffix mode noteNum hash) = - pushViaConstr' "Citation" - [ push cid, push mode, push prefix, push suffix, push noteNum, push hash - ] + push = pushCitation + +pushCitation :: LuaError e => Pusher e Citation +pushCitation (Citation cid prefix suffix mode noteNum hash) = + pushViaConstr' "Citation" + [ push cid, push mode, push prefix, push suffix, push noteNum, push hash + ] peekCitation :: LuaError e => Peeker e Citation peekCitation = fmap (retrieving "Citation") @@ -119,7 +133,10 @@ instance Pushable CitationMode where push = Lua.push . show instance Pushable Format where - push (Format f) = Lua.push f + push = pushFormat + +pushFormat :: LuaError e => Pusher e Format +pushFormat (Format f) = pushText f peekFormat :: LuaError e => Peeker e Format peekFormat idx = Format <$!> peekText idx @@ -134,7 +151,19 @@ instance Pushable MathType where push = Lua.push . show instance Pushable QuoteType where - push = Lua.push . show + push = pushQuoteType + +pushMathType :: LuaError e => Pusher e MathType +pushMathType = pushString . show + +peekMathType :: LuaError e => Peeker e MathType +peekMathType = peekRead + +pushQuoteType :: LuaError e => Pusher e QuoteType +pushQuoteType = pushString . show + +peekQuoteType :: LuaError e => Peeker e QuoteType +peekQuoteType = peekRead -- | Push an meta value element to the top of the lua stack. pushMetaValue :: LuaError e => MetaValue -> LuaE e () @@ -354,66 +383,213 @@ peekCell = fmap (retrieving "Cell") blks <- peekFieldRaw peekBlocks "contents" idx return $! Cell attr algn rs cs blks +getInlineText :: Inline -> Possible Text +getInlineText = \case + Code _ lst -> Actual lst + Math _ str -> Actual str + RawInline _ raw -> Actual raw + Str s -> Actual s + _ -> Absent + +setInlineText :: Inline -> Text -> Possible Inline +setInlineText = \case + Code attr _ -> Actual . Code attr + Math mt _ -> Actual . Math mt + RawInline f _ -> Actual . RawInline f + Str _ -> Actual . Str + _ -> const Absent + +data Content + = ContentBlocks [Block] + | ContentInlines [Inline] + +setInlineContent :: Inline -> Content -> Possible Inline +setInlineContent = \case + -- inline content + Cite cs _ -> Actual . Cite cs . inlineContent + Emph _ -> Actual . Emph . inlineContent + Quoted qt _ -> Actual . Quoted qt . inlineContent + SmallCaps _ -> Actual . SmallCaps . inlineContent + Span attr _ -> Actual . Span attr . inlineContent + Strong _ -> Actual . Strong . inlineContent + Subscript _ -> Actual . Subscript . inlineContent + Superscript _ -> Actual . Superscript . inlineContent + Underline _ -> Actual . Underline . inlineContent + -- block content + Note _ -> Actual . Note . blockContent + _ -> const Absent + where + inlineContent = \case + ContentInlines inlns -> inlns + ContentBlocks _ -> throwM $ + PandocLuaError "expected Inlines, got Blocks" + blockContent = \case + ContentBlocks blks -> blks + ContentInlines [] -> [] + ContentInlines _ -> throwM $ + PandocLuaError "expected Blocks, got Inlines" + +getInlineContent :: Inline -> Possible Content +getInlineContent = \case + Cite _ inlns -> Actual $ ContentInlines inlns + Emph inlns -> Actual $ ContentInlines inlns + Quoted _ inlns -> Actual $ ContentInlines inlns + SmallCaps inlns -> Actual $ ContentInlines inlns + Span _ inlns -> Actual $ ContentInlines inlns + Strong inlns -> Actual $ ContentInlines inlns + Subscript inlns -> Actual $ ContentInlines inlns + Superscript inlns -> Actual $ ContentInlines inlns + Underline inlns -> Actual $ ContentInlines inlns + Note blks -> Actual $ ContentBlocks blks + _ -> Absent + +-- title +getInlineTitle :: Inline -> Possible Text +getInlineTitle = \case + Image _ _ (_, tit) -> Actual tit + Link _ _ (_, tit) -> Actual tit + _ -> Absent + +setInlineTitle :: Inline -> Text -> Possible Inline +setInlineTitle = \case + Image attr capt (src, _) -> Actual . Image attr capt . (src,) + Link attr capt (src, _) -> Actual . Link attr capt . (src,) + _ -> const Absent + +-- attr +getInlineAttr :: Inline -> Possible Attr +getInlineAttr = \case + Code attr _ -> Actual attr + Image attr _ _ -> Actual attr + Link attr _ _ -> Actual attr + Span attr _ -> Actual attr + _ -> Absent + +setInlineAttr :: Inline -> Attr -> Possible Inline +setInlineAttr = \case + Code _ cs -> Actual . (`Code` cs) + Image _ cpt tgt -> Actual . \attr -> Image attr cpt tgt + Link _ cpt tgt -> Actual . \attr -> Link attr cpt tgt + Span _ inlns -> Actual . (`Span` inlns) + _ -> const Absent + +showInline :: LuaError e => DocumentedFunction e +showInline = defun "show" + ### liftPure (show @Inline) + <#> parameter peekInline "inline" "Inline" "Object" + =#> functionResult pushString "string" "stringified Inline" + +pushContent :: LuaError e => Pusher e Content +pushContent = \case + ContentBlocks blks -> pushPandocList pushBlock blks + ContentInlines inlns -> pushPandocList pushInline inlns + +peekContent :: LuaError e => Peeker e Content +peekContent idx = + (ContentInlines <$!> peekList peekInline idx) <|> + (ContentBlocks <$!> peekList peekBlock idx) + +typeInline :: LuaError e => DocumentedType e Inline +typeInline = deftype "Inline" + [ operation Tostring showInline + , operation Eq $ defun "__eq" + ### liftPure2 (==) + <#> parameter peekInline "a" "Inline" "" + <#> parameter peekInline "b" "Inline" "" + =#> functionResult pushBool "boolean" "whether the two are equal" + ] + [ possibleProperty "attr" "element attributes" + (pushAttr, getInlineAttr) + (peekAttr, setInlineAttr) + , possibleProperty "caption" "image caption" + (pushPandocList pushInline, \case + Image _ capt _ -> Actual capt + _ -> Absent) + (peekInlines, \case + Image attr _ target -> Actual . (\capt -> Image attr capt target) + _ -> const Absent) + , possibleProperty "citations" "list of citations" + (pushPandocList pushCitation, \case {Cite cs _ -> Actual cs; _ -> Absent}) + (peekList peekCitation, \case + Cite _ inlns -> Actual . (`Cite` inlns) + _ -> const Absent) + , possibleProperty "content" "element contents" + (pushContent, getInlineContent) + (peekContent, setInlineContent) + , possibleProperty "format" "format of raw text" + (pushFormat, \case {RawInline fmt _ -> Actual fmt; _ -> Absent}) + (peekFormat, \case + RawInline _ txt -> Actual . (`RawInline` txt) + _ -> const Absent) + , possibleProperty "mathtype" "math rendering method" + (pushMathType, \case {Math mt _ -> Actual mt; _ -> Absent}) + (peekMathType, \case + Math _ txt -> Actual . (`Math` txt) + _ -> const Absent) + , possibleProperty "quotetype" "type of quotes (single or double)" + (pushQuoteType, \case {Quoted qt _ -> Actual qt; _ -> Absent}) + (peekQuoteType, \case + Quoted _ inlns -> Actual . (`Quoted` inlns) + _ -> const Absent) + , possibleProperty "src" "image source" + (pushText, \case + Image _ _ (src, _) -> Actual src + _ -> Absent) + (peekText, \case + Image attr capt (_, title) -> Actual . Image attr capt . (,title) + _ -> const Absent) + , possibleProperty "target" "link target URL" + (pushText, \case + Link _ _ (tgt, _) -> Actual tgt + _ -> Absent) + (peekText, \case + Link attr capt (_, title) -> Actual . Image attr capt . (,title) + _ -> const Absent) + , possibleProperty "title" "title text" + (pushText, getInlineTitle) + (peekText, setInlineTitle) + , possibleProperty "text" "text contents" + (pushText, getInlineText) + (peekText, setInlineText) + , readonly "tag" "type of Inline" + (pushString, showConstr . toConstr ) + + , alias "t" "tag" ["tag"] + , alias "c" "content" ["content"] + , alias "identifier" "element identifier" ["attr", "identifier"] + , alias "classes" "element classes" ["attr", "classes"] + , alias "attributes" "other element attributes" ["attr", "attributes"] + + , method $ defun "clone" + ### return + <#> parameter peekInline "inline" "Inline" "self" + =#> functionResult pushInline "Inline" "cloned Inline" + ] + -- | Push an inline element to the top of the lua stack. pushInline :: forall e. LuaError e => Inline -> LuaE e () -pushInline = \case - Cite citations lst -> pushViaConstructor @e "Cite" lst citations - Code attr lst -> pushViaConstr' @e "Code" - [push lst, pushAttr attr] - Emph inlns -> pushViaConstructor @e "Emph" inlns - Underline inlns -> pushViaConstructor @e "Underline" inlns - Image attr alt (src,tit) -> pushViaConstr' @e "Image" - [push alt, push src, push tit, pushAttr attr] - LineBreak -> pushViaConstructor @e "LineBreak" - Link attr lst (src,tit) -> pushViaConstr' @e "Link" - [push lst, push src, push tit, pushAttr attr] - Note blcks -> pushViaConstructor @e "Note" blcks - Math mty str -> pushViaConstructor @e "Math" mty str - Quoted qt inlns -> pushViaConstructor @e "Quoted" qt inlns - RawInline f cs -> pushViaConstructor @e "RawInline" f cs - SmallCaps inlns -> pushViaConstructor @e "SmallCaps" inlns - SoftBreak -> pushViaConstructor @e "SoftBreak" - Space -> pushViaConstructor @e "Space" - Span attr inlns -> pushViaConstr' @e "Span" - [push inlns, pushAttr attr] - Str str -> pushViaConstructor @e "Str" str - Strikeout inlns -> pushViaConstructor @e "Strikeout" inlns - Strong inlns -> pushViaConstructor @e "Strong" inlns - Subscript inlns -> pushViaConstructor @e "Subscript" inlns - Superscript inlns -> pushViaConstructor @e "Superscript" inlns +pushInline = pushUD typeInline -- | Return the value at the given index as inline if possible. peekInline :: forall e. LuaError e => Peeker e Inline -peekInline = retrieving "Inline" . \idx -> do - -- Get the contents of an AST element. - let mkBlock :: (a -> Inline) -> Peeker e a -> Peek e Inline - mkBlock f p = f <$!> peekFieldRaw p "c" idx - LuaUtil.getTag idx >>= \case - "Cite" -> mkBlock (uncurry Cite) $ - peekPair (peekList peekCitation) peekInlines - "Code" -> mkBlock (uncurry Code) (peekPair peekAttr peekText) - "Emph" -> mkBlock Emph peekInlines - "Underline" -> mkBlock Underline peekInlines - "Image" -> mkBlock (\(attr, lst, tgt) -> Image attr lst tgt) - $ peekTriple peekAttr peekInlines - (peekPair peekText peekText) - "Link" -> mkBlock (\(attr, lst, tgt) -> Link attr lst tgt) $ - peekTriple peekAttr peekInlines (peekPair peekText peekText) - "LineBreak" -> return LineBreak - "Note" -> mkBlock Note peekBlocks - "Math" -> mkBlock (uncurry Math) (peekPair peekRead peekText) - "Quoted" -> mkBlock (uncurry Quoted) (peekPair peekRead peekInlines) - "RawInline" -> mkBlock (uncurry RawInline) (peekPair peekFormat peekText) - "SmallCaps" -> mkBlock SmallCaps peekInlines - "SoftBreak" -> return SoftBreak - "Space" -> return Space - "Span" -> mkBlock (uncurry Span) (peekPair peekAttr peekInlines) - "Str" -> mkBlock Str peekText - "Strikeout" -> mkBlock Strikeout peekInlines - "Strong" -> mkBlock Strong peekInlines - "Subscript" -> mkBlock Subscript peekInlines - "Superscript"-> mkBlock Superscript peekInlines - Name tag -> Lua.failPeek ("Unknown inline type: " <> tag) +peekInline = retrieving "Inline" . \idx -> peekUD typeInline idx + +-- | Try extra-hard to return the value at the given index as a list of +-- inlines. +peekFuzzyInlines :: LuaError e => Peeker e [Inline] +peekFuzzyInlines = choice + [ peekList peekInline + , fmap pure . peekInline + , \idx -> pure . Str <$!> peekText idx + ] + +peekFuzzyBlocks :: LuaError e => Peeker e [Block] +peekFuzzyBlocks = choice + [ peekList peekBlock + , fmap pure . peekBlock + , \idx -> pure . Plain . pure . Str <$!> peekText idx + ] + pushListAttributes :: forall e. LuaError e => ListAttributes -> LuaE e () pushListAttributes (start, style, delimiter) = diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 34317276d..ef1d6f078 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -1,5 +1,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Module.Pandoc Copyright : Copyright © 2017-2021 Albert Krewinkel @@ -16,7 +17,7 @@ module Text.Pandoc.Lua.Module.Pandoc import Prelude hiding (read) import Control.Applicative (optional) -import Control.Monad ((>=>), when) +import Control.Monad ((>=>), forM_, when) import Control.Monad.Except (throwError) import Data.Default (Default (..)) import Data.Maybe (fromMaybe) @@ -54,11 +55,116 @@ pushModule = do addFunction "walk_block" (walkElement peekBlock pushBlock) addFunction "walk_inline" (walkElement peekInline pushInline) -- Constructors - addFunction "Pandoc" mkPandoc addFunction "Attr" (liftPandocLua mkAttr) addFunction "AttributeList" (liftPandocLua mkAttributeList) + addFunction "Pandoc" mkPandoc + liftPandocLua $ do + let addConstr fn = do + pushName (functionName fn) + pushDocumentedFunction fn + rawset (nth 3) + forM_ inlineConstructors addConstr + -- add constructors to Inlines.constructor + newtable -- constructor + forM_ (inlineConstructors @PandocError) $ \fn -> do + let name = functionName fn + pushName name + pushName name + rawget (nth 4) + rawset (nth 3) + -- set as pandoc.Inline.constructor + pushName "Inline" + newtable *> pushName "constructor" *> pushvalue (nth 4) *> rawset (nth 3) + rawset (nth 4) + pop 1 -- remaining constructor table return 1 +inlineConstructors :: LuaError e => [DocumentedFunction e] +inlineConstructors = + [ defun "Cite" + ### liftPure2 Cite + <#> parameter (peekList peekCitation) "citations" "list of Citations" "" + <#> parameter peekFuzzyInlines "content" "Inline" "placeholder content" + =#> functionResult pushInline "Inline" "cite element" + , defun "Code" + ### liftPure2 (flip Code) + <#> parameter peekText "code" "string" "code string" + <#> parameter peekAttr "attr" "Attr" "additional attributes" + =#> functionResult pushInline "Inline" "code element" + , mkInlinesConstr "Emph" Emph + , defun "Image" + ### liftPure4 (\caption src mtitle mattr -> + let attr = fromMaybe nullAttr mattr + title = fromMaybe mempty mtitle + in Image attr caption (src, title)) + <#> parameter peekFuzzyInlines "Inlines" "caption" "image caption / alt" + <#> parameter peekText "string" "src" "path/URL of the image file" + <#> optionalParameter peekText "string" "title" "brief image description" + <#> optionalParameter peekAttr "Attr" "attr" "image attributes" + =#> functionResult pushInline "Inline" "image element" + , defun "LineBreak" + ### return LineBreak + =#> functionResult pushInline "Inline" "line break" + , defun "Link" + ### liftPure4 (\content target mtitle mattr -> + let attr = fromMaybe nullAttr mattr + title = fromMaybe mempty mtitle + in Link attr content (target, title)) + <#> parameter peekFuzzyInlines "Inlines" "content" "text for this link" + <#> parameter peekText "string" "target" "the link target" + <#> optionalParameter peekText "string" "title" "brief link description" + <#> optionalParameter peekAttr "Attr" "attr" "link attributes" + =#> functionResult pushInline "Inline" "link element" + , defun "Math" + ### liftPure2 Math + <#> parameter peekMathType "quotetype" "Math" "rendering method" + <#> parameter peekText "text" "string" "math content" + =#> functionResult pushInline "Inline" "math element" + , defun "Note" + ### liftPure Note + <#> parameter peekFuzzyBlocks "content" "Blocks" "note content" + =#> functionResult pushInline "Inline" "note" + , defun "Quoted" + ### liftPure2 Quoted + <#> parameter peekQuoteType "quotetype" "QuoteType" "type of quotes" + <#> parameter peekFuzzyInlines "content" "Inlines" "inlines in quotes" + =#> functionResult pushInline "Inline" "quoted element" + , defun "RawInline" + ### liftPure2 RawInline + <#> parameter peekFormat "format" "Format" "format of content" + <#> parameter peekText "text" "string" "string content" + =#> functionResult pushInline "Inline" "raw inline element" + , mkInlinesConstr "SmallCaps" SmallCaps + , defun "SoftSpace" + ### return SoftBreak + =#> functionResult pushInline "Inline" "soft break" + , defun "Space" + ### return Space + =#> functionResult pushInline "Inline" "new space" + , defun "Span" + ### liftPure2 (\inlns mattr -> Span (fromMaybe nullAttr mattr) inlns) + <#> parameter peekFuzzyInlines "content" "Inlines" "inline content" + <#> optionalParameter peekAttr "attr" "Attr" "additional attributes" + =#> functionResult pushInline "Inline" "span element" + , defun "Str" + ### liftPure (\s -> s `seq` Str s) + <#> parameter peekText "text" "string" "" + =#> functionResult pushInline "Inline" "new Str object" + , mkInlinesConstr "Strong" Strong + , mkInlinesConstr "Strikeout" Strikeout + , mkInlinesConstr "Subscript" Subscript + , mkInlinesConstr "Superscript" Superscript + , mkInlinesConstr "Underline" Underline + ] + +mkInlinesConstr :: LuaError e + => Name -> ([Inline] -> Inline) -> DocumentedFunction e +mkInlinesConstr name constr = defun name + ### liftPure (\x -> x `seq` constr x) + <#> parameter peekFuzzyInlines "content" "Inlines" "" + =#> functionResult pushInline "Inline" "new object" + + walkElement :: (Walkable (SingletonsList Inline) a, Walkable (SingletonsList Block) a, Walkable (List Inline) a, -- cgit v1.2.3 From c07005a095960bc1a3e012fec5a23bf4c70185f5 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 21 Oct 2021 11:11:27 +0200 Subject: Lua: marshal Version values as userdata --- pandoc.cabal | 2 +- src/Text/Pandoc/Lua/Global.hs | 5 +- src/Text/Pandoc/Lua/Marshaling.hs | 1 - src/Text/Pandoc/Lua/Marshaling/AST.hs | 5 ++ src/Text/Pandoc/Lua/Marshaling/Version.hs | 118 ------------------------------ src/Text/Pandoc/Lua/Module/Types.hs | 6 +- src/Text/Pandoc/Lua/Module/Utils.hs | 2 +- 7 files changed, 13 insertions(+), 126 deletions(-) delete mode 100644 src/Text/Pandoc/Lua/Marshaling/Version.hs diff --git a/pandoc.cabal b/pandoc.cabal index 9cf609049..caf91adff 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -556,6 +556,7 @@ library hslua-module-path >= 1.0 && < 1.1, hslua-module-system >= 1.0 && < 1.1, hslua-module-text >= 1.0 && < 1.1, + hslua-module-version >= 1.0 && < 1.1, http-client >= 0.4.30 && < 0.8, http-client-tls >= 0.2.4 && < 0.4, http-types >= 0.8 && < 0.13, @@ -783,7 +784,6 @@ library Text.Pandoc.Lua.Marshaling.PandocError, Text.Pandoc.Lua.Marshaling.ReaderOptions, Text.Pandoc.Lua.Marshaling.SimpleTable, - Text.Pandoc.Lua.Marshaling.Version, Text.Pandoc.Lua.Module.MediaBag, Text.Pandoc.Lua.Module.Pandoc, Text.Pandoc.Lua.Module.System, diff --git a/src/Text/Pandoc/Lua/Global.hs b/src/Text/Pandoc/Lua/Global.hs index df300a8c6..23b3a8284 100644 --- a/src/Text/Pandoc/Lua/Global.hs +++ b/src/Text/Pandoc/Lua/Global.hs @@ -15,6 +15,7 @@ module Text.Pandoc.Lua.Global ) where import HsLua as Lua +import HsLua.Module.Version (pushVersion) import Paths_pandoc (version) import Text.Pandoc.Class.CommonState (CommonState) import Text.Pandoc.Definition (Pandoc (Pandoc), pandocTypesVersion) @@ -48,7 +49,7 @@ setGlobal global = case global of Lua.push format Lua.setglobal "FORMAT" PANDOC_API_VERSION -> do - Lua.push pandocTypesVersion + pushVersion pandocTypesVersion Lua.setglobal "PANDOC_API_VERSION" PANDOC_DOCUMENT doc -> do pushUD typePandocLazy doc @@ -63,7 +64,7 @@ setGlobal global = case global of pushCommonState commonState Lua.setglobal "PANDOC_STATE" PANDOC_VERSION -> do - Lua.push version + pushVersion version Lua.setglobal "PANDOC_VERSION" -- | Readonly and lazy pandoc objects. diff --git a/src/Text/Pandoc/Lua/Marshaling.hs b/src/Text/Pandoc/Lua/Marshaling.hs index 8fde94958..e217b8852 100644 --- a/src/Text/Pandoc/Lua/Marshaling.hs +++ b/src/Text/Pandoc/Lua/Marshaling.hs @@ -16,5 +16,4 @@ import Text.Pandoc.Lua.Marshaling.CommonState () import Text.Pandoc.Lua.Marshaling.Context () import Text.Pandoc.Lua.Marshaling.PandocError() import Text.Pandoc.Lua.Marshaling.ReaderOptions () -import Text.Pandoc.Lua.Marshaling.Version () import Text.Pandoc.Lua.ErrorConversion () diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 1e635483c..5791b39c1 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -48,7 +48,9 @@ import Control.Monad.Catch (throwM) import Control.Monad ((<$!>), (>=>)) import Data.Data (showConstr, toConstr) import Data.Text (Text) +import Data.Version (Version) import HsLua hiding (Operation (Div)) +import HsLua.Module.Version (peekVersionFuzzy) import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError (PandocLuaError)) import Text.Pandoc.Lua.Util (pushViaConstr', pushViaConstructor) @@ -616,5 +618,8 @@ instance Peekable Meta where instance Peekable Pandoc where peek = forcePeek . peekPandoc +instance Peekable Version where + peek = forcePeek . peekVersionFuzzy + instance {-# OVERLAPPING #-} Peekable Attr where peek = forcePeek . peekAttr diff --git a/src/Text/Pandoc/Lua/Marshaling/Version.hs b/src/Text/Pandoc/Lua/Marshaling/Version.hs deleted file mode 100644 index 2af36e5c8..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/Version.hs +++ /dev/null @@ -1,118 +0,0 @@ -{-# OPTIONS_GHC -fno-warn-orphans #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{- | - Module : Text.Pandoc.Lua.Marshaling.Version - Copyright : © 2019-2021 Albert Krewinkel - License : GNU GPL, version 2 or above - - Maintainer : Albert Krewinkel - Stability : alpha - -Marshaling of @'Version'@s. The marshaled elements can be compared using -default comparison operators (like @>@ and @<=@). --} -module Text.Pandoc.Lua.Marshaling.Version - ( peekVersion - , pushVersion - , peekVersionFuzzy - ) - where - -import Data.Maybe (fromMaybe) -import Data.Version (Version (..), makeVersion, parseVersion, showVersion) -import HsLua as Lua -import Safe (lastMay) -import Text.ParserCombinators.ReadP (readP_to_S) -import qualified Text.Pandoc.UTF8 as UTF8 - -instance Peekable Version where - peek = forcePeek . peekVersionFuzzy - -instance Pushable Version where - push = pushVersion - --- | Push a @'Version'@ element to the Lua stack. -pushVersion :: LuaError e => Pusher e Version -pushVersion = pushUD typeVersion - -peekVersionFuzzy :: LuaError e => Peeker e Version -peekVersionFuzzy idx = retrieving "Version" $ liftLua (Lua.ltype idx) >>= \case - Lua.TypeUserdata -> peekVersion idx - Lua.TypeString -> do - versionStr <- peekString idx - let parses = readP_to_S parseVersion versionStr - case lastMay parses of - Just (v, "") -> return v - _ -> Lua.failPeek $ - UTF8.fromString $ "could not parse as Version: " ++ versionStr - - Lua.TypeNumber -> do - (makeVersion . (:[])) <$> peekIntegral idx - - Lua.TypeTable -> - makeVersion <$> peekList peekIntegral idx - - _ -> - Lua.failPeek "could not peek Version" - -peekVersion :: LuaError e => Peeker e Version -peekVersion = peekUD typeVersion - -typeVersion :: LuaError e => DocumentedType e Version -typeVersion = deftype "Version" - [ operation Eq $ defun "__eq" - ### liftPure2 (==) - <#> parameter peekVersionFuzzy "Version" "v1" "" - <#> parameter peekVersionFuzzy "Version" "v2" "" - =#> functionResult pushBool "boolean" "true iff v1 == v2" - , operation Lt $ defun "__lt" - ### liftPure2 (<) - <#> parameter peekVersionFuzzy "Version" "v1" "" - <#> parameter peekVersionFuzzy "Version" "v2" "" - =#> functionResult pushBool "boolean" "true iff v1 < v2" - , operation Le $ defun "__le" - ### liftPure2 (<=) - <#> parameter peekVersionFuzzy "Version" "v1" "" - <#> parameter peekVersionFuzzy "Version" "v2" "" - =#> functionResult pushBool "boolean" "true iff v1 <= v2" - , operation Len $ defun "__len" - ### liftPure (length . versionBranch) - <#> parameter peekVersionFuzzy "Version" "v1" "" - =#> functionResult pushIntegral "integer" "number of version components" - , operation Tostring $ defun "__tostring" - ### liftPure showVersion - <#> parameter peekVersionFuzzy "Version" "version" "" - =#> functionResult pushString "string" "stringified version" - ] - [ method $ defun "must_be_at_least" - ### must_be_at_least - <#> parameter peekVersionFuzzy "Version" "self" "version to check" - <#> parameter peekVersionFuzzy "Version" "reference" "minimum version" - <#> optionalParameter peekString "string" "msg" "alternative message" - =?> "Returns no result, and throws an error if this version is older than reference" - ] - --- | Throw an error if this version is older than the given version. --- FIXME: This function currently requires the string library to be --- loaded. -must_be_at_least :: LuaError e - => Version -> Version -> Maybe String - -> LuaE e NumResults -must_be_at_least actual expected mMsg = do - let msg = fromMaybe versionTooOldMessage mMsg - if expected <= actual - then return 0 - else do - Lua.getglobal' "string.format" - Lua.push msg - Lua.push (showVersion expected) - Lua.push (showVersion actual) - Lua.call 3 1 - Lua.error - --- | Default error message when a version is too old. This message is --- formatted in Lua with the expected and actual versions as arguments. -versionTooOldMessage :: String -versionTooOldMessage = "expected version %s or newer, got %s" diff --git a/src/Text/Pandoc/Lua/Module/Types.hs b/src/Text/Pandoc/Lua/Module/Types.hs index a9ce14ce7..7307c6e88 100644 --- a/src/Text/Pandoc/Lua/Module/Types.hs +++ b/src/Text/Pandoc/Lua/Module/Types.hs @@ -13,21 +13,21 @@ module Text.Pandoc.Lua.Module.Types ( pushModule ) where -import Data.Version (Version) import HsLua (LuaE, NumResults, Peeker, Pusher) import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.ErrorConversion () import Text.Pandoc.Lua.Marshaling.AST -import Text.Pandoc.Lua.Marshaling.Version () import Text.Pandoc.Lua.Util (addFunction) import qualified HsLua as Lua +import qualified HsLua.Module.Version as Version -- | Push the pandoc.types module on the Lua stack. pushModule :: LuaE PandocError NumResults pushModule = do Lua.newtable - addFunction "Version" (return :: Version -> LuaE PandocError Version) + Lua.pushName "Version" *> Lua.pushModule Version.documentedModule + *> Lua.rawset (Lua.nth 3) pushCloneTable Lua.setfield (Lua.nth 2) "clone" return 1 diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 8b6e31b43..7ce1cd18d 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -23,6 +23,7 @@ import Data.Default (def) import Data.Version (Version) import HsLua as Lua hiding (pushModule) import HsLua.Class.Peekable (PeekError) +import HsLua.Module.Version (peekVersionFuzzy, pushVersion) import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshaling () @@ -32,7 +33,6 @@ import Text.Pandoc.Lua.Marshaling.AST import Text.Pandoc.Lua.Marshaling.List (pushPandocList) import Text.Pandoc.Lua.Marshaling.SimpleTable ( SimpleTable (..), peekSimpleTable, pushSimpleTable ) -import Text.Pandoc.Lua.Marshaling.Version (peekVersionFuzzy, pushVersion) import Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua)) import qualified Data.Digest.Pure.SHA as SHA -- cgit v1.2.3 From a9f4bff5e29ed15fb567f4d5f59b60ef3c71933f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Oct 2021 14:33:30 -0700 Subject: Use pandoc-types 1.22.1. --- cabal.project | 5 ----- pandoc.cabal | 4 ++-- stack.yaml | 3 +-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/cabal.project b/cabal.project index b5cef10cb..9c4e74f52 100644 --- a/cabal.project +++ b/cabal.project @@ -13,11 +13,6 @@ source-repository-package location: https://github.com/jgm/texmath.git tag: c046e6e5a93510f2c37dbc700f82a2c53ed87b5f -source-repository-package - type: git - location: https://github.com/jgm/pandoc-types.git - tag: 99402a46361a3e52805935b1fbe9dfe54f852d6a - source-repository-package type: git location: https://github.com/jgm/commonmark-hs.git diff --git a/pandoc.cabal b/pandoc.cabal index caf91adff..c955b5ae4 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -565,7 +565,7 @@ library mtl >= 2.2 && < 2.3, network >= 2.6, network-uri >= 2.6 && < 2.8, - pandoc-types >= 1.22 && < 1.23, + pandoc-types >= 1.22.1 && < 1.23, parsec >= 3.1 && < 3.2, process >= 1.2.3 && < 1.7, random >= 1 && < 1.3, @@ -849,7 +849,7 @@ test-suite test-pandoc filepath >= 1.1 && < 1.5, hslua >= 2.0 && < 2.1, mtl >= 2.2 && < 2.3, - pandoc-types >= 1.22 && < 1.23, + pandoc-types >= 1.22.1 && < 1.23, process >= 1.2.3 && < 1.7, tasty >= 0.11 && < 1.5, tasty-golden >= 2.3 && < 2.4, diff --git a/stack.yaml b/stack.yaml index 932f90d34..fb7aa5143 100644 --- a/stack.yaml +++ b/stack.yaml @@ -25,8 +25,7 @@ extra-deps: - lua-2.0.0 - tasty-hslua-1.0.0 - tasty-lua-1.0.0 -- git: https://github.com/jgm/pandoc-types.git - commit: 99402a46361a3e52805935b1fbe9dfe54f852d6a +- pandoc-types-1.22.1 - git: https://github.com/jgm/texmath.git commit: 19700530733707284bb41f24add757f19ca23430 - git: https://github.com/jgm/citeproc.git -- cgit v1.2.3 From 921af3085422ed5896db6996c54009cf2a61a517 Mon Sep 17 00:00:00 2001 From: Aner Lucero <4rgento@gmail.com> Date: Wed, 9 Jun 2021 10:53:35 -0300 Subject: Use simpleFigure in Readers. --- src/Text/Pandoc/Readers/HTML.hs | 2 +- src/Text/Pandoc/Readers/LaTeX.hs | 33 ++++++++++++++++---------------- src/Text/Pandoc/Readers/Markdown.hs | 27 +++++++++++++------------- src/Text/Pandoc/Readers/MediaWiki.hs | 9 +++++++-- src/Text/Pandoc/Readers/Org/Blocks.hs | 19 +++++++++--------- src/Text/Pandoc/Readers/RST.hs | 4 ++-- src/Text/Pandoc/Writers/AsciiDoc.hs | 3 +-- src/Text/Pandoc/Writers/ConTeXt.hs | 5 +---- src/Text/Pandoc/Writers/Docbook.hs | 5 ++--- src/Text/Pandoc/Writers/Docx.hs | 3 +-- src/Text/Pandoc/Writers/DokuWiki.hs | 4 +--- src/Text/Pandoc/Writers/FB2.hs | 5 ++--- src/Text/Pandoc/Writers/HTML.hs | 4 ++-- src/Text/Pandoc/Writers/Haddock.hs | 3 +-- src/Text/Pandoc/Writers/ICML.hs | 6 ++---- src/Text/Pandoc/Writers/JATS.hs | 4 +--- src/Text/Pandoc/Writers/LaTeX.hs | 5 +---- src/Text/Pandoc/Writers/Markdown.hs | 6 ++---- src/Text/Pandoc/Writers/MediaWiki.hs | 4 +--- src/Text/Pandoc/Writers/OpenDocument.hs | 3 +-- src/Text/Pandoc/Writers/Org.hs | 4 +--- src/Text/Pandoc/Writers/RST.hs | 34 +++++++++++++++++++-------------- src/Text/Pandoc/Writers/Texinfo.hs | 3 +-- src/Text/Pandoc/Writers/Textile.hs | 4 +--- src/Text/Pandoc/Writers/ZimWiki.hs | 4 +--- 25 files changed, 93 insertions(+), 110 deletions(-) diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index fdf4f28e0..c78faebbd 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -551,7 +551,7 @@ pFigure = try $ do let caption = fromMaybe mempty mbcap case B.toList <$> mbimg of Just [Image attr _ (url, tit)] -> - return $ B.para $ B.imageWith attr url ("fig:" <> tit) caption + return $ B.simpleFigureWith attr caption url tit _ -> mzero pCodeBlock :: PandocMonad m => TagParser m Blocks diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 34eb53245..15148debb 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1095,24 +1095,25 @@ figure = try $ do addImageCaption :: PandocMonad m => Blocks -> LP m Blocks addImageCaption = walkM go - where go (Image attr@(_, cls, kvs) alt (src,tit)) + where go p@(Para [Image attr@(_, cls, kvs) _ (src, tit)]) | not ("fig:" `T.isPrefixOf` tit) = do st <- getState - let (alt', tit') = case sCaption st of - Just ils -> (toList ils, "fig:" <> tit) - Nothing -> (alt, tit) - attr' = case sLastLabel st of - Just lab -> (lab, cls, kvs) - Nothing -> attr - case attr' of - ("", _, _) -> return () - (ident, _, _) -> do - num <- getNextNumber sLastFigureNum - setState - st{ sLastFigureNum = num - , sLabels = M.insert ident - [Str (renderDottedNum num)] (sLabels st) } - return $ Image attr' alt' (src, tit') + case sCaption st of + Nothing -> return p + Just figureCaption -> do + let attr' = case sLastLabel st of + Just lab -> (lab, cls, kvs) + Nothing -> attr + case attr' of + ("", _, _) -> return () + (ident, _, _) -> do + num <- getNextNumber sLastFigureNum + setState + st{ sLastFigureNum = num + , sLabels = M.insert ident + [Str (renderDottedNum num)] (sLabels st) } + + return $ SimpleFigure attr' (B.toList figureCaption) (src, tit) go x = return x coloredBlock :: PandocMonad m => Text -> LP m Blocks diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 03becd144..e7ab8efb4 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1015,19 +1015,18 @@ normalDefinitionList = do para :: PandocMonad m => MarkdownParser m (F Blocks) para = try $ do exts <- getOption readerExtensions - let implicitFigures x - | extensionEnabled Ext_implicit_figures exts = do - x' <- x - case B.toList x' of - [Image attr alt (src,tit)] - | not (null alt) -> - -- the fig: at beginning of title indicates a figure - return $ B.singleton - $ Image attr alt (src, "fig:" <> tit) - _ -> return x' - | otherwise = x - result <- implicitFigures . trimInlinesF <$> inlines1 - option (B.plain <$> result) + + result <- trimInlinesF <$> inlines1 + let figureOr constr inlns = + case B.toList inlns of + [Image attr figCaption (src, tit)] + | extensionEnabled Ext_implicit_figures exts + , not (null figCaption) -> do + B.simpleFigureWith attr (B.fromList figCaption) src tit + + _ -> constr inlns + + option (figureOr B.plain <$> result) $ try $ do newline (mempty <$ blanklines) @@ -1049,7 +1048,7 @@ para = try $ do if divLevel > 0 then lookAhead divFenceEnd else mzero - return $ B.para <$> result + return $ figureOr B.para <$> result plain :: PandocMonad m => MarkdownParser m (F Blocks) plain = fmap B.plain . trimInlinesF <$> inlines1 diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs index 825e4a2eb..9348a8053 100644 --- a/src/Text/Pandoc/Readers/MediaWiki.hs +++ b/src/Text/Pandoc/Readers/MediaWiki.hs @@ -201,7 +201,12 @@ para = do contents <- trimInlines . mconcat <$> many1 inline if F.all (==Space) contents then return mempty - else return $ B.para contents + else case B.toList contents of + -- For the MediaWiki format all images are considered figures + [Image attr figureCaption (src, title)] -> + return $ B.simpleFigureWith + attr (B.fromList figureCaption) src title + _ -> return $ B.para contents table :: PandocMonad m => MWParser m Blocks table = do @@ -631,7 +636,7 @@ image = try $ do let attr = ("", [], kvs) caption <- (B.str fname <$ sym "]]") <|> try (char '|' *> (mconcat <$> manyTill inline (sym "]]"))) - return $ B.imageWith attr fname ("fig:" <> stringify caption) caption + return $ B.imageWith attr fname (stringify caption) caption imageOption :: PandocMonad m => MWParser m Text imageOption = try $ char '|' *> opt diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs index 2ec97d903..9a689b0e8 100644 --- a/src/Text/Pandoc/Readers/Org/Blocks.hs +++ b/src/Text/Pandoc/Readers/Org/Blocks.hs @@ -474,15 +474,16 @@ figure = try $ do figCaption = fromMaybe mempty $ blockAttrCaption figAttrs figKeyVals = blockAttrKeyValues figAttrs attr = (figLabel, mempty, figKeyVals) - figTitle = (if isFigure then withFigPrefix else id) figName - in - B.para . B.imageWith attr imgSrc figTitle <$> figCaption - - withFigPrefix :: Text -> Text - withFigPrefix cs = - if "fig:" `T.isPrefixOf` cs - then cs - else "fig:" <> cs + in if isFigure + then (\c -> + B.simpleFigureWith + attr c imgSrc (unstackFig figName)) <$> figCaption + else B.para . B.imageWith attr imgSrc figName <$> figCaption + unstackFig :: Text -> Text + unstackFig figName = + if "fig:" `T.isPrefixOf` figName + then T.drop 4 figName + else figName -- | Succeeds if looking at the end of the current paragraph endOfParagraph :: Monad m => OrgParser m () diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 458a2d48b..8ee017342 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -725,8 +725,8 @@ directive' = do "figure" -> do (caption, legend) <- parseFromString' extractCaption body' let src = escapeURI $ trim top - return $ B.para (B.imageWith (imgAttr "figclass") src "fig:" - caption) <> legend + return $ B.simpleFigureWith + (imgAttr "figclass") caption src "" <> legend "image" -> do let src = escapeURI $ trim top let alt = B.str $ maybe "image" trim $ lookup "alt" fields diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs index 4d3906c5f..24438370a 100644 --- a/src/Text/Pandoc/Writers/AsciiDoc.hs +++ b/src/Text/Pandoc/Writers/AsciiDoc.hs @@ -149,9 +149,8 @@ blockToAsciiDoc opts (Div (id',"section":_,_) blockToAsciiDoc opts (Plain inlines) = do contents <- inlineListToAsciiDoc opts inlines return $ contents <> blankline -blockToAsciiDoc opts (Para [Image attr alternate (src,tgt)]) +blockToAsciiDoc opts (SimpleFigure attr alternate (src, tit)) -- image::images/logo.png[Company logo, title="blah"] - | Just tit <- T.stripPrefix "fig:" tgt = (\args -> "image::" <> args <> blankline) <$> imageArguments opts attr alternate src tit blockToAsciiDoc opts (Para inlines) = do diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index 3cafcefba..13970cbc3 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -162,10 +162,7 @@ blockToConTeXt (Div attr@(_,"section":_,_) innerContents <- blockListToConTeXt xs return $ header' $$ innerContents $$ footer' blockToConTeXt (Plain lst) = inlineListToConTeXt lst --- title beginning with fig: indicates that the image is a figure -blockToConTeXt (Para [Image attr txt (src,tgt)]) - | Just _ <- T.stripPrefix "fig:" tgt - = do +blockToConTeXt (SimpleFigure attr txt (src, _)) = do capt <- inlineListToConTeXt txt img <- inlineToConTeXt (Image attr txt (src, "")) let (ident, _, _) = attr diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index 33a6f5f0c..c9e49517f 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -1,6 +1,5 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} -{-# LANGUAGE ViewPatterns #-} {- | Module : Text.Pandoc.Writers.Docbook Copyright : Copyright (C) 2006-2021 John MacFarlane @@ -188,7 +187,7 @@ blockToDocbook opts (Div (id',"section":_,_) (Header lvl (_,_,attrs) ils : xs)) -- standalone documents will include them in the template. then [("xmlns", "http://docbook.org/ns/docbook"),("xmlns:xlink", "http://www.w3.org/1999/xlink")] else [] - + -- Populate miscAttr with Header.Attr.attributes, filtering out non-valid DocBook section attributes, id, and xml:id miscAttr = filter (isSectionAttr version) attrs attribs = nsAttr <> idAttr <> miscAttr @@ -233,7 +232,7 @@ blockToDocbook _ h@Header{} = do return empty blockToDocbook opts (Plain lst) = inlinesToDocbook opts lst -- title beginning with fig: indicates that the image is a figure -blockToDocbook opts (Para [Image attr txt (src,T.stripPrefix "fig:" -> Just _)]) = do +blockToDocbook opts (SimpleFigure attr txt (src, _)) = do alt <- inlinesToDocbook opts txt let capt = if null txt then empty diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 686a2f662..fccbb0719 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -854,8 +854,7 @@ blockToOpenXML' opts (Plain lst) = do then withParaProp prop block else block -- title beginning with fig: indicates that the image is a figure -blockToOpenXML' opts (Para [Image attr@(imgident,_,_) alt - (src,T.stripPrefix "fig:" -> Just tit)]) = do +blockToOpenXML' opts (SimpleFigure attr@(imgident, _, _) alt (src, tit)) = do setFirstPara fignum <- gets stNextFigureNum unless (null alt) $ modify $ \st -> st{ stNextFigureNum = fignum + 1 } diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index 602c70ebe..c77f20ec1 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -109,9 +109,7 @@ blockToDokuWiki opts (Plain inlines) = -- title beginning with fig: indicates that the image is a figure -- dokuwiki doesn't support captions - so combine together alt and caption into alt -blockToDokuWiki opts (Para [Image attr txt (src,tgt)]) - | Just tit <- T.stripPrefix "fig:" tgt - = do +blockToDokuWiki opts (SimpleFigure attr txt (src, tit)) = do capt <- if null txt then return "" else (" " <>) `fmap` inlineListToDokuWiki opts txt diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs index 6bad37404..ce3fe25a9 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -299,9 +299,8 @@ blockToXml :: PandocMonad m => Block -> FBM m [Content] blockToXml (Plain ss) = cMapM toXml ss -- FIXME: can lead to malformed FB2 blockToXml (Para [Math DisplayMath formula]) = insertMath NormalImage formula -- title beginning with fig: indicates that the image is a figure -blockToXml (Para [Image atr alt (src,tgt)]) - | Just tit <- T.stripPrefix "fig:" tgt - = insertImage NormalImage (Image atr alt (src,tit)) +blockToXml (SimpleFigure atr alt (src, tit)) = + insertImage NormalImage (Image atr alt (src,tit)) blockToXml (Para ss) = list . el "p" <$> cMapM toXml ss blockToXml (CodeBlock _ s) = return . spaceBeforeAfter . map (el "p" . el "code") . T.lines $ s diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 8fc81ed24..0a4c47387 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -742,8 +742,8 @@ blockToHtmlInner opts (Para [Image attr@(_,classes,_) txt (src,tit)]) inlineToHtml opts (Image attr txt (src, tit)) _ -> figure opts attr txt (src, tit) -- title beginning with fig: indicates that the image is a figure -blockToHtmlInner opts (Para [Image attr txt (s,T.stripPrefix "fig:" -> Just tit)]) = - figure opts attr txt (s,tit) +blockToHtmlInner opts (SimpleFigure attr caption (src, title)) = + figure opts attr caption (src, title) blockToHtmlInner opts (Para lst) = do contents <- inlineListToHtml opts lst case contents of diff --git a/src/Text/Pandoc/Writers/Haddock.hs b/src/Text/Pandoc/Writers/Haddock.hs index 75e14714b..dfd89bc54 100644 --- a/src/Text/Pandoc/Writers/Haddock.hs +++ b/src/Text/Pandoc/Writers/Haddock.hs @@ -98,8 +98,7 @@ blockToHaddock opts (Plain inlines) = do contents <- inlineListToHaddock opts inlines return $ contents <> cr -- title beginning with fig: indicates figure -blockToHaddock opts (Para [Image attr alt (src,tgt)]) - | Just tit <- T.stripPrefix "fig:" tgt +blockToHaddock opts (SimpleFigure attr alt (src, tit)) = blockToHaddock opts (Para [Image attr alt (src,tit)]) blockToHaddock opts (Para inlines) = -- TODO: if it contains linebreaks, we need to use a @...@ block diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs index c254fbc58..ea6009fd1 100644 --- a/src/Text/Pandoc/Writers/ICML.hs +++ b/src/Text/Pandoc/Writers/ICML.hs @@ -1,7 +1,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE ViewPatterns #-} {- | Module : Text.Pandoc.Writers.ICML @@ -309,9 +308,8 @@ blocksToICML opts style lst = do -- | Convert a Pandoc block element to ICML. blockToICML :: PandocMonad m => WriterOptions -> Style -> Block -> WS m (Doc Text) blockToICML opts style (Plain lst) = parStyle opts style "" lst --- title beginning with fig: indicates that the image is a figure -blockToICML opts style (Para img@[Image _ txt (_,Text.stripPrefix "fig:" -> Just _)]) = do - figure <- parStyle opts (figureName:style) "" img +blockToICML opts style (SimpleFigure attr txt (src, tit)) = do + figure <- parStyle opts (figureName:style) "" [Image attr txt (src, tit)] caption <- parStyle opts (imgCaptionName:style) "" txt return $ intersperseBrs [figure, caption] blockToICML opts style (Para lst) = parStyle opts (paragraphName:style) "" lst diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs index 9db8723d1..d58da8bd2 100644 --- a/src/Text/Pandoc/Writers/JATS.hs +++ b/src/Text/Pandoc/Writers/JATS.hs @@ -291,9 +291,7 @@ blockToJATS opts (Header _ _ title) = do return $ inTagsSimple "title" title' -- No Plain, everything needs to be in a block-level tag blockToJATS opts (Plain lst) = blockToJATS opts (Para lst) --- title beginning with fig: indicates that the image is a figure -blockToJATS opts (Para [Image (ident,_,kvs) txt - (src,T.stripPrefix "fig:" -> Just tit)]) = do +blockToJATS opts (SimpleFigure (ident, _, kvs) txt (src, tit)) = do alt <- inlinesToJATS opts txt let (maintype, subtype) = imageMimeType src kvs let capt = if null txt diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 8c45c8db5..f8847aa08 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -346,10 +346,7 @@ blockToLaTeX (Div (identifier,classes,kvs) bs) = do wrapNotes <$> wrapDiv (identifier,classes,kvs) result blockToLaTeX (Plain lst) = inlineListToLaTeX lst --- title beginning with fig: indicates that the image is a figure -blockToLaTeX (Para [Image attr@(ident, _, _) txt (src,tgt)]) - | Just tit <- T.stripPrefix "fig:" tgt - = do +blockToLaTeX (SimpleFigure attr@(ident, _, _) txt (src, tit)) = do (capt, captForLof, footnotes) <- getCaption inlineListToLaTeX True txt lab <- labelFor ident let caption = "\\caption" <> captForLof <> braces capt <> lab diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index fda2bbcef..f03dc375d 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -2,7 +2,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} -{-# LANGUAGE ViewPatterns #-} {- | Module : Text.Pandoc.Writers.Markdown Copyright : Copyright (C) 2006-2021 John MacFarlane @@ -365,14 +364,13 @@ blockToMarkdown' opts (Plain inlines) = do _ -> inlines contents <- inlineListToMarkdown opts inlines' return $ contents <> cr --- title beginning with fig: indicates figure -blockToMarkdown' opts (Para [Image attr alt (src,tgt@(T.stripPrefix "fig:" -> Just tit))]) +blockToMarkdown' opts (SimpleFigure attr alt (src, tit)) | isEnabled Ext_raw_html opts && not (isEnabled Ext_link_attributes opts || isEnabled Ext_attributes opts) && attr /= nullAttr = -- use raw HTML (<> blankline) . literal . T.strip <$> writeHtml5String opts{ writerTemplate = Nothing } - (Pandoc nullMeta [Para [Image attr alt (src,tgt)]]) + (Pandoc nullMeta [SimpleFigure attr alt (src, tit)]) | otherwise = blockToMarkdown opts (Para [Image attr alt (src,tit)]) blockToMarkdown' opts (Para inlines) = (<> blankline) `fmap` blockToMarkdown opts (Plain inlines) diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index 5029be69f..c7c53943a 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ViewPatterns #-} {- | Module : Text.Pandoc.Writers.MediaWiki Copyright : Copyright (C) 2008-2021 John MacFarlane @@ -91,8 +90,7 @@ blockToMediaWiki (Div attrs bs) = do blockToMediaWiki (Plain inlines) = inlineListToMediaWiki inlines --- title beginning with fig: indicates that the image is a figure -blockToMediaWiki (Para [Image attr txt (src,T.stripPrefix "fig:" -> Just tit)]) = do +blockToMediaWiki (SimpleFigure attr txt (src, tit)) = do capt <- inlineListToMediaWiki txt img <- imageToMediaWiki attr let opt = if T.null tit diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 5f3224c2f..a42c5df64 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -2,7 +2,6 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PatternGuards #-} -{-# LANGUAGE ViewPatterns #-} {- | Module : Text.Pandoc.Writers.OpenDocument Copyright : Copyright (C) 2008-2020 Andrea Rossato and John MacFarlane @@ -377,7 +376,7 @@ blockToOpenDocument o = \case Plain b -> if null b then return empty else inParagraphTags =<< inlinesToOpenDocument o b - Para [Image attr c (s,T.stripPrefix "fig:" -> Just t)] -> figure attr c s t + SimpleFigure attr c (s, t) -> figure attr c s t Para b -> if null b && not (isEnabled Ext_empty_paragraphs o) then return empty diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index f4a22695c..24e664ae4 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -105,9 +105,7 @@ blockToOrg :: PandocMonad m blockToOrg Null = return empty blockToOrg (Div attr bs) = divToOrg attr bs blockToOrg (Plain inlines) = inlineListToOrg inlines --- title beginning with fig: indicates that the image is a figure -blockToOrg (Para [Image attr txt (src,tgt)]) - | Just tit <- T.stripPrefix "fig:" tgt = do +blockToOrg (SimpleFigure attr txt (src, tit)) = do capt <- if null txt then return empty else ("#+caption: " <>) `fmap` inlineListToOrg txt diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 8b2002851..08733a792 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -219,28 +219,34 @@ blockToRST (Div (ident,classes,_kvs) bs) = do nest 3 contents $$ blankline blockToRST (Plain inlines) = inlineListToRST inlines -blockToRST (Para [Image attr txt (src, rawtit)]) = do +blockToRST (SimpleFigure attr txt (src, tit)) = do description <- inlineListToRST txt dims <- imageDimsToRST attr - -- title beginning with fig: indicates that the image is a figure - let (isfig, tit) = case T.stripPrefix "fig:" rawtit of - Nothing -> (False, rawtit) - Just tit' -> (True, tit') - let fig | isfig = "figure:: " <> literal src - | otherwise = "image:: " <> literal src - alt | isfig = ":alt: " <> if T.null tit then description else literal tit - | null txt = empty + let fig = "figure:: " <> literal src + alt = ":alt: " <> if T.null tit then description else literal tit + capt = description + (_,cls,_) = attr + classes = case cls of + [] -> empty + ["align-right"] -> ":align: right" + ["align-left"] -> ":align: left" + ["align-center"] -> ":align: center" + _ -> ":figclass: " <> literal (T.unwords cls) + return $ hang 3 ".. " (fig $$ alt $$ classes $$ dims $+$ capt) $$ blankline +blockToRST (Para [Image attr txt (src, _)]) = do + description <- inlineListToRST txt + dims <- imageDimsToRST attr + let fig = "image:: " <> literal src + alt | null txt = empty | otherwise = ":alt: " <> description - capt | isfig = description - | otherwise = empty + capt = empty (_,cls,_) = attr classes = case cls of [] -> empty ["align-right"] -> ":align: right" ["align-left"] -> ":align: left" ["align-center"] -> ":align: center" - _ | isfig -> ":figclass: " <> literal (T.unwords cls) - | otherwise -> ":class: " <> literal (T.unwords cls) + _ -> ":class: " <> literal (T.unwords cls) return $ hang 3 ".. " (fig $$ alt $$ classes $$ dims $+$ capt) $$ blankline blockToRST (Para inlines) | LineBreak `elem` inlines = @@ -407,7 +413,7 @@ blockListToRST' topLevel blocks = do toClose Header{} = False toClose LineBlock{} = False toClose HorizontalRule = False - toClose (Para [Image _ _ (_,t)]) = "fig:" `T.isPrefixOf` t + toClose SimpleFigure{} = True toClose Para{} = False toClose _ = True commentSep = RawBlock "rst" "..\n\n" diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs index 6a33b4283..3c5591b3a 100644 --- a/src/Text/Pandoc/Writers/Texinfo.hs +++ b/src/Text/Pandoc/Writers/Texinfo.hs @@ -123,8 +123,7 @@ blockToTexinfo (Plain lst) = inlineListToTexinfo lst -- title beginning with fig: indicates that the image is a figure -blockToTexinfo (Para [Image attr txt (src,tgt)]) - | Just tit <- T.stripPrefix "fig:" tgt = do +blockToTexinfo (SimpleFigure attr txt (src, tit)) = do capt <- if null txt then return empty else (\c -> text "@caption" <> braces c) `fmap` diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs index 03d030477..7f0d668e5 100644 --- a/src/Text/Pandoc/Writers/Textile.hs +++ b/src/Text/Pandoc/Writers/Textile.hs @@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ViewPatterns #-} {- | Module : Text.Pandoc.Writers.Textile Copyright : Copyright (C) 2010-2021 John MacFarlane @@ -111,8 +110,7 @@ blockToTextile opts (Div attr bs) = do blockToTextile opts (Plain inlines) = inlineListToTextile opts inlines --- title beginning with fig: indicates that the image is a figure -blockToTextile opts (Para [Image attr txt (src,T.stripPrefix "fig:" -> Just tit)]) = do +blockToTextile opts (SimpleFigure attr txt (src, tit)) = do capt <- blockToTextile opts (Para txt) im <- inlineToTextile opts (Image attr txt (src,tit)) return $ im <> "\n" <> capt diff --git a/src/Text/Pandoc/Writers/ZimWiki.hs b/src/Text/Pandoc/Writers/ZimWiki.hs index df914f590..5722b6d2e 100644 --- a/src/Text/Pandoc/Writers/ZimWiki.hs +++ b/src/Text/Pandoc/Writers/ZimWiki.hs @@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ViewPatterns #-} {- | Module : Text.Pandoc.Writers.ZimWiki Copyright : © 2008-2021 John MacFarlane, @@ -86,9 +85,8 @@ blockToZimWiki opts (Div _attrs bs) = do blockToZimWiki opts (Plain inlines) = inlineListToZimWiki opts inlines --- title beginning with fig: indicates that the image is a figure -- ZimWiki doesn't support captions - so combine together alt and caption into alt -blockToZimWiki opts (Para [Image attr txt (src,T.stripPrefix "fig:" -> Just tit)]) = do +blockToZimWiki opts (SimpleFigure attr txt (src, tit)) = do capt <- if null txt then return "" else (" " <>) `fmap` inlineListToZimWiki opts txt -- cgit v1.2.3 From ce1aca4a322c91a76d4bf5e4b93d48184d0a54a0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Oct 2021 16:42:21 -0700 Subject: Use texmath 0.12.3.2 --- cabal.project | 5 ----- pandoc.cabal | 2 +- stack.yaml | 3 +-- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cabal.project b/cabal.project index 9c4e74f52..28d7693c4 100644 --- a/cabal.project +++ b/cabal.project @@ -8,11 +8,6 @@ source-repository-package location: https://github.com/jgm/citeproc.git tag: 673a7fb643d24a3bb0f60f8f29e189c0ba7ef15b -source-repository-package - type: git - location: https://github.com/jgm/texmath.git - tag: c046e6e5a93510f2c37dbc700f82a2c53ed87b5f - source-repository-package type: git location: https://github.com/jgm/commonmark-hs.git diff --git a/pandoc.cabal b/pandoc.cabal index c955b5ae4..17bfb6b5a 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -577,7 +577,7 @@ library syb >= 0.1 && < 0.8, tagsoup >= 0.14.6 && < 0.15, temporary >= 1.1 && < 1.4, - texmath >= 0.12.3.1 && < 0.12.4, + texmath >= 0.12.3.2 && < 0.12.4, text >= 1.1.1.0 && < 1.3, text-conversions >= 0.3 && < 0.4, time >= 1.5 && < 1.13, diff --git a/stack.yaml b/stack.yaml index fb7aa5143..3a01d5b88 100644 --- a/stack.yaml +++ b/stack.yaml @@ -26,8 +26,7 @@ extra-deps: - tasty-hslua-1.0.0 - tasty-lua-1.0.0 - pandoc-types-1.22.1 -- git: https://github.com/jgm/texmath.git - commit: 19700530733707284bb41f24add757f19ca23430 +- texmath-0.12.3.2 - git: https://github.com/jgm/citeproc.git commit: 673a7fb643d24a3bb0f60f8f29e189c0ba7ef15b - git: https://github.com/jgm/commonmark-hs.git -- cgit v1.2.3 From 45054733fa3bd9c3ce349018854be61b91b5a804 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Oct 2021 17:31:40 -0700 Subject: Use citeproc 0.6, commonmark 0.2.2.1, commonmark-extensions 0.2.2 --- cabal.project | 17 ----------------- pandoc.cabal | 6 +++--- stack.yaml | 8 +++----- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/cabal.project b/cabal.project index 28d7693c4..4dacd344c 100644 --- a/cabal.project +++ b/cabal.project @@ -3,23 +3,6 @@ tests: True flags: +embed_data_files -- constraints: aeson >= 2.0.1.0 -source-repository-package - type: git - location: https://github.com/jgm/citeproc.git - tag: 673a7fb643d24a3bb0f60f8f29e189c0ba7ef15b - -source-repository-package - type: git - location: https://github.com/jgm/commonmark-hs.git - tag: 7d34a747cd2d8668451909a722eb9ce16d1f4852 - subdir: commonmark - -source-repository-package - type: git - location: https://github.com/jgm/commonmark-hs.git - tag: 7d34a747cd2d8668451909a722eb9ce16d1f4852 - subdir: commonmark-pandoc - -- Needed to build with aeson 2 -- source-repository-package diff --git a/pandoc.cabal b/pandoc.cabal index 17bfb6b5a..d220980fd 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -535,9 +535,9 @@ library blaze-markup >= 0.8 && < 0.9, bytestring >= 0.9 && < 0.12, case-insensitive >= 1.2 && < 1.3, - citeproc >= 0.5 && < 0.6, - commonmark >= 0.2.1 && < 0.3, - commonmark-extensions >= 0.2.1.2 && < 0.3, + citeproc >= 0.6 && < 0.7, + commonmark >= 0.2.1.1 && < 0.3, + commonmark-extensions >= 0.2.2 && < 0.3, commonmark-pandoc >= 0.2.1.1 && < 0.3, connection >= 0.3.1, containers >= 0.4.2.1 && < 0.7, diff --git a/stack.yaml b/stack.yaml index 3a01d5b88..f46485335 100644 --- a/stack.yaml +++ b/stack.yaml @@ -27,11 +27,9 @@ extra-deps: - tasty-lua-1.0.0 - pandoc-types-1.22.1 - texmath-0.12.3.2 -- git: https://github.com/jgm/citeproc.git - commit: 673a7fb643d24a3bb0f60f8f29e189c0ba7ef15b -- git: https://github.com/jgm/commonmark-hs.git - commit: 7d34a747cd2d8668451909a722eb9ce16d1f4852 - subdirs: [commonmark, commonmark-pandoc] +- commonmark-0.2.1.1 +- commonmark-extensions-0.2.2 +- citeproc-0.6 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From 64d55d5a7dae93dd9ba8f68c8e9acee9837af023 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Oct 2021 17:44:33 -0700 Subject: Update changelog. --- changelog.md | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 2dcf75e3f..e1cc9800a 100644 --- a/changelog.md +++ b/changelog.md @@ -352,6 +352,34 @@ (PandocMonad m, MonadIO m) => Lua a -> m (Either PandocError a) + * Lua modules (Albert Krewinkel): + + + Switch to hslua-2.0. The new HsLua version takes a somewhat different + approach to marshalling and unmarshalling, relying less on typeclasses + and more on specialized types. This allows for better performance and + improved error messages. Furthermore, new abstractions allow to + document the code and exposed functions. + + Marshal Version values, Inline elements, Attr elements, + and Pandoc elements as userdata. + + Remove deprecated inline constructors `DoubleQuoted`, + `SingleQuoted`, `DisplayMath`, and `InlineMath`. + + Attr values are no longer normalized when assigned to an Inline + element property. + + It's no longer possible to access parts of Inline elements via + numerical indexes. E.g., `pandoc.Span('test')[2]` used to give + `pandoc.Str 'test'`, but yields `nil` now. This was undocumented + behavior not intended to be used in user scripts. Use named properties + instead. + + Accessing `.c` to get a JSON-like tuple of all components no longer + works. This was undocumented behavior. + + Only known properties can be set on an element value. Trying to set a + different property will now raise an error. + + Adds a new `pandoc.AttributeList()` constructor, which creates the + associative attribute list that is used as the third component of + `Attr` values. Values of this type can often be passed to constructors + instead of `Attr` values. + + `AttributeList` values can no longer be indexed numerically. + * Text.Pandoc.PDF: Previously we had to run `runIOorExplode` inside `withTempDir`. Now that PandocIO is an instance of MonadMask, this is no longer necessary. @@ -367,15 +395,17 @@ so we can run this with any instance of PandocMonad and MonadIO, not just PandocIO. + * Use `simpleFigure` builder in readers and `SimpleFigure` + pattern synonym in writers (Aner Lucero). + * Allow time 1.12. * Use skylighting-0.12, skylighting-core-0.12. This fixes highlighting issues with typescript, scala, and other syntaxes that include keyword lists from different syntaxes. - * Use latest dev version of texmath. - - * Use dev version of citeproc. + * Use citeproc 0.6, commonmark 0.2.2.1, commonmark-extensions 0.2.2, + texmath 0.12.3.2. * Require doclayout >= 0.3.1.1. This fixes recognition of "real widths" of emoji characters, which is important for tabular layout. -- cgit v1.2.3 From c712d13b67a92c887d5ef185064aecf0972d4496 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Oct 2021 22:10:25 -0700 Subject: Org reader: allow an initial :PROPERTIES: drawer to add to metadata. Closes #7520. --- src/Text/Pandoc/Readers/Org/DocumentTree.hs | 12 ++++++++++-- test/Tests/Readers/Org/Meta.hs | 2 +- test/command/7520.md | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 test/command/7520.md diff --git a/src/Text/Pandoc/Readers/Org/DocumentTree.hs b/src/Text/Pandoc/Readers/Org/DocumentTree.hs index 2dcbecb1d..1c4f253cc 100644 --- a/src/Text/Pandoc/Readers/Org/DocumentTree.hs +++ b/src/Text/Pandoc/Readers/Org/DocumentTree.hs @@ -41,6 +41,7 @@ documentTree :: PandocMonad m -> OrgParser m (F Inlines) -> OrgParser m (F Headline) documentTree blocks inline = do + properties <- option mempty propertiesDrawer initialBlocks <- blocks headlines <- sequence <$> manyTill (headline blocks inline 1) eof title <- fmap docTitle . orgStateMeta <$> getState @@ -54,7 +55,7 @@ documentTree blocks inline = do , headlineText = B.fromList title' , headlineTags = mempty , headlinePlanning = emptyPlanning - , headlineProperties = mempty + , headlineProperties = properties , headlineContents = initialBlocks' , headlineChildren = headlines' } @@ -163,8 +164,15 @@ unprunedHeadlineToBlocks hdln st = in if not usingSelectedTags || any (`Set.member` orgStateSelectTags st) (headlineTags rootNode') then do headlineBlocks <- headlineToBlocks rootNode' + -- add metadata from root node :PROPERTIES: + updateState $ \s -> + s{ orgStateMeta = foldr + (\(PropertyKey k, PropertyValue v) m -> + B.setMeta k v <$> m) + (orgStateMeta s) + (headlineProperties rootNode') } -- ignore first headline, it's the document's title - return . drop 1 . B.toList $ headlineBlocks + return $ drop 1 $ B.toList headlineBlocks else do headlineBlocks <- mconcat <$> mapM headlineToBlocks (headlineChildren rootNode') return . B.toList $ headlineBlocks diff --git a/test/Tests/Readers/Org/Meta.hs b/test/Tests/Readers/Org/Meta.hs index 6363d84b0..41a41cb00 100644 --- a/test/Tests/Readers/Org/Meta.hs +++ b/test/Tests/Readers/Org/Meta.hs @@ -238,7 +238,7 @@ tests = , " :setting: foo" , " :END:" ] =?> - (mempty::Blocks) + (setMeta "setting" ("foo" :: T.Text) (doc mempty)) , "Logbook drawer" =: T.unlines [ " :LogBook:" diff --git a/test/command/7520.md b/test/command/7520.md new file mode 100644 index 000000000..0300a9e45 --- /dev/null +++ b/test/command/7520.md @@ -0,0 +1,22 @@ +``` +% pandoc -f org -t native -s +:PROPERTIES: +:ID: d5b18943-98a3-4b2a-a545-41d17bf50f3e +:END: +#+title: Common Ground +^D +Pandoc + Meta + { unMeta = + fromList + [ ( "id" + , MetaString "d5b18943-98a3-4b2a-a545-41d17bf50f3e" + ) + , ( "title" + , MetaInlines [ Str "Common" , Space , Str "Ground" ] + ) + ] + } + [] + +``` -- cgit v1.2.3 From 42396cb23fbb5df9fb1b144c255a2a4b2867bafb Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Oct 2021 22:14:14 -0700 Subject: Update changelog. --- changelog.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index e1cc9800a..ce461caf7 100644 --- a/changelog.md +++ b/changelog.md @@ -107,7 +107,10 @@ considered the end of the parent field. + Add placeholder for word diagram instead of just omitting it (Ezwal). - * Org reader: don't parse a list as first item in a list item (#7557). + * Org reader: + + + Don't parse a list as first item in a list item (#7557). + + Allow an initial `:PROPERTIES:` drawer to add to metadata (#7520). * Docx writer: -- cgit v1.2.3 From 51e1a8601f10d2ebed2d4ff66c39959ac56996a7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Oct 2021 22:15:37 -0700 Subject: Bump to 2.15, updaet man page. --- MANUAL.txt | 2 +- man/pandoc.1 | 218 ++++++++++++++++++++++++++++++++++++++++++++--------------- pandoc.cabal | 2 +- 3 files changed, 165 insertions(+), 57 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 7caedc94a..887276a58 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1,7 +1,7 @@ --- title: Pandoc User's Guide author: John MacFarlane -date: August 20, 2021 +date: October 22, 2021 --- # Synopsis diff --git a/man/pandoc.1 b/man/pandoc.1 index e901f60b3..0cec5d967 100644 --- a/man/pandoc.1 +++ b/man/pandoc.1 @@ -1,7 +1,7 @@ '\" t -.\" Automatically generated by Pandoc 2.14.1 +.\" Automatically generated by Pandoc 2.14.2 .\" -.TH "Pandoc User\[cq]s Guide" "" "July 18, 2021" "pandoc 2.14.2" "" +.TH "Pandoc User\[cq]s Guide" "" "October 22, 2021" "pandoc 2.15" "" .hy .SH NAME pandoc - general markup converter @@ -178,11 +178,11 @@ is used), \f[C]fancyvrb\f[R], \f[C]longtable\f[R], \f[C]booktabs\f[R], \f[C]hyperref\f[R], \f[C]xcolor\f[R], \f[C]ulem\f[R], \f[C]geometry\f[R] (with the \f[C]geometry\f[R] variable set), \f[C]setspace\f[R] (with \f[C]linestretch\f[R]), and \f[C]babel\f[R] (with \f[C]lang\f[R]). +If \f[C]CJKmainfont\f[R] is set, \f[C]xeCJK\f[R] is needed. The use of \f[C]xelatex\f[R] or \f[C]lualatex\f[R] as the PDF engine requires \f[C]fontspec\f[R]. \f[C]lualatex\f[R] uses \f[C]selnolig\f[R]. -\f[C]xelatex\f[R] uses \f[C]polyglossia\f[R] (with \f[C]lang\f[R]), -\f[C]xecjk\f[R], and \f[C]bidi\f[R] (with the \f[C]dir\f[R] variable +\f[C]xelatex\f[R] uses \f[C]bidi\f[R] (with the \f[C]dir\f[R] variable set). If the \f[C]mathspec\f[R] variable is set, \f[C]xelatex\f[R] will use \f[C]mathspec\f[R] instead of \f[C]unicode-math\f[R]. @@ -765,6 +765,15 @@ rendering the document in standalone mode. If no \f[I]VAL\f[R] is specified, the key will be given the value \f[C]true\f[R]. .TP +\f[B]\f[CB]--sandbox\f[B]\f[R] +Run pandoc in a sandbox, limiting IO operations in readers and writers +to reading the files specified on the command line. +Note that this option does not limit IO operations by filters or in the +production of PDF documents. +But it does offer security against, for example, disclosure of files +through the use of \f[C]include\f[R] directives. +Anyone using pandoc on untrusted user input should use this option. +.TP \f[B]\f[CB]-D\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--print-default-template=\f[B]\f[R]\f[I]FORMAT\f[R] Print the system default template for an output \f[I]FORMAT\f[R]. (See \f[C]-t\f[R] for a list of possible \f[I]FORMAT\f[R]s.) Templates @@ -995,7 +1004,10 @@ Specify whether footnotes (and references, if \f[C]reference-links\f[R] is set) are placed at the end of the current (top-level) block, the current section, or the document. The default is \f[C]document\f[R]. -Currently only affects the markdown and HTML writers. +Currently this option only affects the \f[C]markdown\f[R], +\f[C]muse\f[R], \f[C]html\f[R], \f[C]epub\f[R], \f[C]slidy\f[R], +\f[C]s5\f[R], \f[C]slideous\f[R], \f[C]dzslides\f[R], and +\f[C]revealjs\f[R] writers. .TP \f[B]\f[CB]--markdown-headings=setext\f[B]\f[R]|\f[B]\f[CB]atx\f[B]\f[R] Specify whether to use ATX-style (\f[C]#\f[R]-prefixed) or Setext-style @@ -1249,11 +1261,18 @@ Title and Content Section Header .IP \[bu] 2 Two Content +.IP \[bu] 2 +Comparison +.IP \[bu] 2 +Content with Caption +.IP \[bu] 2 +Blank .PP For each name, the first layout found with that name will be used. If no layout is found with one of the names, pandoc will output a warning and use the layout with that name from the default reference doc instead. +(How these layouts are used is described in PowerPoint layout choice.) .PP All templates included with a recent version of MS PowerPoint will fit these criteria. @@ -1263,7 +1282,7 @@ check.) You can also modify the default \f[C]reference.pptx\f[R]: first run \f[C]pandoc -o custom-reference.pptx --print-default-data-file reference.pptx\f[R], and then modify \f[C]custom-reference.pptx\f[R] in MS PowerPoint (pandoc -will use the first four layout slides, as mentioned above). +will use the layouts with the names listed above). .RE .RE .TP @@ -1617,6 +1636,11 @@ T}@T{ PandocCiteprocError T} T{ +25 +T}@T{ +PandocBibliographyError +T} +T{ 31 T}@T{ PandocEpubSubdirectoryError @@ -2444,7 +2468,7 @@ list of keywords to be included in HTML, PDF, ODT, pptx, docx and AsciiDoc metadata; repeat as for \f[C]author\f[R], above .TP \f[B]\f[CB]subject\f[B]\f[R] -document subject, included in ODT, PDF, docx and pptx metadata +document subject, included in ODT, PDF, docx, EPUB, and pptx metadata .TP \f[B]\f[CB]description\f[B]\f[R] document description, included in ODT, docx and pptx metadata. @@ -2621,7 +2645,7 @@ base URL for Slideous documents (defaults to \f[C]slideous\f[R]) .TP \f[B]\f[CB]title-slide-attributes\f[B]\f[R] additional attributes for the title slide of reveal.js slide shows. -See background in reveal.js and beamer for an example. +See [background in reveal.js and beamer] for an example. .PP All reveal.js configuration options are available as variables. To turn off boolean flags that default to true in reveal.js, use @@ -3107,8 +3131,8 @@ working directory from which pandoc is run. non-null value if \f[C]--toc/--table-of-contents\f[R] was specified .TP \f[B]\f[CB]toc-title\f[B]\f[R] -title of table of contents (works only with EPUB, HTML, opendocument, -odt, docx, pptx, beamer, LaTeX) +title of table of contents (works only with EPUB, HTML, revealjs, +opendocument, odt, docx, pptx, beamer, LaTeX) .SH EXTENSIONS .PP The behavior of some of the readers and writers can be adjusted by @@ -4247,8 +4271,8 @@ two spaces. A term may have multiple definitions, and each definition may consist of one or more block elements (paragraph, code block, list, etc.), each indented four spaces or one tab stop. -The body of the definition (including the first line, aside from the -colon or tilde) should be indented four spaces. +The body of the definition (not including the first line) should be +indented four spaces. However, as with other Markdown lists, you can \[lq]lazily\[rq] omit indentation except at the beginning of a paragraph or other block element: @@ -6001,7 +6025,8 @@ relative to the file containing the link reference definition, not the file containing the reference link or image itself, if these differ. .SS Extension: \f[C]attributes\f[R] .PP -Allows attributes to be attached to any inline or block-level element. +Allows attributes to be attached to any inline or block-level element +when parsing \f[C]commonmark\f[R]. The syntax for the attributes is the same as that used in \f[C]header_attributes\f[R]. .IP \[bu] 2 @@ -6819,15 +6844,58 @@ lines in the default template.) .PP These rules are designed to support many different styles of slide show. If you don\[cq]t care about structuring your slides into sections and -subsections, you can just use level-1 headings for all each slide. -(In that case, level-1 will be the slide level.) But you can also -structure the slide show into sections, as in the example above. +subsections, you can either just use level-1 headings for all slides (in +that case, level 1 will be the slide level) or you can set +\f[C]--slide-level=0\f[R]. .PP Note: in reveal.js slide shows, if slide level is 2, a two-dimensional layout will be produced, with level-1 headings building horizontally and level-2 headings building vertically. It is not recommended that you use deeper nesting of section levels with -reveal.js. +reveal.js unless you set \f[C]--slide-level=0\f[R] (which lets reveal.js +produce a one-dimensional layout and only interprets horizontal rules as +slide boundaries). +.SS PowerPoint layout choice +.PP +When creating slides, the pptx writer chooses from a number of +pre-defined layouts, based on the content of the slide: +.TP +Title Slide +This layout is used for the initial slide, which is generated and filled +from the metadata fields \f[C]date\f[R], \f[C]author\f[R], and +\f[C]title\f[R], if they are present. +.TP +Section Header +This layout is used for what pandoc calls \[lq]title slides\[rq], i.e. +slides which start with a header which is above the slide level in the +hierarchy. +.TP +Two Content +This layout is used for two-column slides, i.e.\ slides containing a div +with class \f[C]columns\f[R] which contains at least two divs with class +\f[C]column\f[R]. +.TP +Comparison +This layout is used instead of \[lq]Two Content\[rq] for any two-column +slides in which at least one column contains text followed by non-text +(e.g.\ an image or a table). +.TP +Content with Caption +This layout is used for any non-two-column slides which contain text +followed by non-text (e.g.\ an image or a table). +.TP +Blank +This layout is used for any slides which only contain blank content, +e.g.\ a slide containing only speaker notes, or a slide containing only +a non-breaking space. +.TP +Title and Content +This layout is used for all slides which do not match the criteria for +another layout. +.PP +These layouts are chosen from the default pptx reference doc included +with pandoc, unless an alternative reference doc is specified using +\f[C]--reference-doc\f[R]. .SS Incremental lists .PP By default, these writers produce lists that display \[lq]all at @@ -6879,9 +6947,6 @@ incrementally without the \f[C]-i\f[R] option and all at once with the .PP Both methods allow incremental and nonincremental lists to be mixed in a single document. -.PP -Note: Neither the \f[C]-i/--incremental\f[R] option nor any of the -methods described here currently works for PowerPoint output. .SS Inserting pauses .PP You can add \[lq]pauses\[rq] within a slide by including a paragraph @@ -7057,48 +7122,65 @@ User\[cq]s Guide may also be used: \f[C]allowdisplaybreaks\f[R], \f[C]allowframebreaks\f[R], \f[C]b\f[R], \f[C]c\f[R], \f[C]t\f[R], \f[C]environment\f[R], \f[C]label\f[R], \f[C]plain\f[R], \f[C]shrink\f[R], \f[C]standout\f[R], \f[C]noframenumbering\f[R]. -.SS Background in reveal.js and beamer -.PP -Background images can be added to self-contained reveal.js slideshows -and to beamer slideshows. -.PP -For the same image on every slide, use the configuration option -\f[C]background-image\f[R] either in the YAML metadata block or as a -command-line variable. -(There are no other options in beamer and the rest of this section -concerns reveal.js slideshows.) -.PP -For reveal.js, you can instead use the reveal.js-native option -\f[C]parallaxBackgroundImage\f[R]. -You can also set \f[C]parallaxBackgroundHorizontal\f[R] and -\f[C]parallaxBackgroundVertical\f[R] the same way and must also set -\f[C]parallaxBackgroundSize\f[R] to have your values take effect. -.PP -To set an image for a particular reveal.js slide, add -\f[C]{data-background-image=\[dq]/path/to/image\[dq]}\f[R] to the first -slide-level heading on the slide (which may even be empty). +.SS Background in reveal.js, beamer, and pptx +.PP +Background images can be added to self-contained reveal.js slide shows, +beamer slide shows, and pptx slide shows. +.SS On all slides (beamer, reveal.js, pptx) +.PP +With beamer and reveal.js, the configuration option +\f[C]background-image\f[R] can be used either in the YAML metadata block +or as a command-line variable to get the same image on every slide. +.PP +For pptx, you can use a reference doc in which background images have +been set on the relevant layouts. +.SS \f[C]parallaxBackgroundImage\f[R] (reveal.js) +.PP +For reveal.js, there is also the reveal.js-native option +\f[C]parallaxBackgroundImage\f[R], which can be used instead of +\f[C]background-image\f[R] to produce a parallax scrolling background. +You must also set \f[C]parallaxBackgroundSize\f[R], and can optionally +set \f[C]parallaxBackgroundHorizontal\f[R] and +\f[C]parallaxBackgroundVertical\f[R] to configure the scrolling +behaviour. +See the reveal.js documentation for more details about the meaning of +these options. .PP In reveal.js\[cq]s overview mode, the parallaxBackgroundImage will show up only on the first slide. +.SS On individual slides (reveal.js, pptx) .PP -Other reveal.js background settings also work on individual slides, -including \f[C]data-background-size\f[R], -\f[C]data-background-repeat\f[R], \f[C]data-background-color\f[R], -\f[C]data-transition\f[R], and \f[C]data-transition-speed\f[R]. +To set an image for a particular reveal.js or pptx slide, add +\f[C]{background-image=\[dq]/path/to/image\[dq]}\f[R] to the first +slide-level heading on the slide (which may even be empty). .PP -To add a background image to the automatically generated title slide, -use the \f[C]title-slide-attributes\f[R] variable in the YAML metadata -block. +As the HTML writers pass unknown attributes through, other reveal.js +background settings also work on individual slides, including +\f[C]background-size\f[R], \f[C]background-repeat\f[R], +\f[C]background-color\f[R], \f[C]transition\f[R], and +\f[C]transition-speed\f[R]. +(The \f[C]data-\f[R] prefix will automatically be added.) +.PP +Note: \f[C]data-background-image\f[R] is also supported in pptx for +consistency with reveal.js \[en] if \f[C]background-image\f[R] isn\[cq]t +found, \f[C]data-background-image\f[R] will be checked. +.SS On the title slide (reveal.js, pptx) +.PP +To add a background image to the automatically generated title slide for +reveal.js, use the \f[C]title-slide-attributes\f[R] variable in the YAML +metadata block. It must contain a map of attribute names and values. +(Note that the \f[C]data-\f[R] prefix is required here, as it isn\[cq]t +added automatically.) .PP -See the reveal.js documentation for more details. -.PP -For example in reveal.js: +For pptx, pass a reference doc with the background image set on the +\[lq]Title Slide\[rq] layout. +.SS Example (reveal.js) .IP .nf \f[C] --- -title: My Slideshow +title: My Slide Show parallaxBackgroundImage: /path/to/my/background_image.png title-slide-attributes: data-background-image: /path/to/title_image.png @@ -7109,7 +7191,7 @@ title-slide-attributes: Slide 1 has background_image.png as its background. -## {data-background-image=\[dq]/path/to/special_image.jpg\[dq]} +## {background-image=\[dq]/path/to/special_image.jpg\[dq]} Slide 2 has a special image for its background, even though the heading has no content. \f[R] @@ -7184,7 +7266,15 @@ A string value in BCP 47 format. Pandoc will default to the local language if nothing is specified. .TP \f[B]\f[CB]subject\f[B]\f[R] -A string value or a list of such values. +Either a string value, or an object with fields \f[C]text\f[R], +\f[C]authority\f[R], and \f[C]term\f[R], or a list of such objects. +Valid values for \f[C]authority\f[R] are either a reserved authority +value (currently \f[C]AAT\f[R], \f[C]BIC\f[R], \f[C]BISAC\f[R], +\f[C]CLC\f[R], \f[C]DDC\f[R], \f[C]CLIL\f[R], \f[C]EuroVoc\f[R], +\f[C]MEDTOP\f[R], \f[C]LCSH\f[R], \f[C]NDC\f[R], \f[C]Thema\f[R], +\f[C]UDC\f[R], and \f[C]WGS\f[R]) or an absolute IRI identifying a +custom scheme. +Valid values for \f[C]term\f[R] are defined by the scheme. .TP \f[B]\f[CB]description\f[B]\f[R] A string value. @@ -7368,6 +7458,11 @@ T}@T{ frontmatter T} T{ +frontispiece +T}@T{ +frontmatter +T} +T{ appendix T}@T{ backmatter @@ -7769,13 +7864,22 @@ Several input formats (including HTML, Org, and RST) support included in the output. An untrusted attacker could use these to view the contents of files on the file system. +(Using the \f[C]--sandbox\f[R] option can protect against this threat.) .IP "3." 3 +Several output formats (including RTF, FB2, HTML with +\f[C]--self-contained\f[R], EPUB, Docx, and ODT) will embed encoded or +raw images into the output file. +An untrusted attacker could exploit this to view the contents of +non-image files on the file system. +(Using the \f[C]--sandbox\f[R] option can protect against this threat, +but will also prevent including images in these formats.) +.IP "4." 3 If your application uses pandoc as a Haskell library (rather than shelling out to the executable), it is possible to use it in a mode that fully isolates pandoc from your file system, by running the pandoc operations in the \f[C]PandocPure\f[R] monad. See the document Using the pandoc API for more details. -.IP "4." 3 +.IP "5." 3 Pandoc\[cq]s parsers can exhibit pathological performance on some corner cases. It is wise to put any pandoc operations under a timeout, to avoid DOS @@ -7783,7 +7887,11 @@ attacks that exploit these issues. If you are using the pandoc executable, you can add the command line options \f[C]+RTS -M512M -RTS\f[R] (for example) to limit the heap size to 512MB. -.IP "5." 3 +Note that the \f[C]commonmark\f[R] parser (including +\f[C]commonmark_x\f[R] and \f[C]gfm\f[R]) is much less vulnerable to +pathological performance than the \f[C]markdown\f[R] parser, so it is a +better choice when processing untrusted input. +.IP "6." 3 The HTML generated by pandoc is not guaranteed to be safe. If \f[C]raw_html\f[R] is enabled for the Markdown input, users can inject arbitrary HTML. diff --git a/pandoc.cabal b/pandoc.cabal index d220980fd..126405792 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: pandoc -version: 2.14.2 +version: 2.15 build-type: Simple license: GPL-2.0-or-later license-file: COPYING.md -- cgit v1.2.3 From 82d9aa7ca47a58bd771937b33b7dc3dc5938ed89 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Oct 2021 22:38:58 -0700 Subject: Minor reformatting in chargelog. --- changelog.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index ce461caf7..bf8f2a6e4 100644 --- a/changelog.md +++ b/changelog.md @@ -283,12 +283,11 @@ * Text.Pandoc.Writers.Shared: + Export `splitSentences` as a Doc Text transform [API change]. - Use this in man/ms. - - We used to attempt automatic sentence splitting in man and ms - output, since sentence-ending periods need to be followed by - two spaces or a newline in these formats. But it's difficult - to do this reliably at the level of `[Inline]`. + Use this in man/ms. We used to attempt automatic sentence + splitting in man and ms output, since sentence-ending + periods need to be followed by two spaces or a newline in + these formats. But it's difficult to do this reliably at + the level of `[Inline]`. * Text.Pandoc.Translations: small revisions for compatibility with aeson 2. -- cgit v1.2.3 From c8fb1680276ad9c93d9cf35bcdf0e76f16e3d10e Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 23 Oct 2021 16:07:02 +0200 Subject: changelog.md: update some Lua-related entries --- changelog.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index bf8f2a6e4..c10043c39 100644 --- a/changelog.md +++ b/changelog.md @@ -352,7 +352,11 @@ to any instance of PandocMonad and MonadIO [API change]. The type of `runLua` is now - (PandocMonad m, MonadIO m) => Lua a -> m (Either PandocError a) + (PandocMonad m, MonadIO m) => + LuaE PandocError a -> m (Either PandocError a) + + The change from `Lua` to `LuaE PandocError` is due to the switch to + hslua-2.0; see next item. * Lua modules (Albert Krewinkel): @@ -380,7 +384,6 @@ associative attribute list that is used as the third component of `Attr` values. Values of this type can often be passed to constructors instead of `Attr` values. - + `AttributeList` values can no longer be indexed numerically. * Text.Pandoc.PDF: Previously we had to run `runIOorExplode` inside `withTempDir`. Now that PandocIO is an instance of MonadMask, this is -- cgit v1.2.3 From 2d3813e0dd7c2752bf299eb39e0b226d911920f1 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 23 Oct 2021 12:55:33 +0200 Subject: Lua: convert IOErrors to PandocErrors in pandoc.pipe function Fixes: #7523 --- src/Text/Pandoc/Lua/Module/Pandoc.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index ef1d6f078..eeadfa340 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -18,6 +18,7 @@ module Text.Pandoc.Lua.Module.Pandoc import Prelude hiding (read) import Control.Applicative (optional) import Control.Monad ((>=>), forM_, when) +import Control.Monad.Catch (catch, throwM) import Control.Monad.Except (throwError) import Data.Default (Default (..)) import Data.Maybe (fromMaybe) @@ -206,6 +207,7 @@ pipe :: String -- ^ path to executable -> PandocLua NumResults pipe command args input = liftPandocLua $ do (ec, output) <- Lua.liftIO $ pipeProcess Nothing command args input + `catch` (throwM . PandocIOError "pipe") case ec of ExitSuccess -> 1 <$ Lua.push output ExitFailure n -> do -- cgit v1.2.3 From 87a98b76ce80ee53acfc54fcd8768c332413efe1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 23 Oct 2021 16:17:49 -0700 Subject: Use ipynb 0.1.0.2. With this change pandoc can be built with aeson >= 2. --- cabal.project | 13 +------------ pandoc.cabal | 4 ++-- stack.yaml | 2 ++ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/cabal.project b/cabal.project index 4dacd344c..b0606c372 100644 --- a/cabal.project +++ b/cabal.project @@ -1,16 +1,5 @@ packages: pandoc.cabal tests: True flags: +embed_data_files --- constraints: aeson >= 2.0.1.0 +constraints: aeson >= 2.0.1.0 --- Needed to build with aeson 2 - --- source-repository-package --- type: git --- location: https://github.com/hasufell/aeson-pretty.git --- tag: e902ab866bb41d990b66af3644aeb352ff7aaf6f - --- source-repository-package --- type: git --- location: https://github.com/jgm/ipynb.git --- tag: 1f1ddb29227335091a3a158b9aeeeb47a372c683 diff --git a/pandoc.cabal b/pandoc.cabal index 126405792..ca9fc9245 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -526,7 +526,7 @@ library JuicyPixels >= 3.1.6.1 && < 3.4, SHA >= 1.6 && < 1.7, aeson >= 0.7 && < 2.1, - aeson-pretty >= 0.8.5 && < 0.9, + aeson-pretty >= 0.8.9 && < 0.9, array >= 0.5 && < 0.6, attoparsec >= 0.12 && < 0.15, base64-bytestring >= 0.1 && < 1.3, @@ -560,7 +560,7 @@ library http-client >= 0.4.30 && < 0.8, http-client-tls >= 0.2.4 && < 0.4, http-types >= 0.8 && < 0.13, - ipynb >= 0.1 && < 0.2, + ipynb >= 0.1.0.2 && < 0.2, jira-wiki-markup >= 1.4 && < 1.5, mtl >= 2.2 && < 2.3, network >= 2.6, diff --git a/stack.yaml b/stack.yaml index f46485335..145b53134 100644 --- a/stack.yaml +++ b/stack.yaml @@ -30,6 +30,8 @@ extra-deps: - commonmark-0.2.1.1 - commonmark-extensions-0.2.2 - citeproc-0.6 +- aeson-pretty-0.8.9 +- ipynb-0.1.0.2 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From 844a080d2af35ae70239e714da132900463e726a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 23 Oct 2021 16:32:29 -0700 Subject: Update changelog. --- changelog.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index c10043c39..a79197b5e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,4 @@ -[#](#) Revision history for pandoc +# Revision history for pandoc ## pandoc 2.15 (NODATE) @@ -384,6 +384,7 @@ associative attribute list that is used as the third component of `Attr` values. Values of this type can often be passed to constructors instead of `Attr` values. + + Convert IOErrors to PandocErrors in `pandoc.pipe` function (#7523). * Text.Pandoc.PDF: Previously we had to run `runIOorExplode` inside `withTempDir`. Now that PandocIO is an instance of MonadMask, this is @@ -410,7 +411,8 @@ syntaxes that include keyword lists from different syntaxes. * Use citeproc 0.6, commonmark 0.2.2.1, commonmark-extensions 0.2.2, - texmath 0.12.3.2. + texmath 0.12.3.2, ipynb 0.1.0.2. (These changes also allow + building with aeson >= 2.) * Require doclayout >= 0.3.1.1. This fixes recognition of "real widths" of emoji characters, which is important for tabular layout. -- cgit v1.2.3 From 94bf66c27e4c17202c42d2321a20c4408626d048 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 23 Oct 2021 17:35:17 -0700 Subject: CircleCI: use homebrew not curl to install stack. --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b58f259e6..a6019a6d9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,9 @@ jobs: - stack-dependencies-{{ checksum "stack.yaml" }} - run: name: Install stack - command: stack --version || (curl -sSL https://get.haskellstack.org/ | sh -s - -f) + command: | + brew install ghc + brew install haskell-stack - run: name: Resolve/Update Dependencies command: stack --no-terminal setup -- cgit v1.2.3 From 6dc56ee4f0a66cac77b37ff4935af41455bd7047 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 23 Oct 2021 19:25:23 -0700 Subject: Fix 2.15 release date on changelog. --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index a79197b5e..f2a30817d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ # Revision history for pandoc -## pandoc 2.15 (NODATE) +## pandoc 2.15 (2021-10-23) * Add `--sandbox` option (#5045). -- cgit v1.2.3 From c41ea00820d0dd5ac3b64cc96938c85f5dacd9b4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 23 Oct 2021 19:33:09 -0700 Subject: Update AUTHORS.md --- AUTHORS.md | 52 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 3c1cfa393..95f97e6f6 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,10 +1,7 @@ # Contributors -- Anabra -- Aner Lucero -- Arata Mizuki -- Arfon Smith - Aaron Wolen +- Agustín Martín Barbero - Albert Krewinkel - Alex Ivkin - Alex Toldaiev @@ -16,18 +13,21 @@ - Alexandre Franke - Alfred Wechselberger - Amogh Rathore +- Anabra - Anders Waldenborg - Andreas Lööw - Andrew Dunning - Andy Morris +- Aner Lucero - Anti-Distinctlyminty - Antoine Latter - Antonio Terceiro - Arata Mizuki +- Arata Mizuki +- Arfon Smith - Arfon Smith - Arlo O'Keeffe - Artyom Kazak -- Agustín Martín Barbero - B. Scott Michel - Ben Firshman - Ben Gamari @@ -54,6 +54,7 @@ - Christian Despres - Christoffer Ackelman - Christoffer Sawicki +- Christophe Dervieux - Clare Macrae - Clint Adams - Conal Elliott @@ -82,17 +83,19 @@ - Emily Bourke - Emily Eisenberg - Eric Kow -- Erik Rask -- Eric Seidel - Eric Schrijver +- Eric Seidel +- Erik Rask - Ethan Riley - Étienne Bersac -- Felix Yan +- Ezwal - Félix Baylac-Jacqué +- Felix Yan - Florian Beeres - Florian Eitel - Florian Klink - Florian Kohrt +- Francesco Mazzoli - Francesco Occhipinti - François Gannaz - Frederik Elwert @@ -112,6 +115,7 @@ - Heiko Schlittermann - Henrik Tramberend - Henry de Valence +- Herwig Stuetz - Hubert Plociniczak - Ian Max Andolina - Igor Khorlo @@ -119,7 +123,6 @@ - Ilya V. Portnov - Ivan Trubach - Ivo Clarysse -- Jared Lander - J. B. Rainsberger - J. Lewis Muir - Jaime Marquínez Ferrándiz @@ -131,22 +134,24 @@ - Jan Schulz - Jan Tojnar - Jan-Otto Kröpke +- Jared Lander - Jason Ronallo - Jeff Arnold - Jeff Runningen - Jens Getreu - Jens Petersen +- Jérémy Bobbio - Jeroen de Haas - Jerry Sky - Jesse Rosenthal - Joe Hermaszewski - Joe Hillenbrand - John KetzerX +- John Luke Bentley - John MacFarlane - John Muccigrosso -- John Luke Bentley -- Jonas Smedegaard - Jonas Scholl +- Jonas Smedegaard - Jonathan Daugherty - Jose Luis Duran - José de Mattos Neto @@ -157,7 +162,6 @@ - Juliette Fourcot - Juliusz Gonera - Justin Bogner -- Jérémy Bobbio - Karl Pettersson - Keiichiro Shikano - Kelsey Hightower @@ -165,7 +169,6 @@ - Konstantin Zudov - Kristof Bastiaensen - Krystof Beuermann -- Herwig Stuetz - Lars-Dominik Braun - Laurent P. René de Cotret - Leif Metcalf @@ -201,6 +204,7 @@ - Michael Snoyman - Michael Thompson - Mike Tzou +- Milan Bracke - MinRK - Morton Fox - Nathan Gass @@ -222,8 +226,8 @@ - Owen McGrath - Pablo Rodríguez - Pascal Wagler -- Paul Tilley - Paul Rivier +- Paul Tilley - Paulo Tanimoto - Pete Ryland - Peter Fabinksi @@ -233,6 +237,7 @@ - Phillip Alday - Prayag Verma - Puneeth Chaganti +- Quinn - Ralf Stephan - Raniere Silva - Raymond Ehlers @@ -241,6 +246,7 @@ - Roman Beránek - RyanGlScott - Salim B +- Samuel Tardieu - Sascha Wilde - Scott Morrison - Sebastian Talmon @@ -253,8 +259,10 @@ - Sidarth Kapur - Sidharth Kapur - Simon Hengel +- Simon Schuster - Stefan Dresselhaus - Sumit Sahrawat +- TEC - Tarik Graba - Tatiana Porras - Thenaesh Elango @@ -266,12 +274,12 @@ - Tiziano Müller - Todd Sifleet - Tom Leese -- Tristan de Cacqueray - Tristan Stenner +- Tristan de Cacqueray - Uli Köhler - Urs Liska -- Václav Zeman - Václav Haisman +- Václav Zeman - Vaibhav Sagar - Vanessa McHale - Vasily Alferov @@ -279,8 +287,8 @@ - Viktor Kronvall - Vincent - Vlad Hanciuta -- Wandmalfarbe - Waldir Pimenta +- Wandmalfarbe - Wikiwide - William Lupton - Winnie Hellmann @@ -299,10 +307,11 @@ - chinapedia - cholonam - csforste -- dbecher-ito - d-dorazio +- dbecher-ito - ebiim - favonia +- hseg - infinity0x - jeongminkim-islab - kaizshang91 @@ -310,14 +319,14 @@ - lwolfsonkin - mbrackeantidot - mt_caret -- nkalvi - niszet +- nkalvi - nuew - obcat - oltolm - oquechy -- quasicomputational - qerub +- quasicomputational - robabla - roblabla - rodja.trappe @@ -326,11 +335,10 @@ - takahashim - taotieren - tecosaur -- TEC - tgkokk - the-solipsist -- timo-a - thsutton +- timo-a - vijayphoenix - wiefling - wuffi -- cgit v1.2.3 From a14063340008d18230e32029ee0b1a29526626ed Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 23 Oct 2021 19:35:05 -0700 Subject: Fix description of sandbox feature in changelog. --- changelog.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index f2a30817d..12ee4b3a0 100644 --- a/changelog.md +++ b/changelog.md @@ -4,10 +4,9 @@ * Add `--sandbox` option (#5045). - + Add sandbox feature for readers. When this option is used, - readers and writers only have access to input files (and - other files specified directly on command line). This restriction - is enforced in the type system. + + Add sandbox feature. When this option is used, readers and writers + only have access to input files (and other files specified directly on + command line). This restriction is enforced in the type system. + Filters, PDF production, custom writers are unaffected. This feature only insulates the actual readers and writers, not the pipeline around them in Text.Pandoc.App. -- cgit v1.2.3 From 6df9dc12628927a3e6ea5b5f2570c0d2bd8c808e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 23 Oct 2021 23:19:31 -0700 Subject: Fix conformance errors in test/epub/features.epub and test/epub/formatting.epub. See #7586. --- test/epub/features.epub | Bin 66371 -> 8970 bytes test/epub/formatting.epub | Bin 13460 -> 13513 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/test/epub/features.epub b/test/epub/features.epub index 0d50380ac..3715722d2 100644 Binary files a/test/epub/features.epub and b/test/epub/features.epub differ diff --git a/test/epub/formatting.epub b/test/epub/formatting.epub index f3f9b5b93..c74e05bd8 100644 Binary files a/test/epub/formatting.epub and b/test/epub/formatting.epub differ -- cgit v1.2.3 From c282451fb23c646e8e90aa413a5061993bd63ea2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 24 Oct 2021 14:04:23 -0700 Subject: Fixed test/epub/img.epub and img_no_cover.epub... so they're valid epubs. --- test/epub/img.epub | Bin 61768 -> 20478 bytes test/epub/img_no_cover.epub | Bin 50594 -> 10602 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/test/epub/img.epub b/test/epub/img.epub index ebe80d935..de4ae712a 100644 Binary files a/test/epub/img.epub and b/test/epub/img.epub differ diff --git a/test/epub/img_no_cover.epub b/test/epub/img_no_cover.epub index d8028ff2e..70431ff1a 100644 Binary files a/test/epub/img_no_cover.epub and b/test/epub/img_no_cover.epub differ -- cgit v1.2.3 From 73a105f59c14e7f4dce28b735f01ad1c8ee17d97 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 24 Oct 2021 15:11:02 -0700 Subject: Clean up wasteland.epub and formatting.epub from reader tests. Make them valid according to epubcheck. --- test/epub/formatting.epub | Bin 13513 -> 14022 bytes test/epub/wasteland.epub | Bin 26051 -> 25840 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/test/epub/formatting.epub b/test/epub/formatting.epub index c74e05bd8..c6ca6e57a 100644 Binary files a/test/epub/formatting.epub and b/test/epub/formatting.epub differ diff --git a/test/epub/wasteland.epub b/test/epub/wasteland.epub index 3a542ef83..6541fe066 100644 Binary files a/test/epub/wasteland.epub and b/test/epub/wasteland.epub differ -- cgit v1.2.3 From 113a66bd08fa4921157d95873c18c46431e565f9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 24 Oct 2021 15:24:59 -0700 Subject: Fix more epub files in epub reader tests. Closes #7586. --- test/epub/epub2_cover.epub | Bin 17937 -> 11794 bytes test/epub/epub2_no_cover.epub | Bin 9730 -> 3584 bytes test/epub/epub2_picture.epub | Bin 17939 -> 11742 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/test/epub/epub2_cover.epub b/test/epub/epub2_cover.epub index 02f8ec1fb..059f8c900 100644 Binary files a/test/epub/epub2_cover.epub and b/test/epub/epub2_cover.epub differ diff --git a/test/epub/epub2_no_cover.epub b/test/epub/epub2_no_cover.epub index cd8e24b3f..d3b64deeb 100644 Binary files a/test/epub/epub2_no_cover.epub and b/test/epub/epub2_no_cover.epub differ diff --git a/test/epub/epub2_picture.epub b/test/epub/epub2_picture.epub index d19684ce2..fbc85a4f9 100644 Binary files a/test/epub/epub2_picture.epub and b/test/epub/epub2_picture.epub differ -- cgit v1.2.3 From 230b133db53e8ef2677fe13304e1e03276ca6448 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 24 Oct 2021 22:49:34 +0200 Subject: Lua: marshal Citation values as userdata objects --- data/pandoc.lua | 23 ------------------ src/Text/Pandoc/Lua/Marshaling/AST.hs | 45 +++++++++++++++++++++++------------ src/Text/Pandoc/Lua/Module/Pandoc.hs | 23 ++++++++++++++++++ src/Text/Pandoc/Lua/Module/Types.hs | 1 - test/lua/module/pandoc.lua | 2 ++ 5 files changed, 55 insertions(+), 39 deletions(-) diff --git a/data/pandoc.lua b/data/pandoc.lua index 8fbd2259b..47343b28c 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -557,29 +557,6 @@ for _, blk in pairs(M.Block.constructor) do augment_attr_setter(blk.behavior.setters) end --- Citation -M.Citation = AstElement:make_subtype'Citation' -M.Citation.behavior.clone = M.types.clone.Citation - ---- Creates a single citation. --- @function Citation --- @tparam string id citation identifier (like a bibtex key) --- @tparam AuthorInText|SuppressAuthor|NormalCitation mode citation mode --- @tparam[opt] {Inline,...} prefix citation prefix --- @tparam[opt] {Inline,...} suffix citation suffix --- @tparam[opt] int note_num note number --- @tparam[opt] int hash hash number -function M.Citation:new (id, mode, prefix, suffix, note_num, hash) - return { - id = id, - mode = mode, - prefix = ensureList(prefix or {}), - suffix = ensureList(suffix or {}), - note_num = note_num or 0, - hash = hash or 0, - } -end - -- ListAttributes M.ListAttributes = AstElement:make_subtype 'ListAttributes' M.ListAttributes.behavior.clone = M.types.clone.ListAttributes diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 5791b39c1..e436ffffc 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -37,6 +37,7 @@ module Text.Pandoc.Lua.Marshaling.AST , pushAttr , pushBlock + , pushCitation , pushInline , pushListAttributes , pushMetaValue @@ -109,24 +110,35 @@ instance Pushable Inline where instance Pushable Citation where push = pushCitation -pushCitation :: LuaError e => Pusher e Citation -pushCitation (Citation cid prefix suffix mode noteNum hash) = - pushViaConstr' "Citation" - [ push cid, push mode, push prefix, push suffix, push noteNum, push hash +typeCitation :: LuaError e => DocumentedType e Citation +typeCitation = deftype "Citation" [] + [ property "id" "citation ID / key" + (pushText, citationId) + (peekText, \citation cid -> citation{ citationId = cid }) + , property "mode" "citation mode" + (pushString . show, citationMode) + (peekRead, \citation mode -> citation{ citationMode = mode }) + , property "prefix" "citation prefix" + (pushInlines, citationPrefix) + (peekInlines, \citation prefix -> citation{ citationPrefix = prefix }) + , property "suffix" "citation suffix" + (pushInlines, citationSuffix) + (peekInlines, \citation suffix -> citation{ citationPrefix = suffix }) + , property "note_num" "note number" + (pushIntegral, citationNoteNum) + (peekIntegral, \citation noteNum -> citation{ citationNoteNum = noteNum }) + , property "hash" "hash number" + (pushIntegral, citationHash) + (peekIntegral, \citation hash -> citation{ citationHash = hash }) + , method $ defun "clone" ### return <#> udparam typeCitation "obj" "" + =#> functionResult pushCitation "Citation" "copy of obj" ] -peekCitation :: LuaError e => Peeker e Citation -peekCitation = fmap (retrieving "Citation") - . typeChecked "table" Lua.istable $ \idx -> do - idx' <- liftLua $ absindex idx - Citation - <$!> peekFieldRaw peekText "id" idx' - <*> peekFieldRaw (peekList peekInline) "prefix" idx' - <*> peekFieldRaw (peekList peekInline) "suffix" idx' - <*> peekFieldRaw peekRead "mode" idx' - <*> peekFieldRaw peekIntegral "note_num" idx' - <*> peekFieldRaw peekIntegral "hash" idx' +pushCitation :: LuaError e => Pusher e Citation +pushCitation = pushUD typeCitation +peekCitation :: LuaError e => Peeker e Citation +peekCitation = peekUD typeCitation instance Pushable Alignment where push = Lua.pushString . show @@ -289,6 +301,9 @@ peekBlocks = peekList peekBlock peekInlines :: LuaError e => Peeker e [Inline] peekInlines = peekList peekInline +pushInlines :: LuaError e => Pusher e [Inline] +pushInlines = pushPandocList pushInline + -- | Push Caption element pushCaption :: LuaError e => Caption -> LuaE e () pushCaption (Caption shortCaption longCaption) = do diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index eeadfa340..bc9ddc5e5 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -64,6 +64,7 @@ pushModule = do pushName (functionName fn) pushDocumentedFunction fn rawset (nth 3) + forM_ otherConstructors addConstr forM_ inlineConstructors addConstr -- add constructors to Inlines.constructor newtable -- constructor @@ -165,6 +166,28 @@ mkInlinesConstr name constr = defun name <#> parameter peekFuzzyInlines "content" "Inlines" "" =#> functionResult pushInline "Inline" "new object" +otherConstructors :: LuaError e => [DocumentedFunction e] +otherConstructors = + [ defun "Citation" + ### (\cid mode mprefix msuffix mnote_num mhash -> + cid `seq` mode `seq` mprefix `seq` msuffix `seq` + mnote_num `seq` mhash `seq` return $! Citation + { citationId = cid + , citationMode = mode + , citationPrefix = fromMaybe mempty mprefix + , citationSuffix = fromMaybe mempty msuffix + , citationNoteNum = fromMaybe 0 mnote_num + , citationHash = fromMaybe 0 mhash + }) + <#> parameter peekText "string" "cid" "citation ID (e.g. bibtex key)" + <#> parameter peekRead "citation mode" "mode" "citation rendering mode" + <#> optionalParameter peekFuzzyInlines "prefix" "Inlines" "" + <#> optionalParameter peekFuzzyInlines "suffix" "Inlines" "" + <#> optionalParameter peekIntegral "note_num" "integer" "note number" + <#> optionalParameter peekIntegral "hash" "integer" "hash number" + =#> functionResult pushCitation "Citation" "new citation object" + #? "Creates a single citation." + ] walkElement :: (Walkable (SingletonsList Inline) a, Walkable (SingletonsList Block) a, diff --git a/src/Text/Pandoc/Lua/Module/Types.hs b/src/Text/Pandoc/Lua/Module/Types.hs index 7307c6e88..4a7d14d2f 100644 --- a/src/Text/Pandoc/Lua/Module/Types.hs +++ b/src/Text/Pandoc/Lua/Module/Types.hs @@ -37,7 +37,6 @@ pushCloneTable = do Lua.newtable addFunction "Attr" $ cloneWith peekAttr pushAttr addFunction "Block" $ cloneWith peekBlock pushBlock - addFunction "Citation" $ cloneWith peekCitation Lua.push addFunction "Inline" $ cloneWith peekInline pushInline addFunction "Meta" $ cloneWith peekMeta Lua.push addFunction "MetaValue" $ cloneWith peekMetaValue pushMetaValue diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index a1bcd53fe..ba6d2a1df 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -176,6 +176,8 @@ return { local cloned = cite:clone() cite.id = 'newton' assert.are_same(cloned.id, 'leibniz') + assert.are_same(cite.id, 'newton') + assert.are_same(cite.mode, cloned.mode) end), }, -- cgit v1.2.3 From a493c7029cf2bc8490d96fff04b0a0c624987601 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 26 Oct 2021 14:40:10 +0200 Subject: Lua: marshal Block values as userdata objects Properties of Block values are marshalled lazily, which generally improves performance considerably. Script users may also notice the following differences: - Block element properties can no longer be accessed by numerical indexing of the `.c` field. The `.c` property now serves as an alias for `.content`, so some filter that used this undocumented method for property access may continue to work, while others will need to be updated and use proper property names. - The marshalled Block elements now have a `show` method, and a `__tostring` metamethod. Both return the Haskell string representation of the element. - Block values now have the Lua type `userdata` instead of `table`. --- data/pandoc.lua | 205 ---------------- src/Text/Pandoc/Lua/Init.hs | 4 - src/Text/Pandoc/Lua/Marshaling/AST.hs | 431 +++++++++++++++++++++++++--------- src/Text/Pandoc/Lua/Module/Pandoc.hs | 168 ++++++++++--- src/Text/Pandoc/Lua/Module/Types.hs | 4 - test/lua/module/pandoc.lua | 120 ++++++++++ 6 files changed, 581 insertions(+), 351 deletions(-) diff --git a/data/pandoc.lua b/data/pandoc.lua index 47343b28c..a20ce1e8c 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -273,22 +273,6 @@ local function ensureInlineList (x) end end ---- Ensure that the given object is a definition pair, convert if necessary. --- @local -local function ensureDefinitionPairs (pair) - local inlines = ensureInlineList(pair[1] or {}) - local blocks = ensureList(pair[2] or {}):map(ensureList) - return {inlines, blocks} -end - ---- Try hard to turn the arguments into an Attr object. -local function ensureAttr(attr) - if type(attr) == 'userdata' then - return attr - end - return M.Attr(attr) -end - ------------------------------------------------------------------------ -- Meta -- @section Meta @@ -364,199 +348,10 @@ function M.MetaBool(bool) return bool end ------------------------------------------------------------------------- --- Blocks --- @section Block - ---- Block elements -M.Block = AstElement:make_subtype'Block' -M.Block.behavior.clone = M.types.clone.Block - ---- Creates a block quote element --- @function BlockQuote --- @tparam {Block,...} content block content --- @treturn Block block quote element -M.BlockQuote = M.Block:create_constructor( - "BlockQuote", - function(content) return {c = ensureList(content)} end, - "content" -) - ---- Creates a bullet (i.e. unordered) list. --- @function BulletList --- @tparam {{Block,...},...} content list of items --- @treturn Block bullet list element -M.BulletList = M.Block:create_constructor( - "BulletList", - function(content) return {c = ensureList(content):map(ensureList)} end, - "content" -) - ---- Creates a code block element --- @function CodeBlock --- @tparam string text code string --- @tparam[opt] Attr attr element attributes --- @treturn Block code block element -M.CodeBlock = M.Block:create_constructor( - "CodeBlock", - function(text, attr) return {c = {ensureAttr(attr), text}} end, - {{attr = {"identifier", "classes", "attributes"}}, "text"} -) - ---- Creates a definition list, containing terms and their explanation. --- @function DefinitionList --- @tparam {{{Inline,...},{{Block,...}}},...} content list of items --- @treturn Block definition list element -M.DefinitionList = M.Block:create_constructor( - "DefinitionList", - function(content) - return {c = ensureList(content):map(ensureDefinitionPairs)} - end, - "content" -) - ---- Creates a div element --- @function Div --- @tparam {Block,...} content block content --- @tparam[opt] Attr attr element attributes --- @treturn Block div element -M.Div = M.Block:create_constructor( - "Div", - function(content, attr) - return {c = {ensureAttr(attr), ensureList(content)}} - end, - {{attr = {"identifier", "classes", "attributes"}}, "content"} -) - ---- Creates a header element. --- @function Header --- @tparam int level header level --- @tparam {Inline,...} content inline content --- @tparam[opt] Attr attr element attributes --- @treturn Block header element -M.Header = M.Block:create_constructor( - "Header", - function(level, content, attr) - return {c = {level, ensureAttr(attr), ensureInlineList(content)}} - end, - {"level", {attr = {"identifier", "classes", "attributes"}}, "content"} -) - ---- Creates a horizontal rule. --- @function HorizontalRule --- @treturn Block horizontal rule -M.HorizontalRule = M.Block:create_constructor( - "HorizontalRule", - function() return {} end -) - ---- Creates a line block element. --- @function LineBlock --- @tparam {{Inline,...},...} content inline content --- @treturn Block line block element -M.LineBlock = M.Block:create_constructor( - "LineBlock", - function(content) return {c = ensureList(content):map(ensureInlineList)} end, - "content" -) - ---- Creates a null element. --- @function Null --- @treturn Block null element -M.Null = M.Block:create_constructor( - "Null", - function() return {} end -) - ---- Creates an ordered list. --- @function OrderedList --- @tparam {{Block,...},...} items list items --- @param[opt] listAttributes list parameters --- @treturn Block ordered list element -M.OrderedList = M.Block:create_constructor( - "OrderedList", - function(items, listAttributes) - listAttributes = listAttributes or M.ListAttributes() - return {c = {listAttributes, ensureList(items):map(ensureList)}} - end, - {{listAttributes = {"start", "style", "delimiter"}}, "content"} -) - ---- Creates a para element. --- @function Para --- @tparam {Inline,...} content inline content --- @treturn Block paragraph element -M.Para = M.Block:create_constructor( - "Para", - function(content) return {c = ensureInlineList(content)} end, - "content" -) - ---- Creates a plain element. --- @function Plain --- @tparam {Inline,...} content inline content --- @treturn Block plain element -M.Plain = M.Block:create_constructor( - "Plain", - function(content) return {c = ensureInlineList(content)} end, - "content" -) - ---- Creates a raw content block of the specified format. --- @function RawBlock --- @tparam string format format of content --- @tparam string text string content --- @treturn Block raw block element -M.RawBlock = M.Block:create_constructor( - "RawBlock", - function(format, text) return {c = {format, text}} end, - {"format", "text"} -) - ---- Creates a table element. --- @function Table --- @tparam Caption caption table caption --- @tparam {ColSpec,...} colspecs column alignments and widths --- @tparam TableHead head table head --- @tparam {TableBody,..} bodies table bodies --- @treturn TableFoot foot table foot --- @tparam[opt] Attr attr attributes -M.Table = M.Block:create_constructor( - "Table", - function(caption, colspecs, head, bodies, foot, attr) - return { - c = { - ensureAttr(attr), - caption, - List:new(colspecs), - head, - List:new(bodies), - foot - } - } - end, - {"attr", "caption", "colspecs", "head", "bodies", "foot"} -) - - ------------------------------------------------------------------------ -- Element components -- @section components --- Monkey-patch setters for `attr` fields to be more forgiving in the input that --- results in a valid Attr value. -function augment_attr_setter (setters) - if setters.attr then - local orig = setters.attr - setters.attr = function(k, v) - orig(k, ensureAttr(v)) - end - end -end -for _, blk in pairs(M.Block.constructor) do - augment_attr_setter(blk.behavior.setters) -end - -- ListAttributes M.ListAttributes = AstElement:make_subtype 'ListAttributes' M.ListAttributes.behavior.clone = M.types.clone.ListAttributes diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index d9b210c55..60475e25c 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -83,12 +83,8 @@ initLuaState = do -- stack. putConstructorsInRegistry :: PandocLua () putConstructorsInRegistry = liftPandocLua $ do - constrsToReg $ Pandoc.Pandoc mempty mempty - constrsToReg $ Pandoc.Str mempty - constrsToReg $ Pandoc.Para mempty constrsToReg $ Pandoc.Meta mempty constrsToReg $ Pandoc.MetaList mempty - constrsToReg $ Pandoc.Citation mempty mempty mempty Pandoc.AuthorInText 0 0 putInReg "ListAttributes" -- used for ListAttributes type alias putInReg "List" -- pandoc.List putInReg "SimpleTable" -- helper for backward-compatible table handling diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index e436ffffc..22c78bff9 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -19,21 +19,27 @@ Marshaling/unmarshaling instances for document AST elements. module Text.Pandoc.Lua.Marshaling.AST ( peekAttr , peekBlock + , peekBlockFuzzy , peekBlocks + , peekBlocksFuzzy , peekCaption , peekCitation + , peekColSpec + , peekDefinitionItem , peekFormat , peekInline + , peekInlineFuzzy , peekInlines + , peekInlinesFuzzy , peekListAttributes , peekMeta , peekMetaValue , peekPandoc , peekMathType , peekQuoteType - - , peekFuzzyInlines - , peekFuzzyBlocks + , peekTableBody + , peekTableHead + , peekTableFoot , pushAttr , pushBlock @@ -46,7 +52,7 @@ module Text.Pandoc.Lua.Marshaling.AST import Control.Applicative ((<|>), optional) import Control.Monad.Catch (throwM) -import Control.Monad ((<$!>), (>=>)) +import Control.Monad ((<$!>)) import Data.Data (showConstr, toConstr) import Data.Text (Text) import Data.Version (Version) @@ -54,7 +60,7 @@ import HsLua hiding (Operation (Div)) import HsLua.Module.Version (peekVersionFuzzy) import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError (PandocLuaError)) -import Text.Pandoc.Lua.Util (pushViaConstr', pushViaConstructor) +import Text.Pandoc.Lua.Util (pushViaConstr') import Text.Pandoc.Lua.Marshaling.Attr (peekAttr, pushAttr) import Text.Pandoc.Lua.Marshaling.List (pushPandocList) @@ -102,14 +108,6 @@ instance Pushable MetaValue where instance Pushable Block where push = pushBlock --- Inline -instance Pushable Inline where - push = pushInline - --- Citation -instance Pushable Citation where - push = pushCitation - typeCitation :: LuaError e => DocumentedType e Citation typeCitation = deftype "Citation" [] [ property "id" "citation ID / key" @@ -232,69 +230,188 @@ peekMetaValue = retrieving "MetaValue $ " . \idx -> do Nothing -> peekUntagged _ -> failPeek "could not get meta value" +typeBlock :: LuaError e => DocumentedType e Block +typeBlock = deftype "Block" + [ operation Eq $ lambda + ### liftPure2 (==) + <#> parameter peekBlockFuzzy "Block" "a" "" + <#> parameter peekBlockFuzzy "Block" "b" "" + =#> boolResult "whether the two values are equal" + , operation Tostring $ lambda + ### liftPure show + <#> udparam typeBlock "self" "" + =#> functionResult pushString "string" "Haskell representation" + ] + [ possibleProperty "attr" "element attributes" + (pushAttr, \case + CodeBlock attr _ -> Actual attr + Div attr _ -> Actual attr + Header _ attr _ -> Actual attr + Table attr _ _ _ _ _ -> Actual attr + _ -> Absent) + (peekAttr, \case + CodeBlock _ code -> Actual . flip CodeBlock code + Div _ blks -> Actual . flip Div blks + Header lvl _ blks -> Actual . (\attr -> Header lvl attr blks) + Table _ c cs h bs f -> Actual . (\attr -> Table attr c cs h bs f) + _ -> const Absent) + , possibleProperty "bodies" "table bodies" + (pushPandocList pushTableBody, \case + Table _ _ _ _ bs _ -> Actual bs + _ -> Absent) + (peekList peekTableBody, \case + Table attr c cs h _ f -> Actual . (\bs -> Table attr c cs h bs f) + _ -> const Absent) + , possibleProperty "caption" "element caption" + (pushCaption, \case {Table _ capt _ _ _ _ -> Actual capt; _ -> Absent}) + (peekCaption, \case + Table attr _ cs h bs f -> Actual . (\c -> Table attr c cs h bs f) + _ -> const Absent) + , possibleProperty "colspecs" "column alignments and widths" + (pushPandocList pushColSpec, \case + Table _ _ cs _ _ _ -> Actual cs + _ -> Absent) + (peekList peekColSpec, \case + Table attr c _ h bs f -> Actual . (\cs -> Table attr c cs h bs f) + _ -> const Absent) + , possibleProperty "content" "element content" + (pushContent, getBlockContent) + (peekContent, setBlockContent) + , possibleProperty "foot" "table foot" + (pushTableFoot, \case {Table _ _ _ _ _ f -> Actual f; _ -> Absent}) + (peekTableFoot, \case + Table attr c cs h bs _ -> Actual . (\f -> Table attr c cs h bs f) + _ -> const Absent) + , possibleProperty "format" "format of raw content" + (pushFormat, \case {RawBlock f _ -> Actual f; _ -> Absent}) + (peekFormat, \case + RawBlock _ txt -> Actual . (`RawBlock` txt) + _ -> const Absent) + , possibleProperty "head" "table head" + (pushTableHead, \case {Table _ _ _ h _ _ -> Actual h; _ -> Absent}) + (peekTableHead, \case + Table attr c cs _ bs f -> Actual . (\h -> Table attr c cs h bs f) + _ -> const Absent) + , possibleProperty "level" "heading level" + (pushIntegral, \case {Header lvl _ _ -> Actual lvl; _ -> Absent}) + (peekIntegral, \case + Header _ attr inlns -> Actual . \lvl -> Header lvl attr inlns + _ -> const Absent) + , possibleProperty "listAttributes" "ordered list attributes" + (pushListAttributes, \case + OrderedList listAttr _ -> Actual listAttr + _ -> Absent) + (peekListAttributes, \case + OrderedList _ content -> Actual . (`OrderedList` content) + _ -> const Absent) + , possibleProperty "text" "text contents" + (pushText, getBlockText) + (peekText, setBlockText) + + , readonly "tag" "type of Block" + (pushString, showConstr . toConstr ) + + , alias "t" "tag" ["tag"] + , alias "c" "content" ["content"] + , alias "identifier" "element identifier" ["attr", "identifier"] + , alias "classes" "element classes" ["attr", "classes"] + , alias "attributes" "other element attributes" ["attr", "attributes"] + , alias "start" "ordered list start number" ["listAttributes", "start"] + , alias "style" "ordered list style" ["listAttributes", "style"] + , alias "delimiter" "numbering delimiter" ["listAttributes", "delimiter"] + + , method $ defun "clone" + ### return + <#> parameter peekBlock "Block" "block" "self" + =#> functionResult pushBlock "Block" "cloned Block" + + , method $ defun "show" + ### liftPure show + <#> parameter peekBlock "Block" "self" "" + =#> functionResult pushString "string" "Haskell string representation" + ] + where + boolResult = functionResult pushBool "boolean" + +getBlockContent :: Block -> Possible Content +getBlockContent = \case + -- inline content + Para inlns -> Actual $ ContentInlines inlns + Plain inlns -> Actual $ ContentInlines inlns + -- inline content + BlockQuote blks -> Actual $ ContentBlocks blks + Div _ blks -> Actual $ ContentBlocks blks + -- lines content + LineBlock lns -> Actual $ ContentLines lns + -- list items content + BulletList itms -> Actual $ ContentListItems itms + OrderedList _ itms -> Actual $ ContentListItems itms + -- definition items content + DefinitionList itms -> Actual $ ContentDefItems itms + _ -> Absent + +setBlockContent :: Block -> Content -> Possible Block +setBlockContent = \case + -- inline content + Para _ -> Actual . Para . inlineContent + Plain _ -> Actual . Plain . inlineContent + -- block content + BlockQuote _ -> Actual . BlockQuote . blockContent + Div attr _ -> Actual . Div attr . blockContent + -- lines content + LineBlock _ -> Actual . LineBlock . lineContent + -- list items content + BulletList _ -> Actual . BulletList . listItemContent + OrderedList la _ -> Actual . OrderedList la . listItemContent + -- definition items content + DefinitionList _ -> Actual . DefinitionList . defItemContent + _ -> const Absent + where + inlineContent = \case + ContentInlines inlns -> inlns + c -> throwM . PandocLuaError $ "expected Inlines, got " <> + contentTypeDescription c + blockContent = \case + ContentBlocks blks -> blks + ContentInlines inlns -> [Plain inlns] + c -> throwM . PandocLuaError $ "expected Blocks, got " <> + contentTypeDescription c + lineContent = \case + ContentLines lns -> lns + c -> throwM . PandocLuaError $ "expected list of lines, got " <> + contentTypeDescription c + defItemContent = \case + ContentDefItems itms -> itms + c -> throwM . PandocLuaError $ "expected definition items, got " <> + contentTypeDescription c + listItemContent = \case + ContentBlocks blks -> [blks] + ContentLines lns -> map ((:[]) . Plain) lns + ContentListItems itms -> itms + c -> throwM . PandocLuaError $ "expected list of items, got " <> + contentTypeDescription c + +getBlockText :: Block -> Possible Text +getBlockText = \case + CodeBlock _ lst -> Actual lst + RawBlock _ raw -> Actual raw + _ -> Absent + +setBlockText :: Block -> Text -> Possible Block +setBlockText = \case + CodeBlock attr _ -> Actual . CodeBlock attr + RawBlock f _ -> Actual . RawBlock f + _ -> const Absent + -- | Push a block element to the top of the Lua stack. pushBlock :: forall e. LuaError e => Block -> LuaE e () -pushBlock = \case - BlockQuote blcks -> pushViaConstructor @e "BlockQuote" blcks - BulletList items -> pushViaConstructor @e "BulletList" items - CodeBlock attr code -> pushViaConstr' @e "CodeBlock" - [ push code, pushAttr attr ] - DefinitionList items -> pushViaConstructor @e "DefinitionList" items - Div attr blcks -> pushViaConstr' @e "Div" - [push blcks, pushAttr attr] - Header lvl attr inlns -> pushViaConstr' @e "Header" - [push lvl, push inlns, pushAttr attr] - HorizontalRule -> pushViaConstructor @e "HorizontalRule" - LineBlock blcks -> pushViaConstructor @e "LineBlock" blcks - OrderedList lstAttr list -> pushViaConstr' @e "OrderedList" - [ push list, pushListAttributes @e lstAttr ] - Null -> pushViaConstructor @e "Null" - Para blcks -> pushViaConstructor @e "Para" blcks - Plain blcks -> pushViaConstructor @e "Plain" blcks - RawBlock f cs -> pushViaConstructor @e "RawBlock" f cs - Table attr blkCapt specs thead tbody tfoot -> - pushViaConstr' @e "Table" - [ pushCaption blkCapt, push specs, push thead, push tbody - , push tfoot, pushAttr attr] +pushBlock = pushUD typeBlock -- | Return the value at the given index as block if possible. peekBlock :: forall e. LuaError e => Peeker e Block -peekBlock = fmap (retrieving "Block") - . typeChecked "table" Lua.istable - $ \idx -> do - -- Get the contents of an AST element. - let mkBlock :: (a -> Block) -> Peeker e a -> Peek e Block - mkBlock f p = f <$!> peekFieldRaw p "c" idx - LuaUtil.getTag idx >>= \case - "BlockQuote" -> mkBlock BlockQuote peekBlocks - "BulletList" -> mkBlock BulletList (peekList peekBlocks) - "CodeBlock" -> mkBlock (uncurry CodeBlock) - (peekPair peekAttr peekText) - "DefinitionList" -> mkBlock DefinitionList - (peekList (peekPair peekInlines (peekList peekBlocks))) - "Div" -> mkBlock (uncurry Div) (peekPair peekAttr peekBlocks) - "Header" -> mkBlock (\(lvl, attr, lst) -> Header lvl attr lst) - (peekTriple peekIntegral peekAttr peekInlines) - "HorizontalRule" -> return HorizontalRule - "LineBlock" -> mkBlock LineBlock (peekList peekInlines) - "OrderedList" -> mkBlock (uncurry OrderedList) - (peekPair peekListAttributes (peekList peekBlocks)) - "Null" -> return Null - "Para" -> mkBlock Para peekInlines - "Plain" -> mkBlock Plain peekInlines - "RawBlock" -> mkBlock (uncurry RawBlock) - (peekPair peekFormat peekText) - "Table" -> mkBlock id - (retrieving "Table" . (liftLua . absindex >=> (\idx' -> cleanup $ do - attr <- liftLua (rawgeti idx' 1) *> peekAttr top - capt <- liftLua (rawgeti idx' 2) *> peekCaption top - cs <- liftLua (rawgeti idx' 3) *> peekList peekColSpec top - thead <- liftLua (rawgeti idx' 4) *> peekTableHead top - tbods <- liftLua (rawgeti idx' 5) *> peekList peekTableBody top - tfoot <- liftLua (rawgeti idx' 6) *> peekTableFoot top - return $! Table attr capt cs thead tbods tfoot))) - Name tag -> failPeek ("Unknown block type: " <> tag) +peekBlock = retrieving "Block" . peekUD typeBlock +-- | Retrieves a list of Block elements. peekBlocks :: LuaError e => Peeker e [Block] peekBlocks = peekList peekBlock @@ -304,6 +421,16 @@ peekInlines = peekList peekInline pushInlines :: LuaError e => Pusher e [Inline] pushInlines = pushPandocList pushInline +-- | Retrieves a single definition item from a the stack; it is expected +-- to be a pair of a list of inlines and a list of list of blocks. Uses +-- fuzzy parsing, i.e., tries hard to convert mismatching types into the +-- expected result. +peekDefinitionItem :: LuaError e => Peeker e ([Inline], [[Block]]) +peekDefinitionItem = peekPair peekInlinesFuzzy $ choice + [ peekList peekBlocksFuzzy + , \idx -> (:[]) <$!> peekBlocksFuzzy idx + ] + -- | Push Caption element pushCaption :: LuaError e => Caption -> LuaE e () pushCaption (Caption shortCaption longCaption) = do @@ -318,37 +445,48 @@ peekCaption = retrieving "Caption" . \idx -> do long <- peekFieldRaw peekBlocks "long" idx return $! Caption short long -peekColWidth :: LuaError e => Peeker e ColWidth -peekColWidth = retrieving "ColWidth" . \idx -> do - maybe ColWidthDefault ColWidth <$!> optional (peekRealFloat idx) +-- | Push a ColSpec value as a pair of Alignment and ColWidth. +pushColSpec :: LuaError e => Pusher e ColSpec +pushColSpec = pushPair (pushString . show) pushColWidth +-- | Peek a ColSpec value as a pair of Alignment and ColWidth. peekColSpec :: LuaError e => Peeker e ColSpec peekColSpec = peekPair peekRead peekColWidth -instance Pushable ColWidth where - push = \case - (ColWidth w) -> Lua.push w - ColWidthDefault -> Lua.pushnil +peekColWidth :: LuaError e => Peeker e ColWidth +peekColWidth = retrieving "ColWidth" . \idx -> do + maybe ColWidthDefault ColWidth <$!> optional (peekRealFloat idx) -instance Pushable Row where - push (Row attr cells) = Lua.push (attr, cells) +-- | Push a ColWidth value by pushing the width as a plain number, or +-- @nil@ for ColWidthDefault. +pushColWidth :: LuaError e => Pusher e ColWidth +pushColWidth = \case + (ColWidth w) -> Lua.push w + ColWidthDefault -> Lua.pushnil -instance Peekable Row where - peek = forcePeek . peekRow +-- | Push a table row as a pair of attr and the list of cells. +pushRow :: LuaError e => Pusher e Row +pushRow (Row attr cells) = + pushPair pushAttr (pushPandocList pushCell) (attr, cells) +-- | Push a table row from a pair of attr and the list of cells. peekRow :: LuaError e => Peeker e Row peekRow = ((uncurry Row) <$!>) . retrieving "Row" . peekPair peekAttr (peekList peekCell) -instance Pushable TableBody where - push (TableBody attr (RowHeadColumns rowHeadColumns) head' body) = do +-- | Pushes a 'TableBody' value as a Lua table with fields @attr@, +-- @row_head_columns@, @head@, and @body@. +pushTableBody :: LuaError e => Pusher e TableBody +pushTableBody (TableBody attr (RowHeadColumns rowHeadColumns) head' body) = do Lua.newtable LuaUtil.addField "attr" attr LuaUtil.addField "row_head_columns" rowHeadColumns LuaUtil.addField "head" head' LuaUtil.addField "body" body +-- | Retrieves a 'TableBody' value from a Lua table with fields @attr@, +-- @row_head_columns@, @head@, and @body@. peekTableBody :: LuaError e => Peeker e TableBody peekTableBody = fmap (retrieving "TableBody") . typeChecked "table" Lua.istable @@ -358,17 +496,25 @@ peekTableBody = fmap (retrieving "TableBody") <*> peekFieldRaw (peekList peekRow) "head" idx <*> peekFieldRaw (peekList peekRow) "body" idx -instance Pushable TableHead where - push (TableHead attr rows) = Lua.push (attr, rows) +-- | Push a table head value as the pair of its Attr and rows. +pushTableHead :: LuaError e => Pusher e TableHead +pushTableHead (TableHead attr rows) = + pushPair pushAttr (pushPandocList pushRow) (attr, rows) +-- | Peek a table head value from a pair of Attr and rows. peekTableHead :: LuaError e => Peeker e TableHead peekTableHead = ((uncurry TableHead) <$!>) . retrieving "TableHead" . peekPair peekAttr (peekList peekRow) -instance Pushable TableFoot where - push (TableFoot attr cells) = Lua.push (attr, cells) +-- | Pushes a 'TableFoot' value as a pair of the Attr value and the list +-- of table rows. +pushTableFoot :: LuaError e => Pusher e TableFoot +pushTableFoot (TableFoot attr rows) = + pushPair pushAttr (pushPandocList pushRow) (attr, rows) +-- | Retrieves a 'TableFoot' value from a pair containing an Attr value +-- and a list of table rows. peekTableFoot :: LuaError e => Peeker e TableFoot peekTableFoot = ((uncurry TableFoot) <$!>) . retrieving "TableFoot" @@ -380,6 +526,8 @@ instance Pushable Cell where instance Peekable Cell where peek = forcePeek . peekCell +-- | Push a table cell as a table with fields @attr@, @alignment@, +-- @row_span@, @col_span@, and @contents@. pushCell :: LuaError e => Cell -> LuaE e () pushCell (Cell attr align (RowSpan rowSpan) (ColSpan colSpan) contents) = do Lua.newtable @@ -416,9 +564,42 @@ setInlineText = \case Str _ -> Actual . Str _ -> const Absent +-- | Helper type to represent all the different types a `content` +-- attribute can have. data Content = ContentBlocks [Block] | ContentInlines [Inline] + | ContentLines [[Inline]] + | ContentDefItems [([Inline], [[Block]])] + | ContentListItems [[Block]] + +contentTypeDescription :: Content -> Text +contentTypeDescription = \case + ContentBlocks {} -> "list of Block items" + ContentInlines {} -> "list of Inline items" + ContentLines {} -> "list of Inline lists (i.e., a list of lines)" + ContentDefItems {} -> "list of definition items items" + ContentListItems {} -> "list items (i.e., list of list of Block elements)" + +pushContent :: LuaError e => Pusher e Content +pushContent = \case + ContentBlocks blks -> pushPandocList pushBlock blks + ContentInlines inlns -> pushPandocList pushInline inlns + ContentLines lns -> pushPandocList (pushPandocList pushInline) lns + ContentDefItems itms -> + let pushItem = pushPair (pushPandocList pushInline) + (pushPandocList (pushPandocList pushBlock)) + in pushPandocList pushItem itms + ContentListItems itms -> + pushPandocList (pushPandocList pushBlock) itms + +peekContent :: LuaError e => Peeker e Content +peekContent idx = + (ContentInlines <$!> peekInlinesFuzzy idx) <|> + (ContentLines <$!> peekList (peekList peekInlineFuzzy) idx) <|> + (ContentBlocks <$!> peekBlocksFuzzy idx ) <|> + (ContentListItems <$!> peekList peekBlocksFuzzy idx) <|> + (ContentDefItems <$!> peekList (peekDefinitionItem) idx) setInlineContent :: Inline -> Content -> Possible Inline setInlineContent = \case @@ -438,13 +619,13 @@ setInlineContent = \case where inlineContent = \case ContentInlines inlns -> inlns - ContentBlocks _ -> throwM $ - PandocLuaError "expected Inlines, got Blocks" + c -> throwM . PandocLuaError $ "expected Inlines, got " <> + contentTypeDescription c blockContent = \case ContentBlocks blks -> blks ContentInlines [] -> [] - ContentInlines _ -> throwM $ - PandocLuaError "expected Blocks, got Inlines" + c -> throwM . PandocLuaError $ "expected Blocks, got " <> + contentTypeDescription c getInlineContent :: Inline -> Possible Content getInlineContent = \case @@ -496,16 +677,6 @@ showInline = defun "show" <#> parameter peekInline "inline" "Inline" "Object" =#> functionResult pushString "string" "stringified Inline" -pushContent :: LuaError e => Pusher e Content -pushContent = \case - ContentBlocks blks -> pushPandocList pushBlock blks - ContentInlines inlns -> pushPandocList pushInline inlns - -peekContent :: LuaError e => Peeker e Content -peekContent idx = - (ContentInlines <$!> peekList peekInline idx) <|> - (ContentBlocks <$!> peekList peekBlock idx) - typeInline :: LuaError e => DocumentedType e Inline typeInline = deftype "Inline" [ operation Tostring showInline @@ -591,22 +762,37 @@ pushInline = pushUD typeInline peekInline :: forall e. LuaError e => Peeker e Inline peekInline = retrieving "Inline" . \idx -> peekUD typeInline idx +-- | Try extra hard to retrieve an Inline value from the stack. Treats +-- bare strings as @Str@ values. +peekInlineFuzzy :: LuaError e => Peeker e Inline +peekInlineFuzzy = retrieving "Inline" . choice + [ peekUD typeInline + , \idx -> Str <$!> peekText idx + ] + -- | Try extra-hard to return the value at the given index as a list of -- inlines. -peekFuzzyInlines :: LuaError e => Peeker e [Inline] -peekFuzzyInlines = choice - [ peekList peekInline - , fmap pure . peekInline - , \idx -> pure . Str <$!> peekText idx +peekInlinesFuzzy :: LuaError e => Peeker e [Inline] +peekInlinesFuzzy = choice + [ peekList peekInlineFuzzy + , fmap pure . peekInlineFuzzy ] -peekFuzzyBlocks :: LuaError e => Peeker e [Block] -peekFuzzyBlocks = choice - [ peekList peekBlock - , fmap pure . peekBlock - , \idx -> pure . Plain . pure . Str <$!> peekText idx +-- | Try extra hard to retrieve a Block value from the stack. Treats bar +-- Inline elements as if they were wrapped in 'Plain'. +peekBlockFuzzy :: LuaError e => Peeker e Block +peekBlockFuzzy = choice + [ peekBlock + , (\idx -> Plain <$!> peekInlinesFuzzy idx) ] +-- | Try extra-hard to return the value at the given index as a list of +-- blocks. +peekBlocksFuzzy :: LuaError e => Peeker e [Block] +peekBlocksFuzzy = choice + [ peekList peekBlockFuzzy + , (<$!>) pure . peekBlockFuzzy + ] pushListAttributes :: forall e. LuaError e => ListAttributes -> LuaE e () pushListAttributes (start, style, delimiter) = @@ -619,6 +805,26 @@ peekListAttributes = retrieving "ListAttributes" . peekTriple peekRead peekRead +-- * Orphan Instances + +instance Pushable Inline where + push = pushInline + +instance Pushable Citation where + push = pushCitation + +instance Pushable Row where + push = pushRow + +instance Pushable TableBody where + push = pushTableBody + +instance Pushable TableFoot where + push = pushTableFoot + +instance Pushable TableHead where + push = pushTableHead + -- These instances exist only for testing. It's a hack to avoid making -- the marshalling modules public. instance Peekable Inline where @@ -633,6 +839,9 @@ instance Peekable Meta where instance Peekable Pandoc where peek = forcePeek . peekPandoc +instance Peekable Row where + peek = forcePeek . peekRow + instance Peekable Version where peek = forcePeek . peekVersionFuzzy diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index bc9ddc5e5..f08914eba 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -16,13 +16,14 @@ module Text.Pandoc.Lua.Module.Pandoc ) where import Prelude hiding (read) -import Control.Applicative (optional) -import Control.Monad ((>=>), forM_, when) +import Control.Applicative ((<|>), optional) +import Control.Monad ((>=>), (<$!>), forM_, when) import Control.Monad.Catch (catch, throwM) import Control.Monad.Except (throwError) import Data.Default (Default (..)) import Data.Maybe (fromMaybe) -import HsLua as Lua hiding (pushModule) +import Data.Text (Text) +import HsLua as Lua hiding (Div, pushModule) import HsLua.Class.Peekable (PeekError) import System.Exit (ExitCode (..)) import Text.Pandoc.Class.PandocIO (runIO) @@ -65,20 +66,25 @@ pushModule = do pushDocumentedFunction fn rawset (nth 3) forM_ otherConstructors addConstr + forM_ blockConstructors addConstr forM_ inlineConstructors addConstr - -- add constructors to Inlines.constructor - newtable -- constructor - forM_ (inlineConstructors @PandocError) $ \fn -> do - let name = functionName fn - pushName name - pushName name - rawget (nth 4) - rawset (nth 3) - -- set as pandoc.Inline.constructor - pushName "Inline" - newtable *> pushName "constructor" *> pushvalue (nth 4) *> rawset (nth 3) - rawset (nth 4) - pop 1 -- remaining constructor table + let addConstructorTable constructors = do + -- add constructors to Inlines.constructor + newtable -- constructor + forM_ constructors $ \fn -> do + let name = functionName fn + pushName name + pushName name + rawget (nth 4) + rawset (nth 3) + -- set as pandoc.Inline.constructor + pushName "Inline" + newtable *> pushName "constructor" *> + pushvalue (nth 4) *> rawset (nth 3) + rawset (nth 4) + pop 1 -- remaining constructor table + addConstructorTable (blockConstructors @PandocError) + addConstructorTable (inlineConstructors @PandocError) return 1 inlineConstructors :: LuaError e => [DocumentedFunction e] @@ -86,7 +92,7 @@ inlineConstructors = [ defun "Cite" ### liftPure2 Cite <#> parameter (peekList peekCitation) "citations" "list of Citations" "" - <#> parameter peekFuzzyInlines "content" "Inline" "placeholder content" + <#> parameter peekInlinesFuzzy "content" "Inline" "placeholder content" =#> functionResult pushInline "Inline" "cite element" , defun "Code" ### liftPure2 (flip Code) @@ -99,7 +105,7 @@ inlineConstructors = let attr = fromMaybe nullAttr mattr title = fromMaybe mempty mtitle in Image attr caption (src, title)) - <#> parameter peekFuzzyInlines "Inlines" "caption" "image caption / alt" + <#> parameter peekInlinesFuzzy "Inlines" "caption" "image caption / alt" <#> parameter peekText "string" "src" "path/URL of the image file" <#> optionalParameter peekText "string" "title" "brief image description" <#> optionalParameter peekAttr "Attr" "attr" "image attributes" @@ -112,7 +118,7 @@ inlineConstructors = let attr = fromMaybe nullAttr mattr title = fromMaybe mempty mtitle in Link attr content (target, title)) - <#> parameter peekFuzzyInlines "Inlines" "content" "text for this link" + <#> parameter peekInlinesFuzzy "Inlines" "content" "text for this link" <#> parameter peekText "string" "target" "the link target" <#> optionalParameter peekText "string" "title" "brief link description" <#> optionalParameter peekAttr "Attr" "attr" "link attributes" @@ -124,12 +130,12 @@ inlineConstructors = =#> functionResult pushInline "Inline" "math element" , defun "Note" ### liftPure Note - <#> parameter peekFuzzyBlocks "content" "Blocks" "note content" + <#> parameter peekBlocksFuzzy "content" "Blocks" "note content" =#> functionResult pushInline "Inline" "note" , defun "Quoted" ### liftPure2 Quoted <#> parameter peekQuoteType "quotetype" "QuoteType" "type of quotes" - <#> parameter peekFuzzyInlines "content" "Inlines" "inlines in quotes" + <#> parameter peekInlinesFuzzy "content" "Inlines" "inlines in quotes" =#> functionResult pushInline "Inline" "quoted element" , defun "RawInline" ### liftPure2 RawInline @@ -145,11 +151,11 @@ inlineConstructors = =#> functionResult pushInline "Inline" "new space" , defun "Span" ### liftPure2 (\inlns mattr -> Span (fromMaybe nullAttr mattr) inlns) - <#> parameter peekFuzzyInlines "content" "Inlines" "inline content" + <#> parameter peekInlinesFuzzy "content" "Inlines" "inline content" <#> optionalParameter peekAttr "attr" "Attr" "additional attributes" =#> functionResult pushInline "Inline" "span element" , defun "Str" - ### liftPure (\s -> s `seq` Str s) + ### liftPure Str <#> parameter peekText "text" "string" "" =#> functionResult pushInline "Inline" "new Str object" , mkInlinesConstr "Strong" Strong @@ -159,11 +165,119 @@ inlineConstructors = , mkInlinesConstr "Underline" Underline ] +blockConstructors :: LuaError e => [DocumentedFunction e] +blockConstructors = + [ defun "BlockQuote" + ### liftPure BlockQuote + <#> blocksParam + =#> blockResult "BlockQuote element" + + , defun "BulletList" + ### liftPure BulletList + <#> blockItemsParam "list items" + =#> blockResult "BulletList element" + + , defun "CodeBlock" + ### liftPure2 (\code mattr -> CodeBlock (fromMaybe nullAttr mattr) code) + <#> textParam "text" "code block content" + <#> optAttrParam + =#> blockResult "CodeBlock element" + + , defun "DefinitionList" + ### liftPure DefinitionList + <#> parameter (choice + [ peekList peekDefinitionItem + , \idx -> (:[]) <$!> peekDefinitionItem idx + ]) + "{{Inlines, {Blocks,...}},...}" + "content" "definition items" + =#> blockResult "DefinitionList element" + + , defun "Div" + ### liftPure2 (\content mattr -> Div (fromMaybe nullAttr mattr) content) + <#> blocksParam + <#> optAttrParam + =#> blockResult "Div element" + + , defun "Header" + ### liftPure3 (\lvl content mattr -> + Header lvl (fromMaybe nullAttr mattr) content) + <#> parameter peekIntegral "integer" "level" "heading level" + <#> parameter peekInlinesFuzzy "Inlines" "content" "inline content" + <#> optAttrParam + =#> blockResult "Header element" + + , defun "HorizontalRule" + ### return HorizontalRule + =#> blockResult "HorizontalRule element" + + , defun "LineBlock" + ### liftPure LineBlock + <#> parameter (peekList peekInlinesFuzzy) "{Inlines,...}" "content" "lines" + =#> blockResult "LineBlock element" + + , defun "Null" + ### return Null + =#> blockResult "Null element" + + , defun "OrderedList" + ### liftPure2 (\items mListAttrib -> + let defListAttrib = (1, DefaultStyle, DefaultDelim) + in OrderedList (fromMaybe defListAttrib mListAttrib) items) + <#> blockItemsParam "ordered list items" + <#> optionalParameter peekListAttributes "ListAttributes" "listAttributes" + "specifier for the list's numbering" + =#> blockResult "OrderedList element" + + , defun "Para" + ### liftPure Para + <#> parameter peekInlinesFuzzy "Inlines" "content" "paragraph content" + =#> blockResult "Para element" + + , defun "Plain" + ### liftPure Plain + <#> parameter peekInlinesFuzzy "Inlines" "content" "paragraph content" + =#> blockResult "Plain element" + + , defun "RawBlock" + ### liftPure2 RawBlock + <#> parameter peekFormat "Format" "format" "format of content" + <#> parameter peekText "string" "text" "raw content" + =#> blockResult "RawBlock element" + + , defun "Table" + ### (\capt colspecs thead tbodies tfoot mattr -> + let attr = fromMaybe nullAttr mattr + in return $! attr `seq` capt `seq` colspecs `seq` thead `seq` tbodies + `seq` tfoot `seq` Table attr capt colspecs thead tbodies tfoot) + <#> parameter peekCaption "Caption" "caption" "table caption" + <#> parameter (peekList peekColSpec) "{ColSpec,...}" "colspecs" + "column alignments and widths" + <#> parameter peekTableHead "TableHead" "head" "table head" + <#> parameter (peekList peekTableBody) "{TableBody,...}" "bodies" + "table bodies" + <#> parameter peekTableFoot "TableFoot" "foot" "table foot" + <#> optAttrParam + =#> blockResult "Table element" + ] + where + blockResult = functionResult pushBlock "Block" + blocksParam = parameter peekBlocksFuzzy "Blocks" "content" "block content" + blockItemsParam = parameter peekItemsFuzzy "List of Blocks" "content" + peekItemsFuzzy idx = peekList peekBlocksFuzzy idx + <|> ((:[]) <$!> peekBlocksFuzzy idx) + +textParam :: LuaError e => Text -> Text -> Parameter e Text +textParam = parameter peekText "string" + +optAttrParam :: LuaError e => Parameter e (Maybe Attr) +optAttrParam = optionalParameter peekAttr "attr" "Attr" "additional attributes" + mkInlinesConstr :: LuaError e => Name -> ([Inline] -> Inline) -> DocumentedFunction e mkInlinesConstr name constr = defun name ### liftPure (\x -> x `seq` constr x) - <#> parameter peekFuzzyInlines "content" "Inlines" "" + <#> parameter peekInlinesFuzzy "content" "Inlines" "" =#> functionResult pushInline "Inline" "new object" otherConstructors :: LuaError e => [DocumentedFunction e] @@ -181,8 +295,8 @@ otherConstructors = }) <#> parameter peekText "string" "cid" "citation ID (e.g. bibtex key)" <#> parameter peekRead "citation mode" "mode" "citation rendering mode" - <#> optionalParameter peekFuzzyInlines "prefix" "Inlines" "" - <#> optionalParameter peekFuzzyInlines "suffix" "Inlines" "" + <#> optionalParameter peekInlinesFuzzy "prefix" "Inlines" "" + <#> optionalParameter peekInlinesFuzzy "suffix" "Inlines" "" <#> optionalParameter peekIntegral "note_num" "integer" "note number" <#> optionalParameter peekIntegral "hash" "integer" "hash number" =#> functionResult pushCitation "Citation" "new citation object" @@ -283,7 +397,7 @@ pushPipeError pipeErr = do mkPandoc :: PandocLua NumResults mkPandoc = liftPandocLua $ do doc <- forcePeek $ do - blks <- peekBlocks (nthBottom 1) + blks <- peekBlocksFuzzy (nthBottom 1) mMeta <- optional $ peekMeta (nthBottom 2) pure $ Pandoc (fromMaybe nullMeta mMeta) blks pushPandoc doc diff --git a/src/Text/Pandoc/Lua/Module/Types.hs b/src/Text/Pandoc/Lua/Module/Types.hs index 4a7d14d2f..fb09235de 100644 --- a/src/Text/Pandoc/Lua/Module/Types.hs +++ b/src/Text/Pandoc/Lua/Module/Types.hs @@ -35,13 +35,9 @@ pushModule = do pushCloneTable :: LuaE PandocError NumResults pushCloneTable = do Lua.newtable - addFunction "Attr" $ cloneWith peekAttr pushAttr - addFunction "Block" $ cloneWith peekBlock pushBlock - addFunction "Inline" $ cloneWith peekInline pushInline addFunction "Meta" $ cloneWith peekMeta Lua.push addFunction "MetaValue" $ cloneWith peekMetaValue pushMetaValue addFunction "ListAttributes" $ cloneWith peekListAttributes pushListAttributes - addFunction "Pandoc" $ cloneWith peekPandoc pushPandoc return 1 cloneWith :: Peeker PandocError a diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index ba6d2a1df..173c9bb29 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -98,6 +98,126 @@ return { assert.are_equal(count, 3) end) }, + group "Block elements" { + group "BulletList" { + test('access items via property `content`', function () + local para = pandoc.Para 'one' + local blist = pandoc.BulletList{{para}} + assert.are_same({{para}}, blist.content) + end), + test('property `content` uses fuzzy marshalling', function () + local old = pandoc.Plain 'old' + local new = pandoc.Plain 'new' + local blist = pandoc.BulletList{{old}} + blist.content = {{new}} + assert.are_same({{new}}, blist:clone().content) + blist.content = new + assert.are_same({{new}}, blist:clone().content) + end), + }, + group "OrderedList" { + test('access items via property `content`', function () + local para = pandoc.Plain 'one' + local olist = pandoc.OrderedList{{para}} + assert.are_same({{para}}, olist.content) + end), + test('forgiving constructor', function () + local plain = pandoc.Plain 'old' + local olist = pandoc.OrderedList({plain}, {3, 'Example', 'Period'}) + local listAttribs = pandoc.ListAttributes(3, 'Example', 'Period') + assert.are_same(olist.listAttributes, listAttribs) + end), + test('has list attribute aliases', function () + local olist = pandoc.OrderedList({}, {4, 'Decimal', 'OneParen'}) + assert.are_equal(olist.start, 4) + assert.are_equal(olist.style, 'Decimal') + assert.are_equal(olist.delimiter, 'OneParen') + end) + }, + group 'DefinitionList' { + test('access items via property `content`', function () + local deflist = pandoc.DefinitionList{ + {'apple', {{pandoc.Plain 'fruit'}, {pandoc.Plain 'company'}}}, + {pandoc.Str 'coffee', 'Best when hot.'} + } + assert.are_equal(#deflist.content, 2) + assert.are_same(deflist.content[1][1], {pandoc.Str 'apple'}) + assert.are_same(deflist.content[1][2][2], + {pandoc.Plain{pandoc.Str 'company'}}) + assert.are_same(deflist.content[2][2], + {{pandoc.Plain{pandoc.Str 'Best when hot.'}}}) + end), + test('modify items via property `content`', function () + local deflist = pandoc.DefinitionList{ + {'apple', {{{'fruit'}}, {{'company'}}}} + } + deflist.content[1][1] = pandoc.Str 'orange' + deflist.content[1][2][1] = {pandoc.Plain 'tasty fruit'} + local newlist = pandoc.DefinitionList{ + { {pandoc.Str 'orange'}, + {{pandoc.Plain 'tasty fruit'}, {pandoc.Plain 'company'}} + } + } + assert.are_equal(deflist, newlist) + end), + }, + group 'Para' { + test('access inline via property `content`', function () + local para = pandoc.Para{'Moin, ', pandoc.Space(), 'Sylt!'} + assert.are_same( + para.content, + {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} + ) + end), + test('modifying `content` changes the element', function () + local para = pandoc.Para{'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} + + para.content[3] = 'Hamburg!' + assert.are_same( + para:clone().content, + {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Hamburg!'} + ) + + para.content = 'Huh' + assert.are_same( + para:clone().content, + {pandoc.Str 'Huh'} + ) + end), + }, + group 'LineBlock' { + test('access lines via property `content`', function () + local spc = pandoc.Space() + local lineblock = pandoc.LineBlock{ + {'200', spc, 'Main', spc, 'St.'}, + {'Berkeley', spc, 'CA', spc, '94718'} + } + assert.are_equal(#lineblock.content, 2) -- has two lines + assert.are_same(lineblock.content[2][1], pandoc.Str 'Berkeley') + end), + test('modifying `content` alter the element', function () + local spc = pandoc.Space() + local lineblock = pandoc.LineBlock{ + {'200', spc, 'Main', spc, 'St.'}, + {'Berkeley', spc, 'CA', spc, '94718'} + } + lineblock.content[1][1] = '404' + assert.are_same( + lineblock:clone().content[1], + {pandoc.Str '404', spc, pandoc.Str 'Main', spc, pandoc.Str 'St.'} + ) + + lineblock.content = {{'line1'}, {'line2'}} + assert.are_same( + lineblock:clone(), + pandoc.LineBlock{ + {pandoc.Str 'line1'}, + {pandoc.Str 'line2'} + } + ) + end) + } + }, group 'HTML-like attribute tables' { test('in element constructor', function () local html_attributes = { -- cgit v1.2.3 From f56d8706312df64d3956cea0c93768b51192958e Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 26 Oct 2021 14:40:11 +0200 Subject: Lua: marshal ListAttributes values as userdata objects --- data/pandoc.lua | 42 -------------- pandoc.cabal | 1 + src/Text/Pandoc/Lua/Init.hs | 1 - src/Text/Pandoc/Lua/Marshaling/AST.hs | 14 +---- src/Text/Pandoc/Lua/Marshaling/ListAttributes.hs | 72 ++++++++++++++++++++++++ src/Text/Pandoc/Lua/Module/Pandoc.hs | 4 ++ src/Text/Pandoc/Lua/Module/Types.hs | 1 - src/Text/Pandoc/Lua/Module/Utils.hs | 3 +- 8 files changed, 81 insertions(+), 57 deletions(-) create mode 100644 src/Text/Pandoc/Lua/Marshaling/ListAttributes.hs diff --git a/data/pandoc.lua b/data/pandoc.lua index a20ce1e8c..2bbf0213e 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -349,48 +349,6 @@ function M.MetaBool(bool) end ------------------------------------------------------------------------ --- Element components --- @section components - --- ListAttributes -M.ListAttributes = AstElement:make_subtype 'ListAttributes' -M.ListAttributes.behavior.clone = M.types.clone.ListAttributes - ---- Creates a set of list attributes. --- @function ListAttributes --- @tparam[opt] integer start number of the first list item --- @tparam[opt] string style style used for list numbering --- @tparam[opt] DefaultDelim|Period|OneParen|TwoParens delimiter delimiter of list numbers --- @treturn table list attributes table -function M.ListAttributes:new (start, style, delimiter) - start = start or 1 - style = style or 'DefaultStyle' - delimiter = delimiter or 'DefaultDelim' - return {start, style, delimiter} -end -M.ListAttributes.behavior._field_names = {start = 1, style = 2, delimiter = 3} -M.ListAttributes.behavior.__eq = utils.equals -M.ListAttributes.behavior.__index = function (t, k) - return rawget(t, getmetatable(t)._field_names[k]) or - getmetatable(t)[k] -end -M.ListAttributes.behavior.__newindex = function (t, k, v) - if getmetatable(t)._field_names[k] then - rawset(t, getmetatable(t)._field_names[k], v) - else - rawset(t, k, v) - end -end -M.ListAttributes.behavior.__pairs = function(t) - local field_names = M.ListAttributes.behavior._field_names - local fields = {} - for name, i in pairs(field_names) do - fields[i] = name - end - return make_next_function(fields), t, nil -end - --- -- Legacy and compatibility types -- diff --git a/pandoc.cabal b/pandoc.cabal index ca9fc9245..458e69ab6 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -781,6 +781,7 @@ library Text.Pandoc.Lua.Marshaling.CommonState, Text.Pandoc.Lua.Marshaling.Context, Text.Pandoc.Lua.Marshaling.List, + Text.Pandoc.Lua.Marshaling.ListAttributes, Text.Pandoc.Lua.Marshaling.PandocError, Text.Pandoc.Lua.Marshaling.ReaderOptions, Text.Pandoc.Lua.Marshaling.SimpleTable, diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index 60475e25c..87ae3a0d2 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -85,7 +85,6 @@ putConstructorsInRegistry :: PandocLua () putConstructorsInRegistry = liftPandocLua $ do constrsToReg $ Pandoc.Meta mempty constrsToReg $ Pandoc.MetaList mempty - putInReg "ListAttributes" -- used for ListAttributes type alias putInReg "List" -- pandoc.List putInReg "SimpleTable" -- helper for backward-compatible table handling where diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 22c78bff9..d723fcb4c 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -31,7 +31,6 @@ module Text.Pandoc.Lua.Marshaling.AST , peekInlineFuzzy , peekInlines , peekInlinesFuzzy - , peekListAttributes , peekMeta , peekMetaValue , peekPandoc @@ -63,6 +62,8 @@ import Text.Pandoc.Error (PandocError (PandocLuaError)) import Text.Pandoc.Lua.Util (pushViaConstr') import Text.Pandoc.Lua.Marshaling.Attr (peekAttr, pushAttr) import Text.Pandoc.Lua.Marshaling.List (pushPandocList) +import Text.Pandoc.Lua.Marshaling.ListAttributes + (peekListAttributes, pushListAttributes) import qualified HsLua as Lua import qualified Text.Pandoc.Lua.Util as LuaUtil @@ -794,17 +795,6 @@ peekBlocksFuzzy = choice , (<$!>) pure . peekBlockFuzzy ] -pushListAttributes :: forall e. LuaError e => ListAttributes -> LuaE e () -pushListAttributes (start, style, delimiter) = - pushViaConstr' "ListAttributes" - [ push start, push style, push delimiter ] - -peekListAttributes :: LuaError e => Peeker e ListAttributes -peekListAttributes = retrieving "ListAttributes" . peekTriple - peekIntegral - peekRead - peekRead - -- * Orphan Instances instance Pushable Inline where diff --git a/src/Text/Pandoc/Lua/Marshaling/ListAttributes.hs b/src/Text/Pandoc/Lua/Marshaling/ListAttributes.hs new file mode 100644 index 000000000..5a6608644 --- /dev/null +++ b/src/Text/Pandoc/Lua/Marshaling/ListAttributes.hs @@ -0,0 +1,72 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TupleSections #-} +{- | +Module : Text.Pandoc.Lua.Marshaling.ListAttributes +Copyright : © 2021 Albert Krewinkel +License : GNU GPL, version 2 or above +Maintainer : Albert Krewinkel + +Marshaling/unmarshaling functions and constructor for 'ListAttributes' +values. +-} +module Text.Pandoc.Lua.Marshaling.ListAttributes + ( typeListAttributes + , peekListAttributes + , pushListAttributes + , mkListAttributes + ) where + +import Data.Maybe (fromMaybe) +import HsLua +import Text.Pandoc.Definition ( ListAttributes, ListNumberStyle (DefaultStyle) + , ListNumberDelim (DefaultDelim)) + +typeListAttributes :: LuaError e => DocumentedType e ListAttributes +typeListAttributes = deftype "ListAttributes" + [ operation Eq $ lambda + ### liftPure2 (==) + <#> parameter peekListAttributes "a" "ListAttributes" "" + <#> parameter peekListAttributes "b" "ListAttributes" "" + =#> functionResult pushBool "boolean" "whether the two are equal" + ] + [ property "start" "number of the first list item" + (pushIntegral, \(start,_,_) -> start) + (peekIntegral, \(_,style,delim) -> (,style,delim)) + , property "style" "style used for list numbering" + (pushString . show, \(_,classes,_) -> classes) + (peekRead, \(start,_,delim) -> (start,,delim)) + , property "delimiter" "delimiter of list numbers" + (pushString . show, \(_,_,delim) -> delim) + (peekRead, \(start,style,_) -> (start,style,)) + , method $ defun "clone" + ### return + <#> udparam typeListAttributes "a" "" + =#> functionResult (pushUD typeListAttributes) "ListAttributes" + "cloned ListAttributes value" + ] + +-- | Pushes a 'ListAttributes' value as userdata object. +pushListAttributes :: LuaError e => Pusher e ListAttributes +pushListAttributes = pushUD typeListAttributes + +-- | Retrieve a 'ListAttributes' triple, either from userdata or from a +-- Lua tuple. +peekListAttributes :: LuaError e => Peeker e ListAttributes +peekListAttributes = retrieving "ListAttributes" . choice + [ peekUD typeListAttributes + , peekTriple peekIntegral peekRead peekRead + ] + +-- | Constructor for a new 'ListAttributes' value. +mkListAttributes :: LuaError e => DocumentedFunction e +mkListAttributes = defun "ListAttributes" + ### liftPure3 (\mstart mstyle mdelim -> + ( fromMaybe 1 mstart + , fromMaybe DefaultStyle mstyle + , fromMaybe DefaultDelim mdelim + )) + <#> optionalParameter peekIntegral "integer" "start" "number of first item" + <#> optionalParameter peekRead "string" "style" "list numbering style" + <#> optionalParameter peekRead "string" "delimiter" "list number delimiter" + =#> functionResult pushListAttributes "ListAttributes" "new ListAttributes" + #? "Creates a new ListAttributes object." diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index f08914eba..340c324ad 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -34,6 +34,8 @@ import Text.Pandoc.Lua.Marshaling () import Text.Pandoc.Lua.Marshaling.AST import Text.Pandoc.Lua.Marshaling.Attr (mkAttr, mkAttributeList) import Text.Pandoc.Lua.Marshaling.List (List (..)) +import Text.Pandoc.Lua.Marshaling.ListAttributes ( mkListAttributes + , peekListAttributes) import Text.Pandoc.Lua.PandocLua (PandocLua, addFunction, liftPandocLua, loadDefaultModule) import Text.Pandoc.Options (ReaderOptions (readerExtensions)) @@ -301,6 +303,8 @@ otherConstructors = <#> optionalParameter peekIntegral "hash" "integer" "hash number" =#> functionResult pushCitation "Citation" "new citation object" #? "Creates a single citation." + + , mkListAttributes ] walkElement :: (Walkable (SingletonsList Inline) a, diff --git a/src/Text/Pandoc/Lua/Module/Types.hs b/src/Text/Pandoc/Lua/Module/Types.hs index fb09235de..ff4a4e0d5 100644 --- a/src/Text/Pandoc/Lua/Module/Types.hs +++ b/src/Text/Pandoc/Lua/Module/Types.hs @@ -37,7 +37,6 @@ pushCloneTable = do Lua.newtable addFunction "Meta" $ cloneWith peekMeta Lua.push addFunction "MetaValue" $ cloneWith peekMetaValue pushMetaValue - addFunction "ListAttributes" $ cloneWith peekListAttributes pushListAttributes return 1 cloneWith :: Peeker PandocError a diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 7ce1cd18d..f83c34af7 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -29,7 +29,8 @@ import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshaling () import Text.Pandoc.Lua.Marshaling.AST ( peekBlock, peekInline, peekPandoc, pushBlock, pushInline, pushPandoc - , peekAttr, peekListAttributes, peekMeta, peekMetaValue) + , peekAttr, peekMeta, peekMetaValue) +import Text.Pandoc.Lua.Marshaling.ListAttributes (peekListAttributes) import Text.Pandoc.Lua.Marshaling.List (pushPandocList) import Text.Pandoc.Lua.Marshaling.SimpleTable ( SimpleTable (..), peekSimpleTable, pushSimpleTable ) -- cgit v1.2.3 From 80ed81822e27ac0d09e365ccc6f6508f3b1b4a9b Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 26 Oct 2021 14:40:11 +0200 Subject: Lua: generate constants in module pandoc programmatically --- data/pandoc.lua | 80 ------------------------------------ src/Text/Pandoc/Lua/Module/Pandoc.hs | 17 ++++++++ 2 files changed, 17 insertions(+), 80 deletions(-) diff --git a/data/pandoc.lua b/data/pandoc.lua index 2bbf0213e..294fed99e 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -372,86 +372,6 @@ M.SimpleTable = function(caption, aligns, widths, headers, rows) } end - ------------------------------------------------------------------------- --- Constants --- @section constants - ---- Author name is mentioned in the text. --- @see Citation --- @see Cite -M.AuthorInText = "AuthorInText" - ---- Author name is suppressed. --- @see Citation --- @see Cite -M.SuppressAuthor = "SuppressAuthor" - ---- Default citation style is used. --- @see Citation --- @see Cite -M.NormalCitation = "NormalCitation" - ---- Table cells aligned left. --- @see Table -M.AlignLeft = "AlignLeft" - ---- Table cells right-aligned. --- @see Table -M.AlignRight = "AlignRight" - ---- Table cell content is centered. --- @see Table -M.AlignCenter = "AlignCenter" - ---- Table cells are alignment is unaltered. --- @see Table -M.AlignDefault = "AlignDefault" - ---- Default list number delimiters are used. --- @see OrderedList -M.DefaultDelim = "DefaultDelim" - ---- List numbers are delimited by a period. --- @see OrderedList -M.Period = "Period" - ---- List numbers are delimited by a single parenthesis. --- @see OrderedList -M.OneParen = "OneParen" - ---- List numbers are delimited by a double parentheses. --- @see OrderedList -M.TwoParens = "TwoParens" - ---- List are numbered in the default style --- @see OrderedList -M.DefaultStyle = "DefaultStyle" - ---- List items are numbered as examples. --- @see OrderedList -M.Example = "Example" - ---- List are numbered using decimal integers. --- @see OrderedList -M.Decimal = "Decimal" - ---- List are numbered using lower-case roman numerals. --- @see OrderedList -M.LowerRoman = "LowerRoman" - ---- List are numbered using upper-case roman numerals --- @see OrderedList -M.UpperRoman = "UpperRoman" - ---- List are numbered using lower-case alphabetic characters. --- @see OrderedList -M.LowerAlpha = "LowerAlpha" - ---- List are numbered using upper-case alphabetic characters. --- @see OrderedList -M.UpperAlpha = "UpperAlpha" - ------------------------------------------------------------------------ -- Functions which have moved to different modules M.sha1 = utils.sha1 diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 340c324ad..458795029 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -1,5 +1,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Module.Pandoc @@ -20,8 +21,10 @@ import Control.Applicative ((<|>), optional) import Control.Monad ((>=>), (<$!>), forM_, when) import Control.Monad.Catch (catch, throwM) import Control.Monad.Except (throwError) +import Data.Data (Data, dataTypeConstrs, dataTypeOf, showConstr) import Data.Default (Default (..)) import Data.Maybe (fromMaybe) +import Data.Proxy (Proxy (Proxy)) import Data.Text (Text) import HsLua as Lua hiding (Div, pushModule) import HsLua.Class.Peekable (PeekError) @@ -87,6 +90,9 @@ pushModule = do pop 1 -- remaining constructor table addConstructorTable (blockConstructors @PandocError) addConstructorTable (inlineConstructors @PandocError) + -- Add string constants + forM_ stringConstants $ \c -> do + pushString c *> pushString c *> rawset (nth 3) return 1 inlineConstructors :: LuaError e => [DocumentedFunction e] @@ -307,6 +313,17 @@ otherConstructors = , mkListAttributes ] +stringConstants :: [String] +stringConstants = + let constrs :: forall a. Data a => Proxy a -> [String] + constrs _ = map showConstr . dataTypeConstrs . dataTypeOf @a $ undefined + in constrs (Proxy @ListNumberStyle) + ++ constrs (Proxy @ListNumberDelim) + ++ constrs (Proxy @QuoteType) + ++ constrs (Proxy @MathType) + ++ constrs (Proxy @Alignment) + ++ constrs (Proxy @CitationMode) + walkElement :: (Walkable (SingletonsList Inline) a, Walkable (SingletonsList Block) a, Walkable (List Inline) a, -- cgit v1.2.3 From b95e864ecfc0a0ef96fa09d4118c8e6b4033784c Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 26 Oct 2021 21:39:24 +0200 Subject: Lua: marshal SimpleTable values as userdata objects --- data/pandoc.lua | 24 --------- src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs | 74 ++++++++++++++++++++------- src/Text/Pandoc/Lua/Module/Pandoc.hs | 2 + src/Text/Pandoc/Lua/Util.hs | 28 ---------- test/lua/module/pandoc.lua | 61 ++++++++++++++++++++++ 5 files changed, 119 insertions(+), 70 deletions(-) diff --git a/data/pandoc.lua b/data/pandoc.lua index 294fed99e..cc4dc0cab 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -348,30 +348,6 @@ function M.MetaBool(bool) return bool end ------------------------------------------------------------------------- --- Legacy and compatibility types --- - ---- Creates a simple (old style) table element. --- @function SimpleTable --- @tparam {Inline,...} caption table caption --- @tparam {AlignDefault|AlignLeft|AlignRight|AlignCenter,...} aligns alignments --- @tparam {int,...} widths column widths --- @tparam {Block,...} headers header row --- @tparam {{Block,...}} rows table rows --- @treturn Block table element -M.SimpleTable = function(caption, aligns, widths, headers, rows) - return { - caption = ensureInlineList(caption), - aligns = List:new(aligns), - widths = List:new(widths), - headers = List:new(headers), - rows = List:new(rows), - tag = "SimpleTable", - t = "SimpleTable", - } -end - ------------------------------------------------------------------------ -- Functions which have moved to different modules M.sha1 = utils.sha1 diff --git a/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs b/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs index e9c169dc0..65f5aec8b 100644 --- a/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs +++ b/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs @@ -1,13 +1,10 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Marshaling.SimpleTable Copyright : © 2020-2021 Albert Krewinkel License : GNU GPL, version 2 or above - Maintainer : Albert Krewinkel - Stability : alpha Definition and marshaling of the 'SimpleTable' data type used as a convenience type when dealing with tables. @@ -16,14 +13,14 @@ module Text.Pandoc.Lua.Marshaling.SimpleTable ( SimpleTable (..) , peekSimpleTable , pushSimpleTable + , mkSimpleTable ) where -import Control.Monad ((<$!>)) import HsLua as Lua import Text.Pandoc.Definition -import Text.Pandoc.Lua.Util (pushViaConstructor) import Text.Pandoc.Lua.Marshaling.AST +import Text.Pandoc.Lua.Marshaling.List -- | A simple (legacy-style) table. data SimpleTable = SimpleTable @@ -32,23 +29,64 @@ data SimpleTable = SimpleTable , simpleTableColumnWidths :: [Double] , simpleTableHeader :: [[Block]] , simpleTableBody :: [[[Block]]] - } + } deriving (Eq, Show) + +typeSimpleTable :: LuaError e => DocumentedType e SimpleTable +typeSimpleTable = deftype "SimpleTable" + [ operation Eq $ lambda + ### liftPure2 (==) + <#> udparam typeSimpleTable "a" "" + <#> udparam typeSimpleTable "b" "" + =#> functionResult pushBool "boolean" "whether the two objects are equal" + , operation Tostring $ lambda + ### liftPure show + <#> udparam typeSimpleTable "self" "" + =#> functionResult pushString "string" "Haskell string representation" + ] + [ property "caption" "table caption" + (pushPandocList pushInline, simpleTableCaption) + (peekInlinesFuzzy, \t capt -> t {simpleTableCaption = capt}) + , property "aligns" "column alignments" + (pushPandocList (pushString . show), simpleTableAlignments) + (peekList peekRead, \t aligns -> t{simpleTableAlignments = aligns}) + , property "widths" "relative column widths" + (pushPandocList pushRealFloat, simpleTableColumnWidths) + (peekList peekRealFloat, \t ws -> t{simpleTableColumnWidths = ws}) + , property "headers" "table header" + (pushRow, simpleTableHeader) + (peekRow, \t h -> t{simpleTableHeader = h}) + , property "rows" "table body rows" + (pushPandocList pushRow, simpleTableBody) + (peekList peekRow, \t bs -> t{simpleTableBody = bs}) + + , readonly "t" "type tag (always 'SimpleTable')" + (pushText, const "SimpleTable") + + , alias "header" "alias for `headers`" ["headers"] + ] + where + pushRow = pushPandocList (pushPandocList pushBlock) + +peekRow :: LuaError e => Peeker e [[Block]] +peekRow = peekList peekBlocksFuzzy -- | Push a simple table to the stack by calling the -- @pandoc.SimpleTable@ constructor. pushSimpleTable :: forall e. LuaError e => SimpleTable -> LuaE e () -pushSimpleTable tbl = pushViaConstructor @e "SimpleTable" - (simpleTableCaption tbl) - (simpleTableAlignments tbl) - (simpleTableColumnWidths tbl) - (simpleTableHeader tbl) - (simpleTableBody tbl) +pushSimpleTable = pushUD typeSimpleTable -- | Retrieve a simple table from the stack. peekSimpleTable :: forall e. LuaError e => Peeker e SimpleTable -peekSimpleTable idx = retrieving "SimpleTable" $ SimpleTable - <$!> peekFieldRaw peekInlines "caption" idx - <*> peekFieldRaw (peekList peekRead) "aligns" idx - <*> peekFieldRaw (peekList peekRealFloat) "widths" idx - <*> peekFieldRaw (peekList peekBlocks) "headers" idx - <*> peekFieldRaw (peekList (peekList peekBlocks)) "rows" idx +peekSimpleTable = retrieving "SimpleTable" . peekUD typeSimpleTable + +-- | Constructor for the 'SimpleTable' type. +mkSimpleTable :: LuaError e => DocumentedFunction e +mkSimpleTable = defun "SimpleTable" + ### liftPure5 SimpleTable + <#> parameter peekInlinesFuzzy "Inlines" "caption" "table caption" + <#> parameter (peekList peekRead) "{Alignment,...}" "align" "column alignments" + <#> parameter (peekList peekRealFloat) "{number,...}" "widths" + "relative column widths" + <#> parameter peekRow "{Blocks,...}" "header" "table header row" + <#> parameter (peekList peekRow) "{{Blocks,...},...}" "body" "table body rows" + =#> functionResult pushSimpleTable "SimpleTable" "new SimpleTable object" diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 458795029..7bad3f1a5 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -39,6 +39,7 @@ import Text.Pandoc.Lua.Marshaling.Attr (mkAttr, mkAttributeList) import Text.Pandoc.Lua.Marshaling.List (List (..)) import Text.Pandoc.Lua.Marshaling.ListAttributes ( mkListAttributes , peekListAttributes) +import Text.Pandoc.Lua.Marshaling.SimpleTable (mkSimpleTable) import Text.Pandoc.Lua.PandocLua (PandocLua, addFunction, liftPandocLua, loadDefaultModule) import Text.Pandoc.Options (ReaderOptions (readerExtensions)) @@ -311,6 +312,7 @@ otherConstructors = #? "Creates a single citation." , mkListAttributes + , mkSimpleTable ] stringConstants :: [String] diff --git a/src/Text/Pandoc/Lua/Util.hs b/src/Text/Pandoc/Lua/Util.hs index 50157189f..f20bc09e8 100644 --- a/src/Text/Pandoc/Lua/Util.hs +++ b/src/Text/Pandoc/Lua/Util.hs @@ -19,7 +19,6 @@ module Text.Pandoc.Lua.Util ( getTag , addField , addFunction - , pushViaConstructor , callWithTraceback , dofileWithTraceback , pushViaConstr' @@ -44,33 +43,6 @@ addFunction name fn = do Lua.pushHaskellFunction $ toHaskellFunction fn Lua.rawset (-3) --- | Helper class for pushing a single value to the stack via a lua --- function. See @pushViaCall@. -class LuaError e => PushViaCall e a where - pushViaCall' :: LuaError e => Name -> LuaE e () -> NumArgs -> a - -instance LuaError e => PushViaCall e (LuaE e ()) where - pushViaCall' fn pushArgs num = do - Lua.pushName @e fn - Lua.rawget Lua.registryindex - pushArgs - Lua.call num 1 - -instance (LuaError e, Pushable a, PushViaCall e b) => - PushViaCall e (a -> b) where - pushViaCall' fn pushArgs num x = - pushViaCall' @e fn (pushArgs *> Lua.push x) (num + 1) - --- | Push an value to the stack via a lua function. The lua function is called --- with all arguments that are passed to this function and is expected to return --- a single value. -pushViaCall :: forall e a. LuaError e => PushViaCall e a => Name -> a -pushViaCall fn = pushViaCall' @e fn (return ()) 0 - --- | Call a pandoc element constructor within Lua, passing all given arguments. -pushViaConstructor :: forall e a. LuaError e => PushViaCall e a => Name -> a -pushViaConstructor pandocFn = pushViaCall @e ("pandoc." <> pandocFn) - -- | Get the tag of a value. This is an optimized and specialized version of -- @Lua.getfield idx "tag"@. It only checks for the field on the table at index -- @idx@ and on its metatable, also ignoring any @__index@ value on the diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 173c9bb29..9b6e360f3 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -261,6 +261,67 @@ return { end) } }, + group 'Other types' { + group 'SimpleTable' { + test('can access properties', function () + local spc = pandoc.Space() + local caption = {pandoc.Str 'Languages', spc, pandoc.Str 'overview.'} + local aligns = {pandoc.AlignDefault, pandoc.AlignDefault} + local widths = {0, 0} -- let pandoc determine col widths + local headers = {{pandoc.Plain({pandoc.Str "Language"})}, + {pandoc.Plain({pandoc.Str "Typing"})}} + local rows = { + {{pandoc.Plain "Haskell"}, {pandoc.Plain "static"}}, + {{pandoc.Plain "Lua"}, {pandoc.Plain "Dynamic"}}, + } + local simple_table = pandoc.SimpleTable( + caption, + aligns, + widths, + headers, + rows + ) + assert.are_same(simple_table.caption, caption) + assert.are_same(simple_table.aligns, aligns) + assert.are_same(simple_table.widths, widths) + assert.are_same(simple_table.headers, headers) + assert.are_same(simple_table.rows, rows) + end), + test('can modify properties', function () + local new_table = pandoc.SimpleTable( + {'Languages'}, + {pandoc.AlignDefault, pandoc.AlignDefault}, + {0.5, 0.5}, + {{pandoc.Plain({pandoc.Str "Language"})}, + {pandoc.Plain({pandoc.Str "Typing"})}}, + { + {{pandoc.Plain "Haskell"}, {pandoc.Plain "static"}}, + {{pandoc.Plain "Lua"}, {pandoc.Plain "Dynamic"}}, + } + ) + + new_table.caption = {pandoc.Str 'Good', pandoc.Space(), + pandoc.Str 'languages'} + new_table.aligns[1] = pandoc.AlignLeft + new_table.widths = {0, 0} + new_table.headers[2] = {pandoc.Plain{pandoc.Str 'compiled/interpreted'}} + new_table.rows[1][2] = {pandoc.Plain{pandoc.Str 'both'}} + new_table.rows[2][2] = {pandoc.Plain{pandoc.Str 'interpreted'}} + + local expected_table = pandoc.SimpleTable( + {pandoc.Str 'Good', pandoc.Space(), pandoc.Str 'languages'}, + {pandoc.AlignLeft, pandoc.AlignDefault}, + {0, 0}, + {{pandoc.Plain 'Language'}, {pandoc.Plain 'compiled/interpreted'}}, + { + {{pandoc.Plain 'Haskell'}, {pandoc.Plain 'both'}}, + {{pandoc.Plain 'Lua'}, {pandoc.Plain 'interpreted'}} + } + ) + assert.are_same(expected_table, new_table) + end) + } + }, group 'clone' { test('clones Attr', function () -- cgit v1.2.3 From 2910f9f3f856552b33ada842e3eb485717db100a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 26 Oct 2021 21:48:56 -0700 Subject: Fix a copy/paste bug in Lua marshalling code. This led changes in link properties in Lua filters to change the links into images! Closes #7639. --- src/Text/Pandoc/Lua/Marshaling/AST.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index d723fcb4c..6bb4fd4e0 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -732,7 +732,7 @@ typeInline = deftype "Inline" Link _ _ (tgt, _) -> Actual tgt _ -> Absent) (peekText, \case - Link attr capt (_, title) -> Actual . Image attr capt . (,title) + Link attr capt (_, title) -> Actual . Link attr capt . (,title) _ -> const Absent) , possibleProperty "title" "title text" (pushText, getInlineTitle) -- cgit v1.2.3 From b990ca3c4cadf0da0d17a71809cf0a87c67eb175 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 27 Oct 2021 20:56:30 +0200 Subject: Lua: fix `pandoc.utils.stringify` regression The `pandoc.utils.stringify` function returned empty strings when called with a string argument. --- src/Text/Pandoc/Lua/Module/Utils.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index f83c34af7..3602612cb 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -185,10 +185,10 @@ peekAstElement = retrieving "pandoc AST element" . choice [ (fmap PandocElement . peekPandoc) , (fmap InlineElement . peekInline) , (fmap BlockElement . peekBlock) + , (fmap MetaValueElement . peekMetaValue) , (fmap AttrElement . peekAttr) , (fmap ListAttributesElement . peekListAttributes) , (fmap MetaElement . peekMeta) - , (fmap MetaValueElement . peekMetaValue) ] -- | Converts an old/simple table into a normal table block element. -- cgit v1.2.3 From d226a35c0ac6485c75f083ce3b25ada1d623f45f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 25 Oct 2021 08:48:18 -0700 Subject: Switch back from HsYAML to yaml. Reasons: - Performance: HsYAML is around 20 times slower in parsing large YAML bibliographies (#6084). - An issue was submitted to HsYAML, but it hasn't gotten any attention. HsYAML seems borderline unmaintained; it hasn't had a commit in over a year. - Unfortunately this goes back on our attempts to free ourselves from C dependencies (#4535). But I don't see a better alternative until a better pure Haskell parser is available. Closes #6084. Notes: - We've removed the FromYAML instances for all types that had them, since this is a HsYAML-specific typeclass [API change]. (The yaml package just uses From/ToJSON.) - Unlike HsYAML (in the configuration we were using), yaml parses 'Y', 'N', 'Yes', 'No', 'On', 'Off' as boolean values. Users may need to quote these when they are meant to be interpreted as strings. Similarly, 'null' is parsed as a YAML null value (and will be treated as an empty string by pandoc rather than the string 'null'). Quoting it will force it to be interpreted as a string. - Some tests had to be adjusted accordingly. - Pandoc now behaves better when the YAML metadata contains escaping errors: instead of just falling back on treating the section as a table, it raises a YAML parsing error. --- pandoc.cabal | 10 +- src/Text/Pandoc/App.hs | 2 +- src/Text/Pandoc/App/Opt.hs | 296 ++++++++++++++++------------------- src/Text/Pandoc/Citeproc.hs | 2 +- src/Text/Pandoc/Filter.hs | 20 ++- src/Text/Pandoc/Logging.hs | 8 - src/Text/Pandoc/Options.hs | 217 +++++++++++++------------ src/Text/Pandoc/Readers/Markdown.hs | 10 +- src/Text/Pandoc/Readers/Metadata.hs | 168 +++++++------------- src/Text/Pandoc/Translations.hs | 30 +--- test/command/4819.md | 4 +- test/command/6741.md | 8 +- test/command/pandoc-citeproc-312.md | 2 +- test/command/pandoc-citeproc-327.md | 2 +- test/command/yaml-metadata-blocks.md | 4 +- 15 files changed, 348 insertions(+), 435 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 458e69ab6..f442bc18c 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -522,7 +522,6 @@ common common-executable library import: common-options build-depends: Glob >= 0.7 && < 0.11, - HsYAML >= 0.2 && < 0.3, JuicyPixels >= 3.1.6.1 && < 3.4, SHA >= 1.6 && < 1.7, aeson >= 0.7 && < 2.1, @@ -567,6 +566,8 @@ library network-uri >= 2.6 && < 2.8, pandoc-types >= 1.22.1 && < 1.23, parsec >= 3.1 && < 3.2, + pretty >= 1.1 && < 1.2, + pretty-show >= 1.10 && < 1.11, process >= 1.2.3 && < 1.7, random >= 1 && < 1.3, safe >= 0.3.18 && < 0.4, @@ -581,14 +582,13 @@ library text >= 1.1.1.0 && < 1.3, text-conversions >= 0.3 && < 0.4, time >= 1.5 && < 1.13, + unicode-collation >= 0.1.1 && < 0.2, unicode-transforms >= 0.3 && < 0.4, xml >= 1.3.12 && < 1.4, xml-conduit >= 1.9.1.1 && < 1.10, - unicode-collation >= 0.1.1 && < 0.2, + yaml >= 0.11 && < 0.12, zip-archive >= 0.2.3.4 && < 0.5, - zlib >= 0.5 && < 0.7, - pretty-show >= 1.10 && < 1.11, - pretty >= 1.1 && < 1.2 + zlib >= 0.5 && < 0.7 if os(windows) && arch(i386) build-depends: basement >= 0.0.10, foundation >= 0.0.23 diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index b639a97b7..20e647456 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -217,7 +217,7 @@ convertWithOpts opts = do case optMetadataFiles opts of [] -> return mempty paths -> mconcat <$> - mapM (\path -> do raw <- readFileLazy path + mapM (\path -> do raw <- readFileStrict path yamlToMeta readerOpts (Just path) raw) paths let transforms = (case optShiftHeadingLevelBy opts of diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs index 48eb15fdf..93953d53f 100644 --- a/src/Text/Pandoc/App/Opt.hs +++ b/src/Text/Pandoc/App/Opt.hs @@ -40,7 +40,7 @@ import Text.Pandoc.Options (TopLevelDivision (TopLevelDefault), ReferenceLocation (EndOfDocument), ObfuscationMethod (NoObfuscation), CiteMethod (Citeproc)) -import Text.Pandoc.Class (readFileLazy, fileExists, setVerbosity, report, +import Text.Pandoc.Class (readFileStrict, fileExists, setVerbosity, report, PandocMonad(lookupEnv), getUserDataDir) import Text.Pandoc.Error (PandocError (PandocParseError, PandocSomeError)) import Text.Pandoc.Shared (camelCaseStrToHyphenated, defaultUserDataDir, @@ -54,22 +54,14 @@ import Data.Default (def) import qualified Data.Text as T import qualified Data.Map as M import Text.Pandoc.Definition (Meta(..), MetaValue(..)) -import Data.Aeson (defaultOptions, Options(..)) +import Data.Aeson (defaultOptions, Options(..), Result(..), fromJSON) import Data.Aeson.TH (deriveJSON) import Control.Applicative ((<|>)) -import Data.YAML +import Data.Yaml -- | The type of line-endings to be used when writing plain-text. data LineEnding = LF | CRLF | Native deriving (Show, Generic) -instance FromYAML LineEnding where - parseYAML = withStr "LineEnding" $ \t -> - case T.toLower t of - "lf" -> return LF - "crlf" -> return CRLF - "native" -> return Native - _ -> fail $ "Unknown line ending type " ++ show t - -- | How to handle output blocks in ipynb. data IpynbOutput = IpynbOutputAll @@ -77,14 +69,6 @@ data IpynbOutput = | IpynbOutputBest deriving (Show, Generic) -instance FromYAML IpynbOutput where - parseYAML = withStr "LineEnding" $ \t -> - case t of - "none" -> return IpynbOutputNone - "all" -> return IpynbOutputAll - "best" -> return IpynbOutputBest - _ -> fail $ "Unknown ipynb output type " ++ show t - -- | Data structure for command line options. data Opt = Opt { optTabStop :: Int -- ^ Number of spaces per tab @@ -163,9 +147,12 @@ data Opt = Opt , optSandbox :: Bool } deriving (Generic, Show) -instance FromYAML (Opt -> Opt) where - parseYAML (Mapping _ _ m) = chain doOpt (M.toList m) - parseYAML n = failAtNode n "Expected a mapping" +instance FromJSON (Opt -> Opt) where + parseJSON (Object m) = + case fromJSON (Object m) of + Error err' -> fail err' + Success (m' :: M.Map Text Value) -> chain doOpt (M.toList m') + parseJSON _ = fail "Expected a mapping" data DefaultsState = DefaultsState { @@ -174,22 +161,21 @@ data DefaultsState = DefaultsState } deriving (Show) instance (PandocMonad m, MonadIO m) - => FromYAML (Opt -> StateT DefaultsState m Opt) where - parseYAML (Mapping _ _ m) = do - let opts = M.mapKeys toText m - dataDir <- case M.lookup "data-dir" opts of - Nothing -> return Nothing - Just v -> Just . unpack <$> parseYAML v - f <- parseOptions (M.toList m) - case M.lookup "defaults" opts of - Just v -> do - g <- parseDefaults v dataDir - return $ g >=> f >=> resolveVarsInOpt - Nothing -> return $ f >=> resolveVarsInOpt - where - toText (Scalar _ (SStr s)) = s - toText _ = "" - parseYAML n = failAtNode n "Expected a mapping" + => FromJSON (Opt -> StateT DefaultsState m Opt) where + parseJSON (Object o) = + case fromJSON (Object o) of + Error err' -> fail err' + Success (opts :: M.Map Text Value) -> do + dataDir <- case M.lookup "data-dir" opts of + Nothing -> return Nothing + Just v -> Just . unpack <$> parseJSON v + f <- parseOptions (M.toList opts) + case M.lookup "defaults" opts of + Just v -> do + g <- parseDefaults v dataDir + return $ g >=> f >=> resolveVarsInOpt + Nothing -> return $ f >=> resolveVarsInOpt + parseJSON _ = fail "Expected a mapping" resolveVarsInOpt :: forall m. (PandocMonad m, MonadIO m) => Opt -> StateT DefaultsState m Opt @@ -303,7 +289,7 @@ resolveVarsInOpt parseDefaults :: (PandocMonad m, MonadIO m) - => Node Pos + => Value -> Maybe FilePath -> Parser (Opt -> StateT DefaultsState m Opt) parseDefaults n dataDir = parseDefsNames n >>= \ds -> return $ \o -> do @@ -322,11 +308,11 @@ parseDefaults n dataDir = parseDefsNames n >>= \ds -> return $ \o -> do "Error: Circular defaults file reference in " ++ "'" ++ defsParent ++ "'" else foldM applyDefaults o defsChildren - where parseDefsNames x = (parseYAML x >>= \xs -> return $ map unpack xs) - <|> (parseYAML x >>= \x' -> return [unpack x']) + where parseDefsNames x = (parseJSON x >>= \xs -> return $ map unpack xs) + <|> (parseJSON x >>= \x' -> return [unpack x']) parseOptions :: Monad m - => [(Node Pos, Node Pos)] + => [(Text, Value)] -> Parser (Opt -> StateT DefaultsState m Opt) parseOptions ns = do f <- chain doOpt' ns @@ -336,269 +322,267 @@ chain :: Monad m => (a -> m (b -> b)) -> [a] -> m (b -> b) chain f = foldM g id where g o n = f n >>= \o' -> return $ o' . o -doOpt' :: (Node Pos, Node Pos) -> Parser (Opt -> Opt) -doOpt' (k',v) = do - k <- parseStringKey k' +doOpt' :: (Text, Value) -> Parser (Opt -> Opt) +doOpt' (k,v) = do case k of "defaults" -> return id - _ -> doOpt (k',v) + _ -> doOpt (k,v) -doOpt :: (Node Pos, Node Pos) -> Parser (Opt -> Opt) -doOpt (k',v) = do - k <- parseStringKey k' +doOpt :: (Text, Value) -> Parser (Opt -> Opt) +doOpt (k,v) = do case k of "tab-stop" -> - parseYAML v >>= \x -> return (\o -> o{ optTabStop = x }) + parseJSON v >>= \x -> return (\o -> o{ optTabStop = x }) "preserve-tabs" -> - parseYAML v >>= \x -> return (\o -> o{ optPreserveTabs = x }) + parseJSON v >>= \x -> return (\o -> o{ optPreserveTabs = x }) "standalone" -> - parseYAML v >>= \x -> return (\o -> o{ optStandalone = x }) + parseJSON v >>= \x -> return (\o -> o{ optStandalone = x }) "table-of-contents" -> - parseYAML v >>= \x -> return (\o -> o{ optTableOfContents = x }) + parseJSON v >>= \x -> return (\o -> o{ optTableOfContents = x }) "toc" -> - parseYAML v >>= \x -> return (\o -> o{ optTableOfContents = x }) + parseJSON v >>= \x -> return (\o -> o{ optTableOfContents = x }) "from" -> - parseYAML v >>= \x -> return (\o -> o{ optFrom = x }) + parseJSON v >>= \x -> return (\o -> o{ optFrom = x }) "reader" -> - parseYAML v >>= \x -> return (\o -> o{ optFrom = x }) + parseJSON v >>= \x -> return (\o -> o{ optFrom = x }) "to" -> - parseYAML v >>= \x -> return (\o -> o{ optTo = x }) + parseJSON v >>= \x -> return (\o -> o{ optTo = x }) "writer" -> - parseYAML v >>= \x -> return (\o -> o{ optTo = x }) + parseJSON v >>= \x -> return (\o -> o{ optTo = x }) "shift-heading-level-by" -> - parseYAML v >>= \x -> return (\o -> o{ optShiftHeadingLevelBy = x }) + parseJSON v >>= \x -> return (\o -> o{ optShiftHeadingLevelBy = x }) "template" -> - parseYAML v >>= \x -> return (\o -> o{ optTemplate = unpack <$> x }) + parseJSON v >>= \x -> return (\o -> o{ optTemplate = unpack <$> x }) "variables" -> - parseYAML v >>= \x -> return (\o -> o{ optVariables = + parseJSON v >>= \x -> return (\o -> o{ optVariables = x <> optVariables o }) -- Note: x comes first because <> for Context is left-biased union -- and we want to favor later default files. See #5988. "metadata" -> yamlToMeta v >>= \x -> return (\o -> o{ optMetadata = optMetadata o <> x }) "metadata-files" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optMetadataFiles = optMetadataFiles o <> map unpack x }) "metadata-file" -> -- allow either a list or a single value - (parseYAML v >>= \x -> return (\o -> o{ optMetadataFiles = + (parseJSON v >>= \x -> return (\o -> o{ optMetadataFiles = optMetadataFiles o <> map unpack x })) <|> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optMetadataFiles = optMetadataFiles o <>[unpack x] })) "output-file" -> - parseYAML v >>= \x -> return (\o -> o{ optOutputFile = unpack <$> x }) + parseJSON v >>= \x -> return (\o -> o{ optOutputFile = unpack <$> x }) "input-files" -> - parseYAML v >>= \x -> return (\o -> o{ optInputFiles = + parseJSON v >>= \x -> return (\o -> o{ optInputFiles = optInputFiles o <> (map unpack <$> x) }) "input-file" -> -- allow either a list or a single value - (parseYAML v >>= \x -> return (\o -> o{ optInputFiles = + (parseJSON v >>= \x -> return (\o -> o{ optInputFiles = optInputFiles o <> (map unpack <$> x) })) <|> - (parseYAML v >>= \x -> return (\o -> o{ optInputFiles = + (parseJSON v >>= \x -> return (\o -> o{ optInputFiles = optInputFiles o <> ((\z -> [unpack z]) <$> x) })) "number-sections" -> - parseYAML v >>= \x -> return (\o -> o{ optNumberSections = x }) + parseJSON v >>= \x -> return (\o -> o{ optNumberSections = x }) "number-offset" -> - parseYAML v >>= \x -> return (\o -> o{ optNumberOffset = x }) + parseJSON v >>= \x -> return (\o -> o{ optNumberOffset = x }) "section-divs" -> - parseYAML v >>= \x -> return (\o -> o{ optSectionDivs = x }) + parseJSON v >>= \x -> return (\o -> o{ optSectionDivs = x }) "incremental" -> - parseYAML v >>= \x -> return (\o -> o{ optIncremental = x }) + parseJSON v >>= \x -> return (\o -> o{ optIncremental = x }) "self-contained" -> - parseYAML v >>= \x -> return (\o -> o{ optSelfContained = x }) + parseJSON v >>= \x -> return (\o -> o{ optSelfContained = x }) "html-q-tags" -> - parseYAML v >>= \x -> return (\o -> o{ optHtmlQTags = x }) + parseJSON v >>= \x -> return (\o -> o{ optHtmlQTags = x }) "highlight-style" -> - parseYAML v >>= \x -> return (\o -> o{ optHighlightStyle = x }) + parseJSON v >>= \x -> return (\o -> o{ optHighlightStyle = x }) "syntax-definition" -> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optSyntaxDefinitions = optSyntaxDefinitions o <> map unpack x })) <|> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optSyntaxDefinitions = optSyntaxDefinitions o <> [unpack x] })) "syntax-definitions" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optSyntaxDefinitions = optSyntaxDefinitions o <> map unpack x }) "top-level-division" -> - parseYAML v >>= \x -> return (\o -> o{ optTopLevelDivision = x }) + parseJSON v >>= \x -> return (\o -> o{ optTopLevelDivision = x }) "html-math-method" -> - parseYAML v >>= \x -> return (\o -> o{ optHTMLMathMethod = x }) + parseJSON v >>= \x -> return (\o -> o{ optHTMLMathMethod = x }) "abbreviations" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optAbbreviations = unpack <$> x }) "reference-doc" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optReferenceDoc = unpack <$> x }) "epub-subdirectory" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optEpubSubdirectory = unpack x }) "epub-metadata" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optEpubMetadata = unpack <$> x }) "epub-fonts" -> - parseYAML v >>= \x -> return (\o -> o{ optEpubFonts = optEpubFonts o <> + parseJSON v >>= \x -> return (\o -> o{ optEpubFonts = optEpubFonts o <> map unpack x }) "epub-chapter-level" -> - parseYAML v >>= \x -> return (\o -> o{ optEpubChapterLevel = x }) + parseJSON v >>= \x -> return (\o -> o{ optEpubChapterLevel = x }) "epub-cover-image" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optEpubCoverImage = unpack <$> x }) "toc-depth" -> - parseYAML v >>= \x -> return (\o -> o{ optTOCDepth = x }) + parseJSON v >>= \x -> return (\o -> o{ optTOCDepth = x }) "dump-args" -> - parseYAML v >>= \x -> return (\o -> o{ optDumpArgs = x }) + parseJSON v >>= \x -> return (\o -> o{ optDumpArgs = x }) "ignore-args" -> - parseYAML v >>= \x -> return (\o -> o{ optIgnoreArgs = x }) + parseJSON v >>= \x -> return (\o -> o{ optIgnoreArgs = x }) "verbosity" -> - parseYAML v >>= \x -> return (\o -> o{ optVerbosity = x }) + parseJSON v >>= \x -> return (\o -> o{ optVerbosity = x }) "trace" -> - parseYAML v >>= \x -> return (\o -> o{ optTrace = x }) + parseJSON v >>= \x -> return (\o -> o{ optTrace = x }) "log-file" -> - parseYAML v >>= \x -> return (\o -> o{ optLogFile = unpack <$> x }) + parseJSON v >>= \x -> return (\o -> o{ optLogFile = unpack <$> x }) "fail-if-warnings" -> - parseYAML v >>= \x -> return (\o -> o{ optFailIfWarnings = x }) + parseJSON v >>= \x -> return (\o -> o{ optFailIfWarnings = x }) "reference-links" -> - parseYAML v >>= \x -> return (\o -> o{ optReferenceLinks = x }) + parseJSON v >>= \x -> return (\o -> o{ optReferenceLinks = x }) "reference-location" -> - parseYAML v >>= \x -> return (\o -> o{ optReferenceLocation = x }) + parseJSON v >>= \x -> return (\o -> o{ optReferenceLocation = x }) "dpi" -> - parseYAML v >>= \x -> return (\o -> o{ optDpi = x }) + parseJSON v >>= \x -> return (\o -> o{ optDpi = x }) "wrap" -> - parseYAML v >>= \x -> return (\o -> o{ optWrap = x }) + parseJSON v >>= \x -> return (\o -> o{ optWrap = x }) "columns" -> - parseYAML v >>= \x -> return (\o -> o{ optColumns = x }) + parseJSON v >>= \x -> return (\o -> o{ optColumns = x }) "filters" -> - parseYAML v >>= \x -> return (\o -> o{ optFilters = optFilters o <> x }) + parseJSON v >>= \x -> return (\o -> o{ optFilters = optFilters o <> x }) "citeproc" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> if x then return (\o -> o{ optFilters = CiteprocFilter : optFilters o }) else return id "email-obfuscation" -> - parseYAML v >>= \x -> return (\o -> o{ optEmailObfuscation = x }) + parseJSON v >>= \x -> return (\o -> o{ optEmailObfuscation = x }) "identifier-prefix" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optIdentifierPrefix = x }) "strip-empty-paragraphs" -> - parseYAML v >>= \x -> return (\o -> o{ optStripEmptyParagraphs = x }) + parseJSON v >>= \x -> return (\o -> o{ optStripEmptyParagraphs = x }) "indented-code-classes" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optIndentedCodeClasses = x }) "data-dir" -> - parseYAML v >>= \x -> return (\o -> o{ optDataDir = unpack <$> x }) + parseJSON v >>= \x -> return (\o -> o{ optDataDir = unpack <$> x }) "cite-method" -> - parseYAML v >>= \x -> return (\o -> o{ optCiteMethod = x }) + parseJSON v >>= \x -> return (\o -> o{ optCiteMethod = x }) "listings" -> - parseYAML v >>= \x -> return (\o -> o{ optListings = x }) + parseJSON v >>= \x -> return (\o -> o{ optListings = x }) "pdf-engine" -> - parseYAML v >>= \x -> return (\o -> o{ optPdfEngine = unpack <$> x }) + parseJSON v >>= \x -> return (\o -> o{ optPdfEngine = unpack <$> x }) "pdf-engine-opts" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optPdfEngineOpts = map unpack x }) "pdf-engine-opt" -> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optPdfEngineOpts = map unpack x })) <|> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optPdfEngineOpts = [unpack x] })) "slide-level" -> - parseYAML v >>= \x -> return (\o -> o{ optSlideLevel = x }) + parseJSON v >>= \x -> return (\o -> o{ optSlideLevel = x }) "atx-headers" -> - parseYAML v >>= \x -> return (\o -> o{ optSetextHeaders = not x }) + parseJSON v >>= \x -> return (\o -> o{ optSetextHeaders = not x }) "markdown-headings" -> - parseYAML v >>= \x -> return (\o -> + parseJSON v >>= \x -> return (\o -> case T.toLower x of "atx" -> o{ optSetextHeaders = False } "setext" -> o{ optSetextHeaders = True } _ -> o) "ascii" -> - parseYAML v >>= \x -> return (\o -> o{ optAscii = x }) + parseJSON v >>= \x -> return (\o -> o{ optAscii = x }) "default-image-extension" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optDefaultImageExtension = x }) "extract-media" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optExtractMedia = unpack <$> x }) "track-changes" -> - parseYAML v >>= \x -> return (\o -> o{ optTrackChanges = x }) + parseJSON v >>= \x -> return (\o -> o{ optTrackChanges = x }) "file-scope" -> - parseYAML v >>= \x -> return (\o -> o{ optFileScope = x }) + parseJSON v >>= \x -> return (\o -> o{ optFileScope = x }) "title-prefix" -> - parseYAML v >>= \x -> return (\o -> o{ optTitlePrefix = x, + parseJSON v >>= \x -> return (\o -> o{ optTitlePrefix = x, optStandalone = True }) "css" -> - (parseYAML v >>= \x -> return (\o -> o{ optCss = optCss o <> + (parseJSON v >>= \x -> return (\o -> o{ optCss = optCss o <> map unpack x })) <|> - (parseYAML v >>= \x -> return (\o -> o{ optCss = optCss o <> + (parseJSON v >>= \x -> return (\o -> o{ optCss = optCss o <> [unpack x] })) "bibliography" -> - (parseYAML v >>= \x -> return (\o -> + (parseJSON v >>= \x -> return (\o -> o{ optBibliography = optBibliography o <> map unpack x })) <|> - (parseYAML v >>= \x -> return (\o -> + (parseJSON v >>= \x -> return (\o -> o{ optBibliography = optBibliography o <> [unpack x] })) "csl" -> - parseYAML v >>= \x -> return (\o -> o{ optCSL = unpack <$> x }) + parseJSON v >>= \x -> return (\o -> o{ optCSL = unpack <$> x }) "citation-abbreviations" -> - parseYAML v >>= \x -> return (\o -> o{ optCitationAbbreviations = + parseJSON v >>= \x -> return (\o -> o{ optCitationAbbreviations = unpack <$> x }) "ipynb-output" -> - parseYAML v >>= \x -> return (\o -> o{ optIpynbOutput = x }) + parseJSON v >>= \x -> return (\o -> o{ optIpynbOutput = x }) "include-before-body" -> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optIncludeBeforeBody = optIncludeBeforeBody o <> map unpack x })) <|> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optIncludeBeforeBody = optIncludeBeforeBody o <> [unpack x] })) "include-after-body" -> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optIncludeAfterBody = optIncludeAfterBody o <> map unpack x })) <|> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optIncludeAfterBody = optIncludeAfterBody o <> [unpack x] })) "include-in-header" -> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optIncludeInHeader = optIncludeInHeader o <> map unpack x })) <|> - (parseYAML v >>= \x -> + (parseJSON v >>= \x -> return (\o -> o{ optIncludeInHeader = optIncludeInHeader o <> [unpack x] })) "resource-path" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optResourcePath = map unpack x <> optResourcePath o }) "request-headers" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optRequestHeaders = x }) "no-check-certificate" -> - parseYAML v >>= \x -> + parseJSON v >>= \x -> return (\o -> o{ optNoCheckCertificate = x }) "eol" -> - parseYAML v >>= \x -> return (\o -> o{ optEol = x }) + parseJSON v >>= \x -> return (\o -> o{ optEol = x }) "strip-comments" -> - parseYAML v >>= \x -> return (\o -> o { optStripComments = x }) + parseJSON v >>= \x -> return (\o -> o { optStripComments = x }) "sandbox" -> - parseYAML v >>= \x -> return (\o -> o { optSandbox = x }) - _ -> failAtNode k' $ "Unknown option " ++ show k + parseJSON v >>= \x -> return (\o -> o { optSandbox = x }) + _ -> fail $ "Unknown option " ++ show k -- | Defaults for command-line options. defaultOpts :: Opt @@ -679,18 +663,12 @@ defaultOpts = Opt , optSandbox = False } -parseStringKey :: Node Pos -> Parser Text -parseStringKey k = case k of - Scalar _ (SStr t) -> return t - Scalar _ _ -> failAtNode k "Non-string key" - _ -> failAtNode k "Non-scalar key" - -yamlToMeta :: Node Pos -> Parser Meta -yamlToMeta (Mapping _ _ m) = - either (fail . show) return $ runEverything (yamlMap pMetaString m) - where - pMetaString = pure . MetaString <$> P.manyChar P.anyChar - runEverything p = +yamlToMeta :: Value -> Parser Meta +yamlToMeta (Object o) = + either (fail . show) return $ runEverything (yamlMap pMetaString o) + where + pMetaString = pure . MetaString <$> P.manyChar P.anyChar + runEverything p = runPure (P.readWithM p (def :: P.ParserState) ("" :: Text)) >>= fmap (Meta . flip P.runF def) yamlToMeta _ = return mempty @@ -703,14 +681,12 @@ applyDefaults :: (PandocMonad m, MonadIO m) applyDefaults opt file = do setVerbosity $ optVerbosity opt modify $ \defsState -> defsState{ curDefaults = Just file } - inp <- readFileLazy file - case decode1 inp of + inp <- readFileStrict file + case decodeEither' inp of Right f -> f opt - Left (errpos, errmsg) -> throwError $ - PandocParseError $ T.pack $ - "Error parsing " ++ file ++ " line " ++ - show (posLine errpos) ++ " column " ++ - show (posColumn errpos) ++ ":\n" ++ errmsg + Left err' -> throwError $ + PandocParseError + $ T.pack $ Data.Yaml.prettyPrintParseException err' fullDefaultsPath :: (PandocMonad m, MonadIO m) => Maybe FilePath diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 9a649402e..9f110330e 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -268,7 +268,7 @@ getRefs locale format idpred mbfp raw = do rs <- yamlToRefs idpred def{ readerExtensions = pandocExtensions } (T.unpack <$> mbfp) - (L.fromStrict raw) + raw return $ mapMaybe metaValueToReference rs -- assumes we walk in same order as query diff --git a/src/Text/Pandoc/Filter.hs b/src/Text/Pandoc/Filter.hs index c2f522109..84015ed92 100644 --- a/src/Text/Pandoc/Filter.hs +++ b/src/Text/Pandoc/Filter.hs @@ -19,7 +19,7 @@ module Text.Pandoc.Filter ) where import System.CPUTime (getCPUTime) -import Data.Aeson.TH (deriveJSON, defaultOptions) +import Data.Aeson import GHC.Generics (Generic) import Text.Pandoc.Class (report, getVerbosity, PandocMonad) import Text.Pandoc.Definition (Pandoc) @@ -29,7 +29,6 @@ import Text.Pandoc.Citeproc (processCitations) import qualified Text.Pandoc.Filter.JSON as JSONFilter import qualified Text.Pandoc.Filter.Lua as LuaFilter import qualified Text.Pandoc.Filter.Path as Path -import Data.YAML import qualified Data.Text as T import System.FilePath (takeExtension) import Control.Applicative ((<|>)) @@ -42,9 +41,9 @@ data Filter = LuaFilter FilePath | CiteprocFilter -- built-in citeproc deriving (Show, Generic) -instance FromYAML Filter where - parseYAML node = - (withMap "Filter" $ \m -> do +instance FromJSON Filter where + parseJSON node = + (withObject "Filter" $ \m -> do ty <- m .: "type" fp <- m .:? "path" let missingPath = fail $ "Expected 'path' for filter of type " ++ show ty @@ -55,7 +54,7 @@ instance FromYAML Filter where "json" -> filterWithPath JSONFilter fp _ -> fail $ "Unknown filter type " ++ show (ty :: T.Text)) node <|> - (withStr "Filter" $ \t -> do + (withText "Filter" $ \t -> do let fp = T.unpack t if fp == "citeproc" then return CiteprocFilter @@ -64,6 +63,13 @@ instance FromYAML Filter where ".lua" -> LuaFilter fp _ -> JSONFilter fp) node +instance ToJSON Filter where + toJSON CiteprocFilter = object [ "type" .= String "citeproc" ] + toJSON (LuaFilter fp) = object [ "type" .= String "lua", + "path" .= String (T.pack fp) ] + toJSON (JSONFilter fp) = object [ "type" .= String "json", + "path" .= String (T.pack fp) ] + -- | Modify the given document using a filter. applyFilters :: (PandocMonad m, MonadIO m) => ReaderOptions @@ -96,5 +102,3 @@ expandFilterPath :: (PandocMonad m, MonadIO m) => Filter -> m Filter expandFilterPath (LuaFilter fp) = LuaFilter <$> Path.expandFilterPath fp expandFilterPath (JSONFilter fp) = JSONFilter <$> Path.expandFilterPath fp expandFilterPath CiteprocFilter = return CiteprocFilter - -$(deriveJSON defaultOptions ''Filter) diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs index bb2fb5d36..2268f29f7 100644 --- a/src/Text/Pandoc/Logging.hs +++ b/src/Text/Pandoc/Logging.hs @@ -24,7 +24,6 @@ module Text.Pandoc.Logging ( ) where import Control.Monad (mzero) -import Data.YAML (withStr, FromYAML(..)) import Data.Aeson import Data.Aeson.Encode.Pretty (Config (..), defConfig, encodePretty', keyOrder) @@ -53,13 +52,6 @@ instance FromJSON Verbosity where _ -> mzero parseJSON _ = mzero -instance FromYAML Verbosity where - parseYAML = withStr "Verbosity" $ \case - "ERROR" -> return ERROR - "WARNING" -> return WARNING - "INFO" -> return INFO - _ -> mzero - data LogMessage = SkippedContent Text SourcePos | IgnoredElement Text diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs index 85d9aa103..ba18377c2 100644 --- a/src/Text/Pandoc/Options.hs +++ b/src/Text/Pandoc/Options.hs @@ -34,7 +34,6 @@ module Text.Pandoc.Options ( module Text.Pandoc.Extensions , defaultKaTeXURL ) where import Control.Applicative ((<|>)) -import Data.Char (toLower) import Data.Maybe (fromMaybe) import Data.Data (Data) import Data.Default @@ -46,10 +45,9 @@ import Skylighting (SyntaxMap, defaultSyntaxMap) import Text.DocTemplates (Context(..), Template) import Text.Pandoc.Extensions import Text.Pandoc.Highlighting (Style, pygments) -import Text.Pandoc.Shared (camelCaseStrToHyphenated) -import Data.Aeson.TH (deriveJSON, defaultOptions, Options(..), - SumEncoding(..)) -import Data.YAML +import Text.Pandoc.UTF8 (toStringLazy) +import Data.Aeson.TH (deriveJSON) +import Data.Aeson class HasSyntaxExtensions a where getExtensions :: a -> Extensions @@ -106,9 +104,9 @@ data HTMLMathMethod = PlainMath | KaTeX Text -- url of KaTeX files deriving (Show, Read, Eq, Data, Typeable, Generic) -instance FromYAML HTMLMathMethod where - parseYAML node = - (withMap "HTMLMathMethod" $ \m -> do +instance FromJSON HTMLMathMethod where + parseJSON node = + (withObject "HTMLMathMethod" $ \m -> do method <- m .: "method" mburl <- m .:? "url" case method :: Text of @@ -121,28 +119,48 @@ instance FromYAML HTMLMathMethod where "katex" -> return $ KaTeX $ fromMaybe defaultKaTeXURL mburl _ -> fail $ "Unknown HTML math method " ++ show method) node - <|> (withStr "HTMLMathMethod" $ \method -> - case method of - "plain" -> return PlainMath - "webtex" -> return $ WebTeX "" - "gladtex" -> return GladTeX - "mathml" -> return MathML - "mathjax" -> return $ MathJax defaultMathJaxURL - "katex" -> return $ KaTeX defaultKaTeXURL - _ -> fail $ "Unknown HTML math method " ++ show method) node + <|> (case node of + String "plain" -> return PlainMath + String "webtex" -> return $ WebTeX "" + String "gladtex" -> return GladTeX + String "mathml" -> return MathML + String "mathjax" -> return $ MathJax defaultMathJaxURL + String "katex" -> return $ KaTeX defaultKaTeXURL + _ -> fail $ "Unknown HTML math method " <> + toStringLazy (encode node)) + +instance ToJSON HTMLMathMethod where + toJSON PlainMath = String "plain" + toJSON (WebTeX "") = String "webtex" + toJSON (WebTeX url) = object ["method" .= String "webtex", + "url" .= String url] + toJSON GladTeX = String "gladtex" + toJSON MathML = String "mathml" + toJSON (MathJax "") = String "mathjax" + toJSON (MathJax url) = object ["method" .= String "mathjax", + "url" .= String url] + toJSON (KaTeX "") = String "katex" + toJSON (KaTeX url) = object ["method" .= String "katex", + "url" .= String url] data CiteMethod = Citeproc -- use citeproc to render them | Natbib -- output natbib cite commands | Biblatex -- output biblatex cite commands deriving (Show, Read, Eq, Data, Typeable, Generic) -instance FromYAML CiteMethod where - parseYAML = withStr "Citeproc" $ \t -> - case t of - "citeproc" -> return Citeproc - "natbib" -> return Natbib - "biblatex" -> return Biblatex - _ -> fail $ "Unknown citation method " ++ show t +instance FromJSON CiteMethod where + parseJSON v = + case v of + String "citeproc" -> return Citeproc + String "natbib" -> return Natbib + String "biblatex" -> return Biblatex + _ -> fail $ "Unknown citation method: " <> + toStringLazy (encode v) + +instance ToJSON CiteMethod where + toJSON Citeproc = String "citeproc" + toJSON Natbib = String "natbib" + toJSON Biblatex = String "biblatex" -- | Methods for obfuscating email addresses in HTML. data ObfuscationMethod = NoObfuscation @@ -150,13 +168,18 @@ data ObfuscationMethod = NoObfuscation | JavascriptObfuscation deriving (Show, Read, Eq, Data, Typeable, Generic) -instance FromYAML ObfuscationMethod where - parseYAML = withStr "Citeproc" $ \t -> - case t of - "none" -> return NoObfuscation - "references" -> return ReferenceObfuscation - "javascript" -> return JavascriptObfuscation - _ -> fail $ "Unknown obfuscation method " ++ show t +instance FromJSON ObfuscationMethod where + parseJSON v = + case v of + String "none" -> return NoObfuscation + String "references" -> return ReferenceObfuscation + String "javascript" -> return JavascriptObfuscation + _ -> fail $ "Unknown obfuscation method " ++ toStringLazy (encode v) + +instance ToJSON ObfuscationMethod where + toJSON NoObfuscation = String "none" + toJSON ReferenceObfuscation = String "references" + toJSON JavascriptObfuscation = String "javascript" -- | Varieties of HTML slide shows. data HTMLSlideVariant = S5Slides @@ -173,13 +196,22 @@ data TrackChanges = AcceptChanges | AllChanges deriving (Show, Read, Eq, Data, Typeable, Generic) -instance FromYAML TrackChanges where - parseYAML = withStr "TrackChanges" $ \t -> - case t of - "accept" -> return AcceptChanges - "reject" -> return RejectChanges - "all" -> return AllChanges - _ -> fail $ "Unknown track changes method " ++ show t +-- update in doc/filters.md if this changes: +instance FromJSON TrackChanges where + parseJSON v = + case v of + String "accept" -> return AcceptChanges + String "reject" -> return RejectChanges + String "all" -> return AllChanges + String "accept-changes" -> return AcceptChanges + String "reject-changes" -> return RejectChanges + String "all-changes" -> return AllChanges + _ -> fail $ "Unknown track changes method " <> toStringLazy (encode v) + +instance ToJSON TrackChanges where + toJSON AcceptChanges = String "accept-changes" + toJSON RejectChanges = String "reject-changes" + toJSON AllChanges = String "all-changes" -- | Options for wrapping text in the output. data WrapOption = WrapAuto -- ^ Automatically wrap to width @@ -187,14 +219,21 @@ data WrapOption = WrapAuto -- ^ Automatically wrap to width | WrapPreserve -- ^ Preserve wrapping of input source deriving (Show, Read, Eq, Data, Typeable, Generic) -instance FromYAML WrapOption where - parseYAML = withStr "WrapOption" $ \t -> - case t of - "auto" -> return WrapAuto - "none" -> return WrapNone - "preserve" -> return WrapPreserve - _ -> fail $ "Unknown wrap method " ++ show t - +instance FromJSON WrapOption where + parseJSON v = + case v of + String "auto" -> return WrapAuto + String "wrap-auto" -> return WrapAuto + String "none" -> return WrapNone + String "wrap-none" -> return WrapNone + String "preserve" -> return WrapPreserve + String "wrap-preserve" -> return WrapPreserve + _ -> fail $ "Unknown wrap method " <> toStringLazy (encode v) + +instance ToJSON WrapOption where + toJSON WrapAuto = "wrap-auto" + toJSON WrapNone = "wrap-none" + toJSON WrapPreserve = "wrap-preserve" -- | Options defining the type of top-level headers. data TopLevelDivision = TopLevelPart -- ^ Top-level headers become parts @@ -204,15 +243,24 @@ data TopLevelDivision = TopLevelPart -- ^ Top-level headers become parts -- heuristics deriving (Show, Read, Eq, Data, Typeable, Generic) -instance FromYAML TopLevelDivision where - parseYAML = withStr "TopLevelDivision" $ \t -> - case t of - "part" -> return TopLevelPart - "chapter" -> return TopLevelChapter - "section" -> return TopLevelSection - "default" -> return TopLevelDefault - _ -> fail $ "Unknown top level division " ++ show t - +instance FromJSON TopLevelDivision where + parseJSON v = + case v of + String "part" -> return TopLevelPart + String "top-level-part" -> return TopLevelPart + String "chapter" -> return TopLevelChapter + String "top-level-chapter" -> return TopLevelChapter + String "section" -> return TopLevelSection + String "top-level-section" -> return TopLevelSection + String "default" -> return TopLevelDefault + String "top-level-default" -> return TopLevelDefault + _ -> fail $ "Unknown top level division " <> toStringLazy (encode v) + +instance ToJSON TopLevelDivision where + toJSON TopLevelPart = "top-level-part" + toJSON TopLevelChapter = "top-level-chapter" + toJSON TopLevelSection = "top-level-section" + toJSON TopLevelDefault = "top-level-default" -- | Locations for footnotes and references in markdown output data ReferenceLocation = EndOfBlock -- ^ End of block @@ -220,14 +268,21 @@ data ReferenceLocation = EndOfBlock -- ^ End of block | EndOfDocument -- ^ at end of document deriving (Show, Read, Eq, Data, Typeable, Generic) -instance FromYAML ReferenceLocation where - parseYAML = withStr "ReferenceLocation" $ \t -> - case t of - "block" -> return EndOfBlock - "section" -> return EndOfSection - "document" -> return EndOfDocument - _ -> fail $ "Unknown reference location " ++ show t - +instance FromJSON ReferenceLocation where + parseJSON v = + case v of + String "block" -> return EndOfBlock + String "end-of-block" -> return EndOfBlock + String "section" -> return EndOfSection + String "end-of-section" -> return EndOfSection + String "document" -> return EndOfDocument + String "end-of-document" -> return EndOfDocument + _ -> fail $ "Unknown reference location " <> toStringLazy (encode v) + +instance ToJSON ReferenceLocation where + toJSON EndOfBlock = "end-of-block" + toJSON EndOfSection = "end-of-section" + toJSON EndOfDocument = "end-of-document" -- | Options for writers data WriterOptions = WriterOptions @@ -315,43 +370,7 @@ defaultMathJaxURL = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.j defaultKaTeXURL :: Text defaultKaTeXURL = "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/" --- Update documentation in doc/filters.md if this is changed. -$(deriveJSON defaultOptions{ constructorTagModifier = - camelCaseStrToHyphenated - } ''TrackChanges) - -$(deriveJSON defaultOptions{ constructorTagModifier = - camelCaseStrToHyphenated - } ''WrapOption) - -$(deriveJSON defaultOptions{ constructorTagModifier = - camelCaseStrToHyphenated . drop 8 - } ''TopLevelDivision) - -$(deriveJSON defaultOptions{ constructorTagModifier = - camelCaseStrToHyphenated - } ''ReferenceLocation) - -- Update documentation in doc/filters.md if this is changed. $(deriveJSON defaultOptions ''ReaderOptions) -$(deriveJSON defaultOptions{ - constructorTagModifier = map toLower, - sumEncoding = TaggedObject{ - tagFieldName = "method", - contentsFieldName = "url" } - } ''HTMLMathMethod) - -$(deriveJSON defaultOptions{ constructorTagModifier = - camelCaseStrToHyphenated - } ''CiteMethod) - -$(deriveJSON defaultOptions{ constructorTagModifier = - \case - "NoObfuscation" -> "none" - "ReferenceObfuscation" -> "references" - "JavascriptObfuscation" -> "javascript" - _ -> "none" - } ''ObfuscationMethod) - $(deriveJSON defaultOptions ''HTMLSlideVariant) diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index e7ab8efb4..a73c0cba3 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -28,7 +28,7 @@ import Data.Maybe import qualified Data.Set as Set import Data.Text (Text) import qualified Data.Text as T -import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString as BS import System.FilePath (addExtension, takeExtension, takeDirectory) import qualified System.FilePath.Windows as Windows import qualified System.FilePath.Posix as Posix @@ -72,14 +72,12 @@ readMarkdown opts s = do yamlToMeta :: PandocMonad m => ReaderOptions -> Maybe FilePath - -> BL.ByteString + -> BS.ByteString -> m Meta yamlToMeta opts mbfp bstr = do let parser = do oldPos <- getPosition - case mbfp of - Nothing -> return () - Just fp -> setPosition $ initialPos fp + setPosition $ initialPos (fromMaybe "" mbfp) meta <- yamlBsToMeta (fmap B.toMetaValue <$> parseBlocks) bstr setPosition oldPos return $ runF meta defaultParserState @@ -95,7 +93,7 @@ yamlToRefs :: PandocMonad m => (Text -> Bool) -> ReaderOptions -> Maybe FilePath - -> BL.ByteString + -> BS.ByteString -> m [MetaValue] yamlToRefs idpred opts mbfp bstr = do let parser = do diff --git a/src/Text/Pandoc/Readers/Metadata.hs b/src/Text/Pandoc/Readers/Metadata.hs index cbc523b25..534a7645b 100644 --- a/src/Text/Pandoc/Readers/Metadata.hs +++ b/src/Text/Pandoc/Readers/Metadata.hs @@ -17,102 +17,61 @@ module Text.Pandoc.Readers.Metadata ( yamlMetaBlock, yamlMap ) where -import Control.Monad + import Control.Monad.Except (throwError) -import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString as B import qualified Data.Map as M -import Data.Maybe import Data.Text (Text) import qualified Data.Text as T -import qualified Data.YAML as YAML -import qualified Data.YAML.Event as YE +import qualified Data.Yaml as Yaml +import Data.Aeson (Value(..), Object, Result(..), fromJSON, (.:?), withObject) +import Data.Aeson.Types (parse) +import Text.Pandoc.Shared (tshow) import Text.Pandoc.Class.PandocMonad (PandocMonad (..)) -import Text.Pandoc.Definition +import Text.Pandoc.Definition hiding (Null) import Text.Pandoc.Error -import Text.Pandoc.Parsing hiding (tableWith) -import Text.Pandoc.Shared -import qualified Data.Text.Lazy as TL +import Text.Pandoc.Parsing hiding (tableWith, parse) + + import qualified Text.Pandoc.UTF8 as UTF8 yamlBsToMeta :: (PandocMonad m, HasLastStrPosition st) => ParserT Sources st m (Future st MetaValue) - -> BL.ByteString + -> B.ByteString -> ParserT Sources st m (Future st Meta) yamlBsToMeta pMetaValue bstr = do - case YAML.decodeNode' YAML.failsafeSchemaResolver False False bstr of - Right (YAML.Doc (YAML.Mapping _ _ o):_) - -> fmap Meta <$> yamlMap pMetaValue o - Right [] -> return . return $ mempty - Right [YAML.Doc (YAML.Scalar _ YAML.SNull)] - -> return . return $ mempty - -- the following is what we get from a comment: - Right [YAML.Doc (YAML.Scalar _ (YAML.SUnknown _ ""))] - -> return . return $ mempty + case Yaml.decodeAllEither' bstr of + Right (Object o:_) -> fmap Meta <$> yamlMap pMetaValue o + Right [Null] -> return . return $ mempty Right _ -> Prelude.fail "expected YAML object" - Left (yamlpos, err') - -> do pos <- getPosition - setPosition $ incSourceLine - (setSourceColumn pos (YE.posColumn yamlpos)) - (YE.posLine yamlpos - 1) - Prelude.fail err' - -fakePos :: YAML.Pos -fakePos = YAML.Pos (-1) (-1) 1 0 - -lookupYAML :: Text - -> YAML.Node YE.Pos - -> Maybe (YAML.Node YE.Pos) -lookupYAML t (YAML.Mapping _ _ m) = - M.lookup (YAML.Scalar fakePos (YAML.SUnknown YE.untagged t)) m - `mplus` - M.lookup (YAML.Scalar fakePos (YAML.SStr t)) m -lookupYAML _ _ = Nothing + Left err' -> do + throwError $ PandocParseError + $ T.pack $ Yaml.prettyPrintParseException err' -- Returns filtered list of references. yamlBsToRefs :: (PandocMonad m, HasLastStrPosition st) => ParserT Sources st m (Future st MetaValue) -> (Text -> Bool) -- ^ Filter for id - -> BL.ByteString + -> B.ByteString -> ParserT Sources st m (Future st [MetaValue]) yamlBsToRefs pMetaValue idpred bstr = - case YAML.decodeNode' YAML.failsafeSchemaResolver False False bstr of - Right (YAML.Doc o@YAML.Mapping{}:_) - -> case lookupYAML "references" o of - Just (YAML.Sequence _ _ ns) -> do - let g n = case lookupYAML "id" n of - Just n' -> - case nodeToKey n' of - Nothing -> False - Just t -> idpred t || - case lookupYAML "other-ids" n of - Just (YAML.Sequence _ _ ns') -> - let ts' = mapMaybe nodeToKey ns' - in any idpred ts' - _ -> False - Nothing -> False - sequence <$> - mapM (yamlToMetaValue pMetaValue) (filter g ns) - Just _ -> - Prelude.fail "expecting sequence in 'references' field" - Nothing -> - Prelude.fail "expecting 'references' field" - - Right [] -> return . return $ mempty - Right [YAML.Doc (YAML.Scalar _ YAML.SNull)] - -> return . return $ mempty - Right _ -> Prelude.fail "expecting YAML object" - Left (yamlpos, err') - -> do pos <- getPosition - setPosition $ incSourceLine - (setSourceColumn pos (YE.posColumn yamlpos)) - (YE.posLine yamlpos - 1) - Prelude.fail err' - - -nodeToKey :: YAML.Node YE.Pos -> Maybe Text -nodeToKey (YAML.Scalar _ (YAML.SStr t)) = Just t -nodeToKey (YAML.Scalar _ (YAML.SUnknown _ t)) = Just t -nodeToKey _ = Nothing + case Yaml.decodeEither' bstr of + Right (Object m) -> do + let isSelected (String t) = idpred t + isSelected _ = False + let hasSelectedId (Object o) = + case parse (withObject "ref" (.:? "id")) (Object o) of + Success (Just id') -> isSelected id' + _ -> False + hasSelectedId _ = False + case parse (withObject "metadata" (.:? "references")) (Object m) of + Success (Just refs) -> sequence <$> + mapM (yamlToMetaValue pMetaValue) (filter hasSelectedId refs) + _ -> return $ return [] + Right _ -> return . return $ [] + Left err' -> do + throwError $ PandocParseError + $ T.pack $ Yaml.prettyPrintParseException err' normalizeMetaValue :: (PandocMonad m, HasLastStrPosition st) => ParserT Sources st m (Future st MetaValue) @@ -133,47 +92,36 @@ normalizeMetaValue pMetaValue x = isSpaceChar '\t' = True isSpaceChar _ = False -checkBoolean :: Text -> Maybe Bool -checkBoolean t - | t == T.pack "true" || t == T.pack "True" || t == T.pack "TRUE" = Just True - | t == T.pack "false" || t == T.pack "False" || t == T.pack "FALSE" = Just False - | otherwise = Nothing - yamlToMetaValue :: (PandocMonad m, HasLastStrPosition st) => ParserT Sources st m (Future st MetaValue) - -> YAML.Node YE.Pos + -> Value -> ParserT Sources st m (Future st MetaValue) -yamlToMetaValue pMetaValue (YAML.Scalar _ x) = - case x of - YAML.SStr t -> normalizeMetaValue pMetaValue t - YAML.SBool b -> return $ return $ MetaBool b - YAML.SFloat d -> return $ return $ MetaString $ tshow d - YAML.SInt i -> return $ return $ MetaString $ tshow i - YAML.SUnknown _ t -> - case checkBoolean t of - Just b -> return $ return $ MetaBool b - Nothing -> normalizeMetaValue pMetaValue t - YAML.SNull -> return $ return $ MetaString "" - -yamlToMetaValue pMetaValue (YAML.Sequence _ _ xs) = - fmap MetaList . sequence - <$> mapM (yamlToMetaValue pMetaValue) xs -yamlToMetaValue pMetaValue (YAML.Mapping _ _ o) = - fmap MetaMap <$> yamlMap pMetaValue o -yamlToMetaValue _ _ = return $ return $ MetaString "" +yamlToMetaValue pMetaValue v = + case v of + String t -> normalizeMetaValue pMetaValue t + Bool b -> return $ return $ MetaBool b + Number d -> normalizeMetaValue pMetaValue $ + case fromJSON v of + Success (x :: Int) -> tshow x + _ -> tshow d + Null -> return $ return $ MetaString "" + Array{} -> do + case fromJSON v of + Error err' -> throwError $ PandocParseError $ T.pack err' + Success xs -> fmap MetaList . sequence <$> + mapM (yamlToMetaValue pMetaValue) xs + Object o -> fmap MetaMap <$> yamlMap pMetaValue o yamlMap :: (PandocMonad m, HasLastStrPosition st) => ParserT Sources st m (Future st MetaValue) - -> M.Map (YAML.Node YE.Pos) (YAML.Node YE.Pos) + -> Object -> ParserT Sources st m (Future st (M.Map Text MetaValue)) yamlMap pMetaValue o = do - kvs <- forM (M.toList o) $ \(key, v) -> do - k <- maybe (throwError $ PandocParseError - "Non-string key in YAML mapping") - return $ nodeToKey key - return (k, v) - let kvs' = filter (not . ignorable . fst) kvs - fmap M.fromList . sequence <$> mapM toMeta kvs' + case fromJSON (Object o) of + Error err' -> throwError $ PandocParseError $ T.pack err' + Success (m' :: M.Map Text Value) -> do + let kvs = filter (not . ignorable . fst) $ M.toList m' + fmap M.fromList . sequence <$> mapM toMeta kvs where ignorable t = "_" `T.isSuffixOf` t toMeta (k, v) = do @@ -194,7 +142,7 @@ yamlMetaBlock parser = try $ do -- by including --- and ..., we allow yaml blocks with just comments: let rawYaml = T.unlines ("---" : (rawYamlLines ++ ["..."])) optional blanklines - yamlBsToMeta parser $ UTF8.fromTextLazy $ TL.fromStrict rawYaml + yamlBsToMeta parser $ UTF8.fromText rawYaml stopLine :: Monad m => ParserT Sources st m () stopLine = try $ (string "---" <|> string "...") >> blankline >> return () diff --git a/src/Text/Pandoc/Translations.hs b/src/Text/Pandoc/Translations.hs index 17d56f262..b0476a0ab 100644 --- a/src/Text/Pandoc/Translations.hs +++ b/src/Text/Pandoc/Translations.hs @@ -33,10 +33,11 @@ import Data.Aeson.Types (Value(..), FromJSON(..)) import qualified Data.Aeson.Types as Aeson import qualified Data.Map as M import qualified Data.Text as T -import qualified 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 +import Data.Yaml (prettyPrintParseException) data Term = Abstract @@ -73,14 +74,6 @@ instance FromJSON Term where show t parseJSON invalid = Aeson.typeMismatch "Term" invalid -instance YAML.FromYAML Term where - parseYAML (YAML.Scalar _ (YAML.SStr t)) = - case safeRead t of - Just t' -> pure t' - Nothing -> Prelude.fail $ "Invalid Term name " ++ - show t - parseYAML invalid = YAML.typeMismatch "Term" invalid - instance FromJSON Translations where parseJSON o@(Object{}) = do xs <- parseJSON o >>= mapM addItem . M.toList @@ -94,27 +87,12 @@ instance FromJSON Translations where 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 k of - Nothing -> YAML.typeMismatch "Term" n - Just t -> - case v of - (YAML.Scalar _ (YAML.SStr s)) -> - return (t, T.strip s) - n' -> YAML.typeMismatch "String" n' - addItem (n, _) = YAML.typeMismatch "String" n - lookupTerm :: Term -> Translations -> Maybe T.Text lookupTerm t (Translations tm) = M.lookup t tm readTranslations :: T.Text -> Either T.Text Translations readTranslations s = - case YAML.decodeStrict $ UTF8.fromText s of - Left (pos,err') -> Left $ T.pack $ err' ++ - " (line " ++ show (YAML.posLine pos) ++ " column " ++ - show (YAML.posColumn pos) ++ ")" + case Yaml.decodeAllEither' $ UTF8.fromText s of + Left err' -> Left $ T.pack $ prettyPrintParseException err' Right (t:_) -> Right t Right [] -> Left "empty YAML document" diff --git a/test/command/4819.md b/test/command/4819.md index c7cd9a90a..5caa5c6de 100644 --- a/test/command/4819.md +++ b/test/command/4819.md @@ -49,9 +49,7 @@ foo: no ... ^D Pandoc - Meta - { unMeta = fromList [ ( "foo" , MetaInlines [ Str "no" ] ) ] - } + Meta { unMeta = fromList [ ( "foo" , MetaBool False ) ] } [] ``` diff --git a/test/command/6741.md b/test/command/6741.md index 5fcc0700e..7764055a1 100644 --- a/test/command/6741.md +++ b/test/command/6741.md @@ -35,13 +35,13 @@ references: type: article-journal - author: - family: Suzuki - given: Y + given: Y. - family: Minami - given: T + given: T. - family: Laeng - given: B + given: B. - family: Nakauchi - given: S + given: S. container-title: Acta Psychologica DOI: 10.1016/j.actpsy.2019.102882 id: suzuki2019 diff --git a/test/command/pandoc-citeproc-312.md b/test/command/pandoc-citeproc-312.md index dfc4fe25c..20a9b759b 100644 --- a/test/command/pandoc-citeproc-312.md +++ b/test/command/pandoc-citeproc-312.md @@ -6,7 +6,7 @@ nocite: '@*' references: - author: - literal: NN - id: Y + id: 'Y' issued: - year: 1950 title: 'Date: Year' diff --git a/test/command/pandoc-citeproc-327.md b/test/command/pandoc-citeproc-327.md index 5cfd59576..2ea3a247e 100644 --- a/test/command/pandoc-citeproc-327.md +++ b/test/command/pandoc-citeproc-327.md @@ -45,7 +45,7 @@ I referenced something here^\[1\]^ ::: {#ref-LiLiaoDongWanHaiYuDiQiDongWuCiJiShengChanLiYanJiuJiShengJingGuaYiXingPingJie2017 .csl-entry} [\[1\] ]{.csl-left-margin}[李轶平, 于旭光, 孙明, 等. [辽东湾海域底栖动物次级生产力研究及生境适宜性评价](http://kns.cnki.net/kns/detail/detail.aspx?QueryID=4&CurRec=4&recid=&FileName=CHAN201706006&DbName=CJFDLAST2018&DbCode=CJFQ&yx=Y&pr=&URLID=21.1110.S.20171129.1725.006)\[J\]. -水产科学, 2017(06): 728--734.]{.csl-right-inline} +水产科学, 2017(6): 728--734.]{.csl-right-inline} ::: ::: ``` diff --git a/test/command/yaml-metadata-blocks.md b/test/command/yaml-metadata-blocks.md index d483618d3..d92994b03 100644 --- a/test/command/yaml-metadata-blocks.md +++ b/test/command/yaml-metadata-blocks.md @@ -51,11 +51,11 @@ Pandoc , ( "float" , MetaInlines [ Str "2.5" ] ) , ( "int" , MetaInlines [ Str "8" ] ) , ( "more" , MetaBool False ) - , ( "nothing" , MetaInlines [ Str "null" ] ) + , ( "nothing" , MetaString "" ) , ( "scientific" , MetaInlines [ Str "3.7e-5" ] ) ]) ) - , ( "nothing" , MetaInlines [ Str "null" ] ) + , ( "nothing" , MetaString "" ) , ( "scientific" , MetaInlines [ Str "3.7e-5" ] ) ] } -- cgit v1.2.3 From 26a8de684ea8ec2ed0e2edebda78a8673c2c62d8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 26 Oct 2021 18:32:11 -0700 Subject: Change JSON encodings of some types. - For LineEnding use lowercase constructors, e.g. `crlf`, `native`. This was the original intent, but there was a bug in the implementation. - For HTMLSlideVariant use lowercase constructors. - For ReaderOptions use e.g. `default-image-extension` instead of `readerDefaultImageExtension` for field names. - For Extension, use e.g. `tex_math_dollars` instead of `Ext_tex_math_dollars` as constructor. - For Extensions, use an array of Extensions, instead of an object wrapping the tag `Extensions` and an integer. (The representation is not supposed to be part of the public API.) - For Opt, use field names like `tab-stop` instead of `optTabStop`. --- doc/filters.md | 18 ++++++------- src/Text/Pandoc/App/Opt.hs | 29 ++++++++++---------- src/Text/Pandoc/Extensions.hs | 63 ++++++++++++++++++++++++------------------- src/Text/Pandoc/Options.hs | 8 ++++-- 4 files changed, 65 insertions(+), 53 deletions(-) diff --git a/doc/filters.md b/doc/filters.md index 004a83b7d..c921fc007 100644 --- a/doc/filters.md +++ b/doc/filters.md @@ -460,36 +460,36 @@ filter. Object fields: - `readerAbbreviations` + `abbreviations` : set of known abbreviations (array of strings). - `readerColumns` + `columns` : number of columns in terminal; an integer. - `readerDefaultImageExtension` + default-image-extension` : default extension for images; a string. - `readerExtensions` + `extensions` : integer representation of the syntax extensions bit field. - `readerIndentedCodeClasses` + `indented-code-classes` : default classes for indented code blocks; array of strings. - `readerStandalone` + `standalone` : whether the input was a standalone document with header; either `true` or `false`. - `readerStripComments` + `strip-comments` : HTML comments are stripped instead of parsed as raw HTML; either `true` or `false`. - `readerTabStop` + `tab-stop` : width (i.e. equivalent number of spaces) of tab stops; integer. - `readerTrackChanges` + `track-changes` : track changes setting for docx; one of `"accept-changes"`, `"reject-changes"`, and `"all-changes"`. diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs index 93953d53f..c5fac7951 100644 --- a/src/Text/Pandoc/App/Opt.hs +++ b/src/Text/Pandoc/App/Opt.hs @@ -29,7 +29,7 @@ import Control.Monad.Except (MonadIO, liftIO, throwError, (>=>), foldM) import Control.Monad.State.Strict (StateT, modify, gets) import System.FilePath ( addExtension, (), takeExtension, takeDirectory ) import System.Directory ( canonicalizePath ) -import Data.Char (isLower, toLower) +import Data.Char (toLower) import Data.Maybe (fromMaybe) import GHC.Generics hiding (Meta) import Text.Pandoc.Filter (Filter (..)) @@ -43,8 +43,7 @@ import Text.Pandoc.Options (TopLevelDivision (TopLevelDefault), import Text.Pandoc.Class (readFileStrict, fileExists, setVerbosity, report, PandocMonad(lookupEnv), getUserDataDir) import Text.Pandoc.Error (PandocError (PandocParseError, PandocSomeError)) -import Text.Pandoc.Shared (camelCaseStrToHyphenated, defaultUserDataDir, - findM, ordNub) +import Text.Pandoc.Shared (defaultUserDataDir, findM, ordNub) import qualified Text.Pandoc.Parsing as P import Text.Pandoc.Readers.Metadata (yamlMap) import Text.Pandoc.Class.PandocPure @@ -54,7 +53,7 @@ import Data.Default (def) import qualified Data.Text as T import qualified Data.Map as M import Text.Pandoc.Definition (Meta(..), MetaValue(..)) -import Data.Aeson (defaultOptions, Options(..), Result(..), fromJSON) +import Data.Aeson (defaultOptions, Options(..), Result(..), fromJSON, camelTo2) import Data.Aeson.TH (deriveJSON) import Control.Applicative ((<|>)) import Data.Yaml @@ -62,6 +61,11 @@ import Data.Yaml -- | The type of line-endings to be used when writing plain-text. data LineEnding = LF | CRLF | Native deriving (Show, Generic) +-- see https://github.com/jgm/pandoc/pull/4083 +-- using generic deriving caused long compilation times +$(deriveJSON + defaultOptions{ constructorTagModifier = map toLower } ''LineEnding) + -- | How to handle output blocks in ipynb. data IpynbOutput = IpynbOutputAll @@ -69,6 +73,9 @@ data IpynbOutput = | IpynbOutputBest deriving (Show, Generic) +$(deriveJSON + defaultOptions{ fieldLabelModifier = map toLower . drop 11 } ''IpynbOutput) + -- | Data structure for command line options. data Opt = Opt { optTabStop :: Int -- ^ Number of spaces per tab @@ -147,6 +154,9 @@ data Opt = Opt , optSandbox :: Bool } deriving (Generic, Show) +$(deriveJSON + defaultOptions{ fieldLabelModifier = camelTo2 '-' . drop 3 } ''Opt) + instance FromJSON (Opt -> Opt) where parseJSON (Object m) = case fromJSON (Object m) of @@ -714,14 +724,3 @@ cyclic :: Ord a => [[a]] -> Bool cyclic = any hasDuplicate where hasDuplicate xs = length (ordNub xs) /= length xs - --- see https://github.com/jgm/pandoc/pull/4083 --- using generic deriving caused long compilation times -$(deriveJSON - defaultOptions{ fieldLabelModifier = drop 11 . map toLower } ''IpynbOutput) -$(deriveJSON - defaultOptions{ fieldLabelModifier = map toLower } ''LineEnding) -$(deriveJSON - defaultOptions{ fieldLabelModifier = - camelCaseStrToHyphenated . dropWhile isLower - } ''Opt) diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index 831190e33..ce6a95458 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -40,31 +40,8 @@ import Data.Typeable (Typeable) import GHC.Generics (Generic) import Safe (readMay) import Text.Parsec -import Data.Aeson.TH (deriveJSON, defaultOptions) - -newtype Extensions = Extensions Integer - deriving (Show, Read, Eq, Ord, Data, Typeable, Generic) - -instance Semigroup Extensions where - (Extensions a) <> (Extensions b) = Extensions (a .|. b) -instance Monoid Extensions where - mempty = Extensions 0 - mappend = (<>) - -extensionsFromList :: [Extension] -> Extensions -extensionsFromList = foldr enableExtension emptyExtensions - -emptyExtensions :: Extensions -emptyExtensions = Extensions 0 - -extensionEnabled :: Extension -> Extensions -> Bool -extensionEnabled x (Extensions exts) = testBit exts (fromEnum x) - -enableExtension :: Extension -> Extensions -> Extensions -enableExtension x (Extensions exts) = Extensions (setBit exts (fromEnum x)) - -disableExtension :: Extension -> Extensions -> Extensions -disableExtension x (Extensions exts) = Extensions (clearBit exts (fromEnum x)) +import Data.Aeson.TH (deriveJSON) +import Data.Aeson -- | Individually selectable syntax extensions. data Extension = @@ -162,6 +139,40 @@ data Extension = | Ext_yaml_metadata_block -- ^ YAML metadata block deriving (Show, Read, Enum, Eq, Ord, Bounded, Data, Typeable, Generic) +$(deriveJSON defaultOptions{ constructorTagModifier = drop 4 } ''Extension) + +newtype Extensions = Extensions Integer + deriving (Show, Read, Eq, Ord, Data, Typeable, Generic) + +instance Semigroup Extensions where + (Extensions a) <> (Extensions b) = Extensions (a .|. b) +instance Monoid Extensions where + mempty = Extensions 0 + mappend = (<>) + +instance FromJSON Extensions where + parseJSON = + return . foldr enableExtension emptyExtensions . fromJSON + +instance ToJSON Extensions where + toJSON exts = toJSON $ + [ext | ext <- [minBound..maxBound], extensionEnabled ext exts] + +extensionsFromList :: [Extension] -> Extensions +extensionsFromList = foldr enableExtension emptyExtensions + +emptyExtensions :: Extensions +emptyExtensions = Extensions 0 + +extensionEnabled :: Extension -> Extensions -> Bool +extensionEnabled x (Extensions exts) = testBit exts (fromEnum x) + +enableExtension :: Extension -> Extensions -> Extensions +enableExtension x (Extensions exts) = Extensions (setBit exts (fromEnum x)) + +disableExtension :: Extension -> Extensions -> Extensions +disableExtension x (Extensions exts) = Extensions (clearBit exts (fromEnum x)) + -- | Extensions to be used with pandoc-flavored markdown. pandocExtensions :: Extensions pandocExtensions = extensionsFromList @@ -618,5 +629,3 @@ parseFormatSpec = parse formatSpec "" '+' -> (ext : extsToEnable, extsToDisable) _ -> (extsToEnable, ext : extsToDisable) -$(deriveJSON defaultOptions ''Extension) -$(deriveJSON defaultOptions ''Extensions) diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs index ba18377c2..6a3028b14 100644 --- a/src/Text/Pandoc/Options.hs +++ b/src/Text/Pandoc/Options.hs @@ -37,6 +37,7 @@ import Control.Applicative ((<|>)) import Data.Maybe (fromMaybe) import Data.Data (Data) import Data.Default +import Data.Char (toLower) import Data.Text (Text) import qualified Data.Set as Set import Data.Typeable (Typeable) @@ -371,6 +372,9 @@ defaultKaTeXURL :: Text defaultKaTeXURL = "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/" -- Update documentation in doc/filters.md if this is changed. -$(deriveJSON defaultOptions ''ReaderOptions) +$(deriveJSON defaultOptions{ fieldLabelModifier = + camelTo2 '-' . drop 6 } + ''ReaderOptions) -$(deriveJSON defaultOptions ''HTMLSlideVariant) +$(deriveJSON defaultOptions{ constructorTagModifier = map toLower } + ''HTMLSlideVariant) -- cgit v1.2.3 From 25a86fc06fd5d7e07251ca9bd758cc42c4234d70 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 27 Oct 2021 12:06:29 -0700 Subject: Markdown writer: Be sure to quote special values in YAML metadata. E.g. "Y", "yes", which are now (with yaml library) considered boolean values, as well as "null". This fixes a bug with roundtripping markdown -> markdown: ``` --- foo: "true" ... ``` --- src/Text/Pandoc/Writers/Markdown.hs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index f03dc375d..4f6a8bfb1 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -140,10 +140,20 @@ valToYaml (SimpleVal x) | otherwise = if hasNewlines x then hang 0 ("|" <> cr) x - else if isNothing $ foldM needsDoubleQuotes True x - then "\"" <> fmap escapeInDoubleQuotes x <> "\"" - else x + else case x of + Text _ t | isSpecialString t -> + "\"" <> fmap escapeInDoubleQuotes x <> "\"" + _ | isNothing (foldM needsDoubleQuotes True x) -> + "\"" <> fmap escapeInDoubleQuotes x <> "\"" + | otherwise -> x where + isSpecialString t = Set.member t specialStrings + specialStrings = Set.fromList + ["y", "Y", "yes", "Yes", "YES", "n", "N", + "no", "No", "NO", "true", "True", "TRUE", + "false", "False", "FALSE", "on", "On", "ON", + "off", "Off", "OFF", "null", "Null", + "NULL", "~", "*"] needsDoubleQuotes isFirst t = if T.any isBadAnywhere t || (isFirst && T.any isYamlPunct (T.take 1 t)) -- cgit v1.2.3 From 7fcf1d61843cde87627b09730fbad01c7a9031be Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 27 Oct 2021 22:24:39 +0200 Subject: Lua: re-add `t` and `tag` property to Attr values Removal of these properties from Attr values was a regression. --- src/Text/Pandoc/Lua/Marshaling/Attr.hs | 4 ++++ test/lua/module/pandoc.lua | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/Text/Pandoc/Lua/Marshaling/Attr.hs b/src/Text/Pandoc/Lua/Marshaling/Attr.hs index 1b35e40ad..f69acc61e 100644 --- a/src/Text/Pandoc/Lua/Marshaling/Attr.hs +++ b/src/Text/Pandoc/Lua/Marshaling/Attr.hs @@ -56,6 +56,10 @@ typeAttr = deftype "Attr" ### return <#> parameter peekAttr "attr" "Attr" "" =#> functionResult pushAttr "Attr" "new Attr element" + , readonly "tag" "element type tag (always 'Attr')" + (pushText, const "Attr") + + , alias "t" "alias for `tag`" ["tag"] ] pushAttr :: LuaError e => Pusher e Attr diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 9b6e360f3..9d0663696 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -40,6 +40,13 @@ return { end ) }, + group 'Properties' { + test('has t and tag property', function () + local attr = pandoc.Attr('') + assert.are_equal(attr.t, 'Attr') + assert.are_equal(attr.tag, 'Attr') + end) + }, group 'AttributeList' { test('allows access via fields', function () local attributes = pandoc.Attr('', {}, {{'a', '1'}, {'b', '2'}}).attributes -- cgit v1.2.3 From 25b031e3c3405ae29df6011e1d1cfaedb2e9f4f9 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 26 May 2021 10:53:01 +0200 Subject: Add a short guide to pandoc's sources --- doc/short-guide-to-pandocs-sources.md | 260 ++++++++++++++++++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 doc/short-guide-to-pandocs-sources.md diff --git a/doc/short-guide-to-pandocs-sources.md b/doc/short-guide-to-pandocs-sources.md new file mode 100644 index 000000000..77494f8e5 --- /dev/null +++ b/doc/short-guide-to-pandocs-sources.md @@ -0,0 +1,260 @@ +--- +title: Short guide to pandoc's sources +subtitle: Laying a path for code wanderers +author: Albert Krewinkel +date: 2021-06-07 +--- + +Pandoc, the universal document converter, can serve as a nice intro +into functional programming with Haskell. For many contributors, +including the author of this guide, pandoc was their first real +exposure to this language. Despite its impressive size of more than +60.000 lines of Haskell code (excluding the test suite), pandoc is +still very approachable due to its modular architecture. It can +serve as an interesting subject for learning. + +This guide exists to navigate the large amount of sources, to +lay-out a path that can be followed for learning, and to explain the +underlying concepts. + +A basic understanding of Haskell and of pandoc's functionality is +assumed. + +# Getting the code + +Pandoc has a publicly accessible git repository on GitHub: +. To get a local copy of the source: + + git clone https://github.com/jgm/pandoc + +The source for the main pandoc program is `app/pandoc.hs`. The +source for the pandoc library is in `src/`, the source for the tests +is in `test/`, and the source for the benchmarks is in `benchmark/`. + +Core type definitions are in the separate [*pandoc-types* repo]. +Get it with + + git clone https://github.com/jgm/pandoc-types + +The organization of library and test sources is identical to the +main repo. + +[*pandoc-types* repo]: https://github.com/jgm/pandoc-types + +# Document representation + +The way documents are represented in pandoc is part of its success. +Every document is read into one central data structure, the +so-called *abstract syntax tree* (AST). + +The AST is defined in module `Text.Pandoc.Definition` in package +[*pandoc-types*]. + +It is not necessary to understand the AST in detail, just check-out +the following points: + + * The [`Pandoc`][def-Pandoc] type serves as the central structure. + + * A document has metadata and a list of "block" elements. + + * There are various types of [blocks][def-Block]; some contain raw + text, others contain "Inline" elements. + + * [Inlines][def-Inline] are "running text", with many different + types. The most important contstructors are `Str` (a word), + `Space` (a space char), `Emph` (emphasized text), and `Strong` + (strongly emphasized text). It's worth checking their + definitions. + + * Element attributes are captured as [`Attr`][def-Attr], which is a + triple of the element identifier, its classes, and the key-value + pairs.^[For plans to change this see [jgm/pandoc-types#88].] + +[*pandoc-types*]: https://hackage.haskell.org/package/pandoc-types +[jgm/pandoc-types#88]: https://github.com/jgm/pandoc-types/issues/88 +[def-Pandoc]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Definition.html#Pandoc +[def-Block]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Definition.html#Block +[def-Inline]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Definition.html#Inline +[def-Attr]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Definition.html#Attr + +# Basic architecture + +Take a look at pandoc's source files. The code is below the `src` +directory, in the `Text.Pandoc` module. The basic flow is: + + 1. Document is parsed into the internal representation by a + *reader*; + + 2. the document AST is modified (optional); + + 3. then the internal respresentation is converted into the target + format by a *writer*. + +The [*readers*] can be found in `Text.Pandoc.Readers`, while the +[*writers*] are submodules of `Text.Pandoc.Writers`. The document +modification step is powerful and used in different ways, e.g., in +[*filters*]. + +These parts are the "muscles" of pandoc, which do the heavy lifting. +Everything else can be thought of as the bones and fibers to which +these parts are attached and which make them usable. + +# Writers + +Writers are usually simpler than readers and therefore easier to +grasp. + +Broadly speaking, there are three kind of writers: + + 1. Text writers: these are used for lightweight markup languages + and generate plain text output. Examples: Markdown, Org, + reStructuredText. + 2. XML writers, which convert the AST into structured XML. + Examples: HTML, JATS. + 3. Binary writers, which are like XML writers, but combine the + output with other data and zip it into a single file. Examples: + docx, epub. + + Most writers follow a common pattern and have three main functions: + docTo*Format*, blockTo*Format* and inlineTo*Format*. Each converts + the `Pandoc`, `Block`, and `Inline` elements, respectively. The + *XWiki* and *TEI* writers are comparatively simple and suitable + samples when taking a first look. + + Most writers are self-contained in that most of the conversion code + is within a single module. However, newer writers often use a + different setup: those are built around modules from an external + package. The details of how to serialize the document are not in + the writer module itself, but in an external module. The writer + only has to convert pandoc's AST into the document representation + used by the module. Good examples: commonmark, jira. + +## DocLayout + +All writers build on the `doclayout` package. It can be thought of +as a pretty printer with extra features suitable for lightweight +markup languages. E.g., multiple blank lines are collapsed into a +single blank line, unless multiple blank lines are specifically +requested. This simplifies the code significantly. + +See the repo at https://github.com/jgm/doclayout, and the [hackage +documentation](https://hackage.haskell.org/package/doclayout) + +# Readers + +The same distinction that applies to writers also applies to +readers. Readers for XML formats use XML parsing libraries, while +plain text formats are parsed with [parsec]. + +## Builders + +The plain type constructors from the [`Text.Pandoc.Definition`] +module can be difficult to use, which is why the module +[`Text.Pandoc.Builder`] exists. It offers functions to conveniently +build and combine AST elements. + +The most interesting and important types in `Builder` are +[`Blocks`][def-Blocks] and [`Inlines`][def-Inlines]. All type +constructors use simple lists for sequences of AST elements. +Building lists can be awkward and often comes with bad performance +characteristics, esp. when appending. The `Blocks` and `Inlines` +types are better suited for these operations and are therefore used +extensively in builder functions. + +The builder functions are named with the convention that the suffix +`With` is added if the first argument is an `Attr`; there is usually +another function without that suffix, creating an element with no +attributes. + +[def-Blocks]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Builder.html#Blocks +[def-Inlines]: https://hackage.haskell.org/package/pandoc-types/docs/src/Text.Pandoc.Builder.html#Inlines +[parsec]: https://hackage.haskell.org/package/parsec + +# PandocMonad + +Looking at the readers and writers, one will notice that they all +operate within the `PandocMonad` type class. This class gives access +to options, file operations, and other shared information. The +typeclass has two main implementations: one operates in IO, so on +the "real world", while the other provides a pure functional +interface, suitable to "mock" an environment for testing. + +# Document modifications + +One of the big advantages of a central document structure is that it +allows document modifications via a unified interface. This section +describes the multiple ways in which the document can be altered. + +## Walkable + +Document traversal happens through the `Walkable` class in module +`Text.Pandoc.Walk` ([*pandoc-types* package]). + +## Transitions + +Transitions are simple modifications controllable through +command-line options. + +## Filters + +Filters allow to use Lua or any external language to perform +document transformations. + + +[`Text.Pandoc.Builder`]: https://hackage.haskell.org/package/pandoc-types/docs/Text-Pandoc-Builder.html +[`Text.Pandoc.Definition`]: https://hackage.haskell.org/package/pandoc-types/docs/Text-Pandoc-Definition.html + +# Module overview + +The library is structured as follows: + + - `Text.Pandoc` is a top-level module that exports what is needed + by most users of the library. Any patches that add new readers + or writers will need to make changes here, too. + - `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 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 + tree automatically. + - `Text.Pandoc.Readers.*` are the readers, and `Text.Pandoc.Writers.*` + are the writers. + - `Text.Pandoc.Citeproc.*` contain the code for citation handling, + including an interface to the [citeproc] library. + - `Text.Pandoc.Data` is used to embed data files when the `embed_data_files` + cabal flag is used. + - `Text.Pandoc.Emoji` is a thin wrapper around [emojis]. + - `Text.Pandoc.Highlighting` contains the interface to the + skylighting library, which is used for code syntax highlighting. + - `Text.Pandoc.ImageSize` is a utility module containing functions for + calculating image sizes from the contents of image files. + - `Text.Pandoc.MIME` contains functions for associating MIME types + with extensions. + - `Text.Pandoc.Lua.*` implement Lua filters. + - `Text.Pandoc.Options` defines reader and writer options. + - `Text.Pandoc.PDF` contains functions for producing a PDF from a + LaTeX source. + - `Text.Pandoc.Parsing` contains parsing functions used in multiple readers. + the needs of pandoc. + - `Text.Pandoc.SelfContained` contains functions for making an HTML + file "self-contained," by importing remotely linked images, CSS, + and JavaScript and turning them into `data:` URLs. + - `Text.Pandoc.Shared` is a grab-bag of shared utility functions. + - `Text.Pandoc.Writers.Shared` contains utilities used in writers only. + - `Text.Pandoc.Slides` contains functions for splitting a markdown document + into slides, using the conventions described in the MANUAL. + - `Text.Pandoc.Templates` defines pandoc's templating system. + - `Text.Pandoc.UTF8` contains functions for converting text to and from + UTF8 bytestrings (strict and lazy). + - `Text.Pandoc.Asciify` contains functions to derive ascii versions of + identifiers that use accented characters. + - `Text.Pandoc.UUID` contains functions for generating UUIDs. + - `Text.Pandoc.XML` contains functions for formatting XML. + + + -- cgit v1.2.3 From 3849e12d45cb87b90627ca0d256d7af1a5b867e1 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 8 Jun 2021 09:35:41 +0200 Subject: Update description of T.P.PDF Co-authored-by: Mauro Bieg --- doc/short-guide-to-pandocs-sources.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/short-guide-to-pandocs-sources.md b/doc/short-guide-to-pandocs-sources.md index 77494f8e5..cff764034 100644 --- a/doc/short-guide-to-pandocs-sources.md +++ b/doc/short-guide-to-pandocs-sources.md @@ -234,8 +234,7 @@ The library is structured as follows: with extensions. - `Text.Pandoc.Lua.*` implement Lua filters. - `Text.Pandoc.Options` defines reader and writer options. - - `Text.Pandoc.PDF` contains functions for producing a PDF from a - LaTeX source. + - `Text.Pandoc.PDF` contains functions for producing PDFs. - `Text.Pandoc.Parsing` contains parsing functions used in multiple readers. the needs of pandoc. - `Text.Pandoc.SelfContained` contains functions for making an HTML -- cgit v1.2.3 From 84e4222feda44a05a08ee54a72f9b3f4875ca25a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 27 Oct 2021 16:19:39 -0700 Subject: short-guide: Transitions -> Transformations. --- doc/short-guide-to-pandocs-sources.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/short-guide-to-pandocs-sources.md b/doc/short-guide-to-pandocs-sources.md index cff764034..722063e03 100644 --- a/doc/short-guide-to-pandocs-sources.md +++ b/doc/short-guide-to-pandocs-sources.md @@ -190,9 +190,9 @@ describes the multiple ways in which the document can be altered. Document traversal happens through the `Walkable` class in module `Text.Pandoc.Walk` ([*pandoc-types* package]). -## Transitions +## Transformations -Transitions are simple modifications controllable through +Transformations are simple modifications controllable through command-line options. ## Filters -- cgit v1.2.3 From a1e422097aa62889e6d3d16f3ac9e214a1dcd70c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 27 Oct 2021 21:13:29 -0700 Subject: Require latest skylighting (0.12.1). --- pandoc.cabal | 4 ++-- stack.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index f442bc18c..f2a66b200 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -572,8 +572,8 @@ library random >= 1 && < 1.3, safe >= 0.3.18 && < 0.4, scientific >= 0.3 && < 0.4, - skylighting >= 0.12 && < 0.13, - skylighting-core >= 0.12 && < 0.13, + skylighting >= 0.12.1 && < 0.13, + skylighting-core >= 0.12.1 && < 0.13, split >= 0.2 && < 0.3, syb >= 0.1 && < 0.8, tagsoup >= 0.14.6 && < 0.15, diff --git a/stack.yaml b/stack.yaml index 145b53134..d03ff0e12 100644 --- a/stack.yaml +++ b/stack.yaml @@ -7,8 +7,8 @@ flags: packages: - '.' extra-deps: -- skylighting-core-0.12 -- skylighting-0.12 +- skylighting-core-0.12.1 +- skylighting-0.12.1 - doctemplates-0.10 - emojis-0.1.2 - doclayout-0.3.1.1 -- cgit v1.2.3 From af97598954f07c9762208ef16b03b86494d6b21e Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 28 Oct 2021 10:31:04 +0200 Subject: Lua: increase strictness when getting attribute keys --- src/Text/Pandoc/Lua/Marshaling/Attr.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Lua/Marshaling/Attr.hs b/src/Text/Pandoc/Lua/Marshaling/Attr.hs index f69acc61e..2f1f2406a 100644 --- a/src/Text/Pandoc/Lua/Marshaling/Attr.hs +++ b/src/Text/Pandoc/Lua/Marshaling/Attr.hs @@ -71,7 +71,7 @@ peekAttribs idx = liftLua (ltype idx) >>= \case TypeTable -> liftLua (rawlen idx) >>= \case 0 -> peekKeyValuePairs peekText peekText idx _ -> peekList (peekPair peekText peekText) idx - _ -> fail "unsupported type" + _ -> failPeek "unsupported type" pushAttribs :: LuaError e => Pusher e [(Text, Text)] pushAttribs = pushUD typeAttributeList @@ -139,7 +139,7 @@ peekAttribute idx = (AttributeValue <$!> peekText idx) lookupKey :: [(Text,Text)] -> Maybe Key -> Maybe Attribute lookupKey !kvs = \case - Just (StringKey str) -> AttributeValue <$> lookup str kvs + Just (StringKey str) -> AttributeValue <$!> lookup str kvs Just (IntKey n) -> AttributePair <$!> atMay kvs (n - 1) Nothing -> Nothing -- cgit v1.2.3 From e1cf0ad1bef439da829068b4c5104d81692e860d Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 28 Oct 2021 14:10:54 +0200 Subject: Lua: fix placement of tests for Block elements in pandoc module tests --- test/lua/module/pandoc.lua | 240 ++++++++++++++++++++++----------------------- 1 file changed, 120 insertions(+), 120 deletions(-) diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 9d0663696..72446db99 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -105,126 +105,6 @@ return { assert.are_equal(count, 3) end) }, - group "Block elements" { - group "BulletList" { - test('access items via property `content`', function () - local para = pandoc.Para 'one' - local blist = pandoc.BulletList{{para}} - assert.are_same({{para}}, blist.content) - end), - test('property `content` uses fuzzy marshalling', function () - local old = pandoc.Plain 'old' - local new = pandoc.Plain 'new' - local blist = pandoc.BulletList{{old}} - blist.content = {{new}} - assert.are_same({{new}}, blist:clone().content) - blist.content = new - assert.are_same({{new}}, blist:clone().content) - end), - }, - group "OrderedList" { - test('access items via property `content`', function () - local para = pandoc.Plain 'one' - local olist = pandoc.OrderedList{{para}} - assert.are_same({{para}}, olist.content) - end), - test('forgiving constructor', function () - local plain = pandoc.Plain 'old' - local olist = pandoc.OrderedList({plain}, {3, 'Example', 'Period'}) - local listAttribs = pandoc.ListAttributes(3, 'Example', 'Period') - assert.are_same(olist.listAttributes, listAttribs) - end), - test('has list attribute aliases', function () - local olist = pandoc.OrderedList({}, {4, 'Decimal', 'OneParen'}) - assert.are_equal(olist.start, 4) - assert.are_equal(olist.style, 'Decimal') - assert.are_equal(olist.delimiter, 'OneParen') - end) - }, - group 'DefinitionList' { - test('access items via property `content`', function () - local deflist = pandoc.DefinitionList{ - {'apple', {{pandoc.Plain 'fruit'}, {pandoc.Plain 'company'}}}, - {pandoc.Str 'coffee', 'Best when hot.'} - } - assert.are_equal(#deflist.content, 2) - assert.are_same(deflist.content[1][1], {pandoc.Str 'apple'}) - assert.are_same(deflist.content[1][2][2], - {pandoc.Plain{pandoc.Str 'company'}}) - assert.are_same(deflist.content[2][2], - {{pandoc.Plain{pandoc.Str 'Best when hot.'}}}) - end), - test('modify items via property `content`', function () - local deflist = pandoc.DefinitionList{ - {'apple', {{{'fruit'}}, {{'company'}}}} - } - deflist.content[1][1] = pandoc.Str 'orange' - deflist.content[1][2][1] = {pandoc.Plain 'tasty fruit'} - local newlist = pandoc.DefinitionList{ - { {pandoc.Str 'orange'}, - {{pandoc.Plain 'tasty fruit'}, {pandoc.Plain 'company'}} - } - } - assert.are_equal(deflist, newlist) - end), - }, - group 'Para' { - test('access inline via property `content`', function () - local para = pandoc.Para{'Moin, ', pandoc.Space(), 'Sylt!'} - assert.are_same( - para.content, - {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} - ) - end), - test('modifying `content` changes the element', function () - local para = pandoc.Para{'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} - - para.content[3] = 'Hamburg!' - assert.are_same( - para:clone().content, - {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Hamburg!'} - ) - - para.content = 'Huh' - assert.are_same( - para:clone().content, - {pandoc.Str 'Huh'} - ) - end), - }, - group 'LineBlock' { - test('access lines via property `content`', function () - local spc = pandoc.Space() - local lineblock = pandoc.LineBlock{ - {'200', spc, 'Main', spc, 'St.'}, - {'Berkeley', spc, 'CA', spc, '94718'} - } - assert.are_equal(#lineblock.content, 2) -- has two lines - assert.are_same(lineblock.content[2][1], pandoc.Str 'Berkeley') - end), - test('modifying `content` alter the element', function () - local spc = pandoc.Space() - local lineblock = pandoc.LineBlock{ - {'200', spc, 'Main', spc, 'St.'}, - {'Berkeley', spc, 'CA', spc, '94718'} - } - lineblock.content[1][1] = '404' - assert.are_same( - lineblock:clone().content[1], - {pandoc.Str '404', spc, pandoc.Str 'Main', spc, pandoc.Str 'St.'} - ) - - lineblock.content = {{'line1'}, {'line2'}} - assert.are_same( - lineblock:clone(), - pandoc.LineBlock{ - {pandoc.Str 'line1'}, - {pandoc.Str 'line2'} - } - ) - end) - } - }, group 'HTML-like attribute tables' { test('in element constructor', function () local html_attributes = { @@ -268,6 +148,126 @@ return { end) } }, + group "Block elements" { + group "BulletList" { + test('access items via property `content`', function () + local para = pandoc.Para 'one' + local blist = pandoc.BulletList{{para}} + assert.are_same({{para}}, blist.content) + end), + test('property `content` uses fuzzy marshalling', function () + local old = pandoc.Plain 'old' + local new = pandoc.Plain 'new' + local blist = pandoc.BulletList{{old}} + blist.content = {{new}} + assert.are_same({{new}}, blist:clone().content) + blist.content = new + assert.are_same({{new}}, blist:clone().content) + end), + }, + group "OrderedList" { + test('access items via property `content`', function () + local para = pandoc.Plain 'one' + local olist = pandoc.OrderedList{{para}} + assert.are_same({{para}}, olist.content) + end), + test('forgiving constructor', function () + local plain = pandoc.Plain 'old' + local olist = pandoc.OrderedList({plain}, {3, 'Example', 'Period'}) + local listAttribs = pandoc.ListAttributes(3, 'Example', 'Period') + assert.are_same(olist.listAttributes, listAttribs) + end), + test('has list attribute aliases', function () + local olist = pandoc.OrderedList({}, {4, 'Decimal', 'OneParen'}) + assert.are_equal(olist.start, 4) + assert.are_equal(olist.style, 'Decimal') + assert.are_equal(olist.delimiter, 'OneParen') + end) + }, + group 'DefinitionList' { + test('access items via property `content`', function () + local deflist = pandoc.DefinitionList{ + {'apple', {{pandoc.Plain 'fruit'}, {pandoc.Plain 'company'}}}, + {pandoc.Str 'coffee', 'Best when hot.'} + } + assert.are_equal(#deflist.content, 2) + assert.are_same(deflist.content[1][1], {pandoc.Str 'apple'}) + assert.are_same(deflist.content[1][2][2], + {pandoc.Plain{pandoc.Str 'company'}}) + assert.are_same(deflist.content[2][2], + {{pandoc.Plain{pandoc.Str 'Best when hot.'}}}) + end), + test('modify items via property `content`', function () + local deflist = pandoc.DefinitionList{ + {'apple', {{{'fruit'}}, {{'company'}}}} + } + deflist.content[1][1] = pandoc.Str 'orange' + deflist.content[1][2][1] = {pandoc.Plain 'tasty fruit'} + local newlist = pandoc.DefinitionList{ + { {pandoc.Str 'orange'}, + {{pandoc.Plain 'tasty fruit'}, {pandoc.Plain 'company'}} + } + } + assert.are_equal(deflist, newlist) + end), + }, + group 'Para' { + test('access inline via property `content`', function () + local para = pandoc.Para{'Moin, ', pandoc.Space(), 'Sylt!'} + assert.are_same( + para.content, + {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} + ) + end), + test('modifying `content` changes the element', function () + local para = pandoc.Para{'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} + + para.content[3] = 'Hamburg!' + assert.are_same( + para:clone().content, + {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Hamburg!'} + ) + + para.content = 'Huh' + assert.are_same( + para:clone().content, + {pandoc.Str 'Huh'} + ) + end), + }, + group 'LineBlock' { + test('access lines via property `content`', function () + local spc = pandoc.Space() + local lineblock = pandoc.LineBlock{ + {'200', spc, 'Main', spc, 'St.'}, + {'Berkeley', spc, 'CA', spc, '94718'} + } + assert.are_equal(#lineblock.content, 2) -- has two lines + assert.are_same(lineblock.content[2][1], pandoc.Str 'Berkeley') + end), + test('modifying `content` alter the element', function () + local spc = pandoc.Space() + local lineblock = pandoc.LineBlock{ + {'200', spc, 'Main', spc, 'St.'}, + {'Berkeley', spc, 'CA', spc, '94718'} + } + lineblock.content[1][1] = '404' + assert.are_same( + lineblock:clone().content[1], + {pandoc.Str '404', spc, pandoc.Str 'Main', spc, pandoc.Str 'St.'} + ) + + lineblock.content = {{'line1'}, {'line2'}} + assert.are_same( + lineblock:clone(), + pandoc.LineBlock{ + {pandoc.Str 'line1'}, + {pandoc.Str 'line2'} + } + ) + end) + }, + }, group 'Other types' { group 'SimpleTable' { test('can access properties', function () -- cgit v1.2.3 From f4d9b443d8b44b802d564a64280cbe9ea89dacc8 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 29 Oct 2021 17:08:03 +0200 Subject: Lua: use hslua module abstraction where possible This will make it easier to generate module documentation in the future. --- data/pandoc.lua | 120 +-------------- src/Text/Pandoc/Lua/Filter.hs | 33 +++-- src/Text/Pandoc/Lua/Marshaling/AST.hs | 1 + src/Text/Pandoc/Lua/Marshaling/Attr.hs | 50 ++++--- src/Text/Pandoc/Lua/Module/MediaBag.hs | 160 ++++++++++---------- src/Text/Pandoc/Lua/Module/Pandoc.hs | 258 ++++++++++++++++++++------------- src/Text/Pandoc/Lua/Module/System.hs | 44 +++--- src/Text/Pandoc/Lua/Module/Types.hs | 56 ++++--- src/Text/Pandoc/Lua/Module/Utils.hs | 26 ++-- src/Text/Pandoc/Lua/Packages.hs | 26 ++-- src/Text/Pandoc/Lua/PandocLua.hs | 8 - src/Text/Pandoc/Lua/Util.hs | 9 -- test/lua/module/pandoc.lua | 6 + 13 files changed, 385 insertions(+), 412 deletions(-) diff --git a/data/pandoc.lua b/data/pandoc.lua index cc4dc0cab..1f4830858 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -45,125 +45,19 @@ local utils = M.utils -- @section -- @local ---- Create a new indexing function. --- @param template function template --- @param indices list of indices, starting with the most deeply nested --- @return newly created function --- @local -function make_indexing_function(template, ...) - local indices = {...} - local loadstring = loadstring or load - local bracketed = {} - for i = 1, #indices do - local idx = indices[#indices - i + 1] - bracketed[i] = type(idx) == 'number' - and string.format('[%d]', idx) - or string.format('.%s', idx) - end - local fnstr = string.format('return ' .. template, table.concat(bracketed)) - return assert(loadstring(fnstr))() -end - ---- Create accessor functions using a function template. --- @param fn_template function template in which '%s' is replacd with indices --- @param accessors list of accessors --- @return mapping from accessor names to accessor functions --- @local -local function create_accessor_functions (fn_template, accessors) - local res = {} - function add_accessors(acc, ...) - if type(acc) == 'string' then - res[acc] = make_indexing_function(fn_template, ...) - elseif type(acc) == 'table' and #acc == 0 and next(acc) then - -- Named substructure: the given names are accessed via the substructure, - -- but the accessors are also added to the result table, enabling direct - -- access from the parent element. Mainly used for `attr`. - local name, substructure = next(acc) - res[name] = make_indexing_function(fn_template, ...) - for _, subname in ipairs(substructure) do - res[subname] = make_indexing_function(fn_template, subname, ...) - end - else - for i = 1, #(acc or {}) do - add_accessors(acc[i], i, ...) - end - end - end - add_accessors(accessors) - return res -end - ---- Get list of top-level fields from field descriptor table. --- E.g.: `top_level_fields{'foo', {bar='baz'}, {'qux', 'quux'}}` --- gives {'foo, 'bar', 'qux', 'quux'} --- @local -local function top_level_fields (fields) - local result = List:new{} - for _, v in ipairs(fields) do - if type(v) == 'string' then - table.insert(result, v) - elseif type(v) == 'table' and #v == 0 and next(v) then - table.insert(result, (next(v))) - else - result:extend(top_level_fields(v)) - end - end - return result -end - ---- Creates a function which behaves like next, but respects field names. --- @local -local function make_next_function (fields) - local field_indices = {} - for i, f in ipairs(fields) do - field_indices[f] = i - end - - return function (t, field) - local raw_idx = field == nil and 0 or field_indices[field] - local next_field = fields[raw_idx + 1] - return next_field, t[next_field] - end -end - --- Create a new table which allows to access numerical indices via accessor -- functions. -- @local -local function create_accessor_behavior (tag, accessors) +local function create_accessor_behavior (tag) local behavior = {tag = tag} - behavior.getters = create_accessor_functions( - 'function (x) return x.c%s end', - accessors - ) - behavior.setters = create_accessor_functions( - 'function (x, v) x.c%s = v end', - accessors - ) behavior.__eq = utils.equals behavior.__index = function(t, k) - if getmetatable(t).getters[k] then - return getmetatable(t).getters[k](t) - elseif k == "t" then + if k == "t" then return getmetatable(t)["tag"] - else - return getmetatable(t)[k] - end - end - behavior.__newindex = function(t, k, v) - if getmetatable(t).setters[k] then - getmetatable(t).setters[k](t, v) - else - rawset(t, k, v) end end behavior.__pairs = function (t) - if accessors == nil then - return next, t - end - local iterable_fields = type(accessors) == 'string' - and {accessors} - or top_level_fields(accessors) - return make_next_function(iterable_fields), t + return next, t end return behavior end @@ -242,8 +136,8 @@ end -- @param fn Function to be called when constructing a new element -- @param accessors names to use as accessors for numerical fields -- @return function that constructs a new element -function AstElement:create_constructor(tag, fn, accessors) - local constr = self:make_subtype(tag, create_accessor_behavior(tag, accessors)) +function AstElement:create_constructor(tag, fn) + local constr = self:make_subtype(tag, create_accessor_behavior(tag)) function constr:new(...) return setmetatable(fn(...), self.behavior) end @@ -348,8 +242,4 @@ function M.MetaBool(bool) return bool end ------------------------------------------------------------------------- --- Functions which have moved to different modules -M.sha1 = utils.sha1 - return M diff --git a/src/Text/Pandoc/Lua/Filter.hs b/src/Text/Pandoc/Lua/Filter.hs index 9a06dcac6..9fd0ef32c 100644 --- a/src/Text/Pandoc/Lua/Filter.hs +++ b/src/Text/Pandoc/Lua/Filter.hs @@ -14,6 +14,7 @@ Types and functions for running Lua filters. -} module Text.Pandoc.Lua.Filter ( LuaFilterFunction , LuaFilter + , peekLuaFilter , runFilterFile , walkInlines , walkInlineLists @@ -68,20 +69,24 @@ newtype LuaFilterFunction = LuaFilterFunction Lua.Reference newtype LuaFilter = LuaFilter (Map Name LuaFilterFunction) instance Peekable LuaFilter where - peek idx = do - let constrs = listOfInlinesFilterName - : listOfBlocksFilterName - : metaFilterName - : pandocFilterNames - ++ blockElementNames - ++ inlineElementNames - let go constr acc = do - Lua.getfield idx constr - filterFn <- registerFilterFunction - return $ case filterFn of - Nothing -> acc - Just fn -> Map.insert constr fn acc - LuaFilter <$!> foldrM go Map.empty constrs + peek = Lua.forcePeek . peekLuaFilter + +-- | Retrieves a LuaFilter object from the stack. +peekLuaFilter :: LuaError e => Peeker e LuaFilter +peekLuaFilter idx = do + let constrs = listOfInlinesFilterName + : listOfBlocksFilterName + : metaFilterName + : pandocFilterNames + ++ blockElementNames + ++ inlineElementNames + let go constr acc = Lua.liftLua $ do + Lua.getfield idx constr + filterFn <- registerFilterFunction + return $ case filterFn of + Nothing -> acc + Just fn -> Map.insert constr fn acc + LuaFilter <$!> foldrM go Map.empty constrs -- | Register the function at the top of the stack as a filter function in the -- registry. diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 6bb4fd4e0..aabc9e530 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -45,6 +45,7 @@ module Text.Pandoc.Lua.Marshaling.AST , pushCitation , pushInline , pushListAttributes + , pushMeta , pushMetaValue , pushPandoc ) where diff --git a/src/Text/Pandoc/Lua/Marshaling/Attr.hs b/src/Text/Pandoc/Lua/Marshaling/Attr.hs index 2f1f2406a..a38bc6ec7 100644 --- a/src/Text/Pandoc/Lua/Marshaling/Attr.hs +++ b/src/Text/Pandoc/Lua/Marshaling/Attr.hs @@ -204,26 +204,30 @@ peekAttrTable idx = do return $ ident `seq` classes `seq` attribs `seq` (ident, classes, attribs) -mkAttr :: LuaError e => LuaE e NumResults -mkAttr = do - attr <- ltype (nthBottom 1) >>= \case - TypeString -> forcePeek $ do - mident <- optional (peekText (nthBottom 1)) - mclass <- optional (peekList peekText (nthBottom 2)) - mattribs <- optional (peekAttribs (nthBottom 3)) - return (fromMaybe "" mident, fromMaybe [] mclass, fromMaybe [] mattribs) - TypeTable -> forcePeek $ peekAttrTable (nthBottom 1) - TypeUserdata -> forcePeek $ peekUD typeAttr (nthBottom 1) <|> do - attrList <- peekUD typeAttributeList (nthBottom 1) - return ("", [], attrList) - TypeNil -> pure nullAttr - TypeNone -> pure nullAttr - x -> failLua $ "Cannot create Attr from " ++ show x - pushAttr attr - return 1 - -mkAttributeList :: LuaError e => LuaE e NumResults -mkAttributeList = do - attribs <- forcePeek $ peekAttribs (nthBottom 1) - pushUD typeAttributeList attribs - return 1 +-- | Constructor for 'Attr'. +mkAttr :: LuaError e => DocumentedFunction e +mkAttr = defun "Attr" + ### (ltype (nthBottom 1) >>= \case + TypeString -> forcePeek $ do + mident <- optional (peekText (nthBottom 1)) + mclass <- optional (peekList peekText (nthBottom 2)) + mattribs <- optional (peekAttribs (nthBottom 3)) + return ( fromMaybe "" mident + , fromMaybe [] mclass + , fromMaybe [] mattribs) + TypeTable -> forcePeek $ peekAttrTable (nthBottom 1) + TypeUserdata -> forcePeek $ peekUD typeAttr (nthBottom 1) <|> do + attrList <- peekUD typeAttributeList (nthBottom 1) + return ("", [], attrList) + TypeNil -> pure nullAttr + TypeNone -> pure nullAttr + x -> failLua $ "Cannot create Attr from " ++ show x) + =#> functionResult pushAttr "Attr" "new Attr object" + +-- | Constructor for 'AttributeList'. +mkAttributeList :: LuaError e => DocumentedFunction e +mkAttributeList = defun "AttributeList" + ### return + <#> parameter peekAttribs "table|AttributeList" "attribs" "an attribute list" + =#> functionResult (pushUD typeAttributeList) "AttributeList" + "new AttributeList object" diff --git a/src/Text/Pandoc/Lua/Module/MediaBag.hs b/src/Text/Pandoc/Lua/Module/MediaBag.hs index a1fc40732..6e595f9e4 100644 --- a/src/Text/Pandoc/Lua/Module/MediaBag.hs +++ b/src/Text/Pandoc/Lua/Module/MediaBag.hs @@ -1,112 +1,126 @@ +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Lua.Module.MediaBag Copyright : Copyright © 2017-2021 Albert Krewinkel License : GNU GPL, version 2 or above - Maintainer : Albert Krewinkel - Stability : alpha -The lua module @pandoc.mediabag@. +The Lua module @pandoc.mediabag@. -} module Text.Pandoc.Lua.Module.MediaBag - ( pushModule + ( documentedModule ) where import Prelude hiding (lookup) -import Control.Monad (zipWithM_) -import HsLua (LuaE, NumResults, Optional) -import HsLua.Marshalling (pushIterator) +import Data.Maybe (fromMaybe) +import HsLua ( LuaE, DocumentedFunction, Module (..) + , (<#>), (###), (=#>), (=?>), defun, functionResult + , optionalParameter , parameter) import Text.Pandoc.Class.CommonState (CommonState (..)) import Text.Pandoc.Class.PandocMonad (fetchItem, getMediaBag, modifyCommonState, setMediaBag) import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshaling () -import Text.Pandoc.Lua.PandocLua (PandocLua (..), liftPandocLua, addFunction) +import Text.Pandoc.Lua.Marshaling.List (pushPandocList) +import Text.Pandoc.Lua.PandocLua (unPandocLua) import Text.Pandoc.MIME (MimeType) import qualified Data.ByteString.Lazy as BL -import qualified Data.Text as T import qualified HsLua as Lua import qualified Text.Pandoc.MediaBag as MB -- -- MediaBag submodule -- -pushModule :: PandocLua NumResults -pushModule = do - liftPandocLua Lua.newtable - addFunction "delete" delete - addFunction "empty" empty - addFunction "insert" insert - addFunction "items" items - addFunction "lookup" lookup - addFunction "list" list - addFunction "fetch" fetch - return 1 +documentedModule :: Module PandocError +documentedModule = Module + { moduleName = "pandoc.mediabag" + , moduleDescription = "mediabag access" + , moduleFields = [] + , moduleFunctions = + [ delete + , empty + , fetch + , insert + , items + , list + , lookup + ] + , moduleOperations = [] + } -- | Delete a single item from the media bag. -delete :: FilePath -> PandocLua NumResults -delete fp = 0 <$ modifyCommonState - (\st -> st { stMediaBag = MB.deleteMedia fp (stMediaBag st) }) +delete :: DocumentedFunction PandocError +delete = defun "delete" + ### (\fp -> unPandocLua $ modifyCommonState + (\st -> st { stMediaBag = MB.deleteMedia fp (stMediaBag st) })) + <#> parameter Lua.peekString "string" "filepath" "filename of item to delete" + =#> [] + -- | Delete all items from the media bag. -empty :: PandocLua NumResults -empty = 0 <$ modifyCommonState (\st -> st { stMediaBag = mempty }) +empty :: DocumentedFunction PandocError +empty = defun "empty" + ### unPandocLua (modifyCommonState (\st -> st { stMediaBag = mempty })) + =#> [] -- | Insert a new item into the media bag. -insert :: FilePath - -> Optional MimeType - -> BL.ByteString - -> PandocLua NumResults -insert fp optionalMime contents = do - mb <- getMediaBag - setMediaBag $ MB.insertMedia fp (Lua.fromOptional optionalMime) contents mb - return (Lua.NumResults 0) +insert :: DocumentedFunction PandocError +insert = defun "insert" + ### (\fp mmime contents -> unPandocLua $ do + mb <- getMediaBag + setMediaBag $ MB.insertMedia fp mmime contents mb + return (Lua.NumResults 0)) + <#> parameter Lua.peekString "string" "filepath" "item file path" + <#> optionalParameter Lua.peekText "string" "mimetype" "the item's MIME type" + <#> parameter Lua.peekLazyByteString "string" "contents" "binary contents" + =?> "Nothing" -- | Returns iterator values to be used with a Lua @for@ loop. -items :: PandocLua NumResults -items = do - mb <- getMediaBag - liftPandocLua $ do - let pushItem (fp, mimetype, contents) = do - Lua.pushString fp - Lua.pushText mimetype - Lua.pushByteString $ BL.toStrict contents - return (Lua.NumResults 3) - pushIterator pushItem (MB.mediaItems mb) +items :: DocumentedFunction PandocError +items = defun "items" + ### (do + mb <-unPandocLua getMediaBag + let pushItem (fp, mimetype, contents) = do + Lua.pushString fp + Lua.pushText mimetype + Lua.pushByteString $ BL.toStrict contents + return (Lua.NumResults 3) + Lua.pushIterator pushItem (MB.mediaItems mb)) + =?> "Iterator triple" -lookup :: FilePath - -> PandocLua NumResults -lookup fp = do - res <- MB.lookupMedia fp <$> getMediaBag - liftPandocLua $ case res of - Nothing -> 1 <$ Lua.pushnil - Just item -> do - Lua.push $ MB.mediaMimeType item - Lua.push $ MB.mediaContents item - return 2 +-- | Function to lookup a value in the mediabag. +lookup :: DocumentedFunction PandocError +lookup = defun "lookup" + ### (\fp -> unPandocLua (MB.lookupMedia fp <$> getMediaBag) >>= \case + Nothing -> 1 <$ Lua.pushnil + Just item -> 2 <$ do + Lua.pushText $ MB.mediaMimeType item + Lua.pushLazyByteString $ MB.mediaContents item) + <#> parameter Lua.peekString "string" "filepath" "path of item to lookup" + =?> "MIME type and contents" -list :: PandocLua NumResults -list = do - dirContents <- MB.mediaDirectory <$> getMediaBag - liftPandocLua $ do - Lua.newtable - zipWithM_ addEntry [1..] dirContents - return 1 +-- | Function listing all mediabag items. +list :: DocumentedFunction PandocError +list = defun "list" + ### (unPandocLua (MB.mediaDirectory <$> getMediaBag)) + =#> functionResult (pushPandocList pushEntry) "table" "list of entry triples" where - addEntry :: Lua.Integer -> (FilePath, MimeType, Int) -> LuaE PandocError () - addEntry idx (fp, mimeType, contentLength) = do + pushEntry :: (FilePath, MimeType, Int) -> LuaE PandocError () + pushEntry (fp, mimeType, contentLength) = do Lua.newtable - Lua.push ("path" :: T.Text) *> Lua.push fp *> Lua.rawset (-3) - Lua.push ("type" :: T.Text) *> Lua.push mimeType *> Lua.rawset (-3) - Lua.push ("length" :: T.Text) *> Lua.push contentLength *> Lua.rawset (-3) - Lua.rawseti (-2) idx + Lua.pushName "path" *> Lua.pushString fp *> Lua.rawset (-3) + Lua.pushName "type" *> Lua.pushText mimeType *> Lua.rawset (-3) + Lua.pushName "length" *> Lua.pushIntegral contentLength *> Lua.rawset (-3) -fetch :: T.Text - -> PandocLua NumResults -fetch src = do - (bs, mimeType) <- fetchItem src - liftPandocLua . Lua.push $ maybe "" T.unpack mimeType - liftPandocLua $ Lua.push bs - return 2 -- returns 2 values: contents, mimetype +-- | Lua function to retrieve a new item. +fetch :: DocumentedFunction PandocError +fetch = defun "fetch" + ### (\src -> do + (bs, mimeType) <- unPandocLua $ fetchItem src + Lua.pushText $ fromMaybe "" mimeType + Lua.pushByteString bs + return 2) + <#> parameter Lua.peekText "string" "src" "URI to fetch" + =?> "Returns two string values: the fetched contents and the mimetype." diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 7bad3f1a5..6d1ccea04 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -14,11 +15,12 @@ Pandoc module for lua. -} module Text.Pandoc.Lua.Module.Pandoc ( pushModule + , documentedModule ) where import Prelude hiding (read) -import Control.Applicative ((<|>), optional) -import Control.Monad ((>=>), (<$!>), forM_, when) +import Control.Applicative ((<|>)) +import Control.Monad ((<$!>), forM_, when) import Control.Monad.Catch (catch, throwM) import Control.Monad.Except (throwError) import Data.Data (Data, dataTypeConstrs, dataTypeOf, showConstr) @@ -26,13 +28,14 @@ import Data.Default (Default (..)) import Data.Maybe (fromMaybe) import Data.Proxy (Proxy (Proxy)) import Data.Text (Text) -import HsLua as Lua hiding (Div, pushModule) +import HsLua hiding (Div, pushModule) import HsLua.Class.Peekable (PeekError) import System.Exit (ExitCode (..)) import Text.Pandoc.Class.PandocIO (runIO) import Text.Pandoc.Definition -import Text.Pandoc.Lua.Filter (SingletonsList (..), walkInlines, - walkInlineLists, walkBlocks, walkBlockLists) +import Text.Pandoc.Lua.Filter (SingletonsList (..), LuaFilter, peekLuaFilter, + walkInlines, walkInlineLists, + walkBlocks, walkBlockLists) import Text.Pandoc.Lua.Marshaling () import Text.Pandoc.Lua.Marshaling.AST import Text.Pandoc.Lua.Marshaling.Attr (mkAttr, mkAttributeList) @@ -40,13 +43,15 @@ import Text.Pandoc.Lua.Marshaling.List (List (..)) import Text.Pandoc.Lua.Marshaling.ListAttributes ( mkListAttributes , peekListAttributes) import Text.Pandoc.Lua.Marshaling.SimpleTable (mkSimpleTable) -import Text.Pandoc.Lua.PandocLua (PandocLua, addFunction, liftPandocLua, +import Text.Pandoc.Lua.Module.Utils (sha1) +import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, loadDefaultModule) import Text.Pandoc.Options (ReaderOptions (readerExtensions)) import Text.Pandoc.Process (pipeProcess) import Text.Pandoc.Readers (Reader (..), getReader) import Text.Pandoc.Walk (Walkable) +import qualified HsLua as Lua import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy.Char8 as BSL import qualified Data.Text as T @@ -57,45 +62,74 @@ import Text.Pandoc.Error -- module to be loadable. pushModule :: PandocLua NumResults pushModule = do + liftPandocLua $ Lua.pushModule documentedModule loadDefaultModule "pandoc" - addFunction "read" read - addFunction "pipe" pipe - addFunction "walk_block" (walkElement peekBlock pushBlock) - addFunction "walk_inline" (walkElement peekInline pushInline) - -- Constructors - addFunction "Attr" (liftPandocLua mkAttr) - addFunction "AttributeList" (liftPandocLua mkAttributeList) - addFunction "Pandoc" mkPandoc + let copyNext = do + hasNext <- next (nth 2) + if not hasNext + then return () + else do + pushvalue (nth 2) + insert (nth 2) + rawset (nth 5) -- pandoc module + copyNext liftPandocLua $ do - let addConstr fn = do - pushName (functionName fn) - pushDocumentedFunction fn - rawset (nth 3) - forM_ otherConstructors addConstr - forM_ blockConstructors addConstr - forM_ inlineConstructors addConstr - let addConstructorTable constructors = do - -- add constructors to Inlines.constructor - newtable -- constructor - forM_ constructors $ \fn -> do - let name = functionName fn - pushName name - pushName name - rawget (nth 4) - rawset (nth 3) - -- set as pandoc.Inline.constructor - pushName "Inline" - newtable *> pushName "constructor" *> - pushvalue (nth 4) *> rawset (nth 3) - rawset (nth 4) - pop 1 -- remaining constructor table - addConstructorTable (blockConstructors @PandocError) - addConstructorTable (inlineConstructors @PandocError) - -- Add string constants - forM_ stringConstants $ \c -> do - pushString c *> pushString c *> rawset (nth 3) + pushnil -- initial key + copyNext + pop 1 + return 1 +documentedModule :: Module PandocError +documentedModule = Module + { moduleName = "pandoc" + , moduleDescription = T.unlines + [ "Lua functions for pandoc scripts; includes constructors for" + , "document elements, functions to parse text in a given" + , "format, and functions to filter and modify a subtree." + ] + , moduleFields = stringConstants ++ [inlineField, blockField] + , moduleOperations = [] + , moduleFunctions = mconcat + [ functions + , otherConstructors + , blockConstructors + , inlineConstructors + ] + } + +-- | Inline table field +inlineField :: Field PandocError +inlineField = Field + { fieldName = "Inline" + , fieldDescription = "Inline constructors, nested under 'constructors'." + -- the nesting happens for historical reasons and should probably be + -- changed. + , fieldPushValue = pushWithConstructorsSubtable inlineConstructors + } + +-- | @Block@ module field +blockField :: Field PandocError +blockField = Field + { fieldName = "Block" + , fieldDescription = "Inline constructors, nested under 'constructors'." + -- the nesting happens for historical reasons and should probably be + -- changed. + , fieldPushValue = pushWithConstructorsSubtable blockConstructors + } + +pushWithConstructorsSubtable :: [DocumentedFunction PandocError] + -> LuaE PandocError () +pushWithConstructorsSubtable constructors = do + newtable -- Field table + newtable -- constructor table + pushName "constructor" *> pushvalue (nth 2) *> rawset (nth 4) + forM_ constructors $ \fn -> do + pushName (functionName fn) + pushDocumentedFunction fn + rawset (nth 3) + pop 1 -- pop constructor table + inlineConstructors :: LuaError e => [DocumentedFunction e] inlineConstructors = [ defun "Cite" @@ -291,7 +325,13 @@ mkInlinesConstr name constr = defun name otherConstructors :: LuaError e => [DocumentedFunction e] otherConstructors = - [ defun "Citation" + [ defun "Pandoc" + ### liftPure2 (\blocks mMeta -> Pandoc (fromMaybe nullMeta mMeta) blocks) + <#> parameter peekBlocksFuzzy "Blocks" "blocks" "document contents" + <#> optionalParameter peekMeta "Meta" "meta" "document metadata" + =#> functionResult pushPandoc "Pandoc" "new Pandoc document" + + , defun "Citation" ### (\cid mode mprefix msuffix mnote_num mhash -> cid `seq` mode `seq` mprefix `seq` msuffix `seq` mnote_num `seq` mhash `seq` return $! Citation @@ -311,68 +351,93 @@ otherConstructors = =#> functionResult pushCitation "Citation" "new citation object" #? "Creates a single citation." + , mkAttr + , mkAttributeList , mkListAttributes , mkSimpleTable ] -stringConstants :: [String] +stringConstants :: [Field e] stringConstants = let constrs :: forall a. Data a => Proxy a -> [String] constrs _ = map showConstr . dataTypeConstrs . dataTypeOf @a $ undefined - in constrs (Proxy @ListNumberStyle) - ++ constrs (Proxy @ListNumberDelim) - ++ constrs (Proxy @QuoteType) - ++ constrs (Proxy @MathType) - ++ constrs (Proxy @Alignment) - ++ constrs (Proxy @CitationMode) + nullaryConstructors = mconcat + [ constrs (Proxy @ListNumberStyle) + , constrs (Proxy @ListNumberDelim) + , constrs (Proxy @QuoteType) + , constrs (Proxy @MathType) + , constrs (Proxy @Alignment) + , constrs (Proxy @CitationMode) + ] + toField s = Field + { fieldName = T.pack s + , fieldDescription = T.pack s + , fieldPushValue = pushString s + } + in map toField nullaryConstructors walkElement :: (Walkable (SingletonsList Inline) a, Walkable (SingletonsList Block) a, Walkable (List Inline) a, Walkable (List Block) a) - => Peeker PandocError a -> Pusher PandocError a - -> LuaE PandocError NumResults -walkElement peek' push' = do - x <- forcePeek $ peek' (nthBottom 1) - f <- peek (nthBottom 2) - let walk' = walkInlines f - >=> walkInlineLists f - >=> walkBlocks f - >=> walkBlockLists f - walk' x >>= push' - return (NumResults 1) - -read :: T.Text -> Optional T.Text -> PandocLua NumResults -read content formatSpecOrNil = liftPandocLua $ do - let formatSpec = fromMaybe "markdown" (Lua.fromOptional formatSpecOrNil) - res <- Lua.liftIO . runIO $ - getReader formatSpec >>= \(rdr,es) -> - case rdr of - TextReader r -> - r def{ readerExtensions = es } content - _ -> throwError $ PandocSomeError - "Only textual formats are supported" - case res of - Right pd -> (1 :: NumResults) <$ Lua.push pd -- success, push Pandoc - Left (PandocUnknownReaderError f) -> Lua.raiseError $ - "Unknown reader: " <> f - Left (PandocUnsupportedExtensionError e f) -> Lua.raiseError $ - "Extension " <> e <> " not supported for " <> f - Left e -> Lua.raiseError $ show e - --- | Pipes input through a command. -pipe :: String -- ^ path to executable - -> [String] -- ^ list of arguments - -> BL.ByteString -- ^ input passed to process via stdin - -> PandocLua NumResults -pipe command args input = liftPandocLua $ do - (ec, output) <- Lua.liftIO $ pipeProcess Nothing command args input - `catch` (throwM . PandocIOError "pipe") - case ec of - ExitSuccess -> 1 <$ Lua.push output - ExitFailure n -> do - pushPipeError (PipeError (T.pack command) n output) - Lua.error + => a -> LuaFilter -> LuaE PandocError a +walkElement x f = walkInlines f x + >>= walkInlineLists f + >>= walkBlocks f + >>= walkBlockLists f + +functions :: [DocumentedFunction PandocError] +functions = + [ defun "pipe" + ### (\command args input -> do + (ec, output) <- Lua.liftIO $ pipeProcess Nothing command args input + `catch` (throwM . PandocIOError "pipe") + case ec of + ExitSuccess -> 1 <$ Lua.pushLazyByteString output + ExitFailure n -> do + pushPipeError (PipeError (T.pack command) n output) + Lua.error) + <#> parameter peekString "string" "command" "path to executable" + <#> parameter (peekList peekString) "{string,...}" "args" + "list of arguments" + <#> parameter peekLazyByteString "string" "input" + "input passed to process via stdin" + =?> "output string, or error triple" + + , defun "read" + ### (\content mformatspec -> do + let formatSpec = fromMaybe "markdown" mformatspec + res <- Lua.liftIO . runIO $ getReader formatSpec >>= \case + (TextReader r, es) -> r def{ readerExtensions = es } content + _ -> throwError $ PandocSomeError + "Only textual formats are supported" + case res of + Right pd -> return pd -- success, got a Pandoc document + Left (PandocUnknownReaderError f) -> + Lua.failLua . T.unpack $ "Unknown reader: " <> f + Left (PandocUnsupportedExtensionError e f) -> + Lua.failLua . T.unpack $ + "Extension " <> e <> " not supported for " <> f + Left e -> + throwM e) + <#> parameter peekText "string" "content" "text to parse" + <#> optionalParameter peekText "string" "formatspec" "format and extensions" + =#> functionResult pushPandoc "Pandoc" "result document" + + , sha1 + + , defun "walk_block" + ### walkElement + <#> parameter peekBlockFuzzy "Block" "block" "element to traverse" + <#> parameter peekLuaFilter "LuaFilter" "filter" "filter functions" + =#> functionResult pushBlock "Block" "modified Block" + + , defun "walk_inline" + ### walkElement + <#> parameter peekInlineFuzzy "Inline" "inline" "element to traverse" + <#> parameter peekLuaFilter "LuaFilter" "filter" "filter functions" + =#> functionResult pushInline "Inline" "modified Inline" + ] data PipeError = PipeError { pipeErrorCommand :: T.Text @@ -416,12 +481,3 @@ pushPipeError pipeErr = do , if output == mempty then BSL.pack "" else output ] return (NumResults 1) - -mkPandoc :: PandocLua NumResults -mkPandoc = liftPandocLua $ do - doc <- forcePeek $ do - blks <- peekBlocksFuzzy (nthBottom 1) - mMeta <- optional $ peekMeta (nthBottom 2) - pure $ Pandoc (fromMaybe nullMeta mMeta) blks - pushPandoc doc - return 1 diff --git a/src/Text/Pandoc/Lua/Module/System.hs b/src/Text/Pandoc/Lua/Module/System.hs index 8589f672c..e329a0125 100644 --- a/src/Text/Pandoc/Lua/Module/System.hs +++ b/src/Text/Pandoc/Lua/Module/System.hs @@ -11,34 +11,28 @@ Pandoc's system Lua module. -} module Text.Pandoc.Lua.Module.System - ( pushModule + ( documentedModule ) where -import HsLua hiding (pushModule) +import HsLua import HsLua.Module.System (arch, env, getwd, os, with_env, with_tmpdir, with_wd) -import Text.Pandoc.Error (PandocError) -import Text.Pandoc.Lua.ErrorConversion () - -import qualified HsLua as Lua -- | Push the pandoc.system module on the Lua stack. -pushModule :: LuaE PandocError NumResults -pushModule = do - Lua.pushModule $ Module - { moduleName = "system" - , moduleDescription = "system functions" - , moduleFields = - [ arch - , os - ] - , moduleFunctions = - [ setName "environment" env - , setName "get_working_directory" getwd - , setName "with_environment" with_env - , setName "with_temporary_directory" with_tmpdir - , setName "with_working_directory" with_wd - ] - , moduleOperations = [] - } - return 1 +documentedModule :: LuaError e => Module e +documentedModule = Module + { moduleName = "pandoc.system" + , moduleDescription = "system functions" + , moduleFields = + [ arch + , os + ] + , moduleFunctions = + [ setName "environment" env + , setName "get_working_directory" getwd + , setName "with_environment" with_env + , setName "with_temporary_directory" with_tmpdir + , setName "with_working_directory" with_wd + ] + , moduleOperations = [] + } diff --git a/src/Text/Pandoc/Lua/Module/Types.hs b/src/Text/Pandoc/Lua/Module/Types.hs index ff4a4e0d5..4b37dafd9 100644 --- a/src/Text/Pandoc/Lua/Module/Types.hs +++ b/src/Text/Pandoc/Lua/Module/Types.hs @@ -10,34 +10,52 @@ Pandoc data type constructors. -} module Text.Pandoc.Lua.Module.Types - ( pushModule + ( documentedModule ) where -import HsLua (LuaE, NumResults, Peeker, Pusher) +import HsLua ( LuaE, NumResults, Peeker, Pusher, Module (..), Field (..) + , defun, functionResult, parameter, (###), (<#>), (=#>)) +import HsLua.Module.Version (peekVersionFuzzy, pushVersion) import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.ErrorConversion () import Text.Pandoc.Lua.Marshaling.AST -import Text.Pandoc.Lua.Util (addFunction) import qualified HsLua as Lua -import qualified HsLua.Module.Version as Version -- | Push the pandoc.types module on the Lua stack. -pushModule :: LuaE PandocError NumResults -pushModule = do - Lua.newtable - Lua.pushName "Version" *> Lua.pushModule Version.documentedModule - *> Lua.rawset (Lua.nth 3) - pushCloneTable - Lua.setfield (Lua.nth 2) "clone" - return 1 - -pushCloneTable :: LuaE PandocError NumResults -pushCloneTable = do - Lua.newtable - addFunction "Meta" $ cloneWith peekMeta Lua.push - addFunction "MetaValue" $ cloneWith peekMetaValue pushMetaValue - return 1 +documentedModule :: Module PandocError +documentedModule = Module + { moduleName = "pandoc.types" + , moduleDescription = + "Constructors for types that are not part of the pandoc AST." + , moduleFields = + [ Field + { fieldName = "clone" + , fieldDescription = "DEPRECATED! Helper functions for element cloning." + , fieldPushValue = do + Lua.newtable + addFunction "Meta" $ cloneWith peekMeta pushMeta + addFunction "MetaValue" $ cloneWith peekMetaValue pushMetaValue + } + ] + , moduleFunctions = + [ defun "Version" + ### return + <#> parameter peekVersionFuzzy "string|integer|{integer,...}|Version" + "version_specifier" + (mconcat [ "either a version string like `'2.7.3'`, " + , "a single integer like `2`, " + , "list of integers like `{2,7,3}`, " + , "or a Version object" + ]) + =#> functionResult pushVersion "Version" "A new Version object." + ] + , moduleOperations = [] + } + where addFunction name fn = do + Lua.pushName name + Lua.pushHaskellFunction fn + Lua.rawset (Lua.nth 3) cloneWith :: Peeker PandocError a -> Pusher PandocError a diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 3602612cb..01ba4eb46 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -13,7 +13,8 @@ Utility module for Lua, exposing internal helper functions. -} module Text.Pandoc.Lua.Module.Utils - ( pushModule + ( documentedModule + , sha1 ) where import Control.Applicative ((<|>)) @@ -21,7 +22,7 @@ import Control.Monad ((<$!>)) import Data.Data (showConstr, toConstr) import Data.Default (def) import Data.Version (Version) -import HsLua as Lua hiding (pushModule) +import HsLua as Lua import HsLua.Class.Peekable (PeekError) import HsLua.Module.Version (peekVersionFuzzy, pushVersion) import Text.Pandoc.Definition @@ -39,7 +40,6 @@ import Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua)) import qualified Data.Digest.Pure.SHA as SHA import qualified Data.ByteString.Lazy as BSL import qualified Data.Text as T -import qualified HsLua.Packaging as Lua import qualified Text.Pandoc.Builder as B import qualified Text.Pandoc.Filter.JSON as JSONFilter import qualified Text.Pandoc.Shared as Shared @@ -47,8 +47,8 @@ import qualified Text.Pandoc.UTF8 as UTF8 import qualified Text.Pandoc.Writers.Shared as Shared -- | Push the "pandoc.utils" module to the Lua stack. -pandocUtilsModule :: Module PandocError -pandocUtilsModule = Module +documentedModule :: Module PandocError +documentedModule = Module { moduleName = "pandoc.utils" , moduleDescription = "pandoc utility functions" , moduleFields = [] @@ -92,12 +92,7 @@ pandocUtilsModule = Module , "Returns nil instead of a string if the conversion failed." ] - , defun "sha1" - ### liftPure (SHA.showDigest . SHA.sha1) - <#> parameter (fmap BSL.fromStrict . peekByteString) "string" - "input" "" - =#> functionResult pushString "string" "hexadecimal hash value" - #? "Compute the hash of the given string value." + , sha1 , defun "Version" ### liftPure (id @Version) @@ -146,8 +141,13 @@ pandocUtilsModule = Module ] } -pushModule :: LuaE PandocError NumResults -pushModule = 1 <$ Lua.pushModule pandocUtilsModule +-- | Documented Lua function to compute the hash of a string. +sha1 :: DocumentedFunction e +sha1 = defun "sha1" + ### liftPure (SHA.showDigest . SHA.sha1) + <#> parameter (fmap BSL.fromStrict . peekByteString) "string" "input" "" + =#> functionResult pushString "string" "hexadecimal hash value" + #? "Compute the hash of the given string value." -- | Convert pandoc structure to a string with formatting removed. diff --git a/src/Text/Pandoc/Lua/Packages.hs b/src/Text/Pandoc/Lua/Packages.hs index f9bd7abe8..8e5cc96c3 100644 --- a/src/Text/Pandoc/Lua/Packages.hs +++ b/src/Text/Pandoc/Lua/Packages.hs @@ -16,7 +16,6 @@ module Text.Pandoc.Lua.Packages ) where import Control.Monad (forM_) -import HsLua (NumResults) import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, loadDefaultModule) @@ -43,24 +42,27 @@ installPandocPackageSearcher = liftPandocLua $ do Lua.rawseti (-2) (i + 1) -- | Load a pandoc module. -pandocPackageSearcher :: String -> PandocLua NumResults +pandocPackageSearcher :: String -> PandocLua Lua.NumResults pandocPackageSearcher pkgName = case pkgName of "pandoc" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError Pandoc.pushModule - "pandoc.mediabag" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError MediaBag.pushModule - "pandoc.path" -> pushWrappedHsFun - (Lua.NumResults 1 <$ Lua.pushModule @PandocError Path.documentedModule) - "pandoc.system" -> pushWrappedHsFun $ Lua.toHaskellFunction System.pushModule - "pandoc.types" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError Types.pushModule - "pandoc.utils" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError Utils.pushModule - "text" -> pushWrappedHsFun - (Lua.NumResults 1 <$ Lua.pushModule @PandocError Text.documentedModule) - "pandoc.List" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError (loadDefaultModule pkgName) + "pandoc.mediabag" -> pushModuleLoader MediaBag.documentedModule + "pandoc.path" -> pushModuleLoader Path.documentedModule + "pandoc.system" -> pushModuleLoader System.documentedModule + "pandoc.types" -> pushModuleLoader Types.documentedModule + "pandoc.utils" -> pushModuleLoader Utils.documentedModule + "text" -> pushModuleLoader Text.documentedModule + "pandoc.List" -> pushWrappedHsFun . Lua.toHaskellFunction @PandocError $ + loadDefaultModule pkgName _ -> reportPandocSearcherFailure where + pushModuleLoader mdl = liftPandocLua $ do + Lua.pushHaskellFunction $ + Lua.NumResults 1 <$ Lua.pushModule @PandocError mdl + return (Lua.NumResults 1) pushWrappedHsFun f = liftPandocLua $ do Lua.pushHaskellFunction f return 1 reportPandocSearcherFailure = liftPandocLua $ do Lua.push ("\n\t" <> pkgName <> "is not one of pandoc's default packages") - return (1 :: NumResults) + return (Lua.NumResults 1) diff --git a/src/Text/Pandoc/Lua/PandocLua.hs b/src/Text/Pandoc/Lua/PandocLua.hs index 12511d088..6c2ebc622 100644 --- a/src/Text/Pandoc/Lua/PandocLua.hs +++ b/src/Text/Pandoc/Lua/PandocLua.hs @@ -22,7 +22,6 @@ module Text.Pandoc.Lua.PandocLua ( PandocLua (..) , runPandocLua , liftPandocLua - , addFunction , loadDefaultModule ) where @@ -76,13 +75,6 @@ instance {-# OVERLAPPING #-} Exposable PandocError (PandocLua NumResults) where instance Pushable a => Exposable PandocError (PandocLua a) where partialApply _narg x = 1 <$ (unPandocLua x >>= Lua.push) --- | Add a function to the table at the top of the stack, using the given name. -addFunction :: Exposable PandocError a => Name -> a -> PandocLua () -addFunction name fn = liftPandocLua $ do - Lua.pushName name - Lua.pushHaskellFunction $ toHaskellFunction fn - Lua.rawset (-3) - -- | Load a pure Lua module included with pandoc. Leaves the result on -- the stack and returns @NumResults 1@. -- diff --git a/src/Text/Pandoc/Lua/Util.hs b/src/Text/Pandoc/Lua/Util.hs index f20bc09e8..f35201db0 100644 --- a/src/Text/Pandoc/Lua/Util.hs +++ b/src/Text/Pandoc/Lua/Util.hs @@ -18,7 +18,6 @@ Lua utility functions. module Text.Pandoc.Lua.Util ( getTag , addField - , addFunction , callWithTraceback , dofileWithTraceback , pushViaConstr' @@ -35,14 +34,6 @@ addField key value = do Lua.push value Lua.rawset (Lua.nth 3) --- | Add a function to the table at the top of the stack, using the --- given name. -addFunction :: Exposable e a => String -> a -> LuaE e () -addFunction name fn = do - Lua.push name - Lua.pushHaskellFunction $ toHaskellFunction fn - Lua.rawset (-3) - -- | Get the tag of a value. This is an optimized and specialized version of -- @Lua.getfield idx "tag"@. It only checks for the field on the table at index -- @idx@ and on its metatable, also ignoring any @__index@ value on the diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 72446db99..6e8257633 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -408,6 +408,12 @@ return { }) assert.are_same(expected, pandoc.read(valid_markdown)) end), + test('unsupported extension', function () + assert.error_matches( + function () pandoc.read('foo', 'gfm+empty_paragraphs') end, + 'Extension empty_paragraphs not supported for gfm' + ) + end), test('failing read', function () assert.error_matches( function () pandoc.read('foo', 'nosuchreader') end, -- cgit v1.2.3 From 6509ff62043b6445098cc9c94628fab464638f62 Mon Sep 17 00:00:00 2001 From: Tristan Stenner Date: Tue, 26 Oct 2021 15:03:12 +0200 Subject: Docx writer: move ": " out of the caption bookmark. This is needed so that native references to the figure are included as "As seen in Figure X, it is..." instead of "As seen in [Figure: , it is..." --- src/Text/Pandoc/Writers/Docx.hs | 3 +-- src/Text/Pandoc/Writers/Docx/Table.hs | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index fccbb0719..ce7133f33 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -880,8 +880,7 @@ blockToOpenXML' opts (SimpleFigure attr@(imgident, _, _) alt (src, tit)) = do (" " \\* ARABIC \">" <> tshow fignum - <> ""), - Str ":", Space] : alt + <> "")] : Str ": " : alt else alt return $ Elem (mknode "w:p" [] (map Elem paraProps ++ contents)) diff --git a/src/Text/Pandoc/Writers/Docx/Table.hs b/src/Text/Pandoc/Writers/Docx/Table.hs index e23856f28..4dc4ad6a2 100644 --- a/src/Text/Pandoc/Writers/Docx/Table.hs +++ b/src/Text/Pandoc/Writers/Docx/Table.hs @@ -98,8 +98,8 @@ tableToOpenXML opts blocksToOpenXML gridTable = do addLabel :: Text -> Text -> Int -> [Block] -> [Block] addLabel tableid tablename tablenum bs = case bs of - (Para ils : rest) -> Para (label : Space : ils) : rest - (Plain ils : rest) -> Plain (label : Space : ils) : rest + (Para ils : rest) -> Para (label : Str ": " : ils) : rest + (Plain ils : rest) -> Plain (label : Str ": " : ils) : rest _ -> Para [label] : bs where label = Span (tableid,[],[]) @@ -108,8 +108,7 @@ addLabel tableid tablename tablenum bs = (" " \\* ARABIC \">" <> tshow tablenum - <> ""), - Str ":"] + <> "")] -- | Parts of a table data RowType = HeadRow | BodyRow | FootRow -- cgit v1.2.3 From 31d6a494de232b6fa5e579f2b71ce41f9c184df3 Mon Sep 17 00:00:00 2001 From: Tristan Stenner Date: Wed, 27 Oct 2021 10:36:53 +0200 Subject: Update test golden master for docx native numbering --- test/docx/golden/image.docx | Bin 26816 -> 26814 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/test/docx/golden/image.docx b/test/docx/golden/image.docx index 4e61790a5..9a50d7c0c 100644 Binary files a/test/docx/golden/image.docx and b/test/docx/golden/image.docx differ -- cgit v1.2.3 From 2444cbc668eb6deaa3a1ce71dac682fab68b0aae Mon Sep 17 00:00:00 2001 From: Tristan Stenner Date: Wed, 27 Oct 2021 15:21:45 +0200 Subject: Docx writer: add IDs to native_numbering test --- test/docx/golden/image.docx | Bin 26814 -> 26861 bytes test/docx/image_writer_test.native | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/docx/golden/image.docx b/test/docx/golden/image.docx index 9a50d7c0c..099f705e4 100644 Binary files a/test/docx/golden/image.docx and b/test/docx/golden/image.docx differ diff --git a/test/docx/image_writer_test.native b/test/docx/image_writer_test.native index a0fb3ee3a..8d3bac1ee 100644 --- a/test/docx/image_writer_test.native +++ b/test/docx/image_writer_test.native @@ -1,8 +1,10 @@ [Para [Str "No",Space,Str "width",Space,Str "given:"] -,Para [Image ("",[],[]) [Str "testimg"] ("lalune.jpg","fig:")] +,Para [Image ("fig:testimg",[],[]) [Str "testimg"] ("lalune.jpg","fig:")] ,Para [Str "With",Space,Str "height",Space,Str "10cm:"] -,Para [Image ("",[],[("height","10cm")]) [Str "2testimg"] ("lalune.jpg","fig:")] +,Para [Image ("fig:2testimg",[],[("height","10cm")]) [Str "2testimg"] ("lalune.jpg","fig:")] ,Para [Str "With",Space,Str "width",Space,Str "6cm:"] ,Para [Image ("",[],[("width","6cm")]) [Str "3testimg"] ("lalune.jpg","fig:")] ,Header 1 ("with-height-3in-and-width-6in",[],[]) [Str "With",Space,Str "height",Space,Str "3in",Space,Str "and",Space,Str "width",Space,Str "6in:"] -,Para [Image ("",[],[("width","6in"),("height","3in")]) [Str "4testimg"] ("lalune.jpg","fig:")]] \ No newline at end of file +,Para [Image ("",[],[("width","6in"),("height","3in")]) [Str "4testimg"] ("lalune.jpg","fig:")] +,Para [RawInline (Format "openxml") ""] +,Para [RawInline (Format "openxml") ""]] -- cgit v1.2.3 From 2894c10b28634daef14d6f061c828d5994a78bfe Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 29 Oct 2021 09:50:15 -0700 Subject: Fix trypandoc so it builds with aeson > 2. --- trypandoc/trypandoc.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trypandoc/trypandoc.hs b/trypandoc/trypandoc.hs index f2cc499c3..5a3432ffe 100644 --- a/trypandoc/trypandoc.hs +++ b/trypandoc/trypandoc.hs @@ -52,12 +52,12 @@ app req respond = do let result = case runPure $ reader (tabFilter 4 text) >>= writer of Right s -> s Left err -> error (show err) - let output = encode $ object [ T.pack "html" .= result - , T.pack "name" .= + let output = encode $ object [ "html" .= result + , "name" .= if fromFormat == "markdown_strict" then T.pack "pandoc (strict)" else T.pack "pandoc" - , T.pack "version" .= pandocVersion] + , "version" .= pandocVersion] respond $ responseLBS status200 [(hContentType,"text/json; charset=UTF-8")] output checkLength :: Text -> IO Text -- cgit v1.2.3 From b3d09ebe0198d1174f4109f4e535c6eac9cf917a Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Sat, 30 Oct 2021 13:00:29 -0400 Subject: Fix build on GHC 9.2 --- src/Text/Pandoc/Lua/Marshaling/List.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Text/Pandoc/Lua/Marshaling/List.hs b/src/Text/Pandoc/Lua/Marshaling/List.hs index 57ccd4501..0b145d3a1 100644 --- a/src/Text/Pandoc/Lua/Marshaling/List.hs +++ b/src/Text/Pandoc/Lua/Marshaling/List.hs @@ -1,5 +1,6 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE UndecidableInstances #-} -- cgit v1.2.3 From 621397f42e3388a50451f81eed3ec43bbffca99b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 30 Oct 2021 23:48:06 -0700 Subject: Allow time 1.13 --- pandoc.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index f2a66b200..63b2a5dad 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -581,7 +581,7 @@ library texmath >= 0.12.3.2 && < 0.12.4, text >= 1.1.1.0 && < 1.3, text-conversions >= 0.3 && < 0.4, - time >= 1.5 && < 1.13, + time >= 1.5 && < 1.14, unicode-collation >= 0.1.1 && < 0.2, unicode-transforms >= 0.3 && < 0.4, xml >= 1.3.12 && < 1.4, @@ -858,7 +858,7 @@ test-suite test-pandoc tasty-lua >= 1.0 && < 1.1, tasty-quickcheck >= 0.8 && < 0.11, text >= 1.1.1.0 && < 1.3, - time >= 1.5 && < 1.13, + time >= 1.5 && < 1.14, xml >= 1.3.12 && < 1.4, zip-archive >= 0.2.3.4 && < 0.5 other-modules: Tests.Old -- cgit v1.2.3 From 40655b54a2273371c77230dfe835e8789c06d409 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 31 Oct 2021 00:01:03 -0700 Subject: Bump to 2.16, update changelog. --- MANUAL.txt | 2 +- changelog.md | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pandoc.cabal | 2 +- 3 files changed, 92 insertions(+), 2 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 887276a58..5cf94cb4a 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1,7 +1,7 @@ --- title: Pandoc User's Guide author: John MacFarlane -date: October 22, 2021 +date: October 30, 2021 --- # Synopsis diff --git a/changelog.md b/changelog.md index 12ee4b3a0..4f103c9ae 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,95 @@ # Revision history for pandoc +## pandoc 2.16 (2021-10-31) + + * Switch back from HsYAML to yaml for parsing YAML metadata (#6084). + HsYAML is around 20 times slower in parsing large YAML bibliographies. + In addition, HsYAML is not being actively maintained. This sets us back + in our attempts to free ourselves from C dependencies (#4535). But I + don't see a good alternative until a faster pure Haskell parser is available. + Notes: + + + We've removed the FromYAML instances for all types that had them, since + this is a HsYAML-specific typeclass [API change]. (The yaml package just + uses From/ToJSON instead of having a dedicated From/ToYAML class.) + + Unlike HsYAML (in the configuration we were using), yaml parses 'Y', 'N', + 'Yes', 'No', 'On', 'Off' as boolean values. Users may need to quote these + when they are meant to be interpreted as strings. Similarly, 'null' is + parsed as a YAML null value (and will be treated as an empty string by + pandoc rather than the string 'null'). Quoting it will force it to be + interpreted as a string. + + Some tests had to be adjusted accordingly. + + Pandoc now behaves in a more useful way when the YAML metadata contains + escaping errors: instead of just failng silently and falling back to + some other interpretation of the section, it raises a YAML parsing error. + + * Markdown writer: Ensure that special values are quoted in YAML metadata. + These include "Y", "yes", "on", and "off", which are now (with yaml library) + considered boolean values, as well as "null". + + * Change JSON encodings of some types. + + + For LineEnding use lowercase constructors, e.g. `crlf`, `native`. + + For HTMLSlideVariant use lowercase constructors. + + For ReaderOptions use e.g. `default-image-extension` + instead of `readerDefaultImageExtension` for field names. + + For Extension, use e.g. `tex_math_dollars` instead of + `Ext_tex_math_dollars` as constructor. + + For Extensions, use an array of Extensions, instead of + an object wrapping the tag `Extensions` and an integer. + (The integer representation is not supposed to be part of the + public API.) + + For Opt, use field names like `tab-stop` instead of `optTabStop`. + + * Docx writer: + + + Add IDs to native_numbering test (Tristan Stenner). + + Move ": " out of the caption bookmark (Tristan Stenner). + This is needed so that native references to the figure are included as + "As seen in Figure X, it is..." instead of "As seen in [Figure: X, it is..." + + * Lua (Albert Krewinkel, except as noted): + + + Use hslua module abstraction where possible. + + Fix placement of tests for Block elements in pandoc module tests + + Increase strictness when getting attribute keys + + Re-add `t` and `tag` property to Attr values. + Removal of these properties from Attr values was a regression. + + Fix `pandoc.utils.stringify` regression. The `pandoc.utils.stringify` + function returned empty strings when called with a string argument. + + Fix a copy/paste bug in Lua marshalling code (John MacFarlane, #7639). + This caused links to be changed to figures when Lua filters changed + link properties. + + Generate constants in module pandoc programmatically. + + Marshal SimpleTable, ListAttributes, Citation, and Block values as + userdata objects. Properties of Block values are marshalled lazily, + which generally improves performance considerably. Script users may also + notice the following differences: + + - Block element properties can no longer be accessed by numerical + indexing of the `.c` field. The `.c` property now serves as an alias + for `.content`, so some filter that used this undocumented method + for property access may continue to work, while others will need to + be updated and use proper property names. + - The marshalled Block elements now have a `show` method, and a + `__tostring` metamethod. Both return the Haskell string + representation of the element. + - Block values now have the Lua type `userdata` instead of `table`. + + * Add a short guide to pandoc's sources (Albert Krewinkel). + + * Fix epub files in epub reader tests, so that they are valid + according to epubcheck (#7586). + + * Allow time 1.13. + + * Require latest skylighting (0.12.1). + + * Fix build on GHC 9.2 (Joseph C. Sible). + + * Fix trypandoc so it builds with aeson > 2. + + ## pandoc 2.15 (2021-10-23) * Add `--sandbox` option (#5045). diff --git a/pandoc.cabal b/pandoc.cabal index 63b2a5dad..6fa36f9e7 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: pandoc -version: 2.15 +version: 2.16 build-type: Simple license: GPL-2.0-or-later license-file: COPYING.md -- cgit v1.2.3 From 3de8f4fdc552c7ba103ec30ef79ea42ec674a8cc Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 31 Oct 2021 11:12:53 +0100 Subject: Lua: re-add `content` property to Link elements This was a regression introduced in version 2.15. Fixes: #7647 --- src/Text/Pandoc/Lua/Marshaling/AST.hs | 2 ++ test/lua/module/pandoc.lua | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index aabc9e530..07b11b3ea 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -608,6 +608,7 @@ setInlineContent = \case -- inline content Cite cs _ -> Actual . Cite cs . inlineContent Emph _ -> Actual . Emph . inlineContent + Link a _ tgt -> Actual . (\inlns -> Link a inlns tgt) . inlineContent Quoted qt _ -> Actual . Quoted qt . inlineContent SmallCaps _ -> Actual . SmallCaps . inlineContent Span attr _ -> Actual . Span attr . inlineContent @@ -633,6 +634,7 @@ getInlineContent :: Inline -> Possible Content getInlineContent = \case Cite _ inlns -> Actual $ ContentInlines inlns Emph inlns -> Actual $ ContentInlines inlns + Link _ inlns _ -> Actual $ ContentInlines inlns Quoted _ inlns -> Actual $ ContentInlines inlns SmallCaps inlns -> Actual $ ContentInlines inlns Span _ inlns -> Actual $ ContentInlines inlns diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 6e8257633..b18a01faa 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -148,6 +148,16 @@ return { end) } }, + group "Inline elements" { + test('Link has property `content`', function () + local link = pandoc.Link('example', 'https://example.org') + assert.are_same(link.content, {pandoc.Str 'example'}) + + link.content = 'commercial' + link.target = 'https://example.com' + assert.are_equal(link, pandoc.Link('commercial', 'https://example.com')) + end) + }, group "Block elements" { group "BulletList" { test('access items via property `content`', function () -- cgit v1.2.3 From d4058468735f6acb7badbb09e682f454b4763768 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 31 Oct 2021 09:39:56 -0700 Subject: Regenerate man page. --- man/pandoc.1 | 125 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 68 insertions(+), 57 deletions(-) diff --git a/man/pandoc.1 b/man/pandoc.1 index 0cec5d967..e8f455e57 100644 --- a/man/pandoc.1 +++ b/man/pandoc.1 @@ -1,7 +1,7 @@ '\" t -.\" Automatically generated by Pandoc 2.14.2 +.\" Automatically generated by Pandoc 2.16 .\" -.TH "Pandoc User\[cq]s Guide" "" "October 22, 2021" "pandoc 2.15" "" +.TH "Pandoc User\[cq]s Guide" "" "October 30, 2021" "pandoc 2.16" "" .hy .SH NAME pandoc - general markup converter @@ -554,13 +554,14 @@ Markdown documents that use level-1 headings for sections to HTML, since pandoc uses a level-1 heading to render the document title. .TP \f[B]\f[CB]--base-header-level=\f[B]\f[R]\f[I]NUMBER\f[R] -\f[I]Deprecated. Use \f[CI]--shift-heading-level-by\f[I]=X instead, -where X = NUMBER - 1.\f[R] Specify the base level for headings (defaults -to 1). +\f[I]Deprecated. +Use \f[CI]--shift-heading-level-by\f[I]=X instead, where X = NUMBER - +1.\f[R] Specify the base level for headings (defaults to 1). .TP \f[B]\f[CB]--strip-empty-paragraphs\f[B]\f[R] -\f[I]Deprecated. Use the \f[CI]+empty_paragraphs\f[I] extension -instead.\f[R] Ignore paragraphs with no content. +\f[I]Deprecated. +Use the \f[CI]+empty_paragraphs\f[I] extension instead.\f[R] Ignore +paragraphs with no content. This option is useful for converting word processing documents where users have used empty paragraphs to create inter-paragraph space. .TP @@ -776,8 +777,8 @@ Anyone using pandoc on untrusted user input should use this option. .TP \f[B]\f[CB]-D\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--print-default-template=\f[B]\f[R]\f[I]FORMAT\f[R] Print the system default template for an output \f[I]FORMAT\f[R]. -(See \f[C]-t\f[R] for a list of possible \f[I]FORMAT\f[R]s.) Templates -in the user data directory are ignored. +(See \f[C]-t\f[R] for a list of possible \f[I]FORMAT\f[R]s.) +Templates in the user data directory are ignored. This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before \f[C]--print-default-template\f[R] on the command line. @@ -805,8 +806,8 @@ The default is \f[C]native\f[R]. \f[B]\f[CB]--dpi\f[B]\f[R]=\f[I]NUMBER\f[R] Specify the default dpi (dots per inch) value for conversion from pixels to inch/centimeters and vice versa. -(Technically, the correct term would be ppi: pixels per inch.) The -default is 96dpi. +(Technically, the correct term would be ppi: pixels per inch.) +The default is 96dpi. When images contain information about dpi internally, the encoded value is used instead of the default specified by this option. .TP @@ -1012,8 +1013,8 @@ Currently this option only affects the \f[C]markdown\f[R], \f[B]\f[CB]--markdown-headings=setext\f[B]\f[R]|\f[B]\f[CB]atx\f[B]\f[R] Specify whether to use ATX-style (\f[C]#\f[R]-prefixed) or Setext-style (underlined) headings for level 1 and 2 headings in Markdown output. -(The default is \f[C]atx\f[R].) ATX-style headings are always used for -levels 3+. +(The default is \f[C]atx\f[R].) +ATX-style headings are always used for levels 3+. This option also affects Markdown cells in \f[C]ipynb\f[R] output. .TP \f[B]\f[CB]--atx-headers\f[B]\f[R] @@ -1433,10 +1434,11 @@ list of citations in CSL YAML format with Markdown formatting. The style is controlled by a CSL stylesheet specified using the \f[C]--csl\f[R] option or the \f[C]csl\f[R] field in metadata. (If no stylesheet is specified, the \f[C]chicago-author-date\f[R] style -will be used by default.) The citation processing transformation may be -applied before or after filters or Lua filters (see \f[C]--filter\f[R], -\f[C]--lua-filter\f[R]): these transformations are applied in the order -they appear on the command line. +will be used by default.) +The citation processing transformation may be applied before or after +filters or Lua filters (see \f[C]--filter\f[R], \f[C]--lua-filter\f[R]): +these transformations are applied in the order they appear on the +command line. For more information, see the section on Citations. .TP \f[B]\f[CB]--bibliography=\f[B]\f[R]\f[I]FILE\f[R] @@ -1451,8 +1453,8 @@ will be sought in the resource path (see \f[C]--resource-path\f[R]). \f[B]\f[CB]--csl=\f[B]\f[R]\f[I]FILE\f[R] Set the \f[C]csl\f[R] field in the document\[cq]s metadata to \f[I]FILE\f[R], overriding any value set in the metadata. -(This is equivalent to \f[C]--metadata csl=FILE\f[R].) If \f[I]FILE\f[R] -is a URL, it will be fetched via HTTP. +(This is equivalent to \f[C]--metadata csl=FILE\f[R].) +If \f[I]FILE\f[R] is a URL, it will be fetched via HTTP. If \f[I]FILE\f[R] is not found relative to the working directory, it will be sought in the resource path (see \f[C]--resource-path\f[R]) and finally in the \f[C]csl\f[R] subdirectory of the pandoc user data @@ -1462,8 +1464,8 @@ directory. Set the \f[C]citation-abbreviations\f[R] field in the document\[cq]s metadata to \f[I]FILE\f[R], overriding any value set in the metadata. (This is equivalent to -\f[C]--metadata citation-abbreviations=FILE\f[R].) If \f[I]FILE\f[R] is -a URL, it will be fetched via HTTP. +\f[C]--metadata citation-abbreviations=FILE\f[R].) +If \f[I]FILE\f[R] is a URL, it will be fetched via HTTP. If \f[I]FILE\f[R] is not found relative to the working directory, it will be sought in the resource path (see \f[C]--resource-path\f[R]) and finally in the \f[C]csl\f[R] subdirectory of the pandoc user data @@ -2451,8 +2453,9 @@ including a title block in the document itself, you can set the \f[C]title-meta\f[R], \f[C]author-meta\f[R], and \f[C]date-meta\f[R] variables. (By default these are set automatically, based on \f[C]title\f[R], -\f[C]author\f[R], and \f[C]date\f[R].) The page title in HTML is set by -\f[C]pagetitle\f[R], which is equal to \f[C]title\f[R] by default. +\f[C]author\f[R], and \f[C]date\f[R].) +The page title in HTML is set by \f[C]pagetitle\f[R], which is equal to +\f[C]title\f[R] by default. .RE .TP \f[B]\f[CB]subtitle\f[B]\f[R] @@ -3148,8 +3151,9 @@ without footnotes or pipe tables. The markdown reader and writer make by far the most use of extensions. Extensions only used by them are therefore covered in the section Pandoc\[cq]s Markdown below (See Markdown variants for -\f[C]commonmark\f[R] and \f[C]gfm\f[R].) In the following, extensions -that also work for other formats are covered. +\f[C]commonmark\f[R] and \f[C]gfm\f[R].) +In the following, extensions that also work for other formats are +covered. .PP Note that markdown extensions added to the \f[C]ipynb\f[R] format affect Markdown cells in Jupyter notebooks (as do command-line options like @@ -3932,8 +3936,8 @@ LaTeX, Docx, Ms, and PowerPoint. If highlighting is supported for your output format and language, then the code block above will appear highlighted, with numbered lines. (To see which languages are supported, type -\f[C]pandoc --list-highlight-languages\f[R].) Otherwise, the code block -above will appear as follows: +\f[C]pandoc --list-highlight-languages\f[R].) +Otherwise, the code block above will appear as follows: .IP .nf \f[C] @@ -4365,7 +4369,8 @@ What if you want to put an indented code block after a list? \f[R] .fi .PP -Trouble! Here pandoc (like other Markdown implementations) will treat +Trouble! +Here pandoc (like other Markdown implementations) will treat \f[C]{ my code block }\f[R] as the second paragraph of item two, and not as a code block. .PP @@ -4645,9 +4650,10 @@ full text width and the cell contents will wrap, with the relative cell widths determined by the number of dashes in the line separating the table header from the table body. (For example \f[C]---|-\f[R] would make the first column 3/4 and the -second column 1/4 of the full text width.) On the other hand, if no -lines are wider than column width, then cell contents will not be -wrapped, and the cells will be sized to their contents. +second column 1/4 of the full text width.) +On the other hand, if no lines are wider than column width, then cell +contents will not be wrapped, and the cells will be sized to their +contents. .PP Note: pandoc also recognizes pipe tables of the following form, as can be produced by Emacs\[cq] orgtbl-mode: @@ -4680,8 +4686,9 @@ If the file begins with a title block .PP it will be parsed as bibliographic information, not regular text. (It will be used, for example, in the title of standalone LaTeX or HTML -output.) The block may contain just a title, a title and an author, or -all three elements. +output.) +The block may contain just a title, a title and an author, or all three +elements. If you want to include an author but no title, or a title and a date but no author, you need a blank line: .IP @@ -4804,8 +4811,8 @@ pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html .fi .PP Just be sure that the YAML file begins with \f[C]---\f[R] and ends with -\f[C]---\f[R] or \f[C]...\f[R].) Alternatively, you can use the -\f[C]--metadata-file\f[R] option. +\f[C]---\f[R] or \f[C]...\f[R].) +Alternatively, you can use the \f[C]--metadata-file\f[R] option. Using that approach however, you cannot reference content (like footnotes) from the main markdown input document. .PP @@ -4814,10 +4821,10 @@ any 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.) Field names must not -be interpretable as YAML numbers or boolean values (so, for example, -\f[C]yes\f[R], \f[C]True\f[R], and \f[C]15\f[R] cannot be used as field -names). +(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[R], \f[C]True\f[R], and \f[C]15\f[R] cannot +be used as field names). .PP A document may contain multiple metadata blocks. If two metadata blocks attempt to set the same field, the value from the @@ -5077,9 +5084,9 @@ If the superscripted or subscripted text contains spaces, these spaces must be escaped with backslashes. (This is to prevent accidental superscripting and subscripting through the ordinary use of \f[C]\[ti]\f[R] and \f[C]\[ha]\f[R], and also bad -interactions with footnotes.) Thus, if you want the letter P with `a -cat' in subscripts, use \f[C]P\[ti]a\[rs] cat\[ti]\f[R], not -\f[C]P\[ti]a cat\[ti]\f[R]. +interactions with footnotes.) +Thus, if you want the letter P with `a cat' in subscripts, use +\f[C]P\[ti]a\[rs] cat\[ti]\f[R], not \f[C]P\[ti]a cat\[ti]\f[R]. .SS Verbatim .PP To make a short span of text verbatim, put it inside backticks: @@ -5503,10 +5510,10 @@ before or after the link). The link consists of link text in square brackets, followed by a label in square brackets. (There cannot be space between the two unless the -\f[C]spaced_reference_links\f[R] extension is enabled.) The link -definition consists of the bracketed label, followed by a colon and a -space, followed by the URL, and optionally (after a space) a link title -either in quotes or in parentheses. +\f[C]spaced_reference_links\f[R] extension is enabled.) +The link definition consists of the bracketed label, followed by a colon +and a space, followed by the URL, and optionally (after a space) a link +title either in quotes or in parentheses. The label must not be parseable as a citation (assuming the \f[C]citations\f[R] extension is enabled): citations take precedence over link labels. @@ -6516,8 +6523,9 @@ These files are specified using the \f[C]--csl\f[R] option or the By default, pandoc will use the Chicago Manual of Style author-date format. (You can override this default by copying a CSL style of your choice to -\f[C]default.csl\f[R] in your user data directory.) The CSL project -provides further information on finding and editing styles. +\f[C]default.csl\f[R] in your user data directory.) +The CSL project provides further information on finding and editing +styles. .PP The \f[C]--citation-abbreviations\f[R] option (or the \f[C]citation-abbreviations\f[R] metadata field) may be used to specify @@ -6564,7 +6572,8 @@ Normal citations in footnotes (such as \f[C][\[at]foo, p. 33]\f[R]) will be rendered in parentheses. In-text citations (such as \f[C]\[at]foo [p. 33]\f[R]) will be rendered without parentheses. -(A comma will be added if appropriate.) Thus: +(A comma will be added if appropriate.) +Thus: .IP .nf \f[C] @@ -6677,7 +6686,8 @@ If true, DOIs, PMCIDs, PMID, and URLs in bibliographies will be rendered as hyperlinks. (If an entry contains a DOI, PMCID, PMID, or URL, but none of these fields are rendered by the style, then the title, or in the absence of a -title the whole entry, will be hyperlinked.) Defaults to true. +title the whole entry, will be hyperlinked.) +Defaults to true. .TP \f[B]\f[CB]lang\f[B]\f[R] The \f[C]lang\f[R] field will affect how the style is localized, for @@ -6780,9 +6790,9 @@ files, which are assumed to be available at the relative path \f[C]w3.org\f[R] (for Slidy). (These paths can be changed by setting the \f[C]slidy-url\f[R], \f[C]slideous-url\f[R], \f[C]revealjs-url\f[R], or \f[C]s5-url\f[R] -variables; see Variables for HTML slides, above.) For DZSlides, the -(relatively short) JavaScript and CSS are included in the file by -default. +variables; see Variables for HTML slides, above.) +For DZSlides, the (relatively short) JavaScript and CSS are included in +the file by default. .PP With all HTML slide formats, the \f[C]--self-contained\f[R] option can be used to produce a single file that contains all of the data necessary @@ -7258,8 +7268,8 @@ Same format as \f[C]creator\f[R]. .TP \f[B]\f[CB]date\f[B]\f[R] A string value in \f[C]YYYY-MM-DD\f[R] format. -(Only the year is necessary.) Pandoc will attempt to convert other -common date formats. +(Only the year is necessary.) +Pandoc will attempt to convert other common date formats. .TP \f[B]\f[CB]lang\f[B]\f[R] (or legacy: \f[B]\f[CB]language\f[B]\f[R]) A string value in BCP 47 format. @@ -7904,8 +7914,9 @@ sanitizer. Copyright 2006\[en]2021 John MacFarlane (jgm\[at]berkeley.edu). Released under the GPL, version 2 or greater. This software carries no warranty of any kind. -(See COPYRIGHT for full copyright and warranty notices.) For a full list -of contributors, see the file AUTHORS.md in the pandoc source code. +(See COPYRIGHT for full copyright and warranty notices.) +For a full list of contributors, see the file AUTHORS.md in the pandoc +source code. .PP The Pandoc source code and all documentation may be downloaded from . -- cgit v1.2.3 From a99269eef0bb29b86610eba1b3497077bbe04849 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 31 Oct 2021 09:58:39 -0700 Subject: Update changelog. --- changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.md b/changelog.md index 4f103c9ae..4c2207aca 100644 --- a/changelog.md +++ b/changelog.md @@ -60,6 +60,8 @@ + Fix a copy/paste bug in Lua marshalling code (John MacFarlane, #7639). This caused links to be changed to figures when Lua filters changed link properties. + + Re-add `content` property to Link elements (#7647). + This was a regression introduced in version 2.15. + Generate constants in module pandoc programmatically. + Marshal SimpleTable, ListAttributes, Citation, and Block values as userdata objects. Properties of Block values are marshalled lazily, -- cgit v1.2.3 From 64eb59a7a07975cde98cf648ed4746d1a9ccab93 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 31 Oct 2021 11:12:43 -0700 Subject: Makefile: remove man/pandoc.1 dependency for debpkg. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a880da12d..759bc7dca 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ check: checkdocs check-cabal checkdocs: ! grep -q -n -e "\t" MANUAL.txt changelog.md -debpkg: man/pandoc.1 +debpkg: docker run -v `pwd`:/mnt \ -v `pwd`/linux/artifacts:/artifacts \ --user $(id -u):$(id -g) \ -- cgit v1.2.3 From 171bfd3d652479dab18df4062e24fc7237005859 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 31 Oct 2021 13:17:57 -0700 Subject: Makefile: use --nonmoving-gc RTS option when running benchmarks. As recommended by tasty maintainers. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 759bc7dca..7f36d16e7 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ REVISION?=1 # For gauge: # BENCHARGS?=--small --ci=0.90 --match=pattern $(PATTERN) # For tasty-bench: -BENCHARGS?=--csv bench_$(TIMESTAMP).csv $(BASELINECMD) --timeout=6 +RTS -T -RTS $(if $(PATTERN),--pattern "$(PATTERN)",) +BENCHARGS?=--csv bench_$(TIMESTAMP).csv $(BASELINECMD) --timeout=6 +RTS -T --nonmoving-gc -RTS $(if $(PATTERN),--pattern "$(PATTERN)",) quick: stack install --ghc-options='$(GHCOPTS)' --system-ghc --flag 'pandoc:embed_data_files' --fast --test --test-arguments='-j4 --hide-successes --ansi-tricks=false $(TESTARGS)' -- cgit v1.2.3 From 96e76d4cd475fe479ae6fb36bd6feee1cc6ff39f Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 1 Nov 2021 08:14:44 +0100 Subject: Lua: restore List behavior of MetaList Fixes a regression introduced in 2.16 which had MetaList elements loose the `pandoc.List` properties. Fixes #7650 --- data/pandoc.lua | 1 + test/lua/module/pandoc.lua | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/data/pandoc.lua b/data/pandoc.lua index 1f4830858..d4bd955aa 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -55,6 +55,7 @@ local function create_accessor_behavior (tag) if k == "t" then return getmetatable(t)["tag"] end + return getmetatable(t)[k] end behavior.__pairs = function (t) return next, t diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index b18a01faa..4e0b5188e 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -278,6 +278,19 @@ return { end) }, }, + group 'MetaValue elements' { + test('MetaList elements behave like lists', function () + local metalist = pandoc.MetaList{} + assert.are_equal(type(metalist.insert), 'function') + assert.are_equal(type(metalist.remove), 'function') + end), + test('MetaList, MetaMap, MetaInlines, MetaBlocks have `t` tag', function () + assert.are_equal((pandoc.MetaList{}).t, 'MetaList') + assert.are_equal((pandoc.MetaMap{}).t, 'MetaMap') + assert.are_equal((pandoc.MetaInlines{}).t, 'MetaInlines') + assert.are_equal((pandoc.MetaBlocks{}).t, 'MetaBlocks') + end) + }, group 'Other types' { group 'SimpleTable' { test('can access properties', function () -- cgit v1.2.3 From 1c02145d934c58c3db4de64ed1e16128ecb54c69 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 1 Nov 2021 13:48:36 +0100 Subject: Lua: load module `pandoc.path` on startup Previously the module always had to be loaded via `require 'pandoc.path'`. Closes: #7524 --- data/pandoc.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/data/pandoc.lua b/data/pandoc.lua index d4bd955aa..7e5ff799b 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -27,6 +27,7 @@ local M = {} -- Re-export bundled modules M.List = require 'pandoc.List' M.mediabag = require 'pandoc.mediabag' +M.path = require 'pandoc.path' M.system = require 'pandoc.system' M.types = require 'pandoc.types' M.utils = require 'pandoc.utils' -- cgit v1.2.3 From 759aa5095101351bc2e4d2c4629df945b743e7db Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 1 Nov 2021 15:43:51 +0100 Subject: Lua: restore `content` property on Header elements --- src/Text/Pandoc/Lua/Marshaling/AST.hs | 2 ++ test/lua/module/pandoc.lua | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 07b11b3ea..883a6dce2 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -340,6 +340,7 @@ getBlockContent = \case -- inline content Para inlns -> Actual $ ContentInlines inlns Plain inlns -> Actual $ ContentInlines inlns + Header _ _ inlns -> Actual $ ContentInlines inlns -- inline content BlockQuote blks -> Actual $ ContentBlocks blks Div _ blks -> Actual $ ContentBlocks blks @@ -357,6 +358,7 @@ setBlockContent = \case -- inline content Para _ -> Actual . Para . inlineContent Plain _ -> Actual . Plain . inlineContent + Header attr lvl _ -> Actual . Header attr lvl . inlineContent -- block content BlockQuote _ -> Actual . BlockQuote . blockContent Div attr _ -> Actual . Div attr . blockContent diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 4e0b5188e..21a6de2de 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -245,6 +245,29 @@ return { ) end), }, + group 'Header' { + test('access inlines via property `content`', function () + local header = pandoc.Header(1, 'test') + assert.are_same(header.content, {pandoc.Str 'test'}) + + header.content = {'new text'} + assert.are_equal(header, pandoc.Header(1, 'new text')) + end), + test('access Attr via property `attr`', function () + local header = pandoc.Header(1, 'test', {'my-test'}) + assert.are_same(header.attr, pandoc.Attr{'my-test'}) + + header.attr = 'second-test' + assert.are_equal(header, pandoc.Header(1, 'test', 'second-test')) + end), + test('access level via property `level`', function () + local header = pandoc.Header(3, 'test') + assert.are_same(header.level, 3) + + header.level = 2 + assert.are_equal(header, pandoc.Header(2, 'test')) + end), + }, group 'LineBlock' { test('access lines via property `content`', function () local spc = pandoc.Space() -- cgit v1.2.3 From 3a0ac52f7b23b555a7eeb9e3df10536b809f95ac Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 2 Nov 2021 09:55:38 +0100 Subject: Lua tests: ensure Block elements have expected properties --- test/lua/module/pandoc.lua | 238 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 202 insertions(+), 36 deletions(-) diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 21a6de2de..a0b888c74 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -159,7 +159,26 @@ return { end) }, group "Block elements" { - group "BulletList" { + group 'BlockQuote' { + test('access content via property `content`', function () + local elem = pandoc.BlockQuote{'word'} + assert.are_same(elem.content, {pandoc.Plain 'word'}) + assert.are_equal(type(elem.content), 'table') + + elem.content = { + pandoc.Para{pandoc.Str 'one'}, + pandoc.Para{pandoc.Str 'two'} + } + assert.are_equal( + pandoc.BlockQuote{ + pandoc.Para 'one', + pandoc.Para 'two' + }, + elem + ) + end), + }, + group 'BulletList' { test('access items via property `content`', function () local para = pandoc.Para 'one' local blist = pandoc.BulletList{{para}} @@ -175,23 +194,25 @@ return { assert.are_same({{new}}, blist:clone().content) end), }, - group "OrderedList" { - test('access items via property `content`', function () - local para = pandoc.Plain 'one' - local olist = pandoc.OrderedList{{para}} - assert.are_same({{para}}, olist.content) - end), - test('forgiving constructor', function () - local plain = pandoc.Plain 'old' - local olist = pandoc.OrderedList({plain}, {3, 'Example', 'Period'}) - local listAttribs = pandoc.ListAttributes(3, 'Example', 'Period') - assert.are_same(olist.listAttributes, listAttribs) + group 'CodeBlock' { + test('access code via property `text`', function () + local cb = pandoc.CodeBlock('return true') + assert.are_equal(cb.text, 'return true') + assert.are_equal(type(cb.text), 'string') + + cb.text = 'return nil' + assert.are_equal(cb, pandoc.CodeBlock('return nil')) end), - test('has list attribute aliases', function () - local olist = pandoc.OrderedList({}, {4, 'Decimal', 'OneParen'}) - assert.are_equal(olist.start, 4) - assert.are_equal(olist.style, 'Decimal') - assert.are_equal(olist.delimiter, 'OneParen') + test('access Attr via property `attr`', function () + local cb = pandoc.CodeBlock('true', {'my-code', {'lua'}}) + assert.are_equal(cb.attr, pandoc.Attr{'my-code', {'lua'}}) + assert.are_equal(type(cb.attr), 'userdata') + + cb.attr = pandoc.Attr{'my-other-code', {'java'}} + assert.are_equal( + pandoc.CodeBlock('true', {'my-other-code', {'java'}}), + cb + ) end) }, group 'DefinitionList' { @@ -221,29 +242,35 @@ return { assert.are_equal(deflist, newlist) end), }, - group 'Para' { - test('access inline via property `content`', function () - local para = pandoc.Para{'Moin, ', pandoc.Space(), 'Sylt!'} - assert.are_same( - para.content, - {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} + group 'Div' { + test('access content via property `content`', function () + local elem = pandoc.Div{pandoc.BlockQuote{pandoc.Plain 'word'}} + assert.are_same(elem.content, {pandoc.BlockQuote{'word'}}) + assert.are_equal(type(elem.content), 'table') + + elem.content = { + pandoc.Para{pandoc.Str 'one'}, + pandoc.Para{pandoc.Str 'two'} + } + assert.are_equal( + pandoc.Div{ + pandoc.Para 'one', + pandoc.Para 'two' + }, + elem ) end), - test('modifying `content` changes the element', function () - local para = pandoc.Para{'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} + test('access Attr via property `attr`', function () + local div = pandoc.Div('word', {'my-div', {'sample'}}) + assert.are_equal(div.attr, pandoc.Attr{'my-div', {'sample'}}) + assert.are_equal(type(div.attr), 'userdata') - para.content[3] = 'Hamburg!' - assert.are_same( - para:clone().content, - {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Hamburg!'} + div.attr = pandoc.Attr{'my-other-div', {'example'}} + assert.are_equal( + pandoc.Div('word', {'my-other-div', {'example'}}), + div ) - - para.content = 'Huh' - assert.are_same( - para:clone().content, - {pandoc.Str 'Huh'} - ) - end), + end) }, group 'Header' { test('access inlines via property `content`', function () @@ -300,6 +327,139 @@ return { ) end) }, + group 'OrderedList' { + test('access items via property `content`', function () + local para = pandoc.Plain 'one' + local olist = pandoc.OrderedList{{para}} + assert.are_same({{para}}, olist.content) + end), + test('forgiving constructor', function () + local plain = pandoc.Plain 'old' + local olist = pandoc.OrderedList({plain}, {3, 'Example', 'Period'}) + local listAttribs = pandoc.ListAttributes(3, 'Example', 'Period') + assert.are_same(olist.listAttributes, listAttribs) + end), + test('has list attribute aliases', function () + local olist = pandoc.OrderedList({}, {4, 'Decimal', 'OneParen'}) + assert.are_equal(olist.start, 4) + assert.are_equal(olist.style, 'Decimal') + assert.are_equal(olist.delimiter, 'OneParen') + end) + }, + group 'Para' { + test('access inline via property `content`', function () + local para = pandoc.Para{'Moin, ', pandoc.Space(), 'Sylt!'} + assert.are_same( + para.content, + {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} + ) + end), + test('modifying `content` changes the element', function () + local para = pandoc.Para{'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} + + para.content[3] = 'Hamburg!' + assert.are_same( + para:clone().content, + {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Hamburg!'} + ) + + para.content = 'Huh' + assert.are_same( + para:clone().content, + {pandoc.Str 'Huh'} + ) + end), + }, + group 'RawBlock' { + test('access raw content via property `text`', function () + local raw = pandoc.RawBlock('markdown', '- one') + assert.are_equal(type(raw.text), 'string') + assert.are_equal(raw.text, '- one') + + raw.text = '+ one' + assert.are_equal(raw, pandoc.RawBlock('markdown', '+ one')) + end), + test('access Format via property `format`', function () + local raw = pandoc.RawBlock('markdown', '* hi') + assert.are_equal(type(raw.format), 'string') + assert.are_equal(raw.format, 'markdown') + + raw.format = 'org' + assert.are_equal(pandoc.RawBlock('org', '* hi'), raw) + end) + }, + group 'Table' { + test('access Attr via property `attr`', function () + local caption = {long = {pandoc.Plain 'cap'}} + local tbl = pandoc.Table(caption, {}, {{}, {}}, {}, {{}, {}}, + {'my-tbl', {'a'}}) + assert.are_equal(tbl.attr, pandoc.Attr{'my-tbl', {'a'}}) + + tbl.attr = pandoc.Attr{'my-other-tbl', {'b'}} + assert.are_equal( + pandoc.Table(caption, {}, {{}, {}}, {}, {{}, {}}, + {'my-other-tbl', {'b'}}), + tbl + ) + end), + test('access caption via property `caption`', function () + local caption = {long = {pandoc.Plain 'cap'}} + local tbl = pandoc.Table(caption, {}, {{}, {}}, {}, {{}, {}}) + assert.are_same(tbl.caption, {long = {pandoc.Plain 'cap'}}) + + tbl.caption.short = 'brief' + tbl.caption.long = {pandoc.Plain 'extended'} + + local new_caption = { + short = 'brief', + long = {pandoc.Plain 'extended'} + } + assert.are_equal( + pandoc.Table(new_caption, {}, {{}, {}}, {}, {{}, {}}), + tbl + ) + end), + test('access column specifiers via property `colspecs`', function () + local colspecs = {{pandoc.AlignCenter, 1}} + local tbl = pandoc.Table({long = {}}, colspecs, {{}, {}}, {}, {{}, {}}) + assert.are_same(tbl.colspecs, colspecs) + + tbl.colspecs[1][1] = pandoc.AlignRight + tbl.colspecs[1][2] = nil + + local new_colspecs = {{pandoc.AlignRight}} + assert.are_equal( + pandoc.Table({long = {}}, new_colspecs, {{}, {}}, {}, {{}, {}}), + tbl + ) + end), + test('access table head via property `head`', function () + local head = {pandoc.Attr{'tbl-head'}, {}} + local tbl = pandoc.Table({long = {}}, {}, head, {}, {{}, {}}) + assert.are_same(tbl.head, head) + + tbl.head[1] = pandoc.Attr{'table-head'} + + local new_head = {'table-head', {}} + assert.are_equal( + pandoc.Table({long = {}}, {}, new_head, {}, {{}, {}}), + tbl + ) + end), + test('access table head via property `head`', function () + local foot = {{id = 'tbl-foot'}, {}} + local tbl = pandoc.Table({long = {}}, {}, {{}, {}}, {}, foot) + assert.are_same(tbl.foot, {pandoc.Attr('tbl-foot'), {}}) + + tbl.foot[1] = pandoc.Attr{'table-foot'} + + local new_foot = {'table-foot', {}} + assert.are_equal( + pandoc.Table({long = {}}, {}, {{}, {}}, {}, new_foot), + tbl + ) + end) + }, }, group 'MetaValue elements' { test('MetaList elements behave like lists', function () @@ -312,6 +472,12 @@ return { assert.are_equal((pandoc.MetaMap{}).t, 'MetaMap') assert.are_equal((pandoc.MetaInlines{}).t, 'MetaInlines') assert.are_equal((pandoc.MetaBlocks{}).t, 'MetaBlocks') + end), + test('`tag` is an alias for `t``', function () + assert.are_equal((pandoc.MetaList{}).tag, (pandoc.MetaList{}).t) + assert.are_equal((pandoc.MetaMap{}).tag, (pandoc.MetaMap{}).t) + assert.are_equal((pandoc.MetaInlines{}).tag, (pandoc.MetaInlines{}).t) + assert.are_equal((pandoc.MetaBlocks{}).tag, (pandoc.MetaBlocks{}).t) end) }, group 'Other types' { -- cgit v1.2.3 From 210e4c98b0d09dd8e25c108dda14fdb17ba90192 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 2 Nov 2021 16:49:50 +0100 Subject: Lua: allow to compare, show Citation values Comparisons of Citation values are performed in Haskell; values are equal if they represent the same Haskell value. Converting a Citation value to a string now yields its native Haskell string representation. --- src/Text/Pandoc/Lua/Marshaling/AST.hs | 13 ++++++++++++- test/lua/module/pandoc.lua | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 883a6dce2..469dd4285 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -111,7 +111,18 @@ instance Pushable Block where push = pushBlock typeCitation :: LuaError e => DocumentedType e Citation -typeCitation = deftype "Citation" [] +typeCitation = deftype "Citation" + [ operation Eq $ lambda + ### liftPure2 (==) + <#> parameter (optional . peekCitation) "Citation" "a" "" + <#> parameter (optional . peekCitation) "Citation" "b" "" + =#> functionResult pushBool "boolean" "true iff the citations are equal" + + , operation Tostring $ lambda + ### liftPure show + <#> parameter peekCitation "Citation" "citation" "" + =#> functionResult pushString "string" "native Haskell representation" + ] [ property "id" "citation ID / key" (pushText, citationId) (peekText, \citation cid -> citation{ citationId = cid }) diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index a0b888c74..4792e0949 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -481,6 +481,22 @@ return { end) }, group 'Other types' { + group 'Citation' { + test('checks equality by comparing Haskell values', function() + assert.are_equal( + pandoc.Citation('a', pandoc.NormalCitation), + pandoc.Citation('a', pandoc.NormalCitation) + ) + assert.is_falsy( + pandoc.Citation('a', pandoc.NormalCitation) == + pandoc.Citation('a', pandoc.AuthorInText) + ) + assert.is_falsy( + pandoc.Citation('a', pandoc.NormalCitation) == + pandoc.Citation('b', pandoc.NormalCitation) + ) + end), + }, group 'SimpleTable' { test('can access properties', function () local spc = pandoc.Space() -- cgit v1.2.3 From c467f0fed109c362faa733c1a258a26bc6aba5cd Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 2 Nov 2021 17:21:29 +0100 Subject: Lua: allow omitting the 2nd parameter in pandoc.Code constructor Fixes a regression introduced in 2.15 which required users to always specify an Attr value when constructing a Code element. --- src/Text/Pandoc/Lua/Module/Pandoc.hs | 4 +- test/lua/module/pandoc.lua | 82 +++++++++++++++++++++++++++++++++--- 2 files changed, 77 insertions(+), 9 deletions(-) diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 6d1ccea04..f09159b4e 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -138,9 +138,9 @@ inlineConstructors = <#> parameter peekInlinesFuzzy "content" "Inline" "placeholder content" =#> functionResult pushInline "Inline" "cite element" , defun "Code" - ### liftPure2 (flip Code) + ### liftPure2 (\text mattr -> Code (fromMaybe nullAttr mattr) text) <#> parameter peekText "code" "string" "code string" - <#> parameter peekAttr "attr" "Attr" "additional attributes" + <#> optionalParameter peekAttr "attr" "Attr" "additional attributes" =#> functionResult pushInline "Inline" "code element" , mkInlinesConstr "Emph" Emph , defun "Image" diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 4792e0949..057d24202 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -149,14 +149,82 @@ return { } }, group "Inline elements" { - test('Link has property `content`', function () - local link = pandoc.Link('example', 'https://example.org') - assert.are_same(link.content, {pandoc.Str 'example'}) + group 'Cite' { + test('has property `content`', function () + local cite = pandoc.Cite({}, {pandoc.Emph 'important'}) + assert.are_same(cite.content, {pandoc.Emph {pandoc.Str 'important'}}) - link.content = 'commercial' - link.target = 'https://example.com' - assert.are_equal(link, pandoc.Link('commercial', 'https://example.com')) - end) + cite.content = 'boring' + assert.are_equal(cite, pandoc.Cite({}, {pandoc.Str 'boring'})) + end), + test('has list of citations in property `cite`', function () + local citations = { + pandoc.Citation('einstein1905', 'NormalCitation') + } + local cite = pandoc.Cite(citations, 'relativity') + assert.are_same(cite.citations, citations) + + local new_citations = { + citations[1], + pandoc.Citation('Poincaré1905', 'NormalCitation') + } + cite.citations = new_citations + assert.are_equal(cite, pandoc.Cite(new_citations, {'relativity'})) + end), + }, + group 'Code' { + test('has property `attr`', function () + local code = pandoc.Code('true', {id='true', foo='bar'}) + assert.are_equal(code.attr, pandoc.Attr('true', {}, {{'foo', 'bar'}})) + + code.attr = {id='t', fubar='quux'} + assert.are_equal( + pandoc.Code('true', pandoc.Attr('t', {}, {{'fubar', 'quux'}})), + code + ) + end), + test('has property `text`', function () + local code = pandoc.Code('true') + -- assert.are_equal(code.text, 'true') + + -- code.text = '1 + 1' + -- assert.are_equal(pandoc.Code('1 + 1'), code) + end), + }, + group 'Link' { + test('has property `content`', function () + local link = pandoc.Link('example', 'https://example.org') + assert.are_same(link.content, {pandoc.Str 'example'}) + + link.content = 'commercial' + link.target = 'https://example.com' + assert.are_equal(link, pandoc.Link('commercial', 'https://example.com')) + end), + test('has property `target`', function () + local link = pandoc.Link('example', 'https://example.org') + assert.are_same(link.content, {pandoc.Str 'example'}) + + link.target = 'https://example.com' + assert.are_equal(link, pandoc.Link('example', 'https://example.com')) + end), + test('has property `title`', function () + local link = pandoc.Link('here', 'https://example.org', 'example') + assert.are_same(link.title, 'example') + + link.title = 'a' + assert.are_equal(link, pandoc.Link('here', 'https://example.org', 'a')) + end), + test('has property `attr`', function () + local link = pandoc.Link('up', '../index.html', '', {'up', {'nav'}}) + assert.are_same(link.attr, pandoc.Attr {'up', {'nav'}}) + + link.attr = pandoc.Attr {'up', {'nav', 'button'}} + assert.are_equal( + pandoc.Link('up', '../index.html', nil, {'up', {'nav', 'button'}}), + link + ) + end) + } }, group "Block elements" { group 'BlockQuote' { -- cgit v1.2.3 From b26f950ccaa0a1a973b282a516bd80295536feb2 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 2 Nov 2021 17:25:47 +0100 Subject: Lua: display Attr values using their native Haskell representation --- src/Text/Pandoc/Lua/Marshaling/Attr.hs | 4 ++++ test/lua/module/pandoc.lua | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Lua/Marshaling/Attr.hs b/src/Text/Pandoc/Lua/Marshaling/Attr.hs index a38bc6ec7..97e702e35 100644 --- a/src/Text/Pandoc/Lua/Marshaling/Attr.hs +++ b/src/Text/Pandoc/Lua/Marshaling/Attr.hs @@ -42,6 +42,10 @@ typeAttr = deftype "Attr" <#> parameter peekAttr "a1" "Attr" "" <#> parameter peekAttr "a2" "Attr" "" =#> functionResult pushBool "boolean" "whether the two are equal" + , operation Tostring $ lambda + ### liftPure show + <#> parameter peekAttr "Attr" "attr" "" + =#> functionResult pushString "string" "native Haskell representation" ] [ property "identifier" "element identifier" (pushText, \(ident,_,_) -> ident) diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 057d24202..9f5f5c771 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -185,10 +185,10 @@ return { end), test('has property `text`', function () local code = pandoc.Code('true') - -- assert.are_equal(code.text, 'true') + assert.are_equal(code.text, 'true') - -- code.text = '1 + 1' - -- assert.are_equal(pandoc.Code('1 + 1'), code) + code.text = '1 + 1' + assert.are_equal(pandoc.Code('1 + 1'), code) end), }, group 'Link' { -- cgit v1.2.3 From 70eeeca9c7b399158f01c40ab2f6ef58bd76207f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 2 Nov 2021 09:28:03 -0700 Subject: Docx writer: use getTimestamp for modification times in reference.docx. This ensures that when `SOURCE_DATE_EPOCH` is set, the modification times of files taken from the reference.docx will be set deterministically, allowing for reproducible builds. Closes #7654. --- src/Text/Pandoc/Class/PandocMonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Class/PandocMonad.hs b/src/Text/Pandoc/Class/PandocMonad.hs index d3cf1201c..c15ce6444 100644 --- a/src/Text/Pandoc/Class/PandocMonad.hs +++ b/src/Text/Pandoc/Class/PandocMonad.hs @@ -454,7 +454,7 @@ getDefaultReferenceDocx = do "word/theme/theme1.xml"] let toLazy = BL.fromChunks . (:[]) let pathToEntry path = do - epochtime <- floor . utcTimeToPOSIXSeconds <$> getCurrentTime + epochtime <- floor . utcTimeToPOSIXSeconds <$> getTimestamp contents <- toLazy <$> readDataFile ("docx/" ++ path) return $ toEntry path epochtime contents datadir <- getUserDataDir -- cgit v1.2.3 From cce49c5d4b7429ca3455d356dff59f404f7e6d4b Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 2 Nov 2021 17:38:49 +0100 Subject: Lua: be more forgiving when retrieving the Image `caption` property Fixes a regression introduced in 2.15. --- src/Text/Pandoc/Lua/Marshaling/AST.hs | 2 +- test/lua/module/pandoc.lua | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 469dd4285..4363f7e4f 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -710,7 +710,7 @@ typeInline = deftype "Inline" (pushPandocList pushInline, \case Image _ capt _ -> Actual capt _ -> Absent) - (peekInlines, \case + (peekInlinesFuzzy, \case Image attr _ target -> Actual . (\capt -> Image attr capt target) _ -> const Absent) , possibleProperty "citations" "list of citations" diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 9f5f5c771..be1cbbde1 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -191,6 +191,15 @@ return { assert.are_equal(pandoc.Code('1 + 1'), code) end), }, + group 'Image' { + test('has property `caption`', function () + local img = pandoc.Image('example', 'a.png') + assert.are_same(img.caption, {pandoc.Str 'example'}) + + img.caption = {pandoc.Str 'A'} + assert.are_equal(img, pandoc.Image({pandoc.Str 'A'}, 'a.png')) + end), + }, group 'Link' { test('has property `content`', function () local link = pandoc.Link('example', 'https://example.org') -- cgit v1.2.3 From 421fd736d4ee11815f1b8acc123c1d0f9e9136c7 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 2 Nov 2021 21:22:59 +0100 Subject: Lua: re-add `content` property to Strikeout elements Fixes a regression introduced in 2.15. --- src/Text/Pandoc/Lua/Marshaling/AST.hs | 2 + test/lua/module/pandoc.lua | 96 +++++++++++++++++++++++++++++++++-- 2 files changed, 95 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 4363f7e4f..e73ff43b5 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -625,6 +625,7 @@ setInlineContent = \case Quoted qt _ -> Actual . Quoted qt . inlineContent SmallCaps _ -> Actual . SmallCaps . inlineContent Span attr _ -> Actual . Span attr . inlineContent + Strikeout _ -> Actual . Strikeout . inlineContent Strong _ -> Actual . Strong . inlineContent Subscript _ -> Actual . Subscript . inlineContent Superscript _ -> Actual . Superscript . inlineContent @@ -651,6 +652,7 @@ getInlineContent = \case Quoted _ inlns -> Actual $ ContentInlines inlns SmallCaps inlns -> Actual $ ContentInlines inlns Span _ inlns -> Actual $ ContentInlines inlns + Strikeout inlns -> Actual $ ContentInlines inlns Strong inlns -> Actual $ ContentInlines inlns Subscript inlns -> Actual $ ContentInlines inlns Superscript inlns -> Actual $ ContentInlines inlns diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index be1cbbde1..ba2b823f8 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -191,14 +191,49 @@ return { assert.are_equal(pandoc.Code('1 + 1'), code) end), }, + group 'Emph' { + test('has property `content`', function () + local elem = pandoc.Emph{'two', pandoc.Space(), 'words'} + assert.are_same( + elem.content, + {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} + ) + elem.content = {'word'} + assert.are_equal(elem, pandoc.Emph{'word'}) + end) + }, group 'Image' { test('has property `caption`', function () local img = pandoc.Image('example', 'a.png') assert.are_same(img.caption, {pandoc.Str 'example'}) - img.caption = {pandoc.Str 'A'} - assert.are_equal(img, pandoc.Image({pandoc.Str 'A'}, 'a.png')) + img.caption = 'A' + assert.are_equal(img, pandoc.Image({'A'}, 'a.png')) end), + test('has property `src`', function () + local img = pandoc.Image('example', 'sample.png') + assert.are_same(img.src, 'sample.png') + + img.src = 'example.svg' + assert.are_equal(img, pandoc.Image('example', 'example.svg')) + end), + test('has property `title`', function () + local img = pandoc.Image('here', 'img.gif', 'example') + assert.are_same(img.title, 'example') + + img.title = 'a' + assert.are_equal(img, pandoc.Image('here', 'img.gif', 'a')) + end), + test('has property `attr`', function () + local img = pandoc.Image('up', 'upwards.png', '', {'up', {'point'}}) + assert.are_same(img.attr, pandoc.Attr {'up', {'point'}}) + + img.attr = pandoc.Attr {'up', {'point', 'button'}} + assert.are_equal( + pandoc.Image('up', 'upwards.png', nil, {'up', {'point', 'button'}}), + img + ) + end) }, group 'Link' { test('has property `content`', function () @@ -233,7 +268,62 @@ return { link ) end) - } + }, + group 'Strikeout' { + test('has property `content`', function () + local elem = pandoc.Strikeout{'two', pandoc.Space(), 'words'} + assert.are_same( + elem.content, + {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} + ) + elem.content = {'word'} + assert.are_equal(elem, pandoc.Strikeout{'word'}) + end) + }, + group 'Strong' { + test('has property `content`', function () + local elem = pandoc.Strong{'two', pandoc.Space(), 'words'} + assert.are_same( + elem.content, + {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} + ) + elem.content = {'word'} + assert.are_equal(elem, pandoc.Strong{'word'}) + end) + }, + group 'Subscript' { + test('has property `content`', function () + local elem = pandoc.Subscript{'two', pandoc.Space(), 'words'} + assert.are_same( + elem.content, + {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} + ) + elem.content = {'word'} + assert.are_equal(elem, pandoc.Subscript{'word'}) + end) + }, + group 'Superscript' { + test('has property `content`', function () + local elem = pandoc.Superscript{'two', pandoc.Space(), 'words'} + assert.are_same( + elem.content, + {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} + ) + elem.content = {'word'} + assert.are_equal(elem, pandoc.Superscript{'word'}) + end) + }, + group 'Underline' { + test('has property `content`', function () + local elem = pandoc.Underline{'two', pandoc.Space(), 'words'} + assert.are_same( + elem.content, + {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} + ) + elem.content = {'word'} + assert.are_equal(elem, pandoc.Underline{'word'}) + end) + }, }, group "Block elements" { group 'BlockQuote' { -- cgit v1.2.3 From dbc654e4a7877dacf02c91ee9dcd567194682efa Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 2 Nov 2021 21:40:37 +0100 Subject: Lua tests: ensure Inline elements have all expected properties --- test/lua/module/pandoc.lua | 81 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index ba2b823f8..fac95d27f 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -269,6 +269,87 @@ return { ) end) }, + group 'Math' { + test('has property `text`', function () + local elem = pandoc.Math(pandoc.InlineMath, 'x^2') + assert.are_same(elem.text, 'x^2') + elem.text = 'a + b' + assert.are_equal(elem, pandoc.Math(pandoc.InlineMath, 'a + b')) + end), + test('has property `mathtype`', function () + local elem = pandoc.Math(pandoc.InlineMath, 'x^2') + assert.are_same(elem.mathtype, 'InlineMath') + elem.mathtype = pandoc.DisplayMath + assert.are_equal(elem, pandoc.Math(pandoc.DisplayMath, 'x^2')) + end), + }, + group 'Note' { + test('has property `content`', function () + local elem = pandoc.Note{pandoc.Para {'two', pandoc.Space(), 'words'}} + assert.are_same( + elem.content, + {pandoc.Para {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'}} + ) + elem.content = pandoc.Plain 'word' + assert.are_equal(elem, pandoc.Note{'word'}) + end) + }, + group 'Quoted' { + test('has property `content`', function () + local elem = pandoc.Quoted('SingleQuote', pandoc.Emph{'emph'}) + assert.are_same( + elem.content, + {pandoc.Emph{pandoc.Str 'emph'}} + ) + elem.content = {'word'} + assert.are_equal(elem, pandoc.Quoted(pandoc.SingleQuote, {'word'})) + end), + test('has property `quotetype`', function () + local elem = pandoc.Quoted('SingleQuote', 'a') + assert.are_same(elem.quotetype, pandoc.SingleQuote) + elem.quotetype = 'DoubleQuote' + assert.are_equal(elem, pandoc.Quoted(pandoc.DoubleQuote, {'a'})) + end) + }, + group 'SmallCaps' { + test('has property `content`', function () + local elem = pandoc.SmallCaps{'two', pandoc.Space(), 'words'} + assert.are_same( + elem.content, + {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} + ) + elem.content = {'word'} + assert.are_equal(elem, pandoc.SmallCaps{'word'}) + end) + }, + group 'Span' { + test('has property `attr`', function () + local elem = pandoc.Span('one', {'', {'number'}}) + assert.are_same( + elem.attr, + pandoc.Attr('', {'number'}) + ) + elem.attr = {'', {}, {{'a', 'b'}}} + assert.are_equal(elem, pandoc.Span({'one'}, {a='b'})) + end), + test('has property `content`', function () + local elem = pandoc.Span{'two', pandoc.Space(), 'words'} + assert.are_same( + elem.content, + {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} + ) + elem.content = {'word'} + assert.are_equal(elem, pandoc.Span{'word'}) + end) + }, + group 'Str' { + test('has property `text`', function () + local elem = pandoc.Str 'nein' + assert.are_same(elem.text, 'nein') + elem.text = 'doch' + assert.are_equal(elem, pandoc.Str 'doch') + end) + }, group 'Strikeout' { test('has property `content`', function () local elem = pandoc.Strikeout{'two', pandoc.Space(), 'words'} -- cgit v1.2.3 From 45bcd7d3f1c78d08d20db3b6929421c896fa869a Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 2 Nov 2021 21:53:08 +0100 Subject: Lua: fix typo in SoftBreak constructor --- src/Text/Pandoc/Lua/Module/Pandoc.hs | 2 +- test/lua/module/pandoc.lua | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index f09159b4e..33432b4d8 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -186,7 +186,7 @@ inlineConstructors = <#> parameter peekText "text" "string" "string content" =#> functionResult pushInline "Inline" "raw inline element" , mkInlinesConstr "SmallCaps" SmallCaps - , defun "SoftSpace" + , defun "SoftBreak" ### return SoftBreak =#> functionResult pushInline "Inline" "soft break" , defun "Space" diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index fac95d27f..4da663f07 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -322,6 +322,12 @@ return { assert.are_equal(elem, pandoc.SmallCaps{'word'}) end) }, + group 'SoftBreak' { + test('can be constructed', function () + local sb = pandoc.SoftBreak() + assert.are_equal(sb.t, 'SoftBreak') + end) + }, group 'Span' { test('has property `attr`', function () local elem = pandoc.Span('one', {'', {'number'}}) -- cgit v1.2.3 From 938d55784486f42d80cc4c2fcfe6ae905be382cd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 2 Nov 2021 14:02:24 -0700 Subject: Docx reader: don't let first line indents trigger block quotes. This fixes a regression introduced in pandoc 2.15 by PR #7606. Closes #7655. --- src/Text/Pandoc/Readers/Docx/Parse/Styles.hs | 5 ++--- test/docx/relative_indentation_blockquotes.docx | Bin 12492 -> 12655 bytes test/docx/relative_indentation_blockquotes.native | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs b/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs index bb28b3009..df942579a 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse/Styles.hs @@ -310,9 +310,8 @@ getIndentation ns el = do , rightParIndent = findAttrByName ns "w" "right" indElement <|> findAttrByName ns "w" "end" indElement >>= stringToInteger - , hangingParIndent = (findAttrByName ns "w" "hanging" indElement >>= stringToInteger) <|> - fmap negate - (findAttrByName ns "w" "firstLine" indElement >>= stringToInteger) + , hangingParIndent = findAttrByName ns "w" "hanging" indElement >>= + stringToInteger } getElementStyleName :: Coercible T.Text a => NameSpaces -> Element -> Maybe a diff --git a/test/docx/relative_indentation_blockquotes.docx b/test/docx/relative_indentation_blockquotes.docx index f318a8509..fe252280e 100644 Binary files a/test/docx/relative_indentation_blockquotes.docx and b/test/docx/relative_indentation_blockquotes.docx differ diff --git a/test/docx/relative_indentation_blockquotes.native b/test/docx/relative_indentation_blockquotes.native index 37806f289..6a70aece8 100644 --- a/test/docx/relative_indentation_blockquotes.native +++ b/test/docx/relative_indentation_blockquotes.native @@ -1,4 +1,6 @@ [Header 1 ("indentation-blockquotes",[],[]) [Str "Indentation",Space,Str "blockquotes"] +,Para [Str "Foobar"] +,Para [Str "First",Space,Str "line",Space,Str "indented."] ,Para [Str "Normal",Space,Str "list",Space,Str "paragraph"] ,Para [Str "List",Space,Str "paragraph",Space,Str "with",Space,Str "less",Space,Str "indent"] ,BlockQuote [Para [Str "List",Space,Str "paragraph",Space,Str "with",Space,Str "more",Space,Str "indent"]]] -- cgit v1.2.3 From d1789dda7574035edc12264b45fe5647033f198b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 2 Nov 2021 16:16:21 -0700 Subject: Bump to 2.16.1, update changelog. --- MANUAL.txt | 2 +- changelog.md | 36 ++++++++++++++++++++++++++++++++++++ man/pandoc.1 | 2 +- pandoc.cabal | 2 +- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 5cf94cb4a..74b8a11b7 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1,7 +1,7 @@ --- title: Pandoc User's Guide author: John MacFarlane -date: October 30, 2021 +date: November 02, 2021 --- # Synopsis diff --git a/changelog.md b/changelog.md index 4c2207aca..4ab5fb355 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,41 @@ # Revision history for pandoc +## pandoc 2.16.1 (2021-11-02) + + + * Docx reader: don't let first line indents trigger block quotes (#7655). + This fixes a regression introduced in pandoc 2.15. + + * Docx writer: use `getTimestamp` for modification times in + reference.docx (#7654). This ensures that when `SOURCE_DATE_EPOCH` is + set, the modification times of files taken from the reference.docx will + be set deterministically, allowing for reproducible builds. + + * Lua subsystem (Albert Krewinkel): + + + Load module `pandoc.path` on startup (#7524). Previously the module + always had to be loaded via `require 'pandoc.path'`. + + Fix typo in SoftBreak constructor. + + Re-add `content` property to Strikeout elements. + Fixes a regression introduced in 2.15. + + Be more forgiving when retrieving the Image `caption` property. + Fixes a regression introduced in 2.15. + + Display Attr values using their native Haskell representation. + + Allow omitting the 2nd parameter in pandoc.Code constructor. + Fixes a regression introduced in 2.15 which required users to always + specify an Attr value when constructing a Code element. + + Allow to compare, show Citation values. Comparisons of Citation + values are performed in Haskell; values are equal if they represent + the same Haskell value. Converting a Citation value to a string + now yields its native Haskell string representation. + + Restore List behavior of MetaList (#7650). Fixes a regression + introduced in 2.16 which had MetaList elements lose + the `pandoc.List` properties. + + Restore `content` property on Header elements. + + Ensure Block elements have all expected properties. + + Ensure Inline elements have all expected properties. + + ## pandoc 2.16 (2021-10-31) * Switch back from HsYAML to yaml for parsing YAML metadata (#6084). diff --git a/man/pandoc.1 b/man/pandoc.1 index e8f455e57..5fb524b58 100644 --- a/man/pandoc.1 +++ b/man/pandoc.1 @@ -1,7 +1,7 @@ '\" t .\" Automatically generated by Pandoc 2.16 .\" -.TH "Pandoc User\[cq]s Guide" "" "October 30, 2021" "pandoc 2.16" "" +.TH "Pandoc User\[cq]s Guide" "" "November 02, 2021" "pandoc 2.16.1" "" .hy .SH NAME pandoc - general markup converter diff --git a/pandoc.cabal b/pandoc.cabal index 6fa36f9e7..6f2876413 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: pandoc -version: 2.16 +version: 2.16.1 build-type: Simple license: GPL-2.0-or-later license-file: COPYING.md -- cgit v1.2.3 From 6c1ef00de5bbd29a281e3bbcd6ba32a616fd875c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 2 Nov 2021 16:21:16 -0700 Subject: Allow tasty-bench 0.3.x. --- pandoc.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandoc.cabal b/pandoc.cabal index 6f2876413..695edb349 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -926,7 +926,7 @@ benchmark benchmark-pandoc build-depends: bytestring, containers, -- gauge >= 0.2 && < 0.3, - tasty-bench >= 0.2 && <= 0.3, + tasty-bench >= 0.2 && <= 0.4, mtl >= 2.2 && < 2.3, text >= 1.1.1.0 && < 1.3, time, -- cgit v1.2.3 From 3e466b9346d68ea711d8d3063ac24e7d24512a07 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 2 Nov 2021 16:21:45 -0700 Subject: Allow latest tasty-bench, update changelog. --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 4ab5fb355..148b8566a 100644 --- a/changelog.md +++ b/changelog.md @@ -35,6 +35,7 @@ + Ensure Block elements have all expected properties. + Ensure Inline elements have all expected properties. + * Allow tasty-bench 0.3.x. ## pandoc 2.16 (2021-10-31) -- cgit v1.2.3 From fa83246d7de8527bbf59dfac9636a42ede185194 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 2 Nov 2021 23:25:27 -0700 Subject: Markdown reader: Improve inlinesInBalancedBrackets. This is just a small improvement in terms of performance, but it's simpler and more direct code. Also, we avoid parsing interparagraph spaces in balanced brackets, as the original did. --- src/Text/Pandoc/Readers/Markdown.hs | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index a73c0cba3..e24c38d33 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -186,26 +186,18 @@ litChar = escapedChar' -- including inlines between balanced pairs of square brackets. inlinesInBalancedBrackets :: PandocMonad m => MarkdownParser m (F Inlines) inlinesInBalancedBrackets = - try $ char '[' >> withRaw (go 1) >>= - parseFromString inlines . stripBracket . snd - where stripBracket t = case T.unsnoc t of - Just (t', ']') -> t' - _ -> t - go :: PandocMonad m => Int -> MarkdownParser m () - go 0 = return () - go openBrackets = - (() <$ (escapedChar <|> - code <|> - math <|> - rawHtmlInline <|> - rawLaTeXInline') >> go openBrackets) - <|> - (do char ']' - Control.Monad.when (openBrackets > 1) $ go (openBrackets - 1)) - <|> - (char '[' >> go (openBrackets + 1)) - <|> - (anyChar >> go openBrackets) + mconcat <$> try (char '[' >> go (1 :: Int)) + where + go n = + (:) <$> (note <|> cite <|> bracketedSpan <|> link) <*> go n + <|> + (char '[' *> ((:) <$> pure (pure (B.str "[")) <*> go (n + 1))) + <|> + (char ']' *> (if n > 1 + then (:) <$> pure (pure (B.str "]")) <*> go (n - 1) + else pure [])) + <|> + (:) <$> inline <*> go n -- -- document structure -- cgit v1.2.3 From c256ef34b32308f00b64ca9cb01f1bacd5994802 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 3 Nov 2021 13:36:15 +0100 Subject: Lua: add missing space in "package not found" message Closes: #7658 --- src/Text/Pandoc/Lua/Packages.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Lua/Packages.hs b/src/Text/Pandoc/Lua/Packages.hs index 8e5cc96c3..3a481886a 100644 --- a/src/Text/Pandoc/Lua/Packages.hs +++ b/src/Text/Pandoc/Lua/Packages.hs @@ -64,5 +64,5 @@ pandocPackageSearcher pkgName = Lua.pushHaskellFunction f return 1 reportPandocSearcherFailure = liftPandocLua $ do - Lua.push ("\n\t" <> pkgName <> "is not one of pandoc's default packages") + Lua.push ("\n\t" <> pkgName <> " is not one of pandoc's default packages") return (Lua.NumResults 1) -- cgit v1.2.3 From ebe21f3f656c0fede2dacca0867d28893ba6f723 Mon Sep 17 00:00:00 2001 From: "S.P.H" <7786502+StaticPH@users.noreply.github.com> Date: Wed, 3 Nov 2021 17:15:06 -0400 Subject: Update bash_completion.tpl - Specify local scope for highlight_styles; prevents global namespace pollution when sourcing completion from a file rather than adding `eval "$(pandoc --bash-completion)"` to .bashrc - Add argument completion for --print-highlight-style, --eol, and --markdown-headings --- data/bash_completion.tpl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/data/bash_completion.tpl b/data/bash_completion.tpl index d065c34bb..440abc3e6 100644 --- a/data/bash_completion.tpl +++ b/data/bash_completion.tpl @@ -4,7 +4,7 @@ _pandoc() { - local cur prev opts lastc informats outformats datafiles + local cur prev opts lastc informats outformats highlight_styles datafiles COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" @@ -57,10 +57,18 @@ _pandoc() COMPREPLY=( $(compgen -W "section chapter part" -- ${cur}) ) return 0 ;; - --highlight-style) + --highlight-style|--print-highlight-style) COMPREPLY=( $(compgen -W "${highlight_styles}" -- ${cur}) ) return 0 ;; + --eol) + COMPREPLY=( $(compgen -W "crlf lf native" -- ${cur}) ) + return 0 + ;; + --markdown-headings) + COMPREPLY=( $(compgen -W "setext atx" -- ${cur}) ) + return 0 + ;; *) ;; esac -- cgit v1.2.3 From 4ea2baf814c462670301cf3b6a3b7d6b8a38c143 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 4 Nov 2021 12:25:27 +0100 Subject: Require latest hslua (2.0.1). This fixes issues with - misleading error messages when a required function parameter is omitted; - absent properties still being listed in the output of `pairs`; and - alias accessing leading to errors instead of returning `nil`, e.g. with `(pandoc.Str '').identifier`. Fixes: #7661 See also: #7657 --- pandoc.cabal | 4 ++-- stack.yaml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 695edb349..1d9ca19dd 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -550,8 +550,8 @@ library file-embed >= 0.0 && < 0.1, filepath >= 1.1 && < 1.5, haddock-library >= 1.10 && < 1.11, - hslua >= 2.0 && < 2.1, - hslua-marshalling >= 2.0 && < 2.1, + hslua >= 2.0.1 && < 2.1, + hslua-marshalling >= 2.0.1 && < 2.1, hslua-module-path >= 1.0 && < 1.1, hslua-module-system >= 1.0 && < 1.1, hslua-module-text >= 1.0 && < 1.1, diff --git a/stack.yaml b/stack.yaml index d03ff0e12..651c25167 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,17 +12,17 @@ extra-deps: - doctemplates-0.10 - emojis-0.1.2 - doclayout-0.3.1.1 -- hslua-2.0.0 +- hslua-2.0.1 - hslua-classes-2.0.0 -- hslua-core-2.0.0 -- hslua-marshalling-2.0.0 +- hslua-core-2.0.0.2 +- hslua-marshalling-2.0.1 - hslua-module-path-1.0.0 - hslua-module-system-1.0.0 - hslua-module-text-1.0.0 - hslua-module-version-1.0.0 -- hslua-objectorientation-2.0.0 +- hslua-objectorientation-2.0.1 - hslua-packaging-2.0.0 -- lua-2.0.0 +- lua-2.0.1 - tasty-hslua-1.0.0 - tasty-lua-1.0.0 - pandoc-types-1.22.1 -- cgit v1.2.3 From 0b254ea4af38cf53c027eb5e9977e96c2b7975c7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 4 Nov 2021 10:11:57 -0700 Subject: Allow `plain` to be used in raw attribute syntax. --- src/Text/Pandoc/Writers/Markdown.hs | 3 ++- src/Text/Pandoc/Writers/Markdown/Inline.hs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 4f6a8bfb1..96de5e0cd 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -399,7 +399,8 @@ blockToMarkdown' opts b@(RawBlock f str) = do (literal "```" <> literal "\n") let renderEmpty = mempty <$ report (BlockNotRendered b) case variant of - PlainText -> renderEmpty + PlainText + | f == "plain" -> return $ literal str <> literal "\n" Commonmark | f `elem` ["gfm", "commonmark", "commonmark_x", "markdown"] -> return $ literal str <> literal "\n" diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs index ab9674026..065157e80 100644 --- a/src/Text/Pandoc/Writers/Markdown/Inline.hs +++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs @@ -459,7 +459,8 @@ inlineToMarkdown opts il@(RawInline f str) = do literal (T.replicate numticks "`") <> literal "{=" <> literal fmt <> literal "}" let renderEmpty = mempty <$ report (InlineNotRendered il) case variant of - PlainText -> renderEmpty + PlainText + | f == "plain" -> return $ literal str Commonmark | f `elem` ["gfm", "commonmark", "commonmark_x", "markdown"] -> return $ literal str -- cgit v1.2.3 From a1b6bf69f2266f6b1beb0db4383915a9c4a4eb83 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 5 Nov 2021 03:25:29 +0100 Subject: Lua: include lpeg module (#7649) Compiles the 'lpeg' library (Parsing Expression Grammars For Lua) into the program. Package maintainers may choose to rely on package dependencies to make lpeg available, in which case they can compile the with the constraint `lpeg +rely-on-shared-lpeg-library`. --- pandoc.cabal | 1 + src/Text/Pandoc/Lua/Packages.hs | 4 ++++ stack.yaml | 1 + 3 files changed, 6 insertions(+) diff --git a/pandoc.cabal b/pandoc.cabal index 1d9ca19dd..8911cdb1b 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -561,6 +561,7 @@ library http-types >= 0.8 && < 0.13, ipynb >= 0.1.0.2 && < 0.2, jira-wiki-markup >= 1.4 && < 1.5, + lpeg >= 1.0 && < 1.1, mtl >= 2.2 && < 2.3, network >= 2.6, network-uri >= 2.6 && < 2.8, diff --git a/src/Text/Pandoc/Lua/Packages.hs b/src/Text/Pandoc/Lua/Packages.hs index 3a481886a..4fb11a646 100644 --- a/src/Text/Pandoc/Lua/Packages.hs +++ b/src/Text/Pandoc/Lua/Packages.hs @@ -22,6 +22,7 @@ import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, loadDefaultModule) import qualified HsLua as Lua import qualified HsLua.Module.Path as Path import qualified HsLua.Module.Text as Text +import qualified Lua.LPeg as LPeg import qualified Text.Pandoc.Lua.Module.Pandoc as Pandoc import qualified Text.Pandoc.Lua.Module.MediaBag as MediaBag import qualified Text.Pandoc.Lua.Module.System as System @@ -35,6 +36,9 @@ installPandocPackageSearcher = liftPandocLua $ do shiftArray Lua.pushHaskellFunction $ Lua.toHaskellFunction pandocPackageSearcher Lua.rawseti (Lua.nth 2) 1 + -- add lpeg searcher as last searcher + Lua.pushHaskellFunction $ Lua.state >>= Lua.liftIO . LPeg.lpeg_searcher + Lua.rawseti (Lua.nth 2) 6 Lua.pop 1 -- remove 'package.searchers' from stack where shiftArray = forM_ [4, 3, 2, 1] $ \i -> do diff --git a/stack.yaml b/stack.yaml index 651c25167..656063846 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,6 +12,7 @@ extra-deps: - doctemplates-0.10 - emojis-0.1.2 - doclayout-0.3.1.1 +- lpeg-1.0.0 - hslua-2.0.1 - hslua-classes-2.0.0 - hslua-core-2.0.0.2 -- cgit v1.2.3 From d089d799e7c40a269a3b80e5fd40dc0fbfb5e6de Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 5 Nov 2021 09:21:50 +0100 Subject: Lua: always load lpeg as global module --- src/Text/Pandoc/Lua/Init.hs | 28 +++++++++++++++++++++++++++- src/Text/Pandoc/Lua/Packages.hs | 4 ---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index 87ae3a0d2..5b2a2f3e4 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Lua @@ -24,6 +25,7 @@ import Text.Pandoc.Error (PandocError (PandocLuaError)) import Text.Pandoc.Lua.Packages (installPandocPackageSearcher) import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, runPandocLua) import qualified Data.Text as T +import qualified Lua.LPeg as LPeg import qualified Text.Pandoc.Definition as Pandoc import qualified Text.Pandoc.Lua.Module.Pandoc as ModulePandoc @@ -45,6 +47,7 @@ initLuaState = do liftPandocLua Lua.openlibs installPandocPackageSearcher initPandocModule + requireGlobalModules loadInitScript "init.lua" where initPandocModule :: PandocLua () @@ -53,8 +56,8 @@ initLuaState = do ModulePandoc.pushModule -- register as loaded module liftPandocLua $ do - Lua.pushvalue Lua.top Lua.getfield Lua.registryindex Lua.loaded + Lua.pushvalue (Lua.nth 2) Lua.setfield (Lua.nth 2) "pandoc" Lua.pop 1 -- copy constructors into registry @@ -73,6 +76,29 @@ initLuaState = do PandocLuaError msg -> msg _ -> T.pack $ show err + requireGlobalModules :: PandocLua () + requireGlobalModules = liftPandocLua $ do + Lua.pushcfunction LPeg.luaopen_lpeg_ptr + Lua.pcall 0 1 Nothing >>= \case + Lua.OK -> do + -- Success. Register as a loaded module. + -- Get table "_LOADED" from registry, add entry. + _ <- Lua.getfield Lua.registryindex Lua.loaded + Lua.pushvalue (Lua.nth 2) + Lua.setfield (Lua.nth 2) "lpeg" + Lua.pop 1 -- pop _LOADED + + _ -> do + -- Maybe LPeg was not compiled into the program. Try loading via + -- the normal package loading mechanism. + pop 1 -- ignore error message + Lua.getglobal "require" + Lua.pushName "lpeg" + Lua.call 1 1 -- throws an exception if the module is not found + + -- Module on top of stack. Register as global + Lua.setglobal "lpeg" + -- | AST elements are marshaled via normal constructor functions in the -- @pandoc@ module. However, accessing Lua globals from Haskell is -- expensive (due to error handling). Accessing the Lua registry is much diff --git a/src/Text/Pandoc/Lua/Packages.hs b/src/Text/Pandoc/Lua/Packages.hs index 4fb11a646..3a481886a 100644 --- a/src/Text/Pandoc/Lua/Packages.hs +++ b/src/Text/Pandoc/Lua/Packages.hs @@ -22,7 +22,6 @@ import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, loadDefaultModule) import qualified HsLua as Lua import qualified HsLua.Module.Path as Path import qualified HsLua.Module.Text as Text -import qualified Lua.LPeg as LPeg import qualified Text.Pandoc.Lua.Module.Pandoc as Pandoc import qualified Text.Pandoc.Lua.Module.MediaBag as MediaBag import qualified Text.Pandoc.Lua.Module.System as System @@ -36,9 +35,6 @@ installPandocPackageSearcher = liftPandocLua $ do shiftArray Lua.pushHaskellFunction $ Lua.toHaskellFunction pandocPackageSearcher Lua.rawseti (Lua.nth 2) 1 - -- add lpeg searcher as last searcher - Lua.pushHaskellFunction $ Lua.state >>= Lua.liftIO . LPeg.lpeg_searcher - Lua.rawseti (Lua.nth 2) 6 Lua.pop 1 -- remove 'package.searchers' from stack where shiftArray = forM_ [4, 3, 2, 1] $ \i -> do -- cgit v1.2.3 From ebdb39b3b4d297ea2356063d48f5e472e8ffa9d3 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 5 Nov 2021 13:11:02 +0100 Subject: Lua: display Pandoc values using their native Haskell representation --- src/Text/Pandoc/Lua/Marshaling/AST.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index e73ff43b5..568b610cc 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -85,6 +85,10 @@ typePandoc = deftype "Pandoc" <#> parameter (optional . peekPandoc) "doc1" "pandoc" "" <#> parameter (optional . peekPandoc) "doc2" "pandoc" "" =#> functionResult pushBool "boolean" "true iff the two values are equal" + , operation Tostring $ lambda + ### liftPure show + <#> parameter peekPandoc "Pandoc" "doc" "" + =#> functionResult pushString "string" "native Haskell representation" ] [ property "blocks" "list of blocks" (pushPandocList pushBlock, \(Pandoc _ blks) -> blks) -- cgit v1.2.3 From f32fe9cbd5641244cf5c2e641bdf184aea27e970 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 5 Nov 2021 13:17:08 +0100 Subject: T.P.Error: sort errors in handleError by exit code --- src/Text/Pandoc/Error.hs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs index 9dee8356b..f16ad2997 100644 --- a/src/Text/Pandoc/Error.hs +++ b/src/Text/Pandoc/Error.hs @@ -171,34 +171,34 @@ handleError (Left e) = exitCode = case e of PandocIOError{} -> 1 + PandocFailOnWarningError{} -> 3 + PandocAppError{} -> 4 + PandocTemplateError{} -> 5 + PandocOptionError{} -> 6 + PandocUnknownReaderError{} -> 21 + PandocUnknownWriterError{} -> 22 + PandocUnsupportedExtensionError{} -> 23 + PandocCiteprocError{} -> 24 + PandocBibliographyError{} -> 25 + PandocEpubSubdirectoryError{} -> 31 + PandocPDFError{} -> 43 + PandocXMLError{} -> 44 + PandocPDFProgramNotFoundError{} -> 47 PandocHttpError{} -> 61 PandocShouldNeverHappenError{} -> 62 PandocSomeError{} -> 63 PandocParseError{} -> 64 PandocParsecError{} -> 65 PandocMakePDFError{} -> 66 - PandocOptionError{} -> 6 PandocSyntaxMapError{} -> 67 - PandocFailOnWarningError{} -> 3 - PandocPDFProgramNotFoundError{} -> 47 - PandocPDFError{} -> 43 - PandocXMLError{} -> 44 PandocFilterError{} -> 83 PandocLuaError{} -> 84 - PandocCouldNotFindDataFileError{} -> 97 - PandocResourceNotFound{} -> 99 - PandocTemplateError{} -> 5 - PandocAppError{} -> 4 - PandocEpubSubdirectoryError{} -> 31 PandocMacroLoop{} -> 91 PandocUTF8DecodingError{} -> 92 PandocIpynbDecodingError{} -> 93 PandocUnsupportedCharsetError{} -> 94 - PandocUnknownReaderError{} -> 21 - PandocUnknownWriterError{} -> 22 - PandocUnsupportedExtensionError{} -> 23 - PandocCiteprocError{} -> 24 - PandocBibliographyError{} -> 25 + PandocCouldNotFindDataFileError{} -> 97 + PandocResourceNotFound{} -> 99 err :: Int -> Text -> IO a err exitCode msg = do -- cgit v1.2.3 From 5750f60442923780dda91d63dd11b1904446a2d9 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 5 Nov 2021 13:21:24 +0100 Subject: MANUAL.txt: update table of exit codes and corresponding errors --- MANUAL.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANUAL.txt b/MANUAL.txt index 74b8a11b7..019d80bf0 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1480,6 +1480,7 @@ Nonzero exit codes have the following meanings: Code Error ----- ------------------------------------ + 1 PandocIOError 3 PandocFailOnWarningError 4 PandocAppError 5 PandocTemplateError @@ -1501,6 +1502,7 @@ Nonzero exit codes have the following meanings: 66 PandocMakePDFError 67 PandocSyntaxMapError 83 PandocFilterError + 84 PandocLuaError 91 PandocMacroLoop 92 PandocUTF8DecodingError 93 PandocIpynbDecodingError -- cgit v1.2.3 From 7a70a46c0319f279fdee3926abff08922be2f02c Mon Sep 17 00:00:00 2001 From: Rowan Rodrik van der Molen Date: Fri, 5 Nov 2021 17:22:38 +0000 Subject: Support for s when reading DocBook (#7607) * Support for s when reading DocBook * Update implementation status of `` tags * Remove non-idiomatic parentheses * More complete `` support, with tests Co-authored-by: Rowan Rodrik van der Molen --- src/Text/Pandoc/Readers/DocBook.hs | 41 +++++++- test/docbook-reader.docbook | 12 +++ test/docbook-reader.native | 187 +++++++++++++++++++++++++++++++++++++ 3 files changed, 236 insertions(+), 4 deletions(-) diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 1c13e597b..bdf802925 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -19,7 +19,7 @@ import Data.Foldable (asum) import Data.Generics import Data.List (intersperse,elemIndex) import Data.List.NonEmpty (nonEmpty) -import Data.Maybe (fromMaybe,mapMaybe) +import Data.Maybe (catMaybes,fromMaybe,mapMaybe) import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Lazy as TL @@ -316,7 +316,7 @@ List of all DocBook tags, with [x] indicating implemented, [ ] postcode - A postal code in an address [x] preface - Introductory matter preceding the first chapter of a book [ ] prefaceinfo - Meta-information for a Preface -[ ] primary - The primary word or phrase under which an index term should be +[x] primary - The primary word or phrase under which an index term should be sorted [ ] primaryie - A primary term in an index entry, not in the text [ ] printhistory - The printing history of a document @@ -385,7 +385,7 @@ List of all DocBook tags, with [x] indicating implemented, [o] screeninfo - Information about how a screen shot was produced [ ] screenshot - A representation of what the user sees or might see on a computer screen -[ ] secondary - A secondary word or phrase in an index term +[x] secondary - A secondary word or phrase in an index term [ ] secondaryie - A secondary term in an index entry, rather than in the text [x] sect1 - A top-level section of document [x] sect1info - Meta-information for a Sect1 @@ -461,7 +461,7 @@ List of all DocBook tags, with [x] indicating implemented, [x] td - A table entry in an HTML table [x] term - The word or phrase being defined or described in a variable list [ ] termdef - An inline term definition -[ ] tertiary - A tertiary word or phrase in an index term +[x] tertiary - A tertiary word or phrase in an index term [ ] tertiaryie - A tertiary term in an index entry, rather than in the text [ ] textdata - Pointer to external text data [ ] textobject - A wrapper for a text description of an object and its @@ -1080,6 +1080,17 @@ elementToStr :: Content -> Content elementToStr (Elem e') = Text $ CData CDataText (strContentRecursive e') Nothing elementToStr x = x +childElTextAsAttr :: Text -> Element -> Maybe (Text, Text) +childElTextAsAttr n e = case findChild q e of + Nothing -> Nothing + Just childEl -> Just (n, strContentRecursive childEl) + where q = QName n (Just "http://docbook.org/ns/docbook") Nothing + +attrValueAsOptionalAttr :: Text -> Element -> Maybe (Text, Text) +attrValueAsOptionalAttr n e = case attrValue n e of + "" -> Nothing + _ -> Just (n, attrValue n e) + parseInline :: PandocMonad m => Content -> DB m Inlines parseInline (Text (CData _ s _)) = return $ text s parseInline (CRef ref) = @@ -1094,6 +1105,28 @@ parseInline (Elem e) = if ident /= "" || classes /= [] then innerInlines (spanWith (ident,classes,[])) else innerInlines id + "indexterm" -> do + let ident = attrValue "id" e + let classes = T.words $ attrValue "role" e + let attrs = + -- In DocBook, , , , , and + -- have mixed content models. However, because we're representing these + -- elements in Pandoc's AST as attributes of a phrase, we flatten all + -- the descendant content of these elements. + [ childElTextAsAttr "primary" e + , childElTextAsAttr "secondary" e + , childElTextAsAttr "tertiary" e + , childElTextAsAttr "see" e + , childElTextAsAttr "seealso" e + , attrValueAsOptionalAttr "significance" e + , attrValueAsOptionalAttr "startref" e + , attrValueAsOptionalAttr "scope" e + , attrValueAsOptionalAttr "class" e + -- We don't do anything with the "pagenum" attribute, because these only + -- occur within literal sections, which is not supported by Pandoc, + -- because Pandoc has no concept of pages. + ] + return $ spanWith (ident, ("indexterm" : classes), (catMaybes attrs)) mempty "equation" -> equation e displayMath "informalequation" -> equation e displayMath "inlineequation" -> equation e math diff --git a/test/docbook-reader.docbook b/test/docbook-reader.docbook index c38abda82..00bd84649 100644 --- a/test/docbook-reader.docbook +++ b/test/docbook-reader.docbook @@ -1603,4 +1603,16 @@ or here: <http://example.com/> + + Index terms + + In the simplest case, index termsindex term consists of just a <primary> element, but index termmulti-level they can also consist of a <primary> and <secondary> element, and index termmulti-level3-level can even include a <tertiary> term. + + + Index terms can also refer to other index terms: index cross referencingindex termcross referencesindex cross referencingexclusively, using the <see> tag; or index cross referencingcross referencing as a reference to related terms, using the <seealso> tag. + + + foodbig baguette supremeNested content in index term elements is flattened. + + diff --git a/test/docbook-reader.native b/test/docbook-reader.native index be3819336..7520068b1 100644 --- a/test/docbook-reader.native +++ b/test/docbook-reader.native @@ -2930,4 +2930,191 @@ Pandoc [ Str "A" , Space , Str "Final" , Space , Str "Step" ] ] ] + , Header + 1 + ( "indexterms" , [] , [] ) + [ Str "Index" , Space , Str "terms" ] + , Para + [ Str "In" + , Space + , Str "the" + , Space + , Str "simplest" + , Space + , Str "case," + , Space + , Str "index" + , Space + , Str "terms" + , Span + ( "" , [ "indexterm" ] , [ ( "primary" , "index term" ) ] ) + [] + , Space + , Str "consists" + , Space + , Str "of" + , Space + , Str "just" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "element," + , Space + , Str "but" + , Space + , Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "index term" ) + , ( "secondary" , "multi-level" ) + ] + ) + [] + , Space + , Str "they" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "consist" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "element," + , Space + , Str "and" + , Space + , Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "index term" ) + , ( "secondary" , "multi-level" ) + , ( "tertiary" , "3-level" ) + ] + ) + [] + , Space + , Str "can" + , Space + , Str "even" + , Space + , Str "include" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "term." + ] + , Para + [ Str "Index" + , Space + , Str "terms" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "refer" + , Space + , Str "to" + , Space + , Str "other" + , Space + , Str "index" + , Space + , Str "terms:" + , Space + , Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "index cross referencing" ) ] + ) + [] + , Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "index term" ) + , ( "secondary" , "cross references" ) + , ( "see" , "index cross referencing" ) + ] + ) + [] + , Str "exclusively," + , Space + , Str "using" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "tag;" + , Space + , Str "or" + , Space + , Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "index cross referencing" ) + , ( "seealso" , "cross referencing" ) + ] + ) + [] + , Space + , Str "as" + , Space + , Str "a" + , Space + , Str "reference" + , Space + , Str "to" + , Space + , Str "related" + , Space + , Str "terms," + , Space + , Str "using" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "tag." + ] + , Para + [ Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "food" ) + , ( "secondary" , "big baguette supreme" ) + ] + ) + [] + , Str "Nested" + , Space + , Str "content" + , Space + , Str "in" + , Space + , Str "index" + , Space + , Str "term" + , Space + , Str "elements" + , Space + , Str "is" + , Space + , Str "flattened." + ] ] -- cgit v1.2.3 From 1fa6e53425cd81bf4ec74e3362b8484491472194 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 5 Nov 2021 22:37:49 +0100 Subject: doc/lua-filters.md: add section on global modules, including lpeg --- doc/lua-filters.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index e7cdd256d..e9a121f50 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -245,6 +245,16 @@ variables. variable is of type [CommonState] and is read-only. +## Global modules + +There are two modules which are preloaded and accessible through +global variables. The first is `pandoc`, which is described in the +next section. The other is `lpeg`, a package based on Parsing +Expression Grammars (PEG). See the official [LPeg homepage] for +details. + +[LPeg homepage]: http://www.inf.puc-rio.br/~roberto/lpeg/ + # Pandoc Module The `pandoc` Lua module is loaded into the filter's Lua -- cgit v1.2.3 From bac6ae9607582233336984c30bba3c586eba6844 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 5 Nov 2021 19:13:29 -0700 Subject: CI: remove test on ghc 8.0.2. --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c75fcd213..f0b17d3de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,11 +43,6 @@ jobs: fail-fast: true matrix: versions: - - ghc: '8.0.2' - cabal: '2.4' - prefix: 'v2-' - cabalopts: '' - testopts: '' - ghc: '8.2.2' cabal: '2.4' prefix: 'v2-' -- cgit v1.2.3 From ee2f0021f9b59f0bca6eabf4884641da7a09e21d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 5 Nov 2021 22:10:29 -0700 Subject: Add interface for custom readers written in Lua. (#7671) New module Text.Pandoc.Readers.Custom, exporting readCustom [API change]. Users can now do `-f myreader.lua` and pandoc will treat the script myreader.lua as a custom reader, which parses an input string to a pandoc AST, using the pandoc module defined for Lua filters. A sample custom reader can be found in data/reader.lua. Closes #7669. --- MANUAL.txt | 36 ++++++++++++++++++------- data/reader.lua | 44 +++++++++++++++++++++++++++++++ pandoc.cabal | 1 + src/Text/Pandoc/App.hs | 13 +++++---- src/Text/Pandoc/Readers/Custom.hs | 55 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 135 insertions(+), 14 deletions(-) create mode 100644 data/reader.lua create mode 100644 src/Text/Pandoc/Readers/Custom.hs diff --git a/MANUAL.txt b/MANUAL.txt index 019d80bf0..7e9f9f85a 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -266,6 +266,7 @@ header when requesting a document from a URL: - `tikiwiki` ([TikiWiki markup]) - `twiki` ([TWiki markup]) - `vimwiki` ([Vimwiki]) + - the path of a custom Lua reader, see [Custom readers and writers] below ::: Extensions can be individually enabled or disabled by @@ -338,7 +339,7 @@ header when requesting a document from a URL: - `tei` ([TEI Simple]) - `xwiki` ([XWiki markup]) - `zimwiki` ([ZimWiki markup]) - - the path of a custom Lua writer, see [Custom writers] below + - the path of a custom Lua writer, see [Custom readers and writers] below ::: Note that `odt`, `docx`, `epub`, and `pdf` output will not be directed @@ -6574,19 +6575,35 @@ With these custom styles, you can use your input document as a reference-doc while creating docx output (see below), and maintain the same styles in your input and output files. -# Custom writers +# Custom readers and writers -Pandoc can be extended with custom writers written in [Lua]. (Pandoc -includes a Lua interpreter, so Lua need not be installed separately.) +Pandoc can be extended with custom readers and writers written +in [Lua]. (Pandoc includes a Lua interpreter, so Lua need not +be installed separately.) -To use a custom writer, simply specify the path to the Lua script -in place of the output format. For example: +To use a custom reader or writer, simply specify the path to the +Lua script in place of the input or output format. For example: pandoc -t data/sample.lua + pandoc -f my_custom_markup_language.lua -t latex -s -Creating a custom writer requires writing a Lua function for each -possible element in a pandoc document. To get a documented example -which you can modify according to your needs, do +A custom reader is a Lua script that defines one function, +Reader, which takes a string as input and returns a Pandoc +AST. See the [Lua filters documentation] for documentation +of the functions that are available for creating pandoc +AST elements. For parsing, the [lpeg] parsing library +is available by default. To see a sample custom reader: + + pandoc --print-default-data-file reader.lua + +Reader options are available via the global variable +`PANDOC_READER_OPTIONS`, as expalined in the [Lua filters +documentation]. + +A custom writer is a Lua script that defines a function +that specifies how to render each element in a Pandoc AST. +To see a documented example which you can modify according +to your needs: pandoc --print-default-data-file sample.lua @@ -6598,6 +6615,7 @@ default template with the name subdirectory of your user data directory (see [Templates]). [Lua]: https://www.lua.org +[lpeg]: http://www.inf.puc-rio.br/~roberto/lpeg/ # Reproducible builds diff --git a/data/reader.lua b/data/reader.lua new file mode 100644 index 000000000..4aca4edd3 --- /dev/null +++ b/data/reader.lua @@ -0,0 +1,44 @@ +-- A sample custom reader for a very simple markup language. +-- This parses a document into paragraphs separated by blank lines. +-- This is _{italic} and this is *{boldface} +-- This is an escaped special character: \_, \*, \{, \} +-- == text makes a level-2 heading +-- That's it! + +-- For better performance we put these functions in local variables: +local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B = + lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V, + lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B + +local whitespacechar = S(" \t\r\n") +local specialchar = S("_*{}\\") +local escapedchar = P"\\" * specialchar + / function (x) return string.sub(x,2) end +local wordchar = (P(1) - (whitespacechar + specialchar)) + escapedchar +local spacechar = S(" \t") +local newline = P"\r"^-1 * P"\n" +local blanklines = newline * spacechar^0 * newline^1 +local endline = newline - blanklines + +-- Grammar +G = P{ "Pandoc", + Pandoc = blanklines^-1 * Ct(V"Block"^0) / pandoc.Pandoc; + Block = V"Header" + V"Para"; + Para = Ct(V"Inline"^1) * blanklines^-1 / pandoc.Para; + Header = Ct(Cg(P("=")^1 / function(x) return #x end, "length") + * spacechar^1 + * Cg(Ct(V"Inline"^0), "contents") + * blanklines^-1) / + function(res) return pandoc.Header(res.length, res.contents) end; + Inline = V"Emph" + V"Str" + V"Space" + V"SoftBreak" + V"Special" ; + Str = wordchar^1 / pandoc.Str; + Space = spacechar^1 / pandoc.Space; + SoftBreak = endline / pandoc.SoftBreak; + Emph = Ct(P"_{" * Cg(Ct((V"Inline" - P"}")^1), "contents") * P"}") / + function(res) return pandoc.Emph(res.contents) end; + Special = specialchar / pandoc.Str; +} + +function Reader(input) + return lpeg.match(G, input) +end diff --git a/pandoc.cabal b/pandoc.cabal index 8911cdb1b..a86cc71a3 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -642,6 +642,7 @@ library Text.Pandoc.Readers.Ipynb, Text.Pandoc.Readers.CSV, Text.Pandoc.Readers.RTF, + Text.Pandoc.Readers.Custom, Text.Pandoc.Writers, Text.Pandoc.Writers.Native, Text.Pandoc.Writers.Docbook, diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 20e647456..9eb9c2cf3 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -68,6 +68,7 @@ import Text.Pandoc.Shared (eastAsianLineBreakFilter, stripEmptyParagraphs, defaultUserDataDir, tshow) import Text.Pandoc.Writers.Shared (lookupMetaString) import Text.Pandoc.Readers.Markdown (yamlToMeta) +import Text.Pandoc.Readers.Custom (readCustom) import qualified Text.Pandoc.UTF8 as UTF8 #ifndef _WINDOWS import System.Posix.IO (stdOutput) @@ -154,11 +155,13 @@ convertWithOpts opts = do -> ByteStringReader $ \o t -> sandbox files (r o t) (reader, readerExts) <- - if optSandbox opts - then case runPure (getReader readerName) of - Left e -> throwError e - Right (r, rexts) -> return (makeSandboxed r, rexts) - else getReader readerName + if ".lua" `T.isSuffixOf` readerName + then return (TextReader (readCustom (T.unpack readerName)), mempty) + else if optSandbox opts + then case runPure (getReader readerName) of + Left e -> throwError e + Right (r, rexts) -> return (makeSandboxed r, rexts) + else getReader readerName outputSettings <- optToOutputSettings opts let format = outputFormat outputSettings diff --git a/src/Text/Pandoc/Readers/Custom.hs b/src/Text/Pandoc/Readers/Custom.hs new file mode 100644 index 000000000..83d82a9cc --- /dev/null +++ b/src/Text/Pandoc/Readers/Custom.hs @@ -0,0 +1,55 @@ +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} +{- | + Module : Text.Pandoc.Readers.Custom + Copyright : Copyright (C) 2021 John MacFarlane + License : GNU GPL, version 2 or above + + Maintainer : John MacFarlane + Stability : alpha + Portability : portable + +Supports custom parsers written in Lua which produce a Pandoc AST. +-} +module Text.Pandoc.Readers.Custom ( readCustom ) where +import Control.Exception +import Control.Monad (when) +import Data.Text (Text) +import HsLua as Lua hiding (Operation (Div), render) +import HsLua.Class.Peekable (PeekError) +import Control.Monad.IO.Class (MonadIO) +import Text.Pandoc.Definition +import Text.Pandoc.Lua (Global (..), runLua, setGlobals) +import Text.Pandoc.Lua.Util (dofileWithTraceback) +import Text.Pandoc.Options +import Text.Pandoc.Class (PandocMonad) +import Text.Pandoc.Sources (ToSources(..), sourcesToText) + +-- | Convert custom markup to Pandoc. +readCustom :: (PandocMonad m, MonadIO m, ToSources s) + => FilePath -> ReaderOptions -> s -> m Pandoc +readCustom luaFile opts sources = do + let input = sourcesToText $ toSources sources + let globals = [ PANDOC_SCRIPT_FILE luaFile + , PANDOC_READER_OPTIONS opts + ] + res <- runLua $ do + setGlobals globals + stat <- dofileWithTraceback luaFile + -- check for error in lua script (later we'll change the return type + -- to handle this more gracefully): + when (stat /= Lua.OK) + Lua.throwErrorAsException + parseCustom input + case res of + Left msg -> throw msg + Right doc -> return doc + +parseCustom :: forall e. PeekError e + => Text + -> LuaE e Pandoc +parseCustom = invoke @e "Reader" + -- cgit v1.2.3 From 6b462e59332242c18ea38a721ae672b88f33d621 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 6 Nov 2021 11:00:26 +0100 Subject: Lua: allow to pass custom reader options to `pandoc.read` Reader options can now be passed as an optional third argument to `pandoc.read`. The object can either be a table or a ReaderOptions value like `PANDOC_READER_OPTIONS`. Creating new ReaderOptions objects is possible through the new constructor `pandoc.ReaderOptions`. Closes: #7656 --- doc/lua-filters.md | 42 +++++++- src/Text/Pandoc/Lua/Global.hs | 4 +- src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs | 129 +++++++++++++++++------- src/Text/Pandoc/Lua/Module/Pandoc.hs | 16 ++- test/lua/module/pandoc.lua | 30 +++++- 5 files changed, 177 insertions(+), 44 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index e9a121f50..ba5f58120 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -2742,7 +2742,33 @@ format, and functions to filter and modify a subtree. [`sha1`]{#pandoc.sha1} : Alias for [`pandoc.utils.sha1`](#pandoc.utils.sha1) - (DEPRECATED). + (DEPRECATED, use `pandoc.utils.sha1` instead). + +## Other constructors + +[`ReaderOptions (opts)`]{#pandoc.readeroptions} + +: Creates a new [ReaderOptions] value. + + Parameters + + `opts`: + : Either a table with a subset of the properties of a + [ReaderOptions] object, or another ReaderOptions object. + Uses the defaults specified in the manual for all + properties that are not explicitly specified. Throws an + error if a table contains properties which are not present + in a ReaderOptions object. ([ReaderOptions]|table) + + Returns: new [ReaderOptions] object + + Usage: + + -- copy of the reader options that were defined on the command line. + local cli_opts = pandoc.ReaderOptions(PANDOC_READER_OPTIONS) + + -- default reader options, but columns set to 66. + local short_colums_opts = pandoc.ReaderOptions {columns = 66} ## Helper functions @@ -2815,17 +2841,23 @@ Returns: the transformed inline element ### read {#pandoc.read} -`read (markup[, format])` +`read (markup[, format[, reader_options]])` Parse the given string into a Pandoc document. Parameters: `markup`: -: the markup to be parsed +: the markup to be parsed (string) `format`: -: format specification, defaults to `"markdown"`. +: format specification, defaults to `"markdown"` (string) + +`reader_options`: +: options passed to the reader; may be a ReaderOptions object or + a table with a subset of the keys and values of a + ReaderOptions object; defaults to the default values + documented in the manual. ([ReaderOptions]|table) Returns: pandoc document @@ -2838,6 +2870,8 @@ Usage: -- The inline element in that block is an `Emph` assert(block.content[1].t == "Emph") +[ReaderOptions]: #type-readeroptions + # Module pandoc.utils This module exposes internal pandoc functions and utility diff --git a/src/Text/Pandoc/Lua/Global.hs b/src/Text/Pandoc/Lua/Global.hs index 23b3a8284..05510f45d 100644 --- a/src/Text/Pandoc/Lua/Global.hs +++ b/src/Text/Pandoc/Lua/Global.hs @@ -22,7 +22,7 @@ import Text.Pandoc.Definition (Pandoc (Pandoc), pandocTypesVersion) import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshaling () import Text.Pandoc.Lua.Marshaling.CommonState (pushCommonState) -import Text.Pandoc.Lua.Marshaling.ReaderOptions (pushReaderOptions) +import Text.Pandoc.Lua.Marshaling.ReaderOptions (pushReaderOptionsReadonly) import Text.Pandoc.Options (ReaderOptions) import qualified Data.Text as Text @@ -55,7 +55,7 @@ setGlobal global = case global of pushUD typePandocLazy doc Lua.setglobal "PANDOC_DOCUMENT" PANDOC_READER_OPTIONS ropts -> do - pushReaderOptions ropts + pushReaderOptionsReadonly ropts Lua.setglobal "PANDOC_READER_OPTIONS" PANDOC_SCRIPT_FILE filePath -> do Lua.push filePath diff --git a/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs b/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs index 2cc39ee3a..b19c209e8 100644 --- a/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs +++ b/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-orphans #-} @@ -15,8 +16,10 @@ Marshaling instance for ReaderOptions and its components. module Text.Pandoc.Lua.Marshaling.ReaderOptions ( peekReaderOptions , pushReaderOptions + , pushReaderOptionsReadonly ) where +import Data.Default (def) import HsLua as Lua import Text.Pandoc.Lua.Marshaling.List (pushPandocList) import Text.Pandoc.Options (ReaderOptions (..)) @@ -25,47 +28,103 @@ import Text.Pandoc.Options (ReaderOptions (..)) -- Reader Options -- +-- | Retrieve a ReaderOptions value, either from a normal ReaderOptions +-- value, from a read-only object, or from a table with the same +-- keys as a ReaderOptions object. peekReaderOptions :: LuaError e => Peeker e ReaderOptions -peekReaderOptions = peekUD typeReaderOptions +peekReaderOptions = retrieving "ReaderOptions" . \idx -> + liftLua (ltype idx) >>= \case + TypeUserdata -> choice [ peekUD typeReaderOptions + , peekUD typeReaderOptionsReadonly + ] + idx + TypeTable -> peekReaderOptionsTable idx + _ -> failPeek =<< + typeMismatchMessage "ReaderOptions userdata or table" idx +-- | Pushes a ReaderOptions value as userdata object. pushReaderOptions :: LuaError e => Pusher e ReaderOptions pushReaderOptions = pushUD typeReaderOptions +-- | Pushes a ReaderOptions object, but makes it read-only. +pushReaderOptionsReadonly :: LuaError e => Pusher e ReaderOptions +pushReaderOptionsReadonly = pushUD typeReaderOptionsReadonly + +-- | ReaderOptions object type for read-only values. +typeReaderOptionsReadonly :: LuaError e => DocumentedType e ReaderOptions +typeReaderOptionsReadonly = deftype "ReaderOptions (read-only)" + [ operation Tostring $ lambda + ### liftPure show + <#> udparam typeReaderOptions "opts" "options to print in native format" + =#> functionResult pushString "string" "Haskell representation" + , operation Newindex $ lambda + ### (failLua "This ReaderOptions value is read-only.") + =?> "Throws an error when called, i.e., an assignment is made." + ] + readerOptionsMembers + +-- | 'ReaderOptions' object type. typeReaderOptions :: LuaError e => DocumentedType e ReaderOptions -typeReaderOptions = deftype "pandoc ReaderOptions" - [ operation Tostring luaShow +typeReaderOptions = deftype "ReaderOptions" + [ operation Tostring $ lambda + ### liftPure show + <#> udparam typeReaderOptions "opts" "options to print in native format" + =#> functionResult pushString "string" "Haskell representation" ] - [ readonly "extensions" "" - ( pushString . show - , readerExtensions) - , readonly "standalone" "" - ( pushBool - , readerStandalone) - , readonly "columns" "" - ( pushIntegral - , readerColumns) - , readonly "tab_stop" "" - ( pushIntegral - , readerTabStop) - , readonly "indented_code_classes" "" - ( pushPandocList pushText - , readerIndentedCodeClasses) - , readonly "abbreviations" "" - ( pushSet pushText - , readerAbbreviations) - , readonly "track_changes" "" - ( pushString . show - , readerTrackChanges) - , readonly "strip_comments" "" - ( pushBool - , readerStripComments) - , readonly "default_image_extension" "" - ( pushText - , readerDefaultImageExtension) + readerOptionsMembers + +-- | Member properties of 'ReaderOptions' Lua values. +readerOptionsMembers :: LuaError e + => [Member e (DocumentedFunction e) ReaderOptions] +readerOptionsMembers = + [ property "abbreviations" "" + (pushSet pushText, readerAbbreviations) + (peekSet peekText, \opts x -> opts{ readerAbbreviations = x }) + , property "columns" "" + (pushIntegral, readerColumns) + (peekIntegral, \opts x -> opts{ readerColumns = x }) + , property "default_image_extension" "" + (pushText, readerDefaultImageExtension) + (peekText, \opts x -> opts{ readerDefaultImageExtension = x }) + , property "extensions" "" + (pushString . show, readerExtensions) + (peekRead, \opts x -> opts{ readerExtensions = x }) + , property "indented_code_classes" "" + (pushPandocList pushText, readerIndentedCodeClasses) + (peekList peekText, \opts x -> opts{ readerIndentedCodeClasses = x }) + , property "strip_comments" "" + (pushBool, readerStripComments) + (peekBool, \opts x -> opts{ readerStripComments = x }) + , property "standalone" "" + (pushBool, readerStandalone) + (peekBool, \opts x -> opts{ readerStandalone = x }) + , property "tab_stop" "" + (pushIntegral, readerTabStop) + (peekIntegral, \opts x -> opts{ readerTabStop = x }) + , property "track_changes" "" + (pushString . show, readerTrackChanges) + (peekRead, \opts x -> opts{ readerTrackChanges = x }) ] -luaShow :: LuaError e => DocumentedFunction e -luaShow = defun "__tostring" - ### liftPure show - <#> udparam typeReaderOptions "state" "object to print in native format" - =#> functionResult pushString "string" "Haskell representation" +-- | Retrieves a 'ReaderOptions' object from a table on the stack, using +-- the default values for all missing fields. +-- +-- Internally, this push the defaults reader options, sets each +-- key/value pair of the table in the userdata value, then retrieves the +-- object again. This will update all fields and complain about unknown +-- keys. +peekReaderOptionsTable :: LuaError e => Peeker e ReaderOptions +peekReaderOptionsTable idx = retrieving "ReaderOptions (table)" $ do + liftLua $ do + absidx <- absindex idx + pushUD typeReaderOptions def + let setFields = do + next absidx >>= \case + False -> return () -- all fields were copied + True -> do + pushvalue (nth 2) *> insert (nth 2) + settable (nth 4) -- set in userdata object + setFields + pushnil -- first key + setFields + peekUD typeReaderOptions top diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 33432b4d8..8f42a2988 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -42,6 +42,8 @@ import Text.Pandoc.Lua.Marshaling.Attr (mkAttr, mkAttributeList) import Text.Pandoc.Lua.Marshaling.List (List (..)) import Text.Pandoc.Lua.Marshaling.ListAttributes ( mkListAttributes , peekListAttributes) +import Text.Pandoc.Lua.Marshaling.ReaderOptions ( peekReaderOptions + , pushReaderOptions) import Text.Pandoc.Lua.Marshaling.SimpleTable (mkSimpleTable) import Text.Pandoc.Lua.Module.Utils (sha1) import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, @@ -355,6 +357,12 @@ otherConstructors = , mkAttributeList , mkListAttributes , mkSimpleTable + + , defun "ReaderOptions" + ### liftPure id + <#> parameter peekReaderOptions "ReaderOptions|table" "opts" "reader options" + =#> functionResult pushReaderOptions "ReaderOptions" "new object" + #? "Creates a new ReaderOptions value." ] stringConstants :: [Field e] @@ -405,10 +413,12 @@ functions = =?> "output string, or error triple" , defun "read" - ### (\content mformatspec -> do + ### (\content mformatspec mreaderOptions -> do let formatSpec = fromMaybe "markdown" mformatspec + readerOptions = fromMaybe def mreaderOptions res <- Lua.liftIO . runIO $ getReader formatSpec >>= \case - (TextReader r, es) -> r def{ readerExtensions = es } content + (TextReader r, es) -> r readerOptions{ readerExtensions = es } + content _ -> throwError $ PandocSomeError "Only textual formats are supported" case res of @@ -422,6 +432,8 @@ functions = throwM e) <#> parameter peekText "string" "content" "text to parse" <#> optionalParameter peekText "string" "formatspec" "format and extensions" + <#> optionalParameter peekReaderOptions "ReaderOptions" "reader_options" + "reader options" =#> functionResult pushPandoc "Pandoc" "result document" , sha1 diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 4da663f07..5a58914ef 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -809,7 +809,25 @@ return { ) assert.are_same(expected_table, new_table) end) - } + }, + group 'ReaderOptions' { + test('returns a userdata value', function () + local opts = pandoc.ReaderOptions {} + assert.are_equal(type(opts), 'userdata') + end), + test('can construct from table', function () + local opts = pandoc.ReaderOptions {columns = 66} + assert.are_equal(opts.columns, 66) + end), + test('can construct from other ReaderOptions value', function () + local orig = pandoc.ReaderOptions{columns = 65} + local copy = pandoc.ReaderOptions(orig) + for k, v in pairs(orig) do + assert.are_same(copy[k], v) + end + assert.are_equal(copy.columns, 65) + end), + }, }, group 'clone' { @@ -896,6 +914,16 @@ return { 'Extension empty_paragraphs not supported for gfm' ) end), + test('read with other indented code classes', function() + local indented_code = ' return true' + local expected = pandoc.Pandoc({ + pandoc.CodeBlock('return true', {class='foo'}) + }) + assert.are_same( + expected, + pandoc.read(indented_code, 'markdown', {indented_code_classes={'foo'}}) + ) + end), test('failing read', function () assert.error_matches( function () pandoc.read('foo', 'nosuchreader') end, -- cgit v1.2.3 From 4a3b3b1ac6b8dc0770fd1bbebb297c160d6ee57b Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 6 Nov 2021 17:57:10 +0100 Subject: Lua: add Pushable instance for ReaderOptions --- src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs b/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs index b19c209e8..91eb22ae9 100644 --- a/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs +++ b/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs @@ -109,7 +109,7 @@ readerOptionsMembers = -- | Retrieves a 'ReaderOptions' object from a table on the stack, using -- the default values for all missing fields. -- --- Internally, this push the defaults reader options, sets each +-- Internally, this pushes the default reader options, sets each -- key/value pair of the table in the userdata value, then retrieves the -- object again. This will update all fields and complain about unknown -- keys. @@ -128,3 +128,6 @@ peekReaderOptionsTable idx = retrieving "ReaderOptions (table)" $ do pushnil -- first key setFields peekUD typeReaderOptions top + +instance Pushable ReaderOptions where + push = pushReaderOptions -- cgit v1.2.3 From 822f8949841f851a56bbd964433aa60205609d20 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 6 Nov 2021 16:37:57 -0700 Subject: Fuller sample custom reader. --- data/reader.lua | 83 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 20 deletions(-) diff --git a/data/reader.lua b/data/reader.lua index 4aca4edd3..5cc2dfc0c 100644 --- a/data/reader.lua +++ b/data/reader.lua @@ -1,42 +1,85 @@ -- A sample custom reader for a very simple markup language. -- This parses a document into paragraphs separated by blank lines. --- This is _{italic} and this is *{boldface} --- This is an escaped special character: \_, \*, \{, \} +-- This is /italic/ and this is *boldface* and this is `code` +-- and `code``with backtick` (doubled `` = ` inside backticks). +-- This is an escaped special character: \_, \*, \\ -- == text makes a level-2 heading -- That's it! -- For better performance we put these functions in local variables: -local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B = +local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt = lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V, - lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B + lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt + +--- if item is a table, concatenate it to acc; +-- otherwise insert it at the end. +local function add_item(acc, item) + if acc == nil then + acc = {} + end + if type(item) == "table" then + for i = 1,#item do + add_item(acc, item[i]) + end + else + acc[#acc + 1] = item + end + return acc +end + +local function Many1(parser) + return Cf(Cc(nil) * parser^1 , add_item) +end + +local function Many(parser) + return (Many1(parser) + Cc{}) +end local whitespacechar = S(" \t\r\n") -local specialchar = S("_*{}\\") -local escapedchar = P"\\" * specialchar - / function (x) return string.sub(x,2) end -local wordchar = (P(1) - (whitespacechar + specialchar)) + escapedchar +local specialchar = S("/*\\`") +local wordchar = (1 - (whitespacechar + specialchar)) local spacechar = S(" \t") local newline = P"\r"^-1 * P"\n" -local blanklines = newline * spacechar^0 * newline^1 +local blanklines = newline * (spacechar^0 * newline)^1 local endline = newline - blanklines +local function BetweenDelims(c, parser, constructor) + local starter = P(c) * #(- whitespacechar) + local ender = B(1 - whitespacechar) * P(c) + return starter * Many(parser - ender) * C(ender^-1) / + function(contents, ender) + if ender == "" then -- fallback + return { pandoc.Str(c) , contents } + else + return constructor(contents) + end + end +end + + -- Grammar G = P{ "Pandoc", - Pandoc = blanklines^-1 * Ct(V"Block"^0) / pandoc.Pandoc; - Block = V"Header" + V"Para"; - Para = Ct(V"Inline"^1) * blanklines^-1 / pandoc.Para; - Header = Ct(Cg(P("=")^1 / function(x) return #x end, "length") + Pandoc = Many(V"Block") / pandoc.Pandoc; + Block = blanklines^0 * (V"Header" + V"Para") ; + Para = Many1(V"Inline") * blanklines^-1 / pandoc.Para; + Header = (P("=")^1 / string.len) * spacechar^1 - * Cg(Ct(V"Inline"^0), "contents") - * blanklines^-1) / - function(res) return pandoc.Header(res.length, res.contents) end; - Inline = V"Emph" + V"Str" + V"Space" + V"SoftBreak" + V"Special" ; + * Many(V"Inline" - (spacechar^0 * P("=")^0 * blanklines)) + * spacechar^0 + * P("=")^0 + * blanklines^-1 / + function(lev, contents) return pandoc.Header(lev, contents) end; + Inline = V"Emph" + V"Strong" + V"Str" + V"Space" + V"SoftBreak" + + V"Code" + V"Escaped" + V"Special"; Str = wordchar^1 / pandoc.Str; + Escaped = "\\" * C(specialchar) / function(s) return pandoc.Str(s) end; Space = spacechar^1 / pandoc.Space; SoftBreak = endline / pandoc.SoftBreak; - Emph = Ct(P"_{" * Cg(Ct((V"Inline" - P"}")^1), "contents") * P"}") / - function(res) return pandoc.Emph(res.contents) end; - Special = specialchar / pandoc.Str; + Emph = BetweenDelims("/", V"Inline", pandoc.Emph); + Strong = BetweenDelims("*", V"Inline", pandoc.Strong); + Code = P"`" * Ct(( (P"``" / "`") + (C(1) - S"`"))^1) * P"`" + / table.concat / pandoc.Code; + Special = S"`\\" / pandoc.Str; } function Reader(input) -- cgit v1.2.3 From 213913f02554b5cec8ea946538d8ba445d4d3f4e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 6 Nov 2021 16:45:03 -0700 Subject: Pass ReaderOptions to custom readers as second parameter. --- MANUAL.txt | 6 +++--- data/reader.lua | 2 +- src/Text/Pandoc/Readers/Custom.hs | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 7e9f9f85a..dc973f958 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -6596,9 +6596,9 @@ is available by default. To see a sample custom reader: pandoc --print-default-data-file reader.lua -Reader options are available via the global variable -`PANDOC_READER_OPTIONS`, as expalined in the [Lua filters -documentation]. +If you want your custom reader to have access to reader options +(e.g. the tab stop setting), you give your Reader function a +second `options` parameter. A custom writer is a Lua script that defines a function that specifies how to render each element in a Pandoc AST. diff --git a/data/reader.lua b/data/reader.lua index 5cc2dfc0c..e466e6ea1 100644 --- a/data/reader.lua +++ b/data/reader.lua @@ -82,6 +82,6 @@ G = P{ "Pandoc", Special = S"`\\" / pandoc.Str; } -function Reader(input) +function Reader(input, opts) return lpeg.match(G, input) end diff --git a/src/Text/Pandoc/Readers/Custom.hs b/src/Text/Pandoc/Readers/Custom.hs index 83d82a9cc..d7336012b 100644 --- a/src/Text/Pandoc/Readers/Custom.hs +++ b/src/Text/Pandoc/Readers/Custom.hs @@ -33,9 +33,7 @@ readCustom :: (PandocMonad m, MonadIO m, ToSources s) => FilePath -> ReaderOptions -> s -> m Pandoc readCustom luaFile opts sources = do let input = sourcesToText $ toSources sources - let globals = [ PANDOC_SCRIPT_FILE luaFile - , PANDOC_READER_OPTIONS opts - ] + let globals = [ PANDOC_SCRIPT_FILE luaFile ] res <- runLua $ do setGlobals globals stat <- dofileWithTraceback luaFile @@ -43,13 +41,14 @@ readCustom luaFile opts sources = do -- to handle this more gracefully): when (stat /= Lua.OK) Lua.throwErrorAsException - parseCustom input + parseCustom input opts case res of Left msg -> throw msg Right doc -> return doc parseCustom :: forall e. PeekError e => Text + -> ReaderOptions -> LuaE e Pandoc parseCustom = invoke @e "Reader" -- cgit v1.2.3 From 881b45209e8fd70079e409d05fa7402741501940 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 7 Nov 2021 14:33:18 -0800 Subject: Replace old sample custom reader with a full-featured reader for creole. This is better as an example. And it is faster than pandoc's regular creole parser, which shows that high-performance readers can be developed this way. --- MANUAL.txt | 2 +- data/creole.lua | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ data/reader.lua | 87 ------------------------- pandoc.cabal | 2 + 4 files changed, 200 insertions(+), 88 deletions(-) create mode 100644 data/creole.lua delete mode 100644 data/reader.lua diff --git a/MANUAL.txt b/MANUAL.txt index dc973f958..b1f75961b 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -6594,7 +6594,7 @@ of the functions that are available for creating pandoc AST elements. For parsing, the [lpeg] parsing library is available by default. To see a sample custom reader: - pandoc --print-default-data-file reader.lua + pandoc --print-default-data-file creole.lua If you want your custom reader to have access to reader options (e.g. the tab stop setting), you give your Reader function a diff --git a/data/creole.lua b/data/creole.lua new file mode 100644 index 000000000..ffde73638 --- /dev/null +++ b/data/creole.lua @@ -0,0 +1,197 @@ +-- A sample custom reader for Creole 1.0 (common wiki markup) +-- http://www.wikicreole.org/wiki/CheatSheet + +-- For better performance we put these functions in local variables: +local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt = + lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V, + lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt + +local whitespacechar = S(" \t\r\n") +local specialchar = S("/*~[]\\{}|") +local wordchar = (1 - (whitespacechar + specialchar)) +local spacechar = S(" \t") +local newline = P"\r"^-1 * P"\n" +local blankline = spacechar^0 * newline +local endline = newline * #-blankline +local endequals = spacechar^0 * P"="^0 * spacechar^0 * newline +local cellsep = spacechar^0 * P"|" + +local function trim(s) + return (s:gsub("^%s*(.-)%s*$", "%1")) +end + +local function ListItem(lev, ch) + local start + if ch == nil then + start = S"*#" + else + start = P(ch) + end + local subitem = function(c) + if lev < 6 then + return ListItem(lev + 1, c) + else + return (1 - 1) -- fails + end + end + local parser = spacechar^0 + * start^lev + * #(- start) + * spacechar^0 + * Ct((V"Inline" - (newline * spacechar^0 * S"*#"))^0) + * newline + * (Ct(subitem("*")^1) / pandoc.BulletList + + + Ct(subitem("#")^1) / pandoc.OrderedList + + + Cc(nil)) + / function (ils, sublist) + return { pandoc.Plain(ils), sublist } + end + return parser +end + +local re = require're' +x = re.compile[[ + listname <- {| {:tag: '' -> 'list':} (name s)* |} + name <- {| {:tag: '' -> 'id':} {[a-z][a-z]*} |} + s <- ' '* +]] + +-- Grammar +G = P{ "Doc", + Doc = Ct(V"Block"^0) + / pandoc.Pandoc ; + Block = blankline^0 + * ( V"Header" + + V"HorizontalRule" + + V"CodeBlock" + + V"List" + + V"Table" + + V"Para") ; + Para = Ct(V"Inline"^1) + * newline + / pandoc.Para ; + HorizontalRule = spacechar^0 + * P"----" + * spacechar^0 + * newline + / pandoc.HorizontalRule; + Header = (P("=")^1 / string.len) + * spacechar^1 + * Ct((V"Inline" - endequals)^1) + * endequals + / pandoc.Header; + CodeBlock = P"{{{" + * blankline + * C((1 - (newline * P"}}}"))^0) + * newline + * P"}}}" + / pandoc.CodeBlock; + Placeholder = P"<<<" + * C(P(1) - P">>>")^0 + * P">>>" + / function() return pandoc.Div({}) end; + List = V"BulletList" + + V"OrderedList" ; + BulletList = Ct(ListItem(1,'*')^1) + / pandoc.BulletList ; + OrderedList = Ct(ListItem(1,'#')^1) + / pandoc.OrderedList ; + Table = (V"TableHeader" + Cc{}) + * Ct(V"TableRow"^1) + / function(headrow, bodyrows) + local numcolumns = #(bodyrows[1]) + local aligns = {} + local widths = {} + for i = 1,numcolumns do + aligns[i] = pandoc.AlignDefault + widths[i] = 0 + end + return pandoc.utils.from_simple_table( + pandoc.SimpleTable({}, aligns, widths, headrow, bodyrows)) + end ; + TableHeader = Ct(V"HeaderCell"^1) + * cellsep^-1 + * spacechar^0 + * newline ; + TableRow = Ct(V"BodyCell"^1) + * cellsep^-1 + * spacechar^0 + * newline ; + HeaderCell = cellsep + * P"=" + * spacechar^0 + * Ct((V"Inline" - (newline + cellsep))^0) + / function(ils) return { pandoc.Plain(ils) } end ; + BodyCell = cellsep + * spacechar^0 + * Ct((V"Inline" - (newline + cellsep))^0) + / function(ils) return { pandoc.Plain(ils) } end ; + Inline = V"Emph" + + V"Strong" + + V"LineBreak" + + V"Link" + + V"URL" + + V"Image" + + V"Str" + + V"Space" + + V"SoftBreak" + + V"Escaped" + + V"Placeholder" + + V"Code" + + V"Special" ; + Str = wordchar^1 + / pandoc.Str; + Escaped = P"~" + * C(P(1)) + / pandoc.Str ; + Special = specialchar + / pandoc.Str; + Space = spacechar^1 + / pandoc.Space ; + SoftBreak = endline + * # -(V"HorizontalRule" + V"CodeBlock") + / pandoc.SoftBreak ; + LineBreak = P"\\\\" + / pandoc.LineBreak ; + Code = P"{{{" + * C((1 - P"}}}")^0) + * P"}}}" + / trim / pandoc.Code ; + Link = P"[[" + * C((1 - (P"]]" + P"|"))^0) + * (P"|" * Ct((V"Inline" - P"]]")^1))^-1 * P"]]" + / function(url, desc) + local txt = desc or {pandoc.Str(url)} + return pandoc.Link(txt, url) + end ; + Image = P"{{" + * #-P"{" + * C((1 - (S"}"))^0) + * (P"|" * Ct((V"Inline" - P"}}")^1))^-1 + * P"}}" + / function(url, desc) + local txt = desc or "" + return pandoc.Image(txt, url) + end ; + URL = P"http" + * P"s"^-1 + * P":" + * (1 - (whitespacechar + (S",.?!:;\"'" * #whitespacechar)))^1 + / function(url) + return pandoc.Link(pandoc.Str(url), url) + end ; + Emph = P"//" + * Ct((V"Inline" - P"//")^1) + * P"//" + / pandoc.Emph ; + Strong = P"**" + * Ct((V"Inline" -P"**")^1) + * P"**" + / pandoc.Strong ; +} + +function Reader(input, reader_options) + return lpeg.match(G, input) +end diff --git a/data/reader.lua b/data/reader.lua deleted file mode 100644 index e466e6ea1..000000000 --- a/data/reader.lua +++ /dev/null @@ -1,87 +0,0 @@ --- A sample custom reader for a very simple markup language. --- This parses a document into paragraphs separated by blank lines. --- This is /italic/ and this is *boldface* and this is `code` --- and `code``with backtick` (doubled `` = ` inside backticks). --- This is an escaped special character: \_, \*, \\ --- == text makes a level-2 heading --- That's it! - --- For better performance we put these functions in local variables: -local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt = - lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V, - lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt - ---- if item is a table, concatenate it to acc; --- otherwise insert it at the end. -local function add_item(acc, item) - if acc == nil then - acc = {} - end - if type(item) == "table" then - for i = 1,#item do - add_item(acc, item[i]) - end - else - acc[#acc + 1] = item - end - return acc -end - -local function Many1(parser) - return Cf(Cc(nil) * parser^1 , add_item) -end - -local function Many(parser) - return (Many1(parser) + Cc{}) -end - -local whitespacechar = S(" \t\r\n") -local specialchar = S("/*\\`") -local wordchar = (1 - (whitespacechar + specialchar)) -local spacechar = S(" \t") -local newline = P"\r"^-1 * P"\n" -local blanklines = newline * (spacechar^0 * newline)^1 -local endline = newline - blanklines - -local function BetweenDelims(c, parser, constructor) - local starter = P(c) * #(- whitespacechar) - local ender = B(1 - whitespacechar) * P(c) - return starter * Many(parser - ender) * C(ender^-1) / - function(contents, ender) - if ender == "" then -- fallback - return { pandoc.Str(c) , contents } - else - return constructor(contents) - end - end -end - - --- Grammar -G = P{ "Pandoc", - Pandoc = Many(V"Block") / pandoc.Pandoc; - Block = blanklines^0 * (V"Header" + V"Para") ; - Para = Many1(V"Inline") * blanklines^-1 / pandoc.Para; - Header = (P("=")^1 / string.len) - * spacechar^1 - * Many(V"Inline" - (spacechar^0 * P("=")^0 * blanklines)) - * spacechar^0 - * P("=")^0 - * blanklines^-1 / - function(lev, contents) return pandoc.Header(lev, contents) end; - Inline = V"Emph" + V"Strong" + V"Str" + V"Space" + V"SoftBreak" + - V"Code" + V"Escaped" + V"Special"; - Str = wordchar^1 / pandoc.Str; - Escaped = "\\" * C(specialchar) / function(s) return pandoc.Str(s) end; - Space = spacechar^1 / pandoc.Space; - SoftBreak = endline / pandoc.SoftBreak; - Emph = BetweenDelims("/", V"Inline", pandoc.Emph); - Strong = BetweenDelims("*", V"Inline", pandoc.Strong); - Code = P"`" * Ct(( (P"``" / "`") + (C(1) - S"`"))^1) * P"`" - / table.concat / pandoc.Code; - Special = S"`\\" / pandoc.Str; -} - -function Reader(input, opts) - return lpeg.match(G, input) -end diff --git a/pandoc.cabal b/pandoc.cabal index a86cc71a3..764b459ba 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -174,6 +174,8 @@ data-files: data/abbreviations -- sample lua custom writer data/sample.lua + -- sample lua custom reader + data/creole.lua -- lua init script data/init.lua -- pandoc lua module -- cgit v1.2.3 From cc46667953b609d87bbf5611f50843871b304a0c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 7 Nov 2021 21:08:20 -0800 Subject: LaTeX reader: add 'uri' class when parsing `\url`. Closes #7672. --- src/Text/Pandoc/Readers/LaTeX.hs | 4 ++-- test/command/3681.md | 2 +- test/command/4832.md | 4 ++-- test/latex-reader.native | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 15148debb..25acc0f7e 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -390,8 +390,8 @@ inlineCommands = M.unions unescapeURL . removeDoubleQuotes $ untokenize src) -- hyperref - , ("url", (\url -> link url "" (str url)) . unescapeURL . untokenize <$> - bracedUrl) + , ("url", (\url -> linkWith ("",["uri"],[]) url "" (str url)) + . unescapeURL . untokenize <$> bracedUrl) , ("nolinkurl", code . unescapeURL . untokenize <$> bracedUrl) , ("href", do url <- bracedUrl sp diff --git a/test/command/3681.md b/test/command/3681.md index 3e6c71a47..dc6b90860 100644 --- a/test/command/3681.md +++ b/test/command/3681.md @@ -45,7 +45,7 @@ Software developers create \cicd pipelines to… Following issue can be resolved , Note [ Para [ Link - ( "" , [] , [] ) + ( "" , [ "uri" ] , [] ) [ Str "https://en.wikipedia.org/wiki/CI/CD" ] ( "https://en.wikipedia.org/wiki/CI/CD" , "" ) ] diff --git a/test/command/4832.md b/test/command/4832.md index 5e9f2ac77..ec636b2b7 100644 --- a/test/command/4832.md +++ b/test/command/4832.md @@ -4,7 +4,7 @@ ^D [ Para [ Link - ( "" , [] , [] ) + ( "" , [ "uri" ] , [] ) [ Str "http://example.com/foo%20bar.htm" ] ( "http://example.com/foo%20bar.htm" , "" ) ] @@ -17,7 +17,7 @@ ^D [ Para [ Link - ( "" , [] , [] ) + ( "" , [ "uri" ] , [] ) [ Str "http://example.com/foo{bar}.htm" ] ( "http://example.com/foo{bar}.htm" , "" ) ] diff --git a/test/latex-reader.native b/test/latex-reader.native index 2be447c0d..32ee86899 100644 --- a/test/latex-reader.native +++ b/test/latex-reader.native @@ -1868,7 +1868,7 @@ Pandoc , Str "ampersand:" , Space , Link - ( "" , [] , [] ) + ( "" , [ "uri" ] , [] ) [ Str "http://example.com/?foo=1&bar=2" ] ( "http://example.com/?foo=1&bar=2" , "" ) ] @@ -1878,7 +1878,7 @@ Pandoc ] , [ Para [ Link - ( "" , [] , [] ) + ( "" , [ "uri" ] , [] ) [ Str "http://example.com/" ] ( "http://example.com/" , "" ) ] @@ -1902,7 +1902,7 @@ Pandoc [ Str "Blockquoted:" , Space , Link - ( "" , [] , [] ) + ( "" , [ "uri" ] , [] ) [ Str "http://example.com/" ] ( "http://example.com/" , "" ) ] -- cgit v1.2.3 From ab0fe676a8507ea1ff4e77b97f548a92b13b6317 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 8 Nov 2021 12:14:44 +0100 Subject: Lua: ensure that 're' module is always available. The module is shipped with LPeg. --- pandoc.cabal | 2 +- src/Text/Pandoc/Lua/Init.hs | 8 ++++++++ test/Tests/Lua.hs | 10 +++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 764b459ba..438ad3942 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -563,7 +563,7 @@ library http-types >= 0.8 && < 0.13, ipynb >= 0.1.0.2 && < 0.2, jira-wiki-markup >= 1.4 && < 1.5, - lpeg >= 1.0 && < 1.1, + lpeg >= 1.0.1 && < 1.1, mtl >= 2.2 && < 2.3, network >= 2.6, network-uri >= 2.6 && < 2.8, diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index 5b2a2f3e4..727c79d84 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -46,6 +46,7 @@ initLuaState :: PandocLua () initLuaState = do liftPandocLua Lua.openlibs installPandocPackageSearcher + installLpegSearcher initPandocModule requireGlobalModules loadInitScript "init.lua" @@ -99,6 +100,13 @@ initLuaState = do -- Module on top of stack. Register as global Lua.setglobal "lpeg" + installLpegSearcher :: PandocLua () + installLpegSearcher = liftPandocLua $ do + Lua.getglobal' "package.searchers" + Lua.pushHaskellFunction $ Lua.state >>= liftIO . LPeg.lpeg_searcher + Lua.rawseti (Lua.nth 2) . (+1) . fromIntegral =<< Lua.rawlen (Lua.nth 2) + Lua.pop 1 -- remove 'package.searchers' from stack + -- | AST elements are marshaled via normal constructor functions in the -- @pandoc@ module. However, accessing Lua globals from Haskell is -- expensive (due to error handling). Accessing the Lua registry is much diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index d3694d8a9..6ee07f8fa 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -18,7 +18,7 @@ import Control.Monad (when) import HsLua as Lua hiding (Operation (Div), error) import System.FilePath (()) import Test.Tasty (TestTree, localOption) -import Test.Tasty.HUnit (Assertion, HasCallStack, assertEqual, testCase) +import Test.Tasty.HUnit ((@=?), Assertion, HasCallStack, assertEqual, testCase) import Test.Tasty.QuickCheck (QuickCheckTests (..), ioProperty, testProperty) import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder (bulletList, definitionList, displayMath, divWith, @@ -211,6 +211,14 @@ tests = map (localOption (QuickCheckTests 20)) ty <- Lua.ltype Lua.top Lua.liftIO $ assertEqual "module should be a table" Lua.TypeTable ty + , testCase "module 'lpeg' is loaded into a global" . runLuaTest $ do + s <- Lua.dostring "assert(type(lpeg)=='table');assert(lpeg==require'lpeg')" + Lua.liftIO $ Lua.OK @=? s + + , testCase "module 're' is available" . runLuaTest $ do + s <- Lua.dostring "require 're'" + Lua.liftIO $ Lua.OK @=? s + , testCase "informative error messages" . runLuaTest $ do Lua.pushboolean True -- Lua.newtable -- cgit v1.2.3 From 327bdd66b6874eefe0f339e6d8270e4323cfb8df Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 8 Nov 2021 16:03:17 +0100 Subject: stack.yaml: require latest lpeg --- stack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.yaml b/stack.yaml index 656063846..3d46b814f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,7 +12,7 @@ extra-deps: - doctemplates-0.10 - emojis-0.1.2 - doclayout-0.3.1.1 -- lpeg-1.0.0 +- lpeg-1.0.1 - hslua-2.0.1 - hslua-classes-2.0.0 - hslua-core-2.0.0.2 -- cgit v1.2.3 From 19eb5c6d6ae5b660b309d7a9704a3352ffb3cc5f Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 5 Nov 2021 12:39:10 +0100 Subject: Add disableLayout variable in revealjs template This allows to modify it using Pandoc variable. Default value is correctly set to false by Pandoc. --- data/templates/default.revealjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/templates/default.revealjs b/data/templates/default.revealjs index 45727e2d2..e1ca8b824 100644 --- a/data/templates/default.revealjs +++ b/data/templates/default.revealjs @@ -137,7 +137,7 @@ $endif$ // Disables the default reveal.js slide layout (scaling and centering) // so that you can use custom CSS layout - disableLayout: false, + disableLayout: $disableLayout$, // Vertical centering of slides center: $center$, -- cgit v1.2.3 From 40aa74badc2686b8b9a4ae7f836529cec2f4779b Mon Sep 17 00:00:00 2001 From: Rowan Rodrik van der Molen Date: Sun, 31 Oct 2021 13:21:54 +0000 Subject: Add `` support to DocBook reader --- src/Text/Pandoc/Readers/DocBook.hs | 17 ++++++++++++----- test/docbook-reader.docbook | 4 ++++ test/docbook-reader.native | 7 +++++++ test/docbook-xref.native | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index bdf802925..be90eb23e 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -19,7 +19,7 @@ import Data.Foldable (asum) import Data.Generics import Data.List (intersperse,elemIndex) import Data.List.NonEmpty (nonEmpty) -import Data.Maybe (catMaybes,fromMaybe,mapMaybe) +import Data.Maybe (catMaybes,fromMaybe,mapMaybe,maybeToList) import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Lazy as TL @@ -829,7 +829,7 @@ parseBlock (Elem e) = "section" -> gets dbSectionLevel >>= sect . (+1) "simplesect" -> gets dbSectionLevel >>= - sectWith (attrValue "id" e,["unnumbered"],[]) . (+1) + sectWith(attrValue "id" e) ["unnumbered"] [] . (+1) "refsect1" -> sect 1 "refsect2" -> sect 2 "refsect3" -> sect 3 @@ -994,8 +994,8 @@ parseBlock (Elem e) = (TableHead nullAttr $ toHeaderRow headrows) [TableBody nullAttr 0 [] $ map toRow bodyrows] (TableFoot nullAttr []) - sect n = sectWith (attrValue "id" e,[],[]) n - sectWith attr n = do + sect n = sectWith(attrValue "id" e) [] [] n + sectWith elId classes attrs n = do isbook <- gets dbBook let n' = if isbook || n == 0 then n + 1 else n headerText <- case filterChild (named "title") e `mplus` @@ -1006,7 +1006,14 @@ parseBlock (Elem e) = modify $ \st -> st{ dbSectionLevel = n } b <- getBlocks e modify $ \st -> st{ dbSectionLevel = n - 1 } - return $ headerWith attr n' headerText <> b + return $ headerWith (elId, classes, maybeToList titleabbrevElAsAttr++attrs) n' headerText <> b + titleabbrevElAsAttr = do + txt <- case filterChild (named "titleabbrev") e `mplus` + (filterChild (named "info") e >>= + filterChild (named "titleabbrev")) of + Just t -> Just ("titleabbrev", strContentRecursive t) + Nothing -> Nothing + return txt lineItems = mapM getInlines $ filterChildren (named "line") e -- | Admonitions are parsed into a div. Following other Docbook tools that output HTML, -- we parse the optional title as a div with the @title@ class, and give the diff --git a/test/docbook-reader.docbook b/test/docbook-reader.docbook index 00bd84649..8b0b34c42 100644 --- a/test/docbook-reader.docbook +++ b/test/docbook-reader.docbook @@ -1615,4 +1615,8 @@ or here: <http://example.com/> foodbig baguette supremeNested content in index term elements is flattened. + + Abbreviated title + Abbr. title + diff --git a/test/docbook-reader.native b/test/docbook-reader.native index 7520068b1..16eef6632 100644 --- a/test/docbook-reader.native +++ b/test/docbook-reader.native @@ -3117,4 +3117,11 @@ Pandoc , Space , Str "flattened." ] + , Header + 1 + ( "titleabbrev" + , [] + , [ ( "titleabbrev" , "Abbr. title" ) ] + ) + [ Str "Abbreviated" , Space , Str "title" ] ] diff --git a/test/docbook-xref.native b/test/docbook-xref.native index 1b4ced24e..2983eac0c 100644 --- a/test/docbook-xref.native +++ b/test/docbook-xref.native @@ -156,7 +156,7 @@ Pandoc [ Str "Some" , Space , Str "content" , Space , Str "here" ] , Header 1 - ( "ch04" , [] , [] ) + ( "ch04" , [] , [ ( "titleabbrev" , "Chapter 4" ) ] ) [ Str "The" , Space , Str "Fourth" , Space , Str "Chapter" ] , Para [ Str "Some" , Space , Str "content" , Space , Str "here" ] -- cgit v1.2.3 From 60233cf07e577f25c3d9e0ffd5fccd9e318d4bae Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 8 Nov 2021 08:12:55 -0800 Subject: Remove some extra stuff from data/creole.lua. --- data/creole.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/data/creole.lua b/data/creole.lua index ffde73638..5b7d7f554 100644 --- a/data/creole.lua +++ b/data/creole.lua @@ -51,13 +51,6 @@ local function ListItem(lev, ch) return parser end -local re = require're' -x = re.compile[[ - listname <- {| {:tag: '' -> 'list':} (name s)* |} - name <- {| {:tag: '' -> 'id':} {[a-z][a-z]*} |} - s <- ' '* -]] - -- Grammar G = P{ "Doc", Doc = Ct(V"Block"^0) -- cgit v1.2.3 From 0a45f2600ada92e2c21ee5f819e11da90202116e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 8 Nov 2021 10:15:53 -0800 Subject: Properly handle commented lines in BibTeX/BibLaTeX. Closes #7668. --- src/Text/Pandoc/Citeproc/BibTeX.hs | 45 +++++++++++++++++++++++--------------- test/command/7668.md | 36 ++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 18 deletions(-) create mode 100644 test/command/7668.md diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs index 75990f0a7..66bb9bbe3 100644 --- a/src/Text/Pandoc/Citeproc/BibTeX.hs +++ b/src/Text/Pandoc/Citeproc/BibTeX.hs @@ -48,7 +48,7 @@ import Control.Monad.RWS hiding ((<>)) import qualified Data.Sequence as Seq import Data.Char (isAlphaNum, isDigit, isLetter, isUpper, toLower, toUpper, - isLower, isPunctuation) + isLower, isPunctuation, isSpace) import Data.List (foldl', intercalate, intersperse) import Safe (readMay) import Text.Printf (printf) @@ -804,30 +804,34 @@ bibEntries = do skipMany nonEntry many (bibItem <* skipMany nonEntry) where nonEntry = bibSkip <|> + comment <|> try (char '@' >> (bibComment <|> bibPreamble <|> bibString)) bibSkip :: BibParser () -bibSkip = skipMany1 (satisfy (/='@')) +bibSkip = skipMany1 (satisfy (\c -> c /='@' && c /='%')) + +comment :: BibParser () +comment = char '%' *> void anyLine bibComment :: BibParser () bibComment = do cistring "comment" - spaces + spaces' void inBraces <|> bibSkip <|> return () bibPreamble :: BibParser () bibPreamble = do cistring "preamble" - spaces + spaces' void inBraces bibString :: BibParser () bibString = do cistring "string" - spaces + spaces' char '{' - spaces + spaces' (k,v) <- entField char '}' updateState (\(l,m) -> (l, Map.insert k v m)) @@ -840,10 +844,11 @@ inBraces :: BibParser Text inBraces = do char '{' res <- manyTill - ( take1WhileP (\c -> c /= '{' && c /= '}' && c /= '\\') + ( take1WhileP (\c -> c /= '{' && c /= '}' && c /= '\\' && c /= '%') <|> (char '\\' >> ( (char '{' >> return "\\{") <|> (char '}' >> return "\\}") <|> return "\\")) + <|> ("" <$ (char '%' >> anyLine)) <|> (braced <$> inBraces) ) (char '}') return $ T.concat res @@ -855,8 +860,9 @@ inQuotes :: BibParser Text inQuotes = do char '"' T.concat <$> manyTill - ( take1WhileP (\c -> c /= '{' && c /= '"' && c /= '\\') + ( take1WhileP (\c -> c /= '{' && c /= '"' && c /= '\\' && c /= '%') <|> (char '\\' >> T.cons '\\' . T.singleton <$> anyChar) + <|> ("" <$ (char '%' >> anyLine)) <|> braced <$> inBraces ) (char '"') @@ -869,32 +875,35 @@ isBibtexKeyChar :: Char -> Bool isBibtexKeyChar c = isAlphaNum c || c `elem` (".:;?!`'()$/*@_+=-[]*&" :: [Char]) +spaces' :: BibParser () +spaces' = skipMany (void (satisfy isSpace) <|> comment) + bibItem :: BibParser Item bibItem = do char '@' pos <- getPosition enttype <- T.toLower <$> take1WhileP isLetter - spaces + spaces' char '{' - spaces + spaces' entid <- take1WhileP isBibtexKeyChar - spaces + spaces' char ',' - spaces - entfields <- entField `sepEndBy` (char ',' >> spaces) - spaces + spaces' + entfields <- entField `sepEndBy` (char ',' >> spaces') + spaces' char '}' return $ Item entid pos enttype (Map.fromList entfields) entField :: BibParser (Text, Text) entField = do k <- fieldName - spaces + spaces' char '=' - spaces + spaces' vs <- (expandString <|> inQuotes <|> inBraces <|> rawWord) `sepBy` - try (spaces >> char '#' >> spaces) - spaces + try (spaces' >> char '#' >> spaces') + spaces' return (k, T.concat vs) resolveAlias :: Text -> Text diff --git a/test/command/7668.md b/test/command/7668.md new file mode 100644 index 000000000..6f85aa4de --- /dev/null +++ b/test/command/7668.md @@ -0,0 +1,36 @@ +``` +% pandoc -f bibtex -t csljson +%@Book{JW82, + author = {Richard A. Johnson and Dean W. Wichern}, + title = {Applied Multivariate Statistical Analysis}, + publisher= {Prentice-Hall}, + year = {1983} +} +@Book{JW83, + author = {Richard %A. + B. Johnson}, +% title = {Multivariate Analysis}, + year = "% + 1983" +} +^D +[ + { + "author": [ + { + "family": "Johnson", + "given": "Richard B." + } + ], + "id": "JW83", + "issued": { + "date-parts": [ + [ + 1983 + ] + ] + }, + "type": "book" + } +] +``` -- cgit v1.2.3 From 9c153e3d6e877ce53e8e4f5a9c44f682b973e777 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 8 Nov 2021 11:59:13 -0800 Subject: With `-t latex-smart`, don't generate `\ldots` from ellipsis. Instead just use unicode ellipsis. Closes #7674. --- src/Text/Pandoc/Writers/LaTeX/Util.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/LaTeX/Util.hs b/src/Text/Pandoc/Writers/LaTeX/Util.hs index d79326e0d..916ca1a99 100644 --- a/src/Text/Pandoc/Writers/LaTeX/Util.hs +++ b/src/Text/Pandoc/Writers/LaTeX/Util.hs @@ -124,7 +124,7 @@ stringToLaTeX context zs = do '\160' -> emits "~" '\x200B' -> emits "\\hspace{0pt}" -- zero-width space '\x202F' -> emits "\\," - '\x2026' -> emitcseq "\\ldots" + '\x2026' | ligatures -> emitcseq "\\ldots" '\x2018' | ligatures -> emitquote "`" '\x2019' | ligatures -> emitquote "'" '\x201C' | ligatures -> emitquote "``" -- cgit v1.2.3 From d4c73d5e6536535015f953ba2e5c3b83979819af Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 9 Nov 2021 14:43:18 +0100 Subject: Lua: fix argument order in constructor `pandoc.Cite`. This restores the old behavior; argument order had been switched accidentally in pandoc 2.15. --- src/Text/Pandoc/Lua/Module/Pandoc.hs | 4 ++-- test/lua/module/pandoc.lua | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 8f42a2988..a8b111092 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -135,9 +135,9 @@ pushWithConstructorsSubtable constructors = do inlineConstructors :: LuaError e => [DocumentedFunction e] inlineConstructors = [ defun "Cite" - ### liftPure2 Cite - <#> parameter (peekList peekCitation) "citations" "list of Citations" "" + ### liftPure2 (flip Cite) <#> parameter peekInlinesFuzzy "content" "Inline" "placeholder content" + <#> parameter (peekList peekCitation) "citations" "list of Citations" "" =#> functionResult pushInline "Inline" "cite element" , defun "Code" ### liftPure2 (\text mattr -> Code (fromMaybe nullAttr mattr) text) diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 5a58914ef..4f4a9b27e 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -151,17 +151,17 @@ return { group "Inline elements" { group 'Cite' { test('has property `content`', function () - local cite = pandoc.Cite({}, {pandoc.Emph 'important'}) + local cite = pandoc.Cite({pandoc.Emph 'important'}, {}) assert.are_same(cite.content, {pandoc.Emph {pandoc.Str 'important'}}) cite.content = 'boring' - assert.are_equal(cite, pandoc.Cite({}, {pandoc.Str 'boring'})) + assert.are_equal(cite, pandoc.Cite({pandoc.Str 'boring'}, {})) end), test('has list of citations in property `cite`', function () local citations = { pandoc.Citation('einstein1905', 'NormalCitation') } - local cite = pandoc.Cite(citations, 'relativity') + local cite = pandoc.Cite('relativity', citations) assert.are_same(cite.citations, citations) local new_citations = { @@ -169,7 +169,7 @@ return { pandoc.Citation('Poincaré1905', 'NormalCitation') } cite.citations = new_citations - assert.are_equal(cite, pandoc.Cite(new_citations, {'relativity'})) + assert.are_equal(cite, pandoc.Cite({'relativity'}, new_citations)) end), }, group 'Code' { -- cgit v1.2.3 From 5fb3b82bdf2accb785380c78cf8481bbe06b73f1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 9 Nov 2021 12:59:26 -0800 Subject: Accept empty `--metadata-file`. Closes #7675. This is a regression from 2.15 behavior. --- src/Text/Pandoc/Readers/Metadata.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Text/Pandoc/Readers/Metadata.hs b/src/Text/Pandoc/Readers/Metadata.hs index 534a7645b..30760e933 100644 --- a/src/Text/Pandoc/Readers/Metadata.hs +++ b/src/Text/Pandoc/Readers/Metadata.hs @@ -42,6 +42,7 @@ yamlBsToMeta :: (PandocMonad m, HasLastStrPosition st) yamlBsToMeta pMetaValue bstr = do case Yaml.decodeAllEither' bstr of Right (Object o:_) -> fmap Meta <$> yamlMap pMetaValue o + Right [] -> return . return $ mempty Right [Null] -> return . return $ mempty Right _ -> Prelude.fail "expected YAML object" Left err' -> do -- cgit v1.2.3 From 09748669b07b2a76cc0f9190e4599e4f3f2a8729 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 9 Nov 2021 22:56:31 -0800 Subject: Require Cabal 2.4. Use wildcards... ...to ensure that all pptx tests are included. Closes #7677. --- pandoc.cabal | 87 +++--------------------------------------------------------- 1 file changed, 3 insertions(+), 84 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 438ad3942..3bda8e877 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -1,4 +1,4 @@ -cabal-version: 2.2 +cabal-version: 2.4 name: pandoc version: 2.16.1 build-type: Simple @@ -382,89 +382,8 @@ extra-source-files: test/rtf/*.native test/rtf/*.rtf test/pptx/*.pptx - test/pptx/background-image/input.native - test/pptx/background-image/*.pptx - test/pptx/blanks/just-speaker-notes/input.native - test/pptx/blanks/just-speaker-notes/*.pptx - test/pptx/blanks/nbsp-in-body/input.native - test/pptx/blanks/nbsp-in-body/*.pptx - test/pptx/blanks/nbsp-in-heading/input.native - test/pptx/blanks/nbsp-in-heading/*.pptx - test/pptx/code-custom/*.pptx - test/pptx/code/input.native - test/pptx/code/*.pptx - test/pptx/content-with-caption/heading-text-image/input.native - test/pptx/content-with-caption/heading-text-image/*.pptx - test/pptx/content-with-caption/image-text/input.native - test/pptx/content-with-caption/image-text/*.pptx - test/pptx/content-with-caption/text-image/input.native - test/pptx/content-with-caption/text-image/*.pptx - test/pptx/comparison/both-columns/input.native - test/pptx/comparison/both-columns/*.pptx - test/pptx/comparison/extra-image/input.native - test/pptx/comparison/extra-image/*.pptx - test/pptx/comparison/extra-text/input.native - test/pptx/comparison/extra-text/*.pptx - test/pptx/comparison/non-text-first/input.native - test/pptx/comparison/non-text-first/*.pptx - test/pptx/comparison/one-column/input.native - test/pptx/comparison/one-column/*.pptx - test/pptx/document-properties-short-desc/input.native - test/pptx/document-properties-short-desc/*.pptx - test/pptx/document-properties/input.native - test/pptx/document-properties/*.pptx - test/pptx/endnotes-toc/*.pptx - test/pptx/endnotes/input.native - test/pptx/endnotes/*.pptx - test/pptx/footer/input.native - test/pptx/footer/basic/*.pptx - test/pptx/footer/fixed-date/*.pptx - test/pptx/footer/higher-slide-number/*.pptx - test/pptx/footer/no-title-slide/*.pptx - test/pptx/images/input.native - test/pptx/images/*.pptx - test/pptx/incremental-lists/with-flag/input.native - test/pptx/incremental-lists/with-flag/*.pptx - test/pptx/incremental-lists/without-flag/input.native - test/pptx/incremental-lists/without-flag/*.pptx - test/pptx/inline-formatting/input.native - test/pptx/inline-formatting/*.pptx - test/pptx/lists/input.native - test/pptx/lists/*.pptx - test/pptx/list-level/input.native - test/pptx/list-level/*.pptx - test/pptx/raw-ooxml/input.native - test/pptx/raw-ooxml/*.pptx - test/pptx/remove-empty-slides/input.native - test/pptx/remove-empty-slides/*.pptx - test/pptx/slide-breaks-slide-level-1/*.pptx - test/pptx/slide-breaks-toc/*.pptx - test/pptx/slide-breaks/input.native - test/pptx/slide-breaks/*.pptx - test/pptx/slide-level-0/h1-h2-with-table/input.native - test/pptx/slide-level-0/h1-h2-with-table/*.pptx - test/pptx/slide-level-0/h1-with-image/input.native - test/pptx/slide-level-0/h1-with-image/*.pptx - test/pptx/slide-level-0/h1-with-table/input.native - test/pptx/slide-level-0/h1-with-table/*.pptx - test/pptx/slide-level-0/h2-with-image/input.native - test/pptx/slide-level-0/h2-with-image/*.pptx - test/pptx/speaker-notes-after-metadata/input.native - test/pptx/speaker-notes-after-metadata/*.pptx - test/pptx/speaker-notes-afterheader/input.native - test/pptx/speaker-notes-afterheader/*.pptx - test/pptx/speaker-notes-afterseps/input.native - test/pptx/speaker-notes-afterseps/*.pptx - test/pptx/speaker-notes/input.native - test/pptx/speaker-notes/*.pptx - test/pptx/start-numbering-at/input.native - test/pptx/start-numbering-at/*.pptx - test/pptx/tables/input.native - test/pptx/tables/*.pptx - test/pptx/two-column/all-text/input.native - test/pptx/two-column/all-text/*.pptx - test/pptx/two-column/text-and-image/input.native - test/pptx/two-column/text-and-image/*.pptx + test/pptx/**/*.pptx + test/pptx/**/*.native test/ipynb/*.in.native test/ipynb/*.out.native test/ipynb/*.ipynb -- cgit v1.2.3 From 6bec746074d29d971111a13f52ef515105362e8f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 9 Nov 2021 23:09:43 -0800 Subject: cabal.project: Require transformers >= 0.5.6. For some reason the CI build is trying to use an older version. --- cabal.project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index b0606c372..a7bfa540f 100644 --- a/cabal.project +++ b/cabal.project @@ -1,5 +1,5 @@ packages: pandoc.cabal tests: True flags: +embed_data_files -constraints: aeson >= 2.0.1.0 +constraints: aeson >= 2.0.1.0, transformers >= 0.5.6 -- cgit v1.2.3 From 03f9a0c61eddff1d34537d767bd91cf395eae500 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 9 Nov 2021 23:43:12 -0800 Subject: Require ghc >= 8.6, base >= 4.12. This allows us to get rid of the old custom prelude and some crufty cpp. But the primary reason for this is that conduit has bumped its base lower bound to 4.12, making it impossible for us to support lower base versions. --- .github/workflows/ci.yml | 12 +----------- cabal.project | 2 +- pandoc.cabal | 30 +++++++++++++----------------- prelude/Prelude.hs | 15 --------------- src/Text/Pandoc/App/CommandLineOptions.hs | 6 ------ 5 files changed, 15 insertions(+), 50 deletions(-) delete mode 100644 prelude/Prelude.hs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0b17d3de..4b73442bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,20 +43,10 @@ jobs: fail-fast: true matrix: versions: - - ghc: '8.2.2' - cabal: '2.4' - prefix: 'v2-' - cabalopts: '' - testopts: '' - - ghc: '8.4.4' - cabal: '2.4' - prefix: 'v2-' - cabalopts: '-f-embed_data_files' - testopts: '' - ghc: '8.6.5' cabal: '3.2' prefix: '' - cabalopts: '' + cabalopts: '-f-embed_data_files' testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false' - ghc: '8.8.4' cabal: '3.2' diff --git a/cabal.project b/cabal.project index a7bfa540f..b0606c372 100644 --- a/cabal.project +++ b/cabal.project @@ -1,5 +1,5 @@ packages: pandoc.cabal tests: True flags: +embed_data_files -constraints: aeson >= 2.0.1.0, transformers >= 0.5.6 +constraints: aeson >= 2.0.1.0 diff --git a/pandoc.cabal b/pandoc.cabal index 3bda8e877..1b6f3a50a 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -409,31 +409,27 @@ flag trypandoc common common-options default-language: Haskell2010 - build-depends: base >= 4.9 && < 5 + build-depends: base >= 4.12 && < 5 ghc-options: -Wall -fno-warn-unused-do-bind -Wincomplete-record-updates -Wnoncanonical-monad-instances + -Wcpp-undef + -Wincomplete-uni-patterns + -Widentities + -Wpartial-fields + -Wmissing-signatures + -fhide-source-paths + -- -Wmissing-export-lists - if impl(ghc < 8.6) - hs-source-dirs: prelude - other-modules: Prelude - build-depends: base-compat >= 0.10.5 - other-extensions: NoImplicitPrelude + if impl(ghc >= 8.10) + ghc-options: -Wunused-packages + + if impl(ghc >= 9.0) + ghc-options: -Winvalid-haddock if os(windows) cpp-options: -D_WINDOWS - -- Later: - -- -Wpartial-fields (currently used in Powerpoint writer) - -- -Wmissing-export-lists (currently some Odt modules violate this) - -- -Wredundant-constraints (problematic if we want to support older base) - if impl(ghc >= 8.2) - ghc-options: -Wcpp-undef - if impl(ghc >= 8.4) - ghc-options: -Wincomplete-uni-patterns - -Widentities - -fhide-source-paths - common common-executable import: common-options build-depends: pandoc diff --git a/prelude/Prelude.hs b/prelude/Prelude.hs deleted file mode 100644 index 2d81ec1ff..000000000 --- a/prelude/Prelude.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# LANGUAGE NoImplicitPrelude #-} - --- The intent is that this Prelude provide the API of --- the base 4.11 Prelude in a way that is portable for --- all base versions. - -module Prelude -( - module Prelude.Compat -, Semigroup(..) -) -where - -import Prelude.Compat -import Data.Semigroup (Semigroup(..)) -- includes (<>) diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index 0d3c12c30..759f8ac35 100644 --- a/src/Text/Pandoc/App/CommandLineOptions.hs +++ b/src/Text/Pandoc/App/CommandLineOptions.hs @@ -33,10 +33,8 @@ import Data.Bifunctor (second) import Data.Char (toLower) import Data.List (intercalate, sort, foldl') #ifdef _WINDOWS -#if MIN_VERSION_base(4,12,0) import Data.List (isPrefixOf) #endif -#endif import Data.Maybe (fromMaybe, isJust) import Data.Text (Text) import Safe (tailDef) @@ -1078,7 +1076,6 @@ readMetaValue s -- beginning with \\ to \\?\UNC\. -- See #5127. normalizePath :: FilePath -> FilePath #ifdef _WINDOWS -#if MIN_VERSION_base(4,12,0) normalizePath fp = if "\\\\" `isPrefixOf` fp && not ("\\\\?\\" `isPrefixOf` fp) then "\\\\?\\UNC\\" ++ drop 2 fp @@ -1086,6 +1083,3 @@ normalizePath fp = #else normalizePath = id #endif -#else -normalizePath = id -#endif -- cgit v1.2.3 From 6fb2973a582116cd515c6f7e68794cca22955511 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 10 Nov 2021 08:52:04 -0800 Subject: Fix parsing of `%` in bibtex fields. Closes #7678 (a bug introduced by 0a45f26). --- src/Text/Pandoc/Citeproc/BibTeX.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs index 66bb9bbe3..a8e5622ed 100644 --- a/src/Text/Pandoc/Citeproc/BibTeX.hs +++ b/src/Text/Pandoc/Citeproc/BibTeX.hs @@ -844,11 +844,10 @@ inBraces :: BibParser Text inBraces = do char '{' res <- manyTill - ( take1WhileP (\c -> c /= '{' && c /= '}' && c /= '\\' && c /= '%') - <|> (char '\\' >> ( (char '{' >> return "\\{") - <|> (char '}' >> return "\\}") - <|> return "\\")) - <|> ("" <$ (char '%' >> anyLine)) + ( take1WhileP (\c -> c /= '{' && c /= '}' && c /= '\\') + <|> (char '\\' >> (do c <- oneOf "{}" + return $ T.pack ['\\',c]) + <|> return "\\") <|> (braced <$> inBraces) ) (char '}') return $ T.concat res -- cgit v1.2.3 From 4e50706924a0337a0f044edea912f14695daa28a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 10 Nov 2021 09:46:47 -0800 Subject: Remove unneeded package dependencies from benchmark target. --- pandoc.cabal | 3 --- 1 file changed, 3 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 1b6f3a50a..d379d2fa8 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -843,12 +843,9 @@ benchmark benchmark-pandoc main-is: benchmark-pandoc.hs hs-source-dirs: benchmark build-depends: bytestring, - containers, - -- gauge >= 0.2 && < 0.3, tasty-bench >= 0.2 && <= 0.4, mtl >= 2.2 && < 2.3, text >= 1.1.1.0 && < 1.3, - time, deepseq -- we increase heap size to avoid benchmarking garbage collection: ghc-options: -rtsopts -with-rtsopts=-A8m -threaded -- cgit v1.2.3 From b116022de46cc3969eb91a0035e8da8f9135cbb4 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 11 Nov 2021 09:38:07 +0100 Subject: JATS template: fix equal-contrib attribute The standard requires the value to be either `yes` or `no`, but is was set to `true` for authors who contributed equally. --- data/templates/article.jats_publishing | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/templates/article.jats_publishing b/data/templates/article.jats_publishing index 9bedff6af..7ea53d5b3 100644 --- a/data/templates/article.jats_publishing +++ b/data/templates/article.jats_publishing @@ -86,7 +86,7 @@ $endif$ $if(author)$ $for(author)$ - + $if(author.orcid)$ $author.orcid$ $endif$ @@ -208,4 +208,3 @@ $back$ $endif$ - -- cgit v1.2.3 From fe113dd5fac4b05d74391bc47122f3d24b88b1dd Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 11 Nov 2021 09:44:49 +0100 Subject: JATS template: fix incomplete previous commit --- data/templates/article.jats_publishing | 1 + data/templates/default.jats_articleauthoring | 2 +- doc/jats.md | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/templates/article.jats_publishing b/data/templates/article.jats_publishing index 7ea53d5b3..11902cae8 100644 --- a/data/templates/article.jats_publishing +++ b/data/templates/article.jats_publishing @@ -208,3 +208,4 @@ $back$ $endif$ + diff --git a/data/templates/default.jats_articleauthoring b/data/templates/default.jats_articleauthoring index 60b2ca559..66a4157d7 100644 --- a/data/templates/default.jats_articleauthoring +++ b/data/templates/default.jats_articleauthoring @@ -19,7 +19,7 @@ $endif$ $if(author)$ $for(author)$ - + $if(author.orcid)$ $author.orcid$ $endif$ diff --git a/doc/jats.md b/doc/jats.md index c099e0a04..bebb2536a 100644 --- a/doc/jats.md +++ b/doc/jats.md @@ -53,9 +53,9 @@ Metadata Values `equal-contrib` : boolean attribute used to mark authors who contributed equally to the work. The - [`equal-contrib`][attr:equal-contrib] attribute is added - to the author's [``] element if this is set to a - truthy value. + [`equal-contrib`][attr:equal-contrib] attribute, set to + `yes`, is added to the author's [``] element if + this is set to a truthy value. `cor-id` : identifier linking to the contributor's correspondence -- cgit v1.2.3 From ebf7f782d3151956d6e886c9615580c0b67f6656 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 11 Nov 2021 09:13:27 +0100 Subject: Lua: load `re` module available into global of the same name --- doc/lua-filters.md | 27 ++++++++++++++++++++------- src/Text/Pandoc/Lua/Init.hs | 32 +++++++++++--------------------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index ba5f58120..38790ca5d 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -245,15 +245,28 @@ variables. variable is of type [CommonState] and is read-only. -## Global modules - -There are two modules which are preloaded and accessible through -global variables. The first is `pandoc`, which is described in the -next section. The other is `lpeg`, a package based on Parsing -Expression Grammars (PEG). See the official [LPeg homepage] for -details. +`pandoc` +: The *pandoc* module, described in the next section, is + available through the global `pandoc`. The other modules + described herein are loaded as subfields under their + respective name. + +`lpeg` +: This variable holds the `lpeg` module, a package based on + Parsing Expression Grammars (PEG). It provides excellent + parsing utilities and is documented on the official [LPeg + homepage]. Pandoc will try to load the module through the + normal package mechanism, and fall back to a built-in version + if necessary. + +`re` +: Contains the LPeg.re module, which is built on top of LPeg and + offers an implementation of a [regex engine]. Pandoc will try + to load the module through the normal package mechanism, and + fall back to a built-in version if necessary. [LPeg homepage]: http://www.inf.puc-rio.br/~roberto/lpeg/ +[regex engine]: http://www.inf.puc-rio.br/~roberto/lpeg/re.html # Pandoc Module diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index 727c79d84..23c51969c 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Lua @@ -14,7 +13,7 @@ module Text.Pandoc.Lua.Init ( runLua ) where -import Control.Monad (when) +import Control.Monad (forM_, when) import Control.Monad.Catch (throwM, try) import Control.Monad.Trans (MonadIO (..)) import Data.Data (Data, dataTypeConstrs, dataTypeOf, showConstr) @@ -46,8 +45,8 @@ initLuaState :: PandocLua () initLuaState = do liftPandocLua Lua.openlibs installPandocPackageSearcher - installLpegSearcher initPandocModule + installLpegSearcher requireGlobalModules loadInitScript "init.lua" where @@ -78,27 +77,18 @@ initLuaState = do _ -> T.pack $ show err requireGlobalModules :: PandocLua () - requireGlobalModules = liftPandocLua $ do - Lua.pushcfunction LPeg.luaopen_lpeg_ptr - Lua.pcall 0 1 Nothing >>= \case - Lua.OK -> do - -- Success. Register as a loaded module. - -- Get table "_LOADED" from registry, add entry. - _ <- Lua.getfield Lua.registryindex Lua.loaded - Lua.pushvalue (Lua.nth 2) - Lua.setfield (Lua.nth 2) "lpeg" - Lua.pop 1 -- pop _LOADED - - _ -> do - -- Maybe LPeg was not compiled into the program. Try loading via - -- the normal package loading mechanism. - pop 1 -- ignore error message + requireGlobalModules = liftPandocLua $ + forM_ ["lpeg", "re"] $ \pkgname -> do + -- Try loading via the normal package loading mechanism, which + -- includes the custom LPeg searcher as a last resort. This + -- means the system installation of the package, should it be + -- available, is preferred. Lua.getglobal "require" - Lua.pushName "lpeg" + Lua.pushName pkgname Lua.call 1 1 -- throws an exception if the module is not found - -- Module on top of stack. Register as global - Lua.setglobal "lpeg" + -- Module on top of stack. Register as global + Lua.setglobal pkgname installLpegSearcher :: PandocLua () installLpegSearcher = liftPandocLua $ do -- cgit v1.2.3 From abdfefebdf9ffd338683adb1d4fcfe6db4909b49 Mon Sep 17 00:00:00 2001 From: Christian Despres <50160106+despresc@users.noreply.github.com> Date: Thu, 11 Nov 2021 23:55:37 -0500 Subject: Writers.Shared: Improve toLegacyTable. Closes #7683. (PR #7684) --- src/Text/Pandoc/Writers/Shared.hs | 2 +- test/Tests/Shared.hs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs index 6b8be3c8b..b23fc1341 100644 --- a/src/Text/Pandoc/Writers/Shared.hs +++ b/src/Text/Pandoc/Writers/Shared.hs @@ -508,7 +508,7 @@ toLegacyTable (Caption _ cbody) specs thead tbodies tfoot = let (h, w, cBody) = getComponents c cRowPieces = cBody : replicate (w - 1) mempty cPendingPieces = replicate w $ replicate (h - 1) mempty - pendingPieces' = dropWhile null pendingPieces + pendingPieces' = drop w pendingPieces (pendingPieces'', rowPieces) = placeCutCells pendingPieces' cells' in (cPendingPieces <> pendingPieces'', cRowPieces <> rowPieces) | otherwise = ([], []) diff --git a/test/Tests/Shared.hs b/test/Tests/Shared.hs index e415ea153..5365812fe 100644 --- a/test/Tests/Shared.hs +++ b/test/Tests/Shared.hs @@ -56,6 +56,7 @@ testLegacyTable :: [TestTree] testLegacyTable = [ testCase "decomposes a table with head" $ gen1 @?= expect1 , testCase "decomposes a table without head" $ gen2 @?= expect2 + , testCase "decomposes the table from issue 7683" $ gen3 @?= expect3 ] where pln = toList . plain . str @@ -110,3 +111,18 @@ testLegacyTable = ,[pln "j", mempty, mempty]] ) gen2 = toLegacyTable emptyCaption spec1 (th []) [body1] (tf footRows1) + + spec3 = replicate 4 (AlignDefault, ColWidthDefault) + body3 = tb 0 + [] + [[cl "a" 2 1, cl "b" 1 2, cl "c" 2 1] + ,[cl "d" 1 1, cl "e" 1 1] + ] + expect3 = ( [] + , replicate 4 AlignDefault + , replicate 4 0 + , [] + , [[pln "a", pln "b", mempty, pln "c"] + ,[mempty, pln "d", pln "e", mempty]] + ) + gen3 = toLegacyTable emptyCaption spec3 (th []) [body3] (tf []) -- cgit v1.2.3 From da96e1ff40d359b43c5f0bf06a56f98fedcb8a68 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 12 Nov 2021 11:53:53 +0100 Subject: JATS writer: add URL to element citation entries The URL of a reference, if present, is added in tag `` to element-citation entries. --- src/Text/Pandoc/Writers/JATS/References.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Text/Pandoc/Writers/JATS/References.hs b/src/Text/Pandoc/Writers/JATS/References.hs index 5b19fd034..b00875a7c 100644 --- a/src/Text/Pandoc/Writers/JATS/References.hs +++ b/src/Text/Pandoc/Writers/JATS/References.hs @@ -70,6 +70,7 @@ referenceToJATS _opts ref = do , "pages" `varInTag` "page-range" , "ISBN" `varInTag` "isbn" , "ISSN" `varInTag` "issn" + , "URL" `varInTag` "uri" , varInTagWith "doi" "pub-id" [("pub-id-type", "doi")] , varInTagWith "pmid" "pub-id" [("pub-id-type", "pmid")] ] -- cgit v1.2.3 From 96a01451efd487d0f6a91a2785fd28be001a92bf Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 12 Nov 2021 13:07:25 +0100 Subject: JATS writer: ensure figures are wrapped with `

` in list items. This prevents the generation of invalid output. --- src/Text/Pandoc/Writers/JATS.hs | 1 + test/Tests/Writers/JATS.hs | 48 ++++++++++++++++++++++++++++------------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs index d58da8bd2..799fe29fa 100644 --- a/src/Text/Pandoc/Writers/JATS.hs +++ b/src/Text/Pandoc/Writers/JATS.hs @@ -551,6 +551,7 @@ inlineToJATS _ (Image (ident,_,kvs) _ (src, tit)) = do return $ selfClosingTag "inline-graphic" attr isParaOrList :: Block -> Bool +isParaOrList SimpleFigure{} = False -- implicit figures are not paragraphs isParaOrList Para{} = True isParaOrList Plain{} = True isParaOrList BulletList{} = True diff --git a/test/Tests/Writers/JATS.hs b/test/Tests/Writers/JATS.hs index 5b96ed2ed..e605f55e1 100644 --- a/test/Tests/Writers/JATS.hs +++ b/test/Tests/Writers/JATS.hs @@ -61,21 +61,39 @@ tests = , "

" ]) ] - , "bullet list" =: bulletList [ plain $ text "first" - , plain $ text "second" - , plain $ text "third" - ] - =?> "\n\ - \ \n\ - \

first

\n\ - \
\n\ - \ \n\ - \

second

\n\ - \
\n\ - \ \n\ - \

third

\n\ - \
\n\ - \
" + , testGroup "bullet list" + [ "plain items" =: bulletList [ plain $ text "first" + , plain $ text "second" + , plain $ text "third" + ] + =?> "\n\ + \ \n\ + \

first

\n\ + \
\n\ + \ \n\ + \

second

\n\ + \
\n\ + \ \n\ + \

third

\n\ + \
\n\ + \
" + + , "item with implicit figure" =: + bulletList [ simpleFigure (text "caption") "a.png" "" ] =?> + T.unlines + [ "" + , " " + , "

" + , " " + , "

caption

" + , " + " xlink:href=\"a.png\" xlink:title=\"\" />" + , " " + , "

" + , "
" + , "
" + ] + ] , testGroup "definition lists" [ "with internal link" =: definitionList [(link "#go" "" (str "testing"), [plain (text "hi there")])] =?> -- cgit v1.2.3 From 946b95975158820d66ccdaed51c3722e07c24b12 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 14 Nov 2021 20:55:36 -0800 Subject: Fix misspelled extension name in manual. `short_subsuperscript` -> `short_subsuperscripts`. Closes #7690. --- MANUAL.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANUAL.txt b/MANUAL.txt index b1f75961b..2053771c2 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5334,7 +5334,7 @@ For elements that accept attributes, a `data-pos` attribute is added; other elements are placed in a surrounding Div or Span elemnet with a `data-pos` attribute. -#### Extension: `short_subsuperscript` #### +#### Extension: `short_subsuperscripts` #### Parse multimarkdown style subscripts and superscripts, which start with a '~' or '^' character, respectively, and include the alphanumeric sequence -- cgit v1.2.3 From ea268fd8a72fe59e6cb0086b0c7471b8aa316af1 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 15 Nov 2021 18:40:50 +0100 Subject: LaTeX reader: add rudimentary support for `\autoref` (#7693) --- src/Text/Pandoc/Readers/LaTeX/Inline.hs | 1 + test/command/refs.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Text/Pandoc/Readers/LaTeX/Inline.hs b/src/Text/Pandoc/Readers/LaTeX/Inline.hs index 0fd14017b..0b49fd6c3 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Inline.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Inline.hs @@ -339,6 +339,7 @@ refCommands = M.fromList , ("cref", rawInlineOr "cref" $ doref "ref") -- from cleveref.sty , ("vref", rawInlineOr "vref" $ doref "ref+page") -- from varioref.sty , ("eqref", rawInlineOr "eqref" $ doref "eqref") -- from amsmath.sty + , ("autoref", rawInlineOr "autoref" $ doref "autoref") -- from hyperref.sty ] acronymCommands :: PandocMonad m => M.Map Text (LP m Inlines) diff --git a/test/command/refs.md b/test/command/refs.md index fb362febe..34e51d219 100644 --- a/test/command/refs.md +++ b/test/command/refs.md @@ -58,6 +58,24 @@ Figure \vref{fig:1} ] ``` +``` +% pandoc -f latex -t native +\autoref{fig:flowchart} +^D +[ Para + [ Link + ( "" + , [] + , [ ( "reference-type" , "autoref" ) + , ( "reference" , "fig:flowchart" ) + ] + ) + [ Str "[fig:flowchart]" ] + ( "#fig:flowchart" , "" ) + ] +] +``` + ``` % pandoc -f latex -t native Accuracy~\eqref{eq:Accuracy} is the proportion, measuring true results among all results. -- cgit v1.2.3 From c19f0634203f224a26851635f4b86e1013a6618a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 15 Nov 2021 11:06:08 -0800 Subject: Markdown writer: don't create autolinks when this loses information. Previously we sometimes lost attributes when rendering links as autolinks. Closes #7692. --- src/Text/Pandoc/Writers/Markdown/Inline.hs | 5 ++++- test/command/7692.md | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/command/7692.md diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs index 065157e80..be22f8d9f 100644 --- a/src/Text/Pandoc/Writers/Markdown/Inline.hs +++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs @@ -531,7 +531,7 @@ inlineToMarkdown opts (Cite (c:cs) lst) return $ pdoc <+> r modekey SuppressAuthor = "-" modekey _ = "" -inlineToMarkdown opts lnk@(Link attr txt (src, tit)) = do +inlineToMarkdown opts lnk@(Link attr@(ident,classes,kvs) txt (src, tit)) = do variant <- asks envVariant linktext <- inlineListToMarkdown opts txt let linktitle = if T.null tit @@ -539,6 +539,9 @@ inlineToMarkdown opts lnk@(Link attr txt (src, tit)) = do else literal $ " \"" <> tit <> "\"" let srcSuffix = fromMaybe src (T.stripPrefix "mailto:" src) let useAuto = isURI src && + T.null ident && + null kvs && + (null classes || classes == ["uri"] || classes == ["email"]) && case txt of [Str s] | escapeURI s == srcSuffix -> True _ -> False diff --git a/test/command/7692.md b/test/command/7692.md new file mode 100644 index 000000000..2a91ef378 --- /dev/null +++ b/test/command/7692.md @@ -0,0 +1,13 @@ +``` +% pandoc -t markdown +[https://example.com](https://example.com){.clz} +^D +[https://example.com](https://example.com){.clz} +``` + +``` +% pandoc -f markdown -t html | pandoc -f html -t markdown + +^D + +``` -- cgit v1.2.3 From 305a4f406d64fcf8b3a0d3ac09a276a5f0803e0d Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 16 Nov 2021 12:03:49 +0100 Subject: Lua: make loading of global LPeg modules more robust Ignore errors if the normal package mechanism failed; this not only covers the case of modules being unavailable on the system, but also works if the modules are present, but fail to load for some reason. This makes the built-in package version a true fallback. --- src/Text/Pandoc/Lua/Init.hs | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index 23c51969c..bf87f0a41 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {- | Module : Text.Pandoc.Lua @@ -46,7 +47,6 @@ initLuaState = do liftPandocLua Lua.openlibs installPandocPackageSearcher initPandocModule - installLpegSearcher requireGlobalModules loadInitScript "init.lua" where @@ -78,25 +78,31 @@ initLuaState = do requireGlobalModules :: PandocLua () requireGlobalModules = liftPandocLua $ - forM_ ["lpeg", "re"] $ \pkgname -> do - -- Try loading via the normal package loading mechanism, which - -- includes the custom LPeg searcher as a last resort. This - -- means the system installation of the package, should it be - -- available, is preferred. + forM_ [ ("lpeg", LPeg.luaopen_lpeg_ptr) + , ("re", LPeg.luaopen_re_ptr) + ] $ + \(pkgname, luaopen) -> do + -- Try loading via the normal package loading mechanism, and + -- fall back to manual module loading if the normal mechanism + -- fails. This means the system installation of the package, + -- should it be available, is preferred. Lua.getglobal "require" Lua.pushName pkgname - Lua.call 1 1 -- throws an exception if the module is not found + Lua.pcall 1 1 Nothing >>= \case + OK -> pure () -- all good, loading succeeded + _ -> do -- default mechanism failed, load included lib + Lua.pop 1 -- ignore error message + Lua.pushcfunction luaopen + Lua.call 0 1 -- Throws an exception if loading failed again! + -- Success. Add module to table @_LOADED@ in the registry + _ <- Lua.getfield Lua.registryindex Lua.loaded + Lua.pushvalue (Lua.nth 2) -- push module to top + Lua.setfield (Lua.nth 2) pkgname + Lua.pop 1 -- pop _LOADED -- Module on top of stack. Register as global Lua.setglobal pkgname - installLpegSearcher :: PandocLua () - installLpegSearcher = liftPandocLua $ do - Lua.getglobal' "package.searchers" - Lua.pushHaskellFunction $ Lua.state >>= liftIO . LPeg.lpeg_searcher - Lua.rawseti (Lua.nth 2) . (+1) . fromIntegral =<< Lua.rawlen (Lua.nth 2) - Lua.pop 1 -- remove 'package.searchers' from stack - -- | AST elements are marshaled via normal constructor functions in the -- @pandoc@ module. However, accessing Lua globals from Haskell is -- expensive (due to error handling). Accessing the Lua registry is much -- cgit v1.2.3 From 3ac7deadce6cf2fbf6aaa3c7bacebaacb5c68214 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 16 Nov 2021 21:47:27 -0800 Subject: Use latest dev texmath. --- cabal.project | 4 ++++ stack.yaml | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index b0606c372..cb2d6ebdb 100644 --- a/cabal.project +++ b/cabal.project @@ -3,3 +3,7 @@ tests: True flags: +embed_data_files constraints: aeson >= 2.0.1.0 +source-repository-package + type: git + location: https://github.com/jgm/texmath.git + tag: 674bcbaec03e5550f155623de6662953bd157625 diff --git a/stack.yaml b/stack.yaml index 3d46b814f..2bfc9ad02 100644 --- a/stack.yaml +++ b/stack.yaml @@ -27,12 +27,14 @@ extra-deps: - tasty-hslua-1.0.0 - tasty-lua-1.0.0 - pandoc-types-1.22.1 -- texmath-0.12.3.2 - commonmark-0.2.1.1 - commonmark-extensions-0.2.2 - citeproc-0.6 - aeson-pretty-0.8.9 - ipynb-0.1.0.2 +# - texmath-0.12.3.2 +- git: https://github.com/jgm/texmath.git + commit: 674bcbaec03e5550f155623de6662953bd157625 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From cd91f72843359c5305842fa8afbec4a2d72629fa Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 17 Nov 2021 08:47:30 +0100 Subject: Lua: set `lpeg`, `re` as globals; allow shared lib access via require The `lpeg` and `re` modules are loaded into globals of the respective name, but they are not necessarily registered as loaded packages. This ensures that - the built-in library versions are preferred when setting the globals, - a shared library is used if pandoc has been compiled without `lpeg`, and - the `require` mechanism can be used to load the shared library if available, falling back to the internal version if possible and necessary. --- doc/lua-filters.md | 25 +++++++++++++++++-------- src/Text/Pandoc/Lua/Init.hs | 36 ++++++++++++++++++------------------ test/Tests/Lua.hs | 24 +++++++++++++++++------- 3 files changed, 52 insertions(+), 33 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 38790ca5d..9fc90a13f 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -253,17 +253,26 @@ variables. `lpeg` : This variable holds the `lpeg` module, a package based on - Parsing Expression Grammars (PEG). It provides excellent + Parsing Expression Grammars (PEG). It provides excellent parsing utilities and is documented on the official [LPeg - homepage]. Pandoc will try to load the module through the - normal package mechanism, and fall back to a built-in version - if necessary. + homepage]. Pandoc uses a built-int version of the library, + unless it has been configured by the package maintainer to + rely on a system-wide installation. + + Note that the result of `require 'lpeg'` is not necessarily + equal to this value; the `require` mechanism prefers the + system's lpeg library over the built-in version. `re` -: Contains the LPeg.re module, which is built on top of LPeg and - offers an implementation of a [regex engine]. Pandoc will try - to load the module through the normal package mechanism, and - fall back to a built-in version if necessary. +: Contains the LPeg.re module, which is built on top of LPeg + and offers an implementation of a [regex engine]. Pandoc + uses a built-in version of the library, unless it has been + configured by the package maintainer to rely on a system-wide + installation. + + Note that the result of `require 're` is not necessarily + equal to this value; the `require` mechanism prefers the + system's lpeg library over the built-in version. [LPeg homepage]: http://www.inf.puc-rio.br/~roberto/lpeg/ [regex engine]: http://www.inf.puc-rio.br/~roberto/lpeg/re.html diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index bf87f0a41..72a06f556 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -47,7 +47,8 @@ initLuaState = do liftPandocLua Lua.openlibs installPandocPackageSearcher initPandocModule - requireGlobalModules + installLpegSearcher + setGlobalModules loadInitScript "init.lua" where initPandocModule :: PandocLua () @@ -76,33 +77,32 @@ initLuaState = do PandocLuaError msg -> msg _ -> T.pack $ show err - requireGlobalModules :: PandocLua () - requireGlobalModules = liftPandocLua $ + setGlobalModules :: PandocLua () + setGlobalModules = liftPandocLua $ forM_ [ ("lpeg", LPeg.luaopen_lpeg_ptr) , ("re", LPeg.luaopen_re_ptr) ] $ \(pkgname, luaopen) -> do - -- Try loading via the normal package loading mechanism, and - -- fall back to manual module loading if the normal mechanism - -- fails. This means the system installation of the package, - -- should it be available, is preferred. - Lua.getglobal "require" - Lua.pushName pkgname - Lua.pcall 1 1 Nothing >>= \case + Lua.pushcfunction luaopen + Lua.pcall 0 1 Nothing >>= \case OK -> pure () -- all good, loading succeeded - _ -> do -- default mechanism failed, load included lib + _ -> do -- built-in library failed, load system lib Lua.pop 1 -- ignore error message - Lua.pushcfunction luaopen - Lua.call 0 1 -- Throws an exception if loading failed again! - -- Success. Add module to table @_LOADED@ in the registry - _ <- Lua.getfield Lua.registryindex Lua.loaded - Lua.pushvalue (Lua.nth 2) -- push module to top - Lua.setfield (Lua.nth 2) pkgname - Lua.pop 1 -- pop _LOADED + -- Try loading via the normal package loading mechanism. + Lua.getglobal "require" + Lua.pushName pkgname + Lua.call 1 1 -- Throws an exception if loading failed again! -- Module on top of stack. Register as global Lua.setglobal pkgname + installLpegSearcher :: PandocLua () + installLpegSearcher = liftPandocLua $ do + Lua.getglobal' "package.searchers" + Lua.pushHaskellFunction $ Lua.state >>= liftIO . LPeg.lpeg_searcher + Lua.rawseti (Lua.nth 2) . (+1) . fromIntegral =<< Lua.rawlen (Lua.nth 2) + Lua.pop 1 -- remove 'package.searchers' from stack + -- | AST elements are marshaled via normal constructor functions in the -- @pandoc@ module. However, accessing Lua globals from Haskell is -- expensive (due to error handling). Accessing the Lua registry is much diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index 6ee07f8fa..5e81cec6a 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -17,7 +17,7 @@ module Tests.Lua ( runLuaTest, tests ) where import Control.Monad (when) import HsLua as Lua hiding (Operation (Div), error) import System.FilePath (()) -import Test.Tasty (TestTree, localOption) +import Test.Tasty (TestTree, testGroup, localOption) import Test.Tasty.HUnit ((@=?), Assertion, HasCallStack, assertEqual, testCase) import Test.Tasty.QuickCheck (QuickCheckTests (..), ioProperty, testProperty) import Text.Pandoc.Arbitrary () @@ -211,13 +211,23 @@ tests = map (localOption (QuickCheckTests 20)) ty <- Lua.ltype Lua.top Lua.liftIO $ assertEqual "module should be a table" Lua.TypeTable ty - , testCase "module 'lpeg' is loaded into a global" . runLuaTest $ do - s <- Lua.dostring "assert(type(lpeg)=='table');assert(lpeg==require'lpeg')" - Lua.liftIO $ Lua.OK @=? s + , testGroup "global modules" + [ testCase "module 'lpeg' is loaded into a global" . runLuaTest $ do + s <- Lua.dostring "assert(type(lpeg)=='table')" + Lua.liftIO $ Lua.OK @=? s - , testCase "module 're' is available" . runLuaTest $ do - s <- Lua.dostring "require 're'" - Lua.liftIO $ Lua.OK @=? s + , testCase "module 're' is loaded into a global" . runLuaTest $ do + s <- Lua.dostring "assert(type(re)=='table')" + Lua.liftIO $ Lua.OK @=? s + + , testCase "module 'lpeg' is available via `require`" . runLuaTest $ do + s <- Lua.dostring "require 'lpeg'" + Lua.liftIO $ Lua.OK @=? s + + , testCase "module 're' is available via `require`" . runLuaTest $ do + s <- Lua.dostring "require 're'" + Lua.liftIO $ Lua.OK @=? s + ] , testCase "informative error messages" . runLuaTest $ do Lua.pushboolean True -- cgit v1.2.3 From 13125945261568f04e8efe0033deb32c5a643c3c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 17 Nov 2021 16:32:36 -0800 Subject: Babel mappings: use ancientgreek for grc. --- src/Text/Pandoc/Writers/LaTeX/Lang.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/LaTeX/Lang.hs b/src/Text/Pandoc/Writers/LaTeX/Lang.hs index f6fa8d187..3fdbdc5af 100644 --- a/src/Text/Pandoc/Writers/LaTeX/Lang.hs +++ b/src/Text/Pandoc/Writers/LaTeX/Lang.hs @@ -43,7 +43,7 @@ toBabel (Lang "en" _ (Just "US") _ _ _) = "american" toBabel (Lang "fr" _ (Just "CA") _ _ _) = "canadien" toBabel (Lang "fra" _ _ vars _ _) | "aca" `elem` vars = "acadian" -toBabel (Lang "grc" _ _ _ _ _) = "polutonikogreek" +toBabel (Lang "grc" _ _ _ _ _) = "ancientgreek" toBabel (Lang "hsb" _ _ _ _ _) = "uppersorbian" toBabel (Lang "la" _ _ vars _ _) | "x-classic" `elem` vars = "classiclatin" -- cgit v1.2.3 From 51c85b46ba7212411feb709b5cc5da32cb5b2430 Mon Sep 17 00:00:00 2001 From: Fabián Heredia Montiel <303897+fabianhjr@users.noreply.github.com> Date: Wed, 17 Nov 2021 19:29:01 -0600 Subject: Update build files (#7696) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Drop old windows 32-bit constraints - basement >= 0.0.10 was 0.0.12 on stackage-18.10 - foundation >= 0.0.23 was 0.0.26.1 on stackage-18.10 * Update cabal `tested-with` field to correspond to `ci.yml` matrix * ghc: 8.10.{2,4} → 8.10.7 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/nightly.yml | 2 +- pandoc.cabal | 7 +------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b73442bf..1b7e415ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: prefix: '' cabalopts: '' testopts: '--test-option=--hide-successes --test-option=--ansi-tricks=false' - - ghc: '8.10.4' + - ghc: '8.10.7' cabal: '3.2' prefix: '' cabalopts: '-ftrypandoc' @@ -212,7 +212,7 @@ jobs: versions: - ghc: '8.8.4' cabal: '3.2' - - ghc: '8.10.2' + - ghc: '8.10.7' cabal: '3.2' steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 784c57276..a8afcee95 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,7 +14,7 @@ jobs: - name: Install recent cabal/ghc uses: haskell/actions/setup@v1 with: - ghc-version: '8.10.3' + ghc-version: '8.10.7' cabal-version: '3.2' - name: Install dependencies diff --git a/pandoc.cabal b/pandoc.cabal index d379d2fa8..2514f6805 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -11,8 +11,7 @@ bug-reports: https://github.com/jgm/pandoc/issues stability: alpha homepage: https://pandoc.org category: Text -tested-with: GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, - GHC == 8.8.4, GHC == 8.10.2, GHC == 9.0.1 +tested-with: GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.1 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 @@ -507,10 +506,6 @@ library yaml >= 0.11 && < 0.12, zip-archive >= 0.2.3.4 && < 0.5, zlib >= 0.5 && < 0.7 - if os(windows) && arch(i386) - build-depends: basement >= 0.0.10, - foundation >= 0.0.23 - -- basement 0.0.9 won't build on 32-bit windows. if !os(windows) build-depends: unix >= 2.4 && < 2.8 if flag(embed_data_files) -- cgit v1.2.3 From 3e5af46471477cc7b006a8ef1cbcd9b182f6fa43 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 18 Nov 2021 09:04:24 -0800 Subject: Add doc for custom-readers. --- doc/custom-readers.lua | 599 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 599 insertions(+) create mode 100644 doc/custom-readers.lua diff --git a/doc/custom-readers.lua b/doc/custom-readers.lua new file mode 100644 index 000000000..bef3ae050 --- /dev/null +++ b/doc/custom-readers.lua @@ -0,0 +1,599 @@ +--- +author: +- John MacFarlane +date: 'November 18, 2021' +title: Creating Custom Pandoc Readers in Lua +--- + +# Introduction + +If you need to parse a format not already handled by pandoc, +you can create a custom reader using the [Lua] language. +Pandoc has a built-in Lua interpreter, so you needn't +install any additional software to do this. + +[Lua]: https://www.lua.org + +A custom writer is a Lua file that defines a function +called `Reader`, which takes two arguments: + +- a string, the raw input to be parsed +- optionally, a table of reader options, e.g. + `{ columns = 62, standalone = true }`. + +The `Reader` function should return a `Pandoc` AST. +This can be created using functions in the [`pandoc` module], +which is automatically in scope. (Indeed, all of the utility +functions that are available for [Lua filters] are available +in custom readers, too.) + +[Lua filters]: https://pandoc.org/lua-filters.html +[`pandoc` module]: https://pandoc.org/lua-filters.html#module-pandoc + +A minimal example would be + +```lua +function Reader(input) + return pandoc.Pandoc({ pandoc.CodeBlock(input) }) +end +``` + +This just returns a document containing a big code block with +all of the input. + +In a nontrivial reader, you'll want to parse the input. +You can do this using standard Lua library functions +(for example, the [patterns] library), or with the powerful +and fast [lpeg] parsing library, which is automatically in scope. +You can also use external Lua libraries (for example, +an XML parser). + +[patterns]: http://lua-users.org/wiki/PatternsTutorial +[lpeg]: http://www.inf.puc-rio.br/~roberto/lpeg/ + +# Example: plain text reader + +This is a simple example using [lpeg] to parse the input +into space-separated strings and blankline-separated paragraphs. + +```lua +-- A sample custom reader that just parses text into blankline-separated +-- paragraphs with space-separated words. + +-- For better performance we put these functions in local variables: +local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt = + lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V, + lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt + +local whitespacechar = S(" \t\r\n") +local wordchar = (1 - whitespacechar) +local spacechar = S(" \t") +local newline = P"\r"^-1 * P"\n" +local blanklines = newline * (spacechar^0 * newline)^1 +local endline = newline - blanklines + +-- Grammar +G = P{ "Pandoc", + Pandoc = Ct(V"Block"^0) / pandoc.Pandoc; + Block = blanklines^0 * V"Para" ; + Para = Ct(V"Inline"^1) / pandoc.Para; + Inline = V"Str" + V"Space" + V"SoftBreak" ; + Str = wordchar^1 / pandoc.Str; + Space = spacechar^1 / pandoc.Space; + SoftBreak = endline / pandoc.SoftBreak; +} + +function Reader(input) + return lpeg.match(G, input) +end +``` + +Example of use: + +``` +% pandoc -f plain.lua -t native +*Hello there*, this is plain text with no formatting +except paragraph breaks. + +- Like this one. +^D +[ Para + [ Str "*Hello" + , Space + , Str "there*," + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "plain" + , Space + , Str "text" + , Space + , Str "with" + , Space + , Str "no" + , Space + , Str "formatting" + , SoftBreak + , Str "except" + , Space + , Str "paragraph" + , Space + , Str "breaks." + ] +, Para + [ Str "-" + , Space + , Str "Like" + , Space + , Str "this" + , Space + , Str "one." + ] +] +``` + +# Example: a RIS bibliography reader + +This is a parser for [RIS bibliography] files. It can be used +to convert them to CSL JSON or YAML, BibTeX, or BibLaTeX. + +[RIS bibliography]: https://en.wikipedia.org/wiki/RIS_(file_format) + +```lua +-- A sample custom reader for RIS bibliography format +-- https://en.wikipedia.org/wiki/RIS_(file_format) +-- The references are converted to inline pandoc/CSL YAML +-- references in the metadata. + +local inspect = require"inspect" + +local types = + { ABST = "article", + ADVS = "motion-picture", + AGGR = "dataset", + ANCIENT = "book", + ART = "graphic", + BILL = "bill", + BLOG = "post-weblog", + BOOK = "book", + CASE = "legal_case", + CHAP = "chapter", + CHART = "graphic", + CLSWK = "book", + COMP = "program", + CONF = "paper-conference", + CPAPER = "paper-conference", + CTLG = "catalog", + DATA = "dataset", + DBASE = "dataset", + DICT = "book", + EBOOK = "book", + ECHAP = "chapter", + EDBOOK = "book", + EJOUR = "article", + WEB = "webpage", + ENCYC = "entry-encyclopedia", + EQUA = "figure", + FIGURE = "figure", + GEN = "entry", + GOVDOC = "report", + GRANT = "report", + HEAR = "report", + ICOMM = "personal_communication", + INPR = "article-journal", + JFULL = "article-journal", + JOUR = "article-journal", + LEGAL = "legal_case", + MANSCPT = "manuscript", + MAP = "map", + MGZN = "article-magazine", + MPCT = "motion-picture", + MULTI = "webpage", + MUSIC = "musical_score", + NEWS = "article-newspaper", + PAMP = "pamphlet", + PAT = "patent", + PCOMM = "personal_communication", + RPRT = "report", + SER = "article", + SLIDE = "graphic", + SOUND = "musical_score", + STAND = "report", + STAT = "legislation", + THES = "thesis", + UNBILL = "bill", + UNPB = "unpublished", + VIDEO = "graphic" + } + +local function inlines(s) + local ils = {} + for t in string.gmatch(s, "%S+") do + if #ils == 0 then + ils = {pandoc.Str(t)} + else + table.insert(ils, pandoc.Space()) + table.insert(ils, pandoc.Str(t)) + end + end + return pandoc.MetaInlines(ils) +end + +local function clean(refpairs) + local ref = {} + for i = 1, #refpairs do + local k,v = table.unpack(refpairs[i]) + if k == "TY" then + ref["type"] = types[v] + elseif k == "VL" then + ref.volume = v + elseif k == "KW" then + ref.keyword = v + elseif k == "PB" then + ref.publisher = v + elseif k == "CY" or k == "PP" then + ref["publisher-place"] = v + elseif k == "SP" then + if ref.page then + ref.page = v .. ref.page + else + ref.page = v + end + elseif k == "EP" then + if ref.page then + ref.page = ref.page .. "-" .. v + else + ref.page = "-" .. v + end + elseif k == "AU" or k == "A1" or k == "A2" or k == "A3" then + if ref.author then + table.insert(ref.author, inlines(v)) + else + ref.author = {inlines(v)} + end + elseif k == "TI" or k == "T1" or k == "CT" or + (k == "BT" and ref.type == "book") then + ref.title = inlines(v) + elseif k == "ET" then + ref.edition = inlines(v) + elseif k == "NV" then + ref["number-of-volumes"] = inlines(v) + elseif k == "AB" then + ref.abstract = inlines(v) + elseif k == "ED" then + if ref.editor then + table.insert(ref.editor, inlines(v)) + else + ref.editor = {inlines(v)} + end + elseif k == "JO" or k == "JF" or k == "T2" or + (k == "BT" and ref.type ~= "book") then + ref["container-title"] = inlines(v) + elseif k == "PY" or k == "Y1" then + ref.issued = v + elseif k == "IS" then + ref.issue = v + elseif k == "SN" then + ref.ISSN = v + elseif k == "L" then + ref.lang = v + elseif k == "UR" or k == "LK" then + ref.URL = v + end + end + return ref +end + +function Reader(input, reader_options) + local refs = {} + local thisref = {} + local ids = {} + for line in string.gmatch(input, "[^\n]*") do + key, val = string.match(line, "([A-Z][A-Z0-9]) %- (.*)") + if key == "ER" then + -- clean up fields + local newref = clean(thisref) + -- ensure we have an id and if not, create a sensible one + if not newref.id then + newref.id = "" + for _,x in ipairs(newref.author) do + newref.id = newref.id .. string.match(pandoc.utils.stringify(x), "%a+") + end + if newref.issued then + newref.id = newref.id .. string.match(newref.issued, "%d+") + end + if ids[newref.id] then -- add disambiguator if needed + newref.id = newref.id .. "-" .. #ids + end + end + table.insert(ids, newref.id) + table.insert(refs, newref) + thisref = {} + elseif key then + table.insert(thisref, {key, val}) + end + end + return pandoc.Pandoc({}, pandoc.Meta { references = refs } ) +end +``` + +Example of use: + +``` +% pandoc -f ris.lua -t bibtex +TY - JOUR +AU - Shannon, Claude E. +PY - 1948 +DA - July +TI - A Mathematical Theory of Communication +T2 - Bell System Technical Journal +SP - 379 +EP - 423 +VL - 27 +ER - +TY - JOUR +T1 - On computable numbers, with an application to the Entscheidungsproblem +A1 - Turing, Alan Mathison +JO - Proc. of London Mathematical Society +VL - 47 +IS - 1 +SP - 230 +EP - 265 +Y1 - 1937 +ER - +^D +@article{Shannon1948, + author = {Shannon, Claude E.}, + title = {A {Mathematical} {Theory} of {Communication}}, + journal = {Bell System Technical Journal}, + volume = {27}, + pages = {379-423}, + year = {1948} +} +@article{Turing1937, + author = {Turing, Alan Mathison}, + title = {On Computable Numbers, with an Application to the + {Entscheidungsproblem}}, + journal = {Proc. of London Mathematical Society}, + volume = {47}, + number = {1}, + pages = {230-265}, + year = {1937} +} +``` + +# Example: a wiki Creole reader + +This is a parser for [Creole common wiki markup]. +It uses an [lpeg] grammar. Fun fact: this custom reader is faster than +pandoc's built-in creole reader! This shows that high-performance +readers can be designed in this way. + +[Creole common wiki markup]: http://www.wikicreole.org/wiki/CheatSheet + + +```lua +-- A sample custom reader for Creole 1.0 (common wiki markup) +-- http://www.wikicreole.org/wiki/CheatSheet + +-- For better performance we put these functions in local variables: +local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt = + lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V, + lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt + +local whitespacechar = S(" \t\r\n") +local specialchar = S("/*~[]\\{}|") +local wordchar = (1 - (whitespacechar + specialchar)) +local spacechar = S(" \t") +local newline = P"\r"^-1 * P"\n" +local blankline = spacechar^0 * newline +local endline = newline * #-blankline +local endequals = spacechar^0 * P"="^0 * spacechar^0 * newline +local cellsep = spacechar^0 * P"|" + +local function trim(s) + return (s:gsub("^%s*(.-)%s*$", "%1")) +end + +local function ListItem(lev, ch) + local start + if ch == nil then + start = S"*#" + else + start = P(ch) + end + local subitem = function(c) + if lev < 6 then + return ListItem(lev + 1, c) + else + return (1 - 1) -- fails + end + end + local parser = spacechar^0 + * start^lev + * #(- start) + * spacechar^0 + * Ct((V"Inline" - (newline * spacechar^0 * S"*#"))^0) + * newline + * (Ct(subitem("*")^1) / pandoc.BulletList + + + Ct(subitem("#")^1) / pandoc.OrderedList + + + Cc(nil)) + / function (ils, sublist) + return { pandoc.Plain(ils), sublist } + end + return parser +end + +-- Grammar +G = P{ "Doc", + Doc = Ct(V"Block"^0) + / pandoc.Pandoc ; + Block = blankline^0 + * ( V"Header" + + V"HorizontalRule" + + V"CodeBlock" + + V"List" + + V"Table" + + V"Para") ; + Para = Ct(V"Inline"^1) + * newline + / pandoc.Para ; + HorizontalRule = spacechar^0 + * P"----" + * spacechar^0 + * newline + / pandoc.HorizontalRule; + Header = (P("=")^1 / string.len) + * spacechar^1 + * Ct((V"Inline" - endequals)^1) + * endequals + / pandoc.Header; + CodeBlock = P"{{{" + * blankline + * C((1 - (newline * P"}}}"))^0) + * newline + * P"}}}" + / pandoc.CodeBlock; + Placeholder = P"<<<" + * C(P(1) - P">>>")^0 + * P">>>" + / function() return pandoc.Div({}) end; + List = V"BulletList" + + V"OrderedList" ; + BulletList = Ct(ListItem(1,'*')^1) + / pandoc.BulletList ; + OrderedList = Ct(ListItem(1,'#')^1) + / pandoc.OrderedList ; + Table = (V"TableHeader" + Cc{}) + * Ct(V"TableRow"^1) + / function(headrow, bodyrows) + local numcolumns = #(bodyrows[1]) + local aligns = {} + local widths = {} + for i = 1,numcolumns do + aligns[i] = pandoc.AlignDefault + widths[i] = 0 + end + return pandoc.utils.from_simple_table( + pandoc.SimpleTable({}, aligns, widths, headrow, bodyrows)) + end ; + TableHeader = Ct(V"HeaderCell"^1) + * cellsep^-1 + * spacechar^0 + * newline ; + TableRow = Ct(V"BodyCell"^1) + * cellsep^-1 + * spacechar^0 + * newline ; + HeaderCell = cellsep + * P"=" + * spacechar^0 + * Ct((V"Inline" - (newline + cellsep))^0) + / function(ils) return { pandoc.Plain(ils) } end ; + BodyCell = cellsep + * spacechar^0 + * Ct((V"Inline" - (newline + cellsep))^0) + / function(ils) return { pandoc.Plain(ils) } end ; + Inline = V"Emph" + + V"Strong" + + V"LineBreak" + + V"Link" + + V"URL" + + V"Image" + + V"Str" + + V"Space" + + V"SoftBreak" + + V"Escaped" + + V"Placeholder" + + V"Code" + + V"Special" ; + Str = wordchar^1 + / pandoc.Str; + Escaped = P"~" + * C(P(1)) + / pandoc.Str ; + Special = specialchar + / pandoc.Str; + Space = spacechar^1 + / pandoc.Space ; + SoftBreak = endline + * # -(V"HorizontalRule" + V"CodeBlock") + / pandoc.SoftBreak ; + LineBreak = P"\\\\" + / pandoc.LineBreak ; + Code = P"{{{" + * C((1 - P"}}}")^0) + * P"}}}" + / trim / pandoc.Code ; + Link = P"[[" + * C((1 - (P"]]" + P"|"))^0) + * (P"|" * Ct((V"Inline" - P"]]")^1))^-1 * P"]]" + / function(url, desc) + local txt = desc or {pandoc.Str(url)} + return pandoc.Link(txt, url) + end ; + Image = P"{{" + * #-P"{" + * C((1 - (S"}"))^0) + * (P"|" * Ct((V"Inline" - P"}}")^1))^-1 + * P"}}" + / function(url, desc) + local txt = desc or "" + return pandoc.Image(txt, url) + end ; + URL = P"http" + * P"s"^-1 + * P":" + * (1 - (whitespacechar + (S",.?!:;\"'" * #whitespacechar)))^1 + / function(url) + return pandoc.Link(pandoc.Str(url), url) + end ; + Emph = P"//" + * Ct((V"Inline" - P"//")^1) + * P"//" + / pandoc.Emph ; + Strong = P"**" + * Ct((V"Inline" -P"**")^1) + * P"**" + / pandoc.Strong ; +} + +function Reader(input, reader_options) + return lpeg.match(G, input) +end +``` + +Example of use: + +``` +% pandoc -f creole.lua -t markdown +== Wiki Creole + +You can make things **bold** or //italic// or **//both//** or //**both**//. + +Character formatting extends across line breaks: **bold, +this is still bold. This line deliberately does not end in star-star. + +Not bold. Character formatting does not cross paragraph boundaries. + +You can use [[internal links]] or [[http://www.wikicreole.org|external links]], +give the link a [[internal links|different]] name. +^D +## Wiki Creole + +You can make things **bold** or *italic* or ***both*** or ***both***. + +Character formatting extends across line breaks: \*\*bold, this is still +bold. This line deliberately does not end in star-star. + +Not bold. Character formatting does not cross paragraph boundaries. + +You can use [internal links](internal links) or [external +links](http://www.wikicreole.org), give the link a +[different](internal links) name. +``` + -- cgit v1.2.3 From 005dc7ce56a4a165fa9af239cc28a2589f7b169d Mon Sep 17 00:00:00 2001 From: willj-dev <94586033+willj-dev@users.noreply.github.com> Date: Thu, 18 Nov 2021 17:33:57 -0800 Subject: RST reader: handle class attribute for for custom roles (#7700) Previously the class attribute was ignored, and the name of the role used as the class. Closes #7699. --- src/Text/Pandoc/Readers/RST.hs | 24 ++++++++++++++++-------- test/Tests/Readers/RST.hs | 9 +++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 8ee017342..88471eb0a 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -919,14 +919,22 @@ addNewRole roleText fields = do (baseRole, baseFmt, baseAttr) = getBaseRole (parentRole, Nothing, nullAttr) customRoles fmt = if parentRole == "raw" then lookup "format" fields else baseFmt - annotate :: [Text] -> [Text] - annotate = maybe id (:) $ - if baseRole == "code" - then lookup "language" fields - else Nothing - attr = let (ident, classes, keyValues) = baseAttr - -- nub in case role name & language class are the same - in (ident, nub . (role :) . annotate $ classes, keyValues) + + updateClasses :: [Text] -> [Text] + updateClasses oldClasses = let + + codeLanguageClass = if baseRole == "code" + then maybeToList (lookup "language" fields) + else [] + + -- if no ":class:" field is given, the default is the role name + classFieldClasses = maybe [role] T.words (lookup "class" fields) + + -- nub in case role name & language class are the same + in nub (classFieldClasses ++ codeLanguageClass ++ oldClasses) + + attr = let (ident, baseClasses, keyValues) = baseAttr + in (ident, updateClasses baseClasses, keyValues) -- warn about syntax we ignore forM_ fields $ \(key, _) -> case key of diff --git a/test/Tests/Readers/RST.hs b/test/Tests/Readers/RST.hs index a12b59fc2..e9ab8cc11 100644 --- a/test/Tests/Readers/RST.hs +++ b/test/Tests/Readers/RST.hs @@ -179,6 +179,15 @@ tests = [ "line block with blank line" =: , "custom code role with language field" =: ".. role:: lhs(code)\n :language: haskell\n\n:lhs:`a`" =?> para (codeWith ("", ["lhs", "haskell"], []) "a") + , "custom role with class field" + =: ".. role:: classy\n :class: myclass\n\n:classy:`a`" + =?> para (spanWith ("", ["myclass"], []) "a") + , "custom role with class field containing multiple whitespace-separated classes" + =: ".. role:: classy\n :class: myclass1 myclass2\n myclass3\n\n:classy:`a`" + =?> para (spanWith ("", ["myclass1", "myclass2", "myclass3"], []) "a") + , "custom role with inherited class field" + =: ".. role:: classy\n :class: myclass1\n.. role:: classier(classy)\n :class: myclass2\n\n:classier:`a`" + =?> para (spanWith ("", ["myclass2", "myclass1"], []) "a") , "custom role with unspecified parent role" =: ".. role:: classy\n\n:classy:`text`" =?> para (spanWith ("", ["classy"], []) "text") -- cgit v1.2.3 From 25bba0cc62dae54b5b5a4a9ba540fa7b1ec54530 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 18 Nov 2021 20:03:06 -0800 Subject: MediaWiki writer: use HTML spans for anchors when header has id. Closes #7697. --- src/Text/Pandoc/Writers/MediaWiki.hs | 10 ++++++++-- test/command/7697.md | 27 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 test/command/7697.md diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index c7c53943a..e5e2dfde2 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -128,10 +128,16 @@ blockToMediaWiki b@(RawBlock f str) blockToMediaWiki HorizontalRule = return "\n-----\n" -blockToMediaWiki (Header level _ inlines) = do +blockToMediaWiki (Header level (ident,_,_) inlines) = do + opts <- gets stOptions + let autoId = uniqueIdent (writerExtensions opts) inlines mempty contents <- inlineListToMediaWiki inlines let eqs = T.replicate level "=" - return $ eqs <> " " <> contents <> " " <> eqs <> "\n" + return $ + (if T.null ident || autoId == ident + then "" + else " ident <> "\">\n") + <> eqs <> " " <> contents <> " " <> eqs <> "\n" blockToMediaWiki (CodeBlock (_,classes,keyvals) str) = do let at = Set.fromList classes `Set.intersection` highlightingLangs diff --git a/test/command/7697.md b/test/command/7697.md new file mode 100644 index 000000000..28e865c82 --- /dev/null +++ b/test/command/7697.md @@ -0,0 +1,27 @@ +``` +% pandoc -f rst -t mediawiki +.. _refsubpage1: + +heading +------- + +ref to top of this section: `refsubpage1`_. +^D + += heading = + +ref to top of this section: [[#refsubpage1|refsubpage1]]. +``` +``` +% pandoc -f markdown -t mediawiki +# Heading {#foo} +^D + += Heading = +``` +``` +% pandoc -f markdown -t mediawiki +# Heading {#heading} +^D += Heading = +``` -- cgit v1.2.3 From df5ae1c186ed625e25cf6f080ddf24549f7af22e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 19 Nov 2021 08:50:18 -0800 Subject: HTML writer: Don't create invalid `data-` attribute... for empty attribute key. (It would be better to make these unrepresentable in the type system, but for now this is an improvement.) Closes #7546. --- src/Text/Pandoc/Writers/HTML.hs | 1 + test/command/7546.md | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 test/command/7546.md diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 0a4c47387..247cddfc9 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -633,6 +633,7 @@ toAttrs kvs = do return (keys, attrs) else return (Set.insert k keys, addAttr html5 mbEpubVersion k v attrs) addAttr html5 mbEpubVersion x y + | T.null x = id -- see #7546 | html5 = if x `Set.member` (html5Attributes <> rdfaAttributes) || T.any (== ':') x -- e.g. epub: namespace diff --git a/test/command/7546.md b/test/command/7546.md new file mode 100644 index 000000000..aed17275e --- /dev/null +++ b/test/command/7546.md @@ -0,0 +1,6 @@ +``` +% pandoc -t html -f native +Span ("", [], [("","")]) [] +^D + +``` -- cgit v1.2.3 From 4f2eac88aa1cd26d096a88450ad3ae929980e7a6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 19 Nov 2021 09:05:19 -0800 Subject: MediaWiki writer: fix code for generating spans for header IDs. We need to generate a span when the header's ID doesn't match the one MediaWiki would generate automatically. But MediaWiki's generation scheme is different from ours (it uses uppercase letters, and `_` instead of `-`, for example). This means that in going from markdown -> mediawiki, we'll now get spans before almost every heading, unless explicit identifiers are used that correspond to the ones MediaWiki auto-generates. This is uglier output but it's necessary for internal links to work properly. See #7697. --- src/Text/Pandoc/Writers/MediaWiki.hs | 2 +- test/command/7697.md | 4 ++-- test/writer.mediawiki | 31 +++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index e5e2dfde2..3954c62a6 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -130,7 +130,7 @@ blockToMediaWiki HorizontalRule = return "\n-----\n" blockToMediaWiki (Header level (ident,_,_) inlines) = do opts <- gets stOptions - let autoId = uniqueIdent (writerExtensions opts) inlines mempty + let autoId = T.replace " " "_" $ stringify inlines contents <- inlineListToMediaWiki inlines let eqs = T.replicate level "=" return $ diff --git a/test/command/7697.md b/test/command/7697.md index 28e865c82..eb9c823d0 100644 --- a/test/command/7697.md +++ b/test/command/7697.md @@ -21,7 +21,7 @@ ref to top of this section: [[#refsubpage1|refsubpage1]]. ``` ``` % pandoc -f markdown -t mediawiki -# Heading {#heading} +# My Heading {#My_Heading} ^D -= Heading = += My Heading = ``` diff --git a/test/writer.mediawiki b/test/writer.mediawiki index 79cc1b4e1..23cb78e60 100644 --- a/test/writer.mediawiki +++ b/test/writer.mediawiki @@ -3,24 +3,33 @@ This is a set of tests for pandoc. Most of them are adapted from John Gruber’s ----- + = Headers = + == Level 2 with an [[url|embedded link]] == + === Level 3 with ''emphasis'' === + ==== Level 4 ==== + ===== Level 5 ===== + = Level 1 = + == Level 2 with ''emphasis'' == + === Level 3 === with no blank line + == Level 2 == with no blank line @@ -28,6 +37,7 @@ with no blank line ----- + = Paragraphs = Here’s a regular paragraph. @@ -42,6 +52,7 @@ here. ----- + = Block Quotes = E-mail style: @@ -71,6 +82,7 @@ And a following paragraph. ----- + = Code Blocks = Code: @@ -90,8 +102,10 @@ These should not be escaped: \$ \\ \> \[ \{ ----- + = Lists = + == Unordered == Asterisks tight: @@ -130,6 +144,7 @@ Minuses loose: * Minus 2 * Minus 3 + == Ordered == Tight: @@ -164,6 +179,7 @@ Multiple paragraphs:
  • Item 2.

  • Item 3.

  • + == Nested == * Tab @@ -188,6 +204,7 @@ Same thing but with paragraphs: #* Foe # Third + == Tabs and spaces == * this is a list item indented with tabs @@ -195,6 +212,7 @@ Same thing but with paragraphs: ** this is an example list item indented with tabs ** this is an example list item indented with spaces + == Fancy list markers ==
      @@ -239,6 +257,7 @@ B. Williams ----- + = Definition Lists = Tight using spaces: @@ -307,6 +326,7 @@ Blank line after term, indented marker, alternate markers: ;# sublist ;# sublist + = HTML Blocks = Simple block on one line: @@ -416,6 +436,7 @@ Hr’s: ----- + = Inline Markup = This is ''emphasized'', and so ''is this''. @@ -445,6 +466,7 @@ These should not be superscripts or subscripts, because of the unescaped spaces: ----- + = Smart quotes, ellipses, dashes = “Hello,” said the spider. “‘Shelob’ is my name.” @@ -466,6 +488,7 @@ Ellipses…and…and…. ----- + = LaTeX = * @@ -490,6 +513,7 @@ Here’s a LaTeX table: ----- + = Special Characters = Here is some unicode: @@ -545,8 +569,10 @@ Minus: - ----- + = Links = + == Explicit == Just a [[url/|URL]]. @@ -567,6 +593,7 @@ Just a [[url/|URL]]. [[|Empty]]. + == Reference == Foo [[url/|bar]]. @@ -588,6 +615,7 @@ Foo [[url/|bar]]. Foo [[url/|biz]]. + == With ampersands == Here’s a [http://example.com/?foo=1&bar=2 link with an ampersand in the URL]. @@ -598,6 +626,7 @@ Here’s an [[script?foo=1&bar=2|inline link]]. Here’s an [[script?foo=1&bar=2|inline link in pointy braces]]. + == Autolinks == With an ampersand: http://example.com/?foo=1&bar=2 @@ -616,6 +645,7 @@ Auto-links should not occur here: <http://example.com/> ----- + = Images = From “Voyage dans la Lune” by Georges Melies (1902): @@ -627,6 +657,7 @@ Here is a movie [[File:movie.jpg|movie]] icon. ----- + = Footnotes = Here is a footnote reference,Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document. and another.Here’s the long note. This one contains multiple blocks. -- cgit v1.2.3 From 2b23861948e1925a3ee61773bd92f50c8e6079ec Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 19 Nov 2021 10:21:23 -0800 Subject: Remove unused line. --- src/Text/Pandoc/Writers/MediaWiki.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/MediaWiki.hs b/src/Text/Pandoc/Writers/MediaWiki.hs index 3954c62a6..f047baf1c 100644 --- a/src/Text/Pandoc/Writers/MediaWiki.hs +++ b/src/Text/Pandoc/Writers/MediaWiki.hs @@ -129,7 +129,6 @@ blockToMediaWiki b@(RawBlock f str) blockToMediaWiki HorizontalRule = return "\n-----\n" blockToMediaWiki (Header level (ident,_,_) inlines) = do - opts <- gets stOptions let autoId = T.replace " " "_" $ stringify inlines contents <- inlineListToMediaWiki inlines let eqs = T.replicate level "=" -- cgit v1.2.3 From c1a82896c662d320d75db060aa003f6fc1ccf852 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 19 Nov 2021 20:59:23 +0100 Subject: Lua: fix global module loading (#7701) --- src/Text/Pandoc/Lua/Init.hs | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index 72a06f556..2f113bff2 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -14,10 +14,11 @@ module Text.Pandoc.Lua.Init ( runLua ) where -import Control.Monad (forM_, when) +import Control.Monad (forM, forM_, when) import Control.Monad.Catch (throwM, try) import Control.Monad.Trans (MonadIO (..)) import Data.Data (Data, dataTypeConstrs, dataTypeOf, showConstr) +import Data.Maybe (catMaybes) import HsLua as Lua hiding (status, try) import GHC.IO.Encoding (getForeignEncoding, setForeignEncoding, utf8) import Text.Pandoc.Class.PandocMonad (PandocMonad, readDataFile) @@ -78,23 +79,42 @@ initLuaState = do _ -> T.pack $ show err setGlobalModules :: PandocLua () - setGlobalModules = liftPandocLua $ - forM_ [ ("lpeg", LPeg.luaopen_lpeg_ptr) - , ("re", LPeg.luaopen_re_ptr) - ] $ + setGlobalModules = liftPandocLua $ do + let globalModules = + [ ("lpeg", LPeg.luaopen_lpeg_ptr) -- must be loaded first + , ("re", LPeg.luaopen_re_ptr) -- re depends on lpeg + ] + loadedBuiltInModules <- fmap catMaybes . forM globalModules $ \(pkgname, luaopen) -> do Lua.pushcfunction luaopen - Lua.pcall 0 1 Nothing >>= \case - OK -> pure () -- all good, loading succeeded + usedBuiltIn <- Lua.pcall 0 1 Nothing >>= \case + OK -> do -- all good, loading succeeded + -- register as loaded module so later modules can rely on this + Lua.getfield Lua.registryindex Lua.loaded + Lua.pushvalue (Lua.nth 2) + Lua.setfield (Lua.nth 2) pkgname + Lua.pop 1 -- pop _LOADED + return True _ -> do -- built-in library failed, load system lib Lua.pop 1 -- ignore error message -- Try loading via the normal package loading mechanism. Lua.getglobal "require" Lua.pushName pkgname Lua.call 1 1 -- Throws an exception if loading failed again! + return False -- Module on top of stack. Register as global Lua.setglobal pkgname + return $ if usedBuiltIn then Just pkgname else Nothing + + -- Remove module entry from _LOADED table in registry if we used a + -- built-in library. This ensures that later calls to @require@ will + -- prefer the shared library, if any. + forM_ loadedBuiltInModules $ \pkgname -> do + Lua.getfield Lua.registryindex Lua.loaded + Lua.pushnil + Lua.setfield (Lua.nth 2) pkgname + Lua.pop 1 -- registry installLpegSearcher :: PandocLua () installLpegSearcher = liftPandocLua $ do -- cgit v1.2.3 From db9a73c84259beb8679a838ed4cd44fbdf45c568 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 19 Nov 2021 21:54:55 -0800 Subject: Lua tests: reset path and cpath when testing 'require' fallback. --- test/Tests/Lua.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index 5e81cec6a..2070695e3 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -221,11 +221,13 @@ tests = map (localOption (QuickCheckTests 20)) Lua.liftIO $ Lua.OK @=? s , testCase "module 'lpeg' is available via `require`" . runLuaTest $ do - s <- Lua.dostring "require 'lpeg'" + s <- Lua.dostring + "package.path = ''; package.cpath = ''; require 'lpeg'" Lua.liftIO $ Lua.OK @=? s , testCase "module 're' is available via `require`" . runLuaTest $ do - s <- Lua.dostring "require 're'" + s <- Lua.dostring + "package.path = ''; package.cpath = ''; require 're'" Lua.liftIO $ Lua.OK @=? s ] -- cgit v1.2.3 From 96a4bbe264b6eba8d334df0177d17a75e269bb47 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 20 Nov 2021 18:48:01 +0100 Subject: Capture `alt-text` in JATS figures (#7703) Co-authored-by: Aner Lucero <4rgento@gmail.com> --- src/Text/Pandoc/Readers/JATS.hs | 15 +++++++++++++-- test/command/jats-figure-alt-text.md | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 test/command/jats-figure-alt-text.md diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs index 9cdbf1611..37e0d13bc 100644 --- a/src/Text/Pandoc/Readers/JATS.hs +++ b/src/Text/Pandoc/Readers/JATS.hs @@ -35,6 +35,7 @@ import Text.Pandoc.XML.Light import qualified Data.Set as S (fromList, member) import Data.Set ((\\)) import Text.Pandoc.Sources (ToSources(..), sourcesToText) +import qualified Data.Foldable as DF type JATS m = StateT JATSState m @@ -226,9 +227,19 @@ parseBlock (Elem e) = mapM getInlines (filterChildren (const True) t) Nothing -> return mempty - img <- getGraphic (Just (capt, attrValue "id" e)) g - return $ para img + + let figAttributes = DF.toList $ + ("alt", ) . strContent <$> + filterChild (named "alt-text") e + + return $ simpleFigureWith + (attrValue "id" e, [], figAttributes) + capt + (attrValue "href" g) + (attrValue "title" g) + _ -> divWith (attrValue "id" e, ["fig"], []) <$> getBlocks e + parseTable = do let isCaption x = named "title" x || named "caption" x capt <- case filterChild isCaption e of diff --git a/test/command/jats-figure-alt-text.md b/test/command/jats-figure-alt-text.md new file mode 100644 index 000000000..229e52eda --- /dev/null +++ b/test/command/jats-figure-alt-text.md @@ -0,0 +1,18 @@ +``` +% pandoc -f jats -t native + + +

      bar

      + + alternative-decription + +
      +^D +[ Para + [ Image + ( "fig-1" , [] , [ ( "alt" , "alternative-decription" ) ] ) + [ Str "bar" ] + ( "foo.png" , "fig:" ) + ] +] +``` -- cgit v1.2.3 From 06eb889e9274248641d0bc45d56812f5bdf9ddae Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 20 Nov 2021 15:18:19 -0800 Subject: Use released texmath. --- stack.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stack.yaml b/stack.yaml index 2bfc9ad02..c77ee622f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -32,9 +32,7 @@ extra-deps: - citeproc-0.6 - aeson-pretty-0.8.9 - ipynb-0.1.0.2 -# - texmath-0.12.3.2 -- git: https://github.com/jgm/texmath.git - commit: 674bcbaec03e5550f155623de6662953bd157625 +- texmath-0.12.3.3 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From 62cc9fe22737f9ea077671a47e7bb8742b74b2d4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 20 Nov 2021 17:11:44 -0800 Subject: Update changelog. --- changelog.md | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/changelog.md b/changelog.md index 148b8566a..a59604f19 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,167 @@ # Revision history for pandoc +## pandoc 2.16.2 PROVISIONAL (DATE) + + * Add interface for custom readers written in Lua (#7669). + Users can now do `-f myreader.lua` and pandoc will treat the + script myreader.lua as a custom reader, which parses an input + string to a pandoc AST, using the pandoc module defined for + Lua filters. A sample custom reader can be found in data/creole.lua. + Also see documentation in `doc/custom-readers.md`. + + * New module Text.Pandoc.Readers.Custom, exporting `readCustom` [API change]. + + * Allow `plain` to be used in raw attribute syntax. + + * Accept empty `--metadata-file` (#7675). + This was a regression from 2.15 behavior. + + * Markdown reader: Improve inlinesInBalancedBrackets. + This is just a small improvement in terms of performance, but it's simpler + and more direct code. Also, we avoid parsing interparagraph spaces in + balanced brackets, as the original did. + + * BibTeX reader: Properly handle commented lines in BibTeX/BibLaTeX (#7668). + + * RST reader: handle class attribute for for custom roles (#7699, + willj-dev). Previously the class attribute was ignored, and the name + of the role used as the class. + + * DocBook reader: + + + Add `` support (Rowan Rodrik van der Molen). + + Support for `` (#7607, Rowan Rodrik van der Molen). + + * LaTeX reader: + + + Add rudimentary support for `\autoref` (#7693). + + Add 'uri' class when parsing `\url`, for consistency + with treatment of autolinks in other formats (#7672). + + * JATS reader: Capture `alt-text` in figures (#7703, Albert Krewinkel + and Aner Lucero). + + * MediaWiki writer: use HTML spans for anchors when header has id (#7697). + We need to generate a span when the header's ID doesn't match + the one MediaWiki would generate automatically. Note that MediaWiki's + generation scheme is different from pandoc's (it uses uppercase letters, + and `_` instead of `-`, for example). This means that in going from + markdown -> mediawiki, we'll now get spans before almost every heading, + unless explicit identifiers are used that correspond to the ones MediaWiki + auto-generates. This is uglier output but it's necessary for internal + links to work properly. + + * Markdown writer: don't create autolinks when this loses information + (#7692). Previously we sometimes lost attributes when rendering links + as autolinks. + + * JATS writer: + + + Ensure figures are wrapped with `

      ` in list items + (Albert Krewinkel). This prevents the generation of invalid output. + + Add URL to element citation entries (Albert Krewinkel). + The URL of a reference, if present, is added in tag `` to + element-citation entries. + + * HTML writer: Don't create invalid `data-` attribute for empty + attribute key (#7546). + + * LaTeX writer: + + + Babel mappings: use `ancientgreek` for `grc`. + + With `-t latex-smart`, don't generate `\ldots` from ellipsis (#7674). + Instead just use unicode ellipsis. + + * JATS template: fix equal-contrib attribute (Albert Krewinkel). + The standard requires the value to be either `yes` or `no`, but is was + set to `true` for authors who contributed equally. + + * reveal.js template: Add `disableLayout` variable (Christophe Dervieux). + + * Text.Pandoc.Error: sort errors in `handleError` by exit code + (Albert Krewinkel). + + * Text.Pandoc.Writers.Shared: Improve toLegacyTable (#7683, + Christian Despres). + + * Lua subsystem: + + + Include lpeg module (#7649, Albert Krewinkel). Compiles the `lpeg` + library (Parsing Expression Grammars For Lua) into + the program. Package maintainers may choose to rely on package + dependencies to make lpeg available, in which case they can compile + the with the constraint `lpeg +rely-on-shared-lpeg-library`. + `lpeg` and `re` are always made available in global variables, + without the need for a `require`. + + + Set `lpeg` and `re` as globals; allow shared lib access via require + The `lpeg` and `re` modules are loaded into globals of the respective + name, but they are not necessarily registered as loaded packages. This + ensures that + + - the built-in library versions are preferred when setting the globals, + - a shared library is used if pandoc has been compiled without `lpeg`, + and + - the `require` mechanism can be used to load the shared library if + available, falling back to the internal version if possible and + necessary. + + + Fix argument order in constructor `pandoc.Cite` (Albert Krewinkel). + This restores the old behavior; argument order had been switched + accidentally in pandoc 2.15. + + + Add Pushable instance for `ReaderOptions` (Albert Krewinkel). + + + Allow to pass custom reader options to `pandoc.read` as an + optional third argument (#7656, Albert Krewinkel). + The object can either be a table or a ReaderOptions value + like `PANDOC_READER_OPTIONS`. Creating new ReaderOptions objects is + possible through the new constructor `pandoc.ReaderOptions`. + + + Display Pandoc values using their native Haskell representation + (Albert Krewinkel). + + + Require latest hslua (2.0.1) (#7661, #7657, Albert Krewinkel). + This fixes issues with + + - misleading error messages when a required function parameter is + omitted; + - absent properties still being listed in the output of `pairs`; and + - alias accessing leading to errors instead of returning `nil`, e.g. + with `(pandoc.Str '').identifier`. + + + Add missing space in "package not found" message (#7658, Albert + Krewinkel). + + * Update build files (#7696, Fabián Heredia Montiel). + Drop old windows 32-bit constraints. + Update cabal `tested-with` field to correspond to `ci.yml` matrix + + * Remove unneeded package dependencies from benchmark target. + + * Require ghc >= 8.6, base >= 4.12. + This allows us to get rid of the old custom prelude and + some crufty cpp. But the primary reason for this is that + conduit has bumped its base lower bound to 4.12, making it + impossible for us to support lower base versions. + + * Require Cabal 2.4. Use wildcards to ensure that all pptx tests are + included (#7677). + + * Update bash_completion.tpl (S.P.H.). + + * Add `data/creole.lua` as sample custom reader. + + * Add doc/custom-readers.md. + + * doc/lua-filters.md: add section on global modules, including lpeg + (Albert Krewinkel). + + * MANUAL.txt: update table of exit codes and corresponding errors + (Albert Krewinkel). + + * Use released texmath. + ## pandoc 2.16.1 (2021-11-02) -- cgit v1.2.3 From f1ce1cc891fe6cdef44e25318b90f8cf942fa632 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 20 Nov 2021 23:12:51 -0800 Subject: Minor changelog edits. --- changelog.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index a59604f19..090f0bd6e 100644 --- a/changelog.md +++ b/changelog.md @@ -4,9 +4,9 @@ * Add interface for custom readers written in Lua (#7669). Users can now do `-f myreader.lua` and pandoc will treat the - script myreader.lua as a custom reader, which parses an input + script `myreader.lua` as a custom reader, which parses an input string to a pandoc AST, using the pandoc module defined for - Lua filters. A sample custom reader can be found in data/creole.lua. + Lua filters. A sample custom reader can be found in `data/creole.lua`. Also see documentation in `doc/custom-readers.md`. * New module Text.Pandoc.Readers.Custom, exporting `readCustom` [API change]. @@ -46,7 +46,7 @@ the one MediaWiki would generate automatically. Note that MediaWiki's generation scheme is different from pandoc's (it uses uppercase letters, and `_` instead of `-`, for example). This means that in going from - markdown -> mediawiki, we'll now get spans before almost every heading, + markdown to mediawiki, we'll now get spans before almost every heading, unless explicit identifiers are used that correspond to the ones MediaWiki auto-generates. This is uglier output but it's necessary for internal links to work properly. -- cgit v1.2.3 From b629bda6d538d8ffe2b6565fe6c507b1ae79e92d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 20 Nov 2021 23:14:33 -0800 Subject: More changelog edits --- changelog.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 090f0bd6e..204996bc9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ # Revision history for pandoc -## pandoc 2.16.2 PROVISIONAL (DATE) +## pandoc 2.16.2 (2021-11-21) * Add interface for custom readers written in Lua (#7669). Users can now do `-f myreader.lua` and pandoc will treat the @@ -16,7 +16,7 @@ * Accept empty `--metadata-file` (#7675). This was a regression from 2.15 behavior. - * Markdown reader: Improve inlinesInBalancedBrackets. + * Markdown reader: Improve `inlinesInBalancedBrackets`. This is just a small improvement in terms of performance, but it's simpler and more direct code. Also, we avoid parsing interparagraph spaces in balanced brackets, as the original did. @@ -72,7 +72,7 @@ + With `-t latex-smart`, don't generate `\ldots` from ellipsis (#7674). Instead just use unicode ellipsis. - * JATS template: fix equal-contrib attribute (Albert Krewinkel). + * JATS template: fix `equal-contrib` attribute (Albert Krewinkel). The standard requires the value to be either `yes` or `no`, but is was set to `true` for authors who contributed equally. @@ -160,7 +160,7 @@ * MANUAL.txt: update table of exit codes and corresponding errors (Albert Krewinkel). - * Use released texmath. + * Use latest texmath. ## pandoc 2.16.1 (2021-11-02) -- cgit v1.2.3 From 572d8017386223a8193b3c502986d16cc70290ae Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 20 Nov 2021 23:19:20 -0800 Subject: Bump to 2.16.2 --- pandoc.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandoc.cabal b/pandoc.cabal index 2514f6805..99962ac4c 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -1,6 +1,6 @@ cabal-version: 2.4 name: pandoc -version: 2.16.1 +version: 2.16.2 build-type: Simple license: GPL-2.0-or-later license-file: COPYING.md -- cgit v1.2.3 From 4857cd176946fe6b3df1966963855d84f434831d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 20 Nov 2021 23:19:22 -0800 Subject: Update man page. --- MANUAL.txt | 2 +- man/pandoc.1 | 54 ++++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 2053771c2..7e15e8833 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1,7 +1,7 @@ --- title: Pandoc User's Guide author: John MacFarlane -date: November 02, 2021 +date: November 20, 2021 --- # Synopsis diff --git a/man/pandoc.1 b/man/pandoc.1 index 5fb524b58..cbc100841 100644 --- a/man/pandoc.1 +++ b/man/pandoc.1 @@ -1,7 +1,7 @@ '\" t -.\" Automatically generated by Pandoc 2.16 +.\" Automatically generated by Pandoc 2.16.1 .\" -.TH "Pandoc User\[cq]s Guide" "" "November 02, 2021" "pandoc 2.16.1" "" +.TH "Pandoc User\[cq]s Guide" "" "November 20, 2021" "pandoc 2.16.2" "" .hy .SH NAME pandoc - general markup converter @@ -304,6 +304,8 @@ if you need extensions not supported in \f[C]gfm\f[R]. \f[C]twiki\f[R] (TWiki markup) .IP \[bu] 2 \f[C]vimwiki\f[R] (Vimwiki) +.IP \[bu] 2 +the path of a custom Lua reader, see Custom readers and writers below .PP Extensions can be individually enabled or disabled by appending \f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name. @@ -432,7 +434,7 @@ markup) .IP \[bu] 2 \f[C]zimwiki\f[R] (ZimWiki markup) .IP \[bu] 2 -the path of a custom Lua writer, see Custom writers below +the path of a custom Lua writer, see Custom readers and writers below .PP Note that \f[C]odt\f[R], \f[C]docx\f[R], \f[C]epub\f[R], and \f[C]pdf\f[R] output will not be directed to \f[I]stdout\f[R] unless @@ -1598,6 +1600,11 @@ Error T} _ T{ +1 +T}@T{ +PandocIOError +T} +T{ 3 T}@T{ PandocFailOnWarningError @@ -1703,6 +1710,11 @@ T}@T{ PandocFilterError T} T{ +84 +T}@T{ +PandocLuaError +T} +T{ 91 T}@T{ PandocMacroLoop @@ -6216,7 +6228,7 @@ Include source position attributes when parsing \f[C]commonmark\f[R]. For elements that accept attributes, a \f[C]data-pos\f[R] attribute is added; other elements are placed in a surrounding Div or Span elemnet with a \f[C]data-pos\f[R] attribute. -.SS Extension: \f[C]short_subsuperscript\f[R] +.SS Extension: \f[C]short_subsuperscripts\f[R] .PP Parse multimarkdown style subscripts and superscripts, which start with a `\[ti]' or `\[ha]' character, respectively, and include the @@ -7810,26 +7822,44 @@ text style. With these custom styles, you can use your input document as a reference-doc while creating docx output (see below), and maintain the same styles in your input and output files. -.SH CUSTOM WRITERS +.SH CUSTOM READERS AND WRITERS .PP -Pandoc can be extended with custom writers written in Lua. +Pandoc can be extended with custom readers and writers written in Lua. (Pandoc includes a Lua interpreter, so Lua need not be installed separately.) .PP -To use a custom writer, simply specify the path to the Lua script in -place of the output format. +To use a custom reader or writer, simply specify the path to the Lua +script in place of the input or output format. For example: .IP .nf \f[C] pandoc -t data/sample.lua +pandoc -f my_custom_markup_language.lua -t latex -s \f[R] .fi .PP -Creating a custom writer requires writing a Lua function for each -possible element in a pandoc document. -To get a documented example which you can modify according to your -needs, do +A custom reader is a Lua script that defines one function, Reader, which +takes a string as input and returns a Pandoc AST. +See the Lua filters documentation for documentation of the functions +that are available for creating pandoc AST elements. +For parsing, the lpeg parsing library is available by default. +To see a sample custom reader: +.IP +.nf +\f[C] +pandoc --print-default-data-file creole.lua +\f[R] +.fi +.PP +If you want your custom reader to have access to reader options +(e.g.\ the tab stop setting), you give your Reader function a second +\f[C]options\f[R] parameter. +.PP +A custom writer is a Lua script that defines a function that specifies +how to render each element in a Pandoc AST. +To see a documented example which you can modify according to your +needs: .IP .nf \f[C] -- cgit v1.2.3 From 464abdc854b21b713e68335e07f2331a623acc97 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 21 Nov 2021 10:15:35 +0100 Subject: Rename doc/custom-reader.lua to doc/custom-readers.md --- doc/custom-readers.lua | 599 ------------------------------------------------- doc/custom-readers.md | 599 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 599 insertions(+), 599 deletions(-) delete mode 100644 doc/custom-readers.lua create mode 100644 doc/custom-readers.md diff --git a/doc/custom-readers.lua b/doc/custom-readers.lua deleted file mode 100644 index bef3ae050..000000000 --- a/doc/custom-readers.lua +++ /dev/null @@ -1,599 +0,0 @@ ---- -author: -- John MacFarlane -date: 'November 18, 2021' -title: Creating Custom Pandoc Readers in Lua ---- - -# Introduction - -If you need to parse a format not already handled by pandoc, -you can create a custom reader using the [Lua] language. -Pandoc has a built-in Lua interpreter, so you needn't -install any additional software to do this. - -[Lua]: https://www.lua.org - -A custom writer is a Lua file that defines a function -called `Reader`, which takes two arguments: - -- a string, the raw input to be parsed -- optionally, a table of reader options, e.g. - `{ columns = 62, standalone = true }`. - -The `Reader` function should return a `Pandoc` AST. -This can be created using functions in the [`pandoc` module], -which is automatically in scope. (Indeed, all of the utility -functions that are available for [Lua filters] are available -in custom readers, too.) - -[Lua filters]: https://pandoc.org/lua-filters.html -[`pandoc` module]: https://pandoc.org/lua-filters.html#module-pandoc - -A minimal example would be - -```lua -function Reader(input) - return pandoc.Pandoc({ pandoc.CodeBlock(input) }) -end -``` - -This just returns a document containing a big code block with -all of the input. - -In a nontrivial reader, you'll want to parse the input. -You can do this using standard Lua library functions -(for example, the [patterns] library), or with the powerful -and fast [lpeg] parsing library, which is automatically in scope. -You can also use external Lua libraries (for example, -an XML parser). - -[patterns]: http://lua-users.org/wiki/PatternsTutorial -[lpeg]: http://www.inf.puc-rio.br/~roberto/lpeg/ - -# Example: plain text reader - -This is a simple example using [lpeg] to parse the input -into space-separated strings and blankline-separated paragraphs. - -```lua --- A sample custom reader that just parses text into blankline-separated --- paragraphs with space-separated words. - --- For better performance we put these functions in local variables: -local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt = - lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V, - lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt - -local whitespacechar = S(" \t\r\n") -local wordchar = (1 - whitespacechar) -local spacechar = S(" \t") -local newline = P"\r"^-1 * P"\n" -local blanklines = newline * (spacechar^0 * newline)^1 -local endline = newline - blanklines - --- Grammar -G = P{ "Pandoc", - Pandoc = Ct(V"Block"^0) / pandoc.Pandoc; - Block = blanklines^0 * V"Para" ; - Para = Ct(V"Inline"^1) / pandoc.Para; - Inline = V"Str" + V"Space" + V"SoftBreak" ; - Str = wordchar^1 / pandoc.Str; - Space = spacechar^1 / pandoc.Space; - SoftBreak = endline / pandoc.SoftBreak; -} - -function Reader(input) - return lpeg.match(G, input) -end -``` - -Example of use: - -``` -% pandoc -f plain.lua -t native -*Hello there*, this is plain text with no formatting -except paragraph breaks. - -- Like this one. -^D -[ Para - [ Str "*Hello" - , Space - , Str "there*," - , Space - , Str "this" - , Space - , Str "is" - , Space - , Str "plain" - , Space - , Str "text" - , Space - , Str "with" - , Space - , Str "no" - , Space - , Str "formatting" - , SoftBreak - , Str "except" - , Space - , Str "paragraph" - , Space - , Str "breaks." - ] -, Para - [ Str "-" - , Space - , Str "Like" - , Space - , Str "this" - , Space - , Str "one." - ] -] -``` - -# Example: a RIS bibliography reader - -This is a parser for [RIS bibliography] files. It can be used -to convert them to CSL JSON or YAML, BibTeX, or BibLaTeX. - -[RIS bibliography]: https://en.wikipedia.org/wiki/RIS_(file_format) - -```lua --- A sample custom reader for RIS bibliography format --- https://en.wikipedia.org/wiki/RIS_(file_format) --- The references are converted to inline pandoc/CSL YAML --- references in the metadata. - -local inspect = require"inspect" - -local types = - { ABST = "article", - ADVS = "motion-picture", - AGGR = "dataset", - ANCIENT = "book", - ART = "graphic", - BILL = "bill", - BLOG = "post-weblog", - BOOK = "book", - CASE = "legal_case", - CHAP = "chapter", - CHART = "graphic", - CLSWK = "book", - COMP = "program", - CONF = "paper-conference", - CPAPER = "paper-conference", - CTLG = "catalog", - DATA = "dataset", - DBASE = "dataset", - DICT = "book", - EBOOK = "book", - ECHAP = "chapter", - EDBOOK = "book", - EJOUR = "article", - WEB = "webpage", - ENCYC = "entry-encyclopedia", - EQUA = "figure", - FIGURE = "figure", - GEN = "entry", - GOVDOC = "report", - GRANT = "report", - HEAR = "report", - ICOMM = "personal_communication", - INPR = "article-journal", - JFULL = "article-journal", - JOUR = "article-journal", - LEGAL = "legal_case", - MANSCPT = "manuscript", - MAP = "map", - MGZN = "article-magazine", - MPCT = "motion-picture", - MULTI = "webpage", - MUSIC = "musical_score", - NEWS = "article-newspaper", - PAMP = "pamphlet", - PAT = "patent", - PCOMM = "personal_communication", - RPRT = "report", - SER = "article", - SLIDE = "graphic", - SOUND = "musical_score", - STAND = "report", - STAT = "legislation", - THES = "thesis", - UNBILL = "bill", - UNPB = "unpublished", - VIDEO = "graphic" - } - -local function inlines(s) - local ils = {} - for t in string.gmatch(s, "%S+") do - if #ils == 0 then - ils = {pandoc.Str(t)} - else - table.insert(ils, pandoc.Space()) - table.insert(ils, pandoc.Str(t)) - end - end - return pandoc.MetaInlines(ils) -end - -local function clean(refpairs) - local ref = {} - for i = 1, #refpairs do - local k,v = table.unpack(refpairs[i]) - if k == "TY" then - ref["type"] = types[v] - elseif k == "VL" then - ref.volume = v - elseif k == "KW" then - ref.keyword = v - elseif k == "PB" then - ref.publisher = v - elseif k == "CY" or k == "PP" then - ref["publisher-place"] = v - elseif k == "SP" then - if ref.page then - ref.page = v .. ref.page - else - ref.page = v - end - elseif k == "EP" then - if ref.page then - ref.page = ref.page .. "-" .. v - else - ref.page = "-" .. v - end - elseif k == "AU" or k == "A1" or k == "A2" or k == "A3" then - if ref.author then - table.insert(ref.author, inlines(v)) - else - ref.author = {inlines(v)} - end - elseif k == "TI" or k == "T1" or k == "CT" or - (k == "BT" and ref.type == "book") then - ref.title = inlines(v) - elseif k == "ET" then - ref.edition = inlines(v) - elseif k == "NV" then - ref["number-of-volumes"] = inlines(v) - elseif k == "AB" then - ref.abstract = inlines(v) - elseif k == "ED" then - if ref.editor then - table.insert(ref.editor, inlines(v)) - else - ref.editor = {inlines(v)} - end - elseif k == "JO" or k == "JF" or k == "T2" or - (k == "BT" and ref.type ~= "book") then - ref["container-title"] = inlines(v) - elseif k == "PY" or k == "Y1" then - ref.issued = v - elseif k == "IS" then - ref.issue = v - elseif k == "SN" then - ref.ISSN = v - elseif k == "L" then - ref.lang = v - elseif k == "UR" or k == "LK" then - ref.URL = v - end - end - return ref -end - -function Reader(input, reader_options) - local refs = {} - local thisref = {} - local ids = {} - for line in string.gmatch(input, "[^\n]*") do - key, val = string.match(line, "([A-Z][A-Z0-9]) %- (.*)") - if key == "ER" then - -- clean up fields - local newref = clean(thisref) - -- ensure we have an id and if not, create a sensible one - if not newref.id then - newref.id = "" - for _,x in ipairs(newref.author) do - newref.id = newref.id .. string.match(pandoc.utils.stringify(x), "%a+") - end - if newref.issued then - newref.id = newref.id .. string.match(newref.issued, "%d+") - end - if ids[newref.id] then -- add disambiguator if needed - newref.id = newref.id .. "-" .. #ids - end - end - table.insert(ids, newref.id) - table.insert(refs, newref) - thisref = {} - elseif key then - table.insert(thisref, {key, val}) - end - end - return pandoc.Pandoc({}, pandoc.Meta { references = refs } ) -end -``` - -Example of use: - -``` -% pandoc -f ris.lua -t bibtex -TY - JOUR -AU - Shannon, Claude E. -PY - 1948 -DA - July -TI - A Mathematical Theory of Communication -T2 - Bell System Technical Journal -SP - 379 -EP - 423 -VL - 27 -ER - -TY - JOUR -T1 - On computable numbers, with an application to the Entscheidungsproblem -A1 - Turing, Alan Mathison -JO - Proc. of London Mathematical Society -VL - 47 -IS - 1 -SP - 230 -EP - 265 -Y1 - 1937 -ER - -^D -@article{Shannon1948, - author = {Shannon, Claude E.}, - title = {A {Mathematical} {Theory} of {Communication}}, - journal = {Bell System Technical Journal}, - volume = {27}, - pages = {379-423}, - year = {1948} -} -@article{Turing1937, - author = {Turing, Alan Mathison}, - title = {On Computable Numbers, with an Application to the - {Entscheidungsproblem}}, - journal = {Proc. of London Mathematical Society}, - volume = {47}, - number = {1}, - pages = {230-265}, - year = {1937} -} -``` - -# Example: a wiki Creole reader - -This is a parser for [Creole common wiki markup]. -It uses an [lpeg] grammar. Fun fact: this custom reader is faster than -pandoc's built-in creole reader! This shows that high-performance -readers can be designed in this way. - -[Creole common wiki markup]: http://www.wikicreole.org/wiki/CheatSheet - - -```lua --- A sample custom reader for Creole 1.0 (common wiki markup) --- http://www.wikicreole.org/wiki/CheatSheet - --- For better performance we put these functions in local variables: -local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt = - lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V, - lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt - -local whitespacechar = S(" \t\r\n") -local specialchar = S("/*~[]\\{}|") -local wordchar = (1 - (whitespacechar + specialchar)) -local spacechar = S(" \t") -local newline = P"\r"^-1 * P"\n" -local blankline = spacechar^0 * newline -local endline = newline * #-blankline -local endequals = spacechar^0 * P"="^0 * spacechar^0 * newline -local cellsep = spacechar^0 * P"|" - -local function trim(s) - return (s:gsub("^%s*(.-)%s*$", "%1")) -end - -local function ListItem(lev, ch) - local start - if ch == nil then - start = S"*#" - else - start = P(ch) - end - local subitem = function(c) - if lev < 6 then - return ListItem(lev + 1, c) - else - return (1 - 1) -- fails - end - end - local parser = spacechar^0 - * start^lev - * #(- start) - * spacechar^0 - * Ct((V"Inline" - (newline * spacechar^0 * S"*#"))^0) - * newline - * (Ct(subitem("*")^1) / pandoc.BulletList - + - Ct(subitem("#")^1) / pandoc.OrderedList - + - Cc(nil)) - / function (ils, sublist) - return { pandoc.Plain(ils), sublist } - end - return parser -end - --- Grammar -G = P{ "Doc", - Doc = Ct(V"Block"^0) - / pandoc.Pandoc ; - Block = blankline^0 - * ( V"Header" - + V"HorizontalRule" - + V"CodeBlock" - + V"List" - + V"Table" - + V"Para") ; - Para = Ct(V"Inline"^1) - * newline - / pandoc.Para ; - HorizontalRule = spacechar^0 - * P"----" - * spacechar^0 - * newline - / pandoc.HorizontalRule; - Header = (P("=")^1 / string.len) - * spacechar^1 - * Ct((V"Inline" - endequals)^1) - * endequals - / pandoc.Header; - CodeBlock = P"{{{" - * blankline - * C((1 - (newline * P"}}}"))^0) - * newline - * P"}}}" - / pandoc.CodeBlock; - Placeholder = P"<<<" - * C(P(1) - P">>>")^0 - * P">>>" - / function() return pandoc.Div({}) end; - List = V"BulletList" - + V"OrderedList" ; - BulletList = Ct(ListItem(1,'*')^1) - / pandoc.BulletList ; - OrderedList = Ct(ListItem(1,'#')^1) - / pandoc.OrderedList ; - Table = (V"TableHeader" + Cc{}) - * Ct(V"TableRow"^1) - / function(headrow, bodyrows) - local numcolumns = #(bodyrows[1]) - local aligns = {} - local widths = {} - for i = 1,numcolumns do - aligns[i] = pandoc.AlignDefault - widths[i] = 0 - end - return pandoc.utils.from_simple_table( - pandoc.SimpleTable({}, aligns, widths, headrow, bodyrows)) - end ; - TableHeader = Ct(V"HeaderCell"^1) - * cellsep^-1 - * spacechar^0 - * newline ; - TableRow = Ct(V"BodyCell"^1) - * cellsep^-1 - * spacechar^0 - * newline ; - HeaderCell = cellsep - * P"=" - * spacechar^0 - * Ct((V"Inline" - (newline + cellsep))^0) - / function(ils) return { pandoc.Plain(ils) } end ; - BodyCell = cellsep - * spacechar^0 - * Ct((V"Inline" - (newline + cellsep))^0) - / function(ils) return { pandoc.Plain(ils) } end ; - Inline = V"Emph" - + V"Strong" - + V"LineBreak" - + V"Link" - + V"URL" - + V"Image" - + V"Str" - + V"Space" - + V"SoftBreak" - + V"Escaped" - + V"Placeholder" - + V"Code" - + V"Special" ; - Str = wordchar^1 - / pandoc.Str; - Escaped = P"~" - * C(P(1)) - / pandoc.Str ; - Special = specialchar - / pandoc.Str; - Space = spacechar^1 - / pandoc.Space ; - SoftBreak = endline - * # -(V"HorizontalRule" + V"CodeBlock") - / pandoc.SoftBreak ; - LineBreak = P"\\\\" - / pandoc.LineBreak ; - Code = P"{{{" - * C((1 - P"}}}")^0) - * P"}}}" - / trim / pandoc.Code ; - Link = P"[[" - * C((1 - (P"]]" + P"|"))^0) - * (P"|" * Ct((V"Inline" - P"]]")^1))^-1 * P"]]" - / function(url, desc) - local txt = desc or {pandoc.Str(url)} - return pandoc.Link(txt, url) - end ; - Image = P"{{" - * #-P"{" - * C((1 - (S"}"))^0) - * (P"|" * Ct((V"Inline" - P"}}")^1))^-1 - * P"}}" - / function(url, desc) - local txt = desc or "" - return pandoc.Image(txt, url) - end ; - URL = P"http" - * P"s"^-1 - * P":" - * (1 - (whitespacechar + (S",.?!:;\"'" * #whitespacechar)))^1 - / function(url) - return pandoc.Link(pandoc.Str(url), url) - end ; - Emph = P"//" - * Ct((V"Inline" - P"//")^1) - * P"//" - / pandoc.Emph ; - Strong = P"**" - * Ct((V"Inline" -P"**")^1) - * P"**" - / pandoc.Strong ; -} - -function Reader(input, reader_options) - return lpeg.match(G, input) -end -``` - -Example of use: - -``` -% pandoc -f creole.lua -t markdown -== Wiki Creole - -You can make things **bold** or //italic// or **//both//** or //**both**//. - -Character formatting extends across line breaks: **bold, -this is still bold. This line deliberately does not end in star-star. - -Not bold. Character formatting does not cross paragraph boundaries. - -You can use [[internal links]] or [[http://www.wikicreole.org|external links]], -give the link a [[internal links|different]] name. -^D -## Wiki Creole - -You can make things **bold** or *italic* or ***both*** or ***both***. - -Character formatting extends across line breaks: \*\*bold, this is still -bold. This line deliberately does not end in star-star. - -Not bold. Character formatting does not cross paragraph boundaries. - -You can use [internal links](internal links) or [external -links](http://www.wikicreole.org), give the link a -[different](internal links) name. -``` - diff --git a/doc/custom-readers.md b/doc/custom-readers.md new file mode 100644 index 000000000..bef3ae050 --- /dev/null +++ b/doc/custom-readers.md @@ -0,0 +1,599 @@ +--- +author: +- John MacFarlane +date: 'November 18, 2021' +title: Creating Custom Pandoc Readers in Lua +--- + +# Introduction + +If you need to parse a format not already handled by pandoc, +you can create a custom reader using the [Lua] language. +Pandoc has a built-in Lua interpreter, so you needn't +install any additional software to do this. + +[Lua]: https://www.lua.org + +A custom writer is a Lua file that defines a function +called `Reader`, which takes two arguments: + +- a string, the raw input to be parsed +- optionally, a table of reader options, e.g. + `{ columns = 62, standalone = true }`. + +The `Reader` function should return a `Pandoc` AST. +This can be created using functions in the [`pandoc` module], +which is automatically in scope. (Indeed, all of the utility +functions that are available for [Lua filters] are available +in custom readers, too.) + +[Lua filters]: https://pandoc.org/lua-filters.html +[`pandoc` module]: https://pandoc.org/lua-filters.html#module-pandoc + +A minimal example would be + +```lua +function Reader(input) + return pandoc.Pandoc({ pandoc.CodeBlock(input) }) +end +``` + +This just returns a document containing a big code block with +all of the input. + +In a nontrivial reader, you'll want to parse the input. +You can do this using standard Lua library functions +(for example, the [patterns] library), or with the powerful +and fast [lpeg] parsing library, which is automatically in scope. +You can also use external Lua libraries (for example, +an XML parser). + +[patterns]: http://lua-users.org/wiki/PatternsTutorial +[lpeg]: http://www.inf.puc-rio.br/~roberto/lpeg/ + +# Example: plain text reader + +This is a simple example using [lpeg] to parse the input +into space-separated strings and blankline-separated paragraphs. + +```lua +-- A sample custom reader that just parses text into blankline-separated +-- paragraphs with space-separated words. + +-- For better performance we put these functions in local variables: +local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt = + lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V, + lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt + +local whitespacechar = S(" \t\r\n") +local wordchar = (1 - whitespacechar) +local spacechar = S(" \t") +local newline = P"\r"^-1 * P"\n" +local blanklines = newline * (spacechar^0 * newline)^1 +local endline = newline - blanklines + +-- Grammar +G = P{ "Pandoc", + Pandoc = Ct(V"Block"^0) / pandoc.Pandoc; + Block = blanklines^0 * V"Para" ; + Para = Ct(V"Inline"^1) / pandoc.Para; + Inline = V"Str" + V"Space" + V"SoftBreak" ; + Str = wordchar^1 / pandoc.Str; + Space = spacechar^1 / pandoc.Space; + SoftBreak = endline / pandoc.SoftBreak; +} + +function Reader(input) + return lpeg.match(G, input) +end +``` + +Example of use: + +``` +% pandoc -f plain.lua -t native +*Hello there*, this is plain text with no formatting +except paragraph breaks. + +- Like this one. +^D +[ Para + [ Str "*Hello" + , Space + , Str "there*," + , Space + , Str "this" + , Space + , Str "is" + , Space + , Str "plain" + , Space + , Str "text" + , Space + , Str "with" + , Space + , Str "no" + , Space + , Str "formatting" + , SoftBreak + , Str "except" + , Space + , Str "paragraph" + , Space + , Str "breaks." + ] +, Para + [ Str "-" + , Space + , Str "Like" + , Space + , Str "this" + , Space + , Str "one." + ] +] +``` + +# Example: a RIS bibliography reader + +This is a parser for [RIS bibliography] files. It can be used +to convert them to CSL JSON or YAML, BibTeX, or BibLaTeX. + +[RIS bibliography]: https://en.wikipedia.org/wiki/RIS_(file_format) + +```lua +-- A sample custom reader for RIS bibliography format +-- https://en.wikipedia.org/wiki/RIS_(file_format) +-- The references are converted to inline pandoc/CSL YAML +-- references in the metadata. + +local inspect = require"inspect" + +local types = + { ABST = "article", + ADVS = "motion-picture", + AGGR = "dataset", + ANCIENT = "book", + ART = "graphic", + BILL = "bill", + BLOG = "post-weblog", + BOOK = "book", + CASE = "legal_case", + CHAP = "chapter", + CHART = "graphic", + CLSWK = "book", + COMP = "program", + CONF = "paper-conference", + CPAPER = "paper-conference", + CTLG = "catalog", + DATA = "dataset", + DBASE = "dataset", + DICT = "book", + EBOOK = "book", + ECHAP = "chapter", + EDBOOK = "book", + EJOUR = "article", + WEB = "webpage", + ENCYC = "entry-encyclopedia", + EQUA = "figure", + FIGURE = "figure", + GEN = "entry", + GOVDOC = "report", + GRANT = "report", + HEAR = "report", + ICOMM = "personal_communication", + INPR = "article-journal", + JFULL = "article-journal", + JOUR = "article-journal", + LEGAL = "legal_case", + MANSCPT = "manuscript", + MAP = "map", + MGZN = "article-magazine", + MPCT = "motion-picture", + MULTI = "webpage", + MUSIC = "musical_score", + NEWS = "article-newspaper", + PAMP = "pamphlet", + PAT = "patent", + PCOMM = "personal_communication", + RPRT = "report", + SER = "article", + SLIDE = "graphic", + SOUND = "musical_score", + STAND = "report", + STAT = "legislation", + THES = "thesis", + UNBILL = "bill", + UNPB = "unpublished", + VIDEO = "graphic" + } + +local function inlines(s) + local ils = {} + for t in string.gmatch(s, "%S+") do + if #ils == 0 then + ils = {pandoc.Str(t)} + else + table.insert(ils, pandoc.Space()) + table.insert(ils, pandoc.Str(t)) + end + end + return pandoc.MetaInlines(ils) +end + +local function clean(refpairs) + local ref = {} + for i = 1, #refpairs do + local k,v = table.unpack(refpairs[i]) + if k == "TY" then + ref["type"] = types[v] + elseif k == "VL" then + ref.volume = v + elseif k == "KW" then + ref.keyword = v + elseif k == "PB" then + ref.publisher = v + elseif k == "CY" or k == "PP" then + ref["publisher-place"] = v + elseif k == "SP" then + if ref.page then + ref.page = v .. ref.page + else + ref.page = v + end + elseif k == "EP" then + if ref.page then + ref.page = ref.page .. "-" .. v + else + ref.page = "-" .. v + end + elseif k == "AU" or k == "A1" or k == "A2" or k == "A3" then + if ref.author then + table.insert(ref.author, inlines(v)) + else + ref.author = {inlines(v)} + end + elseif k == "TI" or k == "T1" or k == "CT" or + (k == "BT" and ref.type == "book") then + ref.title = inlines(v) + elseif k == "ET" then + ref.edition = inlines(v) + elseif k == "NV" then + ref["number-of-volumes"] = inlines(v) + elseif k == "AB" then + ref.abstract = inlines(v) + elseif k == "ED" then + if ref.editor then + table.insert(ref.editor, inlines(v)) + else + ref.editor = {inlines(v)} + end + elseif k == "JO" or k == "JF" or k == "T2" or + (k == "BT" and ref.type ~= "book") then + ref["container-title"] = inlines(v) + elseif k == "PY" or k == "Y1" then + ref.issued = v + elseif k == "IS" then + ref.issue = v + elseif k == "SN" then + ref.ISSN = v + elseif k == "L" then + ref.lang = v + elseif k == "UR" or k == "LK" then + ref.URL = v + end + end + return ref +end + +function Reader(input, reader_options) + local refs = {} + local thisref = {} + local ids = {} + for line in string.gmatch(input, "[^\n]*") do + key, val = string.match(line, "([A-Z][A-Z0-9]) %- (.*)") + if key == "ER" then + -- clean up fields + local newref = clean(thisref) + -- ensure we have an id and if not, create a sensible one + if not newref.id then + newref.id = "" + for _,x in ipairs(newref.author) do + newref.id = newref.id .. string.match(pandoc.utils.stringify(x), "%a+") + end + if newref.issued then + newref.id = newref.id .. string.match(newref.issued, "%d+") + end + if ids[newref.id] then -- add disambiguator if needed + newref.id = newref.id .. "-" .. #ids + end + end + table.insert(ids, newref.id) + table.insert(refs, newref) + thisref = {} + elseif key then + table.insert(thisref, {key, val}) + end + end + return pandoc.Pandoc({}, pandoc.Meta { references = refs } ) +end +``` + +Example of use: + +``` +% pandoc -f ris.lua -t bibtex +TY - JOUR +AU - Shannon, Claude E. +PY - 1948 +DA - July +TI - A Mathematical Theory of Communication +T2 - Bell System Technical Journal +SP - 379 +EP - 423 +VL - 27 +ER - +TY - JOUR +T1 - On computable numbers, with an application to the Entscheidungsproblem +A1 - Turing, Alan Mathison +JO - Proc. of London Mathematical Society +VL - 47 +IS - 1 +SP - 230 +EP - 265 +Y1 - 1937 +ER - +^D +@article{Shannon1948, + author = {Shannon, Claude E.}, + title = {A {Mathematical} {Theory} of {Communication}}, + journal = {Bell System Technical Journal}, + volume = {27}, + pages = {379-423}, + year = {1948} +} +@article{Turing1937, + author = {Turing, Alan Mathison}, + title = {On Computable Numbers, with an Application to the + {Entscheidungsproblem}}, + journal = {Proc. of London Mathematical Society}, + volume = {47}, + number = {1}, + pages = {230-265}, + year = {1937} +} +``` + +# Example: a wiki Creole reader + +This is a parser for [Creole common wiki markup]. +It uses an [lpeg] grammar. Fun fact: this custom reader is faster than +pandoc's built-in creole reader! This shows that high-performance +readers can be designed in this way. + +[Creole common wiki markup]: http://www.wikicreole.org/wiki/CheatSheet + + +```lua +-- A sample custom reader for Creole 1.0 (common wiki markup) +-- http://www.wikicreole.org/wiki/CheatSheet + +-- For better performance we put these functions in local variables: +local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt = + lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V, + lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt + +local whitespacechar = S(" \t\r\n") +local specialchar = S("/*~[]\\{}|") +local wordchar = (1 - (whitespacechar + specialchar)) +local spacechar = S(" \t") +local newline = P"\r"^-1 * P"\n" +local blankline = spacechar^0 * newline +local endline = newline * #-blankline +local endequals = spacechar^0 * P"="^0 * spacechar^0 * newline +local cellsep = spacechar^0 * P"|" + +local function trim(s) + return (s:gsub("^%s*(.-)%s*$", "%1")) +end + +local function ListItem(lev, ch) + local start + if ch == nil then + start = S"*#" + else + start = P(ch) + end + local subitem = function(c) + if lev < 6 then + return ListItem(lev + 1, c) + else + return (1 - 1) -- fails + end + end + local parser = spacechar^0 + * start^lev + * #(- start) + * spacechar^0 + * Ct((V"Inline" - (newline * spacechar^0 * S"*#"))^0) + * newline + * (Ct(subitem("*")^1) / pandoc.BulletList + + + Ct(subitem("#")^1) / pandoc.OrderedList + + + Cc(nil)) + / function (ils, sublist) + return { pandoc.Plain(ils), sublist } + end + return parser +end + +-- Grammar +G = P{ "Doc", + Doc = Ct(V"Block"^0) + / pandoc.Pandoc ; + Block = blankline^0 + * ( V"Header" + + V"HorizontalRule" + + V"CodeBlock" + + V"List" + + V"Table" + + V"Para") ; + Para = Ct(V"Inline"^1) + * newline + / pandoc.Para ; + HorizontalRule = spacechar^0 + * P"----" + * spacechar^0 + * newline + / pandoc.HorizontalRule; + Header = (P("=")^1 / string.len) + * spacechar^1 + * Ct((V"Inline" - endequals)^1) + * endequals + / pandoc.Header; + CodeBlock = P"{{{" + * blankline + * C((1 - (newline * P"}}}"))^0) + * newline + * P"}}}" + / pandoc.CodeBlock; + Placeholder = P"<<<" + * C(P(1) - P">>>")^0 + * P">>>" + / function() return pandoc.Div({}) end; + List = V"BulletList" + + V"OrderedList" ; + BulletList = Ct(ListItem(1,'*')^1) + / pandoc.BulletList ; + OrderedList = Ct(ListItem(1,'#')^1) + / pandoc.OrderedList ; + Table = (V"TableHeader" + Cc{}) + * Ct(V"TableRow"^1) + / function(headrow, bodyrows) + local numcolumns = #(bodyrows[1]) + local aligns = {} + local widths = {} + for i = 1,numcolumns do + aligns[i] = pandoc.AlignDefault + widths[i] = 0 + end + return pandoc.utils.from_simple_table( + pandoc.SimpleTable({}, aligns, widths, headrow, bodyrows)) + end ; + TableHeader = Ct(V"HeaderCell"^1) + * cellsep^-1 + * spacechar^0 + * newline ; + TableRow = Ct(V"BodyCell"^1) + * cellsep^-1 + * spacechar^0 + * newline ; + HeaderCell = cellsep + * P"=" + * spacechar^0 + * Ct((V"Inline" - (newline + cellsep))^0) + / function(ils) return { pandoc.Plain(ils) } end ; + BodyCell = cellsep + * spacechar^0 + * Ct((V"Inline" - (newline + cellsep))^0) + / function(ils) return { pandoc.Plain(ils) } end ; + Inline = V"Emph" + + V"Strong" + + V"LineBreak" + + V"Link" + + V"URL" + + V"Image" + + V"Str" + + V"Space" + + V"SoftBreak" + + V"Escaped" + + V"Placeholder" + + V"Code" + + V"Special" ; + Str = wordchar^1 + / pandoc.Str; + Escaped = P"~" + * C(P(1)) + / pandoc.Str ; + Special = specialchar + / pandoc.Str; + Space = spacechar^1 + / pandoc.Space ; + SoftBreak = endline + * # -(V"HorizontalRule" + V"CodeBlock") + / pandoc.SoftBreak ; + LineBreak = P"\\\\" + / pandoc.LineBreak ; + Code = P"{{{" + * C((1 - P"}}}")^0) + * P"}}}" + / trim / pandoc.Code ; + Link = P"[[" + * C((1 - (P"]]" + P"|"))^0) + * (P"|" * Ct((V"Inline" - P"]]")^1))^-1 * P"]]" + / function(url, desc) + local txt = desc or {pandoc.Str(url)} + return pandoc.Link(txt, url) + end ; + Image = P"{{" + * #-P"{" + * C((1 - (S"}"))^0) + * (P"|" * Ct((V"Inline" - P"}}")^1))^-1 + * P"}}" + / function(url, desc) + local txt = desc or "" + return pandoc.Image(txt, url) + end ; + URL = P"http" + * P"s"^-1 + * P":" + * (1 - (whitespacechar + (S",.?!:;\"'" * #whitespacechar)))^1 + / function(url) + return pandoc.Link(pandoc.Str(url), url) + end ; + Emph = P"//" + * Ct((V"Inline" - P"//")^1) + * P"//" + / pandoc.Emph ; + Strong = P"**" + * Ct((V"Inline" -P"**")^1) + * P"**" + / pandoc.Strong ; +} + +function Reader(input, reader_options) + return lpeg.match(G, input) +end +``` + +Example of use: + +``` +% pandoc -f creole.lua -t markdown +== Wiki Creole + +You can make things **bold** or //italic// or **//both//** or //**both**//. + +Character formatting extends across line breaks: **bold, +this is still bold. This line deliberately does not end in star-star. + +Not bold. Character formatting does not cross paragraph boundaries. + +You can use [[internal links]] or [[http://www.wikicreole.org|external links]], +give the link a [[internal links|different]] name. +^D +## Wiki Creole + +You can make things **bold** or *italic* or ***both*** or ***both***. + +Character formatting extends across line breaks: \*\*bold, this is still +bold. This line deliberately does not end in star-star. + +Not bold. Character formatting does not cross paragraph boundaries. + +You can use [internal links](internal links) or [external +links](http://www.wikicreole.org), give the link a +[different](internal links) name. +``` + -- cgit v1.2.3 From a9e5145c3a3bc9c7f9f021389e4d0ae8053c8188 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 21 Nov 2021 10:35:55 +0100 Subject: Minor changelog edits. --- changelog.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index 204996bc9..967206850 100644 --- a/changelog.md +++ b/changelog.md @@ -38,8 +38,7 @@ + Add 'uri' class when parsing `\url`, for consistency with treatment of autolinks in other formats (#7672). - * JATS reader: Capture `alt-text` in figures (#7703, Albert Krewinkel - and Aner Lucero). + * JATS reader: Capture `alt-text` in figures (#7703, Aner Lucero). * MediaWiki writer: use HTML spans for anchors when header has id (#7697). We need to generate a span when the header's ID doesn't match @@ -94,7 +93,7 @@ `lpeg` and `re` are always made available in global variables, without the need for a `require`. - + Set `lpeg` and `re` as globals; allow shared lib access via require + + Set `lpeg` and `re` as globals; allow shared lib access via `require`. The `lpeg` and `re` modules are loaded into globals of the respective name, but they are not necessarily registered as loaded packages. This ensures that @@ -152,10 +151,7 @@ * Add `data/creole.lua` as sample custom reader. - * Add doc/custom-readers.md. - - * doc/lua-filters.md: add section on global modules, including lpeg - (Albert Krewinkel). + * Add `doc/custom-readers.md`. * MANUAL.txt: update table of exit codes and corresponding errors (Albert Krewinkel). -- cgit v1.2.3 From 1d56e6059e65f3c207296e3feb5aa9ae8bcd4e9d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 21 Nov 2021 10:07:05 -0800 Subject: Add custom-writers.md. --- changelog.md | 11 +++++++---- doc/custom-writers.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 doc/custom-writers.md diff --git a/changelog.md b/changelog.md index 967206850..bf054806c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,4 @@ -# Revision history for pandoc +## Revision history for pandoc ## pandoc 2.16.2 (2021-11-21) @@ -147,13 +147,16 @@ * Require Cabal 2.4. Use wildcards to ensure that all pptx tests are included (#7677). - * Update bash_completion.tpl (S.P.H.). + * Update `bash_completion.tpl` (S.P.H.). * Add `data/creole.lua` as sample custom reader. - * Add `doc/custom-readers.md`. + * Add `doc/custom-readers.md` and `doc/custom-writers.md`. - * MANUAL.txt: update table of exit codes and corresponding errors + * `doc/lua-filters.md`: add section on global modules, including lpeg + (Albert Krewinkel). + + * `MANUAL.txt`: update table of exit codes and corresponding errors (Albert Krewinkel). * Use latest texmath. diff --git a/doc/custom-writers.md b/doc/custom-writers.md new file mode 100644 index 000000000..b2258a95f --- /dev/null +++ b/doc/custom-writers.md @@ -0,0 +1,48 @@ +--- +author: +- John MacFarlane +date: 'November 21, 2021' +title: Creating Custom Pandoc Writers in Lua +--- + +# Introduction + +If you need to render a format not already handled by pandoc, +or you want to change how pandoc renders a format, +you can create a custom writer using the [Lua] language. +Pandoc has a built-in Lua interpreter, so you needn't +install any additional software to do this. + +[Lua]: https://www.lua.org + +A custom writer is a Lua file that defines functions for +rendering each element of a pandoc AST. + +For example, + +``` lua +function Para(s) + return "" .. s .. "" +end +``` + +The best way to go about creating a custom writer is to modify +the example that comes with pandoc. To get the example, you +can do + +``` +pandoc --print-default-data-file sample.lua > sample.lua +``` + +`sample.lua` is a full-features HTML writer, with explanatory +comments. To use it, just use the path to the custom writer as +the writer name: + +``` +pandoc -t sample.lua myfile.md +``` + +`sample.lua` defines all the functions needed by any custom +writer, so you can design your own custom writer by modifying +the functions in `sample.lua` according to your needs. + -- cgit v1.2.3 From eeafc3a2eaab3a0cdc2563ab573f00e66fdc0cef Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 21 Nov 2021 10:14:38 -0800 Subject: Update AUTHORS.md --- AUTHORS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 95f97e6f6..65410358e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -89,6 +89,7 @@ - Ethan Riley - Étienne Bersac - Ezwal +- Fabián Heredia Montiel - Félix Baylac-Jacqué - Felix Yan - Florian Beeres @@ -242,9 +243,11 @@ - Raniere Silva - Raymond Ehlers - Recai Oktaş +- Rowan Rodrik van der Molen - Roland Hieber - Roman Beránek - RyanGlScott +- S.P.H - Salim B - Samuel Tardieu - Sascha Wilde @@ -341,4 +344,5 @@ - timo-a - vijayphoenix - wiefling +- willj-dev - wuffi -- cgit v1.2.3 From 3f595659a3ed28f8dfdb6a378cc9d4e97b9a3a54 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 21 Nov 2021 10:22:10 -0800 Subject: yamlBsToRefs: allow multiple YAML documents. Some people use `---` as the end delimiter in YAML bibliography files, which causes the `yaml` library to emit an error unless we explicitly allow multiple YAML documents (and just consider the first). In T.P.Readers.Metadata --- src/Text/Pandoc/Readers/Metadata.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/Metadata.hs b/src/Text/Pandoc/Readers/Metadata.hs index 30760e933..7991dca5c 100644 --- a/src/Text/Pandoc/Readers/Metadata.hs +++ b/src/Text/Pandoc/Readers/Metadata.hs @@ -56,8 +56,8 @@ yamlBsToRefs :: (PandocMonad m, HasLastStrPosition st) -> B.ByteString -> ParserT Sources st m (Future st [MetaValue]) yamlBsToRefs pMetaValue idpred bstr = - case Yaml.decodeEither' bstr of - Right (Object m) -> do + case Yaml.decodeAllEither' bstr of + Right (Object m : _) -> do let isSelected (String t) = idpred t isSelected _ = False let hasSelectedId (Object o) = -- cgit v1.2.3 From 03c1bffab6a87e24cc5074f3c521d3694207f6ea Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 21 Nov 2021 10:25:12 -0800 Subject: Update changelog. --- changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.md b/changelog.md index bf054806c..af16ecb6d 100644 --- a/changelog.md +++ b/changelog.md @@ -54,6 +54,12 @@ (#7692). Previously we sometimes lost attributes when rendering links as autolinks. + * Text.Pandoc.Readers.Metadata: allow multiple YAML documents when parsing + YAML for `yamlBsToRefs`. Some people use `---` as the end delimiter in + YAML bibliography files, which causes the `yaml` library to emit an + error unless we explicitly allow multiple YAML documents (and just + consider the first). + * JATS writer: + Ensure figures are wrapped with `

      ` in list items -- cgit v1.2.3 From 6d52130c8ca49e8f79b177bb3f839d03a148404d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 21 Nov 2021 17:14:20 -0800 Subject: Fix top-level header on changelog. --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index af16ecb6d..300dc0130 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,4 @@ -## Revision history for pandoc +# Revision history for pandoc ## pandoc 2.16.2 (2021-11-21) -- cgit v1.2.3 From a19134f74d41e67371fbbcfac8afc99e1f4d9378 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 21 Nov 2021 17:51:28 -0800 Subject: cabal.project: remove spurious source package stanza for texmath. Unfortunately this means that the release binaries for 2.16.2 weren't built with all of the texmath improvements. --- cabal.project | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cabal.project b/cabal.project index cb2d6ebdb..669dd74e2 100644 --- a/cabal.project +++ b/cabal.project @@ -3,7 +3,7 @@ tests: True flags: +embed_data_files constraints: aeson >= 2.0.1.0 -source-repository-package - type: git - location: https://github.com/jgm/texmath.git - tag: 674bcbaec03e5550f155623de6662953bd157625 +-- source-repository-package +-- type: git +-- location: https://github.com/jgm/texmath.git +-- tag: 674bcbaec03e5550f155623de6662953bd157625 -- cgit v1.2.3 From 17495bf8eb5f5483d01ebe6a61e1c24eb1f00924 Mon Sep 17 00:00:00 2001 From: Jörn Krenzer Date: Mon, 22 Nov 2021 17:42:09 +0100 Subject: Add .yml to Citeproc formatFromExtension (#7706) Make Citeproc recognize files with .yml extension (in addition to .yaml) as YAML bibliographies. Closes #7707. --- src/Text/Pandoc/Citeproc.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 9f110330e..223925522 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -357,6 +357,7 @@ formatFromExtension fp = case dropWhile (== '.') $ takeExtension fp of "bib" -> Just Format_biblatex "json" -> Just Format_json "yaml" -> Just Format_yaml + "yml" -> Just Format_yaml _ -> Nothing -- cgit v1.2.3 From a039f024f2c0e2d9e6d1ae7710cf96debcbc5e43 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 22 Nov 2021 14:58:18 -0800 Subject: Add an example to custom-readers.md. --- doc/custom-readers.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/doc/custom-readers.md b/doc/custom-readers.md index bef3ae050..fe032d4b3 100644 --- a/doc/custom-readers.md +++ b/doc/custom-readers.md @@ -597,3 +597,55 @@ links](http://www.wikicreole.org), give the link a [different](internal links) name. ``` +# Example: parsing JSON from an API + +This custom reader consumes the JSON output of + and produces +a document containing the current top articles on the +Haskell subreddit. + +It assumes that the `luajson` library is available. (It can be +installed using `luarocks install luajson`---but be sure you are +installing it for Lua 5.3, which is the version packaged with +pandoc.) + + +```lua +-- consumes the output of https://www.reddit.com/r/haskell.json + +local json = require'json' -- luajson must be available + +local function read_inlines(raw) + local doc = pandoc.read(raw, "commonmark") + return pandoc.utils.blocks_to_inlines(doc.blocks) +end + +local function read_blocks(raw) + local doc = pandoc.read(raw, "commonmark") + return doc.blocks +end + +function Reader(input) + + local parsed = json.decode(input) + local blocks = {} + + for _,entry in ipairs(parsed.data.children) do + local d = entry.data + table.insert(blocks, pandoc.Header(2, + pandoc.Link(read_inlines(d.title), d.url))) + for _,block in ipairs(read_blocks(d.selftext)) do + table.insert(blocks, block) + end + end + + return pandoc.Pandoc(blocks) + +end +``` + +Similar code can be used to consume JSON output from other APIs. + +Note that the content of the text fields is markdown, so we +convert it using `pandoc.read()`. + -- cgit v1.2.3 From 0c0945b93c2ae502c0629d93e9ad520dbe17c625 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 23 Nov 2021 18:30:48 +0100 Subject: Lua: split strings into words when treating them as Inline list (#7712) Using a Lua string where a list of inlines is expected will cause the string to be split into words, replacing spaces and tabs into `pandoc.Space()` elements and newlines into `pandoc.SoftBreak()`. The previous behavior was to treat the string `s` as `{pandoc.Str(s)}`. The old behavior can be recovered by wrapping the string into a table `{s}`. --- src/Text/Pandoc/Lua/Marshaling/AST.hs | 11 +++++++---- test/lua/module/pandoc.lua | 28 ++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 568b610cc..31d040c83 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -67,6 +67,7 @@ import Text.Pandoc.Lua.Marshaling.ListAttributes (peekListAttributes, pushListAttributes) import qualified HsLua as Lua +import qualified Text.Pandoc.Builder as B import qualified Text.Pandoc.Lua.Util as LuaUtil instance Pushable Pandoc where @@ -796,10 +797,12 @@ peekInlineFuzzy = retrieving "Inline" . choice -- | Try extra-hard to return the value at the given index as a list of -- inlines. peekInlinesFuzzy :: LuaError e => Peeker e [Inline] -peekInlinesFuzzy = choice - [ peekList peekInlineFuzzy - , fmap pure . peekInlineFuzzy - ] +peekInlinesFuzzy idx = liftLua (ltype idx) >>= \case + TypeString -> B.toList . B.text <$> peekText idx + _ -> choice + [ peekList peekInlineFuzzy + , fmap pure . peekInlineFuzzy + ] idx -- | Try extra hard to retrieve a Block value from the stack. Treats bar -- Inline elements as if they were wrapped in 'Plain'. diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 4f4a9b27e..b191bcb3c 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -480,7 +480,10 @@ return { assert.are_same(deflist.content[1][2][2], {pandoc.Plain{pandoc.Str 'company'}}) assert.are_same(deflist.content[2][2], - {{pandoc.Plain{pandoc.Str 'Best when hot.'}}}) + {{pandoc.Plain{ + pandoc.Str 'Best', pandoc.Space(), + pandoc.Str 'when', pandoc.Space(), + pandoc.Str 'hot.'}}}) end), test('modify items via property `content`', function () local deflist = pandoc.DefinitionList{ @@ -532,7 +535,7 @@ return { assert.are_same(header.content, {pandoc.Str 'test'}) header.content = {'new text'} - assert.are_equal(header, pandoc.Header(1, 'new text')) + assert.are_equal(header, pandoc.Header(1, {'new text'})) end), test('access Attr via property `attr`', function () local header = pandoc.Header(1, 'test', {'my-test'}) @@ -968,5 +971,26 @@ return { ) assert.are_equal('1234', table.concat(acc)) end) + }, + + group 'Marshal' { + group 'Inlines' { + test('Strings are broken into words', function () + assert.are_equal( + pandoc.Emph 'Nice, init?', + pandoc.Emph{pandoc.Str 'Nice,', pandoc.Space(), pandoc.Str 'init?'} + ) + end) + }, + group 'Blocks' { + test('Strings are broken into words and wrapped in Plain', function () + assert.are_equal( + pandoc.Div{ + pandoc.Plain{pandoc.Str 'Nice,', pandoc.Space(), pandoc.Str 'init?'} + }, + pandoc.Div{'Nice, init?'} + ) + end) + } } } -- cgit v1.2.3 From bffd74323cfd91f5c44ca34e09633247d1d28954 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 23 Nov 2021 18:32:53 +0100 Subject: Lua: add function `pandoc.utils.text` (#7710) The function converts a string to `Inlines`, treating interword spaces as `Space`s or `SoftBreak`s. If you want a `Str` with literal spaces, use `pandoc.Str`. Closes: #7709 --- doc/lua-filters.md | 18 ++++++++++++++++++ src/Text/Pandoc/Lua/Marshaling/AST.hs | 1 + src/Text/Pandoc/Lua/Module/Utils.hs | 12 ++++++++++-- test/lua/module/pandoc-utils.lua | 28 ++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 9fc90a13f..db5d1ccac 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3082,6 +3082,24 @@ Usage: -- outputs "Moin" print(pandoc.utils.stringify(inline)) +### text {#pandoc.utils.text} + +`text (words)` + +Converts a string to `Inlines`, treating interword spaces as +`Space`s or `SoftBreak`s. If you want a single `Str` with literal +spaces, use `pandoc.Str`. + +Parameters: + +`words` +: markup-less text (string) + +Returns: + +- List of inline elements split into words (Inlines) + + ### to\_roman\_numeral {#pandoc.utils.to_roman_numeral} `to_roman_numeral (integer)` diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 31d040c83..9cf683055 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -44,6 +44,7 @@ module Text.Pandoc.Lua.Marshaling.AST , pushBlock , pushCitation , pushInline + , pushInlines , pushListAttributes , pushMeta , pushMetaValue diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 01ba4eb46..6fd707bf8 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -29,8 +29,8 @@ import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshaling () import Text.Pandoc.Lua.Marshaling.AST - ( peekBlock, peekInline, peekPandoc, pushBlock, pushInline, pushPandoc - , peekAttr, peekMeta, peekMetaValue) + ( peekBlock, peekInline, peekPandoc, pushBlock, pushInline, pushInlines + , pushPandoc, peekAttr, peekMeta, peekMetaValue) import Text.Pandoc.Lua.Marshaling.ListAttributes (peekListAttributes) import Text.Pandoc.Lua.Marshaling.List (pushPandocList) import Text.Pandoc.Lua.Marshaling.SimpleTable @@ -122,6 +122,14 @@ documentedModule = Module <#> parameter peekAstElement "AST element" "elem" "some pandoc AST element" =#> functionResult pushText "string" "stringified element" + , defun "text" + ### liftPure (B.toList . B.text) + <#> parameter peekText "string" "words" "markup-less inlines text" + =#> functionResult pushInlines "Inlines" "list of inline elements" + #? ("Converts a string to `Inlines`, treating interword spaces as " <> + "`Space`s or `SoftBreak`s. If you want a `Str` with literal " <> + "spaces, use `pandoc.Str`.") + , defun "from_simple_table" ### from_simple_table <#> parameter peekSimpleTable "SimpleTable" "simple_tbl" "" diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua index 9bd903f2d..21f550177 100644 --- a/test/lua/module/pandoc-utils.lua +++ b/test/lua/module/pandoc-utils.lua @@ -82,6 +82,34 @@ return { end) }, + group 'text' { + test('string is converted to inlines', function () + local expected = { + pandoc.Str 'Madness', pandoc.Space(), pandoc.Str '-', pandoc.Space(), + pandoc.Str 'Our', pandoc.Space(), pandoc.Str 'House' + } + assert.are_same(pandoc.utils.text('Madness - Our House'), expected) + end), + test('tabs are treated as space', function () + local expected = { + pandoc.Str 'Linkin', pandoc.Space(), pandoc.Str 'Park', pandoc.Space(), + pandoc.Str '-', pandoc.Space(), pandoc.Str 'Papercut' + } + assert.are_same(pandoc.utils.text('Linkin Park\t-\tPapercut'), expected) + end), + test('newlines are treated as softbreaks', function () + local expected = { + pandoc.Str 'Porcupine', pandoc.Space(), pandoc.Str 'Tree', + pandoc.SoftBreak(), pandoc.Str '-', pandoc.SoftBreak(), + pandoc.Str 'Blackest', pandoc.Space(), pandoc.Str 'Eyes' + } + assert.are_same( + pandoc.utils.text('Porcupine Tree\n-\nBlackest Eyes'), + expected + ) + end), + }, + group 'to_roman_numeral' { test('convertes number', function () assert.are_equal('MDCCCLXXXVIII', utils.to_roman_numeral(1888)) -- cgit v1.2.3 From b72ba3ed6dbf6de7ee23c8f5148648b599b49964 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 23 Nov 2021 09:57:09 -0800 Subject: Simplify sample ris reader in doc/custom-readers.md. Made possible by #7712. --- doc/custom-readers.md | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/doc/custom-readers.md b/doc/custom-readers.md index fe032d4b3..c85b43ae4 100644 --- a/doc/custom-readers.md +++ b/doc/custom-readers.md @@ -208,19 +208,6 @@ local types = VIDEO = "graphic" } -local function inlines(s) - local ils = {} - for t in string.gmatch(s, "%S+") do - if #ils == 0 then - ils = {pandoc.Str(t)} - else - table.insert(ils, pandoc.Space()) - table.insert(ils, pandoc.Str(t)) - end - end - return pandoc.MetaInlines(ils) -end - local function clean(refpairs) local ref = {} for i = 1, #refpairs do @@ -249,28 +236,28 @@ local function clean(refpairs) end elseif k == "AU" or k == "A1" or k == "A2" or k == "A3" then if ref.author then - table.insert(ref.author, inlines(v)) + table.insert(ref.author, v) else - ref.author = {inlines(v)} + ref.author = {v} end elseif k == "TI" or k == "T1" or k == "CT" or (k == "BT" and ref.type == "book") then - ref.title = inlines(v) + ref.title = v elseif k == "ET" then - ref.edition = inlines(v) + ref.edition = v elseif k == "NV" then - ref["number-of-volumes"] = inlines(v) + ref["number-of-volumes"] = v elseif k == "AB" then - ref.abstract = inlines(v) + ref.abstract = v elseif k == "ED" then if ref.editor then - table.insert(ref.editor, inlines(v)) + table.insert(ref.editor, v) else - ref.editor = {inlines(v)} + ref.editor = {v} end elseif k == "JO" or k == "JF" or k == "T2" or (k == "BT" and ref.type ~= "book") then - ref["container-title"] = inlines(v) + ref["container-title"] = v elseif k == "PY" or k == "Y1" then ref.issued = v elseif k == "IS" then -- cgit v1.2.3 From 79e6f8db13ef8f0db6da8fe4e17b7626fe6ef3e9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 23 Nov 2021 10:50:35 -0800 Subject: Improve detection of pipe table line widths. Fixed calculation of maximum column widths in pipe tables. It is now based on the length of the markdown line, rather than a "stringified" version of the parsed line. This should be more predictable for users. In addition, we take into account double-wide characters such as emojis. Closes #7713. --- MANUAL.txt | 12 ++++++------ src/Text/Pandoc/Readers/Markdown.hs | 32 ++++++++++++++++++-------------- test/command/7713.md | 28 ++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 test/command/7713.md diff --git a/MANUAL.txt b/MANUAL.txt index 7e15e8833..0038f16cf 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -4055,12 +4055,12 @@ legal (though ugly) pipe table: orange|3.09 The cells of pipe tables cannot contain block elements like paragraphs -and lists, and cannot span multiple lines. If a pipe table contains a -row whose Markdown content is wider than the column width (see -`--columns`), then the table will take up the full text width and -the cell contents will wrap, with the relative cell widths determined -by the number of dashes in the line separating the table header from -the table body. (For example `---|-` would make the first column 3/4 +and lists, and cannot span multiple lines. If any line of the +markdown source is longer than the column width (see `--columns`), +then the table will take up the full text width and the cell +contents will wrap, with the relative cell widths determined by +the number of dashes in the line separating the table header +from the table body. (For example `---|-` would make the first column 3/4 and the second column 1/4 of the full text width.) On the other hand, if no lines are wider than column width, then cell contents will not be wrapped, and the cells will be sized diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index e24c38d33..b72ab22e2 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1,4 +1,5 @@ {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ViewPatterns #-} @@ -21,8 +22,8 @@ module Text.Pandoc.Readers.Markdown ( import Control.Monad import Control.Monad.Except (throwError) import Data.Char (isAlphaNum, isPunctuation, isSpace) +import Text.DocLayout (realLength) import Data.List (transpose, elemIndex, sortOn, foldl') -import Data.List.NonEmpty (NonEmpty(..)) import qualified Data.Map as M import Data.Maybe import qualified Data.Set as Set @@ -39,6 +40,7 @@ import Text.Pandoc.Class.PandocMonad (PandocMonad (..), report) import Text.Pandoc.Definition as Pandoc import Text.Pandoc.Emoji (emojiToInline) import Text.Pandoc.Error +import Safe.Foldable (maximumBounded) import Text.Pandoc.Logging import Text.Pandoc.Options import Text.Pandoc.Walk (walk) @@ -1351,26 +1353,30 @@ pipeTable = try $ do nonindentSpaces lookAhead nonspaceChar (heads,(aligns, seplengths)) <- (,) <$> pipeTableRow <*> pipeBreak - let heads' = take (length aligns) <$> heads + let cellContents = parseFromString' pipeTableCell . trim + let numcols = length aligns + let heads' = take numcols heads lines' <- many pipeTableRow - let lines'' = map (take (length aligns) <$>) lines' - let maxlength = maximum $ - fmap (\x -> T.length . stringify $ runF x def) (heads' :| lines'') - numColumns <- getOption readerColumns - let widths = if maxlength > numColumns + let lines'' = map (take numcols) lines' + let lineWidths = map (sum . map realLength) (heads' : lines'') + columns <- getOption readerColumns + -- add numcols + 1 for the pipes themselves + let widths = if maximumBounded (sum seplengths : lineWidths) + (numcols + 1) > columns then map (\len -> fromIntegral len / fromIntegral (sum seplengths)) seplengths else replicate (length aligns) 0.0 - return (aligns, widths, toHeaderRow <$> heads', map toRow <$> sequence lines'') + (headCells :: F [Blocks]) <- sequence <$> mapM cellContents heads' + (rows :: F [[Blocks]]) <- sequence <$> mapM (fmap sequence . mapM cellContents) lines'' + return (aligns, widths, toHeaderRow <$> headCells, map toRow <$> rows) sepPipe :: PandocMonad m => MarkdownParser m () sepPipe = try $ do char '|' <|> char '+' notFollowedBy blankline --- parse a row, also returning probable alignments for org-table cells -pipeTableRow :: PandocMonad m => MarkdownParser m (F [Blocks]) +-- parse a row, returning raw cell contents +pipeTableRow :: PandocMonad m => MarkdownParser m [Text] pipeTableRow = try $ do scanForPipe skipMany spaceChar @@ -1378,13 +1384,11 @@ pipeTableRow = try $ do -- split into cells let chunk = void (code <|> math <|> rawHtmlInline <|> escapedChar <|> rawLaTeXInline') <|> void (noneOf "|\n\r") - let cellContents = withRaw (many chunk) >>= - parseFromString' pipeTableCell . trim . snd - cells <- cellContents `sepEndBy1` char '|' + cells <- (snd <$> withRaw (many chunk)) `sepEndBy1` char '|' -- surrounding pipes needed for a one-column table: guard $ not (length cells == 1 && not openPipe) blankline - return $ sequence cells + return cells pipeTableCell :: PandocMonad m => MarkdownParser m (F Blocks) pipeTableCell = diff --git a/test/command/7713.md b/test/command/7713.md new file mode 100644 index 000000000..d42dcd9b8 --- /dev/null +++ b/test/command/7713.md @@ -0,0 +1,28 @@ +``` +% pandoc +| aaaaaaaaaaaa | bbbbb | ccccccccccc | +| --- | --- | --- | +| | | cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc | +^D + +++++ + + + + + + + + + + + + + + +
      aaaaaaaaaaaabbbbbccccccccccc
      cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc
      +``` -- cgit v1.2.3 From a8638894ab698cc0e49757a2732e383b652834bc Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 24 Nov 2021 16:41:52 +0100 Subject: Lua: allow single elements as singleton MetaBlocks/MetaInlines Single elements should always be treated as singleton lists in the Lua subsystem. --- src/Text/Pandoc/Lua/Marshaling/AST.hs | 3 +++ test/lua/module/pandoc.lua | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index 9cf683055..6a0e5d077 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -247,6 +247,9 @@ peekMetaValue = retrieving "MetaValue $ " . \idx -> do optional (LuaUtil.getTag idx) >>= \case Just tag -> peekTagged tag Nothing -> peekUntagged + Lua.TypeUserdata -> -- Allow singleton Inline or Block elements + (MetaInlines . (:[]) <$!> peekInline idx) <|> + (MetaBlocks . (:[]) <$!> peekBlock idx) _ -> failPeek "could not get meta value" typeBlock :: LuaError e => DocumentedType e Block diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index b191bcb3c..2849eedbf 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -735,7 +735,25 @@ return { assert.are_equal((pandoc.MetaMap{}).tag, (pandoc.MetaMap{}).t) assert.are_equal((pandoc.MetaInlines{}).tag, (pandoc.MetaInlines{}).t) assert.are_equal((pandoc.MetaBlocks{}).tag, (pandoc.MetaBlocks{}).t) - end) + end), + }, + group 'Meta' { + test('inline list is treated as MetaInlines', function () + local meta = pandoc.Pandoc({}, {test = {pandoc.Emph 'check'}}).meta + assert.are_same(meta.test, {pandoc.Emph{pandoc.Str 'check'}}) + end), + test('inline element is treated as MetaInlines singleton', function () + local meta = pandoc.Pandoc({}, {test = pandoc.Emph 'check'}).meta + assert.are_same(meta.test, {pandoc.Emph{pandoc.Str 'check'}}) + end), + test('block list is treated as MetaBlocks', function () + local meta = pandoc.Pandoc({}, {test = {pandoc.Plain 'check'}}).meta + assert.are_same(meta.test, {pandoc.Plain{pandoc.Str 'check'}}) + end), + test('block element is treated as MetaBlocks singleton', function () + local meta = pandoc.Pandoc({}, {test = pandoc.Plain 'check'}).meta + assert.are_same(meta.test, {pandoc.Plain{pandoc.Str 'check'}}) + end), }, group 'Other types' { group 'Citation' { -- cgit v1.2.3 From 6072bdcec95df9f537b22fb7df4a5f8ea7958189 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 24 Nov 2021 11:01:21 -0800 Subject: HTML reader: parse attributes on links and images. Closes #6970. --- src/Text/Pandoc/Readers/HTML.hs | 14 ++++++-------- src/Text/Pandoc/Readers/HTML/Parsing.hs | 7 ++++--- test/command/5986.md | 4 ++-- test/command/6970.md | 12 ++++++++++++ 4 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 test/command/6970.md diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index c78faebbd..8aa2646b2 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -643,7 +643,7 @@ pQ = do case lookup "cite" attrs of Just url -> do let uid = fromMaybe mempty $ - lookup "name" attrs <> lookup "id" attrs + lookup "name" attrs <|> lookup "id" attrs let cls = maybe [] T.words $ lookup "class" attrs url' <- canonicalizeUrl url makeQuote $ B.spanWith (uid, cls, [("cite", escapeURI url')]) @@ -705,20 +705,18 @@ pLineBreak = do pLink :: PandocMonad m => TagParser m Inlines pLink = try $ do - tag <- pSatisfy $ tagOpenLit "a" (const True) + tag@(TagOpen _ attr') <- pSatisfy $ tagOpenLit "a" (const True) let title = fromAttrib "title" tag - -- take id from id attribute if present, otherwise name - let uid = fromMaybe (fromAttrib "name" tag) $ - maybeFromAttrib "id" tag - let cls = T.words $ fromAttrib "class" tag + let attr = toAttr $ filter (\(k,_) -> k /= "title" && k /= "href") attr' lab <- mconcat <$> manyTill inline (pCloses "a") -- check for href; if href, then a link, otherwise a span case maybeFromAttrib "href" tag of Nothing -> - return $ extractSpaces (B.spanWith (uid, cls, [])) lab + return $ extractSpaces (B.spanWith attr) lab Just url' -> do url <- canonicalizeUrl url' - return $ extractSpaces (B.linkWith (uid, cls, []) (escapeURI url) title) lab + return $ extractSpaces + (B.linkWith attr (escapeURI url) title) lab pImage :: PandocMonad m => TagParser m Inlines pImage = do diff --git a/src/Text/Pandoc/Readers/HTML/Parsing.hs b/src/Text/Pandoc/Readers/HTML/Parsing.hs index 27a23aa69..a8cdf1de2 100644 --- a/src/Text/Pandoc/Readers/HTML/Parsing.hs +++ b/src/Text/Pandoc/Readers/HTML/Parsing.hs @@ -30,7 +30,7 @@ module Text.Pandoc.Readers.HTML.Parsing ) where -import Control.Monad (void, mzero) +import Control.Monad (void, mzero, mplus) import Data.Maybe (fromMaybe) import Data.Text (Text) import Text.HTML.TagSoup @@ -220,9 +220,10 @@ maybeFromAttrib _ _ = Nothing mkAttr :: [(Text, Text)] -> Attr mkAttr attr = (attribsId, attribsClasses, attribsKV) - where attribsId = fromMaybe "" $ lookup "id" attr + where attribsId = fromMaybe "" $ lookup "id" attr `mplus` lookup "name" attr attribsClasses = T.words (fromMaybe "" $ lookup "class" attr) <> epubTypes - attribsKV = filter (\(k,_) -> k /= "class" && k /= "id") attr + attribsKV = filter (\(k,_) -> k /= "class" && k /= "id" && k /= "name") + attr epubTypes = T.words $ fromMaybe "" $ lookup "epub:type" attr toAttr :: [(Text, Text)] -> Attr diff --git a/test/command/5986.md b/test/command/5986.md index ed8dd30c9..c181e33ad 100644 --- a/test/command/5986.md +++ b/test/command/5986.md @@ -6,8 +6,8 @@

      diff --git a/test/command/6970.md b/test/command/6970.md new file mode 100644 index 000000000..45d9b76bd --- /dev/null +++ b/test/command/6970.md @@ -0,0 +1,12 @@ +``` +% pandoc -f html -t native +https://example.com +^D +[ Plain + [ Link + ( "foo" , [ "bar" , "baz" ] , [ ( "target" , "_blank" ) ] ) + [ Str "https://example.com" ] + ( "https://example.com" , "" ) + ] +] +``` -- cgit v1.2.3 From 7726b69cd351b890b299402450f8d14747f0898a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 24 Nov 2021 14:47:00 -0800 Subject: LaTeX reader: omit visible content for `\label{...}`. Previously we included the text of the label in square brackets, but this is undesirable in many cases. See discussion in . --- src/Text/Pandoc/Readers/LaTeX/Inline.hs | 3 +-- test/command/refs.md | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX/Inline.hs b/src/Text/Pandoc/Readers/LaTeX/Inline.hs index 0b49fd6c3..5938096fd 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Inline.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Inline.hs @@ -56,8 +56,7 @@ dolabel = do let refstr = untokenize v updateState $ \st -> st{ sLastLabel = Just refstr } - return $ spanWith (refstr,[],[("label", refstr)]) - $ inBrackets $ str $ untokenize v + return $ spanWith (refstr,[],[("label", refstr)]) mempty doref :: PandocMonad m => Text -> LP m Inlines doref cls = do diff --git a/test/command/refs.md b/test/command/refs.md index 34e51d219..c6457be4c 100644 --- a/test/command/refs.md +++ b/test/command/refs.md @@ -287,9 +287,7 @@ Figure \ref{fig:Logo3} illustrated the SVG logo \label{section} Section \ref{section} ^D [ Para - [ Span - ( "section" , [] , [ ( "label" , "section" ) ] ) - [ Str "[section]" ] + [ Span ( "section" , [] , [ ( "label" , "section" ) ] ) [] , Space , Str "Section" , Space -- cgit v1.2.3 From 2ca3993c6733d8add948338ef69d124237e21c69 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 24 Nov 2021 18:41:20 -0800 Subject: LaTeX reader: improve references. - Resolve references to theorem environments. - Remove Span caused by "label" in figure, table, and theorem environments; this had an id that duplicated the environments' id. See #813. --- src/Text/Pandoc/Readers/LaTeX.hs | 7 +++++-- src/Text/Pandoc/Readers/LaTeX/Math.hs | 6 ++++-- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 15 +++++++++++++++ src/Text/Pandoc/Readers/LaTeX/Table.hs | 4 +++- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 25acc0f7e..548ac75a8 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1101,7 +1101,8 @@ addImageCaption = walkM go case sCaption st of Nothing -> return p Just figureCaption -> do - let attr' = case sLastLabel st of + let mblabel = sLastLabel st + let attr' = case mblabel of Just lab -> (lab, cls, kvs) Nothing -> attr case attr' of @@ -1113,7 +1114,9 @@ addImageCaption = walkM go , sLabels = M.insert ident [Str (renderDottedNum num)] (sLabels st) } - return $ SimpleFigure attr' (B.toList figureCaption) (src, tit) + return $ SimpleFigure attr' + (maybe id removeLabel mblabel (B.toList figureCaption)) + (src, tit) go x = return x coloredBlock :: PandocMonad m => Text -> LP m Blocks diff --git a/src/Text/Pandoc/Readers/LaTeX/Math.hs b/src/Text/Pandoc/Readers/LaTeX/Math.hs index 5b49a0376..0600e45ef 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Math.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Math.hs @@ -142,14 +142,15 @@ newtheorem inline = do theoremEnvironment :: PandocMonad m => LP m Blocks -> LP m Inlines -> Text -> LP m Blocks theoremEnvironment blocks opt name = do + resetCaption tmap <- sTheoremMap <$> getState case M.lookup name tmap of Nothing -> mzero Just tspec -> do optTitle <- option mempty $ (\x -> space <> "(" <> x <> ")") <$> opt - mblabel <- option Nothing $ Just . untokenize <$> - try (spaces >> controlSeq "label" >> spaces >> braced) bs <- env name blocks + mblabel <- sLastLabel <$> getState + number <- if theoremNumber tspec then do @@ -182,6 +183,7 @@ theoremEnvironment blocks opt name = do let title = titleEmph (theoremName tspec <> number) <> optTitle <> "." <> space return $ divWith (fromMaybe "" mblabel, [name], []) $ addTitle title + $ maybe id removeLabel mblabel $ case theoremStyle tspec of PlainStyle -> walk italicize bs _ -> bs diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 7366d7b2d..9eb4a0cbc 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -90,6 +90,7 @@ module Text.Pandoc.Readers.LaTeX.Parsing , resetCaption , env , addMeta + , removeLabel ) where import Control.Applicative (many, (<|>)) @@ -119,6 +120,7 @@ import Text.Pandoc.Readers.LaTeX.Types (ExpansionPoint (..), Macro (..), ArgSpec (..), Tok (..), TokType (..)) import Text.Pandoc.Shared import Text.Parsec.Pos +import Text.Pandoc.Walk newtype DottedNum = DottedNum [Int] deriving (Show, Eq) @@ -1067,3 +1069,16 @@ tokWith inlineParser = try $ spaces >> addMeta :: PandocMonad m => ToMetaValue a => Text -> a -> LP m () addMeta field val = updateState $ \st -> st{ sMeta = addMetaField field val $ sMeta st } + +-- remove label spans to avoid duplicated identifier +removeLabel :: Walkable [Inline] a => Text -> a -> a +removeLabel lbl = walk go + where + go (Span (_,_,kvs) _ : rest) + | Just lbl' <- lookup "label" kvs + , lbl' == lbl = go (dropWhile isSpaceOrSoftBreak rest) + go (x:xs) = x : go xs + go [] = [] + isSpaceOrSoftBreak Space = True + isSpaceOrSoftBreak SoftBreak = True + isSpaceOrSoftBreak _ = False diff --git a/src/Text/Pandoc/Readers/LaTeX/Table.hs b/src/Text/Pandoc/Readers/LaTeX/Table.hs index f56728fe1..7d5c4f265 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Table.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Table.hs @@ -368,7 +368,9 @@ addTableCaption = walkM go ((_,classes,kvs), Just ident) -> (ident,classes,kvs) _ -> attr - return $ addAttrDiv attr' $ Table nullAttr capt spec th tb tf + return $ addAttrDiv attr' + $ maybe id removeLabel mblabel + $ Table nullAttr capt spec th tb tf go x = return x -- TODO: For now we add a Div to contain table attributes, since -- cgit v1.2.3 From 0d25232bbf2998cccf6ca4b1dc6e8d6f36eb9c60 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 24 Nov 2021 19:38:43 -0800 Subject: LaTeX reader: Fix semantics of `\ref`. We were including the ams environment type in addition to the number. This is proper behavior for `\cref` but not for `\ref`. To support `\cref` we need to store the environment label separately. --- src/Text/Pandoc/Readers/LaTeX/Math.hs | 8 +++----- test/command/1608.md | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX/Math.hs b/src/Text/Pandoc/Readers/LaTeX/Math.hs index 0600e45ef..01edce7ed 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Math.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Math.hs @@ -170,9 +170,7 @@ theoremEnvironment blocks opt name = do Just ident -> updateState $ \s -> s{ sLabels = M.insert ident - (B.toList $ - theoremName tspec <> "\160" <> - str (renderDottedNum num)) (sLabels s) } + (B.toList $ str (renderDottedNum num)) (sLabels s) } Nothing -> return () return $ space <> B.text (renderDottedNum num) else return mempty @@ -182,14 +180,14 @@ theoremEnvironment blocks opt name = do RemarkStyle -> B.emph let title = titleEmph (theoremName tspec <> number) <> optTitle <> "." <> space - return $ divWith (fromMaybe "" mblabel, [name], []) $ addTitle title + return $ divWith (fromMaybe "" mblabel, [name], []) + $ addTitle title $ maybe id removeLabel mblabel $ case theoremStyle tspec of PlainStyle -> walk italicize bs _ -> bs - proof :: PandocMonad m => LP m Blocks -> LP m Inlines -> LP m Blocks proof blocks opt = do title <- option (B.text "Proof") opt diff --git a/test/command/1608.md b/test/command/1608.md index 59bd54ab4..77fdaf6d3 100644 --- a/test/command/1608.md +++ b/test/command/1608.md @@ -133,7 +133,7 @@ These are all pretty interesting facts. , ( "reference" , "def:tri" ) ] ) - [ Str "Definition\160\&1" ] + [ Str "1" ] ( "#def:tri" , "" ) , Space , Str "since" -- cgit v1.2.3 From 3692a1d1e83703fbf235214f2838cd92683c625c Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 28 Nov 2021 02:08:01 +0100 Subject: Lua: use package pandoc-lua-marshal (#7719) The marshaling functions for pandoc's AST are extracted into a separate package. The package comes with a number of changes: - Pandoc's List module was rewritten in C, thereby improving error messages. - Lists of `Block` and `Inline` elements are marshaled using the new list types `Blocks` and `Inlines`, respectively. These types currently behave identical to the generic List type, but give better error messages. This also opens up the possibility of adding element-specific methods to these lists in the future. - Elements of type `MetaValue` are no longer pushed as values which have `.t` and `.tag` properties. This was already true for `MetaString` and `MetaBool` values, which are still marshaled as Lua strings and booleans, respectively. Affected values: + `MetaBlocks` values are marshaled as a `Blocks` list; + `MetaInlines` values are marshaled as a `Inlines` list; + `MetaList` values are marshaled as a generic pandoc `List`s. + `MetaMap` values are marshaled as plain tables and no longer given any metatable. - The test suite for marshaled objects and their constructors has been extended and improved. - A bug in Citation objects, where setting a citation's suffix modified it's prefix, has been fixed. --- cabal.project | 5 + data/pandoc.List.lua | 142 ---- data/pandoc.lua | 247 ------- pandoc.cabal | 20 +- src/Text/Pandoc/Lua.hs | 2 +- src/Text/Pandoc/Lua/ErrorConversion.hs | 2 +- src/Text/Pandoc/Lua/Filter.hs | 13 +- src/Text/Pandoc/Lua/Global.hs | 6 +- src/Text/Pandoc/Lua/Init.hs | 50 +- src/Text/Pandoc/Lua/Marshal/CommonState.hs | 70 ++ src/Text/Pandoc/Lua/Marshal/Context.hs | 28 + src/Text/Pandoc/Lua/Marshal/PandocError.hs | 51 ++ src/Text/Pandoc/Lua/Marshal/ReaderOptions.hs | 133 ++++ src/Text/Pandoc/Lua/Marshaling.hs | 19 - src/Text/Pandoc/Lua/Marshaling/AST.hs | 868 ----------------------- src/Text/Pandoc/Lua/Marshaling/Attr.hs | 237 ------- src/Text/Pandoc/Lua/Marshaling/CommonState.hs | 70 -- src/Text/Pandoc/Lua/Marshaling/Context.hs | 28 - src/Text/Pandoc/Lua/Marshaling/List.hs | 48 -- src/Text/Pandoc/Lua/Marshaling/ListAttributes.hs | 72 -- src/Text/Pandoc/Lua/Marshaling/PandocError.hs | 51 -- src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs | 133 ---- src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs | 92 --- src/Text/Pandoc/Lua/Module/MediaBag.hs | 4 +- src/Text/Pandoc/Lua/Module/Pandoc.hs | 261 +------ src/Text/Pandoc/Lua/Module/Types.hs | 30 +- src/Text/Pandoc/Lua/Module/Utils.hs | 9 +- src/Text/Pandoc/Lua/Orphans.hs | 111 +++ src/Text/Pandoc/Lua/Packages.hs | 7 +- src/Text/Pandoc/Lua/PandocLua.hs | 25 +- src/Text/Pandoc/Lua/Util.hs | 31 +- src/Text/Pandoc/Lua/Walk.hs | 31 +- stack.yaml | 4 +- test/Tests/Lua.hs | 3 +- test/lua/module/pandoc.lua | 844 +++------------------- 35 files changed, 581 insertions(+), 3166 deletions(-) delete mode 100644 data/pandoc.List.lua delete mode 100644 data/pandoc.lua create mode 100644 src/Text/Pandoc/Lua/Marshal/CommonState.hs create mode 100644 src/Text/Pandoc/Lua/Marshal/Context.hs create mode 100644 src/Text/Pandoc/Lua/Marshal/PandocError.hs create mode 100644 src/Text/Pandoc/Lua/Marshal/ReaderOptions.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling/AST.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling/Attr.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling/CommonState.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling/Context.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling/List.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling/ListAttributes.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling/PandocError.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs delete mode 100644 src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs create mode 100644 src/Text/Pandoc/Lua/Orphans.hs diff --git a/cabal.project b/cabal.project index 669dd74e2..7164f9978 100644 --- a/cabal.project +++ b/cabal.project @@ -3,6 +3,11 @@ tests: True flags: +embed_data_files constraints: aeson >= 2.0.1.0 +source-repository-package + type: git + location: https://github.com/tarleb/pandoc-lua-marshal.git + tag: 56387e543c48cc5518a77c2a271ff211653f2a36 + -- source-repository-package -- type: git -- location: https://github.com/jgm/texmath.git diff --git a/data/pandoc.List.lua b/data/pandoc.List.lua deleted file mode 100644 index b33c30876..000000000 --- a/data/pandoc.List.lua +++ /dev/null @@ -1,142 +0,0 @@ ---[[ -List.lua - -Copyright © 2017–2020 Albert Krewinkel - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ]] - ---- Pandoc's List type and helper methods --- @classmod pandoc.List --- @author Albert Krewinkel --- @copyright © 2017–2020 Albert Krewinkel --- @license MIT -local List = { - _VERSION = "1.0.0" -} - ---- Create a new list. --- @param[opt] o table that should be altered into a list (default: `{}`) --- @return the altered input table -function List:new (o) - o = o or {} - setmetatable(o, self) - self.__index = self - return o -end - ---- Concatenates two lists. --- @param list second list concatenated to the first --- @return a new list containing all elements from list1 and list2 -function List:__concat (list) - local res = List.clone(self) - List.extend(res, list) - return res -end - ---- Returns a (shallow) copy of the list. -function List:clone () - local lst = setmetatable({}, getmetatable(self)) - List.extend(lst, self) - return lst -end - ---- Adds the given list to the end of this list. --- @param list list to appended -function List:extend (list) - for i = 1, #list do - self[#self + 1] = list[i] - end -end - ---- Returns a new list containing all items satisfying a given condition. --- @param pred condition items must satisfy. --- @return a new list containing all items for which `test` was true. -function List:filter (pred) - local res = setmetatable({}, getmetatable(self)) - for i = 1, #self do - if pred(self[i], i) then - res[#res + 1] = self[i] - end - end - return res -end - ---- Returns the value and index of the first occurrence of the given item. --- @param needle item to search for --- @param[opt] init index at which the search is started (default: 1) --- @return first item equal to the needle, or nil if no such item exists. --- @return index of that element -function List:find (needle, init) - return List.find_if(self, function(x) return x == needle end, init) -end - ---- Returns the value and index of the first element for which the predicate ---- holds true. --- @param pred the predicate function --- @param[opt] init index at which the search is started (default: 1) --- @return first item for which `test` succeeds, or nil if no such item exists. --- @return index of that element -function List:find_if (pred, init) - init = (init == nil and 1) or (init < 0 and #self - init) or init - for i = init, #self do - if pred(self[i], i) then - return self[i], i - end - end - return nil -end - ---- Checks if the list has an item equal to the given needle. --- @param needle item to search for --- @param[opt] init index at which the search is started; defaults to 1. --- @return true if a list item is equal to the needle, false otherwise -function List:includes (needle, init) - return not (List.find(self, needle, init) == nil) -end - ---- Insert an element into the list. Alias for `table.insert`. --- @param list list --- @param[opt] pos position at which the new element is to be inserted --- @param value value to insert -List.insert = table.insert - ---- Returns a copy of the current list by applying the given function to --- all elements. --- @param fn function which is applied to all list items. -function List:map (fn) - local res = setmetatable({}, getmetatable(self)) - for i = 1, #self do - res[i] = fn(self[i], i) - end - return res -end - ---- Remove element from list (alias for `table.remove`) --- @param list list --- @param[opt] pos position of the element to be removed (default: #list) --- @return the removed element -List.remove = table.remove - ---- Sort list in-place (alias for `table.sort`) --- @param list list --- @param[opt] comp comparison function; default to `<` operator. -List.sort = table.sort - --- Set metatable with __call metamethod. This allows the use of `List` --- as a constructor function. -local ListMT = { - __call = List.new -} -setmetatable(List, ListMT) - -return List diff --git a/data/pandoc.lua b/data/pandoc.lua deleted file mode 100644 index 7e5ff799b..000000000 --- a/data/pandoc.lua +++ /dev/null @@ -1,247 +0,0 @@ ---[[ -pandoc.lua - -Copyright © 2017–2019 Albert Krewinkel - -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. -]] - ---- --- Lua functions for pandoc scripts. --- --- @author Albert Krewinkel --- @copyright © 2017–2019 Albert Krewinkel --- @license MIT -local M = {} - --- Re-export bundled modules -M.List = require 'pandoc.List' -M.mediabag = require 'pandoc.mediabag' -M.path = require 'pandoc.path' -M.system = require 'pandoc.system' -M.types = require 'pandoc.types' -M.utils = require 'pandoc.utils' -M.text = require 'text' - --- Local names for modules which this module depends on. -local List = M.List -local utils = M.utils - - ------------------------------------------------------------------------- --- Accessor objects --- --- Create metatables which allow to access numerical indices via accessor --- methods. --- @section --- @local - ---- Create a new table which allows to access numerical indices via accessor --- functions. --- @local -local function create_accessor_behavior (tag) - local behavior = {tag = tag} - behavior.__eq = utils.equals - behavior.__index = function(t, k) - if k == "t" then - return getmetatable(t)["tag"] - end - return getmetatable(t)[k] - end - behavior.__pairs = function (t) - return next, t - end - return behavior -end - - ------------------------------------------------------------------------- --- The base class for types --- @type Type --- @local -local Type = {} -Type.name = 'Type' -Type.__index = Type -Type.behavior = { - __type = Type, - new = function (obj) - obj = obj or {} - setmetatable(obj, self) - return obj - end -} -Type.behavior.__index = Type.behavior - ---- Set a new behavior for the type, inheriting that of the parent type if none ---- is specified explicitly --- @param behavior the behavior object for this type. --- @local -function Type:set_behavior (behavior) - behavior = behavior or {} - behavior.__index = rawget(behavior, '__index') or behavior - behavior.__type = self - if not getmetatable(behavior) and getmetatable(self) then - setmetatable(behavior, getmetatable(self).behavior) - end - self.behavior = behavior -end - ---- Create a new subtype, using the given table as base. --- @param name name of the new type --- @param[opt] behavior behavioral object for the new type. --- @return a new type --- @local -function Type:make_subtype(name, behavior) - local newtype = setmetatable({}, self) - newtype.name = name - newtype.__index = newtype - newtype:set_behavior(behavior) - return newtype -end - - ------------------------------------------------------------------------- --- The base class for pandoc's AST elements. --- @type AstElement --- @local -local AstElement = Type:make_subtype 'AstElement' -AstElement.__call = function(t, ...) - local success, ret = pcall(t.new, t, ...) - if success then - return setmetatable(ret, t.behavior) - else - error(string.format('Constructor for %s failed: %s\n', t.name, ret)) - end -end - ---- Make a new subtype which constructs a new value when called. --- @local -function AstElement:make_subtype(...) - local newtype = Type.make_subtype(self, ...) - newtype.__call = self.__call - return newtype -end - ---- Create a new constructor --- @local --- @param tag Tag used to identify the constructor --- @param fn Function to be called when constructing a new element --- @param accessors names to use as accessors for numerical fields --- @return function that constructs a new element -function AstElement:create_constructor(tag, fn) - local constr = self:make_subtype(tag, create_accessor_behavior(tag)) - function constr:new(...) - return setmetatable(fn(...), self.behavior) - end - self.constructor = self.constructor or {} - self.constructor[tag] = constr - return constr -end - ---- Convert AstElement input into a list if necessary. --- @local -local function ensureList (x) - if x.tag then - -- Lists are not tagged, but all elements are - return List:new{x} - else - return List:new(x) - end -end - ---- Ensure a given object is an Inline element, or convert it into one. --- @local -local function ensureInlineList (x) - if type(x) == 'string' then - return List:new{M.Str(x)} - else - return ensureList(x) - end -end - ------------------------------------------------------------------------- --- Meta --- @section Meta - ---- Create a new Meta object. It sets the metatable of the given table to ---- `Meta`. --- @function Meta --- @tparam meta table table containing document meta information -M.Meta = AstElement:make_subtype'Meta' -M.Meta.behavior.clone = M.types.clone.Meta -function M.Meta:new (meta) return meta end - - ------------------------------------------------------------------------- --- MetaValue --- @section MetaValue -M.MetaValue = AstElement:make_subtype('MetaValue') -M.MetaValue.behavior.clone = M.types.clone.MetaValue - ---- Meta blocks --- @function MetaBlocks --- @tparam {Block,...} blocks blocks -M.MetaBlocks = M.MetaValue:create_constructor( - 'MetaBlocks', - function (content) return ensureList(content) end -) - ---- Meta inlines --- @function MetaInlines --- @tparam {Inline,...} inlines inlines -M.MetaInlines = M.MetaValue:create_constructor( - 'MetaInlines', - function (content) return ensureInlineList(content) end -) - ---- Meta list --- @function MetaList --- @tparam {MetaValue,...} meta_values list of meta values -M.MetaList = M.MetaValue:create_constructor( - 'MetaList', - function (content) - if content.tag == 'MetaList' then - return content - end - return ensureList(content) - end -) -for k, v in pairs(List) do - M.MetaList.behavior[k] = v -end - ---- Meta map --- @function MetaMap --- @tparam table key_value_map a string-indexed map of meta values -M.MetaMap = M.MetaValue:create_constructor( - "MetaMap", - function (mm) return mm end -) - ---- Creates string to be used in meta data. --- Does nothing, lua strings are meta strings. --- @function MetaString --- @tparam string str string value -function M.MetaString(str) - return str -end - ---- Creates boolean to be used in meta data. --- Does nothing, lua booleans are meta booleans. --- @function MetaBool --- @tparam boolean bool boolean value -function M.MetaBool(bool) - return bool -end - -return M diff --git a/pandoc.cabal b/pandoc.cabal index 99962ac4c..e7d1349fc 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -177,10 +177,6 @@ data-files: data/creole.lua -- lua init script data/init.lua - -- pandoc lua module - data/pandoc.lua - -- lua List module - data/pandoc.List.lua -- bash completion template data/bash_completion.tpl -- citeproc @@ -481,6 +477,7 @@ library mtl >= 2.2 && < 2.3, network >= 2.6, network-uri >= 2.6 && < 2.8, + pandoc-lua-marshal >= 0.1 && < 0.2, pandoc-types >= 1.22.1 && < 1.23, parsec >= 3.1 && < 3.2, pretty >= 1.1 && < 1.2, @@ -689,21 +686,16 @@ library Text.Pandoc.Lua.Filter, Text.Pandoc.Lua.Global, Text.Pandoc.Lua.Init, - Text.Pandoc.Lua.Marshaling, - Text.Pandoc.Lua.Marshaling.AST, - Text.Pandoc.Lua.Marshaling.Attr, - Text.Pandoc.Lua.Marshaling.CommonState, - Text.Pandoc.Lua.Marshaling.Context, - Text.Pandoc.Lua.Marshaling.List, - Text.Pandoc.Lua.Marshaling.ListAttributes, - Text.Pandoc.Lua.Marshaling.PandocError, - Text.Pandoc.Lua.Marshaling.ReaderOptions, - Text.Pandoc.Lua.Marshaling.SimpleTable, + Text.Pandoc.Lua.Marshal.CommonState, + Text.Pandoc.Lua.Marshal.Context, + Text.Pandoc.Lua.Marshal.PandocError, + Text.Pandoc.Lua.Marshal.ReaderOptions, Text.Pandoc.Lua.Module.MediaBag, Text.Pandoc.Lua.Module.Pandoc, Text.Pandoc.Lua.Module.System, Text.Pandoc.Lua.Module.Types, Text.Pandoc.Lua.Module.Utils, + Text.Pandoc.Lua.Orphans, Text.Pandoc.Lua.Packages, Text.Pandoc.Lua.PandocLua, Text.Pandoc.Lua.Util, diff --git a/src/Text/Pandoc/Lua.hs b/src/Text/Pandoc/Lua.hs index f0e9e076b..2aa84b7fa 100644 --- a/src/Text/Pandoc/Lua.hs +++ b/src/Text/Pandoc/Lua.hs @@ -20,4 +20,4 @@ module Text.Pandoc.Lua import Text.Pandoc.Lua.Filter (runFilterFile) import Text.Pandoc.Lua.Global (Global (..), setGlobals) import Text.Pandoc.Lua.Init (runLua) -import Text.Pandoc.Lua.Marshaling () +import Text.Pandoc.Lua.Orphans () diff --git a/src/Text/Pandoc/Lua/ErrorConversion.hs b/src/Text/Pandoc/Lua/ErrorConversion.hs index 9c4c990a3..5cb1bf825 100644 --- a/src/Text/Pandoc/Lua/ErrorConversion.hs +++ b/src/Text/Pandoc/Lua/ErrorConversion.hs @@ -19,7 +19,7 @@ import HsLua (LuaError, LuaE, top) import HsLua.Marshalling (resultToEither, runPeek) import HsLua.Class.Peekable (PeekError (..)) import Text.Pandoc.Error (PandocError (PandocLuaError)) -import Text.Pandoc.Lua.Marshaling.PandocError (pushPandocError, peekPandocError) +import Text.Pandoc.Lua.Marshal.PandocError (pushPandocError, peekPandocError) import qualified Data.Text as T import qualified HsLua as Lua diff --git a/src/Text/Pandoc/Lua/Filter.hs b/src/Text/Pandoc/Lua/Filter.hs index 9fd0ef32c..ba5a14a0d 100644 --- a/src/Text/Pandoc/Lua/Filter.hs +++ b/src/Text/Pandoc/Lua/Filter.hs @@ -33,10 +33,9 @@ import Data.String (IsString (fromString)) import HsLua as Lua import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError) -import Text.Pandoc.Lua.Marshaling () -import Text.Pandoc.Lua.Marshaling.AST -import Text.Pandoc.Lua.Marshaling.List (List (..), peekList') -import Text.Pandoc.Lua.Walk (SingletonsList (..)) +import Text.Pandoc.Lua.Marshal.AST +import Text.Pandoc.Lua.Orphans () +import Text.Pandoc.Lua.Walk (List (..), SingletonsList (..)) import Text.Pandoc.Walk (Walkable (walkM)) import qualified Data.Map.Strict as Map @@ -196,7 +195,8 @@ walkInlineLists :: Walkable (List Inline) a => LuaFilter -> a -> LuaE PandocError a walkInlineLists lf = let f :: List Inline -> LuaE PandocError (List Inline) - f = runOnValue listOfInlinesFilterName (peekList' peekInline) lf + f = runOnValue listOfInlinesFilterName peekListOfInlines lf + peekListOfInlines idx = List <$!> (peekInlinesFuzzy idx) in if lf `contains` listOfInlinesFilterName then walkM f else return @@ -214,7 +214,8 @@ walkBlockLists :: Walkable (List Block) a => LuaFilter -> a -> LuaE PandocError a walkBlockLists lf = let f :: List Block -> LuaE PandocError (List Block) - f = runOnValue listOfBlocksFilterName (peekList' peekBlock) lf + f = runOnValue listOfBlocksFilterName peekListOfBlocks lf + peekListOfBlocks idx = List <$!> (peekBlocksFuzzy idx) in if lf `contains` listOfBlocksFilterName then walkM f else return diff --git a/src/Text/Pandoc/Lua/Global.hs b/src/Text/Pandoc/Lua/Global.hs index 05510f45d..c7b50a25f 100644 --- a/src/Text/Pandoc/Lua/Global.hs +++ b/src/Text/Pandoc/Lua/Global.hs @@ -20,9 +20,9 @@ import Paths_pandoc (version) import Text.Pandoc.Class.CommonState (CommonState) import Text.Pandoc.Definition (Pandoc (Pandoc), pandocTypesVersion) import Text.Pandoc.Error (PandocError) -import Text.Pandoc.Lua.Marshaling () -import Text.Pandoc.Lua.Marshaling.CommonState (pushCommonState) -import Text.Pandoc.Lua.Marshaling.ReaderOptions (pushReaderOptionsReadonly) +import Text.Pandoc.Lua.Marshal.CommonState (pushCommonState) +import Text.Pandoc.Lua.Marshal.ReaderOptions (pushReaderOptionsReadonly) +import Text.Pandoc.Lua.Orphans () import Text.Pandoc.Options (ReaderOptions) import qualified Data.Text as Text diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index 2f113bff2..835da1fc9 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -17,7 +17,6 @@ module Text.Pandoc.Lua.Init import Control.Monad (forM, forM_, when) import Control.Monad.Catch (throwM, try) import Control.Monad.Trans (MonadIO (..)) -import Data.Data (Data, dataTypeConstrs, dataTypeOf, showConstr) import Data.Maybe (catMaybes) import HsLua as Lua hiding (status, try) import GHC.IO.Encoding (getForeignEncoding, setForeignEncoding, utf8) @@ -27,7 +26,6 @@ import Text.Pandoc.Lua.Packages (installPandocPackageSearcher) import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, runPandocLua) import qualified Data.Text as T import qualified Lua.LPeg as LPeg -import qualified Text.Pandoc.Definition as Pandoc import qualified Text.Pandoc.Lua.Module.Pandoc as ModulePandoc -- | Run the lua interpreter, using pandoc's default way of environment @@ -42,6 +40,19 @@ runLua luaOp = do liftIO $ setForeignEncoding enc return res +-- | Modules that are loaded at startup and assigned to fields in the +-- pandoc module. +loadedModules :: [(Name, Name)] +loadedModules = + [ ("pandoc.List", "List") + , ("pandoc.mediabag", "mediabag") + , ("pandoc.path", "path") + , ("pandoc.system", "system") + , ("pandoc.types", "types") + , ("pandoc.utils", "utils") + , ("text", "text") + ] + -- | Initialize the lua state with all required values initLuaState :: PandocLua () initLuaState = do @@ -61,9 +72,13 @@ initLuaState = do Lua.getfield Lua.registryindex Lua.loaded Lua.pushvalue (Lua.nth 2) Lua.setfield (Lua.nth 2) "pandoc" - Lua.pop 1 - -- copy constructors into registry - putConstructorsInRegistry + Lua.pop 1 -- remove LOADED table + -- load modules and add them to the `pandoc` module table. + liftPandocLua $ forM_ loadedModules $ \(pkgname, fieldname) -> do + Lua.getglobal "require" + Lua.pushName pkgname + Lua.call 1 1 + Lua.setfield (nth 2) fieldname -- assign module to global variable liftPandocLua $ Lua.setglobal "pandoc" @@ -122,28 +137,3 @@ initLuaState = do Lua.pushHaskellFunction $ Lua.state >>= liftIO . LPeg.lpeg_searcher Lua.rawseti (Lua.nth 2) . (+1) . fromIntegral =<< Lua.rawlen (Lua.nth 2) Lua.pop 1 -- remove 'package.searchers' from stack - --- | AST elements are marshaled via normal constructor functions in the --- @pandoc@ module. However, accessing Lua globals from Haskell is --- expensive (due to error handling). Accessing the Lua registry is much --- cheaper, which is why the constructor functions are copied into the --- Lua registry and called from there. --- --- This function expects the @pandoc@ module to be at the top of the --- stack. -putConstructorsInRegistry :: PandocLua () -putConstructorsInRegistry = liftPandocLua $ do - constrsToReg $ Pandoc.Meta mempty - constrsToReg $ Pandoc.MetaList mempty - putInReg "List" -- pandoc.List - putInReg "SimpleTable" -- helper for backward-compatible table handling - where - constrsToReg :: Data a => a -> LuaE PandocError () - constrsToReg = mapM_ (putInReg . showConstr) . dataTypeConstrs . dataTypeOf - - putInReg :: String -> LuaE PandocError () - putInReg name = do - Lua.push ("pandoc." ++ name) -- name in registry - Lua.push name -- in pandoc module - Lua.rawget (Lua.nth 3) - Lua.rawset Lua.registryindex diff --git a/src/Text/Pandoc/Lua/Marshal/CommonState.hs b/src/Text/Pandoc/Lua/Marshal/CommonState.hs new file mode 100644 index 000000000..a8c0e28d2 --- /dev/null +++ b/src/Text/Pandoc/Lua/Marshal/CommonState.hs @@ -0,0 +1,70 @@ +{-# LANGUAGE OverloadedStrings #-} +{- | + Module : Text.Pandoc.Lua.Marshal.CommonState + Copyright : © 2012-2021 John MacFarlane + © 2017-2021 Albert Krewinkel + License : GNU GPL, version 2 or above + Maintainer : Albert Krewinkel + Stability : alpha + +Instances to marshal (push) and unmarshal (peek) the common state. +-} +module Text.Pandoc.Lua.Marshal.CommonState + ( typeCommonState + , peekCommonState + , pushCommonState + ) where + +import HsLua.Core +import HsLua.Marshalling +import HsLua.Packaging +import Text.Pandoc.Class (CommonState (..)) +import Text.Pandoc.Logging (LogMessage, showLogMessage) +import Text.Pandoc.Lua.Marshal.List (pushPandocList) + +-- | Lua type used for the @CommonState@ object. +typeCommonState :: LuaError e => DocumentedType e CommonState +typeCommonState = deftype "pandoc CommonState" [] + [ readonly "input_files" "input files passed to pandoc" + (pushPandocList pushString, stInputFiles) + + , readonly "output_file" "the file to which pandoc will write" + (maybe pushnil pushString, stOutputFile) + + , readonly "log" "list of log messages" + (pushPandocList (pushUD typeLogMessage), stLog) + + , readonly "request_headers" "headers to add for HTTP requests" + (pushPandocList (pushPair pushText pushText), stRequestHeaders) + + , readonly "resource_path" + "path to search for resources like included images" + (pushPandocList pushString, stResourcePath) + + , readonly "source_url" "absolute URL + dir of 1st source file" + (maybe pushnil pushText, stSourceURL) + + , readonly "user_data_dir" "directory to search for data files" + (maybe pushnil pushString, stUserDataDir) + + , readonly "trace" "controls whether tracing messages are issued" + (pushBool, stTrace) + + , readonly "verbosity" "verbosity level" + (pushString . show, stVerbosity) + ] + +peekCommonState :: LuaError e => Peeker e CommonState +peekCommonState = peekUD typeCommonState + +pushCommonState :: LuaError e => Pusher e CommonState +pushCommonState = pushUD typeCommonState + +typeLogMessage :: LuaError e => DocumentedType e LogMessage +typeLogMessage = deftype "pandoc LogMessage" + [ operation Index $ defun "__tostring" + ### liftPure showLogMessage + <#> udparam typeLogMessage "msg" "object" + =#> functionResult pushText "string" "stringified log message" + ] + mempty -- no members diff --git a/src/Text/Pandoc/Lua/Marshal/Context.hs b/src/Text/Pandoc/Lua/Marshal/Context.hs new file mode 100644 index 000000000..17af936e1 --- /dev/null +++ b/src/Text/Pandoc/Lua/Marshal/Context.hs @@ -0,0 +1,28 @@ +{-# OPTIONS_GHC -fno-warn-orphans #-} +{- | + Module : Text.Pandoc.Lua.Marshaling.Context + Copyright : © 2012-2021 John MacFarlane + © 2017-2021 Albert Krewinkel + License : GNU GPL, version 2 or above + + Maintainer : Albert Krewinkel + Stability : alpha + +Marshaling instance for doctemplates Context and its components. +-} +module Text.Pandoc.Lua.Marshal.Context () where + +import qualified HsLua as Lua +import HsLua (Pushable) +import Text.DocTemplates (Context(..), Val(..), TemplateTarget) +import Text.DocLayout (render) + +instance (TemplateTarget a, Pushable a) => Pushable (Context a) where + push (Context m) = Lua.push m + +instance (TemplateTarget a, Pushable a) => Pushable (Val a) where + push NullVal = Lua.push () + push (BoolVal b) = Lua.push b + push (MapVal ctx) = Lua.push ctx + push (ListVal xs) = Lua.push xs + push (SimpleVal d) = Lua.push $ render Nothing d diff --git a/src/Text/Pandoc/Lua/Marshal/PandocError.hs b/src/Text/Pandoc/Lua/Marshal/PandocError.hs new file mode 100644 index 000000000..d1c0ad4f4 --- /dev/null +++ b/src/Text/Pandoc/Lua/Marshal/PandocError.hs @@ -0,0 +1,51 @@ +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} +{- | + Module : Text.Pandoc.Lua.Marshal.PandocError + Copyright : © 2020-2021 Albert Krewinkel + License : GNU GPL, version 2 or above + + Maintainer : Albert Krewinkel + Stability : alpha + +Marshal of @'PandocError'@ values. +-} +module Text.Pandoc.Lua.Marshal.PandocError + ( peekPandocError + , pushPandocError + , typePandocError + ) + where + +import HsLua.Core (LuaError) +import HsLua.Marshalling (Peeker, Pusher, pushString, liftLua) +import HsLua.Packaging +import Text.Pandoc.Error (PandocError (PandocLuaError)) + +import qualified HsLua as Lua +import qualified Text.Pandoc.UTF8 as UTF8 + +-- | Lua userdata type definition for PandocError. +typePandocError :: LuaError e => DocumentedType e PandocError +typePandocError = deftype "PandocError" + [ operation Tostring $ defun "__tostring" + ### liftPure (show @PandocError) + <#> udparam typePandocError "obj" "PandocError object" + =#> functionResult pushString "string" "string representation of error." + ] + mempty -- no members + +-- | Peek a @'PandocError'@ element to the Lua stack. +pushPandocError :: LuaError e => Pusher e PandocError +pushPandocError = pushUD typePandocError + +-- | Retrieve a @'PandocError'@ from the Lua stack. +peekPandocError :: LuaError e => Peeker e PandocError +peekPandocError idx = Lua.retrieving "PandocError" $ + liftLua (Lua.ltype idx) >>= \case + Lua.TypeUserdata -> peekUD typePandocError idx + _ -> do + msg <- liftLua $ Lua.state >>= \l -> Lua.liftIO (Lua.popErrorMessage l) + return $ PandocLuaError (UTF8.toText msg) diff --git a/src/Text/Pandoc/Lua/Marshal/ReaderOptions.hs b/src/Text/Pandoc/Lua/Marshal/ReaderOptions.hs new file mode 100644 index 000000000..c20770dba --- /dev/null +++ b/src/Text/Pandoc/Lua/Marshal/ReaderOptions.hs @@ -0,0 +1,133 @@ +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +{- | + Module : Text.Pandoc.Lua.Marshaling.ReaderOptions + Copyright : © 2012-2021 John MacFarlane + © 2017-2021 Albert Krewinkel + License : GNU GPL, version 2 or above + + Maintainer : Albert Krewinkel + Stability : alpha + +Marshaling instance for ReaderOptions and its components. +-} +module Text.Pandoc.Lua.Marshal.ReaderOptions + ( peekReaderOptions + , pushReaderOptions + , pushReaderOptionsReadonly + ) where + +import Data.Default (def) +import HsLua as Lua +import Text.Pandoc.Lua.Marshal.List (pushPandocList) +import Text.Pandoc.Options (ReaderOptions (..)) + +-- +-- Reader Options +-- + +-- | Retrieve a ReaderOptions value, either from a normal ReaderOptions +-- value, from a read-only object, or from a table with the same +-- keys as a ReaderOptions object. +peekReaderOptions :: LuaError e => Peeker e ReaderOptions +peekReaderOptions = retrieving "ReaderOptions" . \idx -> + liftLua (ltype idx) >>= \case + TypeUserdata -> choice [ peekUD typeReaderOptions + , peekUD typeReaderOptionsReadonly + ] + idx + TypeTable -> peekReaderOptionsTable idx + _ -> failPeek =<< + typeMismatchMessage "ReaderOptions userdata or table" idx + +-- | Pushes a ReaderOptions value as userdata object. +pushReaderOptions :: LuaError e => Pusher e ReaderOptions +pushReaderOptions = pushUD typeReaderOptions + +-- | Pushes a ReaderOptions object, but makes it read-only. +pushReaderOptionsReadonly :: LuaError e => Pusher e ReaderOptions +pushReaderOptionsReadonly = pushUD typeReaderOptionsReadonly + +-- | ReaderOptions object type for read-only values. +typeReaderOptionsReadonly :: LuaError e => DocumentedType e ReaderOptions +typeReaderOptionsReadonly = deftype "ReaderOptions (read-only)" + [ operation Tostring $ lambda + ### liftPure show + <#> udparam typeReaderOptions "opts" "options to print in native format" + =#> functionResult pushString "string" "Haskell representation" + , operation Newindex $ lambda + ### (failLua "This ReaderOptions value is read-only.") + =?> "Throws an error when called, i.e., an assignment is made." + ] + readerOptionsMembers + +-- | 'ReaderOptions' object type. +typeReaderOptions :: LuaError e => DocumentedType e ReaderOptions +typeReaderOptions = deftype "ReaderOptions" + [ operation Tostring $ lambda + ### liftPure show + <#> udparam typeReaderOptions "opts" "options to print in native format" + =#> functionResult pushString "string" "Haskell representation" + ] + readerOptionsMembers + +-- | Member properties of 'ReaderOptions' Lua values. +readerOptionsMembers :: LuaError e + => [Member e (DocumentedFunction e) ReaderOptions] +readerOptionsMembers = + [ property "abbreviations" "" + (pushSet pushText, readerAbbreviations) + (peekSet peekText, \opts x -> opts{ readerAbbreviations = x }) + , property "columns" "" + (pushIntegral, readerColumns) + (peekIntegral, \opts x -> opts{ readerColumns = x }) + , property "default_image_extension" "" + (pushText, readerDefaultImageExtension) + (peekText, \opts x -> opts{ readerDefaultImageExtension = x }) + , property "extensions" "" + (pushString . show, readerExtensions) + (peekRead, \opts x -> opts{ readerExtensions = x }) + , property "indented_code_classes" "" + (pushPandocList pushText, readerIndentedCodeClasses) + (peekList peekText, \opts x -> opts{ readerIndentedCodeClasses = x }) + , property "strip_comments" "" + (pushBool, readerStripComments) + (peekBool, \opts x -> opts{ readerStripComments = x }) + , property "standalone" "" + (pushBool, readerStandalone) + (peekBool, \opts x -> opts{ readerStandalone = x }) + , property "tab_stop" "" + (pushIntegral, readerTabStop) + (peekIntegral, \opts x -> opts{ readerTabStop = x }) + , property "track_changes" "" + (pushString . show, readerTrackChanges) + (peekRead, \opts x -> opts{ readerTrackChanges = x }) + ] + +-- | Retrieves a 'ReaderOptions' object from a table on the stack, using +-- the default values for all missing fields. +-- +-- Internally, this pushes the default reader options, sets each +-- key/value pair of the table in the userdata value, then retrieves the +-- object again. This will update all fields and complain about unknown +-- keys. +peekReaderOptionsTable :: LuaError e => Peeker e ReaderOptions +peekReaderOptionsTable idx = retrieving "ReaderOptions (table)" $ do + liftLua $ do + absidx <- absindex idx + pushUD typeReaderOptions def + let setFields = do + next absidx >>= \case + False -> return () -- all fields were copied + True -> do + pushvalue (nth 2) *> insert (nth 2) + settable (nth 4) -- set in userdata object + setFields + pushnil -- first key + setFields + peekUD typeReaderOptions top + +instance Pushable ReaderOptions where + push = pushReaderOptions diff --git a/src/Text/Pandoc/Lua/Marshaling.hs b/src/Text/Pandoc/Lua/Marshaling.hs deleted file mode 100644 index e217b8852..000000000 --- a/src/Text/Pandoc/Lua/Marshaling.hs +++ /dev/null @@ -1,19 +0,0 @@ -{- | - Module : Text.Pandoc.Lua.Marshaling - Copyright : © 2012-2021 John MacFarlane - © 2017-2021 Albert Krewinkel - License : GNU GPL, version 2 or above - - Maintainer : Albert Krewinkel - Stability : alpha - -Lua marshaling (pushing) and unmarshaling (peeking) instances. --} -module Text.Pandoc.Lua.Marshaling () where - -import Text.Pandoc.Lua.Marshaling.AST () -import Text.Pandoc.Lua.Marshaling.CommonState () -import Text.Pandoc.Lua.Marshaling.Context () -import Text.Pandoc.Lua.Marshaling.PandocError() -import Text.Pandoc.Lua.Marshaling.ReaderOptions () -import Text.Pandoc.Lua.ErrorConversion () diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs deleted file mode 100644 index 6a0e5d077..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ /dev/null @@ -1,868 +0,0 @@ -{-# OPTIONS_GHC -fno-warn-orphans #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TupleSections #-} -{-# LANGUAGE TypeApplications #-} -{- | - Module : Text.Pandoc.Lua.Marshaling.AST - Copyright : © 2012-2021 John MacFarlane - © 2017-2021 Albert Krewinkel - License : GNU GPL, version 2 or above - - Maintainer : Albert Krewinkel - Stability : alpha - -Marshaling/unmarshaling instances for document AST elements. --} -module Text.Pandoc.Lua.Marshaling.AST - ( peekAttr - , peekBlock - , peekBlockFuzzy - , peekBlocks - , peekBlocksFuzzy - , peekCaption - , peekCitation - , peekColSpec - , peekDefinitionItem - , peekFormat - , peekInline - , peekInlineFuzzy - , peekInlines - , peekInlinesFuzzy - , peekMeta - , peekMetaValue - , peekPandoc - , peekMathType - , peekQuoteType - , peekTableBody - , peekTableHead - , peekTableFoot - - , pushAttr - , pushBlock - , pushCitation - , pushInline - , pushInlines - , pushListAttributes - , pushMeta - , pushMetaValue - , pushPandoc - ) where - -import Control.Applicative ((<|>), optional) -import Control.Monad.Catch (throwM) -import Control.Monad ((<$!>)) -import Data.Data (showConstr, toConstr) -import Data.Text (Text) -import Data.Version (Version) -import HsLua hiding (Operation (Div)) -import HsLua.Module.Version (peekVersionFuzzy) -import Text.Pandoc.Definition -import Text.Pandoc.Error (PandocError (PandocLuaError)) -import Text.Pandoc.Lua.Util (pushViaConstr') -import Text.Pandoc.Lua.Marshaling.Attr (peekAttr, pushAttr) -import Text.Pandoc.Lua.Marshaling.List (pushPandocList) -import Text.Pandoc.Lua.Marshaling.ListAttributes - (peekListAttributes, pushListAttributes) - -import qualified HsLua as Lua -import qualified Text.Pandoc.Builder as B -import qualified Text.Pandoc.Lua.Util as LuaUtil - -instance Pushable Pandoc where - push = pushPandoc - -pushPandoc :: LuaError e => Pusher e Pandoc -pushPandoc = pushUD typePandoc - -peekPandoc :: LuaError e => Peeker e Pandoc -peekPandoc = retrieving "Pandoc value" . peekUD typePandoc - -typePandoc :: LuaError e => DocumentedType e Pandoc -typePandoc = deftype "Pandoc" - [ operation Eq $ defun "__eq" - ### liftPure2 (==) - <#> parameter (optional . peekPandoc) "doc1" "pandoc" "" - <#> parameter (optional . peekPandoc) "doc2" "pandoc" "" - =#> functionResult pushBool "boolean" "true iff the two values are equal" - , operation Tostring $ lambda - ### liftPure show - <#> parameter peekPandoc "Pandoc" "doc" "" - =#> functionResult pushString "string" "native Haskell representation" - ] - [ property "blocks" "list of blocks" - (pushPandocList pushBlock, \(Pandoc _ blks) -> blks) - (peekList peekBlock, \(Pandoc m _) blks -> Pandoc m blks) - , property "meta" "document metadata" - (pushMeta, \(Pandoc meta _) -> meta) - (peekMeta, \(Pandoc _ blks) meta -> Pandoc meta blks) - ] - -instance Pushable Meta where - push = pushMeta - -pushMeta :: LuaError e => Pusher e Meta -pushMeta (Meta mmap) = pushViaConstr' "Meta" [push mmap] - -peekMeta :: LuaError e => Peeker e Meta -peekMeta idx = retrieving "Meta" $ - Meta <$!> peekMap peekText peekMetaValue idx - -instance Pushable MetaValue where - push = pushMetaValue - -instance Pushable Block where - push = pushBlock - -typeCitation :: LuaError e => DocumentedType e Citation -typeCitation = deftype "Citation" - [ operation Eq $ lambda - ### liftPure2 (==) - <#> parameter (optional . peekCitation) "Citation" "a" "" - <#> parameter (optional . peekCitation) "Citation" "b" "" - =#> functionResult pushBool "boolean" "true iff the citations are equal" - - , operation Tostring $ lambda - ### liftPure show - <#> parameter peekCitation "Citation" "citation" "" - =#> functionResult pushString "string" "native Haskell representation" - ] - [ property "id" "citation ID / key" - (pushText, citationId) - (peekText, \citation cid -> citation{ citationId = cid }) - , property "mode" "citation mode" - (pushString . show, citationMode) - (peekRead, \citation mode -> citation{ citationMode = mode }) - , property "prefix" "citation prefix" - (pushInlines, citationPrefix) - (peekInlines, \citation prefix -> citation{ citationPrefix = prefix }) - , property "suffix" "citation suffix" - (pushInlines, citationSuffix) - (peekInlines, \citation suffix -> citation{ citationPrefix = suffix }) - , property "note_num" "note number" - (pushIntegral, citationNoteNum) - (peekIntegral, \citation noteNum -> citation{ citationNoteNum = noteNum }) - , property "hash" "hash number" - (pushIntegral, citationHash) - (peekIntegral, \citation hash -> citation{ citationHash = hash }) - , method $ defun "clone" ### return <#> udparam typeCitation "obj" "" - =#> functionResult pushCitation "Citation" "copy of obj" - ] - -pushCitation :: LuaError e => Pusher e Citation -pushCitation = pushUD typeCitation - -peekCitation :: LuaError e => Peeker e Citation -peekCitation = peekUD typeCitation - -instance Pushable Alignment where - push = Lua.pushString . show - -instance Pushable CitationMode where - push = Lua.push . show - -instance Pushable Format where - push = pushFormat - -pushFormat :: LuaError e => Pusher e Format -pushFormat (Format f) = pushText f - -peekFormat :: LuaError e => Peeker e Format -peekFormat idx = Format <$!> peekText idx - -instance Pushable ListNumberDelim where - push = Lua.push . show - -instance Pushable ListNumberStyle where - push = Lua.push . show - -instance Pushable MathType where - push = Lua.push . show - -instance Pushable QuoteType where - push = pushQuoteType - -pushMathType :: LuaError e => Pusher e MathType -pushMathType = pushString . show - -peekMathType :: LuaError e => Peeker e MathType -peekMathType = peekRead - -pushQuoteType :: LuaError e => Pusher e QuoteType -pushQuoteType = pushString . show - -peekQuoteType :: LuaError e => Peeker e QuoteType -peekQuoteType = peekRead - --- | Push an meta value element to the top of the lua stack. -pushMetaValue :: LuaError e => MetaValue -> LuaE e () -pushMetaValue = \case - MetaBlocks blcks -> pushViaConstr' "MetaBlocks" [pushList pushBlock blcks] - MetaBool bool -> Lua.push bool - MetaInlines inlns -> pushViaConstr' "MetaInlines" - [pushList pushInline inlns] - MetaList metalist -> pushViaConstr' "MetaList" - [pushList pushMetaValue metalist] - MetaMap metamap -> pushViaConstr' "MetaMap" - [pushMap pushText pushMetaValue metamap] - MetaString str -> Lua.push str - --- | Interpret the value at the given stack index as meta value. -peekMetaValue :: forall e. LuaError e => Peeker e MetaValue -peekMetaValue = retrieving "MetaValue $ " . \idx -> do - -- Get the contents of an AST element. - let mkMV :: (a -> MetaValue) -> Peeker e a -> Peek e MetaValue - mkMV f p = f <$!> p idx - - peekTagged = \case - "MetaBlocks" -> mkMV MetaBlocks $ - retrieving "MetaBlocks" . peekBlocks - "MetaBool" -> mkMV MetaBool $ - retrieving "MetaBool" . peekBool - "MetaMap" -> mkMV MetaMap $ - retrieving "MetaMap" . peekMap peekText peekMetaValue - "MetaInlines" -> mkMV MetaInlines $ - retrieving "MetaInlines" . peekInlines - "MetaList" -> mkMV MetaList $ - retrieving "MetaList" . peekList peekMetaValue - "MetaString" -> mkMV MetaString $ - retrieving "MetaString" . peekText - (Name t) -> failPeek ("Unknown meta tag: " <> t) - - peekUntagged = do - -- no meta value tag given, try to guess. - len <- liftLua $ Lua.rawlen idx - if len <= 0 - then MetaMap <$!> peekMap peekText peekMetaValue idx - else (MetaInlines <$!> peekInlines idx) - <|> (MetaBlocks <$!> peekBlocks idx) - <|> (MetaList <$!> peekList peekMetaValue idx) - luatype <- liftLua $ Lua.ltype idx - case luatype of - Lua.TypeBoolean -> MetaBool <$!> peekBool idx - Lua.TypeString -> MetaString <$!> peekText idx - Lua.TypeTable -> do - optional (LuaUtil.getTag idx) >>= \case - Just tag -> peekTagged tag - Nothing -> peekUntagged - Lua.TypeUserdata -> -- Allow singleton Inline or Block elements - (MetaInlines . (:[]) <$!> peekInline idx) <|> - (MetaBlocks . (:[]) <$!> peekBlock idx) - _ -> failPeek "could not get meta value" - -typeBlock :: LuaError e => DocumentedType e Block -typeBlock = deftype "Block" - [ operation Eq $ lambda - ### liftPure2 (==) - <#> parameter peekBlockFuzzy "Block" "a" "" - <#> parameter peekBlockFuzzy "Block" "b" "" - =#> boolResult "whether the two values are equal" - , operation Tostring $ lambda - ### liftPure show - <#> udparam typeBlock "self" "" - =#> functionResult pushString "string" "Haskell representation" - ] - [ possibleProperty "attr" "element attributes" - (pushAttr, \case - CodeBlock attr _ -> Actual attr - Div attr _ -> Actual attr - Header _ attr _ -> Actual attr - Table attr _ _ _ _ _ -> Actual attr - _ -> Absent) - (peekAttr, \case - CodeBlock _ code -> Actual . flip CodeBlock code - Div _ blks -> Actual . flip Div blks - Header lvl _ blks -> Actual . (\attr -> Header lvl attr blks) - Table _ c cs h bs f -> Actual . (\attr -> Table attr c cs h bs f) - _ -> const Absent) - , possibleProperty "bodies" "table bodies" - (pushPandocList pushTableBody, \case - Table _ _ _ _ bs _ -> Actual bs - _ -> Absent) - (peekList peekTableBody, \case - Table attr c cs h _ f -> Actual . (\bs -> Table attr c cs h bs f) - _ -> const Absent) - , possibleProperty "caption" "element caption" - (pushCaption, \case {Table _ capt _ _ _ _ -> Actual capt; _ -> Absent}) - (peekCaption, \case - Table attr _ cs h bs f -> Actual . (\c -> Table attr c cs h bs f) - _ -> const Absent) - , possibleProperty "colspecs" "column alignments and widths" - (pushPandocList pushColSpec, \case - Table _ _ cs _ _ _ -> Actual cs - _ -> Absent) - (peekList peekColSpec, \case - Table attr c _ h bs f -> Actual . (\cs -> Table attr c cs h bs f) - _ -> const Absent) - , possibleProperty "content" "element content" - (pushContent, getBlockContent) - (peekContent, setBlockContent) - , possibleProperty "foot" "table foot" - (pushTableFoot, \case {Table _ _ _ _ _ f -> Actual f; _ -> Absent}) - (peekTableFoot, \case - Table attr c cs h bs _ -> Actual . (\f -> Table attr c cs h bs f) - _ -> const Absent) - , possibleProperty "format" "format of raw content" - (pushFormat, \case {RawBlock f _ -> Actual f; _ -> Absent}) - (peekFormat, \case - RawBlock _ txt -> Actual . (`RawBlock` txt) - _ -> const Absent) - , possibleProperty "head" "table head" - (pushTableHead, \case {Table _ _ _ h _ _ -> Actual h; _ -> Absent}) - (peekTableHead, \case - Table attr c cs _ bs f -> Actual . (\h -> Table attr c cs h bs f) - _ -> const Absent) - , possibleProperty "level" "heading level" - (pushIntegral, \case {Header lvl _ _ -> Actual lvl; _ -> Absent}) - (peekIntegral, \case - Header _ attr inlns -> Actual . \lvl -> Header lvl attr inlns - _ -> const Absent) - , possibleProperty "listAttributes" "ordered list attributes" - (pushListAttributes, \case - OrderedList listAttr _ -> Actual listAttr - _ -> Absent) - (peekListAttributes, \case - OrderedList _ content -> Actual . (`OrderedList` content) - _ -> const Absent) - , possibleProperty "text" "text contents" - (pushText, getBlockText) - (peekText, setBlockText) - - , readonly "tag" "type of Block" - (pushString, showConstr . toConstr ) - - , alias "t" "tag" ["tag"] - , alias "c" "content" ["content"] - , alias "identifier" "element identifier" ["attr", "identifier"] - , alias "classes" "element classes" ["attr", "classes"] - , alias "attributes" "other element attributes" ["attr", "attributes"] - , alias "start" "ordered list start number" ["listAttributes", "start"] - , alias "style" "ordered list style" ["listAttributes", "style"] - , alias "delimiter" "numbering delimiter" ["listAttributes", "delimiter"] - - , method $ defun "clone" - ### return - <#> parameter peekBlock "Block" "block" "self" - =#> functionResult pushBlock "Block" "cloned Block" - - , method $ defun "show" - ### liftPure show - <#> parameter peekBlock "Block" "self" "" - =#> functionResult pushString "string" "Haskell string representation" - ] - where - boolResult = functionResult pushBool "boolean" - -getBlockContent :: Block -> Possible Content -getBlockContent = \case - -- inline content - Para inlns -> Actual $ ContentInlines inlns - Plain inlns -> Actual $ ContentInlines inlns - Header _ _ inlns -> Actual $ ContentInlines inlns - -- inline content - BlockQuote blks -> Actual $ ContentBlocks blks - Div _ blks -> Actual $ ContentBlocks blks - -- lines content - LineBlock lns -> Actual $ ContentLines lns - -- list items content - BulletList itms -> Actual $ ContentListItems itms - OrderedList _ itms -> Actual $ ContentListItems itms - -- definition items content - DefinitionList itms -> Actual $ ContentDefItems itms - _ -> Absent - -setBlockContent :: Block -> Content -> Possible Block -setBlockContent = \case - -- inline content - Para _ -> Actual . Para . inlineContent - Plain _ -> Actual . Plain . inlineContent - Header attr lvl _ -> Actual . Header attr lvl . inlineContent - -- block content - BlockQuote _ -> Actual . BlockQuote . blockContent - Div attr _ -> Actual . Div attr . blockContent - -- lines content - LineBlock _ -> Actual . LineBlock . lineContent - -- list items content - BulletList _ -> Actual . BulletList . listItemContent - OrderedList la _ -> Actual . OrderedList la . listItemContent - -- definition items content - DefinitionList _ -> Actual . DefinitionList . defItemContent - _ -> const Absent - where - inlineContent = \case - ContentInlines inlns -> inlns - c -> throwM . PandocLuaError $ "expected Inlines, got " <> - contentTypeDescription c - blockContent = \case - ContentBlocks blks -> blks - ContentInlines inlns -> [Plain inlns] - c -> throwM . PandocLuaError $ "expected Blocks, got " <> - contentTypeDescription c - lineContent = \case - ContentLines lns -> lns - c -> throwM . PandocLuaError $ "expected list of lines, got " <> - contentTypeDescription c - defItemContent = \case - ContentDefItems itms -> itms - c -> throwM . PandocLuaError $ "expected definition items, got " <> - contentTypeDescription c - listItemContent = \case - ContentBlocks blks -> [blks] - ContentLines lns -> map ((:[]) . Plain) lns - ContentListItems itms -> itms - c -> throwM . PandocLuaError $ "expected list of items, got " <> - contentTypeDescription c - -getBlockText :: Block -> Possible Text -getBlockText = \case - CodeBlock _ lst -> Actual lst - RawBlock _ raw -> Actual raw - _ -> Absent - -setBlockText :: Block -> Text -> Possible Block -setBlockText = \case - CodeBlock attr _ -> Actual . CodeBlock attr - RawBlock f _ -> Actual . RawBlock f - _ -> const Absent - --- | Push a block element to the top of the Lua stack. -pushBlock :: forall e. LuaError e => Block -> LuaE e () -pushBlock = pushUD typeBlock - --- | Return the value at the given index as block if possible. -peekBlock :: forall e. LuaError e => Peeker e Block -peekBlock = retrieving "Block" . peekUD typeBlock - --- | Retrieves a list of Block elements. -peekBlocks :: LuaError e => Peeker e [Block] -peekBlocks = peekList peekBlock - -peekInlines :: LuaError e => Peeker e [Inline] -peekInlines = peekList peekInline - -pushInlines :: LuaError e => Pusher e [Inline] -pushInlines = pushPandocList pushInline - --- | Retrieves a single definition item from a the stack; it is expected --- to be a pair of a list of inlines and a list of list of blocks. Uses --- fuzzy parsing, i.e., tries hard to convert mismatching types into the --- expected result. -peekDefinitionItem :: LuaError e => Peeker e ([Inline], [[Block]]) -peekDefinitionItem = peekPair peekInlinesFuzzy $ choice - [ peekList peekBlocksFuzzy - , \idx -> (:[]) <$!> peekBlocksFuzzy idx - ] - --- | Push Caption element -pushCaption :: LuaError e => Caption -> LuaE e () -pushCaption (Caption shortCaption longCaption) = do - Lua.newtable - LuaUtil.addField "short" (Lua.Optional shortCaption) - LuaUtil.addField "long" longCaption - --- | Peek Caption element -peekCaption :: LuaError e => Peeker e Caption -peekCaption = retrieving "Caption" . \idx -> do - short <- optional $ peekFieldRaw peekInlines "short" idx - long <- peekFieldRaw peekBlocks "long" idx - return $! Caption short long - --- | Push a ColSpec value as a pair of Alignment and ColWidth. -pushColSpec :: LuaError e => Pusher e ColSpec -pushColSpec = pushPair (pushString . show) pushColWidth - --- | Peek a ColSpec value as a pair of Alignment and ColWidth. -peekColSpec :: LuaError e => Peeker e ColSpec -peekColSpec = peekPair peekRead peekColWidth - -peekColWidth :: LuaError e => Peeker e ColWidth -peekColWidth = retrieving "ColWidth" . \idx -> do - maybe ColWidthDefault ColWidth <$!> optional (peekRealFloat idx) - --- | Push a ColWidth value by pushing the width as a plain number, or --- @nil@ for ColWidthDefault. -pushColWidth :: LuaError e => Pusher e ColWidth -pushColWidth = \case - (ColWidth w) -> Lua.push w - ColWidthDefault -> Lua.pushnil - --- | Push a table row as a pair of attr and the list of cells. -pushRow :: LuaError e => Pusher e Row -pushRow (Row attr cells) = - pushPair pushAttr (pushPandocList pushCell) (attr, cells) - --- | Push a table row from a pair of attr and the list of cells. -peekRow :: LuaError e => Peeker e Row -peekRow = ((uncurry Row) <$!>) - . retrieving "Row" - . peekPair peekAttr (peekList peekCell) - --- | Pushes a 'TableBody' value as a Lua table with fields @attr@, --- @row_head_columns@, @head@, and @body@. -pushTableBody :: LuaError e => Pusher e TableBody -pushTableBody (TableBody attr (RowHeadColumns rowHeadColumns) head' body) = do - Lua.newtable - LuaUtil.addField "attr" attr - LuaUtil.addField "row_head_columns" rowHeadColumns - LuaUtil.addField "head" head' - LuaUtil.addField "body" body - --- | Retrieves a 'TableBody' value from a Lua table with fields @attr@, --- @row_head_columns@, @head@, and @body@. -peekTableBody :: LuaError e => Peeker e TableBody -peekTableBody = fmap (retrieving "TableBody") - . typeChecked "table" Lua.istable - $ \idx -> TableBody - <$!> peekFieldRaw peekAttr "attr" idx - <*> peekFieldRaw ((fmap RowHeadColumns) . peekIntegral) "row_head_columns" idx - <*> peekFieldRaw (peekList peekRow) "head" idx - <*> peekFieldRaw (peekList peekRow) "body" idx - --- | Push a table head value as the pair of its Attr and rows. -pushTableHead :: LuaError e => Pusher e TableHead -pushTableHead (TableHead attr rows) = - pushPair pushAttr (pushPandocList pushRow) (attr, rows) - --- | Peek a table head value from a pair of Attr and rows. -peekTableHead :: LuaError e => Peeker e TableHead -peekTableHead = ((uncurry TableHead) <$!>) - . retrieving "TableHead" - . peekPair peekAttr (peekList peekRow) - --- | Pushes a 'TableFoot' value as a pair of the Attr value and the list --- of table rows. -pushTableFoot :: LuaError e => Pusher e TableFoot -pushTableFoot (TableFoot attr rows) = - pushPair pushAttr (pushPandocList pushRow) (attr, rows) - --- | Retrieves a 'TableFoot' value from a pair containing an Attr value --- and a list of table rows. -peekTableFoot :: LuaError e => Peeker e TableFoot -peekTableFoot = ((uncurry TableFoot) <$!>) - . retrieving "TableFoot" - . peekPair peekAttr (peekList peekRow) - -instance Pushable Cell where - push = pushCell - -instance Peekable Cell where - peek = forcePeek . peekCell - --- | Push a table cell as a table with fields @attr@, @alignment@, --- @row_span@, @col_span@, and @contents@. -pushCell :: LuaError e => Cell -> LuaE e () -pushCell (Cell attr align (RowSpan rowSpan) (ColSpan colSpan) contents) = do - Lua.newtable - LuaUtil.addField "attr" attr - LuaUtil.addField "alignment" align - LuaUtil.addField "row_span" rowSpan - LuaUtil.addField "col_span" colSpan - LuaUtil.addField "contents" contents - -peekCell :: LuaError e => Peeker e Cell -peekCell = fmap (retrieving "Cell") - . typeChecked "table" Lua.istable - $ \idx -> do - attr <- peekFieldRaw peekAttr "attr" idx - algn <- peekFieldRaw peekRead "alignment" idx - rs <- RowSpan <$!> peekFieldRaw peekIntegral "row_span" idx - cs <- ColSpan <$!> peekFieldRaw peekIntegral "col_span" idx - blks <- peekFieldRaw peekBlocks "contents" idx - return $! Cell attr algn rs cs blks - -getInlineText :: Inline -> Possible Text -getInlineText = \case - Code _ lst -> Actual lst - Math _ str -> Actual str - RawInline _ raw -> Actual raw - Str s -> Actual s - _ -> Absent - -setInlineText :: Inline -> Text -> Possible Inline -setInlineText = \case - Code attr _ -> Actual . Code attr - Math mt _ -> Actual . Math mt - RawInline f _ -> Actual . RawInline f - Str _ -> Actual . Str - _ -> const Absent - --- | Helper type to represent all the different types a `content` --- attribute can have. -data Content - = ContentBlocks [Block] - | ContentInlines [Inline] - | ContentLines [[Inline]] - | ContentDefItems [([Inline], [[Block]])] - | ContentListItems [[Block]] - -contentTypeDescription :: Content -> Text -contentTypeDescription = \case - ContentBlocks {} -> "list of Block items" - ContentInlines {} -> "list of Inline items" - ContentLines {} -> "list of Inline lists (i.e., a list of lines)" - ContentDefItems {} -> "list of definition items items" - ContentListItems {} -> "list items (i.e., list of list of Block elements)" - -pushContent :: LuaError e => Pusher e Content -pushContent = \case - ContentBlocks blks -> pushPandocList pushBlock blks - ContentInlines inlns -> pushPandocList pushInline inlns - ContentLines lns -> pushPandocList (pushPandocList pushInline) lns - ContentDefItems itms -> - let pushItem = pushPair (pushPandocList pushInline) - (pushPandocList (pushPandocList pushBlock)) - in pushPandocList pushItem itms - ContentListItems itms -> - pushPandocList (pushPandocList pushBlock) itms - -peekContent :: LuaError e => Peeker e Content -peekContent idx = - (ContentInlines <$!> peekInlinesFuzzy idx) <|> - (ContentLines <$!> peekList (peekList peekInlineFuzzy) idx) <|> - (ContentBlocks <$!> peekBlocksFuzzy idx ) <|> - (ContentListItems <$!> peekList peekBlocksFuzzy idx) <|> - (ContentDefItems <$!> peekList (peekDefinitionItem) idx) - -setInlineContent :: Inline -> Content -> Possible Inline -setInlineContent = \case - -- inline content - Cite cs _ -> Actual . Cite cs . inlineContent - Emph _ -> Actual . Emph . inlineContent - Link a _ tgt -> Actual . (\inlns -> Link a inlns tgt) . inlineContent - Quoted qt _ -> Actual . Quoted qt . inlineContent - SmallCaps _ -> Actual . SmallCaps . inlineContent - Span attr _ -> Actual . Span attr . inlineContent - Strikeout _ -> Actual . Strikeout . inlineContent - Strong _ -> Actual . Strong . inlineContent - Subscript _ -> Actual . Subscript . inlineContent - Superscript _ -> Actual . Superscript . inlineContent - Underline _ -> Actual . Underline . inlineContent - -- block content - Note _ -> Actual . Note . blockContent - _ -> const Absent - where - inlineContent = \case - ContentInlines inlns -> inlns - c -> throwM . PandocLuaError $ "expected Inlines, got " <> - contentTypeDescription c - blockContent = \case - ContentBlocks blks -> blks - ContentInlines [] -> [] - c -> throwM . PandocLuaError $ "expected Blocks, got " <> - contentTypeDescription c - -getInlineContent :: Inline -> Possible Content -getInlineContent = \case - Cite _ inlns -> Actual $ ContentInlines inlns - Emph inlns -> Actual $ ContentInlines inlns - Link _ inlns _ -> Actual $ ContentInlines inlns - Quoted _ inlns -> Actual $ ContentInlines inlns - SmallCaps inlns -> Actual $ ContentInlines inlns - Span _ inlns -> Actual $ ContentInlines inlns - Strikeout inlns -> Actual $ ContentInlines inlns - Strong inlns -> Actual $ ContentInlines inlns - Subscript inlns -> Actual $ ContentInlines inlns - Superscript inlns -> Actual $ ContentInlines inlns - Underline inlns -> Actual $ ContentInlines inlns - Note blks -> Actual $ ContentBlocks blks - _ -> Absent - --- title -getInlineTitle :: Inline -> Possible Text -getInlineTitle = \case - Image _ _ (_, tit) -> Actual tit - Link _ _ (_, tit) -> Actual tit - _ -> Absent - -setInlineTitle :: Inline -> Text -> Possible Inline -setInlineTitle = \case - Image attr capt (src, _) -> Actual . Image attr capt . (src,) - Link attr capt (src, _) -> Actual . Link attr capt . (src,) - _ -> const Absent - --- attr -getInlineAttr :: Inline -> Possible Attr -getInlineAttr = \case - Code attr _ -> Actual attr - Image attr _ _ -> Actual attr - Link attr _ _ -> Actual attr - Span attr _ -> Actual attr - _ -> Absent - -setInlineAttr :: Inline -> Attr -> Possible Inline -setInlineAttr = \case - Code _ cs -> Actual . (`Code` cs) - Image _ cpt tgt -> Actual . \attr -> Image attr cpt tgt - Link _ cpt tgt -> Actual . \attr -> Link attr cpt tgt - Span _ inlns -> Actual . (`Span` inlns) - _ -> const Absent - -showInline :: LuaError e => DocumentedFunction e -showInline = defun "show" - ### liftPure (show @Inline) - <#> parameter peekInline "inline" "Inline" "Object" - =#> functionResult pushString "string" "stringified Inline" - -typeInline :: LuaError e => DocumentedType e Inline -typeInline = deftype "Inline" - [ operation Tostring showInline - , operation Eq $ defun "__eq" - ### liftPure2 (==) - <#> parameter peekInline "a" "Inline" "" - <#> parameter peekInline "b" "Inline" "" - =#> functionResult pushBool "boolean" "whether the two are equal" - ] - [ possibleProperty "attr" "element attributes" - (pushAttr, getInlineAttr) - (peekAttr, setInlineAttr) - , possibleProperty "caption" "image caption" - (pushPandocList pushInline, \case - Image _ capt _ -> Actual capt - _ -> Absent) - (peekInlinesFuzzy, \case - Image attr _ target -> Actual . (\capt -> Image attr capt target) - _ -> const Absent) - , possibleProperty "citations" "list of citations" - (pushPandocList pushCitation, \case {Cite cs _ -> Actual cs; _ -> Absent}) - (peekList peekCitation, \case - Cite _ inlns -> Actual . (`Cite` inlns) - _ -> const Absent) - , possibleProperty "content" "element contents" - (pushContent, getInlineContent) - (peekContent, setInlineContent) - , possibleProperty "format" "format of raw text" - (pushFormat, \case {RawInline fmt _ -> Actual fmt; _ -> Absent}) - (peekFormat, \case - RawInline _ txt -> Actual . (`RawInline` txt) - _ -> const Absent) - , possibleProperty "mathtype" "math rendering method" - (pushMathType, \case {Math mt _ -> Actual mt; _ -> Absent}) - (peekMathType, \case - Math _ txt -> Actual . (`Math` txt) - _ -> const Absent) - , possibleProperty "quotetype" "type of quotes (single or double)" - (pushQuoteType, \case {Quoted qt _ -> Actual qt; _ -> Absent}) - (peekQuoteType, \case - Quoted _ inlns -> Actual . (`Quoted` inlns) - _ -> const Absent) - , possibleProperty "src" "image source" - (pushText, \case - Image _ _ (src, _) -> Actual src - _ -> Absent) - (peekText, \case - Image attr capt (_, title) -> Actual . Image attr capt . (,title) - _ -> const Absent) - , possibleProperty "target" "link target URL" - (pushText, \case - Link _ _ (tgt, _) -> Actual tgt - _ -> Absent) - (peekText, \case - Link attr capt (_, title) -> Actual . Link attr capt . (,title) - _ -> const Absent) - , possibleProperty "title" "title text" - (pushText, getInlineTitle) - (peekText, setInlineTitle) - , possibleProperty "text" "text contents" - (pushText, getInlineText) - (peekText, setInlineText) - , readonly "tag" "type of Inline" - (pushString, showConstr . toConstr ) - - , alias "t" "tag" ["tag"] - , alias "c" "content" ["content"] - , alias "identifier" "element identifier" ["attr", "identifier"] - , alias "classes" "element classes" ["attr", "classes"] - , alias "attributes" "other element attributes" ["attr", "attributes"] - - , method $ defun "clone" - ### return - <#> parameter peekInline "inline" "Inline" "self" - =#> functionResult pushInline "Inline" "cloned Inline" - ] - --- | Push an inline element to the top of the lua stack. -pushInline :: forall e. LuaError e => Inline -> LuaE e () -pushInline = pushUD typeInline - --- | Return the value at the given index as inline if possible. -peekInline :: forall e. LuaError e => Peeker e Inline -peekInline = retrieving "Inline" . \idx -> peekUD typeInline idx - --- | Try extra hard to retrieve an Inline value from the stack. Treats --- bare strings as @Str@ values. -peekInlineFuzzy :: LuaError e => Peeker e Inline -peekInlineFuzzy = retrieving "Inline" . choice - [ peekUD typeInline - , \idx -> Str <$!> peekText idx - ] - --- | Try extra-hard to return the value at the given index as a list of --- inlines. -peekInlinesFuzzy :: LuaError e => Peeker e [Inline] -peekInlinesFuzzy idx = liftLua (ltype idx) >>= \case - TypeString -> B.toList . B.text <$> peekText idx - _ -> choice - [ peekList peekInlineFuzzy - , fmap pure . peekInlineFuzzy - ] idx - --- | Try extra hard to retrieve a Block value from the stack. Treats bar --- Inline elements as if they were wrapped in 'Plain'. -peekBlockFuzzy :: LuaError e => Peeker e Block -peekBlockFuzzy = choice - [ peekBlock - , (\idx -> Plain <$!> peekInlinesFuzzy idx) - ] - --- | Try extra-hard to return the value at the given index as a list of --- blocks. -peekBlocksFuzzy :: LuaError e => Peeker e [Block] -peekBlocksFuzzy = choice - [ peekList peekBlockFuzzy - , (<$!>) pure . peekBlockFuzzy - ] - --- * Orphan Instances - -instance Pushable Inline where - push = pushInline - -instance Pushable Citation where - push = pushCitation - -instance Pushable Row where - push = pushRow - -instance Pushable TableBody where - push = pushTableBody - -instance Pushable TableFoot where - push = pushTableFoot - -instance Pushable TableHead where - push = pushTableHead - --- These instances exist only for testing. It's a hack to avoid making --- the marshalling modules public. -instance Peekable Inline where - peek = forcePeek . peekInline - -instance Peekable Block where - peek = forcePeek . peekBlock - -instance Peekable Meta where - peek = forcePeek . peekMeta - -instance Peekable Pandoc where - peek = forcePeek . peekPandoc - -instance Peekable Row where - peek = forcePeek . peekRow - -instance Peekable Version where - peek = forcePeek . peekVersionFuzzy - -instance {-# OVERLAPPING #-} Peekable Attr where - peek = forcePeek . peekAttr diff --git a/src/Text/Pandoc/Lua/Marshaling/Attr.hs b/src/Text/Pandoc/Lua/Marshaling/Attr.hs deleted file mode 100644 index 97e702e35..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/Attr.hs +++ /dev/null @@ -1,237 +0,0 @@ -{-# LANGUAGE BangPatterns #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TupleSections #-} -{-# LANGUAGE TypeApplications #-} -{- | -Module : Text.Pandoc.Lua.Marshaling.Attr -Copyright : © 2012-2021 John MacFarlane - © 2017-2021 Albert Krewinkel -License : GNU GPL, version 2 or above - -Maintainer : Albert Krewinkel -Stability : alpha - -Marshaling/unmarshaling instances for document AST elements. --} -module Text.Pandoc.Lua.Marshaling.Attr - ( typeAttr - , peekAttr - , pushAttr - , mkAttr - , mkAttributeList - ) where - -import Control.Applicative ((<|>), optional) -import Control.Monad ((<$!>)) -import Data.Maybe (fromMaybe) -import Data.Text (Text) -import HsLua -import HsLua.Marshalling.Peekers (peekIndexRaw) -import Safe (atMay) -import Text.Pandoc.Definition (Attr, nullAttr) -import Text.Pandoc.Lua.Marshaling.List (pushPandocList) - -import qualified Data.Text as T - -typeAttr :: LuaError e => DocumentedType e Attr -typeAttr = deftype "Attr" - [ operation Eq $ lambda - ### liftPure2 (==) - <#> parameter peekAttr "a1" "Attr" "" - <#> parameter peekAttr "a2" "Attr" "" - =#> functionResult pushBool "boolean" "whether the two are equal" - , operation Tostring $ lambda - ### liftPure show - <#> parameter peekAttr "Attr" "attr" "" - =#> functionResult pushString "string" "native Haskell representation" - ] - [ property "identifier" "element identifier" - (pushText, \(ident,_,_) -> ident) - (peekText, \(_,cls,kv) -> (,cls,kv)) - , property "classes" "element classes" - (pushPandocList pushText, \(_,classes,_) -> classes) - (peekList peekText, \(ident,_,kv) -> (ident,,kv)) - , property "attributes" "various element attributes" - (pushAttribs, \(_,_,attribs) -> attribs) - (peekAttribs, \(ident,cls,_) -> (ident,cls,)) - , method $ defun "clone" - ### return - <#> parameter peekAttr "attr" "Attr" "" - =#> functionResult pushAttr "Attr" "new Attr element" - , readonly "tag" "element type tag (always 'Attr')" - (pushText, const "Attr") - - , alias "t" "alias for `tag`" ["tag"] - ] - -pushAttr :: LuaError e => Pusher e Attr -pushAttr = pushUD typeAttr - -peekAttribs :: LuaError e => Peeker e [(Text,Text)] -peekAttribs idx = liftLua (ltype idx) >>= \case - TypeUserdata -> peekUD typeAttributeList idx - TypeTable -> liftLua (rawlen idx) >>= \case - 0 -> peekKeyValuePairs peekText peekText idx - _ -> peekList (peekPair peekText peekText) idx - _ -> failPeek "unsupported type" - -pushAttribs :: LuaError e => Pusher e [(Text, Text)] -pushAttribs = pushUD typeAttributeList - -typeAttributeList :: LuaError e => DocumentedType e [(Text, Text)] -typeAttributeList = deftype "AttributeList" - [ operation Eq $ lambda - ### liftPure2 (==) - <#> parameter peekAttribs "a1" "AttributeList" "" - <#> parameter peekAttribs "a2" "AttributeList" "" - =#> functionResult pushBool "boolean" "whether the two are equal" - - , operation Index $ lambda - ### liftPure2 lookupKey - <#> udparam typeAttributeList "t" "attributes list" - <#> parameter peekKey "string|integer" "key" "lookup key" - =#> functionResult (maybe pushnil pushAttribute) "string|table" - "attribute value" - - , operation Newindex $ lambda - ### setKey - <#> udparam typeAttributeList "t" "attributes list" - <#> parameter peekKey "string|integer" "key" "lookup key" - <#> optionalParameter peekAttribute "string|nil" "value" "new value" - =#> [] - - , operation Len $ lambda - ### liftPure length - <#> udparam typeAttributeList "t" "attributes list" - =#> functionResult pushIntegral "integer" "number of attributes in list" - - , operation Pairs $ lambda - ### pushIterator (\(k, v) -> 2 <$ pushText k <* pushText v) - <#> udparam typeAttributeList "t" "attributes list" - =?> "iterator triple" - - , operation Tostring $ lambda - ### liftPure show - <#> udparam typeAttributeList "t" "attributes list" - =#> functionResult pushString "string" "" - ] - [] - -data Key = StringKey Text | IntKey Int - -peekKey :: LuaError e => Peeker e (Maybe Key) -peekKey idx = liftLua (ltype idx) >>= \case - TypeNumber -> Just . IntKey <$!> peekIntegral idx - TypeString -> Just . StringKey <$!> peekText idx - _ -> return Nothing - -data Attribute - = AttributePair (Text, Text) - | AttributeValue Text - -pushAttribute :: LuaError e => Pusher e Attribute -pushAttribute = \case - (AttributePair kv) -> pushPair pushText pushText kv - (AttributeValue v) -> pushText v - --- | Retrieve an 'Attribute'. -peekAttribute :: LuaError e => Peeker e Attribute -peekAttribute idx = (AttributeValue <$!> peekText idx) - <|> (AttributePair <$!> peekPair peekText peekText idx) - -lookupKey :: [(Text,Text)] -> Maybe Key -> Maybe Attribute -lookupKey !kvs = \case - Just (StringKey str) -> AttributeValue <$!> lookup str kvs - Just (IntKey n) -> AttributePair <$!> atMay kvs (n - 1) - Nothing -> Nothing - -setKey :: forall e. LuaError e - => [(Text, Text)] -> Maybe Key -> Maybe Attribute - -> LuaE e () -setKey kvs mbKey mbValue = case mbKey of - Just (StringKey str) -> - case break ((== str) . fst) kvs of - (prefix, _:suffix) -> case mbValue of - Nothing -> setNew $ prefix ++ suffix - Just (AttributeValue value) -> setNew $ prefix ++ (str, value):suffix - _ -> failLua "invalid attribute value" - _ -> case mbValue of - Nothing -> return () - Just (AttributeValue value) -> setNew (kvs ++ [(str, value)]) - _ -> failLua "invalid attribute value" - Just (IntKey idx) -> - case splitAt (idx - 1) kvs of - (prefix, (k,_):suffix) -> setNew $ case mbValue of - Nothing -> prefix ++ suffix - Just (AttributePair kv) -> prefix ++ kv : suffix - Just (AttributeValue v) -> prefix ++ (k, v) : suffix - (prefix, []) -> case mbValue of - Nothing -> setNew prefix - Just (AttributePair kv) -> setNew $ prefix ++ [kv] - _ -> failLua $ "trying to set an attribute key-value pair, " - ++ "but got a single string instead." - - _ -> failLua "invalid attribute key" - where - setNew :: [(Text, Text)] -> LuaE e () - setNew new = - putuserdata (nthBottom 1) (udName @e typeAttributeList) new >>= \case - True -> return () - False -> failLua "failed to modify attributes list" - -peekAttr :: LuaError e => Peeker e Attr -peekAttr idx = retrieving "Attr" $ liftLua (ltype idx) >>= \case - TypeString -> (,[],[]) <$!> peekText idx -- treat string as ID - TypeUserdata -> peekUD typeAttr idx - TypeTable -> peekAttrTable idx - x -> liftLua . failLua $ "Cannot get Attr from " ++ show x - --- | Helper function which gets an Attr from a Lua table. -peekAttrTable :: LuaError e => Peeker e Attr -peekAttrTable idx = do - len' <- liftLua $ rawlen idx - let peekClasses = peekList peekText - if len' > 0 - then do - ident <- peekIndexRaw 1 peekText idx - classes <- fromMaybe [] <$!> optional (peekIndexRaw 2 peekClasses idx) - attribs <- fromMaybe [] <$!> optional (peekIndexRaw 3 peekAttribs idx) - return $ ident `seq` classes `seq` attribs `seq` - (ident, classes, attribs) - else retrieving "HTML-like attributes" $ do - kvs <- peekKeyValuePairs peekText peekText idx - let ident = fromMaybe "" $ lookup "id" kvs - let classes = maybe [] T.words $ lookup "class" kvs - let attribs = filter ((`notElem` ["id", "class"]) . fst) kvs - return $ ident `seq` classes `seq` attribs `seq` - (ident, classes, attribs) - --- | Constructor for 'Attr'. -mkAttr :: LuaError e => DocumentedFunction e -mkAttr = defun "Attr" - ### (ltype (nthBottom 1) >>= \case - TypeString -> forcePeek $ do - mident <- optional (peekText (nthBottom 1)) - mclass <- optional (peekList peekText (nthBottom 2)) - mattribs <- optional (peekAttribs (nthBottom 3)) - return ( fromMaybe "" mident - , fromMaybe [] mclass - , fromMaybe [] mattribs) - TypeTable -> forcePeek $ peekAttrTable (nthBottom 1) - TypeUserdata -> forcePeek $ peekUD typeAttr (nthBottom 1) <|> do - attrList <- peekUD typeAttributeList (nthBottom 1) - return ("", [], attrList) - TypeNil -> pure nullAttr - TypeNone -> pure nullAttr - x -> failLua $ "Cannot create Attr from " ++ show x) - =#> functionResult pushAttr "Attr" "new Attr object" - --- | Constructor for 'AttributeList'. -mkAttributeList :: LuaError e => DocumentedFunction e -mkAttributeList = defun "AttributeList" - ### return - <#> parameter peekAttribs "table|AttributeList" "attribs" "an attribute list" - =#> functionResult (pushUD typeAttributeList) "AttributeList" - "new AttributeList object" diff --git a/src/Text/Pandoc/Lua/Marshaling/CommonState.hs b/src/Text/Pandoc/Lua/Marshaling/CommonState.hs deleted file mode 100644 index 857551598..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/CommonState.hs +++ /dev/null @@ -1,70 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -{- | - Module : Text.Pandoc.Lua.Marshaling.CommonState - Copyright : © 2012-2021 John MacFarlane - © 2017-2021 Albert Krewinkel - License : GNU GPL, version 2 or above - Maintainer : Albert Krewinkel - Stability : alpha - -Instances to marshal (push) and unmarshal (peek) the common state. --} -module Text.Pandoc.Lua.Marshaling.CommonState - ( typeCommonState - , peekCommonState - , pushCommonState - ) where - -import HsLua.Core -import HsLua.Marshalling -import HsLua.Packaging -import Text.Pandoc.Class (CommonState (..)) -import Text.Pandoc.Logging (LogMessage, showLogMessage) -import Text.Pandoc.Lua.Marshaling.List (pushPandocList) - --- | Lua type used for the @CommonState@ object. -typeCommonState :: LuaError e => DocumentedType e CommonState -typeCommonState = deftype "pandoc CommonState" [] - [ readonly "input_files" "input files passed to pandoc" - (pushPandocList pushString, stInputFiles) - - , readonly "output_file" "the file to which pandoc will write" - (maybe pushnil pushString, stOutputFile) - - , readonly "log" "list of log messages" - (pushPandocList (pushUD typeLogMessage), stLog) - - , readonly "request_headers" "headers to add for HTTP requests" - (pushPandocList (pushPair pushText pushText), stRequestHeaders) - - , readonly "resource_path" - "path to search for resources like included images" - (pushPandocList pushString, stResourcePath) - - , readonly "source_url" "absolute URL + dir of 1st source file" - (maybe pushnil pushText, stSourceURL) - - , readonly "user_data_dir" "directory to search for data files" - (maybe pushnil pushString, stUserDataDir) - - , readonly "trace" "controls whether tracing messages are issued" - (pushBool, stTrace) - - , readonly "verbosity" "verbosity level" - (pushString . show, stVerbosity) - ] - -peekCommonState :: LuaError e => Peeker e CommonState -peekCommonState = peekUD typeCommonState - -pushCommonState :: LuaError e => Pusher e CommonState -pushCommonState = pushUD typeCommonState - -typeLogMessage :: LuaError e => DocumentedType e LogMessage -typeLogMessage = deftype "pandoc LogMessage" - [ operation Index $ defun "__tostring" - ### liftPure showLogMessage - <#> udparam typeLogMessage "msg" "object" - =#> functionResult pushText "string" "stringified log message" - ] - mempty -- no members diff --git a/src/Text/Pandoc/Lua/Marshaling/Context.hs b/src/Text/Pandoc/Lua/Marshaling/Context.hs deleted file mode 100644 index 8ee25565e..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/Context.hs +++ /dev/null @@ -1,28 +0,0 @@ -{-# OPTIONS_GHC -fno-warn-orphans #-} -{- | - Module : Text.Pandoc.Lua.Marshaling.Context - Copyright : © 2012-2021 John MacFarlane - © 2017-2021 Albert Krewinkel - License : GNU GPL, version 2 or above - - Maintainer : Albert Krewinkel - Stability : alpha - -Marshaling instance for doctemplates Context and its components. --} -module Text.Pandoc.Lua.Marshaling.Context () where - -import qualified HsLua as Lua -import HsLua (Pushable) -import Text.DocTemplates (Context(..), Val(..), TemplateTarget) -import Text.DocLayout (render) - -instance (TemplateTarget a, Pushable a) => Pushable (Context a) where - push (Context m) = Lua.push m - -instance (TemplateTarget a, Pushable a) => Pushable (Val a) where - push NullVal = Lua.push () - push (BoolVal b) = Lua.push b - push (MapVal ctx) = Lua.push ctx - push (ListVal xs) = Lua.push xs - push (SimpleVal d) = Lua.push $ render Nothing d diff --git a/src/Text/Pandoc/Lua/Marshaling/List.hs b/src/Text/Pandoc/Lua/Marshaling/List.hs deleted file mode 100644 index 0b145d3a1..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/List.hs +++ /dev/null @@ -1,48 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE UndecidableInstances #-} -{- | -Module : Text.Pandoc.Lua.Marshaling.List -Copyright : © 2012-2021 John MacFarlane - © 2017-2021 Albert Krewinkel -License : GNU GPL, version 2 or above -Maintainer : Albert Krewinkel -Stability : alpha - -Marshaling/unmarshaling instances for @pandoc.List@s. --} -module Text.Pandoc.Lua.Marshaling.List - ( List (..) - , peekList' - , pushPandocList - ) where - -import Control.Monad ((<$!>)) -import Data.Data (Data) -import HsLua (LuaError, Peeker, Pusher, Pushable (push), peekList, pushList) -import Text.Pandoc.Walk (Walkable (..)) -import Text.Pandoc.Lua.Util (pushViaConstr') - --- | List wrapper which is marshalled as @pandoc.List@. -newtype List a = List { fromList :: [a] } - deriving (Data, Eq, Show) - -instance Pushable a => Pushable (List a) where - push (List xs) = pushPandocList push xs - --- | Pushes a list as a numerical Lua table, setting a metatable that offers a --- number of convenience functions. -pushPandocList :: LuaError e => Pusher e a -> Pusher e [a] -pushPandocList pushItem xs = pushViaConstr' "List" [pushList pushItem xs] - -peekList' :: LuaError e => Peeker e a -> Peeker e (List a) -peekList' p = (List <$!>) . peekList p - --- List is just a wrapper, so we can reuse the walk instance for --- unwrapped Hasekll lists. -instance Walkable [a] b => Walkable (List a) b where - walkM f = walkM (fmap fromList . f . List) - query f = query (f . List) diff --git a/src/Text/Pandoc/Lua/Marshaling/ListAttributes.hs b/src/Text/Pandoc/Lua/Marshaling/ListAttributes.hs deleted file mode 100644 index 5a6608644..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/ListAttributes.hs +++ /dev/null @@ -1,72 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE TupleSections #-} -{- | -Module : Text.Pandoc.Lua.Marshaling.ListAttributes -Copyright : © 2021 Albert Krewinkel -License : GNU GPL, version 2 or above -Maintainer : Albert Krewinkel - -Marshaling/unmarshaling functions and constructor for 'ListAttributes' -values. --} -module Text.Pandoc.Lua.Marshaling.ListAttributes - ( typeListAttributes - , peekListAttributes - , pushListAttributes - , mkListAttributes - ) where - -import Data.Maybe (fromMaybe) -import HsLua -import Text.Pandoc.Definition ( ListAttributes, ListNumberStyle (DefaultStyle) - , ListNumberDelim (DefaultDelim)) - -typeListAttributes :: LuaError e => DocumentedType e ListAttributes -typeListAttributes = deftype "ListAttributes" - [ operation Eq $ lambda - ### liftPure2 (==) - <#> parameter peekListAttributes "a" "ListAttributes" "" - <#> parameter peekListAttributes "b" "ListAttributes" "" - =#> functionResult pushBool "boolean" "whether the two are equal" - ] - [ property "start" "number of the first list item" - (pushIntegral, \(start,_,_) -> start) - (peekIntegral, \(_,style,delim) -> (,style,delim)) - , property "style" "style used for list numbering" - (pushString . show, \(_,classes,_) -> classes) - (peekRead, \(start,_,delim) -> (start,,delim)) - , property "delimiter" "delimiter of list numbers" - (pushString . show, \(_,_,delim) -> delim) - (peekRead, \(start,style,_) -> (start,style,)) - , method $ defun "clone" - ### return - <#> udparam typeListAttributes "a" "" - =#> functionResult (pushUD typeListAttributes) "ListAttributes" - "cloned ListAttributes value" - ] - --- | Pushes a 'ListAttributes' value as userdata object. -pushListAttributes :: LuaError e => Pusher e ListAttributes -pushListAttributes = pushUD typeListAttributes - --- | Retrieve a 'ListAttributes' triple, either from userdata or from a --- Lua tuple. -peekListAttributes :: LuaError e => Peeker e ListAttributes -peekListAttributes = retrieving "ListAttributes" . choice - [ peekUD typeListAttributes - , peekTriple peekIntegral peekRead peekRead - ] - --- | Constructor for a new 'ListAttributes' value. -mkListAttributes :: LuaError e => DocumentedFunction e -mkListAttributes = defun "ListAttributes" - ### liftPure3 (\mstart mstyle mdelim -> - ( fromMaybe 1 mstart - , fromMaybe DefaultStyle mstyle - , fromMaybe DefaultDelim mdelim - )) - <#> optionalParameter peekIntegral "integer" "start" "number of first item" - <#> optionalParameter peekRead "string" "style" "list numbering style" - <#> optionalParameter peekRead "string" "delimiter" "list number delimiter" - =#> functionResult pushListAttributes "ListAttributes" "new ListAttributes" - #? "Creates a new ListAttributes object." diff --git a/src/Text/Pandoc/Lua/Marshaling/PandocError.hs b/src/Text/Pandoc/Lua/Marshaling/PandocError.hs deleted file mode 100644 index 6f29a5c89..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/PandocError.hs +++ /dev/null @@ -1,51 +0,0 @@ -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeApplications #-} -{- | - Module : Text.Pandoc.Lua.Marshaling.PandocError - Copyright : © 2020-2021 Albert Krewinkel - License : GNU GPL, version 2 or above - - Maintainer : Albert Krewinkel - Stability : alpha - -Marshaling of @'PandocError'@ values. --} -module Text.Pandoc.Lua.Marshaling.PandocError - ( peekPandocError - , pushPandocError - , typePandocError - ) - where - -import HsLua.Core (LuaError) -import HsLua.Marshalling (Peeker, Pusher, pushString, liftLua) -import HsLua.Packaging -import Text.Pandoc.Error (PandocError (PandocLuaError)) - -import qualified HsLua as Lua -import qualified Text.Pandoc.UTF8 as UTF8 - --- | Lua userdata type definition for PandocError. -typePandocError :: LuaError e => DocumentedType e PandocError -typePandocError = deftype "PandocError" - [ operation Tostring $ defun "__tostring" - ### liftPure (show @PandocError) - <#> udparam typePandocError "obj" "PandocError object" - =#> functionResult pushString "string" "string representation of error." - ] - mempty -- no members - --- | Peek a @'PandocError'@ element to the Lua stack. -pushPandocError :: LuaError e => Pusher e PandocError -pushPandocError = pushUD typePandocError - --- | Retrieve a @'PandocError'@ from the Lua stack. -peekPandocError :: LuaError e => Peeker e PandocError -peekPandocError idx = Lua.retrieving "PandocError" $ - liftLua (Lua.ltype idx) >>= \case - Lua.TypeUserdata -> peekUD typePandocError idx - _ -> do - msg <- liftLua $ Lua.state >>= \l -> Lua.liftIO (Lua.popErrorMessage l) - return $ PandocLuaError (UTF8.toText msg) diff --git a/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs b/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs deleted file mode 100644 index 91eb22ae9..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/ReaderOptions.hs +++ /dev/null @@ -1,133 +0,0 @@ -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} -{- | - Module : Text.Pandoc.Lua.Marshaling.ReaderOptions - Copyright : © 2012-2021 John MacFarlane - © 2017-2021 Albert Krewinkel - License : GNU GPL, version 2 or above - - Maintainer : Albert Krewinkel - Stability : alpha - -Marshaling instance for ReaderOptions and its components. --} -module Text.Pandoc.Lua.Marshaling.ReaderOptions - ( peekReaderOptions - , pushReaderOptions - , pushReaderOptionsReadonly - ) where - -import Data.Default (def) -import HsLua as Lua -import Text.Pandoc.Lua.Marshaling.List (pushPandocList) -import Text.Pandoc.Options (ReaderOptions (..)) - --- --- Reader Options --- - --- | Retrieve a ReaderOptions value, either from a normal ReaderOptions --- value, from a read-only object, or from a table with the same --- keys as a ReaderOptions object. -peekReaderOptions :: LuaError e => Peeker e ReaderOptions -peekReaderOptions = retrieving "ReaderOptions" . \idx -> - liftLua (ltype idx) >>= \case - TypeUserdata -> choice [ peekUD typeReaderOptions - , peekUD typeReaderOptionsReadonly - ] - idx - TypeTable -> peekReaderOptionsTable idx - _ -> failPeek =<< - typeMismatchMessage "ReaderOptions userdata or table" idx - --- | Pushes a ReaderOptions value as userdata object. -pushReaderOptions :: LuaError e => Pusher e ReaderOptions -pushReaderOptions = pushUD typeReaderOptions - --- | Pushes a ReaderOptions object, but makes it read-only. -pushReaderOptionsReadonly :: LuaError e => Pusher e ReaderOptions -pushReaderOptionsReadonly = pushUD typeReaderOptionsReadonly - --- | ReaderOptions object type for read-only values. -typeReaderOptionsReadonly :: LuaError e => DocumentedType e ReaderOptions -typeReaderOptionsReadonly = deftype "ReaderOptions (read-only)" - [ operation Tostring $ lambda - ### liftPure show - <#> udparam typeReaderOptions "opts" "options to print in native format" - =#> functionResult pushString "string" "Haskell representation" - , operation Newindex $ lambda - ### (failLua "This ReaderOptions value is read-only.") - =?> "Throws an error when called, i.e., an assignment is made." - ] - readerOptionsMembers - --- | 'ReaderOptions' object type. -typeReaderOptions :: LuaError e => DocumentedType e ReaderOptions -typeReaderOptions = deftype "ReaderOptions" - [ operation Tostring $ lambda - ### liftPure show - <#> udparam typeReaderOptions "opts" "options to print in native format" - =#> functionResult pushString "string" "Haskell representation" - ] - readerOptionsMembers - --- | Member properties of 'ReaderOptions' Lua values. -readerOptionsMembers :: LuaError e - => [Member e (DocumentedFunction e) ReaderOptions] -readerOptionsMembers = - [ property "abbreviations" "" - (pushSet pushText, readerAbbreviations) - (peekSet peekText, \opts x -> opts{ readerAbbreviations = x }) - , property "columns" "" - (pushIntegral, readerColumns) - (peekIntegral, \opts x -> opts{ readerColumns = x }) - , property "default_image_extension" "" - (pushText, readerDefaultImageExtension) - (peekText, \opts x -> opts{ readerDefaultImageExtension = x }) - , property "extensions" "" - (pushString . show, readerExtensions) - (peekRead, \opts x -> opts{ readerExtensions = x }) - , property "indented_code_classes" "" - (pushPandocList pushText, readerIndentedCodeClasses) - (peekList peekText, \opts x -> opts{ readerIndentedCodeClasses = x }) - , property "strip_comments" "" - (pushBool, readerStripComments) - (peekBool, \opts x -> opts{ readerStripComments = x }) - , property "standalone" "" - (pushBool, readerStandalone) - (peekBool, \opts x -> opts{ readerStandalone = x }) - , property "tab_stop" "" - (pushIntegral, readerTabStop) - (peekIntegral, \opts x -> opts{ readerTabStop = x }) - , property "track_changes" "" - (pushString . show, readerTrackChanges) - (peekRead, \opts x -> opts{ readerTrackChanges = x }) - ] - --- | Retrieves a 'ReaderOptions' object from a table on the stack, using --- the default values for all missing fields. --- --- Internally, this pushes the default reader options, sets each --- key/value pair of the table in the userdata value, then retrieves the --- object again. This will update all fields and complain about unknown --- keys. -peekReaderOptionsTable :: LuaError e => Peeker e ReaderOptions -peekReaderOptionsTable idx = retrieving "ReaderOptions (table)" $ do - liftLua $ do - absidx <- absindex idx - pushUD typeReaderOptions def - let setFields = do - next absidx >>= \case - False -> return () -- all fields were copied - True -> do - pushvalue (nth 2) *> insert (nth 2) - settable (nth 4) -- set in userdata object - setFields - pushnil -- first key - setFields - peekUD typeReaderOptions top - -instance Pushable ReaderOptions where - push = pushReaderOptions diff --git a/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs b/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs deleted file mode 100644 index 65f5aec8b..000000000 --- a/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs +++ /dev/null @@ -1,92 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{- | - Module : Text.Pandoc.Lua.Marshaling.SimpleTable - Copyright : © 2020-2021 Albert Krewinkel - License : GNU GPL, version 2 or above - Maintainer : Albert Krewinkel - -Definition and marshaling of the 'SimpleTable' data type used as a -convenience type when dealing with tables. --} -module Text.Pandoc.Lua.Marshaling.SimpleTable - ( SimpleTable (..) - , peekSimpleTable - , pushSimpleTable - , mkSimpleTable - ) - where - -import HsLua as Lua -import Text.Pandoc.Definition -import Text.Pandoc.Lua.Marshaling.AST -import Text.Pandoc.Lua.Marshaling.List - --- | A simple (legacy-style) table. -data SimpleTable = SimpleTable - { simpleTableCaption :: [Inline] - , simpleTableAlignments :: [Alignment] - , simpleTableColumnWidths :: [Double] - , simpleTableHeader :: [[Block]] - , simpleTableBody :: [[[Block]]] - } deriving (Eq, Show) - -typeSimpleTable :: LuaError e => DocumentedType e SimpleTable -typeSimpleTable = deftype "SimpleTable" - [ operation Eq $ lambda - ### liftPure2 (==) - <#> udparam typeSimpleTable "a" "" - <#> udparam typeSimpleTable "b" "" - =#> functionResult pushBool "boolean" "whether the two objects are equal" - , operation Tostring $ lambda - ### liftPure show - <#> udparam typeSimpleTable "self" "" - =#> functionResult pushString "string" "Haskell string representation" - ] - [ property "caption" "table caption" - (pushPandocList pushInline, simpleTableCaption) - (peekInlinesFuzzy, \t capt -> t {simpleTableCaption = capt}) - , property "aligns" "column alignments" - (pushPandocList (pushString . show), simpleTableAlignments) - (peekList peekRead, \t aligns -> t{simpleTableAlignments = aligns}) - , property "widths" "relative column widths" - (pushPandocList pushRealFloat, simpleTableColumnWidths) - (peekList peekRealFloat, \t ws -> t{simpleTableColumnWidths = ws}) - , property "headers" "table header" - (pushRow, simpleTableHeader) - (peekRow, \t h -> t{simpleTableHeader = h}) - , property "rows" "table body rows" - (pushPandocList pushRow, simpleTableBody) - (peekList peekRow, \t bs -> t{simpleTableBody = bs}) - - , readonly "t" "type tag (always 'SimpleTable')" - (pushText, const "SimpleTable") - - , alias "header" "alias for `headers`" ["headers"] - ] - where - pushRow = pushPandocList (pushPandocList pushBlock) - -peekRow :: LuaError e => Peeker e [[Block]] -peekRow = peekList peekBlocksFuzzy - --- | Push a simple table to the stack by calling the --- @pandoc.SimpleTable@ constructor. -pushSimpleTable :: forall e. LuaError e => SimpleTable -> LuaE e () -pushSimpleTable = pushUD typeSimpleTable - --- | Retrieve a simple table from the stack. -peekSimpleTable :: forall e. LuaError e => Peeker e SimpleTable -peekSimpleTable = retrieving "SimpleTable" . peekUD typeSimpleTable - --- | Constructor for the 'SimpleTable' type. -mkSimpleTable :: LuaError e => DocumentedFunction e -mkSimpleTable = defun "SimpleTable" - ### liftPure5 SimpleTable - <#> parameter peekInlinesFuzzy "Inlines" "caption" "table caption" - <#> parameter (peekList peekRead) "{Alignment,...}" "align" "column alignments" - <#> parameter (peekList peekRealFloat) "{number,...}" "widths" - "relative column widths" - <#> parameter peekRow "{Blocks,...}" "header" "table header row" - <#> parameter (peekList peekRow) "{{Blocks,...},...}" "body" "table body rows" - =#> functionResult pushSimpleTable "SimpleTable" "new SimpleTable object" diff --git a/src/Text/Pandoc/Lua/Module/MediaBag.hs b/src/Text/Pandoc/Lua/Module/MediaBag.hs index 6e595f9e4..fb055101e 100644 --- a/src/Text/Pandoc/Lua/Module/MediaBag.hs +++ b/src/Text/Pandoc/Lua/Module/MediaBag.hs @@ -21,8 +21,8 @@ import Text.Pandoc.Class.CommonState (CommonState (..)) import Text.Pandoc.Class.PandocMonad (fetchItem, getMediaBag, modifyCommonState, setMediaBag) import Text.Pandoc.Error (PandocError) -import Text.Pandoc.Lua.Marshaling () -import Text.Pandoc.Lua.Marshaling.List (pushPandocList) +import Text.Pandoc.Lua.Marshal.List (pushPandocList) +import Text.Pandoc.Lua.Orphans () import Text.Pandoc.Lua.PandocLua (unPandocLua) import Text.Pandoc.MIME (MimeType) diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index a8b111092..085d904cf 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -19,35 +19,28 @@ module Text.Pandoc.Lua.Module.Pandoc ) where import Prelude hiding (read) -import Control.Applicative ((<|>)) -import Control.Monad ((<$!>), forM_, when) +import Control.Monad (forM_, when) import Control.Monad.Catch (catch, throwM) import Control.Monad.Except (throwError) import Data.Data (Data, dataTypeConstrs, dataTypeOf, showConstr) import Data.Default (Default (..)) import Data.Maybe (fromMaybe) import Data.Proxy (Proxy (Proxy)) -import Data.Text (Text) -import HsLua hiding (Div, pushModule) +import HsLua hiding (pushModule) import HsLua.Class.Peekable (PeekError) import System.Exit (ExitCode (..)) import Text.Pandoc.Class.PandocIO (runIO) import Text.Pandoc.Definition -import Text.Pandoc.Lua.Filter (SingletonsList (..), LuaFilter, peekLuaFilter, +import Text.Pandoc.Lua.Filter (List (..), SingletonsList (..), LuaFilter, + peekLuaFilter, walkInlines, walkInlineLists, walkBlocks, walkBlockLists) -import Text.Pandoc.Lua.Marshaling () -import Text.Pandoc.Lua.Marshaling.AST -import Text.Pandoc.Lua.Marshaling.Attr (mkAttr, mkAttributeList) -import Text.Pandoc.Lua.Marshaling.List (List (..)) -import Text.Pandoc.Lua.Marshaling.ListAttributes ( mkListAttributes - , peekListAttributes) -import Text.Pandoc.Lua.Marshaling.ReaderOptions ( peekReaderOptions +import Text.Pandoc.Lua.Orphans () +import Text.Pandoc.Lua.Marshal.AST +import Text.Pandoc.Lua.Marshal.ReaderOptions ( peekReaderOptions , pushReaderOptions) -import Text.Pandoc.Lua.Marshaling.SimpleTable (mkSimpleTable) import Text.Pandoc.Lua.Module.Utils (sha1) -import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, - loadDefaultModule) +import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua) import Text.Pandoc.Options (ReaderOptions (readerExtensions)) import Text.Pandoc.Process (pipeProcess) import Text.Pandoc.Readers (Reader (..), getReader) @@ -65,21 +58,6 @@ import Text.Pandoc.Error pushModule :: PandocLua NumResults pushModule = do liftPandocLua $ Lua.pushModule documentedModule - loadDefaultModule "pandoc" - let copyNext = do - hasNext <- next (nth 2) - if not hasNext - then return () - else do - pushvalue (nth 2) - insert (nth 2) - rawset (nth 5) -- pandoc module - copyNext - liftPandocLua $ do - pushnil -- initial key - copyNext - pop 1 - return 1 documentedModule :: Module PandocError @@ -97,6 +75,7 @@ documentedModule = Module , otherConstructors , blockConstructors , inlineConstructors + , metaValueConstructors ] } @@ -132,229 +111,13 @@ pushWithConstructorsSubtable constructors = do rawset (nth 3) pop 1 -- pop constructor table -inlineConstructors :: LuaError e => [DocumentedFunction e] -inlineConstructors = - [ defun "Cite" - ### liftPure2 (flip Cite) - <#> parameter peekInlinesFuzzy "content" "Inline" "placeholder content" - <#> parameter (peekList peekCitation) "citations" "list of Citations" "" - =#> functionResult pushInline "Inline" "cite element" - , defun "Code" - ### liftPure2 (\text mattr -> Code (fromMaybe nullAttr mattr) text) - <#> parameter peekText "code" "string" "code string" - <#> optionalParameter peekAttr "attr" "Attr" "additional attributes" - =#> functionResult pushInline "Inline" "code element" - , mkInlinesConstr "Emph" Emph - , defun "Image" - ### liftPure4 (\caption src mtitle mattr -> - let attr = fromMaybe nullAttr mattr - title = fromMaybe mempty mtitle - in Image attr caption (src, title)) - <#> parameter peekInlinesFuzzy "Inlines" "caption" "image caption / alt" - <#> parameter peekText "string" "src" "path/URL of the image file" - <#> optionalParameter peekText "string" "title" "brief image description" - <#> optionalParameter peekAttr "Attr" "attr" "image attributes" - =#> functionResult pushInline "Inline" "image element" - , defun "LineBreak" - ### return LineBreak - =#> functionResult pushInline "Inline" "line break" - , defun "Link" - ### liftPure4 (\content target mtitle mattr -> - let attr = fromMaybe nullAttr mattr - title = fromMaybe mempty mtitle - in Link attr content (target, title)) - <#> parameter peekInlinesFuzzy "Inlines" "content" "text for this link" - <#> parameter peekText "string" "target" "the link target" - <#> optionalParameter peekText "string" "title" "brief link description" - <#> optionalParameter peekAttr "Attr" "attr" "link attributes" - =#> functionResult pushInline "Inline" "link element" - , defun "Math" - ### liftPure2 Math - <#> parameter peekMathType "quotetype" "Math" "rendering method" - <#> parameter peekText "text" "string" "math content" - =#> functionResult pushInline "Inline" "math element" - , defun "Note" - ### liftPure Note - <#> parameter peekBlocksFuzzy "content" "Blocks" "note content" - =#> functionResult pushInline "Inline" "note" - , defun "Quoted" - ### liftPure2 Quoted - <#> parameter peekQuoteType "quotetype" "QuoteType" "type of quotes" - <#> parameter peekInlinesFuzzy "content" "Inlines" "inlines in quotes" - =#> functionResult pushInline "Inline" "quoted element" - , defun "RawInline" - ### liftPure2 RawInline - <#> parameter peekFormat "format" "Format" "format of content" - <#> parameter peekText "text" "string" "string content" - =#> functionResult pushInline "Inline" "raw inline element" - , mkInlinesConstr "SmallCaps" SmallCaps - , defun "SoftBreak" - ### return SoftBreak - =#> functionResult pushInline "Inline" "soft break" - , defun "Space" - ### return Space - =#> functionResult pushInline "Inline" "new space" - , defun "Span" - ### liftPure2 (\inlns mattr -> Span (fromMaybe nullAttr mattr) inlns) - <#> parameter peekInlinesFuzzy "content" "Inlines" "inline content" - <#> optionalParameter peekAttr "attr" "Attr" "additional attributes" - =#> functionResult pushInline "Inline" "span element" - , defun "Str" - ### liftPure Str - <#> parameter peekText "text" "string" "" - =#> functionResult pushInline "Inline" "new Str object" - , mkInlinesConstr "Strong" Strong - , mkInlinesConstr "Strikeout" Strikeout - , mkInlinesConstr "Subscript" Subscript - , mkInlinesConstr "Superscript" Superscript - , mkInlinesConstr "Underline" Underline - ] - -blockConstructors :: LuaError e => [DocumentedFunction e] -blockConstructors = - [ defun "BlockQuote" - ### liftPure BlockQuote - <#> blocksParam - =#> blockResult "BlockQuote element" - - , defun "BulletList" - ### liftPure BulletList - <#> blockItemsParam "list items" - =#> blockResult "BulletList element" - - , defun "CodeBlock" - ### liftPure2 (\code mattr -> CodeBlock (fromMaybe nullAttr mattr) code) - <#> textParam "text" "code block content" - <#> optAttrParam - =#> blockResult "CodeBlock element" - - , defun "DefinitionList" - ### liftPure DefinitionList - <#> parameter (choice - [ peekList peekDefinitionItem - , \idx -> (:[]) <$!> peekDefinitionItem idx - ]) - "{{Inlines, {Blocks,...}},...}" - "content" "definition items" - =#> blockResult "DefinitionList element" - - , defun "Div" - ### liftPure2 (\content mattr -> Div (fromMaybe nullAttr mattr) content) - <#> blocksParam - <#> optAttrParam - =#> blockResult "Div element" - - , defun "Header" - ### liftPure3 (\lvl content mattr -> - Header lvl (fromMaybe nullAttr mattr) content) - <#> parameter peekIntegral "integer" "level" "heading level" - <#> parameter peekInlinesFuzzy "Inlines" "content" "inline content" - <#> optAttrParam - =#> blockResult "Header element" - - , defun "HorizontalRule" - ### return HorizontalRule - =#> blockResult "HorizontalRule element" - - , defun "LineBlock" - ### liftPure LineBlock - <#> parameter (peekList peekInlinesFuzzy) "{Inlines,...}" "content" "lines" - =#> blockResult "LineBlock element" - - , defun "Null" - ### return Null - =#> blockResult "Null element" - - , defun "OrderedList" - ### liftPure2 (\items mListAttrib -> - let defListAttrib = (1, DefaultStyle, DefaultDelim) - in OrderedList (fromMaybe defListAttrib mListAttrib) items) - <#> blockItemsParam "ordered list items" - <#> optionalParameter peekListAttributes "ListAttributes" "listAttributes" - "specifier for the list's numbering" - =#> blockResult "OrderedList element" - - , defun "Para" - ### liftPure Para - <#> parameter peekInlinesFuzzy "Inlines" "content" "paragraph content" - =#> blockResult "Para element" - - , defun "Plain" - ### liftPure Plain - <#> parameter peekInlinesFuzzy "Inlines" "content" "paragraph content" - =#> blockResult "Plain element" - - , defun "RawBlock" - ### liftPure2 RawBlock - <#> parameter peekFormat "Format" "format" "format of content" - <#> parameter peekText "string" "text" "raw content" - =#> blockResult "RawBlock element" - - , defun "Table" - ### (\capt colspecs thead tbodies tfoot mattr -> - let attr = fromMaybe nullAttr mattr - in return $! attr `seq` capt `seq` colspecs `seq` thead `seq` tbodies - `seq` tfoot `seq` Table attr capt colspecs thead tbodies tfoot) - <#> parameter peekCaption "Caption" "caption" "table caption" - <#> parameter (peekList peekColSpec) "{ColSpec,...}" "colspecs" - "column alignments and widths" - <#> parameter peekTableHead "TableHead" "head" "table head" - <#> parameter (peekList peekTableBody) "{TableBody,...}" "bodies" - "table bodies" - <#> parameter peekTableFoot "TableFoot" "foot" "table foot" - <#> optAttrParam - =#> blockResult "Table element" - ] - where - blockResult = functionResult pushBlock "Block" - blocksParam = parameter peekBlocksFuzzy "Blocks" "content" "block content" - blockItemsParam = parameter peekItemsFuzzy "List of Blocks" "content" - peekItemsFuzzy idx = peekList peekBlocksFuzzy idx - <|> ((:[]) <$!> peekBlocksFuzzy idx) - -textParam :: LuaError e => Text -> Text -> Parameter e Text -textParam = parameter peekText "string" - -optAttrParam :: LuaError e => Parameter e (Maybe Attr) -optAttrParam = optionalParameter peekAttr "attr" "Attr" "additional attributes" - -mkInlinesConstr :: LuaError e - => Name -> ([Inline] -> Inline) -> DocumentedFunction e -mkInlinesConstr name constr = defun name - ### liftPure (\x -> x `seq` constr x) - <#> parameter peekInlinesFuzzy "content" "Inlines" "" - =#> functionResult pushInline "Inline" "new object" - otherConstructors :: LuaError e => [DocumentedFunction e] otherConstructors = - [ defun "Pandoc" - ### liftPure2 (\blocks mMeta -> Pandoc (fromMaybe nullMeta mMeta) blocks) - <#> parameter peekBlocksFuzzy "Blocks" "blocks" "document contents" - <#> optionalParameter peekMeta "Meta" "meta" "document metadata" - =#> functionResult pushPandoc "Pandoc" "new Pandoc document" - - , defun "Citation" - ### (\cid mode mprefix msuffix mnote_num mhash -> - cid `seq` mode `seq` mprefix `seq` msuffix `seq` - mnote_num `seq` mhash `seq` return $! Citation - { citationId = cid - , citationMode = mode - , citationPrefix = fromMaybe mempty mprefix - , citationSuffix = fromMaybe mempty msuffix - , citationNoteNum = fromMaybe 0 mnote_num - , citationHash = fromMaybe 0 mhash - }) - <#> parameter peekText "string" "cid" "citation ID (e.g. bibtex key)" - <#> parameter peekRead "citation mode" "mode" "citation rendering mode" - <#> optionalParameter peekInlinesFuzzy "prefix" "Inlines" "" - <#> optionalParameter peekInlinesFuzzy "suffix" "Inlines" "" - <#> optionalParameter peekIntegral "note_num" "integer" "note number" - <#> optionalParameter peekIntegral "hash" "integer" "hash number" - =#> functionResult pushCitation "Citation" "new citation object" - #? "Creates a single citation." - + [ mkPandoc + , mkMeta , mkAttr , mkAttributeList + , mkCitation , mkListAttributes , mkSimpleTable diff --git a/src/Text/Pandoc/Lua/Module/Types.hs b/src/Text/Pandoc/Lua/Module/Types.hs index 4b37dafd9..f16737f63 100644 --- a/src/Text/Pandoc/Lua/Module/Types.hs +++ b/src/Text/Pandoc/Lua/Module/Types.hs @@ -13,14 +13,11 @@ module Text.Pandoc.Lua.Module.Types ( documentedModule ) where -import HsLua ( LuaE, NumResults, Peeker, Pusher, Module (..), Field (..) - , defun, functionResult, parameter, (###), (<#>), (=#>)) +import HsLua ( Module (..), (###), (<#>), (=#>) + , defun, functionResult, parameter) import HsLua.Module.Version (peekVersionFuzzy, pushVersion) import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.ErrorConversion () -import Text.Pandoc.Lua.Marshaling.AST - -import qualified HsLua as Lua -- | Push the pandoc.types module on the Lua stack. documentedModule :: Module PandocError @@ -28,16 +25,7 @@ documentedModule = Module { moduleName = "pandoc.types" , moduleDescription = "Constructors for types that are not part of the pandoc AST." - , moduleFields = - [ Field - { fieldName = "clone" - , fieldDescription = "DEPRECATED! Helper functions for element cloning." - , fieldPushValue = do - Lua.newtable - addFunction "Meta" $ cloneWith peekMeta pushMeta - addFunction "MetaValue" $ cloneWith peekMetaValue pushMetaValue - } - ] + , moduleFields = [] , moduleFunctions = [ defun "Version" ### return @@ -52,15 +40,3 @@ documentedModule = Module ] , moduleOperations = [] } - where addFunction name fn = do - Lua.pushName name - Lua.pushHaskellFunction fn - Lua.rawset (Lua.nth 3) - -cloneWith :: Peeker PandocError a - -> Pusher PandocError a - -> LuaE PandocError NumResults -cloneWith peeker pusher = do - x <- Lua.forcePeek $ peeker (Lua.nthBottom 1) - pusher x - return (Lua.NumResults 1) diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 6fd707bf8..917f2e627 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -27,14 +27,7 @@ import HsLua.Class.Peekable (PeekError) import HsLua.Module.Version (peekVersionFuzzy, pushVersion) import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError) -import Text.Pandoc.Lua.Marshaling () -import Text.Pandoc.Lua.Marshaling.AST - ( peekBlock, peekInline, peekPandoc, pushBlock, pushInline, pushInlines - , pushPandoc, peekAttr, peekMeta, peekMetaValue) -import Text.Pandoc.Lua.Marshaling.ListAttributes (peekListAttributes) -import Text.Pandoc.Lua.Marshaling.List (pushPandocList) -import Text.Pandoc.Lua.Marshaling.SimpleTable - ( SimpleTable (..), peekSimpleTable, pushSimpleTable ) +import Text.Pandoc.Lua.Marshal.AST import Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua)) import qualified Data.Digest.Pure.SHA as SHA diff --git a/src/Text/Pandoc/Lua/Orphans.hs b/src/Text/Pandoc/Lua/Orphans.hs new file mode 100644 index 000000000..eef05bd27 --- /dev/null +++ b/src/Text/Pandoc/Lua/Orphans.hs @@ -0,0 +1,111 @@ +{-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE FlexibleInstances #-} +{- | + Module : Text.Pandoc.Lua.Orphans + Copyright : © 2012-2021 John MacFarlane + © 2017-2021 Albert Krewinkel + License : GNU GPL, version 2 or above + + Maintainer : Albert Krewinkel + Stability : alpha + +Orphan instances for Lua's Pushable and Peekable type classes. +-} +module Text.Pandoc.Lua.Orphans () where + +import Data.Version (Version) +import HsLua +import HsLua.Module.Version (peekVersionFuzzy) +import Text.Pandoc.Definition +import Text.Pandoc.Lua.Marshal.AST +import Text.Pandoc.Lua.Marshal.CommonState () +import Text.Pandoc.Lua.Marshal.Context () +import Text.Pandoc.Lua.Marshal.PandocError() +import Text.Pandoc.Lua.Marshal.ReaderOptions () +import Text.Pandoc.Lua.ErrorConversion () + +instance Pushable Pandoc where + push = pushPandoc + +instance Pushable Meta where + push = pushMeta + +instance Pushable MetaValue where + push = pushMetaValue + +instance Pushable Block where + push = pushBlock + +instance {-# OVERLAPPING #-} Pushable [Block] where + push = pushBlocks + +instance Pushable Alignment where + push = pushString . show + +instance Pushable CitationMode where + push = pushCitationMode + +instance Pushable Format where + push = pushFormat + +instance Pushable ListNumberDelim where + push = pushString . show + +instance Pushable ListNumberStyle where + push = pushString . show + +instance Pushable MathType where + push = pushMathType + +instance Pushable QuoteType where + push = pushQuoteType + +instance Pushable Cell where + push = pushCell + +instance Peekable Cell where + peek = forcePeek . peekCell + +instance Pushable Inline where + push = pushInline + +instance {-# OVERLAPPING #-} Pushable [Inline] where + push = pushInlines + +instance Pushable Citation where + push = pushCitation + +instance Pushable Row where + push = pushRow + +instance Pushable TableBody where + push = pushTableBody + +instance Pushable TableFoot where + push = pushTableFoot + +instance Pushable TableHead where + push = pushTableHead + +-- These instances exist only for testing. It's a hack to avoid making +-- the marshalling modules public. +instance Peekable Inline where + peek = forcePeek . peekInline + +instance Peekable Block where + peek = forcePeek . peekBlock + +instance Peekable Meta where + peek = forcePeek . peekMeta + +instance Peekable Pandoc where + peek = forcePeek . peekPandoc + +instance Peekable Row where + peek = forcePeek . peekRow + +instance Peekable Version where + peek = forcePeek . peekVersionFuzzy + +instance {-# OVERLAPPING #-} Peekable Attr where + peek = forcePeek . peekAttr diff --git a/src/Text/Pandoc/Lua/Packages.hs b/src/Text/Pandoc/Lua/Packages.hs index 3a481886a..c36c3c670 100644 --- a/src/Text/Pandoc/Lua/Packages.hs +++ b/src/Text/Pandoc/Lua/Packages.hs @@ -17,7 +17,8 @@ module Text.Pandoc.Lua.Packages import Control.Monad (forM_) import Text.Pandoc.Error (PandocError) -import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, loadDefaultModule) +import Text.Pandoc.Lua.Marshal.List (pushListModule) +import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua) import qualified HsLua as Lua import qualified HsLua.Module.Path as Path @@ -45,7 +46,7 @@ installPandocPackageSearcher = liftPandocLua $ do pandocPackageSearcher :: String -> PandocLua Lua.NumResults pandocPackageSearcher pkgName = case pkgName of - "pandoc" -> pushWrappedHsFun $ Lua.toHaskellFunction @PandocError Pandoc.pushModule + "pandoc" -> pushModuleLoader Pandoc.documentedModule "pandoc.mediabag" -> pushModuleLoader MediaBag.documentedModule "pandoc.path" -> pushModuleLoader Path.documentedModule "pandoc.system" -> pushModuleLoader System.documentedModule @@ -53,7 +54,7 @@ pandocPackageSearcher pkgName = "pandoc.utils" -> pushModuleLoader Utils.documentedModule "text" -> pushModuleLoader Text.documentedModule "pandoc.List" -> pushWrappedHsFun . Lua.toHaskellFunction @PandocError $ - loadDefaultModule pkgName + (Lua.NumResults 1 <$ pushListModule @PandocError) _ -> reportPandocSearcherFailure where pushModuleLoader mdl = liftPandocLua $ do diff --git a/src/Text/Pandoc/Lua/PandocLua.hs b/src/Text/Pandoc/Lua/PandocLua.hs index 6c2ebc622..71fdf8d5c 100644 --- a/src/Text/Pandoc/Lua/PandocLua.hs +++ b/src/Text/Pandoc/Lua/PandocLua.hs @@ -22,20 +22,18 @@ module Text.Pandoc.Lua.PandocLua ( PandocLua (..) , runPandocLua , liftPandocLua - , loadDefaultModule ) where import Control.Monad.Catch (MonadCatch, MonadMask, MonadThrow) import Control.Monad.Except (MonadError (catchError, throwError)) import Control.Monad.IO.Class (MonadIO) import HsLua as Lua -import Text.Pandoc.Class.PandocMonad (PandocMonad (..), readDefaultDataFile) -import Text.Pandoc.Error (PandocError (PandocLuaError)) +import Text.Pandoc.Class.PandocMonad (PandocMonad (..)) +import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Global (Global (..), setGlobals) -import Text.Pandoc.Lua.Marshaling.CommonState (peekCommonState) +import Text.Pandoc.Lua.Marshal.CommonState (peekCommonState) import qualified Control.Monad.Catch as Catch -import qualified Data.Text as T import qualified Text.Pandoc.Class.IO as IO -- | Type providing access to both, pandoc and Lua operations. @@ -75,23 +73,6 @@ instance {-# OVERLAPPING #-} Exposable PandocError (PandocLua NumResults) where instance Pushable a => Exposable PandocError (PandocLua a) where partialApply _narg x = 1 <$ (unPandocLua x >>= Lua.push) --- | Load a pure Lua module included with pandoc. Leaves the result on --- the stack and returns @NumResults 1@. --- --- The script is loaded from the default data directory. We do not load --- from data directories supplied via command line, as this could cause --- scripts to be executed even though they had not been passed explicitly. -loadDefaultModule :: String -> PandocLua NumResults -loadDefaultModule name = do - script <- readDefaultDataFile (name <> ".lua") - result <- liftPandocLua $ Lua.dostring script - if result == Lua.OK - then return (1 :: NumResults) - else do - msg <- liftPandocLua Lua.popValue - let err = "Error while loading `" <> name <> "`.\n" <> msg - throwError $ PandocLuaError (T.pack err) - -- | Global variables which should always be set. defaultGlobals :: PandocMonad m => m [Global] defaultGlobals = do diff --git a/src/Text/Pandoc/Lua/Util.hs b/src/Text/Pandoc/Lua/Util.hs index f35201db0..6d67d340d 100644 --- a/src/Text/Pandoc/Lua/Util.hs +++ b/src/Text/Pandoc/Lua/Util.hs @@ -1,9 +1,4 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Lua.Util Copyright : © 2012-2021 John MacFarlane, @@ -16,14 +11,12 @@ Lua utility functions. -} module Text.Pandoc.Lua.Util - ( getTag - , addField + ( addField , callWithTraceback , dofileWithTraceback - , pushViaConstr' ) where -import Control.Monad (unless, when) +import Control.Monad (when) import HsLua import qualified HsLua as Lua @@ -34,26 +27,6 @@ addField key value = do Lua.push value Lua.rawset (Lua.nth 3) --- | Get the tag of a value. This is an optimized and specialized version of --- @Lua.getfield idx "tag"@. It only checks for the field on the table at index --- @idx@ and on its metatable, also ignoring any @__index@ value on the --- metatable. -getTag :: LuaError e => Peeker e Name -getTag idx = do - -- push metatable or just the table - liftLua $ do - Lua.getmetatable idx >>= \hasMT -> unless hasMT (Lua.pushvalue idx) - Lua.pushName "tag" - Lua.rawget (Lua.nth 2) - Lua.peekName Lua.top `lastly` Lua.pop 2 -- table/metatable and `tag` field - -pushViaConstr' :: forall e. LuaError e => Name -> [LuaE e ()] -> LuaE e () -pushViaConstr' fnname pushArgs = do - pushName @e ("pandoc." <> fnname) - rawget @e registryindex - sequence_ pushArgs - call @e (fromIntegral (length pushArgs)) 1 - -- | Like @'Lua.pcall'@, but uses a predefined error handler which adds a -- traceback on error. pcallWithTraceback :: LuaError e => NumArgs -> NumResults -> LuaE e Status diff --git a/src/Text/Pandoc/Lua/Walk.hs b/src/Text/Pandoc/Lua/Walk.hs index d6d973496..75ed1f471 100644 --- a/src/Text/Pandoc/Lua/Walk.hs +++ b/src/Text/Pandoc/Lua/Walk.hs @@ -1,7 +1,9 @@ -{-# LANGUAGE DeriveTraversable #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE UndecidableInstances #-} {- | Module : Text.Pandoc.Lua.Walk Copyright : © 2012-2021 John MacFarlane, @@ -14,13 +16,18 @@ Walking documents in a filter-suitable way. -} module Text.Pandoc.Lua.Walk ( SingletonsList (..) + , List (..) ) where import Control.Monad ((<=<)) +import Data.Data (Data) +import HsLua (Pushable (push)) +import Text.Pandoc.Lua.Marshal.AST (pushBlocks, pushInlines) import Text.Pandoc.Definition import Text.Pandoc.Walk + -- | Helper type which allows to traverse trees in order, while splicing in -- trees. -- @@ -156,3 +163,21 @@ querySingletonsList :: (Monoid c, Walkable (SingletonsList a) a) querySingletonsList f = let f' x = f (SingletonsList [x]) `mappend` query f x in mconcat . map f' + + +-- | List wrapper where each list is processed as a whole, but special +-- pushed to Lua in type-dependent ways. +-- +-- The walk instance is basically that of unwrapped Haskell lists. +newtype List a = List { fromList :: [a] } + deriving (Data, Eq, Show) + +instance Pushable (List Block) where + push (List xs) = pushBlocks xs + +instance Pushable (List Inline) where + push (List xs) = pushInlines xs + +instance Walkable [a] b => Walkable (List a) b where + walkM f = walkM (fmap fromList . f . List) + query f = query (f . List) diff --git a/stack.yaml b/stack.yaml index c77ee622f..71c25c0be 100644 --- a/stack.yaml +++ b/stack.yaml @@ -23,7 +23,7 @@ extra-deps: - hslua-module-version-1.0.0 - hslua-objectorientation-2.0.1 - hslua-packaging-2.0.0 -- lua-2.0.1 +- lua-2.0.2 - tasty-hslua-1.0.0 - tasty-lua-1.0.0 - pandoc-types-1.22.1 @@ -33,6 +33,8 @@ extra-deps: - aeson-pretty-0.8.9 - ipynb-0.1.0.2 - texmath-0.12.3.3 +- git: https://github.com/tarleb/hslua-pandoc-types.git + commit: 56387e543c48cc5518a77c2a271ff211653f2a36 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index 2070695e3..7ef21f933 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -238,7 +238,7 @@ tests = map (localOption (QuickCheckTests 20)) case eitherPandoc of Left (PandocLuaError msg) -> do let expectedMsg = "Pandoc expected, got boolean\n" - <> "\twhile retrieving Pandoc value" + <> "\twhile retrieving Pandoc" Lua.liftIO $ assertEqual "unexpected error message" expectedMsg msg Left e -> error ("Expected a Lua error, but got " <> show e) Right _ -> error "Getting a Pandoc element from a bool should fail." @@ -266,7 +266,6 @@ roundtripEqual x = (x ==) <$> roundtripped runLuaTest :: HasCallStack => Lua.LuaE PandocError a -> IO a runLuaTest op = runIOorExplode $ do - setUserDataDir (Just "../data") res <- runLua op case res of Left e -> error (show e) diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 2849eedbf..1cf777675 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -8,715 +8,124 @@ function os_is_windows () return package.config:sub(1,1) == '\\' end +-- Constructor behavior is tested in the hslua-pandoc-types module, so +-- we just make sure the functions are present. return { - group 'Attr' { - group 'Constructor' { + group 'Constructors' { + group 'Misc' { test('pandoc.Attr is a function', function () assert.are_equal(type(pandoc.Attr), 'function') end), - test('returns null-Attr if no arguments are given', function () - local attr = pandoc.Attr() - assert.are_equal(attr.identifier, '') - assert.are_same(attr.classes, {}) - assert.are_same(#attr.attributes, 0) - end), - test( - 'accepts string-indexed table or list of pairs as attributes', - function () - local attributes_list = {{'one', '1'}, {'two', '2'}} - local attr_from_list = pandoc.Attr('', {}, attributes_list) - - assert.are_equal(attr_from_list.attributes.one, '1') - assert.are_equal(attr_from_list.attributes.two, '2') - - local attributes_table = {one = '1', two = '2'} - local attr_from_table = pandoc.Attr('', {}, attributes_table) - assert.are_equal( - attr_from_table.attributes, - pandoc.AttributeList(attributes_table) - ) - assert.are_equal(attr_from_table.attributes.one, '1') - assert.are_equal(attr_from_table.attributes.two, '2') - end - ) - }, - group 'Properties' { - test('has t and tag property', function () - local attr = pandoc.Attr('') - assert.are_equal(attr.t, 'Attr') - assert.are_equal(attr.tag, 'Attr') - end) - }, - group 'AttributeList' { - test('allows access via fields', function () - local attributes = pandoc.Attr('', {}, {{'a', '1'}, {'b', '2'}}).attributes - assert.are_equal(attributes.a, '1') - assert.are_equal(attributes.b, '2') - end), - test('allows access to pairs via numerical indexing', function () - local attributes = pandoc.Attr('', {}, {{'a', '1'}, {'b', '2'}}).attributes - assert.are_same(attributes[1], {'a', '1'}) - assert.are_same(attributes[2], {'b', '2'}) - end), - test('allows replacing a pair', function () - local attributes = pandoc.AttributeList{{'a', '1'}, {'b', '2'}} - attributes[1] = {'t','five'} - assert.are_same(attributes[1], {'t', 'five'}) - assert.are_same(attributes[2], {'b', '2'}) - end), - test('allows to remove a pair', function () - local attributes = pandoc.AttributeList{{'a', '1'}, {'b', '2'}} - attributes[1] = nil - assert.are_equal(#attributes, 1) - end), - test('adds entries by field name', function () - local attributes = pandoc.Attr('',{}, {{'c', '1'}, {'d', '2'}}).attributes - attributes.e = '3' - assert.are_same( - attributes, - -- checking the full AttributeList would "duplicate" entries - pandoc.AttributeList{{'c', '1'}, {'d', '2'}, {'e', '3'}} - ) + test('pandoc.AttributeList is a function', function () + assert.are_equal(type(pandoc.AttributeList), 'function') end), - test('deletes entries by field name', function () - local attributes = pandoc.Attr('',{}, {a = '1', b = '2'}).attributes - attributes.a = nil - assert.is_nil(attributes.a) - assert.are_same(attributes, pandoc.AttributeList{{'b', '2'}}) - end), - test('remains unchanged if deleted key did not exist', function () - local assoc_list = pandoc.List:new {{'alpha', 'x'}, {'beta', 'y'}} - local attributes = pandoc.Attr('', {}, assoc_list).attributes - attributes.a = nil - local new_assoc_list = pandoc.List() - for k, v in pairs(attributes) do - new_assoc_list:insert({k, v}) - end - assert.are_same(new_assoc_list, assoc_list) - end), - test('gives key-value pairs when iterated-over', function () - local attributes = {width = '11', height = '22', name = 'test'} - local attr = pandoc.Attr('', {}, attributes) - local count = 0 - for k, v in pairs(attr.attributes) do - assert.are_equal(attributes[k], v) - count = count + 1 - end - assert.are_equal(count, 3) - end) - }, - group 'HTML-like attribute tables' { - test('in element constructor', function () - local html_attributes = { - id = 'the-id', - class = 'class1 class2', - width = '11', - height = '12' - } - local attr = pandoc.Span('test', html_attributes).attr - assert.are_equal(attr.identifier, 'the-id') - assert.are_equal(attr.classes[1], 'class1') - assert.are_equal(attr.classes[2], 'class2') - assert.are_equal(attr.attributes.width, '11') - assert.are_equal(attr.attributes.height, '12') - end), - test('element attr setter', function () - local html_attributes = { - id = 'the-id', - class = 'class1 class2', - width = "11", - height = "12" - } - local span = pandoc.Span 'test' - span.attr = html_attributes - span = span:clone() -- normalize - assert.are_equal(span.attr.identifier, 'the-id') - assert.are_equal(span.attr.classes[1], 'class1') - assert.are_equal(span.attr.classes[2], 'class2') - assert.are_equal(span.attr.attributes.width, '11') - assert.are_equal(span.attr.attributes.height, '12') - end), - test('element attrbutes setter', function () - local attributes = { - width = "11", - height = "12" - } - local span = pandoc.Span 'test' - span.attributes = attributes - assert.are_equal(span.attr.attributes.width, '11') - assert.are_equal(span.attr.attributes.height, '12') - end) - } - }, - group "Inline elements" { - group 'Cite' { - test('has property `content`', function () - local cite = pandoc.Cite({pandoc.Emph 'important'}, {}) - assert.are_same(cite.content, {pandoc.Emph {pandoc.Str 'important'}}) - - cite.content = 'boring' - assert.are_equal(cite, pandoc.Cite({pandoc.Str 'boring'}, {})) - end), - test('has list of citations in property `cite`', function () - local citations = { - pandoc.Citation('einstein1905', 'NormalCitation') - } - local cite = pandoc.Cite('relativity', citations) - assert.are_same(cite.citations, citations) - - local new_citations = { - citations[1], - pandoc.Citation('Poincaré1905', 'NormalCitation') - } - cite.citations = new_citations - assert.are_equal(cite, pandoc.Cite({'relativity'}, new_citations)) + test('pandoc.Citation is a function', function () + assert.are_equal(type(pandoc.Citation), 'function') end), - }, - group 'Code' { - test('has property `attr`', function () - local code = pandoc.Code('true', {id='true', foo='bar'}) - assert.are_equal(code.attr, pandoc.Attr('true', {}, {{'foo', 'bar'}})) - - code.attr = {id='t', fubar='quux'} - assert.are_equal( - pandoc.Code('true', pandoc.Attr('t', {}, {{'fubar', 'quux'}})), - code - ) + test('pandoc.SimpleTable is a function', function () + assert.are_equal(type(pandoc.SimpleTable), 'function') end), - test('has property `text`', function () - local code = pandoc.Code('true') - assert.are_equal(code.text, 'true') - - code.text = '1 + 1' - assert.are_equal(pandoc.Code('1 + 1'), code) + test('pandoc.Meta is a function', function () + assert.are_equal(type(pandoc.Meta), 'function') + end), + test('pandoc.Pandoc is a function', function () + assert.are_equal(type(pandoc.Pandoc), 'function') end), }, - group 'Emph' { - test('has property `content`', function () - local elem = pandoc.Emph{'two', pandoc.Space(), 'words'} - assert.are_same( - elem.content, - {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} - ) - elem.content = {'word'} - assert.are_equal(elem, pandoc.Emph{'word'}) - end) - }, - group 'Image' { - test('has property `caption`', function () - local img = pandoc.Image('example', 'a.png') - assert.are_same(img.caption, {pandoc.Str 'example'}) - - img.caption = 'A' - assert.are_equal(img, pandoc.Image({'A'}, 'a.png')) + group "Inline elements" { + test('pandoc.AttributeList is a function', function () + assert.are_equal(type(pandoc.Cite), 'function') end), - test('has property `src`', function () - local img = pandoc.Image('example', 'sample.png') - assert.are_same(img.src, 'sample.png') - - img.src = 'example.svg' - assert.are_equal(img, pandoc.Image('example', 'example.svg')) + test('pandoc.AttributeList is a function', function () + assert.are_equal(type(pandoc.Code), 'function') end), - test('has property `title`', function () - local img = pandoc.Image('here', 'img.gif', 'example') - assert.are_same(img.title, 'example') - - img.title = 'a' - assert.are_equal(img, pandoc.Image('here', 'img.gif', 'a')) + test('pandoc.Emph is a function', function () + assert.are_equal(type(pandoc.Emph), 'function') end), - test('has property `attr`', function () - local img = pandoc.Image('up', 'upwards.png', '', {'up', {'point'}}) - assert.are_same(img.attr, pandoc.Attr {'up', {'point'}}) - - img.attr = pandoc.Attr {'up', {'point', 'button'}} - assert.are_equal( - pandoc.Image('up', 'upwards.png', nil, {'up', {'point', 'button'}}), - img - ) - end) - }, - group 'Link' { - test('has property `content`', function () - local link = pandoc.Link('example', 'https://example.org') - assert.are_same(link.content, {pandoc.Str 'example'}) - - link.content = 'commercial' - link.target = 'https://example.com' - assert.are_equal(link, pandoc.Link('commercial', 'https://example.com')) + test('pandoc.Image is a function', function () + assert.are_equal(type(pandoc.Image), 'function') end), - test('has property `target`', function () - local link = pandoc.Link('example', 'https://example.org') - assert.are_same(link.content, {pandoc.Str 'example'}) - - link.target = 'https://example.com' - assert.are_equal(link, pandoc.Link('example', 'https://example.com')) + test('pandoc.Link is a function', function () + assert.are_equal(type(pandoc.Link), 'function') end), - test('has property `title`', function () - local link = pandoc.Link('here', 'https://example.org', 'example') - assert.are_same(link.title, 'example') - - link.title = 'a' - assert.are_equal(link, pandoc.Link('here', 'https://example.org', 'a')) + test('pandoc.Math is a function', function () + assert.are_equal(type(pandoc.Math), 'function') end), - test('has property `attr`', function () - local link = pandoc.Link('up', '../index.html', '', {'up', {'nav'}}) - assert.are_same(link.attr, pandoc.Attr {'up', {'nav'}}) - - link.attr = pandoc.Attr {'up', {'nav', 'button'}} - assert.are_equal( - pandoc.Link('up', '../index.html', nil, {'up', {'nav', 'button'}}), - link - ) - end) - }, - group 'Math' { - test('has property `text`', function () - local elem = pandoc.Math(pandoc.InlineMath, 'x^2') - assert.are_same(elem.text, 'x^2') - elem.text = 'a + b' - assert.are_equal(elem, pandoc.Math(pandoc.InlineMath, 'a + b')) - end), - test('has property `mathtype`', function () - local elem = pandoc.Math(pandoc.InlineMath, 'x^2') - assert.are_same(elem.mathtype, 'InlineMath') - elem.mathtype = pandoc.DisplayMath - assert.are_equal(elem, pandoc.Math(pandoc.DisplayMath, 'x^2')) + test('pandoc.Note is a function', function () + assert.are_equal(type(pandoc.Note), 'function') end), - }, - group 'Note' { - test('has property `content`', function () - local elem = pandoc.Note{pandoc.Para {'two', pandoc.Space(), 'words'}} - assert.are_same( - elem.content, - {pandoc.Para {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'}} - ) - elem.content = pandoc.Plain 'word' - assert.are_equal(elem, pandoc.Note{'word'}) - end) - }, - group 'Quoted' { - test('has property `content`', function () - local elem = pandoc.Quoted('SingleQuote', pandoc.Emph{'emph'}) - assert.are_same( - elem.content, - {pandoc.Emph{pandoc.Str 'emph'}} - ) - elem.content = {'word'} - assert.are_equal(elem, pandoc.Quoted(pandoc.SingleQuote, {'word'})) - end), - test('has property `quotetype`', function () - local elem = pandoc.Quoted('SingleQuote', 'a') - assert.are_same(elem.quotetype, pandoc.SingleQuote) - elem.quotetype = 'DoubleQuote' - assert.are_equal(elem, pandoc.Quoted(pandoc.DoubleQuote, {'a'})) - end) - }, - group 'SmallCaps' { - test('has property `content`', function () - local elem = pandoc.SmallCaps{'two', pandoc.Space(), 'words'} - assert.are_same( - elem.content, - {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} - ) - elem.content = {'word'} - assert.are_equal(elem, pandoc.SmallCaps{'word'}) - end) - }, - group 'SoftBreak' { - test('can be constructed', function () - local sb = pandoc.SoftBreak() - assert.are_equal(sb.t, 'SoftBreak') - end) - }, - group 'Span' { - test('has property `attr`', function () - local elem = pandoc.Span('one', {'', {'number'}}) - assert.are_same( - elem.attr, - pandoc.Attr('', {'number'}) - ) - elem.attr = {'', {}, {{'a', 'b'}}} - assert.are_equal(elem, pandoc.Span({'one'}, {a='b'})) - end), - test('has property `content`', function () - local elem = pandoc.Span{'two', pandoc.Space(), 'words'} - assert.are_same( - elem.content, - {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} - ) - elem.content = {'word'} - assert.are_equal(elem, pandoc.Span{'word'}) - end) - }, - group 'Str' { - test('has property `text`', function () - local elem = pandoc.Str 'nein' - assert.are_same(elem.text, 'nein') - elem.text = 'doch' - assert.are_equal(elem, pandoc.Str 'doch') - end) - }, - group 'Strikeout' { - test('has property `content`', function () - local elem = pandoc.Strikeout{'two', pandoc.Space(), 'words'} - assert.are_same( - elem.content, - {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} - ) - elem.content = {'word'} - assert.are_equal(elem, pandoc.Strikeout{'word'}) - end) - }, - group 'Strong' { - test('has property `content`', function () - local elem = pandoc.Strong{'two', pandoc.Space(), 'words'} - assert.are_same( - elem.content, - {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} - ) - elem.content = {'word'} - assert.are_equal(elem, pandoc.Strong{'word'}) - end) - }, - group 'Subscript' { - test('has property `content`', function () - local elem = pandoc.Subscript{'two', pandoc.Space(), 'words'} - assert.are_same( - elem.content, - {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} - ) - elem.content = {'word'} - assert.are_equal(elem, pandoc.Subscript{'word'}) - end) - }, - group 'Superscript' { - test('has property `content`', function () - local elem = pandoc.Superscript{'two', pandoc.Space(), 'words'} - assert.are_same( - elem.content, - {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} - ) - elem.content = {'word'} - assert.are_equal(elem, pandoc.Superscript{'word'}) - end) - }, - group 'Underline' { - test('has property `content`', function () - local elem = pandoc.Underline{'two', pandoc.Space(), 'words'} - assert.are_same( - elem.content, - {pandoc.Str 'two', pandoc.Space(), pandoc.Str 'words'} - ) - elem.content = {'word'} - assert.are_equal(elem, pandoc.Underline{'word'}) - end) - }, - }, - group "Block elements" { - group 'BlockQuote' { - test('access content via property `content`', function () - local elem = pandoc.BlockQuote{'word'} - assert.are_same(elem.content, {pandoc.Plain 'word'}) - assert.are_equal(type(elem.content), 'table') - - elem.content = { - pandoc.Para{pandoc.Str 'one'}, - pandoc.Para{pandoc.Str 'two'} - } - assert.are_equal( - pandoc.BlockQuote{ - pandoc.Para 'one', - pandoc.Para 'two' - }, - elem - ) + test('pandoc.Quoted is a function', function () + assert.are_equal(type(pandoc.Quoted), 'function') end), - }, - group 'BulletList' { - test('access items via property `content`', function () - local para = pandoc.Para 'one' - local blist = pandoc.BulletList{{para}} - assert.are_same({{para}}, blist.content) - end), - test('property `content` uses fuzzy marshalling', function () - local old = pandoc.Plain 'old' - local new = pandoc.Plain 'new' - local blist = pandoc.BulletList{{old}} - blist.content = {{new}} - assert.are_same({{new}}, blist:clone().content) - blist.content = new - assert.are_same({{new}}, blist:clone().content) + test('pandoc.SmallCaps is a function', function () + assert.are_equal(type(pandoc.SmallCaps), 'function') end), - }, - group 'CodeBlock' { - test('access code via property `text`', function () - local cb = pandoc.CodeBlock('return true') - assert.are_equal(cb.text, 'return true') - assert.are_equal(type(cb.text), 'string') - - cb.text = 'return nil' - assert.are_equal(cb, pandoc.CodeBlock('return nil')) + test('pandoc.SoftBreak is a function', function () + assert.are_equal(type(pandoc.SoftBreak), 'function') end), - test('access Attr via property `attr`', function () - local cb = pandoc.CodeBlock('true', {'my-code', {'lua'}}) - assert.are_equal(cb.attr, pandoc.Attr{'my-code', {'lua'}}) - assert.are_equal(type(cb.attr), 'userdata') - - cb.attr = pandoc.Attr{'my-other-code', {'java'}} - assert.are_equal( - pandoc.CodeBlock('true', {'my-other-code', {'java'}}), - cb - ) - end) - }, - group 'DefinitionList' { - test('access items via property `content`', function () - local deflist = pandoc.DefinitionList{ - {'apple', {{pandoc.Plain 'fruit'}, {pandoc.Plain 'company'}}}, - {pandoc.Str 'coffee', 'Best when hot.'} - } - assert.are_equal(#deflist.content, 2) - assert.are_same(deflist.content[1][1], {pandoc.Str 'apple'}) - assert.are_same(deflist.content[1][2][2], - {pandoc.Plain{pandoc.Str 'company'}}) - assert.are_same(deflist.content[2][2], - {{pandoc.Plain{ - pandoc.Str 'Best', pandoc.Space(), - pandoc.Str 'when', pandoc.Space(), - pandoc.Str 'hot.'}}}) - end), - test('modify items via property `content`', function () - local deflist = pandoc.DefinitionList{ - {'apple', {{{'fruit'}}, {{'company'}}}} - } - deflist.content[1][1] = pandoc.Str 'orange' - deflist.content[1][2][1] = {pandoc.Plain 'tasty fruit'} - local newlist = pandoc.DefinitionList{ - { {pandoc.Str 'orange'}, - {{pandoc.Plain 'tasty fruit'}, {pandoc.Plain 'company'}} - } - } - assert.are_equal(deflist, newlist) + test('pandoc.Span is a function', function () + assert.are_equal(type(pandoc.Span), 'function') end), - }, - group 'Div' { - test('access content via property `content`', function () - local elem = pandoc.Div{pandoc.BlockQuote{pandoc.Plain 'word'}} - assert.are_same(elem.content, {pandoc.BlockQuote{'word'}}) - assert.are_equal(type(elem.content), 'table') - - elem.content = { - pandoc.Para{pandoc.Str 'one'}, - pandoc.Para{pandoc.Str 'two'} - } - assert.are_equal( - pandoc.Div{ - pandoc.Para 'one', - pandoc.Para 'two' - }, - elem - ) + test('pandoc.Str is a function', function () + assert.are_equal(type(pandoc.Str), 'function') end), - test('access Attr via property `attr`', function () - local div = pandoc.Div('word', {'my-div', {'sample'}}) - assert.are_equal(div.attr, pandoc.Attr{'my-div', {'sample'}}) - assert.are_equal(type(div.attr), 'userdata') - - div.attr = pandoc.Attr{'my-other-div', {'example'}} - assert.are_equal( - pandoc.Div('word', {'my-other-div', {'example'}}), - div - ) - end) - }, - group 'Header' { - test('access inlines via property `content`', function () - local header = pandoc.Header(1, 'test') - assert.are_same(header.content, {pandoc.Str 'test'}) - - header.content = {'new text'} - assert.are_equal(header, pandoc.Header(1, {'new text'})) + test('pandoc.Strikeout is a function', function () + assert.are_equal(type(pandoc.Strikeout), 'function') end), - test('access Attr via property `attr`', function () - local header = pandoc.Header(1, 'test', {'my-test'}) - assert.are_same(header.attr, pandoc.Attr{'my-test'}) - - header.attr = 'second-test' - assert.are_equal(header, pandoc.Header(1, 'test', 'second-test')) + test('pandoc.Strong is a function', function () + assert.are_equal(type(pandoc.Strong), 'function') end), - test('access level via property `level`', function () - local header = pandoc.Header(3, 'test') - assert.are_same(header.level, 3) - - header.level = 2 - assert.are_equal(header, pandoc.Header(2, 'test')) + test('pandoc.Subscript is a function', function () + assert.are_equal(type(pandoc.Subscript), 'function') end), - }, - group 'LineBlock' { - test('access lines via property `content`', function () - local spc = pandoc.Space() - local lineblock = pandoc.LineBlock{ - {'200', spc, 'Main', spc, 'St.'}, - {'Berkeley', spc, 'CA', spc, '94718'} - } - assert.are_equal(#lineblock.content, 2) -- has two lines - assert.are_same(lineblock.content[2][1], pandoc.Str 'Berkeley') - end), - test('modifying `content` alter the element', function () - local spc = pandoc.Space() - local lineblock = pandoc.LineBlock{ - {'200', spc, 'Main', spc, 'St.'}, - {'Berkeley', spc, 'CA', spc, '94718'} - } - lineblock.content[1][1] = '404' - assert.are_same( - lineblock:clone().content[1], - {pandoc.Str '404', spc, pandoc.Str 'Main', spc, pandoc.Str 'St.'} - ) - - lineblock.content = {{'line1'}, {'line2'}} - assert.are_same( - lineblock:clone(), - pandoc.LineBlock{ - {pandoc.Str 'line1'}, - {pandoc.Str 'line2'} - } - ) - end) - }, - group 'OrderedList' { - test('access items via property `content`', function () - local para = pandoc.Plain 'one' - local olist = pandoc.OrderedList{{para}} - assert.are_same({{para}}, olist.content) - end), - test('forgiving constructor', function () - local plain = pandoc.Plain 'old' - local olist = pandoc.OrderedList({plain}, {3, 'Example', 'Period'}) - local listAttribs = pandoc.ListAttributes(3, 'Example', 'Period') - assert.are_same(olist.listAttributes, listAttribs) - end), - test('has list attribute aliases', function () - local olist = pandoc.OrderedList({}, {4, 'Decimal', 'OneParen'}) - assert.are_equal(olist.start, 4) - assert.are_equal(olist.style, 'Decimal') - assert.are_equal(olist.delimiter, 'OneParen') - end) - }, - group 'Para' { - test('access inline via property `content`', function () - local para = pandoc.Para{'Moin, ', pandoc.Space(), 'Sylt!'} - assert.are_same( - para.content, - {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} - ) + test('pandoc.Superscript is a function', function () + assert.are_equal(type(pandoc.Superscript), 'function') end), - test('modifying `content` changes the element', function () - local para = pandoc.Para{'Moin, ', pandoc.Space(), pandoc.Str 'Sylt!'} - - para.content[3] = 'Hamburg!' - assert.are_same( - para:clone().content, - {pandoc.Str 'Moin, ', pandoc.Space(), pandoc.Str 'Hamburg!'} - ) - - para.content = 'Huh' - assert.are_same( - para:clone().content, - {pandoc.Str 'Huh'} - ) + test('pandoc.Underline is a function', function () + assert.are_equal(type(pandoc.Underline), 'function') end), }, - group 'RawBlock' { - test('access raw content via property `text`', function () - local raw = pandoc.RawBlock('markdown', '- one') - assert.are_equal(type(raw.text), 'string') - assert.are_equal(raw.text, '- one') - - raw.text = '+ one' - assert.are_equal(raw, pandoc.RawBlock('markdown', '+ one')) + group "Block elements" { + test('pandoc.BlockQuote is a function', function () + assert.are_equal(type(pandoc.BlockQuote), 'function') end), - test('access Format via property `format`', function () - local raw = pandoc.RawBlock('markdown', '* hi') - assert.are_equal(type(raw.format), 'string') - assert.are_equal(raw.format, 'markdown') - - raw.format = 'org' - assert.are_equal(pandoc.RawBlock('org', '* hi'), raw) - end) - }, - group 'Table' { - test('access Attr via property `attr`', function () - local caption = {long = {pandoc.Plain 'cap'}} - local tbl = pandoc.Table(caption, {}, {{}, {}}, {}, {{}, {}}, - {'my-tbl', {'a'}}) - assert.are_equal(tbl.attr, pandoc.Attr{'my-tbl', {'a'}}) - - tbl.attr = pandoc.Attr{'my-other-tbl', {'b'}} - assert.are_equal( - pandoc.Table(caption, {}, {{}, {}}, {}, {{}, {}}, - {'my-other-tbl', {'b'}}), - tbl - ) + test('pandoc.BulletList is a function', function () + assert.are_equal(type(pandoc.BulletList), 'function') end), - test('access caption via property `caption`', function () - local caption = {long = {pandoc.Plain 'cap'}} - local tbl = pandoc.Table(caption, {}, {{}, {}}, {}, {{}, {}}) - assert.are_same(tbl.caption, {long = {pandoc.Plain 'cap'}}) - - tbl.caption.short = 'brief' - tbl.caption.long = {pandoc.Plain 'extended'} - - local new_caption = { - short = 'brief', - long = {pandoc.Plain 'extended'} - } - assert.are_equal( - pandoc.Table(new_caption, {}, {{}, {}}, {}, {{}, {}}), - tbl - ) + test('pandoc.CodeBlock is a function', function () + assert.are_equal(type(pandoc.CodeBlock), 'function') end), - test('access column specifiers via property `colspecs`', function () - local colspecs = {{pandoc.AlignCenter, 1}} - local tbl = pandoc.Table({long = {}}, colspecs, {{}, {}}, {}, {{}, {}}) - assert.are_same(tbl.colspecs, colspecs) - - tbl.colspecs[1][1] = pandoc.AlignRight - tbl.colspecs[1][2] = nil - - local new_colspecs = {{pandoc.AlignRight}} - assert.are_equal( - pandoc.Table({long = {}}, new_colspecs, {{}, {}}, {}, {{}, {}}), - tbl - ) + test('pandoc.DefinitionList is a function', function () + assert.are_equal(type(pandoc.DefinitionList), 'function') end), - test('access table head via property `head`', function () - local head = {pandoc.Attr{'tbl-head'}, {}} - local tbl = pandoc.Table({long = {}}, {}, head, {}, {{}, {}}) - assert.are_same(tbl.head, head) - - tbl.head[1] = pandoc.Attr{'table-head'} - - local new_head = {'table-head', {}} - assert.are_equal( - pandoc.Table({long = {}}, {}, new_head, {}, {{}, {}}), - tbl - ) + test('pandoc.Div is a function', function () + assert.are_equal(type(pandoc.Div), 'function') end), - test('access table head via property `head`', function () - local foot = {{id = 'tbl-foot'}, {}} - local tbl = pandoc.Table({long = {}}, {}, {{}, {}}, {}, foot) - assert.are_same(tbl.foot, {pandoc.Attr('tbl-foot'), {}}) - - tbl.foot[1] = pandoc.Attr{'table-foot'} - - local new_foot = {'table-foot', {}} - assert.are_equal( - pandoc.Table({long = {}}, {}, {{}, {}}, {}, new_foot), - tbl - ) - end) - }, + test('pandoc.Header is a function', function () + assert.are_equal(type(pandoc.Header), 'function') + end), + test('pandoc.LineBlock is a function', function () + assert.are_equal(type(pandoc.LineBlock), 'function') + end), + test('pandoc.Null is a function', function () + assert.are_equal(type(pandoc.Null), 'function') + end), + test('pandoc.OrderedList is a function', function () + assert.are_equal(type(pandoc.OrderedList), 'function') + end), + test('pandoc.Para is a function', function () + assert.are_equal(type(pandoc.Para), 'function') + end), + test('pandoc.Plain is a function', function () + assert.are_equal(type(pandoc.Plain), 'function') + end), + test('pandoc.RawBlock is a function', function () + assert.are_equal(type(pandoc.Plain), 'function') + end), + test('pandoc.Table is a function', function () + assert.are_equal(type(pandoc.Table), 'function') + end), + } }, group 'MetaValue elements' { test('MetaList elements behave like lists', function () @@ -724,12 +133,6 @@ return { assert.are_equal(type(metalist.insert), 'function') assert.are_equal(type(metalist.remove), 'function') end), - test('MetaList, MetaMap, MetaInlines, MetaBlocks have `t` tag', function () - assert.are_equal((pandoc.MetaList{}).t, 'MetaList') - assert.are_equal((pandoc.MetaMap{}).t, 'MetaMap') - assert.are_equal((pandoc.MetaInlines{}).t, 'MetaInlines') - assert.are_equal((pandoc.MetaBlocks{}).t, 'MetaBlocks') - end), test('`tag` is an alias for `t``', function () assert.are_equal((pandoc.MetaList{}).tag, (pandoc.MetaList{}).t) assert.are_equal((pandoc.MetaMap{}).tag, (pandoc.MetaMap{}).t) @@ -756,81 +159,6 @@ return { end), }, group 'Other types' { - group 'Citation' { - test('checks equality by comparing Haskell values', function() - assert.are_equal( - pandoc.Citation('a', pandoc.NormalCitation), - pandoc.Citation('a', pandoc.NormalCitation) - ) - assert.is_falsy( - pandoc.Citation('a', pandoc.NormalCitation) == - pandoc.Citation('a', pandoc.AuthorInText) - ) - assert.is_falsy( - pandoc.Citation('a', pandoc.NormalCitation) == - pandoc.Citation('b', pandoc.NormalCitation) - ) - end), - }, - group 'SimpleTable' { - test('can access properties', function () - local spc = pandoc.Space() - local caption = {pandoc.Str 'Languages', spc, pandoc.Str 'overview.'} - local aligns = {pandoc.AlignDefault, pandoc.AlignDefault} - local widths = {0, 0} -- let pandoc determine col widths - local headers = {{pandoc.Plain({pandoc.Str "Language"})}, - {pandoc.Plain({pandoc.Str "Typing"})}} - local rows = { - {{pandoc.Plain "Haskell"}, {pandoc.Plain "static"}}, - {{pandoc.Plain "Lua"}, {pandoc.Plain "Dynamic"}}, - } - local simple_table = pandoc.SimpleTable( - caption, - aligns, - widths, - headers, - rows - ) - assert.are_same(simple_table.caption, caption) - assert.are_same(simple_table.aligns, aligns) - assert.are_same(simple_table.widths, widths) - assert.are_same(simple_table.headers, headers) - assert.are_same(simple_table.rows, rows) - end), - test('can modify properties', function () - local new_table = pandoc.SimpleTable( - {'Languages'}, - {pandoc.AlignDefault, pandoc.AlignDefault}, - {0.5, 0.5}, - {{pandoc.Plain({pandoc.Str "Language"})}, - {pandoc.Plain({pandoc.Str "Typing"})}}, - { - {{pandoc.Plain "Haskell"}, {pandoc.Plain "static"}}, - {{pandoc.Plain "Lua"}, {pandoc.Plain "Dynamic"}}, - } - ) - - new_table.caption = {pandoc.Str 'Good', pandoc.Space(), - pandoc.Str 'languages'} - new_table.aligns[1] = pandoc.AlignLeft - new_table.widths = {0, 0} - new_table.headers[2] = {pandoc.Plain{pandoc.Str 'compiled/interpreted'}} - new_table.rows[1][2] = {pandoc.Plain{pandoc.Str 'both'}} - new_table.rows[2][2] = {pandoc.Plain{pandoc.Str 'interpreted'}} - - local expected_table = pandoc.SimpleTable( - {pandoc.Str 'Good', pandoc.Space(), pandoc.Str 'languages'}, - {pandoc.AlignLeft, pandoc.AlignDefault}, - {0, 0}, - {{pandoc.Plain 'Language'}, {pandoc.Plain 'compiled/interpreted'}}, - { - {{pandoc.Plain 'Haskell'}, {pandoc.Plain 'both'}}, - {{pandoc.Plain 'Lua'}, {pandoc.Plain 'interpreted'}} - } - ) - assert.are_same(expected_table, new_table) - end) - }, group 'ReaderOptions' { test('returns a userdata value', function () local opts = pandoc.ReaderOptions {} -- cgit v1.2.3 From 4874f2dbd24ef8dbc078a1b81184c91524c93efb Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 28 Nov 2021 10:23:31 +0100 Subject: Use published pandoc-lua-marshal package --- cabal.project | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cabal.project b/cabal.project index 7164f9978..669dd74e2 100644 --- a/cabal.project +++ b/cabal.project @@ -3,11 +3,6 @@ tests: True flags: +embed_data_files constraints: aeson >= 2.0.1.0 -source-repository-package - type: git - location: https://github.com/tarleb/pandoc-lua-marshal.git - tag: 56387e543c48cc5518a77c2a271ff211653f2a36 - -- source-repository-package -- type: git -- location: https://github.com/jgm/texmath.git -- cgit v1.2.3 From b9222e5cb1d8d1d3217f65c6a91886b897956dde Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 28 Nov 2021 15:07:30 +0100 Subject: Lua: add constructors `pandoc.Blocks` and `pandoc.Inlines` The functions convert their argument into a list of Block and Inline values, respectively. --- doc/lua-filters.md | 37 +++++++++++++++++++++++++++++++++++- src/Text/Pandoc/Lua/Module/Pandoc.hs | 2 ++ test/lua/module/pandoc.lua | 6 ++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index db5d1ccac..f24a66579 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -2074,7 +2074,7 @@ format, and functions to filter and modify a subtree. Returns: [MetaBool] object -## Blocks +## Block [`BlockQuote (content)`]{#pandoc.blockquote} @@ -2254,6 +2254,20 @@ format, and functions to filter and modify a subtree. Returns: [Table](#type-table) object +## Blocks + +[`Blocks (block_like_elements)`]{#pandoc.blocks} + +: Creates a [Blocks](#type-blocks) list. + + Parameters: + + `block_like_elements`: + : List where each element can be treated as a [Block] + value, or a single such value. + + Returns: [Blocks] list + ## Inline [`Cite (content, citations)`]{#pandoc.cite} @@ -2543,6 +2557,27 @@ format, and functions to filter and modify a subtree. Returns: [Underline](#type-underline) object +## Inlines + +[`Inlines (inline_like_elements)`]{#pandoc.inlines} + +: Converts its argument into an [Inlines](#type-inlines) list: + + - copies a list of [Inline] elements into a fresh list; any + string `s` within the list is treated as `pandoc.Str(s)`; + - turns a single [Inline] into a singleton list; + - splits a string into `Str`-wrapped words, treating + interword spaces as `Space`s or `SoftBreak`s. + + Parameters: + + `inline_like_elements`: + : List where each element can be treated as an [Inline] + values, or just a single such value. + + Returns: [Inlines] list + + ## Element components [`Attr ([identifier[, classes[, attributes]]])`]{#pandoc.attr} diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 085d904cf..e932ca59a 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -117,7 +117,9 @@ otherConstructors = , mkMeta , mkAttr , mkAttributeList + , mkBlocks , mkCitation + , mkInlines , mkListAttributes , mkSimpleTable diff --git a/test/lua/module/pandoc.lua b/test/lua/module/pandoc.lua index 1cf777675..892ffee03 100644 --- a/test/lua/module/pandoc.lua +++ b/test/lua/module/pandoc.lua @@ -19,9 +19,15 @@ return { test('pandoc.AttributeList is a function', function () assert.are_equal(type(pandoc.AttributeList), 'function') end), + test('pandoc.Blocks is a function', function () + assert.are_equal(type(pandoc.Blocks), 'function') + end), test('pandoc.Citation is a function', function () assert.are_equal(type(pandoc.Citation), 'function') end), + test('pandoc.Inlines is a function', function () + assert.are_equal(type(pandoc.Inlines), 'function') + end), test('pandoc.SimpleTable is a function', function () assert.are_equal(type(pandoc.SimpleTable), 'function') end), -- cgit v1.2.3 From 32a4c331d2860d31b47358c8ac91c73d9d614cd6 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 28 Nov 2021 14:34:01 +0100 Subject: doc/lua-filters.md: update docs on Blocks, Inlines, MetaValue --- doc/lua-filters.md | 154 +++++++++++++++++++++++++++-------------------------- 1 file changed, 79 insertions(+), 75 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index f24a66579..ff56e1a8e 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -804,68 +804,31 @@ determined via [`pandoc.utils.equals`]. ## MetaValue {#type-metavalue} -Document meta information items. - -Object equality is determined via [`pandoc.utils.equals`]. - -### MetaBlocks {#type-metablocks} - -A list of blocks usable as meta value ([List] of [Blocks]). - -Fields: - -`tag`, `t` -: the literal `MetaBlocks` (string) - -### MetaBool {#type-metabool} - -Alias for Lua boolean, i.e. the values `true` and `false`. - -### MetaInlines {#type-metainlines} - -List of inlines used in metadata ([List] of [Inlines]) - -Values of this type can be created with the -[`pandoc.MetaInlines`](#pandoc.metainlines) constructor. - -Fields: - -`tag`, `t` -: the literal `MetaInlines` (string) - -### MetaList {#type-metalist} - -A list of other metadata values ([List] of [MetaValues]). - -Values of this type can be created with the -[`pandoc.MetaList`](#pandoc.metalist) constructor. - -Fields: - -`tag`, `t` -: the literal `MetaList` (string) - -All methods available for [List]s can be used on this type as -well. - -### MetaMap {#type-metamap} - -A string-indexed map of meta-values. (table). - -Values of this type can be created with the -[`pandoc.MetaMap`](#pandoc.metamap) constructor. - -Fields: - -`tag`, `t` -: the literal `MetaMap` (string) - -*Note*: The fields will be shadowed if the map contains a field -with the same name as those listed. - -### MetaString {#type-metastring} - -Plain Lua string value (string). +Document meta information items. This is not a separate type, but +describes a set of types that can be used in places were a +MetaValue is expected. The types correspond to the following +Haskell type constructors: + +- boolean → MetaBool +- string → MetaString +- Inlines → MetaInlines +- Blocks → MetaBlocks +- List/integer indexed table → MetaList +- string-indexed table → MetaMap + +The corresponding constructors +[`pandoc.MetaBool`](#pandoc.metabool), +[`pandoc.MetaString`](#pandoc.metastring), +[`pandoc.MetaInlines`](#pandoc.metainlines), +[`pandoc.MetaBlocks`](#pandoc.metablocks), +[`pandoc.MetaList`](#pandoc.metalist), and +[`pandoc.MetaMap`](#pandoc.metamap) +can be used to ensure that a value is treated in the intended +way. E.g., an empty table is normally treated as a `MetaMap`, but +can be made into an empty `MetaList` by calling +`pandoc.MetaList{}`. However, the same can be accomplished by +using the generic functions like `pandoc.List`, `pandoc.Inlines`, +or `pandoc.Blocks`. ## Block {#type-block} @@ -1165,9 +1128,23 @@ left-aligned, right-aligned, and centered, respectively. The default alignment is `AlignDefault` (often equivalent to centered). +## Blocks {#type-blocks} + +List of [Block] elements, with the same methods as a generic +[List](#type-list). It is usually not necessary to create values +of this type in user scripts, as pandoc can convert other types +into Blocks wherever a value of this type is expected: + +- a list of [Block] (or Block-like) values is used directly; +- a single [Inlines] value is wrapped into a [Plain] element; +- string values are turned into an [Inlines] value by splitting + the string into words (see [Inlines](#type-inlines)), and + then wrapping the result into a Plain singleton. + ## Inline {#type-inline} -Object equality is determined via [`pandoc.utils.equals`]. +Object equality is determined by checking the Haskell +representation for equality. ### Cite {#type-cite} @@ -1535,6 +1512,20 @@ Fields: `tag`, `t` : the literal `Underline` (string) +## Inlines {#type-inlines} + +List of [Inline] elements, with the same methods as a generic +[List](#type-list). It is usually not necessary to create values +of this type in user scripts, as pandoc can convert other types +into Blocks wherever a value of this type is expected: + +- lists of [Inline] (or Inline-like) values are used directly; +- single [Inline] values are converted into a list containing + just that element; +- String values are split into words, converting line breaks + into [SoftBreak](#type-softbreak) elements, and other + whitespace characters into [Spaces](#type-space). + ## Element components @@ -1916,6 +1907,7 @@ Usage: [LogMessage]: #type-logmessage [Pandoc]: #type-pandoc [Para]: #type-para +[Plain]: #type-plain [Rows]: #type-row [SimpleTable]: #type-simpletable [Table]: #type-table @@ -2010,69 +2002,81 @@ format, and functions to filter and modify a subtree. [`MetaBlocks (blocks)`]{#pandoc.metablocks} -: Meta blocks +: Creates a value to be used as a MetaBlocks value in meta + data; creates a copy of the input list via `pandoc.Blocks`, + discarding all non-list keys. Parameters: `blocks`: : blocks - Returns: [MetaBlocks] object + Returns: [Blocks](#type-blocks) [`MetaInlines (inlines)`]{#pandoc.metainlines} -: Meta inlines +: Creates a value to be used as a MetaInlines value in meta + data; creates a copy of the input list via `pandoc.Inlines`, + discarding all non-list keys. Parameters: `inlines`: : inlines - Returns: [MetaInlines] object + Returns: [Inlines](#types-inlines) [`MetaList (meta_values)`]{#pandoc.metalist} -: Meta list +: Creates a value to be used as a MetaList in meta data; + creates a copy of the input list via `pandoc.List`, + discarding all non-list keys. Parameters: `meta_values`: : list of meta values - Returns: [MetaList] object + Returns: [List] [`MetaMap (key_value_map)`]{#pandoc.metamap} -: Meta map +: Creates a value to be used as a MetaMap in meta data; creates + a copy of the input table, keeping only pairs with string + keys and discards all other keys. Parameters: `key_value_map`: : a string-indexed map of meta values - Returns: [MetaMap] object + Returns: table [`MetaString (str)`]{#pandoc.metastring} -: Creates string to be used in meta data. +: Creates a value to be used as a MetaString in meta data; this + is the identity function for boolean values and exists only + for completeness. Parameters: `str`: : string value - Returns: [MetaString] object + Returns: string [`MetaBool (bool)`]{#pandoc.metabool} -: Creates boolean to be used in meta data. +: Creates a value to be used as MetaBool in meta data; this is + the identity function for boolean values and exists only for + completeness. Parameters: `bool`: : boolean value - Returns: [MetaBool] object + Returns: boolean ## Block -- cgit v1.2.3 From c5287e9de5f3ebfa5b86a37f81e4a75233b6ad4d Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 28 Nov 2021 16:19:34 +0100 Subject: stack.yaml: use pandoc-lua-marshal-0.1.0.1 --- stack.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stack.yaml b/stack.yaml index 71c25c0be..a7ab8841f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -26,6 +26,7 @@ extra-deps: - lua-2.0.2 - tasty-hslua-1.0.0 - tasty-lua-1.0.0 +- pandoc-lua-marshal-0.1.0.1 - pandoc-types-1.22.1 - commonmark-0.2.1.1 - commonmark-extensions-0.2.2 @@ -33,8 +34,6 @@ extra-deps: - aeson-pretty-0.8.9 - ipynb-0.1.0.2 - texmath-0.12.3.3 -- git: https://github.com/tarleb/hslua-pandoc-types.git - commit: 56387e543c48cc5518a77c2a271ff211653f2a36 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From e30be56fc36409c4e5520ef09daeb8d3ddeab294 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 28 Nov 2021 17:43:17 -0800 Subject: Bump pandoc-lua-marshall lower bound to 0.1.0.1 in cabal file. Closes #7721. --- pandoc.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandoc.cabal b/pandoc.cabal index e7d1349fc..42e28d086 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -477,7 +477,7 @@ library mtl >= 2.2 && < 2.3, network >= 2.6, network-uri >= 2.6 && < 2.8, - pandoc-lua-marshal >= 0.1 && < 0.2, + pandoc-lua-marshal >= 0.1.0.1 && < 0.2, pandoc-types >= 1.22.1 && < 1.23, parsec >= 3.1 && < 3.2, pretty >= 1.1 && < 1.2, -- cgit v1.2.3 From 136739b7ed6dbd4052be582febf4ff3beea32d87 Mon Sep 17 00:00:00 2001 From: Mauro Bieg Date: Mon, 29 Nov 2021 17:59:37 +0100 Subject: fix typo in custom-readers.md (#7722) --- doc/custom-readers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/custom-readers.md b/doc/custom-readers.md index c85b43ae4..afa0caa73 100644 --- a/doc/custom-readers.md +++ b/doc/custom-readers.md @@ -14,7 +14,7 @@ install any additional software to do this. [Lua]: https://www.lua.org -A custom writer is a Lua file that defines a function +A custom reader is a Lua file that defines a function called `Reader`, which takes two arguments: - a string, the raw input to be parsed -- cgit v1.2.3 From fa838deefc6badc62b9ca4d93aba55e9fbd747ec Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 29 Nov 2021 18:12:30 +0100 Subject: Lua: remove `pandoc.utils.text` (#7720) The new `pandoc.Inlines` function behaves identical on string input, but allows other Inlines-like arguments as well. The `pandoc.utils.text` function could be written as function pandoc.utils.text (x) assert(type(x) == 'string') return pandoc.Inlines(x) end --- doc/lua-filters.md | 18 ------------------ src/Text/Pandoc/Lua/Module/Utils.hs | 8 -------- test/lua/module/pandoc-utils.lua | 28 ---------------------------- 3 files changed, 54 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index ff56e1a8e..ac682a90d 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3121,24 +3121,6 @@ Usage: -- outputs "Moin" print(pandoc.utils.stringify(inline)) -### text {#pandoc.utils.text} - -`text (words)` - -Converts a string to `Inlines`, treating interword spaces as -`Space`s or `SoftBreak`s. If you want a single `Str` with literal -spaces, use `pandoc.Str`. - -Parameters: - -`words` -: markup-less text (string) - -Returns: - -- List of inline elements split into words (Inlines) - - ### to\_roman\_numeral {#pandoc.utils.to_roman_numeral} `to_roman_numeral (integer)` diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 917f2e627..8bb185500 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -115,14 +115,6 @@ documentedModule = Module <#> parameter peekAstElement "AST element" "elem" "some pandoc AST element" =#> functionResult pushText "string" "stringified element" - , defun "text" - ### liftPure (B.toList . B.text) - <#> parameter peekText "string" "words" "markup-less inlines text" - =#> functionResult pushInlines "Inlines" "list of inline elements" - #? ("Converts a string to `Inlines`, treating interword spaces as " <> - "`Space`s or `SoftBreak`s. If you want a `Str` with literal " <> - "spaces, use `pandoc.Str`.") - , defun "from_simple_table" ### from_simple_table <#> parameter peekSimpleTable "SimpleTable" "simple_tbl" "" diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua index 21f550177..9bd903f2d 100644 --- a/test/lua/module/pandoc-utils.lua +++ b/test/lua/module/pandoc-utils.lua @@ -82,34 +82,6 @@ return { end) }, - group 'text' { - test('string is converted to inlines', function () - local expected = { - pandoc.Str 'Madness', pandoc.Space(), pandoc.Str '-', pandoc.Space(), - pandoc.Str 'Our', pandoc.Space(), pandoc.Str 'House' - } - assert.are_same(pandoc.utils.text('Madness - Our House'), expected) - end), - test('tabs are treated as space', function () - local expected = { - pandoc.Str 'Linkin', pandoc.Space(), pandoc.Str 'Park', pandoc.Space(), - pandoc.Str '-', pandoc.Space(), pandoc.Str 'Papercut' - } - assert.are_same(pandoc.utils.text('Linkin Park\t-\tPapercut'), expected) - end), - test('newlines are treated as softbreaks', function () - local expected = { - pandoc.Str 'Porcupine', pandoc.Space(), pandoc.Str 'Tree', - pandoc.SoftBreak(), pandoc.Str '-', pandoc.SoftBreak(), - pandoc.Str 'Blackest', pandoc.Space(), pandoc.Str 'Eyes' - } - assert.are_same( - pandoc.utils.text('Porcupine Tree\n-\nBlackest Eyes'), - expected - ) - end), - }, - group 'to_roman_numeral' { test('convertes number', function () assert.are_equal('MDCCCLXXXVIII', utils.to_roman_numeral(1888)) -- cgit v1.2.3 From 426342f00d13eb6a899961715961975b113f9792 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 30 Nov 2021 08:25:15 -0800 Subject: Fix typo. Closes jgm/pandoc-website#54. --- MANUAL.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANUAL.txt b/MANUAL.txt index 0038f16cf..fe551bbce 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5332,7 +5332,7 @@ for regular emphasis, add extra blank space around headings. Include source position attributes when parsing `commonmark`. For elements that accept attributes, a `data-pos` attribute is added; other elements are placed in a surrounding -Div or Span elemnet with a `data-pos` attribute. +Div or Span element with a `data-pos` attribute. #### Extension: `short_subsuperscripts` #### -- cgit v1.2.3 From 6e712fa10a9f6c2f562479acf8024f2fb529bb68 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 30 Nov 2021 10:12:42 -0800 Subject: Update cabal description. --- pandoc.cabal | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/pandoc.cabal b/pandoc.cabal index 42e28d086..915998c44 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -15,31 +15,35 @@ tested-with: GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.1 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 - this library. It can read several dialects of Markdown and - (subsets of) HTML, reStructuredText, LaTeX, DocBook, JATS, - MediaWiki markup, DokuWiki markup, TWiki markup, - TikiWiki markup, Jira markup, Creole 1.0, Haddock markup, - OPML, Emacs Org-Mode, Emacs Muse, txt2tags, ipynb (Jupyter - notebooks), Vimwiki, Word Docx, ODT, EPUB, FictionBook2, - roff man, Textile, BibTeX, BibLaTeX, CSL JSON, - , and CSV, and it can write Markdown, - reStructuredText, XHTML, HTML 5, LaTeX, ConTeXt, DocBook, - JATS, OPML, TEI, OpenDocument, ODT, Word docx, - PowerPoint pptx, RTF, MediaWiki, DokuWiki, XWiki, - ZimWiki, Textile, Jira, roff man, roff ms, plain text, - Emacs Org-Mode, AsciiDoc, Haddock markup, - EPUB (v2 and v3), ipynb, FictionBook2, - InDesign ICML, Muse, CSL JSON, LaTeX beamer slides, - and several kinds of HTML/JavaScript slide shows - (S5, Slidy, Slideous, DZSlides, reveal.js). + this library. The formats it can handle include . - In contrast to most existing tools for converting Markdown - to HTML, pandoc has a modular design: it consists of a set of - readers, which parse text in a given format and produce a - native representation of the document, and a set of writers, - which convert this native representation into a target - format. Thus, adding an input or output format requires - only adding a reader or writer. + - light markup formats (many variants of Markdown, + reStructuredText, AsciiDoc, Org-mode, Muse, Textile, + txt2tags) + - HTML formats (HTML 4 and 5) + - Ebook formats (EPUB v2 and v3, FB2) + - Documentation formats (GNU TexInfo, Haddock) + - Roff formats (man, ms) + - TeX formats (LaTeX, ConTeXt) + - XML formats (DocBook 4 and 5, JATS, TEI Simple, OpenDocument) + - Outline formats (OPML) + - Bibliography formats (BibTeX, BibLaTeX, CSL JSON, CSL YAML) + - Word processor formats (Docx, RTF, ODT) + - Interactive notebook formats (Jupyter notebook ipynb) + - Page layout formats (InDesign ICML) + - Wiki markup formats (MediaWiki, DokuWiki, TikiWiki, TWiki, + Vimwiki, XWiki, ZimWiki, Jira wiki, Creole) + - Slide show formats (LaTeX Beamer, PowerPoint, Slidy, + reveal.js, Slideous, S5, DZSlides) + - Data formats (CSV tables) + - PDF (via external programs such as pdflatex or wkhtmltopdf) + . + Pandoc can convert mathematical content in documents + between TeX, MathML, Word equations, roff eqn, and plain text. + It includes a powerful system for automatic citations + and bibliographies, and it can be customized extensively + using templates, filters, and custom readers and writers + written in Lua. data-files: -- templates data/templates/styles.html -- cgit v1.2.3 From 619dfa2a2a19a8433424e830a21384c7b520866a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 30 Nov 2021 12:53:54 -0800 Subject: Markdown reader: don't allow `^` at beginning of link or image label. This is reserved for footnotes. Fixes a regression introduced by 0a93acf. Closes #7723. --- src/Text/Pandoc/Readers/Markdown.hs | 3 +-- test/command/7723.md | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 test/command/7723.md diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index b72ab22e2..0d4592599 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1775,8 +1775,7 @@ endline = try $ do -- a reference label for a link reference :: PandocMonad m => MarkdownParser m (F Inlines, Text) reference = do - -- guardDisabled Ext_footnotes <|> notFollowedBy' (string "[^") - -- guardDisabled Ext_citations <|> notFollowedBy' (string "[@") + guardDisabled Ext_footnotes <|> notFollowedBy' (string "[^") withRaw $ trimInlinesF <$> inlinesInBalancedBrackets parenthesizedChars :: PandocMonad m => MarkdownParser m Text diff --git a/test/command/7723.md b/test/command/7723.md new file mode 100644 index 000000000..f3229eb1e --- /dev/null +++ b/test/command/7723.md @@ -0,0 +1,8 @@ +``` +% pandoc -t native +Bug![^1] + +[^1]: Note. +^D +[ Para [ Str "Bug!" , Note [ Para [ Str "Note." ] ] ] ] +``` -- cgit v1.2.3 From 9dfd9eff6d2f060c121f1e0a5857e92cba55847f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 30 Nov 2021 23:57:37 -0800 Subject: Remove useless first heading in changelog. --- changelog.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/changelog.md b/changelog.md index 300dc0130..4b0eb59dd 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,3 @@ -# Revision history for pandoc - ## pandoc 2.16.2 (2021-11-21) * Add interface for custom readers written in Lua (#7669). -- cgit v1.2.3 From 26d0a1052e79edeed078add56c2f4555df506a2e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 1 Dec 2021 00:00:17 -0800 Subject: Re-add top heading in changelog but as a level-1 heading. --- changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.md b/changelog.md index 4b0eb59dd..300dc0130 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ +# Revision history for pandoc + ## pandoc 2.16.2 (2021-11-21) * Add interface for custom readers written in Lua (#7669). -- cgit v1.2.3 From 0892af33ae9526814b32af4522b995324ffdddc3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 2 Dec 2021 08:28:18 -0800 Subject: Suggest VSCode as a possible editor in getting-started.md. --- doc/getting-started.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/getting-started.md b/doc/getting-started.md index a8f7315fd..b73923daa 100644 --- a/doc/getting-started.md +++ b/doc/getting-started.md @@ -212,6 +212,7 @@ Now save your file as `test1.md` in the directory Note: If you use plain text a lot, you'll want a better editor than `Notepad` or `TextEdit`. You might want to look at +[Visual Studio Code](https://code.visualstudio.com/) or [Sublime Text](https://www.sublimetext.com/) or (if you're willing to put in some time learning an unfamiliar interface) [Vim](https://www.vim.org) or [Emacs](https://www.gnu.org/software/emacs). -- cgit v1.2.3 From 928c120806279579100c7327e92fae21b51a94b4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 2 Dec 2021 09:00:33 -0800 Subject: Allow unicode-transforms 0.4.0. --- pandoc.cabal | 2 +- stack.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pandoc.cabal b/pandoc.cabal index 915998c44..0e064957b 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -501,7 +501,7 @@ library text-conversions >= 0.3 && < 0.4, time >= 1.5 && < 1.14, unicode-collation >= 0.1.1 && < 0.2, - unicode-transforms >= 0.3 && < 0.4, + unicode-transforms >= 0.3 && < 0.5, xml >= 1.3.12 && < 1.4, xml-conduit >= 1.9.1.1 && < 1.10, yaml >= 0.11 && < 0.12, diff --git a/stack.yaml b/stack.yaml index a7ab8841f..bdaa0b3d1 100644 --- a/stack.yaml +++ b/stack.yaml @@ -34,6 +34,8 @@ extra-deps: - aeson-pretty-0.8.9 - ipynb-0.1.0.2 - texmath-0.12.3.3 +- unicode-transforms-0.4.0 +- unicode-data-0.2.0 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From 51f6f0e3a1533a0e1bb94538f55bdc9db380a028 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 3 Dec 2021 17:52:47 -0800 Subject: Improve Markdown writer escaping. This fixes escaping for '#' in particular. Closes #7726. --- src/Text/Pandoc/Writers/Markdown/Inline.hs | 37 +++++++++++++++--------------- test/command/3792.md | 2 +- test/command/4164.md | 2 +- test/command/7208.md | 2 +- test/command/7726.md | 22 ++++++++++++++++++ test/command/biblatex-sigfridsson.md | 2 +- test/writer.opml | 2 +- 7 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 test/command/7726.md diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs index be22f8d9f..e774b5cc4 100644 --- a/src/Text/Pandoc/Writers/Markdown/Inline.hs +++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs @@ -44,32 +44,35 @@ import Text.Pandoc.Writers.Markdown.Types (MarkdownVariant(..), -- | Escape special characters for Markdown. escapeText :: WriterOptions -> Text -> Text -escapeText opts = T.pack . go . T.unpack +escapeText opts = T.pack . go' . T.unpack where startsWithSpace (' ':_) = True startsWithSpace ('\t':_) = True startsWithSpace [] = True startsWithSpace _ = False + go' ('#':cs) + | isEnabled Ext_space_in_atx_header opts + = if startsWithSpace (dropWhile (=='#') cs) + then '\\':'#':go cs + else '#':go cs + | otherwise = '\\':'#':go cs + go' ('@':cs) + | isEnabled Ext_citations opts = + case cs of + (d:_) + | isAlphaNum d || d == '_' || d == '{' + -> '\\':'@':go cs + _ -> '@':go cs + go' cs = go cs go [] = [] go (c:cs) = case c of - '<' | isEnabled Ext_all_symbols_escapable opts -> - '\\' : '<' : go cs - | otherwise -> "<" ++ go cs - '>' | isEnabled Ext_all_symbols_escapable opts -> - '\\' : '>' : go cs - | otherwise -> ">" ++ go cs - '@' | isEnabled Ext_citations opts -> - case cs of - (d:_) - | isAlphaNum d || d == '_' || d == '{' - -> '\\':'@':go cs - _ -> '@':go cs - '#' | isEnabled Ext_space_in_atx_header opts - , startsWithSpace cs - -> '\\':'#':go cs _ | c `elem` ['\\','`','*','_','[',']'] -> '\\':c:go cs + '>' | isEnabled Ext_all_symbols_escapable opts -> '\\':'>':go cs + | otherwise -> ">" ++ go cs + '<' | isEnabled Ext_all_symbols_escapable opts -> '\\':'<':go cs + | otherwise -> "<" ++ go cs '|' | isEnabled Ext_pipe_tables opts -> '\\':'|':go cs '^' | isEnabled Ext_superscript opts -> '\\':'^':go cs '~' | isEnabled Ext_subscript opts || @@ -90,8 +93,6 @@ escapeText opts = T.pack . go . T.unpack | isEnabled Ext_intraword_underscores opts , isAlphaNum c , isAlphaNum x -> c : '_' : x : go xs - '#':xs -> c : '#' : go xs - '>':xs -> c : '>' : go xs _ -> c : go cs attrsToMarkdown :: Attr -> Doc Text diff --git a/test/command/3792.md b/test/command/3792.md index eff26d517..eb109b9cc 100644 --- a/test/command/3792.md +++ b/test/command/3792.md @@ -6,7 +6,7 @@ and properly escaped. ok ^D --- -title: \ \*that\* +title: \ \*that\* --- ok diff --git a/test/command/4164.md b/test/command/4164.md index 68cbd0584..4e7b7e285 100644 --- a/test/command/4164.md +++ b/test/command/4164.md @@ -26,6 +26,6 @@ Here is inline html: Here is inline html: -\
      \ bla bla \
      +\ \ bla bla \ ``` diff --git a/test/command/7208.md b/test/command/7208.md index fe02ec32e..e65943ade 100644 --- a/test/command/7208.md +++ b/test/command/7208.md @@ -2,5 +2,5 @@ % pandoc -t gfm \ ^D -\ +\ ``` diff --git a/test/command/7726.md b/test/command/7726.md new file mode 100644 index 000000000..bab11ca04 --- /dev/null +++ b/test/command/7726.md @@ -0,0 +1,22 @@ +``` +% pandoc -t markdown +\# Hi + +\## Hi + +\### Hi + +\#### hi + +and #hi +^D +\# Hi + +\## Hi + +\### Hi + +\#### hi + +and #hi +``` diff --git a/test/command/biblatex-sigfridsson.md b/test/command/biblatex-sigfridsson.md index e042a8762..f83c35622 100644 --- a/test/command/biblatex-sigfridsson.md +++ b/test/command/biblatex-sigfridsson.md @@ -90,7 +90,7 @@ references: - family: Ryde given: Ulf container-title: Journal of Computational Chemistry - doi: "10.1002/(SICI)1096-987X(199803)19:4\\<377::AID-JCC1>3.0.CO;2-P" + doi: "10.1002/(SICI)1096-987X(199803)19:4\\<377::AID-JCC1\\>3.0.CO;2-P" id: sigfridsson issue: 4 issued: 1998 diff --git a/test/writer.opml b/test/writer.opml index bfe1e5de6..6bdcb882e 100644 --- a/test/writer.opml +++ b/test/writer.opml @@ -52,7 +52,7 @@ - + -- cgit v1.2.3 From 36807db531d1b65a25fee9bf3afd4ece60f12041 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 5 Dec 2021 11:26:01 -0800 Subject: Commonmark writer: allow ')' delimiters on ordered lists. --- src/Text/Pandoc/Writers/Markdown.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 96de5e0cd..022dbc24f 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -588,7 +588,12 @@ blockToMarkdown' opts (OrderedList (start,sty,delim) items) = do then start else 1 let sty' = if isEnabled Ext_fancy_lists opts then sty else DefaultStyle - let delim' = if isEnabled Ext_fancy_lists opts then delim else DefaultDelim + let delim' = if isEnabled Ext_fancy_lists opts + then delim + else if variant == Commonmark && + (delim == OneParen || delim == TwoParens) + then OneParen -- commonmark only supports one paren + else DefaultDelim let attribs = (start', sty', delim') let markers = orderedListMarkers attribs let markers' = map (\m -> if T.length m < 3 -- cgit v1.2.3 From 23b2617bf782c68ae9b46d6bb23812dc7081be3e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 6 Dec 2021 12:00:08 -0800 Subject: Ms writer: properly encode strings for PDF contents. Closes #7731. --- src/Text/Pandoc/Writers/Ms.hs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs index eeb8eca62..53763a609 100644 --- a/src/Text/Pandoc/Writers/Ms.hs +++ b/src/Text/Pandoc/Writers/Ms.hs @@ -21,7 +21,7 @@ TODO: module Text.Pandoc.Writers.Ms ( writeMs ) where import Control.Monad.State.Strict -import Data.Char (isLower, isUpper, ord) +import Data.Char (isAscii, isLower, isUpper, ord) import Data.List (intercalate, intersperse) import Data.List.NonEmpty (nonEmpty) import qualified Data.Map as Map @@ -46,6 +46,8 @@ import Text.Pandoc.Writers.Shared import Text.Pandoc.Writers.Roff import Text.Printf (printf) import Text.TeXMath (writeEqn) +import qualified Data.Text.Encoding as TE +import qualified Data.ByteString as B -- | Convert Pandoc to Ms. writeMs :: PandocMonad m => WriterOptions -> Pandoc -> m Text @@ -88,6 +90,21 @@ escapeStr :: WriterOptions -> Text -> Text escapeStr opts = escapeString (if writerPreferAscii opts then AsciiOnly else AllowUTF8) +-- In PDFs we need to escape parentheses and backslash. +-- In PDF we need to encode as UTF-16 BE. +escapePDFString :: Text -> Text +escapePDFString t + | T.all isAscii t = + T.replace "(" "\\(" . T.replace ")" "\\)" . T.replace "\\" "\\\\" $ t + | otherwise = ("\\376\\377" <>) . -- add bom + mconcat . map encodeChar . T.unpack $ t + where + encodeChar c = + if isAscii c && c /= '\\' && c /= '(' && c /= ')' + then "\\000" <> T.singleton c + else mconcat . map toOctal . B.unpack . TE.encodeUtf16BE $ T.singleton c + toOctal n = "\\" <> T.pack (printf "%03o" n) + escapeUri :: Text -> Text escapeUri = T.pack . escapeURIString (\c -> c /= '@' && isAllowedInURI c) . T.unpack @@ -196,7 +213,7 @@ blockToMs opts (Header level (ident,classes,_) inlines) = do (if T.null secnum then "" else " ") <> - escapeStr opts (stringify inlines)) + escapePDFString (stringify inlines)) let backlink = nowrap (literal ".pdfhref L -D " <> doubleQuotes (literal (toAscii ident)) <> space <> literal "\\") <> cr <> literal " -- " -- cgit v1.2.3 From 72075423d08e7cd2052f5325a17d52fc1d7682b3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 6 Dec 2021 13:04:31 -0800 Subject: custom-writers.md: use filter to include source of example. --- doc/custom-writers.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/custom-writers.md b/doc/custom-writers.md index b2258a95f..6df603288 100644 --- a/doc/custom-writers.md +++ b/doc/custom-writers.md @@ -34,6 +34,8 @@ can do pandoc --print-default-data-file sample.lua > sample.lua ``` +# A custom HTML writer + `sample.lua` is a full-features HTML writer, with explanatory comments. To use it, just use the path to the custom writer as the writer name: @@ -46,3 +48,5 @@ pandoc -t sample.lua myfile.md writer, so you can design your own custom writer by modifying the functions in `sample.lua` according to your needs. +``` {.lua include="sample.lua"} +``` -- cgit v1.2.3 From 51142c6803cab7486dbe962f274174d246e571aa Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 6 Dec 2021 23:39:08 -0800 Subject: Ipynb reader & writer: properly handle cell "id". This is passed through if it exists (in Nb4); otherwise the writer will add a random one so that cells all have an "id". Closes #7728. --- cabal.project | 5 ++++ pandoc.cabal | 2 +- src/Text/Pandoc/Readers/Ipynb.hs | 22 ++++++++------- src/Text/Pandoc/Writers/Ipynb.hs | 58 +++++++++++++++++++++++++++++----------- stack.yaml | 3 ++- test/ipynb/simple.in.native | 12 ++++----- test/ipynb/simple.ipynb | 15 +++++++---- test/ipynb/simple.out.native | 10 +++---- 8 files changed, 85 insertions(+), 42 deletions(-) diff --git a/cabal.project b/cabal.project index 669dd74e2..1c49a003c 100644 --- a/cabal.project +++ b/cabal.project @@ -7,3 +7,8 @@ constraints: aeson >= 2.0.1.0 -- type: git -- location: https://github.com/jgm/texmath.git -- tag: 674bcbaec03e5550f155623de6662953bd157625 + +source-repository-package + type: git + location: https://github.com/jgm/ipynb.git + tag: 62f1a5180a61bc89c06982d8b869b1f254208699 diff --git a/pandoc.cabal b/pandoc.cabal index 0e064957b..74f67c403 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -475,7 +475,7 @@ library http-client >= 0.4.30 && < 0.8, http-client-tls >= 0.2.4 && < 0.4, http-types >= 0.8 && < 0.13, - ipynb >= 0.1.0.2 && < 0.2, + ipynb >= 0.2 && < 0.3, jira-wiki-markup >= 1.4 && < 1.5, lpeg >= 1.0.1 && < 1.1, mtl >= 2.2 && < 2.3, diff --git a/src/Text/Pandoc/Readers/Ipynb.hs b/src/Text/Pandoc/Readers/Ipynb.hs index e6de29b44..8e742a888 100644 --- a/src/Text/Pandoc/Readers/Ipynb.hs +++ b/src/Text/Pandoc/Readers/Ipynb.hs @@ -77,7 +77,10 @@ cellToBlocks opts lang c = do let Source ts = cellSource c let source = mconcat ts let kvs = jsonMetaToPairs (cellMetadata c) - let attachments = maybe mempty M.toList $ cellAttachments c + let attachments = case cellAttachments c of + Nothing -> mempty + Just (MimeAttachments m) -> M.toList m + let ident = fromMaybe mempty $ cellId c mapM_ addAttachment attachments case cellType c of Ipynb.Markdown -> do @@ -86,12 +89,12 @@ cellToBlocks opts lang c = do else do Pandoc _ bs <- walk fixImage <$> readMarkdown opts source return bs - return $ B.divWith ("",["cell","markdown"],kvs) + return $ B.divWith (ident,["cell","markdown"],kvs) $ B.fromList bs Ipynb.Heading lev -> do Pandoc _ bs <- readMarkdown opts (T.replicate lev "#" <> " " <> source) - return $ B.divWith ("",["cell","markdown"],kvs) + return $ B.divWith (ident,["cell","markdown"],kvs) $ B.fromList bs Ipynb.Raw -> do -- we use ipynb to indicate no format given (a wildcard in nbformat) @@ -108,11 +111,12 @@ cellToBlocks opts lang c = do "text/restructuredtext" -> "rst" "text/asciidoc" -> "asciidoc" _ -> format - return $ B.divWith ("",["cell","raw"],kvs) $ B.rawBlock format' source + return $ B.divWith (ident,["cell","raw"],kvs) + $ B.rawBlock format' source Ipynb.Code{ codeOutputs = outputs, codeExecutionCount = ec } -> do outputBlocks <- mconcat <$> mapM outputToBlock outputs let kvs' = maybe kvs (\x -> ("execution_count", tshow x):kvs) ec - return $ B.divWith ("",["cell","code"],kvs') $ + return $ B.divWith (ident,["cell","code"],kvs') $ B.codeBlockWith ("",[lang],[]) source <> outputBlocks @@ -161,7 +165,7 @@ outputToBlock Err{ errName = ename, -- the output format. handleData :: PandocMonad m => JSONMeta -> MimeBundle -> m B.Blocks -handleData metadata (MimeBundle mb) = +handleData (JSONMeta metadata) (MimeBundle mb) = mconcat <$> mapM dataBlock (M.toList mb) where @@ -209,7 +213,7 @@ handleData metadata (MimeBundle mb) = dataBlock _ = return mempty jsonMetaToMeta :: JSONMeta -> M.Map Text MetaValue -jsonMetaToMeta = M.map valueToMetaValue +jsonMetaToMeta (JSONMeta m) = M.map valueToMetaValue m where valueToMetaValue :: Value -> MetaValue valueToMetaValue x@Object{} = @@ -228,11 +232,11 @@ jsonMetaToMeta = M.map valueToMetaValue valueToMetaValue Aeson.Null = MetaString "" jsonMetaToPairs :: JSONMeta -> [(Text, Text)] -jsonMetaToPairs = M.toList . M.map +jsonMetaToPairs (JSONMeta m) = M.toList . M.map (\case String t | not (T.all isDigit t) , t /= "true" , t /= "false" -> t - x -> T.pack $ UTF8.toStringLazy $ Aeson.encode x) + x -> T.pack $ UTF8.toStringLazy $ Aeson.encode x) $ m diff --git a/src/Text/Pandoc/Writers/Ipynb.hs b/src/Text/Pandoc/Writers/Ipynb.hs index 30ef100ad..b81771bb2 100644 --- a/src/Text/Pandoc/Writers/Ipynb.hs +++ b/src/Text/Pandoc/Writers/Ipynb.hs @@ -37,6 +37,8 @@ import qualified Data.ByteString.Lazy as BL import Data.Aeson.Encode.Pretty (Config(..), defConfig, encodePretty', keyOrder, Indent(Spaces)) import Text.DocLayout (literal) +import Text.Pandoc.UUID (getRandomUUID) +import Data.Char (isAscii, isAlphaNum) writeIpynb :: PandocMonad m => WriterOptions -> Pandoc -> m Text writeIpynb opts d = do @@ -79,7 +81,7 @@ pandocToNotebook opts (Pandoc meta blocks) = do let metadata = case fromJSON metadata' of Error _ -> mempty -- TODO warning here? shouldn't happen Success x -> x - cells <- extractCells opts blocks + cells <- extractCells nbformat opts blocks return $ Notebook{ notebookMetadata = metadata , notebookFormat = nbformat @@ -97,23 +99,26 @@ addAttachment (Image attr lab (src,tit)) return $ Image attr lab ("attachment:" <> src, tit) addAttachment x = return x -extractCells :: PandocMonad m => WriterOptions -> [Block] -> m [Ipynb.Cell a] -extractCells _ [] = return [] -extractCells opts (Div (_id,classes,kvs) xs : bs) +extractCells :: PandocMonad m + => (Int, Int) -> WriterOptions -> [Block] -> m [Ipynb.Cell a] +extractCells _ _ [] = return [] +extractCells nbformat opts (Div (ident,classes,kvs) xs : bs) | "cell" `elem` classes , "markdown" `elem` classes = do let meta = pairsToJSONMeta kvs (newdoc, attachments) <- runStateT (walkM addAttachment (Pandoc nullMeta xs)) mempty source <- writeMarkdown opts{ writerTemplate = Nothing } newdoc + uuid <- uuidFrom nbformat ident (Ipynb.Cell{ cellType = Markdown + , cellId = uuid , cellSource = Source $ breakLines $ T.stripEnd source , cellMetadata = meta , cellAttachments = if M.null attachments then Nothing - else Just attachments } :) - <$> extractCells opts bs + else Just $ MimeAttachments attachments } :) + <$> extractCells nbformat opts bs | "cell" `elem` classes , "code" `elem` classes = do let (codeContent, rest) = @@ -123,14 +128,16 @@ extractCells opts (Div (_id,classes,kvs) xs : bs) let meta = pairsToJSONMeta kvs outputs <- catMaybes <$> mapM blockToOutput rest let exeCount = lookup "execution_count" kvs >>= safeRead + uuid <- uuidFrom nbformat ident (Ipynb.Cell{ cellType = Ipynb.Code { codeExecutionCount = exeCount , codeOutputs = outputs } + , cellId = uuid , cellSource = Source $ breakLines codeContent , cellMetadata = meta - , cellAttachments = Nothing } :) <$> extractCells opts bs + , cellAttachments = Nothing } :) <$> extractCells nbformat opts bs | "cell" `elem` classes , "raw" `elem` classes = case consolidateAdjacentRawBlocks xs of @@ -150,33 +157,54 @@ extractCells opts (Div (_id,classes,kvs) xs : bs) "rst" -> "text/restructuredtext" "asciidoc" -> "text/asciidoc" _ -> f + uuid <- uuidFrom nbformat ident (Ipynb.Cell{ cellType = Raw + , cellId = uuid , cellSource = Source $ breakLines raw , cellMetadata = if format' == "ipynb" -- means no format given then mempty - else M.insert "raw_mimetype" + else JSONMeta $ M.insert "raw_mimetype" (Aeson.String format') mempty - , cellAttachments = Nothing } :) <$> extractCells opts bs - _ -> extractCells opts bs -extractCells opts (CodeBlock (_id,classes,kvs) raw : bs) + , cellAttachments = Nothing } :) <$> extractCells nbformat opts bs + _ -> extractCells nbformat opts bs +extractCells nbformat opts (CodeBlock (ident,classes,kvs) raw : bs) | "code" `elem` classes = do let meta = pairsToJSONMeta kvs let exeCount = lookup "execution_count" kvs >>= safeRead + uuid <- uuidFrom nbformat ident (Ipynb.Cell{ cellType = Ipynb.Code { codeExecutionCount = exeCount , codeOutputs = [] } + , cellId = uuid , cellSource = Source $ breakLines raw , cellMetadata = meta - , cellAttachments = Nothing } :) <$> extractCells opts bs -extractCells opts (b:bs) = do + , cellAttachments = Nothing } :) <$> extractCells nbformat opts bs +extractCells nbformat opts (b:bs) = do let isCodeOrDiv (CodeBlock (_,cl,_) _) = "code" `elem` cl isCodeOrDiv (Div (_,cl,_) _) = "cell" `elem` cl isCodeOrDiv _ = False let (mds, rest) = break isCodeOrDiv bs - extractCells opts (Div ("",["cell","markdown"],[]) (b:mds) : rest) + extractCells nbformat opts + (Div ("",["cell","markdown"],[]) (b:mds) : rest) + +-- Return Nothing if nbformat < 4.5. +-- Otherwise construct a UUID, using the existing identifier +-- if it is a valid UUID, otherwise constructing a new one. +uuidFrom :: PandocMonad m => (Int, Int) -> Text -> m (Maybe Text) +uuidFrom nbformat ident = + if nbformat >= (4,5) + then + if isValidUUID ident + then return $ Just ident + else Just . T.pack . drop 9 . show <$> getRandomUUID + else return Nothing + where + isValidUUID t = not (T.null t) && T.length t <= 64 && + T.all isValidUUIDChar t + isValidUUIDChar c = isAscii c && (isAlphaNum c || c == '-' || c == '_') blockToOutput :: PandocMonad m => Block -> m (Maybe (Output a)) blockToOutput (Div (_,["output","stream",sname],_) (CodeBlock _ t:_)) = @@ -229,7 +257,7 @@ extractData bs = do go (mmap, meta) b = (mmap, meta) <$ report (BlockNotRendered b) pairsToJSONMeta :: [(Text, Text)] -> JSONMeta -pairsToJSONMeta kvs = +pairsToJSONMeta kvs = JSONMeta $ M.fromList [(k, case Aeson.decode (UTF8.fromTextLazy $ TL.fromStrict v) of Just val -> val Nothing -> String v) diff --git a/stack.yaml b/stack.yaml index bdaa0b3d1..5f6a34068 100644 --- a/stack.yaml +++ b/stack.yaml @@ -32,10 +32,11 @@ extra-deps: - commonmark-extensions-0.2.2 - citeproc-0.6 - aeson-pretty-0.8.9 -- ipynb-0.1.0.2 - texmath-0.12.3.3 - unicode-transforms-0.4.0 - unicode-data-0.2.0 +- git: https://github.com/jgm/ipynb.git + commit: 62f1a5180a61bc89c06982d8b869b1f254208699 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 diff --git a/test/ipynb/simple.in.native b/test/ipynb/simple.in.native index cc707877f..8f3d36019 100644 --- a/test/ipynb/simple.in.native +++ b/test/ipynb/simple.in.native @@ -1,15 +1,15 @@ Pandoc (Meta {unMeta = fromList [("jupyter",MetaMap (fromList [("nbformat",MetaInlines [Str "4"]),("nbformat_minor",MetaInlines [Str "5"])]))]}) -[Div ("",["cell","markdown"],[]) +[Div ("uid1",["cell","markdown"],[]) [Header 1 ("lorem-ipsum",[],[]) [Str "Lorem",Space,Str "ipsum"] ,Para [Strong [Str "Lorem",Space,Str "ipsum"],Space,Str "dolor",Space,Str "sit",Space,Str "amet,",Space,Str "consectetur",Space,Str "adipiscing",Space,Str "elit.",Space,Str "Nunc",Space,Str "luctus",SoftBreak,Str "bibendum",Space,Str "felis",Space,Str "dictum",Space,Str "sodales."]] -,Div ("",["cell","code"],[]) +,Div ("uid2",["cell","code"],[]) [CodeBlock ("",["python"],[]) "print(\"hello\")"] -,Div ("",["cell","markdown"],[]) +,Div ("uid3",["cell","markdown"],[]) [Header 2 ("pyout",[],[]) [Str "Pyout"]] -,Div ("",["cell","code"],[("execution_count","2")]) +,Div ("uid4",["cell","code"],[("execution_count","2")]) [CodeBlock ("",["python"],[]) "from IPython.display import HTML\nHTML(\"\"\"\n\nHTML\n\"\"\")" - ,Div ("",["output","execute_result"],[("execution_count","2")]) + ,Div ("uid5",["output","execute_result"],[("execution_count","2")]) [RawBlock (Format "html") "\nHTML\nhello"]] -,Div ("",["cell","markdown"],[("tags","[\"foo\",\"bar\"]")]) +,Div ("uid6",["cell","markdown"],[("tags","[\"foo\",\"bar\"]")]) [Header 2 ("image",[],[]) [Str "Image"] ,Para [Str "This",Space,Str "image",Space,Image ("",[],[]) [Str "the",Space,Str "moon"] ("lalune.jpg",""),Space,Str "will",Space,Str "be",Space,Str "included",Space,Str "as",Space,Str "a",Space,Str "cell",SoftBreak,Str "attachment."]]] diff --git a/test/ipynb/simple.ipynb b/test/ipynb/simple.ipynb index 26901db57..c2dbe0640 100644 --- a/test/ipynb/simple.ipynb +++ b/test/ipynb/simple.ipynb @@ -9,7 +9,8 @@ "\n", "**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus\n", "bibendum felis dictum sodales." - ] + ], + "id": "uid1" }, { "cell_type": "code", @@ -18,7 +19,8 @@ "outputs": [], "source": [ "print(\"hello\")" - ] + ], + "id": "uid2" }, { "cell_type": "markdown", @@ -26,7 +28,8 @@ "source": [ "Pyout\n", "-----" - ] + ], + "id": "uid3" }, { "cell_type": "code", @@ -56,7 +59,8 @@ "\n", "HTML\n", "\"\"\")" - ] + ], + "id": "uid4" }, { "cell_type": "markdown", @@ -77,7 +81,8 @@ "lalune.jpg": { "image/jpeg": "/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcU\nFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgo\nKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAD6APoDAREA\nAhEBAxEB/8QAHAAAAAcBAQAAAAAAAAAAAAAAAQIDBAUGBwAI/8QAPhAAAgEDAwIEBAQFAgUFAAMA\nAQIDAAQRBRIhBjETIkFRB2FxgRQykaEjQlKxwRXwFjNictEIJEPh8SZTgv/EABcBAQEBAQAAAAAA\nAAAAAAAAAAABAgT/xAAbEQEBAQEAAwEAAAAAAAAAAAAAARECEiExQf/aAAwDAQACEQMRAD8A2t0Y\noQpwT2qVzMV+N3UHgrDY2eoM0y58VEbgfp9K1yMRmnuJ5h40jyYHGSeKrWE8u2QAApOMdqGCsmT8\nh70TAJwMAZx249aKBy4c9vTNUC0zDCgmmmG7Ockjkj1PrUTAjcy5XP0ouCgHae4IomOJHhgIc55P\nHY0Uk5IXLMcUBQ27n96JYO2MYLebHtRBA7BcMx29sdxQJqwZRtIP+BQKpjHHc+xzigNGoAO/k+nP\nAoAYlee5oBiGeWySO9AJCgY5PHagFCADzj2GaA2N2TkjA/U0HMwbPPeiyBLDfkkj04FCl1cBMgn6\nURwYFGySR6D2oAeQDAxnHGKAhU4IbGc+tFwnwDj9aK7f8v2oNu+IHxNvJdXmt9EmKWSqArA/mPvx\nUxMZNe3Ml1dvNcMzSSEsxPOferJhht/OWyAPc0UfdgDcuM8n50AMCykZFARsngcY/egTcbjnJz9O\n9AB2kZGSQOcUCX8x83bntQCMruJ4B7D1oCyOGzxtJ9M80CAdg5UjFE0aFJrghLeNpHY4IRdx/QUN\nWCw6D6q1EZttEvirHAZ4ig/U4qw1b9H+CHVN3Mq6hJaWMJ5ZjJ4hA/7R3P3q3ET+pf8Ap/lWNm03\nXkkkA8qTW+3PHupP9qxopV78G+s7VSV0+OcAn/kzqSfscVvIKzqPTWu6XKE1LSL+Bhz5oDg/cd6l\nEZzGwLrtPqrA8frUCJfcw9gfegUjZsEAffNADyHt78UAjCjzDJxRcO5Pw3gwCGOVJQp8ZncMGOeN\noxwMY96GCbQffFFcUXKjDDt2NEo+N3yyM5z3okKuqJgIzONoJyuMGi4QfGcqSfXBoYHJx659qKIR\nnnsfUGgJn/poJYoTIGLY+eDzQFlQK2G/KCTmgbspfO0qce/agPGcR7nHf9vnQFfBPlOc88Gg7uuc\nc/M0Bd208YJJweKAYrea4kKQICRGW5IUYUZJ570DYqcknt3FE0VuVyDzj1oamOlulda6puvC0a0e\nZVIWSbtGn1Y1NNbX0x8ENH0qL8X1NdtqDoNxiQbIh8u+WpqL70Tc6fcxypouiRadbW8hhLFFXcB7\nEdz+tNFvEZxkmmgShbA9PlUA+Hgg/wBqDgmBkd6ArJuJBGR7VdEdqWgaVqMfh6hp9pcLj/5Ig2Ka\nKJrvwW6S1EFoLaWwmPIe2fAz81ORTRm3UfwI1mzBbRL+K/ReyS/w3x/b+1Wexmev9O6xoE2zWdOu\nbUDszr5T9G7H9auCJj2n3PPrUXTlGBB2kYx96GlQMjJJHuRRXBgDgk8DtRKH8w4OfYA0SUlIMsFX\nJ4oujHH8ufnRRGOSNoJNAeFC77F2jPucfvQFEqgY3nj/AKaCUY58wwq54AoCzOmVMke9QeRnGR7Z\noEIF7pnaTk49KDpSSwQntQJsGKjgggZ9uDQc4OOe1Am2UCkHOR7dqA8t/cSW8MEkrGGEsUTPCk4z\nj9KJT3pzQtS6m1aPT9Jh8SVxlmJwqL/UfYURuuhfArR7f8NLrF1cXciKDJCrbI2b7c4+9NGtaRpt\nrpdqltYW0VtAn5Y41wBUodvGjqUdQyn0YZqAIreOBFSFFRF7BQAKA1xcRwKplcJuOBn1NAR7y2ik\nWMzoZnGVQHJNAuQcD3oBKkD2FBy8jnvQFxnjjmg4rxwKBMqCBtPNA3vbCC+tngvYo54HGGSRQQR9\nDV0Y91n8DNOvFkuOmZmsrk5PgSNuiY98D1X+1XRhWu6DqWgX72er2j2069t/ZvmD2IoGG7jbnj1F\nFlB224PB+VClN4DYJHyAojmPGCck8cetCAxgjPp6UaAGKtx6+9ATAXO7nFBw8HHLN+goJhBuj2Fe\nAcnmgNazW8U0vjweODGyqpYrsYjytx3x3oGa5LEEjH9XvQGlgmjjMmQq4HBPfPYgevagG5nhe3tk\nFuInQHxJQTmQntn0wKBKTlAeDx60DSY+U9zn+mgsnQvROr9Y3W2xi8KxV8SXUnCrjvj1Y/IUR6c6\nA6H03o6wMVgrSXMoBmuX/NIf8Djt/eiLfjJwO9ZBiOfmKDhktzQAzYBLZ8oyaDF+rOptVv8AUjNZ\nL4tjA/lT+kr3wvqTQX/pi3Y+DqFxKXurmFWAaPaVzg4I/b0oHlxqV7penRTXFu93dPLsESYB2k8n\n7CgnradLq1WaIOFI/K42sPkRQCg3Kcd6Dgp3d6AdrGg5VxnjmgKWB8uQGxnFAUgKuSefSghuqNC0\njXbAWGtxQyJKdsYc4YMf6T6GtDzR8S/hnqfSUz3NvuvNILYSZR5o+ezj/Pb6UGfLzyD/AJoFFySQ\nVBHpQDJ5kGByPahAbWxn5+po0OF3D+XPtQJsNwOe+aAuygmMkebgHnHFALHYpJwSeGz2oGpOJWAI\n49BQEZlYAHkg4oARVOMvtBIJJ7AUAX6xxSOsUgmjViFcKRuHviiVfvhT8NZuqpk1LVFeHRkPlHZp\nznsP+n50qPS+mWVppdnFa2cEcFtGu1I41ChR8qyHVxK8cLPDD4kgGVQHBNAa0maaBJGTYzDJXOcU\nCy5JOaA2OMfoaArkheM7vlQNYNOtoWLJCgLHJwo5NApPKLaNpGRQB6j2oGmnRvcyNd3O/DkeErLh\nkWgklIdCyZOCRzxzQEeRxhdpUnncBkD5UCxXjJ7+tAlctMsIMLohz5mcZAH09aBQYdQwyAeaAuA7\nMAQxHH0oG1481nbGVInuWU5Kr+bHrgepoKB1u+o6jqlvBH05NevEBPBK0pQR4I4BHZj+1Bb9IS7l\nsFtNWtYwDGFYB/EXHqpJ7/WtQYx8VfhGbdZtV6Uh8gy81mpyR6koPb5UGKY4YkeYd88fbFAI5AC9\n8c5oQBb+U9+9GnN5RgDgjOPWgAN3yMfWgAqc91/UUD2RSSRg9+49KCR6e0WfX9WS0icRwgb55WOF\nijH5nP0FBYNRi6dSR7HRNPmu0hOW1GaXaZMdwBwAP3oynE0XRYrFtV02wS4ECj8dp1wcsE7eJEf3\n9qlFZ616ZttPu7Kbp9Zbi0vYzNCcgjHqoHuKsEp8LPh7P1PqjXerxywaXaviRSu1pWH8g+XuflQe\nmIIY7S3SK3hVIo12pGoAAA7AClEL1N1RH0/oTalcwx+IACLaSQKx59Ppmshv0D1jH1ZbTubU27xk\nkAnKsuSMg/UUFluLlLaJXETyecKAg554zigXiubeRnSKeJ5FOGVXBIPsaBLULoWkIfw3kYsAqIOS\nTQJMbpm3oqlmwACeF9yfn+1A+Bx34oE5IY5P+YFbnPIzQKAckHuRQCAQOO1AL8r9KDhkZOT9M8UC\ncrxgAyYJzwD70CT3Itxm8kgi3fly+P7/AOKA9pskhEkZysnOfeg6RH8w3tgjAHtQRZ1uystSg0m5\neRJ2UbHceV8fP3oJkBSAVII9xQFdSRwKDDvjN8L/AMSJte6chxcgFrm1QcSf9aj39x61YMH8Q+Ck\nfhqpQncxBDH5H6VRwXJ/Ke1Am2QchuMYOaNFSAVznB9qAm8f10D2RmX8jDHP3oLbebtA6ej0m2Lr\nfX6LcX7IMskf8kf6HcffIoG8yTadZxSTxCK3kRZUwSFfkruIJ78GhiS6Y1OS3160uZJFWO5bwZtx\nzuQ8bcfPNMZXvo2wsLnQ9R0q/maJNNv5Yo3bjCuMAHPzqA2jdUan0lF0/ZXcElxp9zE+5WVd/DE7\n1IPPB7H2po1bSNXsdYthLp1ykyEcj+ZT817ioITrnoux6vs1gv5JYnjz4ckZ/Ln5etA+6N0BemdB\nttMina4WEFfFdQpIJJ7D60E5I4Vo9qnnsQO1A3k0yzeTxhCizZJ3qNpz9RQO449igMSxHGW5NAIw\nBtUAUAMORkfegMhG3jtQD8+fvQGXJz7UAHuRQA5YDI5FB0qCQA5yaCs2/SFit/Jd3AmvJ2bO64ct\nt5zwD2oLMilVAUDgcAelAJLbhgZz3oGN9HPIYmhtrWRw2czjt7Y+dA+h3mJS67W9gc0AvuLYANAD\npkZABHY85oPOnxy+Hx06Z+odGjC2jt/7qBRwjH+cY9D6/OrKMebcceHwfaqCYIyDgZ96GhHOFJI4\n/WjQpXnsaCz9J6fDqGvRC8OLO3Vri5PB/hqMkfc4H3oDT3UupapcXrKS9zISgDdhnAGPbsKC5aLL\nBHq9p01c6bbagPE23kpJYhmz5IySAAMj6nNGdRnT2lu3V9vaQQrJDHfCMFj5kAfufsMUFogu5H0j\nrLUYXK+Lq0aRse/lf/8AOKlFfudagvbnQpNQRmtILydCwPdCQcgMOMZFQanPoeiawBd9M6s9jeKP\nK1vKQp+RFA4septa6fuFtuqbRrmzx5b+BAdo927A+vsflQXfTr2z1O3W5025juIW/mjOR9KAZI91\n4khaRNo4XdwT9KAl3b2+oWpjMoZWbOVfnI9sUCrXUNssUU8w3sQoJH5jQLvwQQC3NAKvuUPtK54w\naDg23v6UA7weBnNAIOBigMr+hoOjdZQdhBx3waAVG0Z7UBWfAOQSflQChyNxBAxQRutarb6bHALi\n9trSW4kEcJnGd7ewFA/j8QEK/IA/MBjmgWDDBB7igj9dupLTTbiaHZ4oQ7A7bQW9ATVgwXSNV6on\nl8azW6t45pWdxHIxWA/zNtz7A8Glg2S1u7fX+nt0J/H2c4MMhmQoW9GBUjj60g8sfEHpebpDqi4s\nHLG2Y77eQ486E8fcdvtVFekGW4UfegKVAAKgnFGhuDzxQXbpDTZF6a13UnUqrCOzQ5wGZmXIJ+lE\n0ppkEK6nJcRWcTW9hA08iKcjcowpye/mxQ0+6VRbC/jvLm48L8LG9y8pIOXxkDnuSTipqHXQMng3\nes9S3fhn8DbvcZI5Mr/lH700dc3Dad8NtPs4nU6jeXD6nMCwBRF5XOfU8YHrTNJFF1X8RawW1jc4\nGxTKNrZB385yPkBTFw1stSu7Ni9tPLGSQfK5Aphi8J8UNUm6fn0u72yvJ5fGbuF/39aYYtGgadp9\n/axXnRetzaXqnhqZI3bEcj4547Ak/X6UxFisPiXe6NMdO65057eQAr+LhUlHHbOPX07UwWXpQ6Bq\nMo1LpgW0sioVI8Qgxk+684qC028M5890Y3kHKbUwF+lA4LDOzu2M4FAOG3DaoI9cntQdJxzQEyR2\n59f/AKoGl5fSQRFo7ZpB/MhYIR9zxQdayyXKb7gqox5Yo2yB9WHc0DPUIWnhWKxkuYFRs5gcKWbP\nY59KBkx6isVeSGW31JNwHhyOUkA+o8v9qCfjkMo/LJFKqBmRvSgc2swnRyFcYODuXGfpQMtRsLK8\nvYJL+wjuGiUtHK6hghz6Z7H6UEmCsig84I9RigiruC9t0DaaVmIIHhTOQMeuGwT9qCJ1ywv9T0U2\n9xFFiaVBJGHz5M5ODgYPY/arKJPTtLW1t44i7SKq48w8x+ZPrTRJoipGFQAAdgKgzX47dMJrXSrX\nkUe6807MykDkp/MP8/aro80FQyZ+tUJ7hvH0x270XQ7KGtXvIk0T4c9P2bIhkvpnvJVfjIxhf7qf\ntRDXpu0/1DpzXltUlkvmWMBI+2zdnn64oYa6yX0XTm0i4jQ3t6wmuV53xov5UPpyeeKyLbpFtZ6X\npmn6TqNq7/ic6pqQRR/DVf8Alq2fTOP0FXBnXU+ox32o3lzeW+JrxlMXHKR9wfbJ/tVWK5f3AnaA\njafCTwwcY4BOM/qKKSjA4Dg8j37UHZKkE5P0olSFlcLDdJPbTNBOigjxOVZu3+80Rbbnrq9l0t9I\n6isRd2rgKpPlZMdyre9An07oupoh1zo2+lea2fMlr+WZFx7ZwwqWDVug/ihDq7R6b1EPwmpMNokP\nlVj8xng1BqEUe1EAJOMDOc5oDSxq6YYeuaAJF4oCBUQ7mJ45zQHYB14wR86AVjBXyjge1AEcRTHl\nA9hQE8kbgEohJ5yQM0ETHNqMOr3IZQ9tIMQyEjKt7D3FBLqywRPJKTuxlj3zQI3Ut14e+yhWRj28\nQ7RjH60EfpF3rU/jLqFrHbS4/hqpJXH19aCRa8jgiVr1xGwXzYyf99qA9tc29/aRXFnKs1vINyOO\n2KByoxwe9AYocHGKBvdwLcWzxSLuR1KuD6gjBoPHXWujt071Nf6YSSkUnkJ4yp5H7f2rQgWAA3Y+\n1An4j/1t+tBrHxKuYS+gx24LRx6ZFtI/lz60FY0+/v8ASphNpd68EpXY5AGNvzFF1YOirZbzVrvX\n9dkNxZWH8eeaY5Lyj8qj7kcVlETqOqXd/HrPUNzcNE16Tbwxf1JkEgD2AA/etBte9R2Oq2cv+p6X\nHJfBFjgmjkMaRgAAEqO5o1FWfbgjsR8+9AlI5CgEggeoNAq0iug8uD7g80KKmCcZ7fPmjJzJfT/h\nWtjJvhOPK/OOe49u9A96X1W90/VrRtNkkSfxQF8I5yScdvX6UGidSLpfVFzcvbRiy6kgZBGysFW7\nB9T7HHNSjU+o9S1iz0e2uNLmX8RYxJ+KgYeVwVGTn5d6gjug/iU3UOt/6TewQpP59skL5B29x/8A\nYoNHPB78Ggb2l3bXO78PKsoyVyvIBHBFAoSkbfyhn4GfWgTnmWFN7ybAvc4Jz9hQRdx1dp0S3Dw+\nJJHbDdPIUZUjX3yRz9Bmrgzbqb4x9Oxho4bB751O5HPkXPsc80wQHT/xrJ1IHUbGKO0kdRiBiAgz\n+YjnsPpTKN/tLy3vLOK5t5klt5F3LKhyCPemAYLuK5XMDEj1OCP71ArGWLMPT0oIbU7h11u2t49O\nllWWNm/FIRsjI4AI/egfQ2ktpbww2XgxoDl9wJ49cUCHUGv2GixM13Mkcm0squwUH5/SrgxDW/jF\ncXOteHb3otrKEEiRISRM3zGc49v1qDT+gfiBpvV7y2unxTxywRhz4ozuHbOR2+9Bmf8A6kNIEWpa\nZqiooEqtBIR6kHI/atfRjDEt3AKjgVQjug9j+lQWh72e/htTOzyeCnhHPomeMYoJvQum7vVD47K9\njpsQBkvZ5NoAHcgUAa7rKamE0Lp9Xh0G1OZZTwZSO8jn9cCsivdS38F9cJDZIY7G2URxKe5x/MT7\nnNaEKrENwAFPPlosFwS2cd/cc0UlIm3JOeKDo2LH+UA0SjgDk98URzPiJ2449e/NAbS7v8PdpKkp\nikQ5WQLkqccGgmYNQmXWLeQLG9wVRQVPlcj+Yn3xQa98OviAjz3WjdXSpFdliEuJCNjDtsJ7enep\nRdel+kdL0rqOTVdIsoYklV1dixO3nunpg9jUCnU3WMeka5b2EUcl3JInmigQs6ZPlJAHY8+vpQP9\nO1m3nthNo0cTwM2JDwoVj6H5gd6CbhtUiVn8TcXO4ktkZ+We1BAf8Z6fZ2uqXWpyxQrbStGseQzM\nB2IA961B59+IHXmodXal+HsPFh04HbHCo25+bY/zQWv4f/CCxvII73qC8iuXYb1tYZeF9txHf6U3\nBatX+DvSl86x6cr2dwjbnEUmcj6Enj6U8hLdJdEX/SmowJp2tTT6Oc+La3HO0442+3NBf1LmRUjj\nQAfmc+nyHvWQockYyQcY3CgaabaPZxGNnaUFi3mPb6f+KA2q3RstNurnBxDE0mPfCk1YPMemaP1L\n8RtYN9fJPc2aMUaVmCKg54H0z6VRYendf6Z6T1W56a6j6fgfwJyguhGJmPzbIzjHtSjTn0zSunbi\n01fSkt9Os5GAmWNCDOGxtXb6HnNZEZ8etOF90DPKFy1rKk3zAzg/3rXI8u7zvOTg4zVoTLDJ81QW\nDTb2SwuvFgcrkbXwM5H0PFGqsjpd6+kcT61Nc2ieb8OikFc/9PA+WfSjKA1nWBzpFlZ/hLWM4KH8\nzsPVj6mghN4IyQRk5NGo5BkFmyAfSgVjChdpGO/FAXYpOHLBe/FAQqoBJbA9sUBGxgtgEj/eaCf6\nDGjt1TZf8RNGumKS7mQZQkDIB+WaMrf8Ub/ovV7V20JIYL62K4khhCLOCcEcAdu9BmCuEQvxvyFU\ng42+v+/rQaj0zax/EXRY9Nns0t9TtM+BqCKAjEclXA98jn+1Si7Cz6u6O0tLjTrxLu2tQJJrDwcK\nE/m2M2SfeoLrpupDV9Mh1OytUS2vIN8m4BZQf6T7+vPpj50GfdK9L6rJqk1y1y0elRDKRqdjHHoy\nDhjx39e9BZr7fagW0j3kul3iETRqHkeF8ZBUjkZIxjtk5rQ86dW6r+O1OcW0UtvaRsY4oWfLKBxz\n7k/5NA46P6X1rqS6WPS7V9v88rAqi/f3oN46X6C1DSotkus+BIwKl8hn2+3PapROXPT2t20bPY6k\nJ5UGYmbIfIHGW5z68VBI6DrzzWSrrAjtrwFUbDja5OBlfuaCbluJLeNwIpLiVF3bVXAP0Pv8qBxL\nO8cYcW7vnuqkAigNFKs8CyxlwG/lcYI+1A31ayF/pt1auSFmiaM/LIxVgwfoO413o3qqfSLyUSwo\ndogAyZVGcbPTPr71aNDvendJ6wtbu7Fi1lezK0bS4VZMjtnFZE0bC5u9Jh0qRAr2yw4uWx59vBI4\n4PegN1tpbap0lqOk2sipLPB4aFsnHbBNOR5A1exFhqFxbeKkngyMhdOxIPcVuhiZFz/zBUEwcKvY\nnP6fWi0+6chjn6h062uATFLcRrIMnzAsO9EehNR+GvTV3GUh0+O2YsGaWHIf9amjIfib0no3S0Vt\nFY3M000zMzLJtLKvvkenyx96oz0rwNjA8cj2osFLbVAbOc9jRQiXOAwxnj3oBlAxwDj37UDY+vHO\nQeTQBIdqjcPMfnQwJclWyBgCjJBFeefw4VaVycBUGST2wAKD0L8H9C1rSIILjWLSCytY1lZASVnl\nL4PI/wD8+vvUo1uwbxI5GkjdVc7isvOBjtj2qBWKFZiQ8CJCB5FHYj5jHFArDbQ20ey3RY1HOAOP\nsKCH1u61CPSLt9MtlXUHUrbCbJBbPdtvYetXR5T1y2udD6lni1ErJdJLvlK4wWOCePvVgsV/8Sr6\n7UW1vA0NiowIonMe4+7FeT9ARQRmodWa9EYpPBhs1Tygw26rk9xknkn70EjonxZ17TXjAeKTkZ3L\n+YZ7N8vpSjX+lOpNM6umgkMG3EgBV1DYbG4kewz2NZGkC43CP8MPFBONysMAD50DaHVH8S6N1a+B\naxMUjd280pA5wPb296DrXWLK9WNoJdtwybxDKPDcAnHIoJBifTBzzmgaz2UFzPFNNbwvLCcxuygl\nT7igdRRKg8qAZ5JAAzQEnuYoHiSWQIZW2ID/ADH2H6UERr12BY6hueIQJaO7SK/nHfnHtx3pyPGW\noN4jynuCfU963RF+DL/UtQWTkjaWY/8ATnHFGql+j1VerdJY8r+KiJz/ANwoy9C/EjqSbpbRY723\nRJC8ojIcZ4IJ/wAVkecer9en1+9FzeLCCq4URjgDP7mtLhteadBY2kMczyHUpcO0YxtiUjgH/q9c\nelAiLy1kjCX1ruyMLNGdrj0+h+lE0+t+kNQltJ7yKS3jgiTxUFw/hySp7qp70NV6YEBgWUNjBoaK\neAODnHrRoVgDnBP0ozpxZ2f4y5trVeGuJFiBPpk4zQep9C0LTembS30fQbWP8ZsDyTugZgf6ix9f\nYZpbgmbXSmXULaa6kMzpltzcjJ//AGpaLCY1CDsF74PrUCgHY0HbSx7Z96BGUfxB2xjtQZ11t0Tb\n6jNfyw2wM18gV5AcBdpzyPnV0Yp1F0o/TEczXjXaTOQYpIk3QlT3B9Rj0zVl0VKbVppImheUSwbs\ngFfXHc0De0tri/ujFYQSSyfmKopPHqaDV/g9p+padr/gkSRTzKu0kZRlPLYPbOPf2pg9GWzRCMJA\nFxH5do4wayKX1z/G0CdzqLWRkiaTxQBLudclQvovbv3oMU/4Z67uwnUAt3u1Zw42yhmx3/Ln8v0o\nN86L1d00i3i1UiGQIocNnEbnkqT2xgiguEbI4DIysp7EHNAZnxQQ/Usksej3EsCl5EUthR5sY52/\nMjigr6Qrp3R15LqEcIlmgdpFGAsY2navPJApyPJtwd8rnGBuJz6Gt0MzGSTyf0qCwSKA5ZsAjnn2\notTXQYj/AOMNIDqCrXUZwf8AuGDRG6fF6Gyfo6+ub0CR4EPgIScLIeAcfc1keatN0661a+S3sYTP\nKzAbV9B7/StLrQ/iXp9pYLp8elWsUM11AzXMqt53I7g7j244oiB6W6Tn6j2TeAy2FspTeB+Z+/8A\nmgtnWlvpdl1Dp1pq07Ja20GFQpuDHHAwPf39KDHriVTKSPOCeBnHHtQGsrG5v5pfwcTOIlMjgEeV\nfck0XRIreS7uUigRpJXOEVe5PtRE/wBJ9HaxqvUcdhNFJp0lviaSWVcMgzxgdySeBipo9T6O8Npp\nUJ1K4iW5KgSvIyqxb5jPH0paJm1NvKivE6Mp7MpyP1FQLRTwy58F0cjuAckfagOTtO3+Y8igMWCI\nWbOPlzQNhNBOWEbq5Q+YKc4+tAD7JEZgQfXj0oI/VtIttXsZLW5hRopByCP/ADVlGRa78Erae63a\nXK1tG3LAncM/Kmh10l8IZdBv4rxtTE0yggJsyoz6/P0po0zSNKEMdo9xGnjxuzkqMAEgjj7Gmial\njWQMgyCRyQcGoITqHT7q/a30+G2jFmwLSzl8GPBGFA9c5NBPRwJDbpHCipEi4CjtigqfWltqCaG8\nWhNbxyzOBIs8W8FcY4+dWQQ/wtuZdIGqadrknhy2u2QyOSEZOeRngY+XvTBZZevOmhC8janbqiZ5\n3Zzj2FMFcs+sh1ZqsFrp8UkGkrlpbh+DNzhVX5Z5NQTfXyWUXSV2t+wW3EZ5I4HHt61eYPI0mA5C\n9snFaoLsPv8AvUEk5JcA8cZG480WnOlXX4PVLO4yQ0cyP244Yf8AiiPUfUump1B0/c2O8xfi4v8A\nmL3UcGpgw/SujNX0Trj8PpckimOMvHO/kEg9Rjs3PpV0aFq/Qqa1ZJ/qcrverEqNOwGM+uMfemiV\ntrKbQdMNjp9rvtkhPht6mU5yT8u1BkvXg1qXUtOvddgRY1R3j2YHiMvZSD27CgzSCyuNQ1KK0giL\n3Mz4VAOc/wDignoNNOnaHeiW8hgkku/Al2+Ziqgn09M0ETp0qpqSmGKOdFcEeLwMfPHag3JLuCRt\nPmQWsDhNphtVAcn1w3BPFSwDdWGpX1/OYdOtbbSrlQ80szHdn0GR24/c1AbWemdatLbTJdGvJIJy\npDQwMV3exwOPatSz9Ei/R+txy2mr3evyHV4miWIDhGwwyGA7nGRS2YNZAUBWYDdjGayEvxMYB3nY\nu4KCfU+woG93c2enWs1xcPFDCp8zEgDPzq4GGgz22saS1zZSZhkdsFePXt86YHWmySeLNDMYikZ4\nYNlvvUD+VARxQJqgwRQHUAAe2O1AWOFRM8mDlgB37fagb6reXFt4ItLZJnZsuWfaI0Hdjwcn2FAz\n0nWX1i4u4xY3VpFbv4eZ1x4vGdy/KgkriN2aMRlQoOW3DOR/5qwYr1P1tp2pdS3WnanKkGh24kRl\n2eaYgcb/AFxnnAqiv9Jno0dRLJPbtdQtkNPIALaMnODsPPpSjbdK0DTbWQXui+Gsco3BU5hPP5gP\nT7VkU74t6PZHpq/1N5ZZbwrtRnmOwDPOFJwPsK1xR5ybudw788VaC5X2WoJRULSBpAe5PA/aiinA\nZnHck4A70THq/Qr23/4Y0u4lmCpLBGA7epxjH60Du+WGOBvFlFuWOFcYyCfbPrUojri6k06xX8PF\nNfBUJ3ltzM3scVBjfVvVXVNit5dapNDZGQGK3shjeAe7YHIwAOT3zVggNTiu+orrR4p7m+upJFR7\nh3TPhggDaoBwRjnPH5hV0af0xotnoD3l5dWdrY2YjGLhwPEHoef996CC6m0HpuPpk3Wny2s9sJPH\nJ3AeI2D39T37UGU9QTDULuGPSLPwIyoVIYk2lj6/X70G2/DPp0hVudRuBLcwxhRGkeEjB9M+p96D\nSLprVHiieaAE+YxHkke4H1qUOIBawL4uAuc8nvj71AwjRtQ1eO78QNp9odyLju/qT8uf70Gb6r8S\npLzryy0vp+4NxYSSCEswI2u2Rn3OOD9qC4dVamen9NlaC7tUaIFvCmnHiy4HJXJxnOeDVwed+rOv\nLnqSyWO4jZSru/kc7ck+30GKosXw2+KmqaDJDY3jR3OmqNoRhtZAP6SP7Ggtmt63qbTJ1XLazJps\nlwBFblypEOAA7L2OWANS+xrnR2vW3UmjJeWp8wJSRf6WHeoJdSPMCRmgMq8DmgBpNsgUIxBGSccD\n70DczmS8MDWoe28MN4+f588rj980CktuJZYpFdlKZ4B4OfegQ1hpIrVjbsRMBhBj8x9qsHnX/hm3\n6y1O/u9V1ddPmS6aD8OkQdyxOSe4OMmqLUvwQsYY4Xjv7m4YEEhwFyMY7fXB5pRbvhp0jqfSMV7b\n6jqZvLGQAwxAEBDk54PuD6VkVb49a5DBpiaNaeF/FIaQDumOwpzMGDEZQZ5+VboR8In1I+9QWDY6\ngFn7jjHpQhtJEFbAGBnijT0P8H7qPVOh47a42yNaymPBOcDupoykep+m73V7g/8Av2itQowvJIx6\nj5/OpRjfUWrax051RPY6LqFy8YACkebO4Z7HjNWCY0ToW2utJbqPreW5na4O4R78cehY9+fQVKLX\n05p1ro97awC4kX8VFmJLeEKdoyfOxJPbHbHYVAz0rqKPWNauri9t1ktJgILYgEiNFJ/Op9STmrBB\ndeaFCo0y3jt444DI3jLE204Y5DD+9UPPhv0NaRtPq99mSLOy22nOfdh75oNC0vT7m1uJGvGiii3A\nW8UDbQAeDu9zUohLlhouqap1VciF4I1FtbxSthtobBIPuTn7VBJ2vUth1TYk2ULi9iALwyKQYz6Z\n9CM0Ft060/DWEcDHe2Mucdye9BFW3SekWt3LPb2cUTsd2UGCG9x7VYMzufhzdX/WmoXj+BPpx3I7\nXZMmXYckc8EVRKaP8I+nXikLQuxOQSTnBzj6UEjonw90XSrq3S3s7dplJcl1EhGDx396lFx1TQ4N\nVjaC7UNCU2lAO/8AvNWDCLp9X+E/WgWImXSp2LRq7eSRT3B9iP8AFSjd9P1+21TRodVsMS2rLmTb\nyUGOePXFQSltcLcW0c1vh4mXcjDswoDLdRm4FvISsgXeTghDzjAPbPyzmgVFxCzuiOC0WN3sM+5o\nDqySJmNg3rx7UFb60tNUubGJdFdEvhIdryflUFSM49TVgyTQenJemOorf/U4H1Fpp1edAh/hOQTu\nQ9375JA4q0bnbPBcxxT20wkjKkqYzlT9ayGWu38um2MbLEJ7iRtoUds+/wAgBzQeW/iHqi6j1Pdz\neL44HkL9txHtWhVUOVyvHNB2F9zQT8hUAhAdp5FCG0mSAzE4HGDRppvwL1bwOpJbEsFiuYyVX3de\nR98Zoy2ZtRgmjkSRZocEp51K7se3vUow/rfpFE124mVpfD4mk2MWdCc4A+VWCH1281/UmFnpklzP\nYRFBEG8uGC4yQfcn9alGgaJo95rRsbi53WaxwrHOm7BjYcHnvz/moJaw07pXSI5IW1K0CQnDhpAW\nB9R796CudY62msTRW+gadI8KnDXMkLLv9MA8HGOKC3dAXF1dRfh75f41moi4G0AdwcfTj7UFhv7R\njqMBV5AJFZHkR8FRjIx6CgpXVNjJ1JqNn07p26CztSJLlpIydyj2J+fGaC+afplrazqLa3SKNIgg\nx3IHYUEsBk4wQc4oK11L1z070/M9rql6wuVA3QopLcjNBDwfFboqeSO2W7kQNxuaEhQfnQLt8Tui\nreVoV1UeXnckTFT9DigHRuv+mbu9ZV1W3Nyc4IRlVl9O47/KgtU+s6baw+JcX1umRkAuM/p3oK/1\nt0rYdX6cqXKESqN8Ug/Mp9P1qwZ702mo9GdUTWJsmOn3EY8CAORGXJAwScjJ5q0bJDNLb6YklxbK\nsgA3wwndg9sDtWQN3aw3ZKTwLLEQOGORn6ehoG1vYAw3FikRt7JSuH3Hc/GSc5P0oHn4aO2uGuYy\niose044wBQIm6F1dwfh5ARs8R8L2BHGfnQHv9PS4PjxrGLtFKxysm4qD3oCxboIIo7e1jhQHzAYU\nJ8wP8VYM56j1ktaal1BMrS2sAaK1OQDD6eUepY9yfQVR5zv7hrmaSaRtzyHJY0DcE4BPIPb5UBwO\nO4oJYzFvzEYHAH9XvQhNZN7AEgDOSDRo/wBA1SXRdVtNQgb/AJUgfBHcZ/8AGaGPVlhPbarZ2t5C\nEeORBKje2RUrI1zYxTBhMinIwcjvUEcugWkO4AMisMEA8N69u3yoERrOhWNxNYy6hapcxAeJHM+D\n8u9ASLStLlm/EWdpZyxy+Z3RQ3I5B44oJKTT4blFWSNBEOeBg5+goFYbOK1TKhIxnIbGMH50Cpcy\no6AMrIcM2OD68Ggb6Lbbllu5Cd88hYBu6rztWglSNkfm4P70Gaat8Rba96w0vp3R2mhufxyi4kO3\nYyDOV9+f8VYMw+P0cP8Ax4JVuEKzW8bEr5tuMj0+lUZ7Y2X4288GK+towRlZXYqv9uKCQi6YmbT2\nu11GzaJWKnYxbBB49KCFnhubdiwL+U8OhP60ElpXUFxY6nDdXQF0qYbZKxwT9vWg3npb42aHcmC1\n1C3uLSQjEkpIdQfr3xUondP6x6e6tv7e101hczRzrNtaFiFC/wAxPYHtUF+lj8bYCTgMG59cUC4O\nBQQOo2eoXepFTeL/AKYQN1sEwWx6Fu+DQLX2kw3Ok3Vjas9qJ48Exd1PHb9KCE6R0G86Ut7mK71K\nK4gklM7TyKRIBjtjtjj96AOreudJsrMJbXksk8jBCbVdzRjONxBHP/3QQ9x1jcWGkERWWqXdpMPC\nt7x4wfFOOWPbA+fAqwZr8TJ9Qbp2ymvEjsrSTEVvawyHz45Lv6E4wPqaoyl8g91OKDlYEc8mgKW5\nPH7UE80f8PPHl7gDFAZkUjawUIQG8w5ouknAUbl9Dg59KK1X4Z9XXFvo8mlRXax3KHfBG8Rk3qe6\njHOc54+dMZO7jr/qK8vWtba4tYu38TwvDOMc8N60wPLbrW10PS7pnvrnUtbAKobgBUUk9jg8f/lM\nC2rydMdRSaRqWoLEbx4UefwxkL2BVvvn9Klgv3Tp0lPxFno6wJ4IVmEOMEHsf2xUD2e4ks7n+NGD\naCMu8q8lCMcEfPNA6tW/EwrMybEYZUHnI9Cf/FAzu7G4LXTWs38SRNqhs4Bz3z9KCO6x07UNT6al\ntNMvEs7xkC7nPlI9R2/egwbrDT+r+kupLCeK9nu3KBYGRy+QvdWFWCU6avtA6h1iKDqLRhpmpvkx\nz2p8JGb3z7k557VRX77TdHteuPBut401CAouyXGcdvmASaC069030brYaay/CwPFwWspRErfUN7U\nGZX2hWSiY6ZrMc0CvhUlBUk/UcGgiLq2mtG8F54yDwfDfIoGkrRsSZXwOB2zmgsvw06XHVfUcFvI\n22xQ753Ze4H8v3OBUo9a6XodjpltHbabDHZIhVsQqBuA9DxznFQTQUe5oDYGMnn7UEbpV3JqDyz+\nBJFbBtsXiDBf/qx6CgDXL42cSRwGM3UzBQrHGFzy32oG2i2kKTSI80lzMow0rqQoyew+3tQO59Kt\nJJRI9rEzgg7igz3z/egZ6paJdGGwW4eBXy7pGeXUdwT6A5qwebPjJrcOr9TvbWZQ2Onr+Gi2nIJH\ncj7+vyqigOuRk+vtxQAqEk4BU0ABj7j96CzzKxYD0GeM0CQG3OMAjkfOgbSZwzE4PJyfWi6caTdz\naffW95akrPFIrLg/tRHpGzs9C6t0W31FrO3Y43MrcbH9c/eloZ6v0JpWoKlrHHBbScSFEHYc5Pz7\n1NDXUoJrK1g0dvw9qsspW3nXaN6KMrHnH5ieSfan0U3Rr1uidaRbiwk8BUSS6naQkjc3ZcHaRnn7\n0wbja6lZX+nw3NvMksM+FXnPJ9DUCeoXj2hSG2t2km7op4U/f/FAvHaNePb3N0jRzRA7VD8Akc9u\n/FAvcxnawZQ3HYtjJoKfDFAdeub6Vo1dSULIBtTbgYOfU8jNWUVvrm5ih0m1urixhlsI5HJliOwR\n5/LkkHHJPamjHdQ0HWdemlutN0+YWBYtC0rHDhjwVz3zWgx1n4e9U6QE8XT5Zd//APR5se9XBXbj\nS9S0zAvbO5tyWKAOhG4/KpQ3ZHXO5JFK98qRUGhfCbph77Uvx91pv463wVjR0LR7s483796WjW7r\nTrXpHWrSW2YK7lmXTbaIFpCRjjHOOSeeBipaNLtXuIre3R43lnkGXYADZnnmoH6Dkbzn6UDGWe9a\n/hKG3jsW8riQMJS3svp86B6zgMQmDtGT8qDNb6XUpOoPx72tzOkjFYowOduDwDjj70Gg6Wsq2KNe\nAJKRuKk52fIn5DvVkENrvW+iaSAsl0txI2Asdud5Yk4A4pgzv4l9ST6JZSXbyyprWpw+FFa5G21g\nz5icfzH3pgwCSQlh688+tUEwjjngZ7UHAHuWAHpn+1AXj5frQWXOGBZcKSe3c/rQIyAtnI27eBj/\nADQIMAuH8vHBB9DQwVpPLjOckEZ/ahi9/Czqj/S9VhtLm6aG1uZFUsT5VOfX5Gpg9GiNJArxsrxs\nv1BHypYGF7pljeG3kvLZSlqzNGGxhSRjP6GoG1yLUWiWc2nSPA4KJGItyYHYHHarop3wu0jWYNUv\nzriNBp8ErraRMANxJ/N7nA7ZqDUHgSQLvAbacjI7H3oOuIFuYzGS68jJRyp4+lA0m0yDwGjiTw3b\nzBwTuDe+TQVbV+mLmW1NtbSok9weZiC2zPLEZ+/FBM6Xo40/TYdL8Jr21G4vJcuCck55HbFWUKQ/\nh4tR/DTz2o8TK21qmMgKOf8AfpmrokljG1i5BHI57D5VNorut9Lab1LA638W6H8sboNrqQckq3pn\ntV0RWsfD6K7SGC3vTFahQJY2iVmkI9d+Mimie0Hp2DQ7AQacio3JZgqjcT3zxk1KHGldPWtnqMup\nS5uNTmGGnk5KjGNqf0r8qgmkhVGcquGblm96BDUZZYLGVrdN8+MIvux7UGKTdXdbaRrFvbaxbWN4\nd58BmwCjHPORycLx2q4LNe9S9TdN6I13qkWmzSXdwBCGlO4hiMKAB2A9ag0WySQwpLLtMjDcQBhV\nz6CgoHxF17XbnUYunulgsUsu4TTvjIUAEhR+x4qwZwtkOi7651PXJobm4tohHbQhdgecjnaPZeOf\neqMy1vWLvWNQlvb+ZpJpWyT2A9gB6Cgjy5AO4A5oAGRgBR39aA7Z8MkFtxPY0AbV9UGfpQWhj5Tk\nBQGxuBoEGG1iQCyHvj1oELgSkK6oRnIBIxzRdJ28Q3+fHiAds96LoH3AF1wCfyijNbF8JviI1rbQ\n6Pq/iSopxFOx5Uf0n3qUbWQk8II2SRyDPuCDUHMpSIiJQSBwDwKAgTxApnEbyIQ+APyn0+9A5B3A\ngfmoEWgcb3VlMpGFYjt+negSs7zxH/C3RWO9UElM8SAHG5fl/agNdXcEbJAZ1WadvDQDJO7Gf7c0\nED1dqWv2enzw6Rb24nZfJd3EwREHqxyMZHzOKBbT7H8PZWTK5uZ9o3Xm1SzEry5PsT7UFF+JnUez\nSZ9LttRs2km2m5KSFWXDZI491AyBzVwK6J8T7CRtPjee0tbaGAtdNISdoXgLEo5JJxyfSmC6aF1f\no2vELZXDJOxwkMybHYe4HtUFiJWJd8rKqjuTQcZV8SNI0dy43BlGVA+ZoBniE0RU7tp77Tg5zQUv\n4hNrU2tdNWOhylPEnaS5UHGYlAzn5cn74oHGt6l0z07k6nJC123HhKPFlbPptGTj9q0Kx0XMvU+t\ny6vqQtpWlZo4LOdGDWsak8Aflycgk+v2qC8a1q8OnaXLPOz2kCIWkZ+CqjgYx6n0xTBkmp9Sabp0\nKdRyI5vJkaGw08MVKIDw8jA557896QY1q2o3eqXr3N7O8skjnlnzgn5e1UMCGV/MOM0BJFOVwfX0\noFtgZTjkg8UBtpOeO1B3hg85FBZXVMM+VJAA2+h96BO4IMJ/p7qvuKBKacmOKB5CYYx5UzgDPfHz\noGwD5OApJHAHrQEAk8NWdNpx+XdkA0AIGhkGWOQcgg8UGw/DP4kmwhi07WCTZqAiSbstGc4+pFKN\nvs5o7q2Sa3kWaJxkOp4NZDOHUh/qL2k8LW78eG7kbZv+0+/yoEZp7fUpX/BXpgvYZTCSRtO7vtwe\n/vQdY6jeyatPp91FEPw8aSNMoYbi2cADt6Z70DS60KW7luJdV1JniJzBtURG2b0KN7+/vQKSWUWn\nLLqN3cSLP4ex5Y8jxiPykr23+nzzigpXUPVOu6Vqmmf8UWttb9OXDqkjRnfI3H849uRkDOKC0axL\nFr+nLB0rrUMM0bqCIGGGX1AH09qsGc9UfBiTV9Vhu9Pu5oPGLNeG6bczN7jHvVEr058Gre3sLeDV\nrmOdo3LmSFNjEH+XdntQXO51XQOl5YrCKGWa8SMYS3tzMyLjjJHb9alDqz1S5ktJ7nVdLmSVDiOO\nNfEMiE4Xy+h9xUDm11CaTxEOn3VmpHFxKFCr9s5GPmKAus6jb9M6RJf3c88yxpjcxL7uM5OO3HrQ\nVTSupoOuYdZMTSpptriNFtXKXDA/Pjhs9h2xQOJ7Xpnpa2S91WK2swqjbGw3ysfcnuxrQsGmapYv\npwvra1FtDL52Mi+Gx49sZoMb+LXV0t+jWl3OYLGTO2zjx4h2nyszHsG4/Sgxt5ZJmEsjl3PB3GgS\nlyXBxkDnNADseB2PsaA8SoXQyFgmQCV70B5R/EIjYmPJxnvigEKcYDfrQF2/X9aCwqC7l2zwfT/F\nAJJ5747E5oGTqZArKOfccftQHZWwmOD23Z4NAEkTEBmwR7g5AoG7KSSE5HyFAMTyQsMHa/cEcEc5\noL58P+v7rppdryPNAXx+GfsQe7Z9D2/Wg3zSdX0fqzT08F433eYwscOpHt9PcVkQPW632mX9vfWd\nrbXiRgrIdu2eHIwGD57+nIoKdc/ELVdC0u5afp27SUtta5vJMMzk+UDjzYHtQWDpj4gxXmif/wAi\ntXZkGZzFGW8MehZO+PmM0Fibr/poWQmF6xXA2xmFg59sKRk0C2nQP1KFvdb0vwIUJNtDKcsVP8zD\n0Jx2oJDTNA0vR5p7qzs44pJOXkUc/SgNfa/pNvbF5L2JgTsCo2WJzjGKA1jcNcxOF/m/I0zbt4+g\nxgenNA5s7CCxWWYQxpNLgyMiY3nt2oHajcuexAoEL1C1uyFkVHO1ixHb17/KgwT4rdXWep6oul2O\npywaTYqVLxDyySDjaM9x6Z+tWDPdB1TW7Wa9sumpGlursqMQRlpXwd3BA4571RcdN0i41G7h/wBS\nmNxqdkwn1O6u5/4cAXlYgcnngE/pQNvih8S211obHRyYbWInfJG/Ex9MD2+tBmNzcTXTtJcSSSSH\nH5jngDAH0oEdxbg5A9wKAzPwO+fegSLfLJoFoR5fUfegXOcHGAT8qAM+XaBzQCCwGDuyPlQWJpV3\n7Q5TIweM7u/f9qA9vNYpFML2KaR8YiaJgAh55PvQRvnYoqA+MThcDnPai4PKWQlH3K6tggjnPaiE\nmz4ZznBPfFAVWG0AZDH1z2HzoE7lhv8AJIHI/mGRQI8AEeuOMGgndN6pu7V4RJLKY4WDLhypXj0o\nNL6d+MMS4ttetDdQgDNwAPEwPRh2NZGkabrvTXVZiexvba5aI+ILWZQG3Y4IDdvtQScvTdjK8cht\nFjkQ+VlYgqPXGKA17daV07apJrV9CsZbELTgbu3YY78UEHf9evJ4K9P6JqGoiR1XxjCUjAJ5OT3N\nBM9YdSWPTenwy3t7bWbSuBunUthfUhRyT+1BA2vXnS/jGdeo9LnIHljeLwSCe5zgmgejrOz1S3kG\nhazoaXYGAJ5Sw3e38uaCsJfX02rPD1XfXtvcCXdBJGjLbOO+EK88Y7nIoLB1H1Bb6WkN1ddSQ29i\no/5MZEjzt7DGTjj2FXNGUfEH4wRaxCtnp2kwGGM7llvBvIOO4XOAe/fNMwZbqusalfLBHfzSvFH+\nSIgKo+igYqiwWfWV30rpp03p6exJnUPJexQnxuR+Ulu2PkKCrT6jcSiTxZnbxCWcFidxPJJ96BBD\nlQ35fbFAbahBHJIGO+KAIwg5YnB455oDkKcbW7UAOowSMjOORQcCVXPp+9AqDkHcDmgMNpHPcUBT\nuzQWCJXcFvKR2Y0CMiqjnz4UcH/6oG8gKluwxyAfSjQ6ylEJBJfv37/OiYQMjbjkZXOSP/FEELAE\nkNn1waBCXdjORnPoc80CZeTb5wQe2BQAm4y7jlhjvQcWO3cW4GB7ZpgGC5a3uUeNyGQ5GCR+45pg\nt+l/EzqLTgxj1O5Zc4CSOXCj70wOE+Jd/Pq0V7qVvb3bISAWUBhnuc+/2pgvkHx0soLaNIdKkEiq\nR5yDg47cYpgresfELSNc1n8VrFtAw2ZBiiywwcgeb14x2xTBYNA13ozUo/GOqWVizDc1nf6crIh/\n7wOf1rOURvVupdE6ncpFeakiSWsZdbjSLfw1Zs+VVyMHA75xWsFDHU0idTJdf65rT28YKpPvHjKp\n9Bk49qYK/rGpXF/qU9zPdyzyyMSJJAAx9ifnVlwNZ7vxYEh8GAEHO8DDH5H5U0IPK8jHxSzFQAMn\nOKgJkFwPT6UBlAII5z3zQCjnA5OKBXeuAT9KABMA208DtxQHRhzgUC3KjJx9z2oAP6/L3NAHC8Hg\n/XNAcNtGe4oEy5yeaCdLk7yx2qQCAO1AmXZSSexHbPNAhJuLJkgjvzRonuAJy2cd8UCbyOi453Dj\n7GiYTZyVPPl74oYLJIyq68EH3Gf3oYTDEjLbiP1FEDHOUOdgOfXIBFAm77j5Mnng/WgLI5UE8Eg9\niO9AnuJbuQx5wOBQFRxuIbOc54PrQK28ws76F722EyI4d4HJUOPb35yKBm8oeQsi4BPbPb71RyYI\nHmPGRg00GRsbsHIPY0Bg52AEEseBUCQJyOPXtQDtcdvvjtQCQ/GBwKAuXU4PrQBvZE5IGeO1Affj\nBJ57UBvEO045HagFWAAzktQKIzBeMg0C5kz5mOG/WgMrDJJ7jmgEnIyOccYoA3cEMRj05oC7/wDe\nBQTduzEoNxwcZGaAJOWfPNAlISVOT60aIQfkj+amgJ3bnnigKeFGPQUCf/x0Smw4V8exogX/AOY3\n+/SgKxKxeU459KAgJOckntQJkkcgkGgAAFFz/XQEmJaY7jnk96BM9yPQelAf/wCX7UBv/jagGP8A\nKB6ZoDf00HMfO/0oAH5TQA/5moECSMDPFAvGASMjPP8AigVX+b60BW7/AHoHEJJD55oDd4snv70C\nsSjCcDmgVAAbgYoGYJ3nk9qBUAYHAoP/2Q==\n" } - } + }, + "id": "uid6" } ], "nbformat": 4, diff --git a/test/ipynb/simple.out.native b/test/ipynb/simple.out.native index 0f243ca48..a17c36a41 100644 --- a/test/ipynb/simple.out.native +++ b/test/ipynb/simple.out.native @@ -12,7 +12,7 @@ Pandoc ] } [ Div - ( "" , [ "cell" , "markdown" ] , [] ) + ( "uid1" , [ "cell" , "markdown" ] , [] ) [ Header 1 ( "lorem-ipsum" , [] , [] ) @@ -46,13 +46,13 @@ Pandoc ] ] , Div - ( "" , [ "cell" , "code" ] , [] ) + ( "uid2" , [ "cell" , "code" ] , [] ) [ CodeBlock ( "" , [ "python" ] , [] ) "print(\"hello\")" ] , Div - ( "" , [ "cell" , "markdown" ] , [] ) + ( "uid3" , [ "cell" , "markdown" ] , [] ) [ Header 2 ( "pyout" , [] , [] ) [ Str "Pyout" ] ] , Div - ( "" + ( "uid4" , [ "cell" , "code" ] , [ ( "execution_count" , "2" ) ] ) @@ -70,7 +70,7 @@ Pandoc ] ] , Div - ( "" + ( "uid6" , [ "cell" , "markdown" ] , [ ( "tags" , "[\"foo\",\"bar\"]" ) ] ) -- cgit v1.2.3 From 45e51ecd65beb663973508799bd7cfd6a304930b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 7 Dec 2021 23:52:29 -0800 Subject: Revert "Markdown reader: Improve inlinesInBalancedBrackets." This reverts commit fa83246d7de8527bbf59dfac9636a42ede185194. --- src/Text/Pandoc/Readers/Markdown.hs | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 0d4592599..d5a4c322f 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -188,18 +188,26 @@ litChar = escapedChar' -- including inlines between balanced pairs of square brackets. inlinesInBalancedBrackets :: PandocMonad m => MarkdownParser m (F Inlines) inlinesInBalancedBrackets = - mconcat <$> try (char '[' >> go (1 :: Int)) - where - go n = - (:) <$> (note <|> cite <|> bracketedSpan <|> link) <*> go n - <|> - (char '[' *> ((:) <$> pure (pure (B.str "[")) <*> go (n + 1))) - <|> - (char ']' *> (if n > 1 - then (:) <$> pure (pure (B.str "]")) <*> go (n - 1) - else pure [])) - <|> - (:) <$> inline <*> go n + try $ char '[' >> withRaw (go 1) >>= + parseFromString inlines . stripBracket . snd + where stripBracket t = case T.unsnoc t of + Just (t', ']') -> t' + _ -> t + go :: PandocMonad m => Int -> MarkdownParser m () + go 0 = return () + go openBrackets = + (() <$ (escapedChar <|> + code <|> + math <|> + rawHtmlInline <|> + rawLaTeXInline') >> go openBrackets) + <|> + (do char ']' + Control.Monad.when (openBrackets > 1) $ go (openBrackets - 1)) + <|> + (char '[' >> go (openBrackets + 1)) + <|> + (anyChar >> go openBrackets) -- -- document structure -- cgit v1.2.3 From ccb9db34f8af9c201f02e1defc409b5e9523a523 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 7 Dec 2021 23:59:59 -0800 Subject: Add test for #7738. --- test/command/7738.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/command/7738.md diff --git a/test/command/7738.md b/test/command/7738.md new file mode 100644 index 000000000..e3c629aa0 --- /dev/null +++ b/test/command/7738.md @@ -0,0 +1,6 @@ +``` +% pandoc +![_](url.png) image +^D +

      _ image

      +``` -- cgit v1.2.3 From 8215ca081df398c1acce7612bec4605a97e4e8d0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Dec 2021 08:55:26 -0800 Subject: Use latest dev version of ipynb. This should give us deterministic JSON output for mime bundles. --- cabal.project | 2 +- stack.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cabal.project b/cabal.project index 1c49a003c..99c3a7815 100644 --- a/cabal.project +++ b/cabal.project @@ -11,4 +11,4 @@ constraints: aeson >= 2.0.1.0 source-repository-package type: git location: https://github.com/jgm/ipynb.git - tag: 62f1a5180a61bc89c06982d8b869b1f254208699 + tag: 00246af10885c2ad4413ace4f69a7e6c88297a08 diff --git a/stack.yaml b/stack.yaml index 5f6a34068..45215123b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -36,7 +36,7 @@ extra-deps: - unicode-transforms-0.4.0 - unicode-data-0.2.0 - git: https://github.com/jgm/ipynb.git - commit: 62f1a5180a61bc89c06982d8b869b1f254208699 + commit: 00246af10885c2ad4413ace4f69a7e6c88297a08 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From 9cbea695c439dd04c9a670107ec729c503d5b368 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Dec 2021 23:21:39 -0800 Subject: Ipynb writer: ensure deterministic order of keys. --- src/Text/Pandoc/Writers/Ipynb.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Ipynb.hs b/src/Text/Pandoc/Writers/Ipynb.hs index b81771bb2..65299a4c9 100644 --- a/src/Text/Pandoc/Writers/Ipynb.hs +++ b/src/Text/Pandoc/Writers/Ipynb.hs @@ -51,7 +51,7 @@ writeIpynb opts d = do "cell_type", "output_type", "execution_count", "metadata", "outputs", "source", - "data", "name", "text" ] } + "data", "name", "text" ] <> compare } $ notebook pandocToNotebook :: PandocMonad m -- cgit v1.2.3 From fa643ba6d78fd97f0a779840dca32bfea3b296f8 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 6 Dec 2021 16:55:19 +0100 Subject: Lua: update to latest pandoc-lua-marshal (0.1.1) - `walk` methods are added to `Block` and `Inline` values; the methods are similar to `pandoc.utils.walk_block` and `pandoc.utils.walk_inline`, but apply to filter also to the element itself, and therefore return a list of element instead of a single element. - Functions of name `Doc` are no longer accepted as alternatives for `Pandoc` filter functions. This functionality was undocumented. --- cabal.project | 5 + doc/lua-filters.md | 181 +++++++++++++++++++++++++- pandoc.cabal | 3 +- src/Text/Pandoc/Lua/Filter.hs | 238 +++-------------------------------- src/Text/Pandoc/Lua/Module/Pandoc.hs | 28 ++--- src/Text/Pandoc/Lua/Walk.hs | 183 --------------------------- stack.yaml | 3 +- test/lua/implicit-doc-filter.lua | 2 +- 8 files changed, 211 insertions(+), 432 deletions(-) delete mode 100644 src/Text/Pandoc/Lua/Walk.hs diff --git a/cabal.project b/cabal.project index 99c3a7815..63c967594 100644 --- a/cabal.project +++ b/cabal.project @@ -3,6 +3,11 @@ tests: True flags: +embed_data_files constraints: aeson >= 2.0.1.0 +source-repository-package + type: git + location: https://github.com/pandoc/pandoc-lua-marshal.git + tag: c24be07a51a6fd5ea2e1ec244b8caf220cea5ce4 + -- source-repository-package -- type: git -- location: https://github.com/jgm/texmath.git diff --git a/doc/lua-filters.md b/doc/lua-filters.md index ac682a90d..fb13f4915 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -523,8 +523,9 @@ will output: This is the filter we use when converting `MANUAL.txt` to man pages. It converts level-1 headers to uppercase (using -`walk_block` to transform inline elements inside headers), -removes footnotes, and replaces links with regular text. +[`walk`](#type-block:walk) to transform inline elements inside +headers), removes footnotes, and replaces links with regular +text. ``` lua -- we use preloaded text to get a UTF-8 aware 'upper' function @@ -532,10 +533,11 @@ local text = require('text') function Header(el) if el.level == 1 then - return pandoc.walk_block(el, { + return el:walk { Str = function(el) return pandoc.Str(text.upper(el.text)) - end }) + end + } end end @@ -611,7 +613,7 @@ wordcount = { function Pandoc(el) -- skip metadata, just count body: - pandoc.walk_block(pandoc.Div(el.blocks), wordcount) + el.blocks:walk(wordcount) print(words .. " words in body") os.exit(0) end @@ -793,6 +795,35 @@ determined via [`pandoc.utils.equals`]. `meta` : document meta information ([Meta] object) + +### walk {#type-pandoc:walk} + +`walk(self, lua_filter)` + +Applies a Lua filter to the Pandoc element. Just as for +full-document filters, the order in which elements are handled +are Inline → Inlines → Block → Blocks → Meta → Pandoc. + +Parameters: + +`self` +: the element ([Pandoc](#type-pandoc)) + +`lua_filter` +: map of filter functions (table) + +Result: + +- filtered document ([Pandoc][]) + +Usage: + + -- returns `pandoc.Pandoc{pandoc.Para{pandoc.Str 'Bye'}}` + return pandoc.Pandoc{pandoc.Para('Hi')}:walk { + Str = function (_) return 'Bye' end, + } + + ## Meta {#type-meta} Meta information on a document; string-indexed collection of @@ -834,6 +865,40 @@ or `pandoc.Blocks`. Object equality is determined via [`pandoc.utils.equals`]. +### Common Methods + +#### walk {#type-block:walk} + +`walk(self, lua_filter)` + +Applies a Lua filter to the block element. Just as for +full-document filters, the order in which elements are handled +are Inline → Inlines → Block → Blocks. + +Note that the filter is applied to the subtree, but not to the +element itself. The rationale is that the element might be +deleted by the filter, leading to possibly unexpected results. + +Parameters: + +`self` +: the element ([Block](#type-block)) + +`lua_filter` +: map of filter functions (table) + +Result: + +- filtered block ([Block][]) + +Usage: + + -- returns `pandoc.Para{pandoc.Str 'Bye'}` + return pandoc.Para('Hi'):walk { + Str = function (_) return 'Bye' end, + } + + ### BlockQuote {#type-blockquote} A block quote element. @@ -1141,11 +1206,80 @@ into Blocks wherever a value of this type is expected: the string into words (see [Inlines](#type-inlines)), and then wrapping the result into a Plain singleton. +### Methods + +Lists of type `Blocks` share all methods available in generic +lists, see the [`pandoc.List` module](#module-pandoc.list). + +Additionally, the following methods are available on Blocks +values: + +#### walk {#type-blocks:walk} + +`walk(self, lua_filter)` + +Applies a Lua filter to the Blocks list. Just as for +full-document filters, the order in which elements are handled +are are Inline → Inlines → Block → Blocks. The filter is applied +to all list items *and* to the list itself. + +Parameters: + +`self` +: the list ([Blocks](#type-blocks)) + +`lua_filter` +: map of filter functions (table) + +Result: + +- filtered list ([Blocks](#type-blocks)) + +Usage: + + -- returns `pandoc.Blocks{pandoc.Para('Salve!')}` + return pandoc.Blocks{pandoc.Plain('Salve!)}:walk { + Plain = function (p) return pandoc.Para(p.content) end, + } + ## Inline {#type-inline} Object equality is determined by checking the Haskell representation for equality. +### Common Methods + +#### walk {#type-inline:walk} + +`walk(self, lua_filter)` + +Applies a Lua filter to the Inline element. Just as for +full-document filters, the order in which elements are handled +are are Inline → Inlines → Block → Blocks. + +Note that the filter is applied to the subtree, but *not* to the +element itself. The rationale is that the element might be +deleted by the filter, leading to possibly unexpected results. + +Parameters: + +`self` +: the element ([Inline](#type-inline)) + +`lua_filter` +: map of filter functions (table) + +Result: + +- filtered inline element ([Inline][]) + +Usage: + + -- returns `pandoc.SmallCaps('SPQR)` + return pandoc.SmallCaps('spqr'):walk { + Str = function (s) return string.upper(s.text) end, + } + ### Cite {#type-cite} Citation. @@ -1526,6 +1660,43 @@ into Blocks wherever a value of this type is expected: into [SoftBreak](#type-softbreak) elements, and other whitespace characters into [Spaces](#type-space). +### Methods + +Lists of type `Inlines` share all methods available in generic +lists, see the [`pandoc.List` module](#module-pandoc.list). + +Additionally, the following methods are available on *Inlines* +values: + +#### walk {#type-inlines:walk} + +`walk(self, lua_filter)` + +Applies a Lua filter to the Inlines list. Just as for +full-document filters, the order in which elements are handled +are are Inline → Inlines → Block → Blocks. The filter is applied +to all list items *and* to the list itself. + +Parameters: + +`self` +: the list ([Inlines](#type-inlines)) + +`lua_filter` +: map of filter functions (table) + +Result: + +- filtered list ([Inlines](#type-inlines)) + +Usage: + + -- returns `pandoc.Inlines{pandoc.SmallCaps('SPQR)}` + return pandoc.Inlines{pandoc.Emph('spqr')}:walk { + Str = function (s) return string.upper(s.text) end, + Emph = function (e) return pandoc.SmallCaps(e.content) end, + } + ## Element components diff --git a/pandoc.cabal b/pandoc.cabal index 74f67c403..2abc75b87 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -481,7 +481,7 @@ library mtl >= 2.2 && < 2.3, network >= 2.6, network-uri >= 2.6 && < 2.8, - pandoc-lua-marshal >= 0.1.0.1 && < 0.2, + pandoc-lua-marshal >= 0.1.1 && < 0.2, pandoc-types >= 1.22.1 && < 1.23, parsec >= 3.1 && < 3.2, pretty >= 1.1 && < 1.2, @@ -703,7 +703,6 @@ library Text.Pandoc.Lua.Packages, Text.Pandoc.Lua.PandocLua, Text.Pandoc.Lua.Util, - Text.Pandoc.Lua.Walk, Text.Pandoc.XML.Light, Text.Pandoc.XML.Light.Types, Text.Pandoc.XML.Light.Proc, diff --git a/src/Text/Pandoc/Lua/Filter.hs b/src/Text/Pandoc/Lua/Filter.hs index ba5a14a0d..9910424d8 100644 --- a/src/Text/Pandoc/Lua/Filter.hs +++ b/src/Text/Pandoc/Lua/Filter.hs @@ -12,242 +12,36 @@ Stability : alpha Types and functions for running Lua filters. -} -module Text.Pandoc.Lua.Filter ( LuaFilterFunction - , LuaFilter - , peekLuaFilter - , runFilterFile - , walkInlines - , walkInlineLists - , walkBlocks - , walkBlockLists - , module Text.Pandoc.Lua.Walk - ) where -import Control.Applicative ((<|>)) -import Control.Monad (mplus, (>=>), (<$!>)) -import Data.Data (Data, DataType, dataTypeConstrs, dataTypeName, dataTypeOf, - showConstr, toConstr, tyconUQname) -import Data.Foldable (foldrM) -import Data.List (foldl') -import Data.Map (Map) -import Data.String (IsString (fromString)) +module Text.Pandoc.Lua.Filter + ( runFilterFile + ) where +import Control.Monad ((>=>), (<$!>)) import HsLua as Lua import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError) +import Text.Pandoc.Lua.ErrorConversion () import Text.Pandoc.Lua.Marshal.AST -import Text.Pandoc.Lua.Orphans () -import Text.Pandoc.Lua.Walk (List (..), SingletonsList (..)) -import Text.Pandoc.Walk (Walkable (walkM)) +import Text.Pandoc.Lua.Marshal.Filter -import qualified Data.Map.Strict as Map import qualified Text.Pandoc.Lua.Util as LuaUtil -- | Transform document using the filter defined in the given file. runFilterFile :: FilePath -> Pandoc -> LuaE PandocError Pandoc runFilterFile filterPath doc = do - oldtop <- Lua.gettop + oldtop <- gettop stat <- LuaUtil.dofileWithTraceback filterPath if stat /= Lua.OK - then Lua.throwErrorAsException + then throwErrorAsException else do - newtop <- Lua.gettop + newtop <- gettop -- Use the returned filters, or the implicitly defined global -- filter if nothing was returned. - luaFilters <- if newtop - oldtop >= 1 - then Lua.peek Lua.top - else Lua.pushglobaltable *> fmap (:[]) Lua.popValue + luaFilters <- forcePeek $ + if newtop - oldtop >= 1 + then peekList peekFilter top + else (:[]) <$!> (liftLua pushglobaltable *> peekFilter top) + settop oldtop runAll luaFilters doc -runAll :: [LuaFilter] -> Pandoc -> LuaE PandocError Pandoc -runAll = foldr ((>=>) . walkMWithLuaFilter) return - --- | Filter function stored in the registry -newtype LuaFilterFunction = LuaFilterFunction Lua.Reference - --- | Collection of filter functions (at most one function per element --- constructor) -newtype LuaFilter = LuaFilter (Map Name LuaFilterFunction) - -instance Peekable LuaFilter where - peek = Lua.forcePeek . peekLuaFilter - --- | Retrieves a LuaFilter object from the stack. -peekLuaFilter :: LuaError e => Peeker e LuaFilter -peekLuaFilter idx = do - let constrs = listOfInlinesFilterName - : listOfBlocksFilterName - : metaFilterName - : pandocFilterNames - ++ blockElementNames - ++ inlineElementNames - let go constr acc = Lua.liftLua $ do - Lua.getfield idx constr - filterFn <- registerFilterFunction - return $ case filterFn of - Nothing -> acc - Just fn -> Map.insert constr fn acc - LuaFilter <$!> foldrM go Map.empty constrs - --- | Register the function at the top of the stack as a filter function in the --- registry. -registerFilterFunction :: LuaError e => LuaE e (Maybe LuaFilterFunction) -registerFilterFunction = do - isFn <- Lua.isfunction Lua.top - if isFn - then Just . LuaFilterFunction <$> Lua.ref Lua.registryindex - else Nothing <$ Lua.pop 1 - --- | Retrieve filter function from registry and push it to the top of the stack. -pushFilterFunction :: LuaFilterFunction -> LuaE PandocError () -pushFilterFunction (LuaFilterFunction fnRef) = - Lua.getref Lua.registryindex fnRef - --- | Fetch either a list of elements from the stack. If there is a single --- element instead of a list, fetch that element as a singleton list. If the top --- of the stack is nil, return the default element that was passed to this --- function. If none of these apply, raise an error. -elementOrList :: Peeker PandocError a -> a -> LuaE PandocError [a] -elementOrList p x = do - elementUnchanged <- Lua.isnil top - if elementUnchanged - then [x] <$ pop 1 - else forcePeek . (`lastly` pop 1) $ (((:[]) <$!> p top) <|> peekList p top) - --- | Fetches a single element; returns the fallback if the value is @nil@. -singleElement :: forall a e. (LuaError e) => Peeker e a -> a -> LuaE e a -singleElement p x = do - elementUnchanged <- Lua.isnil top - if elementUnchanged - then x <$ Lua.pop 1 - else forcePeek $ p top `lastly` pop 1 - --- | Pop and return a value from the stack; if the value at the top of --- the stack is @nil@, return the fallback element. -popOption :: Peeker PandocError a -> a -> LuaE PandocError a -popOption peeker fallback = forcePeek . (`lastly` pop 1) $ - (fallback <$ peekNil top) <|> peeker top - --- | Apply filter on a sequence of AST elements. Both lists and single --- value are accepted as filter function return values. -runOnSequence :: forall a. (Data a, Pushable a) - => Peeker PandocError a -> LuaFilter -> SingletonsList a - -> LuaE PandocError (SingletonsList a) -runOnSequence peeker (LuaFilter fnMap) (SingletonsList xs) = - SingletonsList <$> mconcatMapM tryFilter xs - where - tryFilter :: a -> LuaE PandocError [a] - tryFilter x = - let filterFnName = fromString $ showConstr (toConstr x) - catchAllName = fromString . tyconUQname $ dataTypeName (dataTypeOf x) - in case Map.lookup filterFnName fnMap <|> Map.lookup catchAllName fnMap of - Just fn -> runFilterFunction fn x *> elementOrList peeker x - Nothing -> return [x] - --- | Try filtering the given value without type error corrections on --- the return value. -runOnValue :: (Data a, Pushable a) - => Name -> Peeker PandocError a - -> LuaFilter -> a - -> LuaE PandocError a -runOnValue filterFnName peeker (LuaFilter fnMap) x = - case Map.lookup filterFnName fnMap of - Just fn -> runFilterFunction fn x *> popOption peeker x - Nothing -> return x - --- | Push a value to the stack via a Lua filter function. The filter --- function is called with the given element as argument and is expected --- to return an element. Alternatively, the function can return nothing --- or nil, in which case the element is left unchanged. -runFilterFunction :: Pushable a - => LuaFilterFunction -> a -> LuaE PandocError () -runFilterFunction lf x = do - pushFilterFunction lf - Lua.push x - LuaUtil.callWithTraceback 1 1 - -walkMWithLuaFilter :: LuaFilter -> Pandoc -> LuaE PandocError Pandoc -walkMWithLuaFilter f = - walkInlines f - >=> walkInlineLists f - >=> walkBlocks f - >=> walkBlockLists f - >=> walkMeta f - >=> walkPandoc f - -mconcatMapM :: (Monad m) => (a -> m [a]) -> [a] -> m [a] -mconcatMapM f = fmap mconcat . mapM f - -hasOneOf :: LuaFilter -> [Name] -> Bool -hasOneOf (LuaFilter fnMap) = any (`Map.member` fnMap) - -contains :: LuaFilter -> Name -> Bool -contains (LuaFilter fnMap) = (`Map.member` fnMap) - -walkInlines :: Walkable (SingletonsList Inline) a - => LuaFilter -> a -> LuaE PandocError a -walkInlines lf = - let f :: SingletonsList Inline -> LuaE PandocError (SingletonsList Inline) - f = runOnSequence peekInline lf - in if lf `hasOneOf` inlineElementNames - then walkM f - else return - -walkInlineLists :: Walkable (List Inline) a - => LuaFilter -> a -> LuaE PandocError a -walkInlineLists lf = - let f :: List Inline -> LuaE PandocError (List Inline) - f = runOnValue listOfInlinesFilterName peekListOfInlines lf - peekListOfInlines idx = List <$!> (peekInlinesFuzzy idx) - in if lf `contains` listOfInlinesFilterName - then walkM f - else return - -walkBlocks :: Walkable (SingletonsList Block) a - => LuaFilter -> a -> LuaE PandocError a -walkBlocks lf = - let f :: SingletonsList Block -> LuaE PandocError (SingletonsList Block) - f = runOnSequence peekBlock lf - in if lf `hasOneOf` blockElementNames - then walkM f - else return - -walkBlockLists :: Walkable (List Block) a - => LuaFilter -> a -> LuaE PandocError a -walkBlockLists lf = - let f :: List Block -> LuaE PandocError (List Block) - f = runOnValue listOfBlocksFilterName peekListOfBlocks lf - peekListOfBlocks idx = List <$!> (peekBlocksFuzzy idx) - in if lf `contains` listOfBlocksFilterName - then walkM f - else return - -walkMeta :: LuaFilter -> Pandoc -> LuaE PandocError Pandoc -walkMeta lf (Pandoc m bs) = do - m' <- runOnValue "Meta" peekMeta lf m - return $ Pandoc m' bs - -walkPandoc :: LuaFilter -> Pandoc -> LuaE PandocError Pandoc -walkPandoc (LuaFilter fnMap) = - case foldl' mplus Nothing (map (`Map.lookup` fnMap) pandocFilterNames) of - Just fn -> \x -> runFilterFunction fn x *> singleElement peekPandoc x - Nothing -> return - -constructorsFor :: DataType -> [Name] -constructorsFor x = map (fromString . show) (dataTypeConstrs x) - -inlineElementNames :: [Name] -inlineElementNames = "Inline" : constructorsFor (dataTypeOf (Str mempty)) - -blockElementNames :: [Name] -blockElementNames = "Block" : constructorsFor (dataTypeOf (Para [])) - -listOfInlinesFilterName :: Name -listOfInlinesFilterName = "Inlines" - -listOfBlocksFilterName :: Name -listOfBlocksFilterName = "Blocks" - -metaFilterName :: Name -metaFilterName = "Meta" - -pandocFilterNames :: [Name] -pandocFilterNames = ["Pandoc", "Doc"] +runAll :: [Filter] -> Pandoc -> LuaE PandocError Pandoc +runAll = foldr ((>=>) . applyFully) return diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index e932ca59a..529a28cf8 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -31,20 +31,16 @@ import HsLua.Class.Peekable (PeekError) import System.Exit (ExitCode (..)) import Text.Pandoc.Class.PandocIO (runIO) import Text.Pandoc.Definition -import Text.Pandoc.Lua.Filter (List (..), SingletonsList (..), LuaFilter, - peekLuaFilter, - walkInlines, walkInlineLists, - walkBlocks, walkBlockLists) import Text.Pandoc.Lua.Orphans () import Text.Pandoc.Lua.Marshal.AST +import Text.Pandoc.Lua.Marshal.Filter (peekFilter) import Text.Pandoc.Lua.Marshal.ReaderOptions ( peekReaderOptions - , pushReaderOptions) + , pushReaderOptions) import Text.Pandoc.Lua.Module.Utils (sha1) import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua) import Text.Pandoc.Options (ReaderOptions (readerExtensions)) import Text.Pandoc.Process (pipeProcess) import Text.Pandoc.Readers (Reader (..), getReader) -import Text.Pandoc.Walk (Walkable) import qualified HsLua as Lua import qualified Data.ByteString.Lazy as BL @@ -149,16 +145,6 @@ stringConstants = } in map toField nullaryConstructors -walkElement :: (Walkable (SingletonsList Inline) a, - Walkable (SingletonsList Block) a, - Walkable (List Inline) a, - Walkable (List Block) a) - => a -> LuaFilter -> LuaE PandocError a -walkElement x f = walkInlines f x - >>= walkInlineLists f - >>= walkBlocks f - >>= walkBlockLists f - functions :: [DocumentedFunction PandocError] functions = [ defun "pipe" @@ -206,15 +192,21 @@ functions = , defun "walk_block" ### walkElement <#> parameter peekBlockFuzzy "Block" "block" "element to traverse" - <#> parameter peekLuaFilter "LuaFilter" "filter" "filter functions" + <#> parameter peekFilter "Filter" "lua_filter" "filter functions" =#> functionResult pushBlock "Block" "modified Block" , defun "walk_inline" ### walkElement <#> parameter peekInlineFuzzy "Inline" "inline" "element to traverse" - <#> parameter peekLuaFilter "LuaFilter" "filter" "filter functions" + <#> parameter peekFilter "Filter" "lua_filter" "filter functions" =#> functionResult pushInline "Inline" "modified Inline" ] + where + walkElement x f = + walkInlineSplicing f x + >>= walkInlinesStraight f + >>= walkBlockSplicing f + >>= walkBlocksStraight f data PipeError = PipeError { pipeErrorCommand :: T.Text diff --git a/src/Text/Pandoc/Lua/Walk.hs b/src/Text/Pandoc/Lua/Walk.hs deleted file mode 100644 index 75ed1f471..000000000 --- a/src/Text/Pandoc/Lua/Walk.hs +++ /dev/null @@ -1,183 +0,0 @@ -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE DeriveTraversable #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE UndecidableInstances #-} -{- | -Module : Text.Pandoc.Lua.Walk -Copyright : © 2012-2021 John MacFarlane, - © 2017-2021 Albert Krewinkel -License : GNU GPL, version 2 or above -Maintainer : Albert Krewinkel -Stability : alpha - -Walking documents in a filter-suitable way. --} -module Text.Pandoc.Lua.Walk - ( SingletonsList (..) - , List (..) - ) -where - -import Control.Monad ((<=<)) -import Data.Data (Data) -import HsLua (Pushable (push)) -import Text.Pandoc.Lua.Marshal.AST (pushBlocks, pushInlines) -import Text.Pandoc.Definition -import Text.Pandoc.Walk - - --- | Helper type which allows to traverse trees in order, while splicing in --- trees. --- --- The only interesting use of this type is via it's '@Walkable@' instance. That --- instance makes it possible to walk a Pandoc document (or a subset thereof), --- while applying a function on each element of an AST element /list/, and have --- the resulting list spliced back in place of the original element. This is the --- traversal/splicing method used for Lua filters. -newtype SingletonsList a = SingletonsList { singletonsList :: [a] } - deriving (Functor, Foldable, Traversable) - --- --- SingletonsList Inline --- -instance {-# OVERLAPPING #-} Walkable (SingletonsList Inline) [Inline] where - walkM = walkSingletonsListM - query = querySingletonsList - -instance Walkable (SingletonsList Inline) Pandoc where - walkM = walkPandocM - query = queryPandoc - -instance Walkable (SingletonsList Inline) Citation where - walkM = walkCitationM - query = queryCitation - -instance Walkable (SingletonsList Inline) Inline where - walkM = walkInlineM - query = queryInline - -instance Walkable (SingletonsList Inline) Block where - walkM = walkBlockM - query = queryBlock - -instance Walkable (SingletonsList Inline) Row where - walkM = walkRowM - query = queryRow - -instance Walkable (SingletonsList Inline) TableHead where - walkM = walkTableHeadM - query = queryTableHead - -instance Walkable (SingletonsList Inline) TableBody where - walkM = walkTableBodyM - query = queryTableBody - -instance Walkable (SingletonsList Inline) TableFoot where - walkM = walkTableFootM - query = queryTableFoot - -instance Walkable (SingletonsList Inline) Caption where - walkM = walkCaptionM - query = queryCaption - -instance Walkable (SingletonsList Inline) Cell where - walkM = walkCellM - query = queryCell - -instance Walkable (SingletonsList Inline) MetaValue where - walkM = walkMetaValueM - query = queryMetaValue - -instance Walkable (SingletonsList Inline) Meta where - walkM f (Meta metamap) = Meta <$> walkM f metamap - query f (Meta metamap) = query f metamap - --- --- SingletonsList Block --- -instance {-# OVERLAPPING #-} Walkable (SingletonsList Block) [Block] where - walkM = walkSingletonsListM - query = querySingletonsList - -instance Walkable (SingletonsList Block) Pandoc where - walkM = walkPandocM - query = queryPandoc - -instance Walkable (SingletonsList Block) Citation where - walkM = walkCitationM - query = queryCitation - -instance Walkable (SingletonsList Block) Inline where - walkM = walkInlineM - query = queryInline - -instance Walkable (SingletonsList Block) Block where - walkM = walkBlockM - query = queryBlock - -instance Walkable (SingletonsList Block) Row where - walkM = walkRowM - query = queryRow - -instance Walkable (SingletonsList Block) TableHead where - walkM = walkTableHeadM - query = queryTableHead - -instance Walkable (SingletonsList Block) TableBody where - walkM = walkTableBodyM - query = queryTableBody - -instance Walkable (SingletonsList Block) TableFoot where - walkM = walkTableFootM - query = queryTableFoot - -instance Walkable (SingletonsList Block) Caption where - walkM = walkCaptionM - query = queryCaption - -instance Walkable (SingletonsList Block) Cell where - walkM = walkCellM - query = queryCell - -instance Walkable (SingletonsList Block) MetaValue where - walkM = walkMetaValueM - query = queryMetaValue - -instance Walkable (SingletonsList Block) Meta where - walkM f (Meta metamap) = Meta <$> walkM f metamap - query f (Meta metamap) = query f metamap - - -walkSingletonsListM :: (Monad m, Walkable (SingletonsList a) a) - => (SingletonsList a -> m (SingletonsList a)) - -> [a] -> m [a] -walkSingletonsListM f = - let f' = fmap singletonsList . f . SingletonsList . (:[]) <=< walkM f - in fmap mconcat . mapM f' - -querySingletonsList :: (Monoid c, Walkable (SingletonsList a) a) - => (SingletonsList a -> c) - -> [a] -> c -querySingletonsList f = - let f' x = f (SingletonsList [x]) `mappend` query f x - in mconcat . map f' - - --- | List wrapper where each list is processed as a whole, but special --- pushed to Lua in type-dependent ways. --- --- The walk instance is basically that of unwrapped Haskell lists. -newtype List a = List { fromList :: [a] } - deriving (Data, Eq, Show) - -instance Pushable (List Block) where - push (List xs) = pushBlocks xs - -instance Pushable (List Inline) where - push (List xs) = pushInlines xs - -instance Walkable [a] b => Walkable (List a) b where - walkM f = walkM (fmap fromList . f . List) - query f = query (f . List) diff --git a/stack.yaml b/stack.yaml index 45215123b..e1eb606b8 100644 --- a/stack.yaml +++ b/stack.yaml @@ -26,7 +26,6 @@ extra-deps: - lua-2.0.2 - tasty-hslua-1.0.0 - tasty-lua-1.0.0 -- pandoc-lua-marshal-0.1.0.1 - pandoc-types-1.22.1 - commonmark-0.2.1.1 - commonmark-extensions-0.2.2 @@ -37,6 +36,8 @@ extra-deps: - unicode-data-0.2.0 - git: https://github.com/jgm/ipynb.git commit: 00246af10885c2ad4413ace4f69a7e6c88297a08 +- git: https://github.com/pandoc/pandoc-lua-marshal.git + commit: c24be07a51a6fd5ea2e1ec244b8caf220cea5ce4 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 diff --git a/test/lua/implicit-doc-filter.lua b/test/lua/implicit-doc-filter.lua index 253462d1c..f053dc1b2 100644 --- a/test/lua/implicit-doc-filter.lua +++ b/test/lua/implicit-doc-filter.lua @@ -1,4 +1,4 @@ -function Doc (doc) +function Pandoc (doc) local meta = {} local hello = { pandoc.Str "Hello,", pandoc.Space(), pandoc.Str "World!" } local blocks = { pandoc.Para(hello) } -- cgit v1.2.3 From 20eb8ac7fded0220278e8818a92968328f9014eb Mon Sep 17 00:00:00 2001 From: Kolen Cheung Date: Thu, 9 Dec 2021 20:36:56 -0800 Subject: ipynb writer: handle cell output with raw block of markdown (#7563) Write RawBlock of markdown in code-cell output. #7561 makes the ipynb reader reads code-cell output with mime "text/markdown" to a RawBlock of markdown This commit makes the ipynb writer writes this RawBlock of markdown back inside a code-cell output with the same mime, preserving this information in round-trip Add tests of ipynb reader (#7561) and ipynb writer (#7563)'s ability to handle a "text/markdown" mime type in a code-cell output --- src/Text/Pandoc/Writers/Ipynb.hs | 2 + test/Tests/Old.hs | 6 ++ test/ipynb/mime.ipynb | 187 +++++++++++++++++++++++++++++++++++++++ test/ipynb/mime.native | 154 ++++++++++++++++++++++++++++++++ test/ipynb/mime.out.ipynb | 169 +++++++++++++++++++++++++++++++++++ 5 files changed, 518 insertions(+) create mode 100644 test/ipynb/mime.ipynb create mode 100644 test/ipynb/mime.native create mode 100644 test/ipynb/mime.out.ipynb diff --git a/src/Text/Pandoc/Writers/Ipynb.hs b/src/Text/Pandoc/Writers/Ipynb.hs index 65299a4c9..47c6e6966 100644 --- a/src/Text/Pandoc/Writers/Ipynb.hs +++ b/src/Text/Pandoc/Writers/Ipynb.hs @@ -253,6 +253,8 @@ extractData bs = do return (M.insert "text/html" (TextualData raw) mmap, meta) go (mmap, meta) (RawBlock (Format "latex") raw) = return (M.insert "text/latex" (TextualData raw) mmap, meta) + go (mmap, meta) (RawBlock (Format "markdown") raw) = + return (M.insert "text/markdown" (TextualData raw) mmap, meta) go (mmap, meta) (Div _ bs') = foldM go (mmap, meta) bs' go (mmap, meta) b = (mmap, meta) <$ report (BlockNotRendered b) diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs index d080f68f1..1d5b0b04e 100644 --- a/test/Tests/Old.hs +++ b/test/Tests/Old.hs @@ -219,6 +219,12 @@ tests pandocPath = "--markdown-headings=setext", "-t", "ipynb-raw_html-raw_tex+raw_attribute", "-s"] "ipynb/simple.in.native" "ipynb/simple.ipynb" + , test' "reader" ["-t", "native", "-f", "ipynb", + "--ipynb-output=all"] + "ipynb/mime.ipynb" "ipynb/mime.native" + , test' "writer" ["-f", "native", "-t", "ipynb", + "--wrap=preserve"] + "ipynb/mime.native" "ipynb/mime.out.ipynb" ] ] where diff --git a/test/ipynb/mime.ipynb b/test/ipynb/mime.ipynb new file mode 100644 index 000000000..8789ca857 --- /dev/null +++ b/test/ipynb/mime.ipynb @@ -0,0 +1,187 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "0ad1fbe7-107b-4668-ae4d-8ce4ae9a4400", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import annotations\n", + "\n", + "from dataclasses import dataclass" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "c2d3a9f4-dfdb-4ced-bbcd-3dfd1780af80", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "7.29.0\n" + ] + } + ], + "source": [ + "import IPython\n", + "\n", + "print(IPython.__version__)" + ] + }, + { + "cell_type": "markdown", + "id": "21e7a4a1-0cf8-48cc-823c-dca698ae6853", + "metadata": {}, + "source": [ + "Supported IPython display formatters:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "053cdbc4-b157-4e3e-9c86-8f374770d006", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "text/plain\n", + "text/html\n", + "text/markdown\n", + "image/svg+xml\n", + "image/png\n", + "application/pdf\n", + "image/jpeg\n", + "text/latex\n", + "application/json\n", + "application/javascript\n" + ] + } + ], + "source": [ + "ip = get_ipython()\n", + "for mime in ip.display_formatter.formatters:\n", + " print(mime)" + ] + }, + { + "cell_type": "markdown", + "id": "d79b063d-ce81-497b-a0ea-5b2e2972e845", + "metadata": {}, + "source": [ + "Let's write a simple class that will output different mime:" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "c847636c-1c45-432e-9d8d-7310dd7f5637", + "metadata": {}, + "outputs": [], + "source": [ + "@dataclass\n", + "class Mime:\n", + " math: str\n", + "\n", + " def _repr_mimebundle_(\n", + " self,\n", + " include: Container[str] | None = None,\n", + " exclude: Container[str] | None = None,\n", + " **kwargs,\n", + " ) -> dict[str, str]:\n", + " string = self.math\n", + " data = {\n", + " \"text/plain\": string,\n", + " \"text/html\": (latex := f\"\\\\[{string}\\\\]\"),\n", + " \"text/markdown\": f\"$${string}$$\",\n", + " # \"image/svg+xml\":,\n", + " # \"image/png\":,\n", + " # \"application/pdf\":,\n", + " # \"image/jpeg\":,\n", + " \"text/latex\": latex,\n", + " # \"application/json\":,\n", + " # \"application/javascript\":,\n", + " }\n", + " if include:\n", + " data = {k: v for k, v in data.items() if k in include}\n", + " if exclude:\n", + " data = {k: v for k, v in data.items() if k not in exclude}\n", + " return data" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "4fa54f22-0c3a-4809-91f7-ea7101ff1907", + "metadata": {}, + "outputs": [], + "source": [ + "mime = Mime(\"E = mc^2\")" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "c419e6a6-240c-4af0-a244-5f1526705c30", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\\[E = mc^2\\]" + ], + "text/latex": [ + "\\[E = mc^2\\]" + ], + "text/markdown": [ + "$$E = mc^2$$" + ], + "text/plain": [ + "E = mc^2" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mime" + ] + }, + { + "cell_type": "markdown", + "id": "bf140b8e-16ac-4670-9778-f1c1d9486f9d", + "metadata": {}, + "source": [ + "Note that #7561 made ipynb reader aware of this, and #7563 made ipynb writer aware of this." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/test/ipynb/mime.native b/test/ipynb/mime.native new file mode 100644 index 000000000..21e3444e2 --- /dev/null +++ b/test/ipynb/mime.native @@ -0,0 +1,154 @@ +[ Div + ( "0ad1fbe7-107b-4668-ae4d-8ce4ae9a4400" + , [ "cell" , "code" ] + , [ ( "execution_count" , "1" ) ] + ) + [ CodeBlock + ( "" , [ "python" ] , [] ) + "from __future__ import annotations\n\nfrom dataclasses import dataclass" + ] +, Div + ( "c2d3a9f4-dfdb-4ced-bbcd-3dfd1780af80" + , [ "cell" , "code" ] + , [ ( "execution_count" , "2" ) ] + ) + [ CodeBlock + ( "" , [ "python" ] , [] ) + "import IPython\n\nprint(IPython.__version__)" + , Div + ( "" , [ "output" , "stream" , "stdout" ] , [] ) + [ CodeBlock ( "" , [] , [] ) "7.29.0\n" ] + ] +, Div + ( "21e7a4a1-0cf8-48cc-823c-dca698ae6853" + , [ "cell" , "markdown" ] + , [] + ) + [ Para + [ Str "Supported" + , Space + , Str "IPython" + , Space + , Str "display" + , Space + , Str "formatters:" + ] + ] +, Div + ( "053cdbc4-b157-4e3e-9c86-8f374770d006" + , [ "cell" , "code" ] + , [ ( "execution_count" , "3" ) ] + ) + [ CodeBlock + ( "" , [ "python" ] , [] ) + "ip = get_ipython()\nfor mime in ip.display_formatter.formatters:\n print(mime)" + , Div + ( "" , [ "output" , "stream" , "stdout" ] , [] ) + [ CodeBlock + ( "" , [] , [] ) + "text/plain\ntext/html\ntext/markdown\nimage/svg+xml\nimage/png\napplication/pdf\nimage/jpeg\ntext/latex\napplication/json\napplication/javascript\n" + ] + ] +, Div + ( "d79b063d-ce81-497b-a0ea-5b2e2972e845" + , [ "cell" , "markdown" ] + , [] + ) + [ Para + [ Str "Let's" + , Space + , Str "write" + , Space + , Str "a" + , Space + , Str "simple" + , Space + , Str "class" + , Space + , Str "that" + , Space + , Str "will" + , Space + , Str "output" + , Space + , Str "different" + , Space + , Str "mime:" + ] + ] +, Div + ( "c847636c-1c45-432e-9d8d-7310dd7f5637" + , [ "cell" , "code" ] + , [ ( "execution_count" , "4" ) ] + ) + [ CodeBlock + ( "" , [ "python" ] , [] ) + "@dataclass\nclass Mime:\n math: str\n\n def _repr_mimebundle_(\n self,\n include: Container[str] | None = None,\n exclude: Container[str] | None = None,\n **kwargs,\n ) -> dict[str, str]:\n string = self.math\n data = {\n \"text/plain\": string,\n \"text/html\": (latex := f\"\\\\[{string}\\\\]\"),\n \"text/markdown\": f\"$${string}$$\",\n # \"image/svg+xml\":,\n # \"image/png\":,\n # \"application/pdf\":,\n # \"image/jpeg\":,\n \"text/latex\": latex,\n # \"application/json\":,\n # \"application/javascript\":,\n }\n if include:\n data = {k: v for k, v in data.items() if k in include}\n if exclude:\n data = {k: v for k, v in data.items() if k not in exclude}\n return data" + ] +, Div + ( "4fa54f22-0c3a-4809-91f7-ea7101ff1907" + , [ "cell" , "code" ] + , [ ( "execution_count" , "5" ) ] + ) + [ CodeBlock + ( "" , [ "python" ] , [] ) "mime = Mime(\"E = mc^2\")" + ] +, Div + ( "c419e6a6-240c-4af0-a244-5f1526705c30" + , [ "cell" , "code" ] + , [ ( "execution_count" , "6" ) ] + ) + [ CodeBlock ( "" , [ "python" ] , [] ) "mime" + , Div + ( "" + , [ "output" , "execute_result" ] + , [ ( "execution_count" , "6" ) ] + ) + [ RawBlock (Format "html") "\\[E = mc^2\\]" + , RawBlock (Format "latex") "\\[E = mc^2\\]" + , RawBlock (Format "markdown") "$$E = mc^2$$" + , CodeBlock ( "" , [] , [] ) "E = mc^2" + ] + ] +, Div + ( "bf140b8e-16ac-4670-9778-f1c1d9486f9d" + , [ "cell" , "markdown" ] + , [] + ) + [ Para + [ Str "Note" + , Space + , Str "that" + , Space + , Str "#7561" + , Space + , Str "made" + , Space + , Str "ipynb" + , Space + , Str "reader" + , Space + , Str "aware" + , Space + , Str "of" + , Space + , Str "this," + , Space + , Str "and" + , Space + , Str "#7563" + , Space + , Str "made" + , Space + , Str "ipynb" + , Space + , Str "writer" + , Space + , Str "aware" + , Space + , Str "of" + , Space + , Str "this." + ] + ] +] diff --git a/test/ipynb/mime.out.ipynb b/test/ipynb/mime.out.ipynb new file mode 100644 index 000000000..4cc806a1e --- /dev/null +++ b/test/ipynb/mime.out.ipynb @@ -0,0 +1,169 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import annotations\n", + "\n", + "from dataclasses import dataclass" + ], + "id": "0ad1fbe7-107b-4668-ae4d-8ce4ae9a4400" + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "7.29.0\n" + ] + } + ], + "source": [ + "import IPython\n", + "\n", + "print(IPython.__version__)" + ], + "id": "c2d3a9f4-dfdb-4ced-bbcd-3dfd1780af80" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Supported IPython display formatters:" + ], + "id": "21e7a4a1-0cf8-48cc-823c-dca698ae6853" + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "text/plain\n", + "text/html\n", + "text/markdown\n", + "image/svg+xml\n", + "image/png\n", + "application/pdf\n", + "image/jpeg\n", + "text/latex\n", + "application/json\n", + "application/javascript\n" + ] + } + ], + "source": [ + "ip = get_ipython()\n", + "for mime in ip.display_formatter.formatters:\n", + " print(mime)" + ], + "id": "053cdbc4-b157-4e3e-9c86-8f374770d006" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's write a simple class that will output different mime:" + ], + "id": "d79b063d-ce81-497b-a0ea-5b2e2972e845" + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "@dataclass\n", + "class Mime:\n", + " math: str\n", + "\n", + " def _repr_mimebundle_(\n", + " self,\n", + " include: Container[str] | None = None,\n", + " exclude: Container[str] | None = None,\n", + " **kwargs,\n", + " ) -> dict[str, str]:\n", + " string = self.math\n", + " data = {\n", + " \"text/plain\": string,\n", + " \"text/html\": (latex := f\"\\\\[{string}\\\\]\"),\n", + " \"text/markdown\": f\"$${string}$$\",\n", + " # \"image/svg+xml\":,\n", + " # \"image/png\":,\n", + " # \"application/pdf\":,\n", + " # \"image/jpeg\":,\n", + " \"text/latex\": latex,\n", + " # \"application/json\":,\n", + " # \"application/javascript\":,\n", + " }\n", + " if include:\n", + " data = {k: v for k, v in data.items() if k in include}\n", + " if exclude:\n", + " data = {k: v for k, v in data.items() if k not in exclude}\n", + " return data" + ], + "id": "c847636c-1c45-432e-9d8d-7310dd7f5637" + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "mime = Mime(\"E = mc^2\")" + ], + "id": "4fa54f22-0c3a-4809-91f7-ea7101ff1907" + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "output_type": "execute_result", + "execution_count": 6, + "metadata": {}, + "data": { + "text/html": [ + "\\[E = mc^2\\]" + ], + "text/latex": [ + "\\[E = mc^2\\]" + ], + "text/markdown": [ + "$$E = mc^2$$" + ], + "text/plain": [ + "E = mc^2" + ] + } + } + ], + "source": [ + "mime" + ], + "id": "c419e6a6-240c-4af0-a244-5f1526705c30" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that #7561 made ipynb reader aware of this, and #7563 made ipynb writer aware of this." + ], + "id": "bf140b8e-16ac-4670-9778-f1c1d9486f9d" + } + ], + "nbformat": 4, + "nbformat_minor": 5, + "metadata": {} +} -- cgit v1.2.3 From 3e7b46af642b205439e3dee52d805d738c4ad954 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 10 Dec 2021 14:07:41 +0100 Subject: Switch to released pandoc-lua-marshal-0.1.2 Cell values are now marshaled as userdata objects; a constructor function for table cells is provided as `pandoc.Cell`. --- cabal.project | 5 ----- doc/lua-filters.md | 9 +++++++++ pandoc.cabal | 2 +- src/Text/Pandoc/Lua/Module/Pandoc.hs | 1 + stack.yaml | 3 +-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cabal.project b/cabal.project index 63c967594..99c3a7815 100644 --- a/cabal.project +++ b/cabal.project @@ -3,11 +3,6 @@ tests: True flags: +embed_data_files constraints: aeson >= 2.0.1.0 -source-repository-package - type: git - location: https://github.com/pandoc/pandoc-lua-marshal.git - tag: c24be07a51a6fd5ea2e1ec244b8caf220cea5ce4 - -- source-repository-package -- type: git -- location: https://github.com/jgm/texmath.git diff --git a/doc/lua-filters.md b/doc/lua-filters.md index fb13f4915..322833c46 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -1769,6 +1769,15 @@ Fields: : number of rows occupied by the cell; the height of the cell (integer). +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List] of strings) + +`attributes` +: alias for `attr.attributes` ([Attributes]) + ### Citation {#type-citation} Single citation entry diff --git a/pandoc.cabal b/pandoc.cabal index 2abc75b87..dcf12bf04 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -481,7 +481,7 @@ library mtl >= 2.2 && < 2.3, network >= 2.6, network-uri >= 2.6 && < 2.8, - pandoc-lua-marshal >= 0.1.1 && < 0.2, + pandoc-lua-marshal >= 0.1.2 && < 0.2, pandoc-types >= 1.22.1 && < 1.23, parsec >= 3.1 && < 3.2, pretty >= 1.1 && < 1.2, diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index 529a28cf8..ac159ae0d 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -115,6 +115,7 @@ otherConstructors = , mkAttributeList , mkBlocks , mkCitation + , mkCell , mkInlines , mkListAttributes , mkSimpleTable diff --git a/stack.yaml b/stack.yaml index e1eb606b8..548931120 100644 --- a/stack.yaml +++ b/stack.yaml @@ -26,6 +26,7 @@ extra-deps: - lua-2.0.2 - tasty-hslua-1.0.0 - tasty-lua-1.0.0 +- pandoc-lua-marshal-0.1.2 - pandoc-types-1.22.1 - commonmark-0.2.1.1 - commonmark-extensions-0.2.2 @@ -36,8 +37,6 @@ extra-deps: - unicode-data-0.2.0 - git: https://github.com/jgm/ipynb.git commit: 00246af10885c2ad4413ace4f69a7e6c88297a08 -- git: https://github.com/pandoc/pandoc-lua-marshal.git - commit: c24be07a51a6fd5ea2e1ec244b8caf220cea5ce4 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From a64ea1864743ed8d96acec04f2895dc638bc1df7 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 10 Dec 2021 18:10:36 +0100 Subject: Powerpoint tests: shorten lines by grouping tests This makes the test output more pleasant to read in narrow terminal windows. --- test/Tests/Writers/Powerpoint.hs | 375 +++++++++++++++++++-------------------- 1 file changed, 186 insertions(+), 189 deletions(-) diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs index f3663efbb..0e8ef076b 100644 --- a/test/Tests/Writers/Powerpoint.hs +++ b/test/Tests/Writers/Powerpoint.hs @@ -1,5 +1,6 @@ module Tests.Writers.Powerpoint (tests) where +import Control.Arrow ((***)) import Tests.Writers.OOXML (ooxmlTest) import Text.Pandoc import Test.Tasty @@ -42,198 +43,194 @@ groupPptxTests pairs = , testGroup "With `--reference-doc` pptx file" refs ] +testGroup' :: String -> [(TestTree, TestTree)] -> (TestTree, TestTree) +testGroup' descr = (testGroup descr *** testGroup descr) . unzip + tests :: [TestTree] tests = let - regularTests = - groupPptxTests [ pptxTests "Inline formatting" - def - "pptx/inline-formatting/input.native" - "pptx/inline-formatting/output.pptx" - , pptxTests "Slide breaks (default slide-level)" - def - "pptx/slide-breaks/input.native" - "pptx/slide-breaks/output.pptx" - , pptxTests "slide breaks (slide-level set to 1)" - def{ writerSlideLevel = Just 1 } - "pptx/slide-breaks/input.native" - "pptx/slide-breaks-slide-level-1/output.pptx" - , pptxTests "lists" - def - "pptx/lists/input.native" - "pptx/lists/output.pptx" - , pptxTests "start ordered list at specified num" - def - "pptx/start-numbering-at/input.native" - "pptx/start-numbering-at/output.pptx" - , pptxTests "List continuation paragraph indentation" - def - "pptx/list-level/input.native" - "pptx/list-level/output.pptx" - , pptxTests "tables" - def - "pptx/tables/input.native" - "pptx/tables/output.pptx" - , pptxTests "table of contents" - def{ writerTableOfContents = True } - "pptx/slide-breaks/input.native" - "pptx/slide-breaks-toc/output.pptx" - , pptxTests "end notes" - def - "pptx/endnotes/input.native" - "pptx/endnotes/output.pptx" - , pptxTests "end notes, with table of contents" - def { writerTableOfContents = True } - "pptx/endnotes/input.native" - "pptx/endnotes-toc/output.pptx" - , pptxTests "images" - def - "pptx/images/input.native" - "pptx/images/output.pptx" - , pptxTests "two-column layout" - def - "pptx/two-column/all-text/input.native" - "pptx/two-column/all-text/output.pptx" - , pptxTests "two-column (not comparison)" - def - "pptx/two-column/text-and-image/input.native" - "pptx/two-column/text-and-image/output.pptx" - , pptxTests "speaker notes" - def - "pptx/speaker-notes/input.native" - "pptx/speaker-notes/output.pptx" - , pptxTests "speaker notes after a separating block" - def - "pptx/speaker-notes-afterseps/input.native" - "pptx/speaker-notes-afterseps/output.pptx" - , pptxTests "speaker notes after a separating header" - def - "pptx/speaker-notes-afterheader/input.native" - "pptx/speaker-notes-afterheader/output.pptx" - , pptxTests "speaker notes after metadata" - def - "pptx/speaker-notes-after-metadata/input.native" - "pptx/speaker-notes-after-metadata/output.pptx" - , pptxTests "remove empty slides" - def - "pptx/remove-empty-slides/input.native" - "pptx/remove-empty-slides/output.pptx" - , pptxTests "raw ooxml" - def - "pptx/raw-ooxml/input.native" - "pptx/raw-ooxml/output.pptx" - , pptxTests "metadata, custom properties" - def - "pptx/document-properties/input.native" - "pptx/document-properties/output.pptx" - , pptxTests "metadata, short description" - def - "pptx/document-properties-short-desc/input.native" - "pptx/document-properties-short-desc/output.pptx" - , pptxTests "inline code and code blocks" - def - "pptx/code/input.native" - "pptx/code/output.pptx" - , pptxTests "inline code and code blocks, custom formatting" - def { writerVariables = Context $ M.fromList - [(pack "monofont", toVal $ pack "Consolas")] } - "pptx/code/input.native" - "pptx/code-custom/output.pptx" - , pptxTests ("Using slide level 0, if the first thing on " - <> "a slide is a h1 it's used as the " - <> "slide title") - def { writerSlideLevel = Just 0 } - "pptx/slide-level-0/h1-with-image/input.native" - "pptx/slide-level-0/h1-with-image/output.pptx" - , pptxTests ("Using slide level 0, if the first thing on " - <> "a slide is a h2 it's used as the " - <> "slide title") - def { writerSlideLevel = Just 0 } - "pptx/slide-level-0/h2-with-image/input.native" - "pptx/slide-level-0/h2-with-image/output.pptx" - , pptxTests ("Using slide level 0, if the first thing on " - <> "a slide is a heading it's used as the " - <> "slide title (works with a table)") - def { writerSlideLevel = Just 0 } - "pptx/slide-level-0/h1-with-table/input.native" - "pptx/slide-level-0/h1-with-table/output.pptx" - , pptxTests ("Using slide level 0, if the first thing on " - <> "a slide is a heading it's used as the " - <> "slide title (content with caption layout)") - def { writerSlideLevel = Just 0 } - "pptx/slide-level-0/h1-h2-with-table/input.native" - "pptx/slide-level-0/h1-h2-with-table/output.pptx" - , pptxTests ("comparison layout used when two columns " - <> "contain text plus non-text") - def - "pptx/comparison/both-columns/input.native" - "pptx/comparison/both-columns/output.pptx" - , pptxTests ("comparison layout used even when only one " - <> "column contains text plus non-text") - def - "pptx/comparison/one-column/input.native" - "pptx/comparison/one-column/output.pptx" - , pptxTests ("extra text in one column in comparison " - <> "layout gets overlaid") - def - "pptx/comparison/extra-text/input.native" - "pptx/comparison/extra-text/output.pptx" - , pptxTests ("extra image in one column in comparison " - <> "layout gets overlaid") - def - "pptx/comparison/extra-image/input.native" - "pptx/comparison/extra-image/output.pptx" - , pptxTests "comparison not used if the non-text comes first" - def - "pptx/comparison/non-text-first/input.native" - "pptx/comparison/non-text-first/output.pptx" - , pptxTests ("Heading, text and an image on the same " - <> "slide uses the Content with Caption " - <> "layout") - def - "pptx/content-with-caption/heading-text-image/input.native" - "pptx/content-with-caption/heading-text-image/output.pptx" - , pptxTests ("Text and an image on the same " - <> "slide uses the Content with Caption " - <> "layout") - def - "pptx/content-with-caption/text-image/input.native" - "pptx/content-with-caption/text-image/output.pptx" - , pptxTests ("If the image comes first, Content with " - <> "Caption is not used") - def - "pptx/content-with-caption/image-text/input.native" - "pptx/content-with-caption/image-text/output.pptx" - , pptxTests ("If a slide contains only speaker notes, the " - <> "Blank layout is used") - def - "pptx/blanks/just-speaker-notes/input.native" - "pptx/blanks/just-speaker-notes/output.pptx" - , pptxTests ("If a slide contains only an empty heading " - <> "with a body of only non-breaking spaces" - <> ", the Blank layout is used") - def - "pptx/blanks/nbsp-in-body/input.native" - "pptx/blanks/nbsp-in-body/output.pptx" - , pptxTests ("If a slide contains only a heading " - <> "containing only non-breaking spaces, " - <> "the Blank layout is used") - def - "pptx/blanks/nbsp-in-heading/input.native" - "pptx/blanks/nbsp-in-heading/output.pptx" - , pptxTests ("Incremental lists are supported") - def { writerIncremental = True } - "pptx/incremental-lists/with-flag/input.native" - "pptx/incremental-lists/with-flag/output.pptx" - , pptxTests ("One-off incremental lists are supported") - def - "pptx/incremental-lists/without-flag/input.native" - "pptx/incremental-lists/without-flag/output.pptx" - , pptxTests "Background images" - def - "pptx/background-image/input.native" - "pptx/background-image/output.pptx" - ] + regularTests = groupPptxTests + [ pptxTests "Inline formatting" + def + "pptx/inline-formatting/input.native" + "pptx/inline-formatting/output.pptx" + , pptxTests "Slide breaks (default slide-level)" + def + "pptx/slide-breaks/input.native" + "pptx/slide-breaks/output.pptx" + , pptxTests "slide breaks (slide-level set to 1)" + def{ writerSlideLevel = Just 1 } + "pptx/slide-breaks/input.native" + "pptx/slide-breaks-slide-level-1/output.pptx" + , pptxTests "lists" + def + "pptx/lists/input.native" + "pptx/lists/output.pptx" + , pptxTests "start ordered list at specified num" + def + "pptx/start-numbering-at/input.native" + "pptx/start-numbering-at/output.pptx" + , pptxTests "List continuation paragraph indentation" + def + "pptx/list-level/input.native" + "pptx/list-level/output.pptx" + , pptxTests "tables" + def + "pptx/tables/input.native" + "pptx/tables/output.pptx" + , pptxTests "table of contents" + def{ writerTableOfContents = True } + "pptx/slide-breaks/input.native" + "pptx/slide-breaks-toc/output.pptx" + , pptxTests "end notes" + def + "pptx/endnotes/input.native" + "pptx/endnotes/output.pptx" + , pptxTests "end notes, with table of contents" + def { writerTableOfContents = True } + "pptx/endnotes/input.native" + "pptx/endnotes-toc/output.pptx" + , pptxTests "images" + def + "pptx/images/input.native" + "pptx/images/output.pptx" + , pptxTests "two-column layout" + def + "pptx/two-column/all-text/input.native" + "pptx/two-column/all-text/output.pptx" + , pptxTests "two-column (not comparison)" + def + "pptx/two-column/text-and-image/input.native" + "pptx/two-column/text-and-image/output.pptx" + , pptxTests "speaker notes" + def + "pptx/speaker-notes/input.native" + "pptx/speaker-notes/output.pptx" + , pptxTests "speaker notes after a separating block" + def + "pptx/speaker-notes-afterseps/input.native" + "pptx/speaker-notes-afterseps/output.pptx" + , pptxTests "speaker notes after a separating header" + def + "pptx/speaker-notes-afterheader/input.native" + "pptx/speaker-notes-afterheader/output.pptx" + , pptxTests "speaker notes after metadata" + def + "pptx/speaker-notes-after-metadata/input.native" + "pptx/speaker-notes-after-metadata/output.pptx" + , pptxTests "remove empty slides" + def + "pptx/remove-empty-slides/input.native" + "pptx/remove-empty-slides/output.pptx" + , pptxTests "raw ooxml" + def + "pptx/raw-ooxml/input.native" + "pptx/raw-ooxml/output.pptx" + , pptxTests "metadata, custom properties" + def + "pptx/document-properties/input.native" + "pptx/document-properties/output.pptx" + , pptxTests "metadata, short description" + def + "pptx/document-properties-short-desc/input.native" + "pptx/document-properties-short-desc/output.pptx" + , pptxTests "inline code and code blocks" + def + "pptx/code/input.native" + "pptx/code/output.pptx" + , pptxTests "inline code and code blocks, custom formatting" + def { writerVariables = Context $ M.fromList + [(pack "monofont", toVal $ pack "Consolas")] } + "pptx/code/input.native" + "pptx/code-custom/output.pptx" + , testGroup' "Using slide level 0, if the first thing on a slide is" + [ pptxTests ("a h1 it's used as the slide title") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0/h1-with-image/input.native" + "pptx/slide-level-0/h1-with-image/output.pptx" + , pptxTests ("a h2 it's used as the " + <> "slide title") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0/h2-with-image/input.native" + "pptx/slide-level-0/h2-with-image/output.pptx" + , testGroup' "a heading it's used as the slide title" + [ pptxTests "(works with a table)" + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0/h1-with-table/input.native" + "pptx/slide-level-0/h1-with-table/output.pptx" + , pptxTests ("(content with caption layout)") + def { writerSlideLevel = Just 0 } + "pptx/slide-level-0/h1-h2-with-table/input.native" + "pptx/slide-level-0/h1-h2-with-table/output.pptx" + ] + ] + , testGroup' "comparison layout" + [ testGroup' "comparison layout is used..." + [ pptxTests "when two columns contain text + non-text" + def + "pptx/comparison/both-columns/input.native" + "pptx/comparison/both-columns/output.pptx" + , pptxTests "even when only one col contains text + non-text" + def + "pptx/comparison/one-column/input.native" + "pptx/comparison/one-column/output.pptx" + ] + , testGroup' "extra ... in one column gets overlaid" + [ pptxTests "text" + def + "pptx/comparison/extra-text/input.native" + "pptx/comparison/extra-text/output.pptx" + , pptxTests "image" + def + "pptx/comparison/extra-image/input.native" + "pptx/comparison/extra-image/output.pptx" + ] + , pptxTests "is not used if the non-text comes first" + def + "pptx/comparison/non-text-first/input.native" + "pptx/comparison/non-text-first/output.pptx" + ] + , testGroup' "Content with Caption layout is ..." + [ pptxTests "used for heading, text, image on the same slide" + def + "pptx/content-with-caption/heading-text-image/input.native" + "pptx/content-with-caption/heading-text-image/output.pptx" + , pptxTests "used for text and an image on the same slide" + def + "pptx/content-with-caption/text-image/input.native" + "pptx/content-with-caption/text-image/output.pptx" + , pptxTests "not used if the image comes first" + def + "pptx/content-with-caption/image-text/input.native" + "pptx/content-with-caption/image-text/output.pptx" + ] + , testGroup' "The Blank layout is used if a slide contains only..." + [ pptxTests "speaker notes" + def + "pptx/blanks/just-speaker-notes/input.native" + "pptx/blanks/just-speaker-notes/output.pptx" + , pptxTests "an empty heading with a body of only NBSPs" + def + "pptx/blanks/nbsp-in-body/input.native" + "pptx/blanks/nbsp-in-body/output.pptx" + , pptxTests "a heading containing only non-breaking spaces" + def + "pptx/blanks/nbsp-in-heading/input.native" + "pptx/blanks/nbsp-in-heading/output.pptx" + ] + , pptxTests ("Incremental lists are supported") + def { writerIncremental = True } + "pptx/incremental-lists/with-flag/input.native" + "pptx/incremental-lists/with-flag/output.pptx" + , pptxTests ("One-off incremental lists are supported") + def + "pptx/incremental-lists/without-flag/input.native" + "pptx/incremental-lists/without-flag/output.pptx" + , pptxTests "Background images" + def + "pptx/background-image/input.native" + "pptx/background-image/output.pptx" + ] referenceSpecificTests = [ ooxmlTest writePowerpoint -- cgit v1.2.3 From bfb3118ebb1f24d8b12a806ef0ade14d5c4575ce Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 10 Dec 2021 18:28:54 +0100 Subject: Lua tests: remove roundtrip tests Property tests that roundtrip elements through the Lua stack are performed in the test-suite of the pandoc-lua-marshal package. No need to test this here as well. --- test/Tests/Lua.hs | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index 7ef21f933..00193614d 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -14,12 +14,10 @@ Unit and integration tests for pandoc's Lua subsystem. -} module Tests.Lua ( runLuaTest, tests ) where -import Control.Monad (when) import HsLua as Lua hiding (Operation (Div), error) import System.FilePath (()) -import Test.Tasty (TestTree, testGroup, localOption) +import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit ((@=?), Assertion, HasCallStack, assertEqual, testCase) -import Test.Tasty.QuickCheck (QuickCheckTests (..), ioProperty, testProperty) import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder (bulletList, definitionList, displayMath, divWith, doc, doubleQuoted, emph, header, lineBlock, @@ -28,7 +26,7 @@ import Text.Pandoc.Builder (bulletList, definitionList, displayMath, divWith, HasMeta (setMeta)) import Text.Pandoc.Class (runIOorExplode, setUserDataDir) import Text.Pandoc.Definition (Attr, Block (BlockQuote, Div, Para), Pandoc, - Inline (Emph, Str), Meta, pandocTypesVersion) + Inline (Emph, Str), pandocTypesVersion) import Text.Pandoc.Error (PandocError (PandocLuaError)) import Text.Pandoc.Filter (Filter (LuaFilter), applyFilters) import Text.Pandoc.Lua (runLua) @@ -40,20 +38,8 @@ import qualified Data.Text as T import qualified Data.Text.Encoding as TE tests :: [TestTree] -tests = map (localOption (QuickCheckTests 20)) - [ testProperty "inline elements can be round-tripped through the lua stack" $ - ioProperty . roundtripEqual @Inline - - , testProperty "block elements can be round-tripped through the lua stack" $ - ioProperty . roundtripEqual @Block - - , testProperty "meta blocks can be round-tripped through the lua stack" $ - ioProperty . roundtripEqual @Meta - - , testProperty "documents can be round-tripped through the lua stack" $ - ioProperty . roundtripEqual @Pandoc - - , testCase "macro expansion via filter" $ +tests = + [ testCase "macro expansion via filter" $ assertFilterConversion "a '{{helloworld}}' string is expanded" "strmacro.lua" (doc . para $ str "{{helloworld}}") @@ -251,19 +237,6 @@ assertFilterConversion msg filterPath docIn expectedDoc = do applyFilters def [LuaFilter ("lua" filterPath)] ["HTML"] docIn assertEqual msg expectedDoc actualDoc -roundtripEqual :: forall a. (Eq a, Lua.Pushable a, Lua.Peekable a) - => a -> IO Bool -roundtripEqual x = (x ==) <$> roundtripped - where - roundtripped :: IO a - roundtripped = runLuaTest $ do - oldSize <- Lua.gettop - Lua.push x - size <- Lua.gettop - when (size - oldSize /= 1) $ - error ("not exactly one additional element on the stack: " ++ show size) - Lua.peek Lua.top - runLuaTest :: HasCallStack => Lua.LuaE PandocError a -> IO a runLuaTest op = runIOorExplode $ do res <- runLua op -- cgit v1.2.3 From 83b5b79c0e4f073198b5af11b9e8a0a4471fcd41 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 8 Dec 2021 19:06:48 +0100 Subject: Custom reader: pass list of sources instead of concatenated text The first argument passed to Lua `Reader` functions is no longer a plain string but a richer data structure. The structure can easily be converted to a string by applying `tostring`, but is also a list with elements that contain each the *text* and *name* of each input source as a property of the respective name. A small example is added to the custom reader documentation, showcasing its use in a reader that creates a syntax-highlighted code block for each source code file passed as input. Existing readers must be updated. --- data/creole.lua | 2 +- doc/custom-readers.md | 55 +++++++++++++++++++++++++++++----- pandoc.cabal | 1 + src/Text/Pandoc/Lua/Marshal/Sources.hs | 46 ++++++++++++++++++++++++++++ src/Text/Pandoc/Lua/Orphans.hs | 5 ++++ src/Text/Pandoc/Readers/Custom.hs | 10 +++---- 6 files changed, 104 insertions(+), 15 deletions(-) create mode 100644 src/Text/Pandoc/Lua/Marshal/Sources.hs diff --git a/data/creole.lua b/data/creole.lua index 5b7d7f554..590dfc871 100644 --- a/data/creole.lua +++ b/data/creole.lua @@ -186,5 +186,5 @@ G = P{ "Doc", } function Reader(input, reader_options) - return lpeg.match(G, input) + return lpeg.match(G, tostring(input)) end diff --git a/doc/custom-readers.md b/doc/custom-readers.md index afa0caa73..df2de2182 100644 --- a/doc/custom-readers.md +++ b/doc/custom-readers.md @@ -17,7 +17,7 @@ install any additional software to do this. A custom reader is a Lua file that defines a function called `Reader`, which takes two arguments: -- a string, the raw input to be parsed +- the raw input to be parsed, as a list of sources - optionally, a table of reader options, e.g. `{ columns = 62, standalone = true }`. @@ -27,6 +27,16 @@ which is automatically in scope. (Indeed, all of the utility functions that are available for [Lua filters] are available in custom readers, too.) +Each source item corresponds to a file or stream passed to pandoc +containing its text and name. E.g., if a single file `input.txt` +is passed to pandoc, then the list of sources will contain just a +single element `s`, where `s.name == 'input.txt'` and `s.text` +contains the file contents as a string. + +The sources list, as well as each of its elements, can be +converted to a string via the Lua standard library function +`tostring`. + [Lua filters]: https://pandoc.org/lua-filters.html [`pandoc` module]: https://pandoc.org/lua-filters.html#module-pandoc @@ -34,12 +44,20 @@ A minimal example would be ```lua function Reader(input) - return pandoc.Pandoc({ pandoc.CodeBlock(input) }) + return pandoc.Pandoc({ pandoc.CodeBlock(tostring(input)) }) end ``` -This just returns a document containing a big code block with -all of the input. +This just returns a document containing a big code block with all +of the input. Or, to create a separate code block for each input +file, one might write + +``` lua +function Reader(input) + return pandoc.Pandoc(input:map( + function (s) return pandoc.CodeBlock(s.text) end)) +end +``` In a nontrivial reader, you'll want to parse the input. You can do this using standard Lua library functions @@ -84,7 +102,7 @@ G = P{ "Pandoc", } function Reader(input) - return lpeg.match(G, input) + return lpeg.match(G, tostring(input)) end ``` @@ -277,7 +295,7 @@ function Reader(input, reader_options) local refs = {} local thisref = {} local ids = {} - for line in string.gmatch(input, "[^\n]*") do + for line in string.gmatch(tostring(input), "[^\n]*") do key, val = string.match(line, "([A-Z][A-Z0-9]) %- (.*)") if key == "ER" then -- clean up fields @@ -550,7 +568,7 @@ G = P{ "Doc", } function Reader(input, reader_options) - return lpeg.match(G, input) + return lpeg.match(G, tostring(input)) end ``` @@ -614,7 +632,7 @@ end function Reader(input) - local parsed = json.decode(input) + local parsed = json.decode(tostring(input)) local blocks = {} for _,entry in ipairs(parsed.data.children) do @@ -636,3 +654,24 @@ Similar code can be used to consume JSON output from other APIs. Note that the content of the text fields is markdown, so we convert it using `pandoc.read()`. + +# Example: syntax-highlighted code files + +This is a reader that puts the content of each input file into a +code block, sets the file's extension as the block's class to +enable code highlighting, and places the filename as a header +above each code block. + +``` lua +function to_code_block (source) + local _, lang = pandoc.path.split_extension(source.name) + return pandoc.Div{ + pandoc.Header(1, source.name == '' and '' or source.name), + pandoc.CodeBlock(source.text, {class=lang}), + } +end + +function Reader (input, opts) + return pandoc.Pandoc(input:map(to_code_block)) +end +``` diff --git a/pandoc.cabal b/pandoc.cabal index dcf12bf04..92513b911 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -694,6 +694,7 @@ library Text.Pandoc.Lua.Marshal.Context, Text.Pandoc.Lua.Marshal.PandocError, Text.Pandoc.Lua.Marshal.ReaderOptions, + Text.Pandoc.Lua.Marshal.Sources, Text.Pandoc.Lua.Module.MediaBag, Text.Pandoc.Lua.Module.Pandoc, Text.Pandoc.Lua.Module.System, diff --git a/src/Text/Pandoc/Lua/Marshal/Sources.hs b/src/Text/Pandoc/Lua/Marshal/Sources.hs new file mode 100644 index 000000000..7b5262ab5 --- /dev/null +++ b/src/Text/Pandoc/Lua/Marshal/Sources.hs @@ -0,0 +1,46 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +{- | +Module : Text.Pandoc.Lua.Marshaling.Sources +Copyright : © 2021 Albert Krewinkel +License : GNU GPL, version 2 or above +Maintainer : Albert Krewinkel + +Marshal 'Sources'. +-} +module Text.Pandoc.Lua.Marshal.Sources + ( pushSources + ) where + +import Data.Text (Text) +import HsLua as Lua +import Text.Pandoc.Lua.Marshal.List (newListMetatable) +import Text.Pandoc.Sources (Sources (..)) +import Text.Parsec (SourcePos, sourceName) + +-- | Pushes the 'Sources' as a list of lazy Lua objects. +pushSources :: LuaError e => Pusher e Sources +pushSources (Sources srcs) = do + pushList (pushUD typeSource) srcs + newListMetatable "pandoc Sources" $ do + pushName "__tostring" + pushHaskellFunction $ do + sources <- forcePeek $ peekList (peekUD typeSource) (nthBottom 1) + pushText . mconcat $ map snd sources + return 1 + rawset (nth 3) + setmetatable (nth 2) + +-- | Source object type. +typeSource :: LuaError e => DocumentedType e (SourcePos, Text) +typeSource = deftype "pandoc input source" + [ operation Tostring $ lambda + ### liftPure snd + <#> udparam typeSource "srcs" "Source to print in native format" + =#> functionResult pushText "string" "Haskell representation" + ] + [ readonly "name" "source name" + (pushString, sourceName . fst) + , readonly "text" "source text" + (pushText, snd) + ] diff --git a/src/Text/Pandoc/Lua/Orphans.hs b/src/Text/Pandoc/Lua/Orphans.hs index eef05bd27..d5b8f2c5d 100644 --- a/src/Text/Pandoc/Lua/Orphans.hs +++ b/src/Text/Pandoc/Lua/Orphans.hs @@ -22,7 +22,9 @@ import Text.Pandoc.Lua.Marshal.CommonState () import Text.Pandoc.Lua.Marshal.Context () import Text.Pandoc.Lua.Marshal.PandocError() import Text.Pandoc.Lua.Marshal.ReaderOptions () +import Text.Pandoc.Lua.Marshal.Sources (pushSources) import Text.Pandoc.Lua.ErrorConversion () +import Text.Pandoc.Sources (Sources) instance Pushable Pandoc where push = pushPandoc @@ -109,3 +111,6 @@ instance Peekable Version where instance {-# OVERLAPPING #-} Peekable Attr where peek = forcePeek . peekAttr + +instance Pushable Sources where + push = pushSources diff --git a/src/Text/Pandoc/Readers/Custom.hs b/src/Text/Pandoc/Readers/Custom.hs index d7336012b..7b6c99ed8 100644 --- a/src/Text/Pandoc/Readers/Custom.hs +++ b/src/Text/Pandoc/Readers/Custom.hs @@ -17,7 +17,6 @@ Supports custom parsers written in Lua which produce a Pandoc AST. module Text.Pandoc.Readers.Custom ( readCustom ) where import Control.Exception import Control.Monad (when) -import Data.Text (Text) import HsLua as Lua hiding (Operation (Div), render) import HsLua.Class.Peekable (PeekError) import Control.Monad.IO.Class (MonadIO) @@ -26,13 +25,13 @@ import Text.Pandoc.Lua (Global (..), runLua, setGlobals) import Text.Pandoc.Lua.Util (dofileWithTraceback) import Text.Pandoc.Options import Text.Pandoc.Class (PandocMonad) -import Text.Pandoc.Sources (ToSources(..), sourcesToText) +import Text.Pandoc.Sources (Sources, ToSources(..)) -- | Convert custom markup to Pandoc. readCustom :: (PandocMonad m, MonadIO m, ToSources s) => FilePath -> ReaderOptions -> s -> m Pandoc -readCustom luaFile opts sources = do - let input = sourcesToText $ toSources sources +readCustom luaFile opts srcs = do + let input = toSources srcs let globals = [ PANDOC_SCRIPT_FILE luaFile ] res <- runLua $ do setGlobals globals @@ -47,8 +46,7 @@ readCustom luaFile opts sources = do Right doc -> return doc parseCustom :: forall e. PeekError e - => Text + => Sources -> ReaderOptions -> LuaE e Pandoc parseCustom = invoke @e "Reader" - -- cgit v1.2.3 From e88224621de1a8f1be4ea7ad9bf05fe635ddc3cc Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 9 Dec 2021 08:36:17 +0100 Subject: Custom reader: ensure old Readers continue to work Retry conversion by passing a string instead of sources when the `Reader` fails with a message that hints at an outdated function. A deprecation notice is reported in that case. --- doc/custom-readers.md | 7 +++++ src/Text/Pandoc/Lua/Util.hs | 1 + src/Text/Pandoc/Readers/Custom.hs | 63 +++++++++++++++++++++++++++++---------- 3 files changed, 55 insertions(+), 16 deletions(-) diff --git a/doc/custom-readers.md b/doc/custom-readers.md index df2de2182..37b6d6a3e 100644 --- a/doc/custom-readers.md +++ b/doc/custom-readers.md @@ -66,6 +66,13 @@ and fast [lpeg] parsing library, which is automatically in scope. You can also use external Lua libraries (for example, an XML parser). +A previous pandoc version passed a raw string instead of a list +of sources to the Reader function. Reader functions that rely on +this are obsolete, but still supported: Pandoc analyzes any +script error, detecting when code assumed the old behavior. The +code is rerun with raw string input in this case, thereby +ensuring backwards compatibility. + [patterns]: http://lua-users.org/wiki/PatternsTutorial [lpeg]: http://www.inf.puc-rio.br/~roberto/lpeg/ diff --git a/src/Text/Pandoc/Lua/Util.hs b/src/Text/Pandoc/Lua/Util.hs index 6d67d340d..9c6f42b2b 100644 --- a/src/Text/Pandoc/Lua/Util.hs +++ b/src/Text/Pandoc/Lua/Util.hs @@ -13,6 +13,7 @@ Lua utility functions. module Text.Pandoc.Lua.Util ( addField , callWithTraceback + , pcallWithTraceback , dofileWithTraceback ) where diff --git a/src/Text/Pandoc/Readers/Custom.hs b/src/Text/Pandoc/Readers/Custom.hs index 7b6c99ed8..9252a9e45 100644 --- a/src/Text/Pandoc/Readers/Custom.hs +++ b/src/Text/Pandoc/Readers/Custom.hs @@ -1,8 +1,5 @@ -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeApplications #-} {- | Module : Text.Pandoc.Readers.Custom Copyright : Copyright (C) 2021 John MacFarlane @@ -18,20 +15,23 @@ module Text.Pandoc.Readers.Custom ( readCustom ) where import Control.Exception import Control.Monad (when) import HsLua as Lua hiding (Operation (Div), render) -import HsLua.Class.Peekable (PeekError) import Control.Monad.IO.Class (MonadIO) import Text.Pandoc.Definition +import Text.Pandoc.Class (PandocMonad, report) +import Text.Pandoc.Logging import Text.Pandoc.Lua (Global (..), runLua, setGlobals) -import Text.Pandoc.Lua.Util (dofileWithTraceback) +import Text.Pandoc.Lua.PandocLua +import Text.Pandoc.Lua.Marshal.Pandoc (peekPandoc) +import Text.Pandoc.Lua.Util (dofileWithTraceback, callWithTraceback, + pcallWithTraceback) import Text.Pandoc.Options -import Text.Pandoc.Class (PandocMonad) -import Text.Pandoc.Sources (Sources, ToSources(..)) +import Text.Pandoc.Sources (ToSources(..), sourcesToText) +import qualified Data.Text as T -- | Convert custom markup to Pandoc. readCustom :: (PandocMonad m, MonadIO m, ToSources s) => FilePath -> ReaderOptions -> s -> m Pandoc readCustom luaFile opts srcs = do - let input = toSources srcs let globals = [ PANDOC_SCRIPT_FILE luaFile ] res <- runLua $ do setGlobals globals @@ -40,13 +40,44 @@ readCustom luaFile opts srcs = do -- to handle this more gracefully): when (stat /= Lua.OK) Lua.throwErrorAsException - parseCustom input opts + parseCustom case res of Left msg -> throw msg Right doc -> return doc - -parseCustom :: forall e. PeekError e - => Sources - -> ReaderOptions - -> LuaE e Pandoc -parseCustom = invoke @e "Reader" + where + parseCustom = do + let input = toSources srcs + getglobal "Reader" + push input + push opts + pcallWithTraceback 2 1 >>= \case + OK -> forcePeek $ peekPandoc top + ErrRun -> do + -- Caught a runtime error. Check if parsing might work if we + -- pass a string instead of a Sources list, then retry. + runPeek (peekText top) >>= \case + Failure {} -> + -- not a string error object. Bail! + throwErrorAsException + Success errmsg -> do + if "string expected, got pandoc Sources" `T.isInfixOf` errmsg + then do + pop 1 + _ <- unPandocLua $ do + report $ Deprecated "old Reader function signature" $ + T.unlines + [ "Reader functions should accept a sources list; " + , "functions expecting `string` input are deprecated. " + , "Use `tostring` to convert the first argument to a " + , "string." + ] + getglobal "Reader" + push $ sourcesToText input -- push sources as string + push opts + callWithTraceback 2 1 + forcePeek $ peekPandoc top + else + -- nothing we can do here + throwErrorAsException + _ -> -- not a runtime error, we won't be able to recover from that + throwErrorAsException -- cgit v1.2.3 From a9a9a2c62a811d0e64062b0be628f55ba541dad7 Mon Sep 17 00:00:00 2001 From: Kolen Cheung Date: Fri, 10 Dec 2021 16:18:35 -0800 Subject: fix(IpynbOutput)!: rank always favors output format Previously, both `fmt == f` case and Image have a rank of 1. In the end, e.g. from ipynb to html conversion, if both html and image exists, it actually prefers the image. This commit changes this, so that fmt == f is always highest rank, and rank never collides. This is achieved by keeping fmt == f case having rank 1, and every other rank increased by 1. --- pandoc.cabal | 3 +++ src/Text/Pandoc/Shared.hs | 14 +++++------ test/Tests/Old.hs | 2 ++ test/ipynb/rank.ipynb | 60 +++++++++++++++++++++++++++++++++++++++++++++++ test/ipynb/rank.out.html | 10 ++++++++ 5 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 test/ipynb/rank.ipynb create mode 100644 test/ipynb/rank.out.html diff --git a/pandoc.cabal b/pandoc.cabal index 92513b911..69401bc8c 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -383,9 +383,12 @@ extra-source-files: test/pptx/*.pptx test/pptx/**/*.pptx test/pptx/**/*.native + test/ipynb/*.native test/ipynb/*.in.native test/ipynb/*.out.native test/ipynb/*.ipynb + test/ipynb/*.out.ipynb + test/ipynb/*.out.html test/txt2tags.t2t test/twiki-reader.twiki test/tikiwiki-reader.tikiwiki diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 06fd052b9..eb0b4acbf 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -727,17 +727,17 @@ filterIpynbOutput mode = walk go where rank (RawBlock (Format "html") _) | fmt == Format "html" = 1 :: Int - | fmt == Format "markdown" = 2 - | otherwise = 3 + | fmt == Format "markdown" = 3 + | otherwise = 4 rank (RawBlock (Format "latex") _) | fmt == Format "latex" = 1 - | fmt == Format "markdown" = 2 - | otherwise = 3 + | fmt == Format "markdown" = 3 + | otherwise = 4 rank (RawBlock f _) | fmt == f = 1 - | otherwise = 3 - rank (Para [Image{}]) = 1 - rank _ = 2 + | otherwise = 4 + rank (Para [Image{}]) = 2 + rank _ = 3 removeANSI (CodeBlock attr code) = CodeBlock attr (removeANSIEscapes code) removeANSI x = x diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs index 1d5b0b04e..e03d94e85 100644 --- a/test/Tests/Old.hs +++ b/test/Tests/Old.hs @@ -225,6 +225,8 @@ tests pandocPath = , test' "writer" ["-f", "native", "-t", "ipynb", "--wrap=preserve"] "ipynb/mime.native" "ipynb/mime.out.ipynb" + , test' "reader" ["-f", "ipynb", "-t", "html"] + "ipynb/rank.ipynb" "ipynb/rank.out.html" ] ] where diff --git a/test/ipynb/rank.ipynb b/test/ipynb/rank.ipynb new file mode 100644 index 000000000..c03ed7d99 --- /dev/null +++ b/test/ipynb/rank.ipynb @@ -0,0 +1,60 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "5cf8f54d-bf3c-4db2-996d-22662a86ad43", + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "a0228622-9ff8-4392-9ddd-f70a90f0e106", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": "

      you should see this when converting from ipynb to html instead of the image below.

      ", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAACdAAAAnQGPcuduAAAASUlEQVR4nGNkYGBgc1HM+/lfkI/hqQ0XAwsDAwPDzSphBi6h/wwlahsgAiJCHxkkBL4zWLA8YGBkYGBgZGBg4GRgYPjDwMDABADgfgxL+wQIRAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
      " + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fig, ax = plt.subplots(figsize=(1, 1), dpi=4)\n", + "ax.imshow([[0, 1], [2, 3]]);" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.0" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/test/ipynb/rank.out.html b/test/ipynb/rank.out.html new file mode 100644 index 000000000..eb5176509 --- /dev/null +++ b/test/ipynb/rank.out.html @@ -0,0 +1,10 @@ +
      +
      import matplotlib.pyplot as plt
      +
      +
      +
      fig, ax = plt.subplots(figsize=(1, 1), dpi=4)
      +ax.imshow([[0, 1], [2, 3]]);
      +
      +

      you should see this when converting from ipynb to html instead of the image below.

      +
      +
      -- cgit v1.2.3 From 0679620f92ea880702cd46e680e837d6841dc3ec Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 12 Dec 2021 23:42:13 -0800 Subject: Org writer: preliminary support for new org-cite syntax. See #7329. This could use some tests. --- src/Text/Pandoc/Writers/Org.hs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index 24e664ae4..bf7c3f551 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -396,7 +396,27 @@ inlineToOrg (Quoted SingleQuote lst) = do inlineToOrg (Quoted DoubleQuote lst) = do contents <- inlineListToOrg lst return $ "\"" <> contents <> "\"" -inlineToOrg (Cite _ lst) = inlineListToOrg lst +inlineToOrg (Cite cs lst) = do + opts <- gets stOptions + if isEnabled Ext_citations opts + then do + let renderCiteItem c = do + citePref <- inlineListToOrg (citationPrefix c) + citeSuff <- inlineListToOrg (citationSuffix c) + return $ hsep [ citePref + , ("@" <> literal (citationId c)) + , citeSuff ] + citeItems <- mconcat . intersperse "; " <$> mapM renderCiteItem cs + let sty = case cs of + (d:_) + | citationMode d == AuthorInText + -> literal "/t" + [d] + | citationMode d == SuppressAuthor + -> literal "/na" + _ -> mempty + return $ "[cite" <> sty <> ":" <> citeItems <> "]" + else inlineListToOrg lst inlineToOrg (Code _ str) = return $ "=" <> literal str <> "=" inlineToOrg (Str str) = return . literal $ escapeString str inlineToOrg (Math t str) = do -- cgit v1.2.3 From b79bf192ec1dee8311bc146bbd876de02ceaf13a Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 13 Dec 2021 12:21:26 +0100 Subject: Lua: support topdown traversals The traversal order of filters can now be selected by setting the key `traverse` of the filter to either `'topdown'` or `'typewise'`; the default remains `'typewise'`. Topdown traversals can be cut short by returning `false` as a second value from the filter function. No child-element of the returned element is processed in that case. --- cabal.project | 5 +++++ doc/lua-filters.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- pandoc.cabal | 2 +- stack.yaml | 3 ++- 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/cabal.project b/cabal.project index 99c3a7815..606d8bb48 100644 --- a/cabal.project +++ b/cabal.project @@ -3,6 +3,11 @@ tests: True flags: +embed_data_files constraints: aeson >= 2.0.1.0 +source-repository-package + type: git + location: https://github.com/pandoc/pandoc-lua-marshal + tag: 98e3de5087bb533fadbb89720f83f7f7cc3be5bf + -- source-repository-package -- type: git -- location: https://github.com/jgm/texmath.git diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 322833c46..778934e17 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -109,7 +109,8 @@ element filtering function. In other words, filter entries will be called for each corresponding element in the document, getting the respective element as input. -The return of a filter function must be one of the following: +The return value of a filter function must be one of the +following: - nil: this means that the object should remain unchanged. - a pandoc object: this must be of the same type as the input @@ -173,7 +174,26 @@ This functionality has been added in pandoc 2.9.2. [Inlines filter example]: #remove-spaces-before-citations -## Execution Order +## Traversal Order + +The traversal order of filters can be selected by setting the key +`traverse` to either `'topdown'` or `'typewise'`; the default is +`'typewise'`. + +Example: + +``` lua +local filter = { + traverse = 'topdown', + -- ... filter functions ... +} +return {filter} +``` + +Support for this was added in pandoc 2.16.3; previous versions +ignore the `traverse` setting. + +### Typewise traversal Element filter functions within a filter set are called in a fixed order, skipping any which are not present: @@ -203,6 +223,31 @@ All functions in set (1) are thus run before those in (2), causing the filter function for *Meta* to be run before the filtering of *Str* elements is started. +### Topdown traversal + +It is sometimes more natural to traverse the document tree +depth-first from the root towards the leaves, and all in a single +run. + +For example, a block list `[Plain [Str "a"], Para [Str +"b"]]`{.haskell} will be try the following filter functions, in +order: `Blocks`, `Plain`, `Inlines`, `Str`, `Para`, `Inlines`, +`Str`. + +Topdown traversals can be cut short by returning `false` as a +second value from the filter function. No child-element of +the returned element is processed in that case. + +For example, to exclude the contents of a footnote from being +processed, one might write + +``` lua +traverse = 'topdown' +function Note (n) + return n, false +end +``` + ## Global variables Pandoc passes additional data to Lua filters by setting global diff --git a/pandoc.cabal b/pandoc.cabal index 69401bc8c..13db955b9 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -484,7 +484,7 @@ library mtl >= 2.2 && < 2.3, network >= 2.6, network-uri >= 2.6 && < 2.8, - pandoc-lua-marshal >= 0.1.2 && < 0.2, + pandoc-lua-marshal >= 0.1.3 && < 0.2, pandoc-types >= 1.22.1 && < 1.23, parsec >= 3.1 && < 3.2, pretty >= 1.1 && < 1.2, diff --git a/stack.yaml b/stack.yaml index 548931120..30845ad6b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -26,7 +26,6 @@ extra-deps: - lua-2.0.2 - tasty-hslua-1.0.0 - tasty-lua-1.0.0 -- pandoc-lua-marshal-0.1.2 - pandoc-types-1.22.1 - commonmark-0.2.1.1 - commonmark-extensions-0.2.2 @@ -37,6 +36,8 @@ extra-deps: - unicode-data-0.2.0 - git: https://github.com/jgm/ipynb.git commit: 00246af10885c2ad4413ace4f69a7e6c88297a08 +- git: https://github.com/pandoc/pandoc-lua-marshal + commit: 98e3de5087bb533fadbb89720f83f7f7cc3be5bf ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From b8ada284b1f6a4b37cd72f4f2f0e6707a1a7160b Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 13 Dec 2021 21:02:19 +0100 Subject: doc/lua-filters.md: update description of walk methods, fix typos --- doc/lua-filters.md | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 778934e17..b0ae3f7a7 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -174,7 +174,7 @@ This functionality has been added in pandoc 2.9.2. [Inlines filter example]: #remove-spaces-before-citations -## Traversal Order +## Traversal order The traversal order of filters can be selected by setting the key `traverse` to either `'topdown'` or `'typewise'`; the default is @@ -230,7 +230,7 @@ depth-first from the root towards the leaves, and all in a single run. For example, a block list `[Plain [Str "a"], Para [Str -"b"]]`{.haskell} will be try the following filter functions, in +"b"]]`{.haskell} will try the following filter functions, in order: `Blocks`, `Plain`, `Inlines`, `Str`, `Para`, `Inlines`, `Str`. @@ -846,8 +846,9 @@ determined via [`pandoc.utils.equals`]. `walk(self, lua_filter)` Applies a Lua filter to the Pandoc element. Just as for -full-document filters, the order in which elements are handled -are Inline → Inlines → Block → Blocks → Meta → Pandoc. +full-document filters, the order in which elements are traversed +can be controlled by setting the `traverse` field of the filter; +see the section on [traversal order][Traversal order]. Parameters: @@ -910,19 +911,21 @@ or `pandoc.Blocks`. Object equality is determined via [`pandoc.utils.equals`]. -### Common Methods +### Common methods #### walk {#type-block:walk} `walk(self, lua_filter)` Applies a Lua filter to the block element. Just as for -full-document filters, the order in which elements are handled -are Inline → Inlines → Block → Blocks. +full-document filters, the order in which elements are traversed +can be controlled by setting the `traverse` field of the filter; +see the section on [traversal order][Traversal order]. Note that the filter is applied to the subtree, but not to the -element itself. The rationale is that the element might be -deleted by the filter, leading to possibly unexpected results. +`self` block element. The rationale is that otherwise the element +could be deleted by the filter, or replaced with multiple block +elements, which might lead to possibly unexpected results. Parameters: @@ -1264,9 +1267,9 @@ values: `walk(self, lua_filter)` Applies a Lua filter to the Blocks list. Just as for -full-document filters, the order in which elements are handled -are are Inline → Inlines → Block → Blocks. The filter is applied -to all list items *and* to the list itself. +full-document filters, the order in which elements are traversed +can be controlled by setting the `traverse` field of the filter; +see the section on [traversal order][Traversal order]. Parameters: @@ -1292,19 +1295,21 @@ Usage: Object equality is determined by checking the Haskell representation for equality. -### Common Methods +### Common methods #### walk {#type-inline:walk} `walk(self, lua_filter)` Applies a Lua filter to the Inline element. Just as for -full-document filters, the order in which elements are handled -are are Inline → Inlines → Block → Blocks. +full-document filters, the order in which elements are traversed +can be controlled by setting the `traverse` field of the filter; +see the section on [traversal order][Traversal order]. -Note that the filter is applied to the subtree, but *not* to the -element itself. The rationale is that the element might be -deleted by the filter, leading to possibly unexpected results. +Note that the filter is applied to the subtree, but not to the +`self` inline element. The rationale is that otherwise the +element could be deleted by the filter, or replaced with multiple +inline elements, which might lead to possibly unexpected results. Parameters: -- cgit v1.2.3 From ea77f2e6f653d5b570109fa208dc427d99f95b51 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 13 Dec 2021 12:07:24 -0800 Subject: Citeproc changes: T.P.Citeproc exports `getCiteprocLang` and `getStyle` [API change]. T.P.Citeproc.Locator now exports `toLocatorMap`, `LocatorInfo`, and `LocatorMap`. The type of `parseLocator` has changed, so it now takes a `LocatorMap` rather than a `Locale` as parameter, and returns a `LocatorInfo` instead of a tuple. --- src/Text/Pandoc/Citeproc.hs | 29 ++++++++--------- src/Text/Pandoc/Citeproc/Locator.hs | 65 +++++++++++++++++++++++-------------- 2 files changed, 53 insertions(+), 41 deletions(-) diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 223925522..d769a91c8 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -7,13 +7,15 @@ module Text.Pandoc.Citeproc ( processCitations, getReferences, - getStyle + getStyle, + getCiteprocLang ) where import Citeproc import Citeproc.Pandoc () -import Text.Pandoc.Citeproc.Locator (parseLocator) +import Text.Pandoc.Citeproc.Locator (parseLocator, toLocatorMap, + LocatorInfo(..)) import Text.Pandoc.Citeproc.CslJson (cslJsonToReferences) import Text.Pandoc.Citeproc.BibTeX (readBibtexString, Variant(..)) import Text.Pandoc.Citeproc.MetaValue (metaValueToReference, metaValueToText) @@ -49,12 +51,10 @@ import qualified Data.Text as T import System.FilePath (takeExtension) import Safe (lastMay, initSafe) - processCitations :: PandocMonad m => Pandoc -> m Pandoc processCitations (Pandoc meta bs) = do style <- getStyle (Pandoc meta bs) - - mblang <- getLang meta + mblang <- getCiteprocLang meta let locale = Citeproc.mergeLocales mblang style refs <- getReferences (Just locale) (Pandoc meta bs) @@ -166,10 +166,9 @@ getStyle (Pandoc meta _) = do -- Retrieve citeproc lang based on metadata. -getLang :: PandocMonad m => Meta -> m (Maybe Lang) -getLang meta = maybe (return Nothing) bcp47LangToIETF - ((lookupMeta "lang" meta <|> lookupMeta "locale" meta) >>= - metaValueToText) +getCiteprocLang :: PandocMonad m => Meta -> m (Maybe Lang) +getCiteprocLang meta = maybe (return Nothing) bcp47LangToIETF + ((lookupMeta "lang" meta <|> lookupMeta "locale" meta) >>= metaValueToText) -- | Get references defined inline in the metadata and via an external -- bibliography. Only references that are actually cited in the document @@ -181,7 +180,7 @@ getReferences mblocale (Pandoc meta bs) = do locale <- case mblocale of Just l -> return l Nothing -> do - mblang <- getLang meta + mblang <- getCiteprocLang meta case mblang of Just lang -> return $ either mempty id $ getLocale lang Nothing -> return mempty @@ -307,17 +306,15 @@ fromPandocCitations :: Locale -> [CitationItem Inlines] fromPandocCitations locale otherIdsMap = concatMap go where + locmap = toLocatorMap locale go c = - let (loclab, suffix) = parseLocator locale (citationSuffix c) - (mblab, mbloc) = case loclab of - Just (loc, lab) -> (Just loc, Just lab) - Nothing -> (Nothing, Nothing) + let (mblocinfo, suffix) = parseLocator locmap (citationSuffix c) cit = CitationItem { citationItemId = fromMaybe (ItemId $ Pandoc.citationId c) (M.lookup (Pandoc.citationId c) otherIdsMap) - , citationItemLabel = mblab - , citationItemLocator = mbloc + , citationItemLabel = locatorLabel <$> mblocinfo + , citationItemLocator = locatorLoc <$> mblocinfo , citationItemType = NormalCite , citationItemPrefix = case citationPrefix c of [] -> Nothing diff --git a/src/Text/Pandoc/Citeproc/Locator.hs b/src/Text/Pandoc/Citeproc/Locator.hs index ce606197b..0b8f79922 100644 --- a/src/Text/Pandoc/Citeproc/Locator.hs +++ b/src/Text/Pandoc/Citeproc/Locator.hs @@ -2,7 +2,10 @@ {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE OverloadedStrings #-} module Text.Pandoc.Citeproc.Locator - ( parseLocator ) + ( parseLocator + , toLocatorMap + , LocatorInfo(..) + , LocatorMap(..) ) where import Citeproc.Types import Text.Pandoc.Citeproc.Util (splitStrWhen) @@ -17,9 +20,17 @@ import Control.Monad (mzero) import qualified Data.Map as M import Data.Char (isSpace, isPunctuation, isDigit) -parseLocator :: Locale -> [Inline] -> (Maybe (Text, Text), [Inline]) -parseLocator locale inp = - case parse (pLocatorWords (toLocatorMap locale)) "suffix" $ splitInp inp of + +data LocatorInfo = + LocatorInfo{ locatorRaw :: Text + , locatorLabel :: Text + , locatorLoc :: Text + } + deriving (Show) + +parseLocator :: LocatorMap -> [Inline] -> (Maybe LocatorInfo, [Inline]) +parseLocator locmap inp = + case parse (pLocatorWords locmap) "suffix" $ splitInp inp of Right r -> r Left _ -> (Nothing, maybeAddComma inp) @@ -33,18 +44,16 @@ splitInp = splitStrWhen (\c -> isSpace c || (isPunctuation c && c /= ':')) type LocatorParser = Parsec [Inline] () pLocatorWords :: LocatorMap - -> LocatorParser (Maybe (Text, Text), [Inline]) + -> LocatorParser (Maybe LocatorInfo, [Inline]) pLocatorWords locMap = do optional $ pMatchChar "," (== ',') optional pSpace - (la, lo) <- pLocatorDelimited locMap <|> pLocatorIntegrated locMap + info <- pLocatorDelimited locMap <|> pLocatorIntegrated locMap s <- getInput -- rest is suffix - -- need to trim, otherwise "p. 9" and "9" will have 'different' locators later on - -- i.e. the first one will be " 9" return $ - if T.null la && T.null lo + if T.null (locatorLabel info) && T.null (locatorLoc info) then (Nothing, maybeAddComma s) - else (Just (la, T.strip lo), s) + else (Just info, s) maybeAddComma :: [Inline] -> [Inline] maybeAddComma [] = [] @@ -54,28 +63,30 @@ maybeAddComma ils@(Str t : _) , isPunctuation c = ils maybeAddComma ils = Str "," : Space : ils -pLocatorDelimited :: LocatorMap -> LocatorParser (Text, Text) +pLocatorDelimited :: LocatorMap -> LocatorParser LocatorInfo pLocatorDelimited locMap = try $ do _ <- pMatchChar "{" (== '{') skipMany pSpace -- gobble pre-spaces so label doesn't try to include them - (la, _) <- pLocatorLabelDelimited locMap + (rawlab, la, _) <- pLocatorLabelDelimited locMap -- we only care about balancing {} and [] (because of the outer [] scope); -- the rest can be anything let inner = do { t <- anyToken; return (True, stringify t) } gs <- many (pBalancedBraces [('{','}'), ('[',']')] inner) _ <- pMatchChar "}" (== '}') let lo = T.concat $ map snd gs - return (la, lo) + return $ LocatorInfo{ locatorLoc = lo, + locatorLabel = la, + locatorRaw = rawlab <> "{" <> lo <> "}" } -pLocatorLabelDelimited :: LocatorMap -> LocatorParser (Text, Bool) +pLocatorLabelDelimited :: LocatorMap -> LocatorParser (Text, Text, Bool) pLocatorLabelDelimited locMap - = pLocatorLabel' locMap lim <|> return ("page", True) + = pLocatorLabel' locMap lim <|> return ("", "page", True) where lim = stringify <$> anyToken -pLocatorIntegrated :: LocatorMap -> LocatorParser (Text, Text) +pLocatorIntegrated :: LocatorMap -> LocatorParser LocatorInfo pLocatorIntegrated locMap = try $ do - (la, wasImplicit) <- pLocatorLabelIntegrated locMap + (rawlab, la, wasImplicit) <- pLocatorLabelIntegrated locMap -- if we got the label implicitly, we have presupposed the first one is -- going to have a digit, so guarantee that. You _can_ have p. (a) -- because you specified it. @@ -85,17 +96,20 @@ pLocatorIntegrated locMap = try $ do g <- try $ pLocatorWordIntegrated (not wasImplicit) >>= modifier gs <- many (try $ pLocatorWordIntegrated False >>= modifier) let lo = T.concat (g:gs) - return (la, lo) + return $ LocatorInfo{ locatorLabel = la, + locatorLoc = lo, + locatorRaw = rawlab <> lo } -pLocatorLabelIntegrated :: LocatorMap -> LocatorParser (Text, Bool) +pLocatorLabelIntegrated :: LocatorMap -> LocatorParser (Text, Text, Bool) pLocatorLabelIntegrated locMap - = pLocatorLabel' locMap lim <|> (lookAhead digital >> return ("page", True)) + = pLocatorLabel' locMap lim <|> + (lookAhead digital >> return ("", "page", True)) where lim = try $ pLocatorWordIntegrated True >>= requireRomansOrDigits digital = try $ pLocatorWordIntegrated True >>= requireDigits pLocatorLabel' :: LocatorMap -> LocatorParser Text - -> LocatorParser (Text, Bool) + -> LocatorParser (Text, Text, Bool) pLocatorLabel' locMap lim = go "" where -- grow the match string until we hit the end @@ -106,9 +120,9 @@ pLocatorLabel' locMap lim = go "" t <- anyToken ts <- manyTill anyToken (try $ lookAhead lim) let s = acc <> stringify (t:ts) - case M.lookup (T.toCaseFold $ T.strip s) locMap of + case M.lookup (T.toCaseFold $ T.strip s) (unLocatorMap locMap) of -- try to find a longer one, or return this one - Just l -> go s <|> return (l, False) + Just l -> go s <|> return (s, l, False) Nothing -> go s -- hard requirement for a locator to have some real digits in it @@ -252,11 +266,12 @@ isLocatorSep _ = False -- Locator Map -- -type LocatorMap = M.Map Text Text +newtype LocatorMap = LocatorMap { unLocatorMap :: M.Map Text Text } + deriving (Show) toLocatorMap :: Locale -> LocatorMap toLocatorMap locale = - foldr go mempty locatorTerms + LocatorMap $ foldr go mempty locatorTerms where go tname locmap = case M.lookup tname (localeTerms locale) of -- cgit v1.2.3 From 2015c9070d1389b407711cfd699e529fe14bffcd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 13 Dec 2021 12:08:58 -0800 Subject: Markdown reader: fix parsing of "bare locators"... ...after author-in-text citations. Previously `@item [p. 12; @item2]` was incorrectly parsed as three citations rather than two. This is now fixed by ensuring that `prefix` doesn't gobble any semicolons. --- src/Text/Pandoc/Readers/Markdown.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index d5a4c322f..b5017a433 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -2216,7 +2216,7 @@ suffix = try $ do prefix :: PandocMonad m => MarkdownParser m (F Inlines) prefix = trimInlinesF . mconcat <$> - manyTill inline (char ']' + manyTill (notFollowedBy (char ';') >> inline) (char ']' <|> lookAhead (try $ do optional (try (char ';' >> spnl)) citeKey True -- cgit v1.2.3 From 9f089aa2863afdbfacd8a43dc85f0b8c53463bb8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 13 Dec 2021 12:10:13 -0800 Subject: Org writer: add tests for org-cite citations, and improve support. --- src/Text/Pandoc/Writers/Org.hs | 32 ++++++++++++++++++++++++++---- test/command/7329.md | 44 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 test/command/7329.md diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index bf7c3f551..ce406567b 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -29,22 +29,32 @@ import Text.Pandoc.Options import Text.DocLayout import Text.Pandoc.Shared import Text.Pandoc.Templates (renderTemplate) +import Text.Pandoc.Citeproc.Locator (parseLocator, toLocatorMap, LocatorMap, + LocatorInfo(..)) +import Text.Pandoc.Citeproc (getCiteprocLang, getStyle) +import qualified Citeproc as Citeproc import Text.Pandoc.Writers.Shared data WriterState = WriterState { stNotes :: [[Block]] , stHasMath :: Bool , stOptions :: WriterOptions + , stLocatorMap :: LocatorMap } type Org = StateT WriterState -- | Convert Pandoc to Org. writeOrg :: PandocMonad m => WriterOptions -> Pandoc -> m Text -writeOrg opts document = do +writeOrg opts document@(Pandoc meta _) = do + style <- getStyle document + mblang <- getCiteprocLang meta + let locmap = toLocatorMap $ Citeproc.mergeLocales mblang style + let st = WriterState { stNotes = [], stHasMath = False, - stOptions = opts } + stOptions = opts, + stLocatorMap = locmap } evalStateT (pandocToOrg document) st -- | Return Org representation of document. @@ -103,7 +113,12 @@ blockToOrg :: PandocMonad m => Block -- ^ Block element -> Org m (Doc Text) blockToOrg Null = return empty -blockToOrg (Div attr bs) = divToOrg attr bs +blockToOrg (Div attr@(ident,_,_) bs) = do + opts <- gets stOptions + -- Strip off bibliography if citations enabled + if ident == "refs" && isEnabled Ext_citations opts + then return mempty + else divToOrg attr bs blockToOrg (Plain inlines) = inlineListToOrg inlines blockToOrg (SimpleFigure attr txt (src, tit)) = do capt <- if null txt @@ -402,9 +417,18 @@ inlineToOrg (Cite cs lst) = do then do let renderCiteItem c = do citePref <- inlineListToOrg (citationPrefix c) - citeSuff <- inlineListToOrg (citationSuffix c) + locmap <- gets stLocatorMap + let (locinfo, suffix) = parseLocator locmap (citationSuffix c) + citeSuff <- inlineListToOrg suffix + let locator = case locinfo of + Just info -> literal $ + T.replace "\160" " " $ + T.replace "{" "" $ + T.replace "}" "" $ locatorRaw info + Nothing -> mempty return $ hsep [ citePref , ("@" <> literal (citationId c)) + , locator , citeSuff ] citeItems <- mconcat . intersperse "; " <$> mapM renderCiteItem cs let sty = case cs of diff --git a/test/command/7329.md b/test/command/7329.md new file mode 100644 index 000000000..565241db8 --- /dev/null +++ b/test/command/7329.md @@ -0,0 +1,44 @@ +``` +% pandoc -f markdown -t org +- @item1 +- @item1 [p. 12] +- @item1 [p.12; see also @item2] +- [@item1] +- [-@item1] +- [see @item1 p. 12] +- [see @item1, p. 12] +- [see @item1, p. 12 and *passim*] +- [@item1;@item2] +- [see @item1; @item2] +^D +- [cite/t:@item1] +- [cite/t:@item1 p. 12] +- [cite/t:@item1 p.12; see also @item2] +- [cite:@item1] +- [cite/na:@item1] +- [cite:see @item1 p. 12] +- [cite:see @item1 p. 12] +- [cite:see @item1 p. 12 and /passim/] +- [cite:@item1; @item2] +- [cite:see @item1; @item2] +``` + +``` +% pandoc -f markdown -t org -C --bibliography command/biblio.bib +- [@item1] +^D +- [cite:@item1] +``` + + +``` +% pandoc -f markdown -t org-citations -C --bibliography command/biblio.bib +[@item1] +^D +(Doe 2005) + +<> + +<> +Doe, John. 2005. /First Book/. Cambridge: Cambridge University Press. +``` -- cgit v1.2.3 From ce44cf688a0e37f001dccfdb014f4ecd6e55d6ab Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 14 Dec 2021 09:13:38 +0100 Subject: doc/lua-filters.md: add docs for `Cell` constructor --- doc/lua-filters.md | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index b0ae3f7a7..7b73dd9c5 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -1812,12 +1812,12 @@ Fields: : cell contents (list of [Blocks]). `col_span` -: number of columns occupied by the cell; the height of the cell - (integer). +: number of columns spanned by the cell; the width of the cell + in columns (integer). `row_span` -: number of rows occupied by the cell; the height of the cell - (integer). +: number of rows spanned by the cell; the height of the cell in + rows (integer). `identifier` : alias for `attr.identifier` (string) @@ -2831,6 +2831,33 @@ format, and functions to filter and modify a subtree. Returns: [Attr](#type-attr) object +[`Cell (blocks[, align[, rowspan[, colspan[, attr]]]])`]{#pandoc.attr} + +: Create a new table cell. + + Parameters: + + `blocks`: + : cell contents (list of [Blocks]) + + `align`: + : text alignment; defaults to `AlignDefault` (Alignment) + + `rowspan`: + : number of rows occupied by the cell; defaults to `1` + (integer) + + `colspan`: + : number of columns spanned by the cell; defaults to `1` + (integer) + + `attr`: + : cell attributes ([Attr](#type-attr)) + + Returns: + + - [Cell](#type-cell) object + [`Citation (id, mode[, prefix[, suffix[, note_num[, hash]]]])`]{#pandoc.citation} : Creates a single citation. -- cgit v1.2.3 From 5817e864918e5d03b6402afac0ff8c748a2ac2f6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 14 Dec 2021 09:20:09 -0800 Subject: Org reader: remove support for "Berkeley style" citations. See #7329. --- src/Text/Pandoc/Readers/Org/Inlines.hs | 187 +++++++----------------------- test/Tests/Readers/Org/Inline/Citation.hs | 47 -------- 2 files changed, 42 insertions(+), 192 deletions(-) diff --git a/src/Text/Pandoc/Readers/Org/Inlines.hs b/src/Text/Pandoc/Readers/Org/Inlines.hs index 6862dd71e..2366aa290 100644 --- a/src/Text/Pandoc/Readers/Org/Inlines.hs +++ b/src/Text/Pandoc/Readers/Org/Inlines.hs @@ -32,10 +32,9 @@ import Text.TeXMath (DisplayType (..), readTeX, writePandoc) import Text.Pandoc.Sources (ToSources(..)) import qualified Text.TeXMath.Readers.MathML.EntityMap as MathMLEntityMap -import Control.Monad (guard, mplus, mzero, unless, void, when) +import Control.Monad (guard, mplus, mzero, unless, when) import Control.Monad.Trans (lift) import Data.Char (isAlphaNum, isSpace) -import Data.List (intersperse) import qualified Data.Map as M import Data.Text (Text) import qualified Data.Text as T @@ -148,32 +147,57 @@ endline = try $ do -- Citations -- --- The state of citations is a bit confusing due to the lack of an official --- syntax and multiple syntaxes coexisting. The pandocOrgCite syntax was the --- first to be implemented here and is almost identical to Markdown's citation --- syntax. The org-ref package is in wide use to handle citations, but the --- syntax is a bit limiting and not quite as simple to write. The --- semi-official Org-mode citation syntax is based on John MacFarlane's Pandoc --- sytax and Org-oriented enhancements contributed by Richard Lawrence and --- others. It's dubbed Berkeley syntax due the place of activity of its main --- contributors. All this should be consolidated once an official Org-mode --- citation syntax has emerged. +-- We first try to parse official org-cite citations, then fall +-- back to org-ref citations (which are still in wide use). cite :: PandocMonad m => OrgParser m (F Inlines) -cite = try $ berkeleyCite <|> do +cite = try $ do guardEnabled Ext_citations (cs, raw) <- withRaw $ choice - [ pandocOrgCite + [ orgCite , orgRefCite - , berkeleyTextualCite ] return $ flip B.cite (B.text raw) <$> cs --- | A citation in Pandoc Org-mode style (@[prefix \@citekey suffix]@). -pandocOrgCite :: PandocMonad m => OrgParser m (F [Citation]) -pandocOrgCite = try $ +-- | A citation in org-cite style +orgCite :: PandocMonad m => OrgParser m (F [Citation]) +orgCite = try $ char '[' *> skipSpaces *> citeList <* skipSpaces <* char ']' +citeList :: PandocMonad m => OrgParser m (F [Citation]) +citeList = sequence <$> sepEndBy1 citation (try $ char ';' *> skipSpaces) + +citation :: PandocMonad m => OrgParser m (F Citation) +citation = try $ do + pref <- prefix + (suppress_author, key) <- citeKey False + suff <- suffix + return $ do + x <- pref + y <- suff + return Citation + { citationId = key + , citationPrefix = B.toList x + , citationSuffix = B.toList y + , citationMode = if suppress_author + then SuppressAuthor + else NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + where + prefix = trimInlinesF . mconcat <$> + manyTill inline (char ']' <|> (']' <$ lookAhead (citeKey False))) + suffix = try $ do + hasSpace <- option False (notFollowedBy nonspaceChar >> return True) + skipSpaces + rest <- trimInlinesF . mconcat <$> + many (notFollowedBy (oneOf ";]") *> inline) + return $ if hasSpace + then (B.space <>) <$> rest + else rest + + orgRefCite :: PandocMonad m => OrgParser m (F [Citation]) orgRefCite = try $ choice [ normalOrgRefCite @@ -201,100 +225,6 @@ normalOrgRefCite = try $ do , citationHash = 0 } --- | Read an Berkeley-style Org-mode citation. Berkeley citation style was --- develop and adjusted to Org-mode style by John MacFarlane and Richard --- Lawrence, respectively, both philosophers at UC Berkeley. -berkeleyCite :: PandocMonad m => OrgParser m (F Inlines) -berkeleyCite = try $ do - bcl <- berkeleyCitationList - return $ do - parens <- berkeleyCiteParens <$> bcl - prefix <- berkeleyCiteCommonPrefix <$> bcl - suffix <- berkeleyCiteCommonSuffix <$> bcl - citationList <- berkeleyCiteCitations <$> bcl - return $ - if parens - then toCite - . maybe id (alterFirst . prependPrefix) prefix - . maybe id (alterLast . appendSuffix) suffix - $ citationList - else maybe mempty (<> " ") prefix - <> toListOfCites (map toInTextMode citationList) - <> maybe mempty (", " <>) suffix - where - toCite :: [Citation] -> Inlines - toCite cs = B.cite cs mempty - - toListOfCites :: [Citation] -> Inlines - toListOfCites = mconcat . intersperse ", " . map (\c -> B.cite [c] mempty) - - toInTextMode :: Citation -> Citation - toInTextMode c = c { citationMode = AuthorInText } - - alterFirst, alterLast :: (a -> a) -> [a] -> [a] - alterFirst _ [] = [] - alterFirst f (c:cs) = f c : cs - alterLast f = reverse . alterFirst f . reverse - - prependPrefix, appendSuffix :: Inlines -> Citation -> Citation - prependPrefix pre c = c { citationPrefix = B.toList pre <> citationPrefix c } - appendSuffix suf c = c { citationSuffix = citationSuffix c <> B.toList suf } - -data BerkeleyCitationList = BerkeleyCitationList - { berkeleyCiteParens :: Bool - , berkeleyCiteCommonPrefix :: Maybe Inlines - , berkeleyCiteCommonSuffix :: Maybe Inlines - , berkeleyCiteCitations :: [Citation] - } -berkeleyCitationList :: PandocMonad m => OrgParser m (F BerkeleyCitationList) -berkeleyCitationList = try $ do - char '[' - parens <- choice [ False <$ berkeleyBareTag, True <$ berkeleyParensTag ] - char ':' - skipSpaces - commonPrefix <- optionMaybe (try $ citationListPart <* char ';') - citations <- citeList - commonSuffix <- optionMaybe (try citationListPart) - char ']' - return (BerkeleyCitationList parens - <$> sequence commonPrefix - <*> sequence commonSuffix - <*> citations) - where - citationListPart :: PandocMonad m => OrgParser m (F Inlines) - citationListPart = fmap (trimInlinesF . mconcat) . try . many1 $ do - notFollowedBy' $ citeKey False - notFollowedBy (oneOf ";]") - inline - -berkeleyBareTag :: PandocMonad m => OrgParser m () -berkeleyBareTag = try $ void berkeleyBareTag' - -berkeleyParensTag :: PandocMonad m => OrgParser m () -berkeleyParensTag = try . void $ enclosedByPair1 '(' ')' berkeleyBareTag' - -berkeleyBareTag' :: PandocMonad m => OrgParser m () -berkeleyBareTag' = try $ void (string "cite") - -berkeleyTextualCite :: PandocMonad m => OrgParser m (F [Citation]) -berkeleyTextualCite = try $ do - (suppressAuthor, key) <- citeKey False - returnF . return $ Citation - { citationId = key - , citationPrefix = mempty - , citationSuffix = mempty - , citationMode = if suppressAuthor then SuppressAuthor else AuthorInText - , citationNoteNum = 0 - , citationHash = 0 - } - --- The following is what a Berkeley-style bracketed textual citation parser --- would look like. However, as these citations are a subset of Pandoc's Org --- citation style, this isn't used. --- berkeleyBracketedTextualCite :: PandocMonad m => OrgParser m (F [Citation]) --- berkeleyBracketedTextualCite = try . (fmap head) $ --- enclosedByPair1 '[' ']' berkeleyTextualCite - -- | Read a link-like org-ref style citation. The citation includes pre and -- post text. However, multiple citations are not possible due to limitations -- in the syntax. @@ -345,39 +275,6 @@ orgRefCiteMode = , ("citeyear", SuppressAuthor) ] -citeList :: PandocMonad m => OrgParser m (F [Citation]) -citeList = sequence <$> sepEndBy1 citation (try $ char ';' *> skipSpaces) - -citation :: PandocMonad m => OrgParser m (F Citation) -citation = try $ do - pref <- prefix - (suppress_author, key) <- citeKey False - suff <- suffix - return $ do - x <- pref - y <- suff - return Citation - { citationId = key - , citationPrefix = B.toList x - , citationSuffix = B.toList y - , citationMode = if suppress_author - then SuppressAuthor - else NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - where - prefix = trimInlinesF . mconcat <$> - manyTill inline (char ']' <|> (']' <$ lookAhead (citeKey False))) - suffix = try $ do - hasSpace <- option False (notFollowedBy nonspaceChar >> return True) - skipSpaces - rest <- trimInlinesF . mconcat <$> - many (notFollowedBy (oneOf ";]") *> inline) - return $ if hasSpace - then (B.space <>) <$> rest - else rest - footnote :: PandocMonad m => OrgParser m (F Inlines) footnote = try $ do note <- inlineNote <|> referencedNote diff --git a/test/Tests/Readers/Org/Inline/Citation.hs b/test/Tests/Readers/Org/Inline/Citation.hs index a11804983..7eabd9aae 100644 --- a/test/Tests/Readers/Org/Inline/Citation.hs +++ b/test/Tests/Readers/Org/Inline/Citation.hs @@ -169,53 +169,6 @@ tests = in (para $ cite [citation] "[[citep:Dominik201408][See page 20::, for example]]") ] - , testGroup "Berkeley-style citations" $ - let pandocCite = Citation - { citationId = "Pandoc" - , citationPrefix = mempty - , citationSuffix = mempty - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - pandocInText = pandocCite { citationMode = AuthorInText } - dominikCite = Citation - { citationId = "Dominik201408" - , citationPrefix = mempty - , citationSuffix = mempty - , citationMode = NormalCitation - , citationNoteNum = 0 - , citationHash = 0 - } - dominikInText = dominikCite { citationMode = AuthorInText } - in - [ "Berkeley-style in-text citation" =: - "See @Dominik201408." =?> - para ("See " - <> cite [dominikInText] "@Dominik201408" - <> ".") - - , "Berkeley-style parenthetical citation list" =: - "[(cite): see; @Dominik201408;also @Pandoc; and others]" =?> - let pandocCite' = pandocCite { - citationPrefix = toList "also" - , citationSuffix = toList "and others" - } - dominikCite' = dominikCite { - citationPrefix = toList "see" - } - in (para $ cite [dominikCite', pandocCite'] "") - - , "Berkeley-style plain citation list" =: - "[cite: See; @Dominik201408; and @Pandoc; and others]" =?> - let pandocCite' = pandocInText { citationPrefix = toList "and" } - in (para $ "See " - <> cite [dominikInText] "" - <> "," <> space - <> cite [pandocCite'] "" - <> "," <> space <> "and others") - ] - , "LaTeX citation" =: "\\cite{Coffee}" =?> let citation = Citation -- cgit v1.2.3 From d393f2f15816ed9030e6bf73a836f26d8148166e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 14 Dec 2021 11:20:59 -0800 Subject: Markdown writer: ensure semicolon btw locator and next citation... when an author-in-text citation has a locator and following citations. --- src/Text/Pandoc/Writers/Markdown/Inline.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs index e774b5cc4..0d8463cdf 100644 --- a/src/Text/Pandoc/Writers/Markdown/Inline.hs +++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs @@ -505,7 +505,11 @@ inlineToMarkdown opts (Cite (c:cs) lst) then do suffs <- inlineListToMarkdown opts $ citationSuffix c rest <- mapM convertOne cs - let inbr = suffs <+> joincits rest + let inbr = suffs <> + (if not (null (citationSuffix c)) && not (null rest) + then text ";" + else mempty) + <+> joincits rest br = if isEmpty inbr then empty else char '[' <> inbr <> char ']' return $ literal ("@" <> maybeInBraces (citationId c)) <+> br else do -- cgit v1.2.3 From be0e3f979441176b6d838ff722ae7990940564be Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 14 Dec 2021 11:26:28 -0800 Subject: Markdown writer: avoid extra space before citation suffix... if it already starts with a space. --- src/Text/Pandoc/Writers/Markdown/Inline.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs index 0d8463cdf..d299d31b2 100644 --- a/src/Text/Pandoc/Writers/Markdown/Inline.hs +++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs @@ -531,8 +531,10 @@ inlineToMarkdown opts (Cite (c:cs) lst) sdoc <- inlineListToMarkdown opts sinlines let k' = literal (modekey m <> "@" <> maybeInBraces k) r = case sinlines of - Str (T.uncons -> Just (y,_)):_ | y `elem` (",;]@" :: String) -> k' <> sdoc - _ -> k' <+> sdoc + Str (T.uncons -> Just (y,_)):_ + | y `elem` (",;]@" :: String) -> k' <> sdoc + Space:_ -> k' <> sdoc + _ -> k' <+> sdoc return $ pdoc <+> r modekey SuppressAuthor = "-" modekey _ = "" -- cgit v1.2.3 From 394fa9d0727a30f540d9c36ccfa68fc942cad587 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 14 Dec 2021 10:40:24 -0800 Subject: Org reader: parse official org-cite citations. We also support the older org-ref style as a fallback. We no longer support the "markdown-style" citations. See #7329. --- src/Text/Pandoc/Readers/Org/Inlines.hs | 199 ++++++++++++++++++++++++------ test/Tests/Readers/Org/Inline/Citation.hs | 40 +++++- test/command/7329.md | 23 ++++ 3 files changed, 218 insertions(+), 44 deletions(-) diff --git a/src/Text/Pandoc/Readers/Org/Inlines.hs b/src/Text/Pandoc/Readers/Org/Inlines.hs index 2366aa290..617f98a10 100644 --- a/src/Text/Pandoc/Readers/Org/Inlines.hs +++ b/src/Text/Pandoc/Readers/Org/Inlines.hs @@ -31,8 +31,8 @@ import Text.Pandoc.Readers.LaTeX (inlineCommand, rawLaTeXInline) import Text.TeXMath (DisplayType (..), readTeX, writePandoc) import Text.Pandoc.Sources (ToSources(..)) import qualified Text.TeXMath.Readers.MathML.EntityMap as MathMLEntityMap - -import Control.Monad (guard, mplus, mzero, unless, when) +import Safe (lastMay) +import Control.Monad (guard, mplus, mzero, unless, when, void) import Control.Monad.Trans (lift) import Data.Char (isAlphaNum, isSpace) import qualified Data.Map as M @@ -150,53 +150,174 @@ endline = try $ do -- We first try to parse official org-cite citations, then fall -- back to org-ref citations (which are still in wide use). -cite :: PandocMonad m => OrgParser m (F Inlines) -cite = try $ do - guardEnabled Ext_citations - (cs, raw) <- withRaw $ choice - [ orgCite - , orgRefCite - ] - return $ flip B.cite (B.text raw) <$> cs - -- | A citation in org-cite style orgCite :: PandocMonad m => OrgParser m (F [Citation]) -orgCite = try $ - char '[' *> skipSpaces *> citeList <* skipSpaces <* char ']' - -citeList :: PandocMonad m => OrgParser m (F [Citation]) -citeList = sequence <$> sepEndBy1 citation (try $ char ';' *> skipSpaces) - -citation :: PandocMonad m => OrgParser m (F Citation) -citation = try $ do - pref <- prefix - (suppress_author, key) <- citeKey False - suff <- suffix +orgCite = try $ do + string "[cite" + (sty, _variants) <- citeStyle + char ':' + spnl + globalPref <- option mempty (try (citePrefix <* char ';')) + items <- citeItems + globalSuff <- option mempty (try (char ';' *> citeSuffix)) + spnl + char ']' + return $ adjustCiteStyle sty . + addPrefixToFirstItem globalPref . + addSuffixToLastItem globalSuff $ items + +adjustCiteStyle :: CiteStyle -> (F [Citation]) -> (F [Citation]) +adjustCiteStyle sty cs = do + cs' <- cs + case cs' of + [] -> return [] + (d:ds) -- TODO needs refinement + -> case sty of + TextStyle -> return $ d{ citationMode = AuthorInText + , citationSuffix = dropWhile (== Space) + (citationSuffix d)} : ds + NoAuthorStyle -> return $ d{ citationMode = SuppressAuthor } : ds + _ -> return (d:ds) + +addPrefixToFirstItem :: (F Inlines) -> (F [Citation]) -> (F [Citation]) +addPrefixToFirstItem aff cs = do + cs' <- cs + aff' <- aff + case cs' of + [] -> return [] + (d:ds) -> return (d{ citationPrefix = + B.toList aff' <> citationPrefix d }:ds) + +addSuffixToLastItem :: (F Inlines) -> (F [Citation]) -> (F [Citation]) +addSuffixToLastItem aff cs = do + cs' <- cs + aff' <- aff + case lastMay cs' of + Nothing -> return cs' + Just d -> + return (init cs' ++ [d{ citationSuffix = + citationSuffix d <> B.toList aff' }]) + +citeItems :: PandocMonad m => OrgParser m (F [Citation]) +citeItems = sequence <$> citeItem `sepBy1` (char ';') + +citeItem :: PandocMonad m => OrgParser m (F Citation) +citeItem = do + pref <- citePrefix + itemKey <- orgCiteKey + suff <- citeSuffix return $ do - x <- pref - y <- suff + pre' <- pref + suf' <- suff return Citation - { citationId = key - , citationPrefix = B.toList x - , citationSuffix = B.toList y - , citationMode = if suppress_author - then SuppressAuthor - else NormalCitation + { citationId = itemKey + , citationPrefix = B.toList pre' + , citationSuffix = B.toList suf' + , citationMode = NormalCitation , citationNoteNum = 0 , citationHash = 0 } + +orgCiteKey :: PandocMonad m => OrgParser m Text +orgCiteKey = do + char '@' + T.pack <$> many1 (satisfy orgCiteKeyChar) + +orgCiteKeyChar :: Char -> Bool +orgCiteKeyChar c = + isAlphaNum c || c `elem` ['.',':','?','!','`','\'','/','*','@','+','|', + '(',')','{','}','<','>','&','_','^','$','#', + '%','~','-'] + +rawAffix :: PandocMonad m => Bool -> OrgParser m Text +rawAffix isPrefix = snd <$> withRaw + (many + (affixChar + <|> + try (void (char '[' >> rawAffix isPrefix >> char ']')))) where - prefix = trimInlinesF . mconcat <$> - manyTill inline (char ']' <|> (']' <$ lookAhead (citeKey False))) - suffix = try $ do - hasSpace <- option False (notFollowedBy nonspaceChar >> return True) - skipSpaces - rest <- trimInlinesF . mconcat <$> - many (notFollowedBy (oneOf ";]") *> inline) + affixChar = void $ satisfy $ \c -> + not (c == '^' || c == ';' || c == '[' || c == ']') && + (not isPrefix || c /= '@') + +citePrefix :: PandocMonad m => OrgParser m (F Inlines) +citePrefix = + rawAffix True >>= parseFromString (trimInlinesF . mconcat <$> many inline) + +citeSuffix :: PandocMonad m => OrgParser m (F Inlines) +citeSuffix = + rawAffix False >>= parseFromString parseSuffix + where + parseSuffix = do + hasSpace <- option False + (True <$ try (spaceChar >> skipSpaces >> lookAhead nonspaceChar)) + ils <- trimInlinesF . mconcat <$> many inline return $ if hasSpace - then (B.space <>) <$> rest - else rest + then (B.space <>) <$> ils + else ils + +citeStyle :: PandocMonad m => OrgParser m (CiteStyle, [CiteVariant]) +citeStyle = option (DefStyle, []) $ do + sty <- option DefStyle $ try $ char '/' *> orgCiteStyle + variants <- option [] $ try $ char '/' *> orgCiteVariants + return (sty, variants) + +orgCiteStyle :: PandocMonad m => OrgParser m CiteStyle +orgCiteStyle = choice $ map try + [ NoAuthorStyle <$ string "noauthor" + , NoAuthorStyle <$ string "na" + , LocatorsStyle <$ string "locators" + , LocatorsStyle <$ char 'l' + , NociteStyle <$ string "nocite" + , NociteStyle <$ char 'n' + , TextStyle <$ string "text" + , TextStyle <$ char 't' + ] + +orgCiteVariants :: PandocMonad m => OrgParser m [CiteVariant] +orgCiteVariants = + (fullnameVariant `sepBy1` (char '-')) <|> (many1 onecharVariant) + where + fullnameVariant = choice $ map try + [ Bare <$ string "bare" + , Caps <$ string "caps" + , Full <$ string "full" + ] + onecharVariant = choice + [ Bare <$ char 'b' + , Caps <$ char 'c' + , Full <$ char 'f' + ] + +data CiteStyle = + NoAuthorStyle + | LocatorsStyle + | NociteStyle + | TextStyle + | DefStyle + deriving Show + +data CiteVariant = + Caps + | Bare + | Full + deriving Show + + +spnl :: PandocMonad m => OrgParser m () +spnl = + skipSpaces *> optional (newline *> notFollowedBy blankline *> skipSpaces) + +cite :: PandocMonad m => OrgParser m (F Inlines) +cite = do + guardEnabled Ext_citations + (cs, raw) <- withRaw $ try $ choice + [ orgCite + , orgRefCite + ] + return $ flip B.cite (B.text raw) <$> cs +-- org-ref orgRefCite :: PandocMonad m => OrgParser m (F [Citation]) orgRefCite = try $ choice diff --git a/test/Tests/Readers/Org/Inline/Citation.hs b/test/Tests/Readers/Org/Inline/Citation.hs index 7eabd9aae..2d0d460a2 100644 --- a/test/Tests/Readers/Org/Inline/Citation.hs +++ b/test/Tests/Readers/Org/Inline/Citation.hs @@ -19,9 +19,9 @@ import Text.Pandoc.Builder tests :: [TestTree] tests = - [ testGroup "Markdown-style citations" + [ testGroup "Org-cite citations" [ "Citation" =: - "[@nonexistent]" =?> + "[cite:@nonexistent]" =?> let citation = Citation { citationId = "nonexistent" , citationPrefix = [] @@ -29,10 +29,10 @@ tests = , citationMode = NormalCitation , citationNoteNum = 0 , citationHash = 0} - in (para $ cite [citation] "[@nonexistent]") + in (para $ cite [citation] "[cite:@nonexistent]") , "Citation containing text" =: - "[see @item1 p. 34-35]" =?> + "[cite:see @item1 p. 34-35]" =?> let citation = Citation { citationId = "item1" , citationPrefix = [Str "see"] @@ -40,7 +40,37 @@ tests = , citationMode = NormalCitation , citationNoteNum = 0 , citationHash = 0} - in (para $ cite [citation] "[see @item1 p. 34-35]") + in (para $ cite [citation] "[cite:see @item1 p. 34-35]") + + , "Author-in-text citation with locator and suffix" =: + "[cite/t:see @item1 p. 34-35 and *passim*; @item2]" =?> + let citations = + [ Citation + { citationId = "item1" + , citationPrefix = [ Str "see" ] + , citationSuffix = + [ Str "p." + , Space + , Str "34-35" + , Space + , Str "and" + , Space + , Strong [ Str "passim" ] + ] + , citationMode = AuthorInText + , citationNoteNum = 0 + , citationHash = 0 + } + , Citation + { citationId = "item2" + , citationPrefix = [] + , citationSuffix = [] + , citationMode = NormalCitation + , citationNoteNum = 0 + , citationHash = 0 + } + ] + in (para $ cite citations "[cite/t:see @item1 p. 34-35 and *passim*; @item2]") ] , testGroup "org-ref citations" diff --git a/test/command/7329.md b/test/command/7329.md index 565241db8..9ed9c52ff 100644 --- a/test/command/7329.md +++ b/test/command/7329.md @@ -42,3 +42,26 @@ <> Doe, John. 2005. /First Book/. Cambridge: Cambridge University Press. ``` + +``` +% pandoc -f org -t markdown +- [cite/t:@item1] +- [cite/t:@item1 p. 12] +- [cite/t:@item1 p.12; see also @item2] +- [cite:@item1] +- [cite/na:@item1] +- [cite:see @item1 p. 12] +- [cite:see @item1 p. 12 and /passim/] +- [cite:@item1; @item2] +- [cite:see @item1; @item2] +^D +- @item1 +- @item1 [p. 12] +- @item1 [p.12; see also @item2] +- [@item1] +- [-@item1] +- [see @item1 p. 12] +- [see @item1 p. 12 and *passim*] +- [@item1; @item2] +- [see @item1; @item2] +``` -- cgit v1.2.3 From a527a2f3454adb637827704739dc2ffc94101531 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 14 Dec 2021 20:30:55 -0800 Subject: Org writer: use the citation locator list from the org source code... which is not localized, instead of getting locators from the localized CSL stylesheet as we did before. --- src/Text/Pandoc/Writers/Org.hs | 74 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 13 deletions(-) diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index ce406567b..d2a383212 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -22,6 +22,7 @@ import Data.List (intersect, intersperse, partition, transpose) import Data.List.NonEmpty (nonEmpty) import Data.Text (Text) import qualified Data.Text as T +import qualified Data.Map as M import Text.Pandoc.Class.PandocMonad (PandocMonad, report) import Text.Pandoc.Definition import Text.Pandoc.Logging @@ -29,32 +30,23 @@ import Text.Pandoc.Options import Text.DocLayout import Text.Pandoc.Shared import Text.Pandoc.Templates (renderTemplate) -import Text.Pandoc.Citeproc.Locator (parseLocator, toLocatorMap, LocatorMap, - LocatorInfo(..)) -import Text.Pandoc.Citeproc (getCiteprocLang, getStyle) -import qualified Citeproc as Citeproc +import Text.Pandoc.Citeproc.Locator (parseLocator, LocatorMap(..), LocatorInfo(..)) import Text.Pandoc.Writers.Shared data WriterState = WriterState { stNotes :: [[Block]] , stHasMath :: Bool , stOptions :: WriterOptions - , stLocatorMap :: LocatorMap } type Org = StateT WriterState -- | Convert Pandoc to Org. writeOrg :: PandocMonad m => WriterOptions -> Pandoc -> m Text -writeOrg opts document@(Pandoc meta _) = do - style <- getStyle document - mblang <- getCiteprocLang meta - let locmap = toLocatorMap $ Citeproc.mergeLocales mblang style - +writeOrg opts document = do let st = WriterState { stNotes = [], stHasMath = False, - stOptions = opts, - stLocatorMap = locmap } + stOptions = opts } evalStateT (pandocToOrg document) st -- | Return Org representation of document. @@ -417,7 +409,6 @@ inlineToOrg (Cite cs lst) = do then do let renderCiteItem c = do citePref <- inlineListToOrg (citationPrefix c) - locmap <- gets stLocatorMap let (locinfo, suffix) = parseLocator locmap (citationSuffix c) citeSuff <- inlineListToOrg suffix let locator = case locinfo of @@ -552,3 +543,60 @@ orgLangIdentifiers = , "sqlite" , "lilypond" , "vala" ] + +-- taken from oc-csl.el in the org source tree: +locmap :: LocatorMap +locmap = LocatorMap $ M.fromList + [ ("bk." , "book") + , ("bks." , "book") + , ("book" , "book") + , ("chap." , "chapter") + , ("chaps." , "chapter") + , ("chapter" , "chapter") + , ("col." , "column") + , ("cols." , "column") + , ("column" , "column") + , ("figure" , "figure") + , ("fig." , "figure") + , ("figs." , "figure") + , ("folio" , "folio") + , ("fol." , "folio") + , ("fols." , "folio") + , ("number" , "number") + , ("no." , "number") + , ("nos." , "number") + , ("line" , "line") + , ("l." , "line") + , ("ll." , "line") + , ("note" , "note") + , ("n." , "note") + , ("nn." , "note") + , ("opus" , "opus") + , ("op." , "opus") + , ("opp." , "opus") + , ("page" , "page") + , ("p" , "page") + , ("p." , "page") + , ("pp." , "page") + , ("paragraph" , "paragraph") + , ("para." , "paragraph") + , ("paras." , "paragraph") + , ("¶" , "paragraph") + , ("¶¶" , "paragraph") + , ("part" , "part") + , ("pt." , "part") + , ("pts." , "part") + , ("§" , "section") + , ("§§" , "section") + , ("section" , "section") + , ("sec." , "section") + , ("secs." , "section") + , ("sub verbo" , "sub verbo") + , ("s.v." , "sub verbo") + , ("s.vv." , "sub verbo") + , ("verse" , "verse") + , ("v." , "verse") + , ("vv." , "verse") + , ("volume" , "volume") + , ("vol." , "volume") + , ("vols." , "volume") ] -- cgit v1.2.3 From 6303952623d7a9fe2c5e9f618abd812d48ca3fcd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 14 Dec 2021 22:22:09 -0800 Subject: Use dev texmath. --- cabal.project | 8 ++++---- stack.yaml | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cabal.project b/cabal.project index 606d8bb48..091031930 100644 --- a/cabal.project +++ b/cabal.project @@ -8,10 +8,10 @@ source-repository-package location: https://github.com/pandoc/pandoc-lua-marshal tag: 98e3de5087bb533fadbb89720f83f7f7cc3be5bf --- source-repository-package --- type: git --- location: https://github.com/jgm/texmath.git --- tag: 674bcbaec03e5550f155623de6662953bd157625 +source-repository-package + type: git + location: https://github.com/jgm/texmath.git + tag: 46df85d747f4f233157d3476683264232a4f58be source-repository-package type: git diff --git a/stack.yaml b/stack.yaml index 30845ad6b..730a13da9 100644 --- a/stack.yaml +++ b/stack.yaml @@ -31,9 +31,10 @@ extra-deps: - commonmark-extensions-0.2.2 - citeproc-0.6 - aeson-pretty-0.8.9 -- texmath-0.12.3.3 - unicode-transforms-0.4.0 - unicode-data-0.2.0 +- git: https://github.com/jgm/texmath.git + commit: 46df85d747f4f233157d3476683264232a4f58be - git: https://github.com/jgm/ipynb.git commit: 00246af10885c2ad4413ace4f69a7e6c88297a08 - git: https://github.com/pandoc/pandoc-lua-marshal -- cgit v1.2.3 From 61ffa55835bf8ee0d86431e52d9a5d9482bd7bb3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 15 Dec 2021 16:05:15 -0800 Subject: T.P.Citeproc: do not export getStyle, getCiteprocLang. This commit undoes the API changes noted in ea77f2e6f653d5b570109fa208dc427d99f95b51 They are no longer needed, and we should avoid unnecessary API changes. --- src/Text/Pandoc/Citeproc.hs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index d769a91c8..f235f6e01 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -7,8 +7,6 @@ module Text.Pandoc.Citeproc ( processCitations, getReferences, - getStyle, - getCiteprocLang ) where -- cgit v1.2.3 From 7a70b87facffe5f2daaaa58af9fadad89b81a9e9 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 17 Dec 2021 17:32:28 +0100 Subject: Lua: add function `pandoc.utils.references` List with all cited references of a document. Closes: #7752 --- doc/lua-filters.md | 32 ++++++++++ pandoc.cabal | 1 + src/Text/Pandoc/Lua/Marshal/Reference.hs | 101 +++++++++++++++++++++++++++++++ src/Text/Pandoc/Lua/Module/Utils.hs | 14 +++++ 4 files changed, 148 insertions(+) create mode 100644 src/Text/Pandoc/Lua/Marshal/Reference.hs diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 7b73dd9c5..93595a814 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3301,6 +3301,38 @@ Usage: } local newblocks = pandoc.utils.make_sections(true, 1, blocks) +### references {#pandoc.references} + +`references (doc)` + +Get references defined inline in the metadata and via an external +bibliography. Only references that are actually cited in the +document (either with a genuine citation or with `nocite`) are +returned. URL variables are converted to links. + +The structure used represent reference values corresponds to that +used in CSL JSON; the return value can be use as `references` +metadata, which is one of the values used by pandoc and citeproc +when generating bibliographies. + +Parameters: + +`doc`: +: document ([Pandoc](#type-pandoc)) + +Returns: + +- list of references. (table) + +Usage: + + -- Include all cited references in document + function Pandoc (doc) + doc.meta.references = pandoc.utils.references(doc) + doc.meta.bibliography = nil + return doc + end + ### run\_json\_filter {#pandoc.utils.run_json_filter} `run_json_filter (doc, filter[, args])` diff --git a/pandoc.cabal b/pandoc.cabal index 13db955b9..b09b19144 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -697,6 +697,7 @@ library Text.Pandoc.Lua.Marshal.Context, Text.Pandoc.Lua.Marshal.PandocError, Text.Pandoc.Lua.Marshal.ReaderOptions, + Text.Pandoc.Lua.Marshal.Reference, Text.Pandoc.Lua.Marshal.Sources, Text.Pandoc.Lua.Module.MediaBag, Text.Pandoc.Lua.Module.Pandoc, diff --git a/src/Text/Pandoc/Lua/Marshal/Reference.hs b/src/Text/Pandoc/Lua/Marshal/Reference.hs new file mode 100644 index 000000000..51501836f --- /dev/null +++ b/src/Text/Pandoc/Lua/Marshal/Reference.hs @@ -0,0 +1,101 @@ +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +{- | + Module : Text.Pandoc.Lua.Marshaling.ReaderOptions + Copyright : © 2012-2021 John MacFarlane + © 2017-2021 Albert Krewinkel + License : GNU GPL, version 2 or above + + Maintainer : Albert Krewinkel + Stability : alpha + +Marshal citeproc 'Reference' values. +-} +module Text.Pandoc.Lua.Marshal.Reference + ( pushReference + ) where + +import Citeproc.Types + ( Date (..), DateParts (..), ItemId (..), Name (..), Reference (..) + , Val (..), Variable, fromVariable + ) +import Control.Monad (forM_) +import HsLua hiding (Name, Reference, pushName, peekName) +import Text.Pandoc.Builder (Inlines, toList) +import Text.Pandoc.Lua.Marshal.Inline (pushInlines) +import Text.Pandoc.Lua.Marshal.List (pushPandocList) + +import qualified Data.Map as Map +import qualified HsLua + +-- | Pushes a ReaderOptions value as userdata object. +pushReference :: LuaError e => Pusher e (Reference Inlines) +pushReference reference = do + pushAsTable [ ("id", pushItemId . referenceId) + , ("type", pushText . referenceType) + ] + reference + forM_ (Map.toList $ referenceVariables reference) $ \(var, val) -> do + pushVariable var + pushVal val + rawset (nth 3) + +-- | Pushes an 'ItemId' as a string. +pushItemId :: Pusher e ItemId +pushItemId = pushText . unItemId + +-- | Pushes a person's 'Name' as a table. +pushName :: LuaError e => Pusher e Name +pushName = pushAsTable + [ ("family" , pushTextOrNil . nameFamily) + , ("given" , pushTextOrNil . nameGiven) + , ("dropping-particle" , pushTextOrNil . nameDroppingParticle) + , ("non-dropping-particle" , pushTextOrNil . nameNonDroppingParticle) + , ("suffix" , pushTextOrNil . nameSuffix) + , ("literal" , pushTextOrNil . nameLiteral) + , ("comma-suffix" , pushBool . nameCommaSuffix) + , ("static-ordering" , pushBool . nameStaticOrdering) + ] + where + pushTextOrNil = \case + Nothing -> pushnil + Just xs -> pushText xs + +-- | Pushes a 'Variable' as string. +pushVariable :: Pusher e Variable +pushVariable = pushText . fromVariable + +-- | Pushes a 'Val', i.e., a variable value. +pushVal :: LuaError e => Pusher e (Val Inlines) +pushVal = \case + TextVal t -> pushText t + FancyVal inlns -> pushInlines $ toList inlns + NumVal i -> pushIntegral i + NamesVal names -> pushPandocList pushName names + DateVal date -> pushDate date + +-- | Pushes a 'Date' as table. +pushDate :: LuaError e => Pusher e Date +pushDate = pushAsTable + [ ("date-parts", pushPandocList pushDateParts . dateParts) + , ("circa", pushBool . dateCirca) + , ("season", maybe pushnil pushIntegral . dateSeason) + , ("literal", maybe pushnil pushText . dateLiteral) + ] + where + -- date parts are integers, but we push them as strings, as meta + -- values can't handle integers yet. + pushDateParts (DateParts dp) = pushPandocList (pushString . show) dp + +-- | Helper funtion to push an object as a table. +pushAsTable :: LuaError e + => [(HsLua.Name, a -> LuaE e ())] + -> a -> LuaE e () +pushAsTable props obj = do + createtable 0 (length props) + forM_ props $ \(name, pushValue) -> do + HsLua.pushName name + pushValue obj + rawset (nth 3) diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 8bb185500..6d0130dc2 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -25,9 +25,11 @@ import Data.Version (Version) import HsLua as Lua import HsLua.Class.Peekable (PeekError) import HsLua.Module.Version (peekVersionFuzzy, pushVersion) +import Text.Pandoc.Citeproc (getReferences) import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshal.AST +import Text.Pandoc.Lua.Marshal.Reference import Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua)) import qualified Data.Digest.Pure.SHA as SHA @@ -95,6 +97,18 @@ documentedModule = Module =#> functionResult pushVersion "Version" "new Version object" #? "Creates a Version object." + , defun "references" + ### (unPandocLua . getReferences Nothing) + <#> parameter peekPandoc "Pandoc" "doc" "document" + =#> functionResult (pushPandocList pushReference) "table" + "lift of references" + #? mconcat + [ "Get references defined inline in the metadata and via an external " + , "bibliography. Only references that are actually cited in the " + , "document (either with a genuine citation or with `nocite`) are " + , "returned. URL variables are converted to links." + ] + , defun "run_json_filter" ### (\doc filterPath margs -> do args <- case margs of -- cgit v1.2.3 From bc947a4496404fb9bacaf459d048937c0e3f6c25 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 18 Dec 2021 09:48:34 -0800 Subject: Use latest doctemplates, commonmark-extensions in stack.yaml. --- stack.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stack.yaml b/stack.yaml index 730a13da9..14e81063c 100644 --- a/stack.yaml +++ b/stack.yaml @@ -9,7 +9,7 @@ packages: extra-deps: - skylighting-core-0.12.1 - skylighting-0.12.1 -- doctemplates-0.10 +- doctemplates-0.10.0.1 - emojis-0.1.2 - doclayout-0.3.1.1 - lpeg-1.0.1 @@ -28,7 +28,7 @@ extra-deps: - tasty-lua-1.0.0 - pandoc-types-1.22.1 - commonmark-0.2.1.1 -- commonmark-extensions-0.2.2 +- commonmark-extensions-0.2.2.1 - citeproc-0.6 - aeson-pretty-0.8.9 - unicode-transforms-0.4.0 -- cgit v1.2.3 From 6b0a560ae71b5ca7c2439d7470bed7b02c362a64 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 18 Dec 2021 09:52:24 -0800 Subject: Improve 'make check'. --- Makefile | 23 ++++++++++++++--------- RELEASE-CHECKLIST | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 7f36d16e7..ac0506328 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,19 @@ ghci: haddock: stack haddock +check: check-cabal checkdocs + cabal check # check cabal file + cabal outdated # check cabal dependencies + lsd # check that stack.yaml dependencies are up to date + +check-cabal: git-files.txt sdist-files.txt + @echo "Checking to see if all committed test/data files are in sdist." + diff -u $^ + +checkdocs: + @echo "Checking for tabs in manual." + ! grep -q -n -e "\t" MANUAL.txt changelog.md + # Note: to accept current results of golden tests, # make test TESTARGS='--accept' test: @@ -82,10 +95,6 @@ dist: man/pandoc.1 cd pandoc-${version} stack setup && stack test && cd .. && rm -rf "pandoc-${version}" -check: checkdocs check-cabal - -checkdocs: - ! grep -q -n -e "\t" MANUAL.txt changelog.md debpkg: docker run -v `pwd`:/mnt \ @@ -135,14 +144,10 @@ update-website: clean: stack clean -check-cabal: git-files.txt sdist-files.txt - echo "Checking to see if all committed test/data files are in sdist." - diff -u $^ - sdist-files.txt: .FORCE cabal sdist --list-only | sed 's/\.\///' | grep '^\(test\|data\)\/' | sort > $@ git-files.txt: .FORCE git ls-tree -r --name-only HEAD | grep '^\(test\|data\)\/' | sort > $@ -.PHONY: .FORCE deps quick full haddock install clean test bench changes_github dist prof download_stats reformat lint weigh doc/lua-filters.md pandoc-templates trypandoc update-website debpkg checkdocs ghcid ghci fix_spacing hlint check check-cabal +.PHONY: .FORCE deps quick full haddock install clean test bench changes_github dist prof download_stats reformat lint weigh doc/lua-filters.md pandoc-templates trypandoc update-website debpkg checkdocs ghcid ghci fix_spacing hlint check check-cabal check diff --git a/RELEASE-CHECKLIST b/RELEASE-CHECKLIST index 1e42c0f3e..fcfe2d751 100644 --- a/RELEASE-CHECKLIST +++ b/RELEASE-CHECKLIST @@ -1,4 +1,4 @@ -[ ] use 'policeman' to check API changes and version update +[ ] make check [ ] make README.md and commit if needed [ ] make man/pandoc.1 and commit if needed [ ] Finalize changelog -- cgit v1.2.3 From 4b220d592c163efb0bf5a0e1db2ed7d6be9c69e7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 18 Dec 2021 12:13:06 -0800 Subject: Citeproc: avoid adding comma before an author-in-text citation... ...in a note if it begins with a title (no author). Closes #7761. --- src/Text/Pandoc/Citeproc.hs | 22 ++++++++++++++-------- test/command/7761.md | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 test/command/7761.md diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index f235f6e01..03a15e9f6 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -543,7 +543,7 @@ deNote (Note bs) = addParens [] = [] addParens (Cite (c:cs) ils : zs) | citationMode c == AuthorInText - = Cite (c:cs) (concatMap (noteAfterComma (needsPeriod zs)) ils) : + = Cite (c:cs) (addCommas (needsPeriod zs) ils) : addParens zs | otherwise = Cite (c:cs) (concatMap noteInParens ils) : addParens zs @@ -564,13 +564,19 @@ deNote (Note bs) = removeFinalPeriod ils ++ [Str ")"] noteInParens x = [x] - noteAfterComma needsPer (Span ("",["csl-note"],[]) ils) - | not (null ils) - = Str "," : Space : - if needsPer - then ils - else removeFinalPeriod ils - noteAfterComma _ x = [x] + -- We want to add a comma before a CSL note citation, but not + -- before the author name, and not before the first citation + -- if it doesn't begin with an author name. + addCommas = addCommas' True -- boolean == "at beginning" + + addCommas' _ _ [] = [] + addCommas' atBeginning needsPer + (Span ("",["csl-note"],[]) ils : rest) + | not (null ils) + = (if atBeginning then id else ([Str "," , Space] ++)) $ + (if needsPer then ils else removeFinalPeriod ils) ++ + addCommas' False needsPer rest + addCommas' _ needsPer (il : rest) = il : addCommas' False needsPer rest deNote x = x diff --git a/test/command/7761.md b/test/command/7761.md new file mode 100644 index 000000000..0307bcaee --- /dev/null +++ b/test/command/7761.md @@ -0,0 +1,35 @@ +``` +% pandoc --citeproc --csl command/chicago-fullnote-bibliography.csl -t plain +--- +references: +- id: noauthor + issued: 2020 + publisher: Oxford University Press + publisher-place: Oxford + title: Title + type: book +- id: author + author: + - family: Jones + given: Jim + issued: 2021 + title: Title + type: book + url: "https://duckduckgo.com/cite2021" +--- + +Text.[^n] + +[^n]: See @author. Another example of a sea level mapping tool with +similar limitations is @noauthor. +^D +Text.[1] + +Jones, Jim. Title, 2021. https://duckduckgo.com/cite2021. + +Title. Oxford: Oxford University Press, 2020. + +[1] See Jim Jones, Title, 2021, https://duckduckgo.com/cite2021. Another +example of a sea level mapping tool with similar limitations is Title +(Oxford: Oxford University Press, 2020). +``` -- cgit v1.2.3 From a0af1b5926e45c830f734883b909e733fd3c01cb Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 19 Dec 2021 09:17:54 +0100 Subject: Lua: change representation of TableHead, TableFoot, and Row values. The objects now also follow the principle that element attributes are accessible through the `.attr` field. Rows in `TableHead` and `TableFoot` are available via the `.rows` field. Row objects have a `.cells` field, containing the list of table cells. Closes: #7718 --- cabal.project | 2 +- doc/lua-filters.md | 93 +++++++++++++++++++++++++++++++++++++++++++++--------- stack.yaml | 2 +- 3 files changed, 80 insertions(+), 17 deletions(-) diff --git a/cabal.project b/cabal.project index 091031930..bc617093c 100644 --- a/cabal.project +++ b/cabal.project @@ -6,7 +6,7 @@ constraints: aeson >= 2.0.1.0 source-repository-package type: git location: https://github.com/pandoc/pandoc-lua-marshal - tag: 98e3de5087bb533fadbb89720f83f7f7cc3be5bf + tag: 45e53d9dce37d20f8e30e0d297a43c5b4c4a6831 source-repository-package type: git diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 93595a814..616c13cea 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -1876,8 +1876,6 @@ List attributes Values of this type can be created with the [`pandoc.ListAttributes`](#pandoc.listattributes) constructor. -Object equality is determined via [`pandoc.utils.equals`]. - Fields: `start` @@ -1896,10 +1894,13 @@ Fields: A table row. -Tuple fields: +Fields: -1. row attributes -2. row cells (list of [Cells]) +`attr` +: element attributes ([Attr][]) + +`cells` +: list of table cells ([List][] of [Cell][]s) ### TableBody {#type-tablebody} @@ -1909,35 +1910,59 @@ number of row header columns. Fields: `attr` -: table body attributes ([Attr]) +: table body attributes ([Attr][]) `body` -: table body rows (list of [Rows]) +: table body rows ([List][] of [Row][]s) `head` -: intermediate head (list of [Rows]) +: intermediate head ([List][] of [Row][]s) `row_head_columns` : number of columns taken up by the row head of each row of a - [TableBody]. The row body takes up the remaining columns. + [TableBody][]. The row body takes up the remaining columns. ### TableFoot {#type-tablefoot} The foot of a table. -This is a pair with the following components: +Fields: -1. attributes -2. foot rows ([Rows]) +`attr` +: element attributes ([Attr][]) + +`rows` +: list of rows ([List][] of [Row][]s) + +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List][] of strings) + +`attributes` +: alias for `attr.attributes` ([Attributes][]) ### TableHead {#type-tablehead} The head of a table. -This is a pair with the following components: +Fields: + +`attr` +: element attributes ([Attr][]) + +`rows` +: list of rows ([List][] of [Row][]s) + +`identifier` +: alias for `attr.identifier` (string) + +`classes` +: alias for `attr.classes` ([List][] of strings) -1. attributes -2. head rows ([Rows]) +`attributes` +: alias for `attr.attributes` ([Attributes][]) ## ReaderOptions {#type-readeroptions} @@ -2120,6 +2145,7 @@ Usage: [Block]: #type-block [Blocks]: #type-block [Caption]: #type-caption +[Cell]: #type-cell [Cells]: #type-cell [Citation]: #type-citation [Citations]: #type-citation @@ -2138,6 +2164,7 @@ Usage: [Pandoc]: #type-pandoc [Para]: #type-para [Plain]: #type-plain +[Row]: #type-row [Rows]: #type-row [SimpleTable]: #type-simpletable [Table]: #type-table @@ -2901,6 +2928,42 @@ format, and functions to filter and modify a subtree. Returns: [ListAttributes](#type-listattributes) object +[`Row ([cells[, attr]])`]{#pandoc.row} + +: Creates a table row. + + Parameters: + + `cells`: + : list of table cells in this row + + `attr`: + : row attributes + +[`TableFoot ([rows[, attr]])`]{#pandoc.tablefoot} + +: Creates a table foot. + + Parameters: + + `rows`: + : list of table rows + + `attr`: + : table foot attributes + +[`TableHead ([rows[, attr]])`]{#pandoc.tablehead} + +: Creates a table head. + + Parameters: + + `rows`: + : list of table rows + + `attr`: + : table head attributes + ## Legacy types [`SimpleTable (caption, aligns, widths, headers, rows)`]{#pandoc.simpletable} diff --git a/stack.yaml b/stack.yaml index 14e81063c..a76508782 100644 --- a/stack.yaml +++ b/stack.yaml @@ -38,7 +38,7 @@ extra-deps: - git: https://github.com/jgm/ipynb.git commit: 00246af10885c2ad4413ace4f69a7e6c88297a08 - git: https://github.com/pandoc/pandoc-lua-marshal - commit: 98e3de5087bb533fadbb89720f83f7f7cc3be5bf + commit: 45e53d9dce37d20f8e30e0d297a43c5b4c4a6831 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From dc3dcc2ccd3435ca88cf1eaeea05f62806f066d6 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 19 Dec 2021 14:31:52 +0100 Subject: Lua: fixup, should have been part of previous commit --- src/Text/Pandoc/Lua/Module/Pandoc.hs | 3 +++ test/lua/module/pandoc-utils.lua | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index ac159ae0d..20c2f5af5 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -116,6 +116,9 @@ otherConstructors = , mkBlocks , mkCitation , mkCell + , mkRow + , mkTableHead + , mkTableFoot , mkInlines , mkListAttributes , mkSimpleTable diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua index 9bd903f2d..0c3831bb1 100644 --- a/test/lua/module/pandoc-utils.lua +++ b/test/lua/module/pandoc-utils.lua @@ -106,14 +106,14 @@ return { {long = {pandoc.Plain { pandoc.Str "the", pandoc.Space(), pandoc.Str "caption"}}}, {{pandoc.AlignDefault, nil}}, - {pandoc.Attr(), {{pandoc.Attr(), {simple_cell{pandoc.Plain "head1"}}}}}, + pandoc.TableHead{pandoc.Row{simple_cell{pandoc.Plain "head1"}}}, {{ attr = pandoc.Attr(), - body = {{pandoc.Attr(), {simple_cell{pandoc.Plain "cell1"}}}}, + body = {pandoc.Row{simple_cell{pandoc.Plain "cell1"}}}, head = {}, row_head_columns = 0 }}, - {pandoc.Attr(), {}}, + pandoc.TableFoot(), pandoc.Attr() ) local stbl = utils.to_simple_table(tbl) -- cgit v1.2.3 From 74c2d9eb07f26da89698e051891fa084ffdfea8e Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 19 Dec 2021 15:59:05 +0100 Subject: doc/lua-filters: numbers are now accepted as MetaValue --- doc/lua-filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 616c13cea..901fd6be8 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -887,7 +887,7 @@ MetaValue is expected. The types correspond to the following Haskell type constructors: - boolean → MetaBool -- string → MetaString +- string or number → MetaString - Inlines → MetaInlines - Blocks → MetaBlocks - List/integer indexed table → MetaList -- cgit v1.2.3 From f8f03c2ffca168d5c897febc2a631c2605973699 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 19 Dec 2021 20:05:58 +0100 Subject: JATS writer: keep quotes in element-citations The JATS writer was losing quotes in element-citations, as it uses the `T.P.Citeproc.getReferences` function to get references. That function replaces `Quoted` elements with spans. That transformation is required in `T.P.Citeproc.processCitations`, so it has been moved there. --- src/Text/Pandoc/Citeproc.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 03a15e9f6..2530ef46f 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -55,7 +55,10 @@ processCitations (Pandoc meta bs) = do mblang <- getCiteprocLang meta let locale = Citeproc.mergeLocales mblang style - refs <- getReferences (Just locale) (Pandoc meta bs) + let addQuoteSpan (Quoted _ xs) = Span ("",["csl-quoted"],[]) xs + addQuoteSpan x = x + refs <- map (walk addQuoteSpan) <$> + getReferences (Just locale) (Pandoc meta bs) let otherIdsMap = foldr (\ref m -> case T.words . extractText <$> @@ -206,10 +209,7 @@ getReferences mblocale (Pandoc meta bs) = do Just fp -> getRefsFromBib locale idpred fp Nothing -> return [] Nothing -> return [] - let addQuoteSpan (Quoted _ xs) = Span ("",["csl-quoted"],[]) xs - addQuoteSpan x = x - return $ map (legacyDateRanges . walk addQuoteSpan) - (externalRefs ++ inlineRefs) + return $ map legacyDateRanges (externalRefs ++ inlineRefs) -- note that inlineRefs can override externalRefs -- cgit v1.2.3 From 0610f16f7f684b320325b6c0b501725138d10a52 Mon Sep 17 00:00:00 2001 From: binaarinen <53334195+binaarinen@users.noreply.github.com> Date: Sun, 19 Dec 2021 21:10:41 +0100 Subject: Add a writer for Markua 0.10 (#7729) Markua is a markdown variant used by Leanpub. More information about Markua can be found at https://leanpub.com/markua/read. Adds a new exported function `writeMarkua` from T.P.Writers.Markdown. [API change] Closes #1871. Co-authored by Tim Wisotzki and Samuel Lemmenmeier. --- MANUAL.txt | 2 + data/templates/default.markua | 21 + pandoc.cabal | 2 + src/Text/Pandoc/App/FormatHeuristics.hs | 1 + src/Text/Pandoc/Extensions.hs | 2 + src/Text/Pandoc/Shared.hs | 5 + src/Text/Pandoc/Writers.hs | 2 + src/Text/Pandoc/Writers/Markdown.hs | 102 ++++- src/Text/Pandoc/Writers/Markdown/Inline.hs | 172 +++++-- src/Text/Pandoc/Writers/Markdown/Types.hs | 3 +- test/Tests/Old.hs | 1 + test/Tests/Writers/Markua.hs | 40 ++ test/tables.markua | 58 +++ test/test-pandoc.hs | 2 + test/writer.markua | 700 +++++++++++++++++++++++++++++ 15 files changed, 1043 insertions(+), 70 deletions(-) create mode 100644 data/templates/default.markua create mode 100644 test/Tests/Writers/Markua.hs create mode 100644 test/tables.markua create mode 100644 test/writer.markua diff --git a/MANUAL.txt b/MANUAL.txt index fe551bbce..2e6d53ca6 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -316,6 +316,7 @@ header when requesting a document from a URL: - `markdown_mmd` ([MultiMarkdown]) - `markdown_phpextra` ([PHP Markdown Extra]) - `markdown_strict` (original unextended [Markdown]) + - `markua` ([Markua]) - `mediawiki` ([MediaWiki markup]) - `ms` ([roff ms]) - `muse` ([Muse]), @@ -502,6 +503,7 @@ header when requesting a document from a URL: [CSL JSON]: https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html [BibTeX]: https://ctan.org/pkg/bibtex [BibLaTeX]: https://ctan.org/pkg/biblatex +[Markua]: https://leanpub.com/markua/read ## Reader options {.options} diff --git a/data/templates/default.markua b/data/templates/default.markua new file mode 100644 index 000000000..9f6ca96de --- /dev/null +++ b/data/templates/default.markua @@ -0,0 +1,21 @@ +$if(titleblock)$ +$titleblock$ + +$endif$ +$for(header-includes)$ +$header-includes$ + +$endfor$ +$for(include-before)$ +$include-before$ + +$endfor$ +$if(toc)$ +$table-of-contents$ + +$endif$ +$body$ +$for(include-after)$ + +$include-after$ +$endfor$ diff --git a/pandoc.cabal b/pandoc.cabal index b09b19144..3cad5bce7 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -90,6 +90,7 @@ data-files: data/templates/default.epub3 data/templates/article.jats_publishing data/templates/affiliations.jats + data/templates/default.markua -- translations data/translations/*.yaml -- source files for reference.docx @@ -825,6 +826,7 @@ test-suite test-pandoc Tests.Writers.Docx Tests.Writers.RST Tests.Writers.TEI + Tests.Writers.Markua Tests.Writers.Muse Tests.Writers.FB2 Tests.Writers.Powerpoint diff --git a/src/Text/Pandoc/App/FormatHeuristics.hs b/src/Text/Pandoc/App/FormatHeuristics.hs index a2acfc6d6..e5fe7ad81 100644 --- a/src/Text/Pandoc/App/FormatHeuristics.hs +++ b/src/Text/Pandoc/App/FormatHeuristics.hs @@ -54,6 +54,7 @@ formatFromFilePath x = ".lhs" -> Just "markdown+lhs" ".ltx" -> Just "latex" ".markdown" -> Just "markdown" + ".markua" -> Just "markua" ".mkdn" -> Just "markdown" ".mkd" -> Just "markdown" ".mdwn" -> Just "markdown" diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index ce6a95458..33f615740 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -432,6 +432,8 @@ getDefaultExtensions "jats_archiving" = getDefaultExtensions "jats" getDefaultExtensions "jats_publishing" = getDefaultExtensions "jats" getDefaultExtensions "jats_articleauthoring" = getDefaultExtensions "jats" getDefaultExtensions "opml" = pandocExtensions -- affects notes +getDefaultExtensions "markua" = extensionsFromList + [] getDefaultExtensions _ = extensionsFromList [Ext_auto_identifiers] diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index eb0b4acbf..50abe6937 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -25,6 +25,7 @@ module Text.Pandoc.Shared ( ordNub, findM, -- * Text processing + inquotes, tshow, elemText, notElemText, @@ -186,6 +187,10 @@ findM p = foldr go (pure Nothing) -- Text processing -- +-- | Wrap double quotes around a Text +inquotes :: T.Text -> T.Text +inquotes txt = T.cons '\"' (T.snoc txt '\"') + tshow :: Show a => a -> T.Text tshow = T.pack . show diff --git a/src/Text/Pandoc/Writers.hs b/src/Text/Pandoc/Writers.hs index c348477c2..960b9074c 100644 --- a/src/Text/Pandoc/Writers.hs +++ b/src/Text/Pandoc/Writers.hs @@ -51,6 +51,7 @@ module Text.Pandoc.Writers , writeLaTeX , writeMan , writeMarkdown + , writeMarkua , writeMediaWiki , writeMs , writeMuse @@ -190,6 +191,7 @@ writers = [ ,("csljson" , TextWriter writeCslJson) ,("bibtex" , TextWriter writeBibTeX) ,("biblatex" , TextWriter writeBibLaTeX) + ,("markua" , TextWriter writeMarkua) ] -- | Retrieve writer, extensions based on formatSpec (format+extensions). diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 022dbc24f..bb68d9fee 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -18,6 +18,7 @@ Markdown: module Text.Pandoc.Writers.Markdown ( writeMarkdown, writeCommonMark, + writeMarkua, writePlain) where import Control.Monad.Reader import Control.Monad.State.Strict @@ -42,7 +43,10 @@ import Text.Pandoc.Templates (renderTemplate) import Text.DocTemplates (Val(..), Context(..), FromContext(..)) import Text.Pandoc.Walk import Text.Pandoc.Writers.HTML (writeHtml5String) -import Text.Pandoc.Writers.Markdown.Inline (inlineListToMarkdown, linkAttributes, attrsToMarkdown) +import Text.Pandoc.Writers.Markdown.Inline (inlineListToMarkdown, + linkAttributes, + attrsToMarkdown, + attrsToMarkua) import Text.Pandoc.Writers.Markdown.Types (MarkdownVariant(..), WriterState(..), WriterEnv(..), @@ -77,6 +81,26 @@ writeCommonMark opts document = enableExtension Ext_intraword_underscores $ writerExtensions opts } +-- | Convert Pandoc to Markua. +writeMarkua :: PandocMonad m => WriterOptions -> Pandoc -> m Text +writeMarkua opts document = + evalMD (pandocToMarkdown opts' document) def{ envVariant = Markua } def + where + opts' = opts{ writerExtensions = + enableExtension Ext_hard_line_breaks $ + enableExtension Ext_pipe_tables $ + -- required for fancy list enumerators + enableExtension Ext_fancy_lists $ + enableExtension Ext_startnum $ + enableExtension Ext_strikeout $ + enableExtension Ext_subscript $ + enableExtension Ext_superscript $ + enableExtension Ext_definition_lists $ + enableExtension Ext_smart $ + enableExtension Ext_footnotes + mempty } + + pandocTitleBlock :: Doc Text -> [Doc Text] -> Doc Text -> Doc Text pandocTitleBlock tit auths dat = hang 2 (text "% ") tit <> cr <> @@ -327,8 +351,15 @@ blockToMarkdown' opts (Div attrs ils) = do contents <- blockListToMarkdown opts ils variant <- asks envVariant return $ - case () of - _ | isEnabled Ext_fenced_divs opts && + case () of + _ | variant == Markua -> + case () of + () | "blurb" `elem` classes' -> prefixed "B> " contents <> blankline + | "aside" `elem` classes' -> prefixed "A> " contents <> blankline + -- | necessary to enable option to create a bibliography + | (take 3 (T.unpack id')) == "ref" -> contents <> blankline + | otherwise -> contents <> blankline + | isEnabled Ext_fenced_divs opts && attrs /= nullAttr -> let attrsToMd = if variant == Commonmark then attrsToMarkdown @@ -408,6 +439,7 @@ blockToMarkdown' opts b@(RawBlock f str) = do | f `elem` ["markdown", "markdown_github", "markdown_phpextra", "markdown_mmd", "markdown_strict"] -> return $ literal str <> literal "\n" + Markua -> renderEmpty _ | isEnabled Ext_raw_attribute opts -> rawAttribBlock | f `elem` ["html", "html5", "html4"] , isEnabled Ext_markdown_attribute opts @@ -419,17 +451,19 @@ blockToMarkdown' opts b@(RawBlock f str) = do , isEnabled Ext_raw_tex opts -> return $ literal str <> literal "\n" _ -> renderEmpty -blockToMarkdown' opts HorizontalRule = - return $ blankline <> literal (T.replicate (writerColumns opts) "-") <> blankline +blockToMarkdown' opts HorizontalRule = do + variant <- asks envVariant + let indicator = case variant of + Markua -> "* * *" + _ -> T.replicate (writerColumns opts) "-" + return $ blankline <> literal indicator <> blankline blockToMarkdown' opts (Header level attr inlines) = do - -- first, if we're putting references at the end of a section, we -- put them here. blkLevel <- asks envBlockLevel refs <- if writerReferenceLocation opts == EndOfSection && blkLevel == 1 then notesAndRefs opts else return empty - variant <- asks envVariant -- we calculate the id that would be used by auto_identifiers -- so we know whether to print an explicit identifier @@ -442,7 +476,8 @@ blockToMarkdown' opts (Header level attr inlines) = do && id' == autoId -> empty (id',_,_) | isEnabled Ext_mmd_header_identifiers opts -> space <> brackets (literal id') - _ | isEnabled Ext_header_attributes opts || + _ | variant == Markua -> attrsToMarkua attr + | isEnabled Ext_header_attributes opts || isEnabled Ext_attributes opts -> space <> attrsToMarkdown attr | otherwise -> empty @@ -476,6 +511,8 @@ blockToMarkdown' opts (Header level attr inlines) = do -- ghc interprets '#' characters in column 1 as linenum specifiers. _ | variant == PlainText || isEnabled Ext_literate_haskell opts -> contents <> blankline + _ | variant == Markua -> attr' <> cr <> literal (T.replicate level "#") + <> space <> contents <> blankline _ -> literal (T.replicate level "#") <> space <> contents <> attr' <> blankline return $ refs <> hdr @@ -492,9 +529,11 @@ blockToMarkdown' opts (CodeBlock attribs str) = do backticks <> attrs <> cr <> literal str <> cr <> backticks <> blankline | isEnabled Ext_fenced_code_blocks opts -> tildes <> attrs <> cr <> literal str <> cr <> tildes <> blankline - _ -> nest (writerTabStop opts) (literal str) <> blankline + _ | variant == Markua -> blankline <> attrsToMarkua attribs <> cr <> backticks <> cr <> + literal str <> cr <> backticks <> cr <> blankline + | otherwise -> nest (writerTabStop opts) (literal str) <> blankline where - endlineLen c = maybe 3 ((+1) . maximum) $ nonEmpty $ + endlineLen c = maybe 3 ((+1) . maximum) $ nonEmpty [T.length ln | ln <- map trim (T.lines str) , T.pack [c,c,c] `T.isPrefixOf` ln @@ -581,24 +620,29 @@ blockToMarkdown' opts t@(Table _ blkCapt specs thead tbody tfoot) = do return $ nst (tbl $$ caption'') $$ blankline blockToMarkdown' opts (BulletList items) = do contents <- inList $ mapM (bulletListItemToMarkdown opts) items - return $ (if isTightList items then vcat else vsep) contents <> blankline + return $ (if isTightList items then vcat else vsep) + contents <> blankline blockToMarkdown' opts (OrderedList (start,sty,delim) items) = do variant <- asks envVariant let start' = if variant == Commonmark || isEnabled Ext_startnum opts then start else 1 let sty' = if isEnabled Ext_fancy_lists opts then sty else DefaultStyle - let delim' = if isEnabled Ext_fancy_lists opts - then delim - else if variant == Commonmark && - (delim == OneParen || delim == TwoParens) - then OneParen -- commonmark only supports one paren - else DefaultDelim + let delim' | isEnabled Ext_fancy_lists opts = + case variant of + -- Markua supports 'fancy' enumerators, but no TwoParens + Markua -> if delim == TwoParens then OneParen else delim + _ -> delim + | variant == Commonmark && --commonmark only supports one paren + (delim == OneParen || delim == TwoParens) = OneParen + | otherwise = DefaultDelim let attribs = (start', sty', delim') let markers = orderedListMarkers attribs - let markers' = map (\m -> if T.length m < 3 - then m <> T.replicate (3 - T.length m) " " - else m) markers + let markers' = case variant of + Markua -> markers + _ -> map (\m -> if T.length m < 3 + then m <> T.replicate (3 - T.length m) " " + else m) markers contents <- inList $ zipWithM (orderedListItemToMarkdown opts) markers' items return $ (if isTightList items then vcat else vsep) contents <> blankline @@ -712,10 +756,13 @@ itemEndsWithTightList bs = -- | Convert bullet list item (list of blocks) to markdown. bulletListItemToMarkdown :: PandocMonad m => WriterOptions -> [Block] -> MD m (Doc Text) bulletListItemToMarkdown opts bs = do + variant <- asks envVariant let exts = writerExtensions opts contents <- blockListToMarkdown opts $ taskListItemToAscii exts bs let sps = T.replicate (writerTabStop opts - 2) " " - let start = literal $ "- " <> sps + let start = case variant of + Markua -> literal "* " + _ -> literal $ "- " <> sps -- remove trailing blank line if item ends with a tight list let contents' = if itemEndsWithTightList bs then chomp contents <> cr @@ -725,19 +772,22 @@ bulletListItemToMarkdown opts bs = do -- | Convert ordered list item (a list of blocks) to markdown. orderedListItemToMarkdown :: PandocMonad m => WriterOptions -- ^ options - -> Text -- ^ list item marker + -> Text -- ^ list item marker -> [Block] -- ^ list item (list of blocks) -> MD m (Doc Text) orderedListItemToMarkdown opts marker bs = do let exts = writerExtensions opts contents <- blockListToMarkdown opts $ taskListItemToAscii exts bs + variant <- asks envVariant let sps = case writerTabStop opts - T.length marker of n | n > 0 -> literal $ T.replicate n " " _ -> literal " " let ind = if isEnabled Ext_four_space_rule opts then writerTabStop opts else max (writerTabStop opts) (T.length marker + 1) - let start = literal marker <> sps + let start = case variant of + Markua -> literal marker <> " " + _ -> literal marker <> sps -- remove trailing blank line if item ends with a tight list let contents' = if itemEndsWithTightList bs then chomp contents <> cr @@ -756,7 +806,10 @@ definitionListItemToMarkdown opts (label, defs) = do then do let tabStop = writerTabStop opts variant <- asks envVariant - let leader = if variant == PlainText then " " else ": " + let leader = case variant of + PlainText -> " " + Markua -> ":" + _ -> ": " let sps = case writerTabStop opts - 3 of n | n > 0 -> literal $ T.replicate n " " _ -> literal " " @@ -827,6 +880,7 @@ blockListToMarkdown opts blocks = do isListBlock _ = False commentSep | variant == PlainText = Null + | variant == Markua = Null | isEnabled Ext_raw_html opts = RawBlock "html" "\n" | otherwise = RawBlock "markdown" " \n" mconcat <$> mapM (blockToMarkdown opts) (fixBlocks blocks) diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs index d299d31b2..0bf70e80e 100644 --- a/src/Text/Pandoc/Writers/Markdown/Inline.hs +++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs @@ -13,7 +13,8 @@ module Text.Pandoc.Writers.Markdown.Inline ( inlineListToMarkdown, linkAttributes, - attrsToMarkdown + attrsToMarkdown, + attrsToMarkua ) where import Control.Monad.Reader import Control.Monad.State.Strict @@ -95,6 +96,11 @@ escapeText opts = T.pack . go' . T.unpack , isAlphaNum x -> c : '_' : x : go xs _ -> c : go cs +-- Escape the escape character, as well as formatting pairs +escapeMarkuaString :: Text -> Text +escapeMarkuaString s = foldr (uncurry T.replace) s [("--","~-~-"), + ("**","~*~*"),("//","~/~/"),("^^","~^~^"),(",,","~,~,")] + attrsToMarkdown :: Attr -> Doc Text attrsToMarkdown attribs = braces $ hsep [attribId, attribClasses, attribKeys] where attribId = case attribs of @@ -116,9 +122,56 @@ attrsToMarkdown attribs = braces $ hsep [attribId, attribClasses, attribKeys] escAttrChar '\\' = literal "\\\\" escAttrChar c = literal $ T.singleton c +attrsToMarkua:: Attr -> Doc Text +attrsToMarkua attributes + | null list = empty + | otherwise = braces $ intercalateDocText list + where attrId = case attributes of + ("",_,_) -> [] + (i,_,_) -> [literal $ "id: " <> i] + -- all non explicit (key,value) attributes besides id are getting + -- a default class key to be Markua conform + attrClasses = case attributes of + (_,[],_) -> [] + (_,classes,_) -> map (escAttr . ("class: " <>)) + classes + attrKeyValues = case attributes of + (_,_,[]) -> [] + (_,_,keyvalues) -> map ((\(k,v) -> escAttr k + <> ": " <> escAttr v) . + preprocessKeyValues) keyvalues + escAttr = mconcat . map escAttrChar . T.unpack + escAttrChar '"' = literal "\"" + escAttrChar c = literal $ T.singleton c + + list = concat [attrId, attrClasses, attrKeyValues] + + -- if attribute key is alt, caption, title then content + -- gets wrapped inside quotes + -- attribute gets removed + preprocessKeyValues :: (Text, Text) -> (Text, Text) + preprocessKeyValues (key,value) + | key == "alt" || + key == "caption" || + key == "title" = (key, inquotes value) + | otherwise = (key,value) + intercalateDocText :: [Doc Text] -> Doc Text + intercalateDocText [] = empty + intercalateDocText [x] = x + intercalateDocText (x:xs) = x <> ", " <> (intercalateDocText xs) + +-- | Add a (key, value) pair to Pandoc attr type +addKeyValueToAttr :: Attr -> (Text,Text) -> Attr +addKeyValueToAttr (ident,classes,kvs) (key,value) + | not (T.null key) && not (T.null value) = (ident, + classes, + (key,value): kvs) + | otherwise = (ident,classes,kvs) + linkAttributes :: WriterOptions -> Attr -> Doc Text linkAttributes opts attr = - if (isEnabled Ext_link_attributes opts || isEnabled Ext_attributes opts) && attr /= nullAttr + if (isEnabled Ext_link_attributes opts || + isEnabled Ext_attributes opts) && attr /= nullAttr then attrsToMarkdown attr else empty @@ -283,6 +336,7 @@ inlineToMarkdown opts (Span attrs ils) = do _ -> id $ case variant of PlainText -> contents + Markua -> "`" <> contents <> "`" <> attrsToMarkua attrs _ | attrs == nullAttr -> contents | isEnabled Ext_bracketed_spans opts -> let attrs' = if attrs /= nullAttr @@ -396,60 +450,75 @@ inlineToMarkdown opts (Quoted DoubleQuote lst) = do then "“" <> contents <> "”" else "“" <> contents <> "”" inlineToMarkdown opts (Code attr str) = do + variant <- asks envVariant let tickGroups = filter (T.any (== '`')) $ T.group str let longest = maybe 0 maximum $ nonEmpty $ map T.length tickGroups let marker = T.replicate (longest + 1) "`" let spacer = if longest == 0 then "" else " " let attrsEnabled = isEnabled Ext_inline_code_attributes opts || isEnabled Ext_attributes opts - let attrs = if attrsEnabled && attr /= nullAttr - then attrsToMarkdown attr - else empty - variant <- asks envVariant + let attrs = case variant of + Markua -> attrsToMarkua attr + _ -> if attrsEnabled && attr /= nullAttr + then attrsToMarkdown attr + else empty case variant of PlainText -> return $ literal str _ -> return $ literal (marker <> spacer <> str <> spacer <> marker) <> attrs inlineToMarkdown opts (Str str) = do variant <- asks envVariant - let str' = (if writerPreferAscii opts - then toHtml5Entities - else id) . - (if isEnabled Ext_smart opts - then unsmartify opts - else id) . - (if variant == PlainText - then id - else escapeText opts) $ str + let str' = case variant of + Markua -> escapeMarkuaString str + _ -> (if writerPreferAscii opts + then toHtml5Entities + else id) . + (if isEnabled Ext_smart opts + then unsmartify opts + else id) . + (if variant == PlainText + then id + else escapeText opts) $ str return $ literal str' -inlineToMarkdown opts (Math InlineMath str) = - case writerHTMLMathMethod opts of - WebTeX url -> inlineToMarkdown opts - (Image nullAttr [Str str] (url <> urlEncode str, str)) - _ | isEnabled Ext_tex_math_dollars opts -> - return $ "$" <> literal str <> "$" - | isEnabled Ext_tex_math_single_backslash opts -> - return $ "\\(" <> literal str <> "\\)" - | isEnabled Ext_tex_math_double_backslash opts -> - return $ "\\\\(" <> literal str <> "\\\\)" - | otherwise -> do - variant <- asks envVariant - texMathToInlines InlineMath str >>= - inlineListToMarkdown opts . - (if variant == PlainText then makeMathPlainer else id) -inlineToMarkdown opts (Math DisplayMath str) = - case writerHTMLMathMethod opts of - WebTeX url -> (\x -> blankline <> x <> blankline) `fmap` - inlineToMarkdown opts (Image nullAttr [Str str] - (url <> urlEncode str, str)) - _ | isEnabled Ext_tex_math_dollars opts -> - return $ "$$" <> literal str <> "$$" - | isEnabled Ext_tex_math_single_backslash opts -> - return $ "\\[" <> literal str <> "\\]" - | isEnabled Ext_tex_math_double_backslash opts -> - return $ "\\\\[" <> literal str <> "\\\\]" - | otherwise -> (\x -> cr <> x <> cr) `fmap` - (texMathToInlines DisplayMath str >>= inlineListToMarkdown opts) +inlineToMarkdown opts (Math InlineMath str) = do + variant <- asks envVariant + case () of + _ | variant == Markua -> return $ "`" <> literal str <> "`" <> "$" + | otherwise -> case writerHTMLMathMethod opts of + WebTeX url -> inlineToMarkdown opts + (Image nullAttr [Str str] (url <> urlEncode str, str)) + _ | isEnabled Ext_tex_math_dollars opts -> + return $ "$" <> literal str <> "$" + | isEnabled Ext_tex_math_single_backslash opts -> + return $ "\\(" <> literal str <> "\\)" + | isEnabled Ext_tex_math_double_backslash opts -> + return $ "\\\\(" <> literal str <> "\\\\)" + | otherwise -> + texMathToInlines InlineMath str >>= + inlineListToMarkdown opts . + (if variant == PlainText then makeMathPlainer else id) + +inlineToMarkdown opts (Math DisplayMath str) = do + variant <- asks envVariant + case () of + _ | variant == Markua -> do + let attributes = attrsToMarkua (addKeyValueToAttr ("",[],[]) + ("format", "latex")) + return $ blankline <> attributes <> cr <> literal "```" <> cr + <> literal str <> cr <> literal "```" <> blankline + | otherwise -> case writerHTMLMathMethod opts of + WebTeX url -> (\x -> blankline <> x <> blankline) `fmap` + inlineToMarkdown opts (Image nullAttr [Str str] + (url <> urlEncode str, str)) + _ | isEnabled Ext_tex_math_dollars opts -> + return $ "$$" <> literal str <> "$$" + | isEnabled Ext_tex_math_single_backslash opts -> + return $ "\\[" <> literal str <> "\\]" + | isEnabled Ext_tex_math_double_backslash opts -> + return $ "\\\\[" <> literal str <> "\\\\]" + | otherwise -> (\x -> cr <> x <> cr) `fmap` + (texMathToInlines DisplayMath str >>= inlineListToMarkdown opts) + inlineToMarkdown opts il@(RawInline f str) = do let tickGroups = filter (T.any (== '`')) $ T.group str let numticks = 1 + maybe 0 maximum (nonEmpty (map T.length tickGroups)) @@ -469,6 +538,7 @@ inlineToMarkdown opts il@(RawInline f str) = do | f `elem` ["markdown", "markdown_github", "markdown_phpextra", "markdown_mmd", "markdown_strict"] -> return $ literal str + Markua -> renderEmpty _ | isEnabled Ext_raw_attribute opts -> rawAttribInline | f `elem` ["html", "html5", "html4"] , isEnabled Ext_raw_html opts @@ -563,6 +633,11 @@ inlineToMarkdown opts lnk@(Link attr@(ident,classes,kvs) txt (src, tit)) = do PlainText | useAuto -> return $ literal srcSuffix | otherwise -> return linktext + Markua + | T.null tit -> return $ result <> attrsToMarkua attr + | otherwise -> return $ result <> attrsToMarkua attributes + where result = "[" <> linktext <> "](" <> (literal src) <> ")" + attributes = addKeyValueToAttr attr ("title", tit) _ | useAuto -> return $ "<" <> literal srcSuffix <> ">" | useRefLinks -> let first = "[" <> linktext <> "]" @@ -594,9 +669,16 @@ inlineToMarkdown opts img@(Image attr alternate (source, tit)) then [Str ""] else alternate linkPart <- inlineToMarkdown opts (Link attr txt (source, tit)) + alt <- inlineListToMarkdown opts alternate + let attributes | variant == Markua = attrsToMarkua $ + addKeyValueToAttr (addKeyValueToAttr attr ("title", tit)) + ("alt", render (Just (writerColumns opts)) alt) + | otherwise = empty return $ case variant of - PlainText -> "[" <> linkPart <> "]" - _ -> "!" <> linkPart + PlainText -> "[" <> linkPart <> "]" + Markua -> cr <> attributes <> cr <> literal "![](" <> + literal source <> ")" <> cr + _ -> "!" <> linkPart inlineToMarkdown opts (Note contents) = do modify (\st -> st{ stNotes = contents : stNotes st }) st <- get diff --git a/src/Text/Pandoc/Writers/Markdown/Types.hs b/src/Text/Pandoc/Writers/Markdown/Types.hs index a1d0d14e4..060446811 100644 --- a/src/Text/Pandoc/Writers/Markdown/Types.hs +++ b/src/Text/Pandoc/Writers/Markdown/Types.hs @@ -45,7 +45,8 @@ data WriterEnv = WriterEnv { envInList :: Bool } data MarkdownVariant = - PlainText + Markua + | PlainText | Commonmark | Markdown deriving (Show, Eq) diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs index e03d94e85..450449946 100644 --- a/test/Tests/Old.hs +++ b/test/Tests/Old.hs @@ -228,6 +228,7 @@ tests pandocPath = , test' "reader" ["-f", "ipynb", "-t", "html"] "ipynb/rank.ipynb" "ipynb/rank.out.html" ] + , testGroup "markua" [ testGroup "writer" $ writerTests' "markua"] ] where test' = test pandocPath diff --git a/test/Tests/Writers/Markua.hs b/test/Tests/Writers/Markua.hs new file mode 100644 index 000000000..62239f3da --- /dev/null +++ b/test/Tests/Writers/Markua.hs @@ -0,0 +1,40 @@ +{-# LANGUAGE OverloadedStrings #-} +module Tests.Writers.Markua (tests) where + +import Test.Tasty +import Tests.Helpers +import Text.Pandoc +import Text.Pandoc.Arbitrary () +import Text.Pandoc.Builder + +{- + "my test" =: X =?> Y + +is shorthand for + + test html "my test" $ X =?> Y + +which is in turn shorthand for + + test html "my test" (X,Y) +-} + +infix 4 =: +(=:) :: (ToString a, ToPandoc a) + => String -> (a, String) -> TestTree +(=:) = test (purely (writeMarkua def) . toPandoc) + +tests :: [TestTree] +tests = [ testGroup "simple blurb/aside" + ["blurb" =: divWith ("",["blurb"],[]) (bulletList [para "blurb content"]) + =?> "B> * blurb content" + ,"aside" =: divWith ("",["aside"],[]) (bulletList [para "aside list"]) + =?> "A> * aside list" + ] + ,testGroup "multiclass blurb/aside" + ["blurb" =: divWith ("",["blurb", "otherclass"],[]) (bulletList [para "blurb content"]) + =?> "B> * blurb content" + ,"aside" =: divWith ("",["otherclass", "aside"],[]) (bulletList [para "aside list"]) + =?> "A> * aside list" + ] + ] diff --git a/test/tables.markua b/test/tables.markua new file mode 100644 index 000000000..b82264fd7 --- /dev/null +++ b/test/tables.markua @@ -0,0 +1,58 @@ +Simple table with caption: + +| Right | Left | Center | Default | +|------:|:-----|:------:|---------| +| 12 | 12 | 12 | 12 | +| 123 | 123 | 123 | 123 | +| 1 | 1 | 1 | 1 | + +Demonstration of simple table syntax. + +Simple table without caption: + +| Right | Left | Center | Default | +|------:|:-----|:------:|---------| +| 12 | 12 | 12 | 12 | +| 123 | 123 | 123 | 123 | +| 1 | 1 | 1 | 1 | + +Simple table indented two spaces: + +| Right | Left | Center | Default | +|------:|:-----|:------:|---------| +| 12 | 12 | 12 | 12 | +| 123 | 123 | 123 | 123 | +| 1 | 1 | 1 | 1 | + +Demonstration of simple table syntax. + +Multiline table with caption: + +| Centered Header | Left Aligned | Right Aligned | Default aligned | +|:---------------:|:-------------|--------------:|:------------------------------------------------------| +| First | row | 12.0 | Example of a row that spans multiple lines. | +| Second | row | 5.0 | Here’s another one. Note the blank line between rows. | + +Here’s the caption. It may span multiple lines. + +Multiline table without caption: + +| Centered Header | Left Aligned | Right Aligned | Default aligned | +|:---------------:|:-------------|--------------:|:------------------------------------------------------| +| First | row | 12.0 | Example of a row that spans multiple lines. | +| Second | row | 5.0 | Here’s another one. Note the blank line between rows. | + +Table without column headers: + +| | | | | +|----:|:----|:---:|----:| +| 12 | 12 | 12 | 12 | +| 123 | 123 | 123 | 123 | +| 1 | 1 | 1 | 1 | + +Multiline table without column headers: + +| | | | | +|:------:|:----|-----:|-------------------------------------------------------| +| First | row | 12.0 | Example of a row that spans multiple lines. | +| Second | row | 5.0 | Here’s another one. Note the blank line between rows. | diff --git a/test/test-pandoc.hs b/test/test-pandoc.hs index 476762aac..fcb157fb7 100644 --- a/test/test-pandoc.hs +++ b/test/test-pandoc.hs @@ -50,6 +50,7 @@ import qualified Tests.Writers.Powerpoint import qualified Tests.Writers.RST import qualified Tests.Writers.AnnotatedTable import qualified Tests.Writers.TEI +import qualified Tests.Writers.Markua import Text.Pandoc.Shared (inDirectory) tests :: FilePath -> TestTree @@ -72,6 +73,7 @@ tests pandocPath = testGroup "pandoc tests" , testGroup "Docx" Tests.Writers.Docx.tests , testGroup "RST" Tests.Writers.RST.tests , testGroup "TEI" Tests.Writers.TEI.tests + , testGroup "markua" Tests.Writers.Markua.tests , testGroup "Muse" Tests.Writers.Muse.tests , testGroup "FB2" Tests.Writers.FB2.tests , testGroup "PowerPoint" Tests.Writers.Powerpoint.tests diff --git a/test/writer.markua b/test/writer.markua new file mode 100644 index 000000000..1c5b44cc2 --- /dev/null +++ b/test/writer.markua @@ -0,0 +1,700 @@ +This is a set of tests for pandoc. Most of them are adapted from John Gruber’s +markdown test suite. + +* * * + +{id: headers} +# Headers + +{id: level-2-with-an-embedded-link} +## Level 2 with an [embedded link](/url) + +{id: level-3-with-emphasis} +### Level 3 with *emphasis* + +{id: level-4} +#### Level 4 + +{id: level-5} +##### Level 5 + +{id: level-1} +# Level 1 + +{id: level-2-with-emphasis} +## Level 2 with *emphasis* + +{id: level-3} +### Level 3 + +with no blank line + +{id: level-2} +## Level 2 + +with no blank line + +* * * + +{id: paragraphs} +# Paragraphs + +Here’s a regular paragraph. + +In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. +Because a hard-wrapped line in the middle of a paragraph looked like a list +item. + +Here’s one with a bullet. * criminey. + +There should be a hard line break +here. + +* * * + +{id: block-quotes} +# Block Quotes + +E-mail style: + +> This is a block quote. It is pretty short. + +> Code in a block quote: +> +> ``` +> sub status { +> print "working"; +> } +> ``` +> +> A list: +> +> 1. item one +> 2. item two +> +> Nested block quotes: +> +> > nested +> +> > nested + +This should not be a block quote: 2 > 1. + +And a following paragraph. + +* * * + +{id: code-blocks} +# Code Blocks + +Code: + +``` +---- (should be four hyphens) + +sub status { + print "working"; +} + +this code block is indented by one tab +``` + +And: + +``` + this code block is indented by two tabs + +These should not be escaped: \$ \\ \> \[ \{ +``` + +* * * + +{id: lists} +# Lists + +{id: unordered} +## Unordered + +Asterisks tight: + +* asterisk 1 +* asterisk 2 +* asterisk 3 + +Asterisks loose: + +* asterisk 1 + +* asterisk 2 + +* asterisk 3 + +Pluses tight: + +* Plus 1 +* Plus 2 +* Plus 3 + +Pluses loose: + +* Plus 1 + +* Plus 2 + +* Plus 3 + +Minuses tight: + +* Minus 1 +* Minus 2 +* Minus 3 + +Minuses loose: + +* Minus 1 + +* Minus 2 + +* Minus 3 + +{id: ordered} +## Ordered + +Tight: + +1. First +2. Second +3. Third + +and: + +1. One +2. Two +3. Three + +Loose using tabs: + +1. First + +2. Second + +3. Third + +and using spaces: + +1. One + +2. Two + +3. Three + +Multiple paragraphs: + +1. Item 1, graf one. + + Item 1. graf two. The quick brown fox jumped over the lazy dog’s back. + +2. Item 2. + +3. Item 3. + +{id: nested} +## Nested + +* Tab + * Tab + * Tab + +Here’s another: + +1. First +2. Second: + * Fee + * Fie + * Foe +3. Third + +Same thing but with paragraphs: + +1. First + +2. Second: + + * Fee + * Fie + * Foe + +3. Third + +{id: tabs-and-spaces} +## Tabs and spaces + +* this is a list item indented with tabs + +* this is a list item indented with spaces + + * this is an example list item indented with tabs + + * this is an example list item indented with spaces + +{id: fancy-list-markers} +## Fancy list markers + +2) begins with 2 + +3) and now 3 + + with a continuation + + iv. sublist with roman numerals, starting with 4 + v. more items + A) a subsublist + B) a subsublist + +Nesting: + +A. Upper Alpha + I. Upper Roman. + 6) Decimal start with 6 + c) Lower alpha with paren + +Autonumbering: + +1. Autonumber. +2. More. + 1. Nested. + +Should not be a list item: + +M.A. 2007 + +B. Williams + +* * * + +{id: definition-lists} +# Definition Lists + +Tight using spaces: + +apple +: red fruit + +orange +: orange fruit + +banana +: yellow fruit + +Tight using tabs: + +apple +: red fruit + +orange +: orange fruit + +banana +: yellow fruit + +Loose: + +apple + +: red fruit + +orange + +: orange fruit + +banana + +: yellow fruit + +Multiple blocks with italics: + +*apple* + +: red fruit + + contains seeds, crisp, pleasant to taste + +*orange* + +: orange fruit + + ``` + { orange code block } + ``` + + > orange block quote + +Multiple definitions, tight: + +apple +: red fruit +: computer + +orange +: orange fruit +: bank + +Multiple definitions, loose: + +apple + +: red fruit + +: computer + +orange + +: orange fruit + +: bank + +Blank line after term, indented marker, alternate markers: + +apple + +: red fruit + +: computer + +orange + +: orange fruit + + 1. sublist + 2. sublist + +{id: html-blocks} +# HTML Blocks + +Simple block on one line: + +foo + +And nested without indentation: + +foo + +bar + +Interpreted markdown in a table: + +This is *emphasized* +And this is **strong** +Here’s a simple block: + +foo + +This should be a code block, though: + +``` +
      + foo +
      +``` + +As should this: + +``` +
      foo
      +``` + +Now, nested: + +foo + +This should just be an HTML comment: + +Multiline: + +Code block: + +``` + +``` + +Just plain comment, with trailing spaces on the line: + +Code: + +``` +
      +``` + +Hr’s: + +* * * + +{id: inline-markup} +# Inline Markup + +This is *emphasized*, and so *is this*. + +This is **strong**, and so **is this**. + +An *[emphasized link](/url)*. + +***This is strong and em.*** + +So is ***this*** word. + +***This is strong and em.*** + +So is ***this*** word. + +This is code: `>`, `$`, `\`, `\$`, ``. + +~~This is *strikeout*.~~ + +Superscripts: a^bc^d a^*hello*^ a^hello there^. + +Subscripts: H~2~O, H~23~O, H~many of them~O. + +These should not be superscripts or subscripts, because of the unescaped spaces: +a^b c^d, a~b c~d. + +* * * + +{id: smart-quotes-ellipses-dashes} +# Smart quotes, ellipses, dashes + +"Hello," said the spider. "'Shelob' is my name." + +'A', 'B', and 'C' are letters. + +'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.' + +'He said, "I want to go."' Were you alive in the 70’s? + +Here is some quoted '`code`' and a "[quoted +link](http://example.com/?foo=1&bar=2)". + +Some dashes: one—two — three—four — five. + +Dashes between numbers: 5–7, 255–66, 1987–1999. + +Ellipses…and…and…. + +* * * + +{id: latex} +# LaTeX + +* +* `2+2=4`$ +* `x \in y`$ +* `\alpha \wedge \omega`$ +* `223`$ +* `p`$-Tree +* Here’s some display math: + + {format: latex} + ``` + \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} + ``` +* Here’s one that has a line break in it: `\alpha + \omega \times x^2`$. + +These shouldn’t be math: + +* To get the famous equation, write `$e = mc^2$`. +* $22,000 is a *lot* of money. So is $34,000. (It worked if "lot" is + emphasized.) +* Shoes ($20) and socks ($5). +* Escaped `$`: $73 *this should be emphasized* 23$. + +Here’s a LaTeX table: + +* * * + +{id: special-characters} +# Special Characters + +Here is some unicode: + +* I hat: Î +* o umlaut: ö +* section: § +* set membership: ∈ +* copyright: © + +AT&T has an ampersand in their name. + +AT&T is another way to write it. + +This & that. + +4 < 5. + +6 > 5. + +Backslash: \ + +Backtick: ` + +Asterisk: * + +Underscore: _ + +Left brace: { + +Right brace: } + +Left bracket: [ + +Right bracket: ] + +Left paren: ( + +Right paren: ) + +Greater-than: > + +Hash: # + +Period: . + +Bang: ! + +Plus: + + +Minus: - + +* * * + +{id: links} +# Links + +{id: explicit} +## Explicit + +Just a [URL](/url/). + +[URL and title](/url/){title: "title"}. + +[URL and title](/url/){title: "title preceded by two spaces"}. + +[URL and title](/url/){title: "title preceded by a tab"}. + +[URL and title](/url/){title: "title with "quotes" in it"} + +[URL and title](/url/){title: "title with single quotes"} + +[with_underscore](/url/with_underscore) + +[Email link](mailto:nobody@nowhere.net) + +[Empty](). + +{id: reference} +## Reference + +Foo [bar](/url/). + +With [embedded [brackets]](/url/). + +[b](/url/) by itself should be a link. + +Indented [once](/url). + +Indented [twice](/url). + +Indented [thrice](/url). + +This should [not][] be a link. + +``` +[not]: /url +``` + +Foo [bar](/url/){title: "Title with "quotes" inside"}. + +Foo [biz](/url/){title: "Title with "quote" inside"}. + +{id: with-ampersands} +## With ampersands + +Here’s a [link with an ampersand in the URL](http://example.com/?foo=1&bar=2). + +Here’s a link with an amersand in the link text: +[AT&T](http://att.com/){title: "AT&T"}. + +Here’s an [inline link](/script?foo=1&bar=2). + +Here’s an [inline link in pointy braces](/script?foo=1&bar=2). + +{id: autolinks} +## Autolinks + +With an ampersand: +[http:~/~/example.com/?foo=1&bar=2](http://example.com/?foo=1&bar=2){class: uri} + +* In a list? +* [http:~/~/example.com/](http://example.com/){class: uri} +* It should. + +An e-mail address: [nobody@nowhere.net](mailto:nobody@nowhere.net){class: email} + +> Blockquoted: [http:~/~/example.com/](http://example.com/){class: uri} + +Auto-links should not occur here: `` + +``` +or here: +``` + +* * * + +{id: images} +# Images + +From "Voyage dans la Lune" by Georges Melies (1902): + +{alt: "lalune", title: "Voyage dans la Lune"} +![](lalune.jpg) + +Here is a movie +{alt: "movie"} +![](movie.jpg) +icon. + +* * * + +{id: footnotes} +# Footnotes + +Here is a footnote reference,[^1] and another.[^2] This should *not* be a +footnote reference, because it contains a space.[^my note] Here is an inline +note.[^3] + +> Notes can go in quotes.[^4] + +1. And in list items.[^5] + +This paragraph should not be part of the note, as it is not indented. + +[^1]: Here is the footnote. It can go anywhere after the footnote reference. It + need not be placed at the end of the document. + +[^2]: Here’s the long note. This one contains multiple blocks. + + Subsequent blocks are indented to show that they belong to the footnote (as + with list items). + + ``` + { } + ``` + + If you want, you can indent every line, but you can also be lazy and just + indent the first line of each block. + +[^3]: This is *easier* to type. Inline notes may contain + [links](http://google.com) and `]` verbatim characters, as well as + [bracketed text]. + +[^4]: In quote. + +[^5]: In list. -- cgit v1.2.3 From 993222d2c9c94cbf51f06528b79ffddd56b9da46 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 19 Dec 2021 23:04:31 +0100 Subject: Custom writer: assign default Pandoc object to global PANDOC_DOCUMENT The default Pandoc object is now non-strict, i.e., only the parts of the document that are accessed will be marshaled to Lua. A special type is no longer necessary. This change also makes it possible to use the global variable with library functions such as `pandoc.utils.references`, or to inspect the document contents with `walk()`. --- src/Text/Pandoc/Lua/Global.hs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Text/Pandoc/Lua/Global.hs b/src/Text/Pandoc/Lua/Global.hs index c7b50a25f..cf82890c6 100644 --- a/src/Text/Pandoc/Lua/Global.hs +++ b/src/Text/Pandoc/Lua/Global.hs @@ -18,9 +18,10 @@ import HsLua as Lua import HsLua.Module.Version (pushVersion) import Paths_pandoc (version) import Text.Pandoc.Class.CommonState (CommonState) -import Text.Pandoc.Definition (Pandoc (Pandoc), pandocTypesVersion) +import Text.Pandoc.Definition (Pandoc, pandocTypesVersion) import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshal.CommonState (pushCommonState) +import Text.Pandoc.Lua.Marshal.Pandoc (pushPandoc) import Text.Pandoc.Lua.Marshal.ReaderOptions (pushReaderOptionsReadonly) import Text.Pandoc.Lua.Orphans () import Text.Pandoc.Options (ReaderOptions) @@ -52,7 +53,7 @@ setGlobal global = case global of pushVersion pandocTypesVersion Lua.setglobal "PANDOC_API_VERSION" PANDOC_DOCUMENT doc -> do - pushUD typePandocLazy doc + pushPandoc doc Lua.setglobal "PANDOC_DOCUMENT" PANDOC_READER_OPTIONS ropts -> do pushReaderOptionsReadonly ropts @@ -66,10 +67,3 @@ setGlobal global = case global of PANDOC_VERSION -> do pushVersion version Lua.setglobal "PANDOC_VERSION" - --- | Readonly and lazy pandoc objects. -typePandocLazy :: LuaError e => DocumentedType e Pandoc -typePandocLazy = deftype "Pandoc (lazy)" [] - [ readonly "meta" "document metadata" (push, \(Pandoc meta _) -> meta) - , readonly "blocks" "content blocks" (push, \(Pandoc _ blocks) -> blocks) - ] -- cgit v1.2.3 From cd2bffee1e4c0ca9c999bd37f81732664f9f107a Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 20 Dec 2021 09:28:38 +0100 Subject: Lua: use more natural representation for Reference values Omit `false` boolean values, push integers as numbers. --- src/Text/Pandoc/Lua/Marshal/Reference.hs | 18 ++++++++++++------ test/Tests/Lua/Module.hs | 2 +- test/lua/module/pandoc-utils.lua | 25 +++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/Text/Pandoc/Lua/Marshal/Reference.hs b/src/Text/Pandoc/Lua/Marshal/Reference.hs index 51501836f..ee297484e 100644 --- a/src/Text/Pandoc/Lua/Marshal/Reference.hs +++ b/src/Text/Pandoc/Lua/Marshal/Reference.hs @@ -55,14 +55,21 @@ pushName = pushAsTable , ("non-dropping-particle" , pushTextOrNil . nameNonDroppingParticle) , ("suffix" , pushTextOrNil . nameSuffix) , ("literal" , pushTextOrNil . nameLiteral) - , ("comma-suffix" , pushBool . nameCommaSuffix) - , ("static-ordering" , pushBool . nameStaticOrdering) + , ("comma-suffix" , pushBoolOrNil . nameCommaSuffix) + , ("static-ordering" , pushBoolOrNil . nameStaticOrdering) ] where pushTextOrNil = \case Nothing -> pushnil Just xs -> pushText xs +-- | Pushes a boolean, but uses @nil@ instead of @false@; table fields +-- are not set unless the value is true. +pushBoolOrNil :: Pusher e Bool +pushBoolOrNil = \case + False -> pushnil + True -> pushBool True + -- | Pushes a 'Variable' as string. pushVariable :: Pusher e Variable pushVariable = pushText . fromVariable @@ -80,14 +87,13 @@ pushVal = \case pushDate :: LuaError e => Pusher e Date pushDate = pushAsTable [ ("date-parts", pushPandocList pushDateParts . dateParts) - , ("circa", pushBool . dateCirca) + , ("circa", pushBoolOrNil . dateCirca) , ("season", maybe pushnil pushIntegral . dateSeason) , ("literal", maybe pushnil pushText . dateLiteral) ] where - -- date parts are integers, but we push them as strings, as meta - -- values can't handle integers yet. - pushDateParts (DateParts dp) = pushPandocList (pushString . show) dp + -- date parts are lists of Int values + pushDateParts (DateParts dp) = pushPandocList pushIntegral dp -- | Helper funtion to push an object as a table. pushAsTable :: LuaError e diff --git a/test/Tests/Lua/Module.hs b/test/Tests/Lua/Module.hs index 8be445f65..e4d1e8bd9 100644 --- a/test/Tests/Lua/Module.hs +++ b/test/Tests/Lua/Module.hs @@ -29,7 +29,7 @@ tests = ("lua" "module" "pandoc-path.lua") , testPandocLua "pandoc.types" ("lua" "module" "pandoc-types.lua") - , testPandocLua "pandoc.util" + , testPandocLua "pandoc.utils" ("lua" "module" "pandoc-utils.lua") ] diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua index 0c3831bb1..7a43e9286 100644 --- a/test/lua/module/pandoc-utils.lua +++ b/test/lua/module/pandoc-utils.lua @@ -62,6 +62,31 @@ return { end), }, + group 'references' { + test('gets references from doc', function () + local ref = { + ['author'] = { + {given = 'Max', family = 'Mustermann'} + }, + ['container-title'] = pandoc.Inlines('JOSS'), + ['id'] = 'test', + ['issued'] = {['date-parts'] = {{2021}}}, + ['title'] = pandoc.Inlines{ + pandoc.Quoted('DoubleQuote', 'Interesting'), + pandoc.Space(), + 'work' + }, + ['type'] = 'article-journal', + } + local nocite = pandoc.Cite( + '@test', + {pandoc.Citation('test', 'NormalCitation')} + ) + local doc = pandoc.Pandoc({}, {nocite = nocite, references = {ref}}) + assert.are_same({ref}, pandoc.utils.references(doc)) + end) + }, + group 'sha1' { test('hashing', function () local ref_hash = '0a0a9f2a6772942557ab5355d76af442f8f65e01' -- cgit v1.2.3 From c90802d7d85ba2ae98492701b30cc37bde757b83 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 21 Dec 2021 09:48:54 +0100 Subject: Lua: fix return types of `blocks_to_inlines`, `make_sections` Ensures the returned lists have the correct type (`Inlines` and `Blocks`, respectively). --- src/Text/Pandoc/Lua/Module/Utils.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 6d0130dc2..439a9a50b 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -57,7 +57,7 @@ documentedModule = Module "blocks" "" <#> optionalParameter (peekList peekInline) "list of inlines" "inline" "" - =#> functionResult (pushPandocList pushInline) "list of inlines" "" + =#> functionResult pushInlines "list of inlines" "" , defun "equals" ### liftPure2 (==) @@ -72,7 +72,7 @@ documentedModule = Module "integer or nil" "baselevel" "" <#> parameter (peekList peekBlock) "list of blocks" "blocks" "document blocks to process" - =#> functionResult (pushPandocList pushBlock) "list of Blocks" + =#> functionResult pushBlocks "list of Blocks" "processes blocks" , defun "normalize_date" -- cgit v1.2.3 From d7cab5198269fbbdbc40f54a2ad7aeb83fee619f Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 21 Dec 2021 09:40:23 +0100 Subject: Lua: add new library function `pandoc.utils.type`. The function behaves like the default `type` function from Lua's standard library, but is aware of pandoc userdata types. A typical use-case would be to determine the type of a metadata value. --- doc/lua-filters.md | 36 ++++++++++++++++++++++++++++++++- src/Text/Pandoc/Lua/Module/Utils.hs | 12 +++++++++++ test/lua/module/pandoc-utils.lua | 40 +++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 901fd6be8..e5ea90104 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -1863,7 +1863,8 @@ Fields: Column alignment and width specification for a single table column. -This is a pair with the following components: +This is a pair, i.e., a plain table, with the following +components: 1. cell alignment ([Alignment]). 2. table column width, as a fraction of the total table width @@ -3507,6 +3508,39 @@ Usage: -- create normal table block again table = pandoc.utils.from_simple_table(simple) +### type {#pandoc.utils.type} + +`type (value)` + +Pandoc-friendly version of Lua's default `type` function, +returning the type of a value. This function works with all types +listed in section [Lua type reference][], except if noted +otherwise. + +The function works by checking the metafield `__name`. If the +argument has a string-valued metafield `__name`, then it returns +that string. Otherwise it behaves just like the normal `type` +function. + +Parameters: + +`value` +: any Lua value + +Returns: + +- type of the given value (string) + +Usage: + + -- Prints one of 'string', 'boolean', 'Inlines', 'Blocks', + -- 'table', and 'nil', corresponding to the Haskell constructors + -- MetaString, MetaBool, MetaInlines, MetaBlocks, MetaMap, + -- and an unset value, respectively. + function Meta (meta) + print('type of metavalue `author`:', pandoc.utils.type(meta.author)) + end + # Module pandoc.mediabag The `pandoc.mediabag` module allows accessing pandoc's media diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 439a9a50b..c1bb42410 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -21,6 +21,7 @@ import Control.Applicative ((<|>)) import Control.Monad ((<$!>)) import Data.Data (showConstr, toConstr) import Data.Default (def) +import Data.Maybe (fromMaybe) import Data.Version (Version) import HsLua as Lua import HsLua.Class.Peekable (PeekError) @@ -145,6 +146,17 @@ documentedModule = Module <#> parameter peekTable "Block" "tbl" "a table" =#> functionResult pushSimpleTable "SimpleTable" "SimpleTable object" #? "Converts a table into an old/simple table." + + , defun "type" + ### (\idx -> getmetafield idx "__name" >>= \case + TypeString -> fromMaybe mempty <$> tostring top + _ -> ltype idx >>= typename) + <#> parameter pure "any" "object" "" + =#> functionResult pushByteString "string" "type of the given value" + #? ("Pandoc-friendly version of Lua's default `type` function, " <> + "returning the type of a value. If the argument has a " <> + "string-valued metafield `__name`, then it gives that string. " <> + "Otherwise it behaves just like the normal `type` function.") ] } diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua index 7a43e9286..104adfe4c 100644 --- a/test/lua/module/pandoc-utils.lua +++ b/test/lua/module/pandoc-utils.lua @@ -116,6 +116,46 @@ return { end) }, + group 'type' { + test('nil', function () + assert.are_equal(utils.type(nil), 'nil') + end), + test('boolean', function () + assert.are_equal(utils.type(true), 'boolean') + assert.are_equal(utils.type(false), 'boolean') + end), + test('number', function () + assert.are_equal(utils.type(5), 'number') + assert.are_equal(utils.type(-3.02), 'number') + end), + test('string', function () + assert.are_equal(utils.type(''), 'string') + assert.are_equal(utils.type('asdf'), 'string') + end), + test('plain table', function () + assert.are_equal(utils.type({}), 'table') + end), + test('List', function () + assert.are_equal(utils.type(pandoc.List{}), 'List') + end), + test('Inline', function () + assert.are_equal(utils.type(pandoc.Str 'a'), 'Inline') + assert.are_equal(utils.type(pandoc.Emph 'emphasized'), 'Inline') + end), + test('Inlines', function () + assert.are_equal(utils.type(pandoc.Inlines{pandoc.Str 'a'}), 'Inlines') + assert.are_equal(utils.type(pandoc.Inlines{pandoc.Emph 'b'}), 'Inlines') + end), + test('Blocks', function () + assert.are_equal(utils.type(pandoc.Para 'a'), 'Block') + assert.are_equal(utils.type(pandoc.CodeBlock 'true'), 'Block') + end), + test('Inlines', function () + assert.are_equal(utils.type(pandoc.Blocks{'a'}), 'Blocks') + assert.are_equal(utils.type(pandoc.Blocks{pandoc.CodeBlock 'b'}), 'Blocks') + end), + }, + group 'to_simple_table' { test('convertes Table', function () function simple_cell (blocks) -- cgit v1.2.3 From 8734057dff33cbfad45c81847a1efd371380d5c4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Dec 2021 09:55:17 -0800 Subject: Put sourcepos attribute on header, not enclosing div... with `-f commonmark+sourcepos`. Closes #7769. --- cabal.project | 6 ++++++ stack.yaml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/cabal.project b/cabal.project index bc617093c..8e56ca0a4 100644 --- a/cabal.project +++ b/cabal.project @@ -13,6 +13,12 @@ source-repository-package location: https://github.com/jgm/texmath.git tag: 46df85d747f4f233157d3476683264232a4f58be +source-repository-package + type: git + location: https://github.com/jgm/commonmark-hs + tag: 4d460b206e0b1872376db86cadf7a4567eeddaed + subdir: commonmark-pandoc + source-repository-package type: git location: https://github.com/jgm/ipynb.git diff --git a/stack.yaml b/stack.yaml index a76508782..702e3a780 100644 --- a/stack.yaml +++ b/stack.yaml @@ -39,6 +39,9 @@ extra-deps: commit: 00246af10885c2ad4413ace4f69a7e6c88297a08 - git: https://github.com/pandoc/pandoc-lua-marshal commit: 45e53d9dce37d20f8e30e0d297a43c5b4c4a6831 +- git: https://github.com/jgm/commonmark-hs + commit: 4d460b206e0b1872376db86cadf7a4567eeddaed + subdir: commonmark-pandoc ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.10 -- cgit v1.2.3 From 1c389bf6b6236cefcadac3c2eefe62eb6c884863 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 21 Dec 2021 17:12:56 +0100 Subject: Lua: add tests for pandoc.utils.equals --- test/lua/module/pandoc-utils.lua | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua index 104adfe4c..db363ebe6 100644 --- a/test/lua/module/pandoc-utils.lua +++ b/test/lua/module/pandoc-utils.lua @@ -39,6 +39,46 @@ return { end) }, + group 'equals' { + test('compares Pandoc elements', function () + assert.is_truthy( + utils.equals(pandoc.Pandoc{'foo'}, pandoc.Pandoc{'foo'}) + ) + end), + test('compares Block elements', function () + assert.is_truthy( + utils.equals(pandoc.Plain{'foo'}, pandoc.Plain{'foo'}) + ) + assert.is_falsy( + utils.equals(pandoc.Para{'foo'}, pandoc.Plain{'foo'}) + ) + end), + test('compares Inline elements', function () + assert.is_truthy( + utils.equals(pandoc.Emph{'foo'}, pandoc.Emph{'foo'}) + ) + assert.is_falsy( + utils.equals(pandoc.Emph{'foo'}, pandoc.Strong{'foo'}) + ) + end), + test('compares Inline with Block elements', function () + assert.is_falsy( + utils.equals(pandoc.Emph{'foo'}, pandoc.Plain{'foo'}) + ) + assert.is_falsy( + utils.equals(pandoc.Para{'foo'}, pandoc.Strong{'foo'}) + ) + end), + test('compares Pandoc with Block elements', function () + assert.is_falsy( + utils.equals(pandoc.Pandoc{'foo'}, pandoc.Plain{'foo'}) + ) + assert.is_falsy( + utils.equals(pandoc.Para{'foo'}, pandoc.Pandoc{'foo'}) + ) + end), + }, + group 'make_sections' { test('sanity check', function () local blks = { -- cgit v1.2.3 From 17a32a99a5eefadc5ebe66d441b6c4f7a0d2f438 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 21 Dec 2021 18:53:37 +0100 Subject: Lua: simplify and deprecate function `pandoc.utils.equals` The function is no longer required for element comparisons; it is now an alias for the `==` operator. --- cabal.project | 2 +- doc/lua-filters.md | 36 +++++++++++++++++++++--------------- src/Text/Pandoc/Lua/Module/Utils.hs | 6 +++--- stack.yaml | 2 +- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/cabal.project b/cabal.project index 8e56ca0a4..f0365d5da 100644 --- a/cabal.project +++ b/cabal.project @@ -6,7 +6,7 @@ constraints: aeson >= 2.0.1.0 source-repository-package type: git location: https://github.com/pandoc/pandoc-lua-marshal - tag: 45e53d9dce37d20f8e30e0d297a43c5b4c4a6831 + tag: f81ec19006cc4d0476f199d1fb913bac4af0a0d8 source-repository-package type: git diff --git a/doc/lua-filters.md b/doc/lua-filters.md index e5ea90104..af3342826 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -831,8 +831,8 @@ Usage: Pandoc document Values of this type can be created with the -[`pandoc.Pandoc`](#pandoc.pandoc) constructor. Object equality is -determined via [`pandoc.utils.equals`]. +[`pandoc.Pandoc`](#pandoc.pandoc) constructor. Pandoc values are +equal in Lua if and only if they are equal in Haskell. `blocks` : document content ([List] of [Blocks]) @@ -876,8 +876,8 @@ Meta information on a document; string-indexed collection of [MetaValues]. Values of this type can be created with the -[`pandoc.Meta`](#pandoc.meta) constructor. Object equality is -determined via [`pandoc.utils.equals`]. +[`pandoc.Meta`](#pandoc.meta) constructor. Meta values are equal +in Lua if and only if they are equal in Haskell. ## MetaValue {#type-metavalue} @@ -909,7 +909,8 @@ or `pandoc.Blocks`. ## Block {#type-block} -Object equality is determined via [`pandoc.utils.equals`]. +Block values are equal in Lua if and only if they are equal in +Haskell. ### Common methods @@ -1292,8 +1293,8 @@ Usage: ## Inline {#type-inline} -Object equality is determined by checking the Haskell -representation for equality. +Inline values are equal in Lua if and only if they are equal in +Haskell. ### Common methods @@ -1741,7 +1742,7 @@ Result: Usage: - -- returns `pandoc.Inlines{pandoc.SmallCaps('SPQR)}` + -- returns `pandoc.Inlines{pandoc.SmallCaps('SPQR')}` return pandoc.Inlines{pandoc.Emph('spqr')}:walk { Str = function (s) return string.upper(s.text) end, Emph = function (e) return pandoc.SmallCaps(e.content) end, @@ -1766,7 +1767,8 @@ This also works when using the `attr` setter: local span = pandoc.Span 'text' span.attr = {id = 'text', class = 'a b', other_attribute = '1'} -Object equality is determined via [`pandoc.utils.equals`]. +Attr values are equal in Lua if and only if they are equal in +Haskell. Fields: @@ -1784,6 +1786,9 @@ Fields: List of key/value pairs. Values can be accessed by using keys as indices to the list table. +Attributes values are equal in Lua if and only if they are equal +in Haskell. + ### Caption {#type-caption} The caption of a table, with an optional short caption. @@ -1835,7 +1840,8 @@ Single citation entry Values of this type can be created with the [`pandoc.Citation`](#pandoc.citation) constructor. -Object equality is determined via [`pandoc.utils.equals`]. +Citation values are equal in Lua if and only if they are equal in +Haskell. Fields: @@ -2115,7 +2121,7 @@ Values of this type can be created with the `must_be_at_least(actual, expected [, error_message])` Raise an error message if the actual version is older than the -expected version; does nothing if actual is equal to or newer +expected version; does nothing if `actual` is equal to or newer than the expected version. Parameters: @@ -2173,7 +2179,6 @@ Usage: [TableFoot]: #type-tablefoot [TableHead]: #type-tablehead [Version]: #type-version -[`pandoc.utils.equals`]: #pandoc.utils.equals # Module text @@ -3308,12 +3313,13 @@ Test equality of AST elements. Elements in Lua are considered equal if and only if the objects obtained by unmarshaling are equal. +**This function is deprecated.** Use the normal Lua `==` equality +operator instead. + Parameters: `element1`, `element2`: -: Objects to be compared. Acceptable input types are [Pandoc], - [Meta], [MetaValue], [Block], [Inline], [Attr], - [ListAttributes], and [Citation]. +: Objects to be compared (any type) Returns: diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index c1bb42410..24fd3402e 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -61,9 +61,9 @@ documentedModule = Module =#> functionResult pushInlines "list of inlines" "" , defun "equals" - ### liftPure2 (==) - <#> parameter peekAstElement "AST element" "elem1" "" - <#> parameter peekAstElement "AST element" "elem2" "" + ### equal + <#> parameter pure "AST element" "elem1" "" + <#> parameter pure "AST element" "elem2" "" =#> functionResult pushBool "boolean" "true iff elem1 == elem2" , defun "make_sections" diff --git a/stack.yaml b/stack.yaml index 702e3a780..492f39cf0 100644 --- a/stack.yaml +++ b/stack.yaml @@ -38,7 +38,7 @@ extra-deps: - git: https://github.com/jgm/ipynb.git commit: 00246af10885c2ad4413ace4f69a7e6c88297a08 - git: https://github.com/pandoc/pandoc-lua-marshal - commit: 45e53d9dce37d20f8e30e0d297a43c5b4c4a6831 + commit: f81ec19006cc4d0476f199d1fb913bac4af0a0d8 - git: https://github.com/jgm/commonmark-hs commit: 4d460b206e0b1872376db86cadf7a4567eeddaed subdir: commonmark-pandoc -- cgit v1.2.3 From edb04a78dba3490dc28ef68d5133b0220a0426fa Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 21 Dec 2021 21:25:16 +0100 Subject: Lua tests: add more tests for `pandoc.utils.stringify`. --- test/lua/module/pandoc-utils.lua | 47 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua index db363ebe6..73886346c 100644 --- a/test/lua/module/pandoc-utils.lua +++ b/test/lua/module/pandoc-utils.lua @@ -135,7 +135,7 @@ return { }, group 'stringify' { - test('inlines', function () + test('Inline', function () local inline = pandoc.Emph{ pandoc.Str 'Cogito', pandoc.Space(), @@ -144,7 +144,50 @@ return { pandoc.Str 'sum.', } assert.are_equal('Cogito ergo sum.', utils.stringify(inline)) - end) + end), + test('Block', function () + local block = pandoc.Para{ + pandoc.Str 'Make', + pandoc.Space(), + pandoc.Str 'it', + pandoc.Space(), + pandoc.Str 'so.', + } + assert.are_equal('Make it so.', utils.stringify(block)) + end), + test('boolean', function () + assert.are_equal('true', utils.stringify(true)) + assert.are_equal('false', utils.stringify(false)) + end), + test('number', function () + assert.are_equal('5', utils.stringify(5)) + assert.are_equal('23.23', utils.stringify(23.23)) + end), + test('Attr', function () + local attr = pandoc.Attr('foo', {'bar'}, {a = 'b'}) + assert.are_equal('', utils.stringify(attr)) + end), + test('List', function () + local list = pandoc.List{pandoc.Str 'a', pandoc.Blocks('b')} + assert.are_equal('ab', utils.stringify(list)) + end), + test('Blocks', function () + local blocks = pandoc.Blocks{pandoc.Para 'a', pandoc.Header(1, 'b')} + assert.are_equal('ab', utils.stringify(blocks)) + end), + test('Inlines', function () + local inlines = pandoc.Inlines{pandoc.Str 'a', pandoc.Subscript('b')} + assert.are_equal('ab', utils.stringify(inlines)) + end), + test('Meta', function () + local meta = pandoc.Meta{ + a = pandoc.Inlines 'a text', + b = 'movie', + c = pandoc.List{pandoc.Inlines{pandoc.Str '!'}} + } + -- nested MetaString values are not stringified. + assert.are_equal('a text!', utils.stringify(meta)) + end), }, group 'to_roman_numeral' { -- cgit v1.2.3 From 0bdf37315766eb4b785002ffaf38cdb724628e7a Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 21 Dec 2021 21:50:13 +0100 Subject: Lua: simplify code of pandoc.utils.stringify Minor behavior change: plain strings nested in tables are now included in the result string. --- src/Text/Pandoc/Lua/Module/Utils.hs | 62 +++++++++++++------------------------ test/lua/module/pandoc-utils.lua | 7 ++--- 2 files changed, 25 insertions(+), 44 deletions(-) diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 24fd3402e..eabb2b532 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -24,7 +24,6 @@ import Data.Default (def) import Data.Maybe (fromMaybe) import Data.Version (Version) import HsLua as Lua -import HsLua.Class.Peekable (PeekError) import HsLua.Module.Version (peekVersionFuzzy, pushVersion) import Text.Pandoc.Citeproc (getReferences) import Text.Pandoc.Definition @@ -35,6 +34,7 @@ import Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua)) import qualified Data.Digest.Pure.SHA as SHA import qualified Data.ByteString.Lazy as BSL +import qualified Data.Map as Map import qualified Data.Text as T import qualified Text.Pandoc.Builder as B import qualified Text.Pandoc.Filter.JSON as JSONFilter @@ -126,8 +126,8 @@ documentedModule = Module =#> functionResult pushPandoc "Pandoc" "filtered document" , defun "stringify" - ### unPandocLua . stringify - <#> parameter peekAstElement "AST element" "elem" "some pandoc AST element" + ### stringify + <#> parameter pure "AST element" "elem" "some pandoc AST element" =#> functionResult pushText "string" "stringified element" , defun "from_simple_table" @@ -172,43 +172,25 @@ sha1 = defun "sha1" -- | Convert pandoc structure to a string with formatting removed. -- Footnotes are skipped (since we don't want their contents in link -- labels). -stringify :: AstElement -> PandocLua T.Text -stringify el = return $ case el of - PandocElement pd -> Shared.stringify pd - InlineElement i -> Shared.stringify i - BlockElement b -> Shared.stringify b - MetaElement m -> Shared.stringify m - CitationElement c -> Shared.stringify c - MetaValueElement m -> stringifyMetaValue m - _ -> mempty - -stringifyMetaValue :: MetaValue -> T.Text -stringifyMetaValue mv = case mv of - MetaBool b -> T.toLower $ T.pack (show b) - MetaString s -> s - _ -> Shared.stringify mv - -data AstElement - = PandocElement Pandoc - | MetaElement Meta - | BlockElement Block - | InlineElement Inline - | MetaValueElement MetaValue - | AttrElement Attr - | ListAttributesElement ListAttributes - | CitationElement Citation - deriving (Eq, Show) - -peekAstElement :: PeekError e => Peeker e AstElement -peekAstElement = retrieving "pandoc AST element" . choice - [ (fmap PandocElement . peekPandoc) - , (fmap InlineElement . peekInline) - , (fmap BlockElement . peekBlock) - , (fmap MetaValueElement . peekMetaValue) - , (fmap AttrElement . peekAttr) - , (fmap ListAttributesElement . peekListAttributes) - , (fmap MetaElement . peekMeta) - ] +stringify :: LuaError e => StackIndex -> LuaE e T.Text +stringify idx = forcePeek . retrieving "stringifyable element" $ + choice + [ (fmap Shared.stringify . peekPandoc) + , (fmap Shared.stringify . peekInline) + , (fmap Shared.stringify . peekBlock) + , (fmap Shared.stringify . peekCitation) + , (fmap stringifyMetaValue . peekMetaValue) + , (fmap (const "") . peekAttr) + , (fmap (const "") . peekListAttributes) + ] idx + where + stringifyMetaValue :: MetaValue -> T.Text + stringifyMetaValue mv = case mv of + MetaBool b -> T.toLower $ T.pack (show b) + MetaString s -> s + MetaList xs -> mconcat $ map stringifyMetaValue xs + MetaMap m -> mconcat $ map (stringifyMetaValue . snd) (Map.toList m) + _ -> Shared.stringify mv -- | Converts an old/simple table into a normal table block element. from_simple_table :: SimpleTable -> LuaE PandocError NumResults diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua index 73886346c..0475e96ec 100644 --- a/test/lua/module/pandoc-utils.lua +++ b/test/lua/module/pandoc-utils.lua @@ -181,12 +181,11 @@ return { end), test('Meta', function () local meta = pandoc.Meta{ - a = pandoc.Inlines 'a text', - b = 'movie', + a = pandoc.Inlines 'funny and ', + b = 'good movie', c = pandoc.List{pandoc.Inlines{pandoc.Str '!'}} } - -- nested MetaString values are not stringified. - assert.are_equal('a text!', utils.stringify(meta)) + assert.are_equal('funny and good movie!', utils.stringify(meta)) end), }, -- cgit v1.2.3 From 7a9832166e36f77402d5e0259647e9f5c7ba4e58 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 20 Dec 2021 13:44:03 -0800 Subject: Add text wrapping to HTML output. Previously the HTML writer was exceptional in not being sensitive to the `--wrap` option. With this change `--wrap` now works for HTML. The default (as with other formats) is automatic wrapping to 72 columns. A new internal module, T.P.Writers.Blaze, exports `layoutMarkup`. This converts a blaze Html structure into a doclayout Doc Text. In addition, we now add a line break between an `img` tag and the associated `figcaption`. Note: Output is never wrapped in `writeHtmlStringForEPUB`. This accords with previous behavior since previously the HTML writer was insensitive to `--wrap` settings. There's no real need to wrap HTML inside a zipped container. Note that the contents of script, textarea, and pre tags are always laid out with the `flush` combinator, so that unwanted spaces won't be introduced if these occur in an indented context in a template. Closes #7764. --- MANUAL.txt | 1 - pandoc.cabal | 1 + src/Text/Pandoc/Writers/Blaze.hs | 139 +++++++++++++++++++++++++++++++++++++++ src/Text/Pandoc/Writers/HTML.hs | 107 ++++++++++++++++-------------- test/command/262.md | 3 +- test/command/2649.md | 9 ++- test/command/3523.md | 8 ++- test/command/3534.md | 15 +++-- test/command/3577.md | 9 ++- test/command/3701.md | 3 +- test/command/3752.md | 18 +++-- test/command/3840.md | 3 +- test/command/4012.md | 3 +- test/command/4186.md | 3 +- test/command/4235.md | 10 ++- test/command/4639.md | 2 +- test/command/4677.md | 3 +- test/command/4743.md | 4 +- test/command/512.md | 3 +- test/command/5121.md | 3 +- test/command/5627.md | 12 ++-- test/command/5642.md | 3 +- test/command/5650.md | 6 +- test/command/5655.md | 10 ++- test/command/5813.md | 3 +- test/command/5986.md | 3 +- test/command/6739.md | 3 +- test/command/7006.md | 9 ++- test/command/7416.md | 6 +- test/command/7568.md | 7 +- test/command/7713.md | 3 +- test/command/853.md | 6 +- test/command/video-audio.md | 10 ++- test/ipynb/rank.out.html | 12 ++-- test/s5-basic.html | 3 +- test/s5-fancy.html | 7 +- test/s5-fragment.html | 3 +- test/s5-inserts.html | 3 +- test/tables.html5 | 6 +- test/writer.html4 | 85 ++++++++++++++++-------- test/writer.html5 | 100 +++++++++++++++++++--------- 41 files changed, 475 insertions(+), 172 deletions(-) create mode 100644 src/Text/Pandoc/Writers/Blaze.hs diff --git a/MANUAL.txt b/MANUAL.txt index 2e6d53ca6..008a0e657 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -790,7 +790,6 @@ header when requesting a document from a URL: preserve the wrapping from the source document (that is, where there are nonsemantic newlines in the source, there will be nonsemantic newlines in the output as well). - Automatic wrapping does not currently work in HTML output. In `ipynb` output, this option affects wrapping of the contents of markdown cells. diff --git a/pandoc.cabal b/pandoc.cabal index 3cad5bce7..dc6a92a5f 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -688,6 +688,7 @@ library Text.Pandoc.Writers.Markdown.Types, Text.Pandoc.Writers.Markdown.Inline, Text.Pandoc.Writers.Roff, + Text.Pandoc.Writers.Blaze, Text.Pandoc.Writers.Powerpoint.Presentation, Text.Pandoc.Writers.Powerpoint.Output, Text.Pandoc.Lua.ErrorConversion, diff --git a/src/Text/Pandoc/Writers/Blaze.hs b/src/Text/Pandoc/Writers/Blaze.hs new file mode 100644 index 000000000..0e3bd0f98 --- /dev/null +++ b/src/Text/Pandoc/Writers/Blaze.hs @@ -0,0 +1,139 @@ +{-# LANGUAGE OverloadedStrings #-} +{- | + Module : Text.Pandoc.Writers.Shared + Copyright : Copyright (C) 2021 John MacFarlane + License : GNU GPL, version 2 or above + + Maintainer : John MacFarlane + Stability : alpha + Portability : portable + +Render blaze-html Html to DocLayout document (so it can be wrapped). +-} +module Text.Pandoc.Writers.Blaze ( layoutMarkup ) +where +import Text.Blaze +import qualified Data.ByteString as S +import Data.List (isInfixOf) +import Data.Text.Encoding (decodeUtf8) +import qualified Data.Text as T +import Data.Text (Text) +import Text.DocLayout hiding (Text, Empty) +import Text.Blaze.Internal (ChoiceString(..), getText, MarkupM(..)) + +layoutMarkup :: Markup -> Doc T.Text +layoutMarkup = go True mempty + where + go :: Bool -> Doc T.Text -> MarkupM b -> Doc T.Text + go wrap attrs (Parent _ open close content) = + let open' = getText open + in literal open' + <> attrs + <> char '>' + <> (if allowsWrap open' + then go wrap mempty content + else flush $ go False mempty content) + <> literal (getText close) + go wrap attrs (CustomParent tag content) = + char '<' + <> fromChoiceString wrap tag + <> attrs + <> char '>' + <> go wrap mempty content + <> literal " fromChoiceString wrap tag + <> char '>' + go _wrap attrs (Leaf _ begin end _) = + literal (getText begin) + <> attrs + <> literal (getText end) + go wrap attrs (CustomLeaf tag close _) = + char '<' + <> fromChoiceString wrap tag + <> attrs + <> (if close then literal " />" else char '>') + go wrap attrs (AddAttribute rawkey _ value h) = + go wrap + (space' wrap + <> literal (getText rawkey) + <> char '=' + <> doubleQuotes (fromChoiceString wrap value) + <> attrs) h + go wrap attrs (AddCustomAttribute key value h) = + go wrap + (space' wrap + <> fromChoiceString wrap key + <> char '=' + <> doubleQuotes (fromChoiceString wrap value) + <> attrs) h + go wrap _ (Content content _) = fromChoiceString wrap content + go wrap _ (Comment comment _) = + literal "" + go wrap attrs (Append h1 h2) = go wrap attrs h1 <> go wrap attrs h2 + go _ _ (Empty _) = mempty + space' wrap = if wrap then space else char ' ' + +allowsWrap :: T.Text -> Bool +allowsWrap t = + not (t == " ChoiceString -- ^ String to render + -> Doc Text -- ^ Resulting builder +fromChoiceString wrap (Static s) = withWrap wrap $ getText s +fromChoiceString wrap (String s) = withWrap wrap $ + escapeMarkupEntities $ T.pack s +fromChoiceString wrap (Text s) = withWrap wrap $ escapeMarkupEntities s +fromChoiceString wrap (ByteString s) = withWrap wrap $ decodeUtf8 s +fromChoiceString _wrap (PreEscaped x) = -- don't wrap! + case x of + String s -> literal $ T.pack s + Text s -> literal s + s -> fromChoiceString False s +fromChoiceString wrap (External x) = case x of + -- Check that the sequence " if " if " if " fromChoiceString wrap s +fromChoiceString wrap (AppendChoiceString x y) = + fromChoiceString wrap x <> fromChoiceString wrap y +fromChoiceString _ EmptyChoiceString = mempty + +withWrap :: Bool -> Text -> Doc Text +withWrap wrap + | wrap = mconcat . toChunks + | otherwise = literal + +toChunks :: Text -> [Doc Text] +toChunks = map toDoc . T.groupBy sameStatus + where + toDoc t = + if T.any (== ' ') t + then space + else if T.any (== '\n') t + then cr + else literal t + sameStatus c d = + (c == ' ' && d == ' ') || + (c == '\n' && d == '\n') || + (c /= ' ' && d /= ' ' && c /= '\n' && d /= '\n') + + +-- | Escape predefined XML entities in a text value +-- +escapeMarkupEntities :: Text -- ^ Text to escape + -> Text -- ^ Resulting Doc +escapeMarkupEntities = T.concatMap escape + where + escape :: Char -> Text + escape '<' = "<" + escape '>' = ">" + escape '&' = "&" + escape '"' = """ + escape '\'' = "'" + escape x = T.singleton x diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 247cddfc9..664aeffb6 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -39,7 +39,7 @@ import qualified Data.Text as T import qualified Data.Text.Lazy as TL import Network.URI (URI (..), parseURIReference) import Numeric (showHex) -import Text.DocLayout (render, literal) +import Text.DocLayout (render, literal, Doc) import Text.Blaze.Internal (MarkupM (Empty), customLeaf, customParent) import Text.DocTemplates (FromContext (lookupContext), Context (..)) import Text.Blaze.Html hiding (contents) @@ -70,6 +70,7 @@ import Text.Pandoc.Class.PandocPure (runPure) import Text.Pandoc.Error import Text.Pandoc.Logging import Text.Pandoc.MIME (mediaCategory) +import Text.Pandoc.Writers.Blaze (layoutMarkup) import Text.TeXMath import Text.XML.Light (elChildren, unode, unqual) import qualified Text.XML.Light as XML @@ -160,7 +161,8 @@ writeHtmlStringForEPUB :: PandocMonad m -> m Text writeHtmlStringForEPUB version o = writeHtmlString' defaultWriterState{ stHtml5 = version == EPUB3, - stEPUBVersion = Just version } o + stEPUBVersion = Just version } + o{ writerWrapText = WrapNone } -- | Convert Pandoc document to Reveal JS HTML slide show. writeRevealJs :: PandocMonad m @@ -207,17 +209,23 @@ writeHtmlString' :: PandocMonad m => WriterState -> WriterOptions -> Pandoc -> m Text writeHtmlString' st opts d = do (body, context) <- evalStateT (pandocToHtml opts d) st + let colwidth = case writerWrapText opts of + WrapAuto -> Just (writerColumns opts) + _ -> Nothing (if writerPreferAscii opts then toEntities else id) <$> case writerTemplate opts of - Nothing -> return $ renderHtml' body + Nothing -> return $ + case colwidth of + Nothing -> renderHtml' body -- optimization, skip layout + Just cols -> render (Just cols) $ layoutMarkup body Just tpl -> do -- warn if empty lang when (isNothing (getField "lang" context :: Maybe Text)) $ report NoLangSpecified -- check for empty pagetitle - context' <- + (context' :: Context Text) <- case getField "pagetitle" context of Just (s :: Text) | not (T.null s) -> return context _ -> do @@ -228,9 +236,9 @@ writeHtmlString' st opts d = do Just [] -> "Untitled" Just (x:_) -> takeBaseName $ T.unpack x report $ NoTitleElement fallback - return $ resetField "pagetitle" fallback context - return $ render Nothing $ renderTemplate tpl - (defField "body" (renderHtml' body) context') + return $ resetField "pagetitle" (literal fallback) context + return $ render colwidth $ renderTemplate tpl + (defField "body" (layoutMarkup body) context') writeHtml' :: PandocMonad m => WriterState -> WriterOptions -> Pandoc -> m Html writeHtml' st opts d = @@ -252,13 +260,13 @@ pandocToHtml opts (Pandoc meta blocks) = do let slideLevel = fromMaybe (getSlideLevel blocks) $ writerSlideLevel opts modify $ \st -> st{ stSlideLevel = slideLevel } metadata <- metaToContext opts - (fmap (literal . renderHtml') . blockListToHtml opts) - (fmap (literal . renderHtml') . inlineListToHtml opts) + (fmap layoutMarkup . blockListToHtml opts) + (fmap layoutMarkup . inlineListToHtml opts) meta let stringifyHTML = escapeStringForXML . stringify - let authsMeta = map stringifyHTML $ docAuthors meta + let authsMeta = map (literal . stringifyHTML) $ docAuthors meta let dateMeta = stringifyHTML $ docDate meta - let descriptionMeta = escapeStringForXML $ + let descriptionMeta = literal $ escapeStringForXML $ lookupMetaString "description" meta slideVariant <- gets stSlideVariant let sects = adjustNumbers opts $ @@ -267,7 +275,7 @@ pandocToHtml opts (Pandoc meta blocks) = do then blocks else prepSlides slideLevel blocks toc <- if writerTableOfContents opts && slideVariant /= S5Slides - then fmap renderHtml' <$> tableOfContents opts sects + then fmap layoutMarkup <$> tableOfContents opts sects else return Nothing blocks' <- blockListToHtml opts sects notes <- do @@ -281,7 +289,7 @@ pandocToHtml opts (Pandoc meta blocks) = do return notes st <- get let thebody = blocks' >> notes - let math = case writerHTMLMathMethod opts of + let math = layoutMarkup $ case writerHTMLMathMethod opts of MathJax url | slideVariant /= RevealJsSlides -> -- mathjax is handled via a special plugin in revealjs @@ -298,7 +306,7 @@ pandocToHtml opts (Pandoc meta blocks) = do nl opts let katexFlushLeft = case lookupContext "classoption" metadata of - Just clsops | "fleqn" `elem` (clsops :: [Text]) -> "true" + Just clsops | "fleqn" `elem` (clsops :: [Doc Text]) -> "true" _ -> "false" H.script $ text $ T.unlines [ "document.addEventListener(\"DOMContentLoaded\", function () {" @@ -324,15 +332,16 @@ pandocToHtml opts (Pandoc meta blocks) = do Just s | not (stHtml5 st) -> H.script ! A.type_ "text/javascript" $ preEscapedString - ("/* T.unpack s <> "/*]]>*/\n") | otherwise -> mempty Nothing -> mempty let mCss :: Maybe [Text] = lookupContext "css" metadata - let context = (if stHighlighting st + let context :: Context Text + context = (if stHighlighting st then case writerHighlightStyle opts of Just sty -> defField "highlighting-css" - (T.pack $ styleToCss sty) + (literal $ T.pack $ styleToCss sty) Nothing -> id else id) . (if stCsl st @@ -342,15 +351,15 @@ pandocToHtml opts (Pandoc meta blocks) = do Just 0 -> id Just n -> defField "csl-entry-spacing" - (tshow n <> "em")) + (literal $ tshow n <> "em")) else id) . (if stMath st - then defField "math" (renderHtml' math) + then defField "math" math else id) . (case writerHTMLMathMethod opts of MathJax u -> defField "mathjax" True . defField "mathjaxurl" - (T.takeWhile (/='?') u) + (literal $ T.takeWhile (/='?') u) _ -> defField "mathjax" False) . (case writerHTMLMathMethod opts of PlainMath -> defField "displaymath-css" True @@ -361,11 +370,12 @@ pandocToHtml opts (Pandoc meta blocks) = do -- template can't distinguish False/undefined defField "controls" True . defField "controlsTutorial" True . - defField "controlsLayout" ("bottom-right" :: Text) . - defField "controlsBackArrows" ("faded" :: Text) . + defField "controlsLayout" + ("bottom-right" :: Doc Text) . + defField "controlsBackArrows" ("faded" :: Doc Text) . defField "progress" True . defField "slideNumber" False . - defField "showSlideNumber" ("all" :: Text) . + defField "showSlideNumber" ("all" :: Doc Text) . defField "hashOneBasedIndex" False . defField "hash" True . defField "respondToHashChanges" True . @@ -377,7 +387,7 @@ pandocToHtml opts (Pandoc meta blocks) = do defField "touch" True . defField "loop" False . defField "rtl" False . - defField "navigationMode" ("default" :: Text) . + defField "navigationMode" ("default" :: Doc Text) . defField "shuffle" False . defField "fragments" True . defField "fragmentInURL" True . @@ -385,22 +395,22 @@ pandocToHtml opts (Pandoc meta blocks) = do defField "help" True . defField "pause" True . defField "showNotes" False . - defField "autoPlayMedia" ("null" :: Text) . - defField "preloadIframes" ("null" :: Text) . - defField "autoSlide" ("0" :: Text) . + defField "autoPlayMedia" ("null" :: Doc Text) . + defField "preloadIframes" ("null" :: Doc Text) . + defField "autoSlide" ("0" :: Doc Text) . defField "autoSlideStoppable" True . - defField "autoSlideMethod" ("null" :: Text) . - defField "defaultTiming" ("null" :: Text) . + defField "autoSlideMethod" ("null" :: Doc Text) . + defField "defaultTiming" ("null" :: Doc Text) . defField "mouseWheel" False . - defField "display" ("block" :: Text) . + defField "display" ("block" :: Doc Text) . defField "hideInactiveCursor" True . - defField "hideCursorTime" ("5000" :: Text) . + defField "hideCursorTime" ("5000" :: Doc Text) . defField "previewLinks" False . - defField "transition" ("slide" :: Text) . - defField "transitionSpeed" ("default" :: Text) . - defField "backgroundTransition" ("fade" :: Text) . - defField "viewDistance" ("3" :: Text) . - defField "mobileViewDistance" ("2" :: Text) + defField "transition" ("slide" :: Doc Text) . + defField "transitionSpeed" ("default" :: Doc Text) . + defField "backgroundTransition" ("fade" :: Doc Text) . + defField "viewDistance" ("3" :: Doc Text) . + defField "mobileViewDistance" ("2" :: Doc Text) else id) . defField "document-css" (isNothing mCss && slideVariant == NoSlides) . defField "quotes" (stQuotes st) . @@ -410,18 +420,18 @@ pandocToHtml opts (Pandoc meta blocks) = do maybe id (defField "toc") toc . maybe id (defField "table-of-contents") toc . defField "author-meta" authsMeta . - maybe id (defField "date-meta") + maybe id (defField "date-meta" . literal) (normalizeDate dateMeta) . defField "description-meta" descriptionMeta . defField "pagetitle" - (stringifyHTML . docTitle $ meta) . - defField "idprefix" (writerIdentifierPrefix opts) . + (literal . stringifyHTML . docTitle $ meta) . + defField "idprefix" (literal $ writerIdentifierPrefix opts) . -- these should maybe be set in pandoc.hs defField "slidy-url" - ("https://www.w3.org/Talks/Tools/Slidy2" :: Text) . - defField "slideous-url" ("slideous" :: Text) . - defField "revealjs-url" ("https://unpkg.com/reveal.js@^4/" :: Text) $ - defField "s5-url" ("s5/default" :: Text) . + ("https://www.w3.org/Talks/Tools/Slidy2" :: Doc Text) . + defField "slideous-url" ("slideous" :: Doc Text) . + defField "revealjs-url" ("https://unpkg.com/reveal.js@^4/" :: Doc Text) $ + defField "s5-url" ("s5/default" :: Doc Text) . defField "html5" (stHtml5 st) $ metadata return (thebody, context) @@ -705,12 +715,11 @@ figure opts attr@(_, _, attrList) txt (s,tit) = do img <- inlineToHtml opts (Image attr alt (s,tit)) capt <- if null txt then return mempty - else tocapt `fmap` inlineListToHtml opts txt + else (nl opts <>) . tocapt <$> inlineListToHtml opts txt + let inner = mconcat [nl opts, img, capt, nl opts] return $ if html5 - then H5.figure $ mconcat - [nl opts, img, capt, nl opts] - else H.div ! A.class_ "figure" $ mconcat - [nl opts, img, nl opts, capt, nl opts] + then H5.figure inner + else H.div ! A.class_ "figure" $ inner adjustNumbers :: WriterOptions -> [Block] -> [Block] @@ -1332,7 +1341,7 @@ inlineToHtml opts inline = do Space -> return $ strToHtml " " SoftBreak -> return $ case writerWrapText opts of WrapNone -> preEscapedText " " - WrapAuto -> preEscapedText " " + WrapAuto -> " " WrapPreserve -> preEscapedText "\n" LineBreak -> return $ do if html5 then H5.br else H.br diff --git a/test/command/262.md b/test/command/262.md index bda2acb35..61af20ede 100644 --- a/test/command/262.md +++ b/test/command/262.md @@ -5,7 +5,8 @@ .. _hello: .. _goodbye: example.com ^D -

      hello and goodbye

      +

      hello and goodbye

      ``` ``` diff --git a/test/command/2649.md b/test/command/2649.md index 52ae16ce4..4ab059ea0 100644 --- a/test/command/2649.md +++ b/test/command/2649.md @@ -90,17 +90,20 @@

      1

      -

      Sébastien Loeb

      +

      Sébastien +Loeb

      78

      2

      -

      Sébastien Ogier

      +

      Sébastien +Ogier

      38

      10

      -

      Hannu Mikkola

      +

      Hannu +Mikkola

      18

      diff --git a/test/command/3523.md b/test/command/3523.md index cb0089489..c3574943c 100644 --- a/test/command/3523.md +++ b/test/command/3523.md @@ -19,8 +19,12 @@ \end{document} ^D
      -

      Das Recht hat kein Dasein für sich, sein Wesen vielmehr ist das Leben des Menschen selbst, von einer besonderen Seite angesehen.

      -

      Das Recht hat kein Dasein für sich, sein Wesen vielmehr ist das Leben des Menschen selbst, von einer besonderen Seite angesehen.

      +

      Das Recht hat kein Dasein für sich, sein Wesen vielmehr +ist das Leben des Menschen selbst, von einer besonderen Seite +angesehen.

      +

      Das Recht hat kein Dasein für sich, sein Wesen vielmehr +ist das Leben des Menschen selbst, von einer besonderen Seite +angesehen.

      • hey

      • hey

      • diff --git a/test/command/3534.md b/test/command/3534.md index 8692007d2..42dca9207 100644 --- a/test/command/3534.md +++ b/test/command/3534.md @@ -2,7 +2,9 @@ % pandoc -f latex -t html I want to explain the interface of \lstinline[language=Java]{public class MyClass}. ^D -

        I want to explain the interface of public class MyClass.

        +

        I want to explain the interface of public class +MyClass.

        ``` @@ -10,7 +12,8 @@ I want to explain the interface of \lstinline[language=Java]{public class MyClas % pandoc -f latex -t html I want to explain the interface of \lstinline{public class MyClass}. ^D -

        I want to explain the interface of public class MyClass.

        +

        I want to explain the interface of public class +MyClass.

        ``` @@ -43,7 +46,9 @@ I want to explain the interface of \lstinline[language=Java]{public class MyClas % pandoc -f latex -t html I want to explain the interface of \mintinline{java}{public class MyClass}. ^D -

        I want to explain the interface of public class MyClass.

        +

        I want to explain the interface of public class +MyClass.

        ``` @@ -51,7 +56,9 @@ I want to explain the interface of \mintinline{java}{public class MyClass}. % pandoc -f latex -t html I want to explain the interface of \mintinline{java}|public class MyClass|. ^D -

        I want to explain the interface of public class MyClass.

        +

        I want to explain the interface of public class +MyClass.

        ``` diff --git a/test/command/3577.md b/test/command/3577.md index 2f415146d..2caeb7c11 100644 --- a/test/command/3577.md +++ b/test/command/3577.md @@ -16,10 +16,12 @@ \end{figure} ^D
        -Caption 1 +Caption 1 +
        -Caption 2 +Caption 2 +
        ``` ``` @@ -30,6 +32,7 @@ \end{figure} ^D
        -Caption 3 +Caption 3 +
        ``` diff --git a/test/command/3701.md b/test/command/3701.md index 01e438639..bd70fae59 100644 --- a/test/command/3701.md +++ b/test/command/3701.md @@ -55,6 +55,7 @@ ^D

        a

        a

        -

        a A a

        +

        a A a

        a

        ``` diff --git a/test/command/3752.md b/test/command/3752.md index 863e3f2d4..7db581cfe 100644 --- a/test/command/3752.md +++ b/test/command/3752.md @@ -32,11 +32,14 @@ A spider: [spider] ^D

        Chapter one

        A spider: spider

        -

        Another spider: another spider

        +

        Another spider: another
+spider

        The moon: moon

        Link to spider picture.

        -

        URL left alone: manual.

        -

        Absolute path left alone: absolute.

        +

        URL left alone: manual.

        +

        Absolute path left alone: absolute.

        Link to fragment: chapter two.

        Empty path: empty.

        Chapter two

        @@ -48,11 +51,14 @@ A spider: [spider] ^D

        Chapter one

        A spider: spider

        -

        Another spider: another spider

        +

        Another spider: another
+spider

        The moon: moon

        Link to spider picture.

        -

        URL left alone: manual.

        -

        Absolute path left alone: absolute.

        +

        URL left alone: manual.

        +

        Absolute path left alone: absolute.

        Link to fragment: chapter two.

        Empty path: empty.

        Chapter two

        diff --git a/test/command/3840.md b/test/command/3840.md index ceb1d1e51..a0dd314d3 100644 --- a/test/command/3840.md +++ b/test/command/3840.md @@ -2,7 +2,8 @@ % pandoc [@Alhazen1572-qk, V.9]: "competentius est" ^D -

        [@Alhazen1572-qk, V.9]: “competentius est”

        +

        [@Alhazen1572-qk, +V.9]: “competentius est”

        ``` ``` diff --git a/test/command/4012.md b/test/command/4012.md index 9e32692d6..26e971d4e 100644 --- a/test/command/4012.md +++ b/test/command/4012.md @@ -4,5 +4,6 @@ [image]: http://example.com/image.jpg {height=35mm} ^D -

        image

        +

        ``` diff --git a/test/command/4186.md b/test/command/4186.md index 90ac1271b..b2a2bd6e9 100644 --- a/test/command/4186.md +++ b/test/command/4186.md @@ -57,7 +57,8 @@ Outside all lists.
      This belongs to the outer list element, and is aligned accordingly, since the NAME attribute is not indented deeply enough. It is not enough for the BEGIN alone to be aligned deeply if the block is meant to have a NAME.
       
      -

      Still in the shallower list element since the preceding example block forced the deeper list element to terminate.

      +

      Still in the shallower list element since the preceding example block +forced the deeper list element to terminate.

      Outside all lists.

      ``` diff --git a/test/command/4235.md b/test/command/4235.md index 4f2644dd6..5b534b6d7 100644 --- a/test/command/4235.md +++ b/test/command/4235.md @@ -2,11 +2,15 @@ % pandoc --id-prefix=foo This.^[Has a footnote.] ^D -

      This.1

      -
      +

      This.1

      +

        -
      1. Has a footnote.↩︎

      2. +
      3. Has a footnote.↩︎

      ``` diff --git a/test/command/4639.md b/test/command/4639.md index c35df1749..31ac3a5d9 100644 --- a/test/command/4639.md +++ b/test/command/4639.md @@ -5,6 +5,6 @@ \end{equation} ^D

      \[\begin{equation} - E=mc^2 +E=mc^2 \end{equation}\]

      ``` diff --git a/test/command/4677.md b/test/command/4677.md index 2694624b9..64c436005 100644 --- a/test/command/4677.md +++ b/test/command/4677.md @@ -3,6 +3,7 @@ ![Caption](img.png){#img:1} ^D
      -Caption +Caption +
      ``` diff --git a/test/command/4743.md b/test/command/4743.md index 582540736..a75ec1078 100644 --- a/test/command/4743.md +++ b/test/command/4743.md @@ -41,5 +41,7 @@ My:thumbsup:emoji:heart: My:thumbsup:emoji:heart:x :hearts: xyz ^D

      0️⃣ header

      -

      My👍emoji❤️x ♥️ xyz

      +

      My👍emoji❤️x ♥️ xyz

      ``` diff --git a/test/command/512.md b/test/command/512.md index b95921309..21b3ea9a7 100644 --- a/test/command/512.md +++ b/test/command/512.md @@ -8,7 +8,8 @@ __ link1_ __ link2_ ^D -

      click here or click here

      +

      click here or click here

      ``` Multiple indirection: diff --git a/test/command/5121.md b/test/command/5121.md index 1ee6bda77..f1b972fb4 100644 --- a/test/command/5121.md +++ b/test/command/5121.md @@ -5,7 +5,8 @@ ## Header 2 ^D
      -My caption +My caption +
      ## Header 2 diff --git a/test/command/5627.md b/test/command/5627.md index 9910e76c5..dde4c99d6 100644 --- a/test/command/5627.md +++ b/test/command/5627.md @@ -20,8 +20,10 @@ Something
    1. Two -->something<!--
    2. Three
    -
    --><!--<script>alert('Escaped!')</script>
    -
    Something
    +
    --><!--<script>alert('Escaped!')</script>
    +
    Something
    ``` ``` @@ -46,8 +48,10 @@ Something
  • -->something<!--
  • bye -->something else<!--
  • -
    --><!--<script>alert('Escaped!')</script>
    -
    Something
    +
    --><!--<script>alert('Escaped!')</script>
    +
    Something
    ``` ``` diff --git a/test/command/5642.md b/test/command/5642.md index cd60df812..120a88ada 100644 --- a/test/command/5642.md +++ b/test/command/5642.md @@ -3,6 +3,7 @@ ![test](foo){aria-describedby="barbaz"} ^D
    -test +test +
    ``` diff --git a/test/command/5650.md b/test/command/5650.md index a2dd215bc..1e96aeaa4 100644 --- a/test/command/5650.md +++ b/test/command/5650.md @@ -5,7 +5,8 @@ a b ``` ^D -
    a
    +
    a
     b
    ```` @@ -16,7 +17,8 @@ a b ``` ^D -
    a
    +
    a
     b
    ```` diff --git a/test/command/5655.md b/test/command/5655.md index 692009562..72ad46e5e 100644 --- a/test/command/5655.md +++ b/test/command/5655.md @@ -2,13 +2,19 @@ % pandoc --webtex $T_n={n+1 \choose 2}$ ^D -

    T_n={n+1 \choose 2}

    +

    ```` ```` % pandoc --webtex $$T_n={n+1 \choose 2}$$ ^D -

    T_n={n+1 \choose 2}

    +

    ```` diff --git a/test/command/5813.md b/test/command/5813.md index 927a161ed..51f774524 100644 --- a/test/command/5813.md +++ b/test/command/5813.md @@ -2,5 +2,6 @@ % pandoc -f gfm ### Jekyll Plugins & Gems :gem: ^D -

    Jekyll Plugins & Gems 💎

    +

    Jekyll Plugins & Gems 💎

    ``` diff --git a/test/command/5986.md b/test/command/5986.md index c181e33ad..aaa1e6568 100644 --- a/test/command/5986.md +++ b/test/command/5986.md @@ -6,7 +6,8 @@

    diff --git a/test/command/6739.md b/test/command/6739.md index 7c9ed24a2..ff2d4bc75 100644 --- a/test/command/6739.md +++ b/test/command/6739.md @@ -4,7 +4,8 @@ * `--argA | --argB` This item has a pipe character ^D
      -
    • --argument This item does not have a pipe character
    • +
    • --argument This item does not have a pipe +character
    • --argA | --argB This item has a pipe character
    ``` diff --git a/test/command/7006.md b/test/command/7006.md index 7e2215cdf..22aaf84ad 100644 --- a/test/command/7006.md +++ b/test/command/7006.md @@ -6,13 +6,16 @@ Test.[^fn] ![Caption.](/image.jpg) ^D -

    Test.1

    -
    +

    Test.1

    +

    1. Foo:

      -Caption. +Caption. +
      ↩︎
    diff --git a/test/command/7416.md b/test/command/7416.md index 2f9577f10..d440725ab 100644 --- a/test/command/7416.md +++ b/test/command/7416.md @@ -4,7 +4,8 @@ ^D
    -alt
    caption
    +alt +
    caption
    ``` @@ -14,6 +15,7 @@ ^D
    -caption +caption +
    ``` diff --git a/test/command/7568.md b/test/command/7568.md index 42f1e37b1..487da0861 100644 --- a/test/command/7568.md +++ b/test/command/7568.md @@ -7,5 +7,10 @@ holds a useful spot. .. _Labyrinth Lord\: Revised Edition: https://www.drivethrurpg.com/product/64332/Labyrinth-Lord-Revised-Edition ^D -

    While Labyrinth Lord: Revised Edition (LLRE; PDF and POD) has been criticized for not being a completely faithful retro-clone of the Moldvay/Cook/Marsh Basic/Expert D&D rules (B/X), I think it still holds a useful spot.

    +

    While Labyrinth +Lord: Revised Edition (LLRE; PDF and POD) has been criticized for +not being a completely faithful retro-clone of the Moldvay/Cook/Marsh +Basic/Expert D&D rules (B/X), I think it still holds a useful +spot.

    ``` diff --git a/test/command/7713.md b/test/command/7713.md index d42dcd9b8..851cb4729 100644 --- a/test/command/7713.md +++ b/test/command/7713.md @@ -21,7 +21,8 @@ -cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc +cccccccccc cccccccccc cccccccccc cccccccccc cccccccccc +cccccccccc diff --git a/test/command/853.md b/test/command/853.md index 54eb416a9..bcc3b4654 100644 --- a/test/command/853.md +++ b/test/command/853.md @@ -7,11 +7,13 @@ Here is a citation reference: [CIT2002]_. .. [CIT2002] This is the citation. It's just like a footnote, except the label is textual. ^D -

    Here is a citation reference: [CIT2002].

    +

    Here is a citation reference: [CIT2002].

    CIT2002
    -

    This is the citation. It's just like a footnote, except the label is textual.

    +

    This is the citation. It's just like a footnote, except the label +is textual.

    diff --git a/test/command/video-audio.md b/test/command/video-audio.md index 451b614d8..4fbd58db3 100644 --- a/test/command/video-audio.md +++ b/test/command/video-audio.md @@ -10,9 +10,13 @@ ![](./test.jpg) ^D -

    -

    -

    +

    +

    +

    ``` diff --git a/test/ipynb/rank.out.html b/test/ipynb/rank.out.html index eb5176509..a82fe8bbc 100644 --- a/test/ipynb/rank.out.html +++ b/test/ipynb/rank.out.html @@ -1,8 +1,12 @@ -
    -
    import matplotlib.pyplot as plt
    +
    +
    import matplotlib.pyplot as plt
    -
    -
    fig, ax = plt.subplots(figsize=(1, 1), dpi=4)
    +
    +
    fig, ax = plt.subplots(figsize=(1, 1), dpi=4)
     ax.imshow([[0, 1], [2, 3]]);

    you should see this when converting from ipynb to html instead of the image below.

    diff --git a/test/s5-basic.html b/test/s5-basic.html index 7440b575b..3a225da83 100644 --- a/test/s5-basic.html +++ b/test/s5-basic.html @@ -56,7 +56,8 @@

    Math

      -
    • $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
    • +
    • $\frac{d}{dx}f(x)=\lim_{h\to +0}\frac{f(x+h)-f(x)}{h}$
    diff --git a/test/s5-fancy.html b/test/s5-fancy.html index f5c41e561..00b25e80c 100644 --- a/test/s5-fancy.html +++ b/test/s5-fancy.html @@ -28,7 +28,9 @@ - +
    @@ -56,7 +58,8 @@

    Math

      -
    • \(\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\)
    • +
    • \(\frac{d}{dx}f(x)=\lim_{h\to +0}\frac{f(x+h)-f(x)}{h}\)
    diff --git a/test/s5-fragment.html b/test/s5-fragment.html index 81c578d25..1a8d4839d 100644 --- a/test/s5-fragment.html +++ b/test/s5-fragment.html @@ -5,5 +5,6 @@

    Math

      -
    • $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
    • +
    • $\frac{d}{dx}f(x)=\lim_{h\to +0}\frac{f(x+h)-f(x)}{h}$
    diff --git a/test/s5-inserts.html b/test/s5-inserts.html index 1df9dd018..04dfc134a 100644 --- a/test/s5-inserts.html +++ b/test/s5-inserts.html @@ -35,7 +35,8 @@ STUFF INSERTED

    Math

      -
    • $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
    • +
    • $\frac{d}{dx}f(x)=\lim_{h\to +0}\frac{f(x+h)-f(x)}{h}$
    STUFF INSERTED diff --git a/test/tables.html5 b/test/tables.html5 index 533d2fd25..b3ee0ec79 100644 --- a/test/tables.html5 +++ b/test/tables.html5 @@ -121,7 +121,8 @@ Second row 5.0 -Here’s another one. Note the blank line between rows. +Here’s another one. Note the blank line between +rows. @@ -152,7 +153,8 @@ Second row 5.0 -Here’s another one. Note the blank line between rows. +Here’s another one. Note the blank line between +rows. diff --git a/test/writer.html4 b/test/writer.html4 index 257d86ddb..e2adcf5bc 100644 --- a/test/writer.html4 +++ b/test/writer.html4 @@ -156,10 +156,12 @@

    Anonymous

    July 17, 2006

    -

    This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.

    +

    This is a set of tests for pandoc. Most of them are adapted from John +Gruber’s markdown test suite.


    Headers

    - +

    Level 3 with emphasis

    Level 4

    Level 5
    @@ -172,7 +174,9 @@

    Paragraphs

    Here’s a regular paragraph.

    -

    In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.

    +

    In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. +Because a hard-wrapped line in the middle of a paragraph looked like a list +item.

    Here’s one with a bullet. * criminey.

    There should be a hard line break
    here.

    @@ -283,7 +287,8 @@ These should not be escaped: \$ \\ \> \[ \{

    Multiple paragraphs:

    1. Item 1, graf one.

      -

      Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.

    2. +

      Item 1. graf two. The quick brown fox jumped over the lazy dog’s +back.

    3. Item 2.

    4. Item 3.

    @@ -540,18 +545,22 @@ Blah

    So is this word.

    This is strong and em.

    So is this word.

    -

    This is code: >, $, \, \$, <html>.

    +

    This is code: >, $, \, +\$, <html>.

    This is strikeout.

    -

    Superscripts: abcd ahello ahello there.

    +

    Superscripts: abcd ahello +ahello there.

    Subscripts: H2O, H23O, Hmany of themO.

    -

    These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.

    +

    These should not be superscripts or subscripts, because of the unescaped +spaces: a^b c^d, a~b c~d.


    Smart quotes, ellipses, dashes

    “Hello,” said the spider. “‘Shelob’ is my name.”

    ‘A’, ‘B’, and ‘C’ are letters.

    ‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’

    ‘He said, “I want to go.”’ Were you alive in the 70’s?

    -

    Here is some quoted ‘code’ and a “quoted link”.

    +

    Here is some quoted ‘code’ and a “quoted link”.

    Some dashes: one—two — three—four — five.

    Dashes between numbers: 5–7, 255–66, 1987–1999.

    Ellipses…and…and….

    @@ -564,13 +573,16 @@ Blah
  • α ∧ ω
  • 223
  • p-Tree
  • -
  • Here’s some display math: $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
  • -
  • Here’s one that has a line break in it: α + ω × x2.
  • +
  • Here’s some display math: $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
  • +
  • Here’s one that has a line break in it: α + ω × x2.
  • These shouldn’t be math:

    • To get the famous equation, write $e = mc^2$.
    • -
    • $22,000 is a lot of money. So is $34,000. (It worked if “lot” is emphasized.)
    • +
    • $22,000 is a lot of money. So is $34,000. (It worked if “lot” is +emphasized.)
    • Shoes ($20) and socks ($5).
    • Escaped $: $73 this should be emphasized 23$.
    @@ -613,7 +625,8 @@ Blah

    URL and title.

    URL and title.

    URL and title.

    -

    URL and title

    +

    URL and +title

    URL and title

    with_underscore

    Email link

    @@ -630,22 +643,29 @@ Blah

    Foo bar.

    Foo biz.

    With ampersands

    -

    Here’s a link with an ampersand in the URL.

    -

    Here’s a link with an amersand in the link text: AT&T.

    +

    Here’s a link with an ampersand +in the URL.

    +

    Here’s a link with an amersand in the link text: AT&T.

    Here’s an inline link.

    -

    Here’s an inline link in pointy braces.

    +

    Here’s an inline link in pointy +braces.

    -

    With an ampersand: http://example.com/?foo=1&bar=2

    +

    With an ampersand: http://example.com/?foo=1&bar=2

    -

    An e-mail address:

    +

    An e-mail address: nobody@nowhere.net

    -

    Blockquoted: http://example.com/

    +

    Blockquoted: http://example.com/

    -

    Auto-links should not occur here: <http://example.com/>

    +

    Auto-links should not occur here: +<http://example.com/>

    or here: <http://example.com/>

    Images

    @@ -657,23 +677,36 @@ Blah

    Here is a movie movie icon.


    Footnotes

    -

    Here is a footnote reference,1 and another.2 This should not be a footnote reference, because it contains a space.[^my note] Here is an inline note.3

    +

    Here is a footnote reference,1 and another.2 This should not be a footnote reference, +because it contains a space.[^my note] Here is an inline note.3

    -

    Notes can go in quotes.4

    +

    Notes can go in quotes.4

      -
    1. And in list items.5
    2. +
    3. And in list items.5

    This paragraph should not be part of the note, as it is not indented.


      -
    1. Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.↩︎

    2. +
    3. Here is the footnote. It can go anywhere after the footnote +reference. It need not be placed at the end of the document.↩︎

    4. Here’s the long note. This one contains multiple blocks.

      -

      Subsequent blocks are indented to show that they belong to the footnote (as with list items).

      +

      Subsequent blocks are indented to show that they belong to the footnote (as +with list items).

        { <code> }
      -

      If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.↩︎

    5. -
    6. This is easier to type. Inline notes may contain links and ] verbatim characters, as well as [bracketed text].↩︎

    7. +

      If you want, you can indent every line, but you can also be lazy and just +indent the first line of each block.↩︎

      +
    8. This is easier to type. Inline notes may contain links and ] verbatim characters, as +well as [bracketed text].↩︎

    9. In quote.↩︎

    10. In list.↩︎

    diff --git a/test/writer.html5 b/test/writer.html5 index 0141bf9fe..cdfcf042f 100644 --- a/test/writer.html5 +++ b/test/writer.html5 @@ -159,10 +159,12 @@

    Anonymous

    July 17, 2006

    -

    This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.

    +

    This is a set of tests for pandoc. Most of them are adapted from John +Gruber’s markdown test suite.


    Headers

    - +

    Level 3 with emphasis

    Level 4

    Level 5
    @@ -175,7 +177,9 @@

    Paragraphs

    Here’s a regular paragraph.

    -

    In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.

    +

    In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. +Because a hard-wrapped line in the middle of a paragraph looked like a list +item.

    Here’s one with a bullet. * criminey.

    There should be a hard line break
    here.

    @@ -286,7 +290,8 @@ These should not be escaped: \$ \\ \> \[ \{

    Multiple paragraphs:

    1. Item 1, graf one.

      -

      Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.

    2. +

      Item 1. graf two. The quick brown fox jumped over the lazy dog’s +back.

    3. Item 2.

    4. Item 3.

    @@ -543,18 +548,22 @@ Blah

    So is this word.

    This is strong and em.

    So is this word.

    -

    This is code: >, $, \, \$, <html>.

    +

    This is code: >, $, \, +\$, <html>.

    This is strikeout.

    -

    Superscripts: abcd ahello ahello there.

    +

    Superscripts: abcd ahello +ahello there.

    Subscripts: H2O, H23O, Hmany of themO.

    -

    These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.

    +

    These should not be superscripts or subscripts, because of the unescaped +spaces: a^b c^d, a~b c~d.


    Smart quotes, ellipses, dashes

    “Hello,” said the spider. “‘Shelob’ is my name.”

    ‘A’, ‘B’, and ‘C’ are letters.

    ‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’

    ‘He said, “I want to go.”’ Were you alive in the 70’s?

    -

    Here is some quoted ‘code’ and a “quoted link”.

    +

    Here is some quoted ‘code’ and a “quoted link”.

    Some dashes: one—two — three—four — five.

    Dashes between numbers: 5–7, 255–66, 1987–1999.

    Ellipses…and…and….

    @@ -567,13 +576,16 @@ Blah
  • α ∧ ω
  • 223
  • p-Tree
  • -
  • Here’s some display math: $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
  • -
  • Here’s one that has a line break in it: α + ω × x2.
  • +
  • Here’s some display math: $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
  • +
  • Here’s one that has a line break in it: α + ω × x2.
  • These shouldn’t be math:

    • To get the famous equation, write $e = mc^2$.
    • -
    • $22,000 is a lot of money. So is $34,000. (It worked if “lot” is emphasized.)
    • +
    • $22,000 is a lot of money. So is $34,000. (It worked if “lot” is +emphasized.)
    • Shoes ($20) and socks ($5).
    • Escaped $: $73 this should be emphasized 23$.
    @@ -616,7 +628,8 @@ Blah

    URL and title.

    URL and title.

    URL and title.

    -

    URL and title

    +

    URL and +title

    URL and title

    with_underscore

    Email link

    @@ -633,51 +646,78 @@ Blah

    Foo bar.

    Foo biz.

    With ampersands

    -

    Here’s a link with an ampersand in the URL.

    -

    Here’s a link with an amersand in the link text: AT&T.

    +

    Here’s a link with an ampersand +in the URL.

    +

    Here’s a link with an amersand in the link text: AT&T.

    Here’s an inline link.

    -

    Here’s an inline link in pointy braces.

    +

    Here’s an inline link in pointy +braces.

    -

    With an ampersand: http://example.com/?foo=1&bar=2

    +

    With an ampersand: http://example.com/?foo=1&bar=2

    -

    An e-mail address:

    +

    An e-mail address: nobody@nowhere.net

    -

    Blockquoted: http://example.com/

    +

    Blockquoted: http://example.com/

    -

    Auto-links should not occur here: <http://example.com/>

    +

    Auto-links should not occur here: +<http://example.com/>

    or here: <http://example.com/>

    Images

    From “Voyage dans la Lune” by Georges Melies (1902):

    -lalune +lalune +

    Here is a movie movie icon.


    Footnotes

    -

    Here is a footnote reference,1 and another.2 This should not be a footnote reference, because it contains a space.[^my note] Here is an inline note.3

    +

    Here is a footnote reference,1 and another.2 This should +not be a footnote reference, because it contains a space.[^my note] +Here is an inline note.3

    -

    Notes can go in quotes.4

    +

    Notes can go in quotes.4

      -
    1. And in list items.5
    2. +
    3. And in list items.5

    This paragraph should not be part of the note, as it is not indented.


      -
    1. Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.↩︎

    2. -
    3. Here’s the long note. This one contains multiple blocks.

      -

      Subsequent blocks are indented to show that they belong to the footnote (as with list items).

      +
    4. Here is the footnote. It can go anywhere +after the footnote reference. It need not be placed at the end of the +document.↩︎

    5. +
    6. Here’s the long note. This one contains +multiple blocks.

      +

      Subsequent blocks are indented to show that they belong to the footnote (as +with list items).

        { <code> }
      -

      If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.↩︎

    7. -
    8. This is easier to type. Inline notes may contain links and ] verbatim characters, as well as [bracketed text].↩︎

    9. -
    10. In quote.↩︎

    11. -
    12. In list.↩︎

    13. +

      If you want, you can indent every line, but you can also be lazy and just +indent the first line of each block.↩︎

      +
    14. This is easier to type. Inline notes +may contain links and ] verbatim +characters, as well as [bracketed text].↩︎

    15. +
    16. In quote.↩︎

    17. +
    18. In list.↩︎

    -- cgit v1.2.3 From c4f6e6cb57e4fdda9ad59ff7220988810583ec60 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Dec 2021 22:53:22 -0800 Subject: HTML writer: make line breaks more consistent. - With `--wrap=none`, we now output line breaks between block-level elements. Previously they were omitted entirely, so the whole document was on one line, unless there were literal line breaks in pre sections. This makes the HTML writer's behavior more consistent with that of other writers. - Put newline after `
    `. - Put newlines after block-level elements in footnote section. --- src/Text/Pandoc/Writers/HTML.hs | 119 ++++++++++++++++++++-------------------- test/Tests/Writers/HTML.hs | 73 +++++++++++++++++++----- test/command/853.md | 5 +- test/writer.html4 | 66 ++++++++++++++-------- test/writer.html5 | 66 ++++++++++++++-------- 5 files changed, 208 insertions(+), 121 deletions(-) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 664aeffb6..8c5548196 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -132,10 +132,8 @@ needsVariationSelector '↔' = True needsVariationSelector _ = False -- | Hard linebreak. -nl :: WriterOptions -> Html -nl opts = if writerWrapText opts == WrapNone - then mempty - else preEscapedString "\n" +nl :: Html +nl = preEscapedString "\n" -- | Convert Pandoc document to Html 5 string. writeHtml5String :: PandocMonad m => WriterOptions -> Pandoc -> m Text @@ -284,7 +282,7 @@ pandocToHtml opts (Pandoc meta blocks) = do if null (stNotes st) then return mempty else do - notes <- footnoteSection opts EndOfDocument (stEmittedNotes st + 1) (reverse (stNotes st)) + notes <- footnoteSection EndOfDocument (stEmittedNotes st + 1) (reverse (stNotes st)) modify (\st' -> st'{ stNotes = mempty, stEmittedNotes = stEmittedNotes st' + length (stNotes st') }) return notes st <- get @@ -303,7 +301,7 @@ pandocToHtml opts (Pandoc meta blocks) = do KaTeX url -> do H.script ! A.src (toValue $ url <> "katex.min.js") $ mempty - nl opts + nl let katexFlushLeft = case lookupContext "classoption" metadata of Just clsops | "fleqn" `elem` (clsops :: [Doc Text]) -> "true" @@ -323,7 +321,7 @@ pandocToHtml opts (Pandoc meta blocks) = do , " });" , "}}});" ] - nl opts + nl H.link ! A.rel "stylesheet" ! A.href (toValue $ url <> "katex.min.css") @@ -459,15 +457,15 @@ toList listop opts items = do unordList :: PandocMonad m => WriterOptions -> [Html] -> StateT WriterState m Html -unordList opts = toList H.ul opts . toListItems opts +unordList opts = toList H.ul opts . toListItems ordList :: PandocMonad m => WriterOptions -> [Html] -> StateT WriterState m Html -ordList opts = toList H.ol opts . toListItems opts +ordList opts = toList H.ol opts . toListItems defList :: PandocMonad m => WriterOptions -> [Html] -> StateT WriterState m Html -defList opts items = toList H.dl opts (items ++ [nl opts]) +defList opts items = toList H.dl opts (items ++ [nl]) isTaskListItem :: [Block] -> Bool isTaskListItem (Plain (Str "☐":Space:_):_) = True @@ -489,7 +487,7 @@ listItemToHtml opts bls let checkbox = if checked then checkbox' ! A.checked "" else checkbox' - checkbox' = H.input ! A.type_ "checkbox" ! A.disabled "" >> nl opts + checkbox' = H.input ! A.type_ "checkbox" ! A.disabled "" >> nl isContents <- inlineListToHtml opts is bsContents <- blockListToHtml opts bs return $ constr (checkbox >> isContents) >> bsContents @@ -513,11 +511,13 @@ tableOfContents opts sects = do -- | Convert list of Note blocks to a footnote
    . -- Assumes notes are sorted. footnoteSection :: - PandocMonad m => WriterOptions -> ReferenceLocation -> Int -> [Html] -> StateT WriterState m Html -footnoteSection opts refLocation startCounter notes = do + PandocMonad m => ReferenceLocation -> Int -> [Html] -> StateT WriterState m Html +footnoteSection refLocation startCounter notes = do html5 <- gets stHtml5 slideVariant <- gets stSlideVariant - let hrtag = if refLocation /= EndOfBlock then (if html5 then H5.hr else H.hr) else mempty + let hrtag = if refLocation /= EndOfBlock + then (if html5 then H5.hr else H.hr) <> nl + else mempty let additionalClassName = case refLocation of EndOfBlock -> "footnotes-end-of-block" EndOfDocument -> "footnotes-end-of-document" @@ -538,17 +538,17 @@ footnoteSection opts refLocation startCounter notes = do if null notes then mempty else do - nl opts + nl container $ do - nl opts + nl hrtag - nl opts -- Keep the previous output exactly the same if we don't -- have multiple notes sections if startCounter == 1 - then H.ol $ mconcat notes >> nl opts - else H.ol ! A.start (fromString (show startCounter)) $ mconcat notes >> nl opts - nl opts + then H.ol $ mconcat notes >> nl + else H.ol ! A.start (fromString (show startCounter)) $ + mconcat notes >> nl + nl -- | Parse a mailto link; return Just (name, domain) or Nothing. parseMailto :: Text -> Maybe (Text, Text) @@ -715,8 +715,8 @@ figure opts attr@(_, _, attrList) txt (s,tit) = do img <- inlineToHtml opts (Image attr alt (s,tit)) capt <- if null txt then return mempty - else (nl opts <>) . tocapt <$> inlineListToHtml opts txt - let inner = mconcat [nl opts, img, capt, nl opts] + else (nl <>) . tocapt <$> inlineListToHtml opts txt + let inner = mconcat [nl, img, capt, nl] return $ if html5 then H5.figure inner else H.div ! A.class_ "figure" $ inner @@ -820,32 +820,32 @@ blockToHtmlInner opts (Div (ident, "section":dclasses, dkvs) if titleSlide then do t <- addAttrs opts attr $ - secttag $ nl opts <> header' <> nl opts <> titleContents <> nl opts + secttag $ nl <> header' <> nl <> titleContents <> nl -- ensure 2D nesting for revealjs, but only for one level; -- revealjs doesn't like more than one level of nesting return $ if slideVariant == RevealJsSlides && not inSection && not (null innerSecs) - then H5.section (nl opts <> t <> nl opts <> innerContents) - else t <> nl opts <> if null innerSecs + then H5.section (nl <> t <> nl <> innerContents) + else t <> nl <> if null innerSecs then mempty - else innerContents <> nl opts + else innerContents <> nl else if writerSectionDivs opts || slide || (hident /= ident && not (T.null hident || T.null ident)) || (hclasses /= dclasses) || (hkvs /= dkvs) then addAttrs opts attr $ secttag - $ nl opts <> header' <> nl opts <> + $ nl <> header' <> nl <> if null innerSecs then mempty - else innerContents <> nl opts + else innerContents <> nl else do let attr' = (ident, classes' \\ hclasses, dkvs \\ hkvs) t <- addAttrs opts attr' header' return $ t <> if null innerSecs then mempty - else nl opts <> innerContents + else nl <> innerContents blockToHtmlInner opts (Div attr@(ident, classes, kvs') bs) = do html5 <- gets stHtml5 slideVariant <- gets stSlideVariant @@ -883,7 +883,7 @@ blockToHtmlInner opts (Div attr@(ident, classes, kvs') bs) = do -- off widths! see #4028 mconcat <$> mapM (blockToHtml opts) bs' else blockListToHtml opts' bs' - let contents' = nl opts >> contents >> nl opts + let contents' = nl >> contents >> nl let (divtag, classes'') = if html5 && "section" `elem` classes' then (H5.section, filter (/= "section") classes') else (H.div, classes') @@ -964,10 +964,10 @@ blockToHtmlInner opts (BlockQuote blocks) = do (DefinitionList lst) _ -> do contents <- blockListToHtml opts blocks return $ H.blockquote - $ nl opts >> contents >> nl opts + $ nl >> contents >> nl else do contents <- blockListToHtml opts blocks - return $ H.blockquote $ nl opts >> contents >> nl opts + return $ H.blockquote $ nl >> contents >> nl blockToHtmlInner opts (Header level (ident,classes,kvs) lst) = do contents <- inlineListToHtml opts lst let secnum = fromMaybe mempty $ lookup "number" kvs @@ -1022,10 +1022,10 @@ blockToHtmlInner opts (OrderedList (startnum, numstyle, _) lst) = do blockToHtmlInner opts (DefinitionList lst) = do contents <- mapM (\(term, defs) -> do term' <- liftM H.dt $ inlineListToHtml opts term - defs' <- mapM (liftM (\x -> H.dd (x >> nl opts)) . + defs' <- mapM (liftM (\x -> H.dd (nl >> x >> nl)) . blockListToHtml opts) defs - return $ mconcat $ nl opts : term' : nl opts : - intersperse (nl opts) defs') lst + return $ mconcat $ nl : term' : nl : + intersperse (nl) defs') lst defList opts contents blockToHtmlInner opts (Table attr caption colspecs thead tbody tfoot) = tableToHtml opts (Ann.toTable attr caption colspecs thead tbody tfoot) @@ -1052,7 +1052,7 @@ blockToHtml opts block = do then do notes <- if null (stNotes st) then return mempty - else footnoteSection opts (writerReferenceLocation opts) (stEmittedNotes st + 1) (reverse (stNotes st)) + else footnoteSection (writerReferenceLocation opts) (stEmittedNotes st + 1) (reverse (stNotes st)) modify (\st' -> st'{ stNotes = mempty, stEmittedNotes = stEmittedNotes st' + length (stNotes st') }) return (doc <> notes) else return doc @@ -1071,10 +1071,10 @@ tableToHtml opts (Ann.Table attr caption colspecs thead tbodies tfoot) = do cs <- blockListToHtml opts longCapt return $ do H.caption cs - nl opts - coltags <- colSpecListToHtml opts colspecs + nl + coltags <- colSpecListToHtml colspecs head' <- tableHeadToHtml opts thead - bodies <- intersperse (nl opts) <$> mapM (tableBodyToHtml opts) tbodies + bodies <- intersperse (nl) <$> mapM (tableBodyToHtml opts) tbodies foot' <- tableFootToHtml opts tfoot let (ident,classes,kvs) = attr -- When widths of columns are < 100%, we need to set width for the whole @@ -1091,13 +1091,13 @@ tableToHtml opts (Ann.Table attr caption colspecs thead tbodies tfoot) = do <> "%;"):kvs) _ -> attr addAttrs opts attr' $ H.table $ do - nl opts + nl captionDoc coltags head' mconcat bodies foot' - nl opts + nl tableBodyToHtml :: PandocMonad m => WriterOptions @@ -1144,7 +1144,7 @@ tablePartToHtml opts tblpart attr rows = tablePartElement <- addAttrs opts attr $ tag' contents return $ do tablePartElement - nl opts + nl where isEmptyRow (Ann.HeaderRow _attr _rownum cells) = all isEmptyCell cells isEmptyCell (Ann.Cell _colspecs _colnum cell) = @@ -1185,14 +1185,13 @@ rowListToHtml :: PandocMonad m -> [TableRow] -> StateT WriterState m Html rowListToHtml opts rows = - (\x -> nl opts *> mconcat x) <$> + (\x -> nl *> mconcat x) <$> mapM (tableRowToHtml opts) rows colSpecListToHtml :: PandocMonad m - => WriterOptions - -> [ColSpec] + => [ColSpec] -> StateT WriterState m Html -colSpecListToHtml opts colspecs = do +colSpecListToHtml colspecs = do html5 <- gets stHtml5 let hasDefaultWidth (_, ColWidthDefault) = True hasDefaultWidth _ = False @@ -1206,16 +1205,16 @@ colSpecListToHtml opts colspecs = do ColWidth w -> if html5 then A.style (toValue $ "width: " <> percent w) else A.width (toValue $ percent w) - nl opts + nl return $ if all hasDefaultWidth colspecs then mempty else do H.colgroup $ do - nl opts + nl mapM_ (col . snd) colspecs - nl opts + nl tableRowToHtml :: PandocMonad m => WriterOptions @@ -1234,12 +1233,12 @@ tableRowToHtml opts (TableRow tblpart attr rownum rowhead rowbody) = do headcells <- mapM (cellToHtml opts HeaderCell) rowhead bodycells <- mapM (cellToHtml opts celltype) rowbody rowHtml <- addAttrs opts attr' $ H.tr $ do - nl opts + nl mconcat headcells mconcat bodycells return $ do rowHtml - nl opts + nl alignmentToString :: Alignment -> Maybe Text alignmentToString = \case @@ -1297,18 +1296,18 @@ tableCellToHtml opts ctype colAlign (Cell attr align rowspan colspan item) = do : otherAttribs return $ do tag' ! attribs $ contents - nl opts + nl -toListItems :: WriterOptions -> [Html] -> [Html] -toListItems opts items = map (toListItem opts) items ++ [nl opts] +toListItems :: [Html] -> [Html] +toListItems items = map toListItem items ++ [nl] -toListItem :: WriterOptions -> Html -> Html -toListItem opts item = nl opts *> H.li item +toListItem :: Html -> Html +toListItem item = nl *> H.li item blockListToHtml :: PandocMonad m => WriterOptions -> [Block] -> StateT WriterState m Html blockListToHtml opts lst = - mconcat . intersperse (nl opts) . filter nonempty + mconcat . intersperse (nl) . filter nonempty <$> mapM (blockToHtml opts) lst where nonempty (Empty _) = False nonempty _ = True @@ -1340,9 +1339,9 @@ inlineToHtml opts inline = do (Str str) -> return $ strToHtml str Space -> return $ strToHtml " " SoftBreak -> return $ case writerWrapText opts of - WrapNone -> preEscapedText " " + WrapNone -> " " WrapAuto -> " " - WrapPreserve -> preEscapedText "\n" + WrapPreserve -> nl LineBreak -> return $ do if html5 then H5.br else H.br strToHtml "\n" @@ -1607,7 +1606,7 @@ blockListToNote opts ref blocks = do _ | html5 -> noteItem ! customAttribute "role" "doc-endnote" _ -> noteItem - return $ nl opts >> noteItem' + return $ nl >> noteItem' inDiv :: PandocMonad m=> Text -> Html -> StateT WriterState m Html inDiv cls x = do diff --git a/test/Tests/Writers/HTML.hs b/test/Tests/Writers/HTML.hs index 50775b171..a81badae8 100644 --- a/test/Tests/Writers/HTML.hs +++ b/test/Tests/Writers/HTML.hs @@ -2,6 +2,7 @@ module Tests.Writers.HTML (tests) where import Data.Text (unpack) +import qualified Data.Text as T import Test.Tasty import Tests.Helpers import Text.Pandoc @@ -68,7 +69,7 @@ tests = , testGroup "blocks" [ "definition list with empty
    " =: definitionList [(mempty, [para $ text "foo bar"])] - =?> "

    foo bar

    " + =?> "
    \n
    \n
    \n

    foo bar

    \n
    \n
    " , "heading with disallowed attributes" =: headerWith ("", [], [("invalid","1"), ("lang", "en")]) 1 "test" =?> @@ -108,37 +109,66 @@ tests = [ test (htmlWithOpts def{writerReferenceLocation=EndOfDocument}) "at the end of a document" $ noteTestDoc =?> - concat + T.unlines [ "

    Page title

    " , "

    First section

    " , "

    This is a footnote.1 And this is a link.

    " - , "

    A note inside a block quote.2

    A second paragraph.

    " + , "
    " + , "

    A note inside a block quote.2

    " + , "

    A second paragraph.

    " + , "
    " , "

    Second section

    " , "

    Some more text.

    " - , "

    1. Down here.↩︎

    2. The second note.↩︎

    " + , "
    " + , "
    " + , "
      " + , "
    1. Down here.↩︎

    2. " + , "
    3. The second note.↩︎

    4. " + , "
    " + , "
    " ] , test (htmlWithOpts def{writerReferenceLocation=EndOfBlock}) "at the end of a block" $ noteTestDoc =?> - concat + T.unlines [ "

    Page title

    " , "

    First section

    " , "

    This is a footnote.1 And this is a link.

    " - , "
    1. Down here.↩︎

    " - , "

    A note inside a block quote.2

    A second paragraph.

    " - , "
    1. The second note.↩︎

    " + , "
    " + , "
      " + , "
    1. Down here.↩︎

    2. " + , "
    " + , "
    " + , "
    " + , "

    A note inside a block quote.2

    " + , "

    A second paragraph.

    " + , "
    " + , "
    " + , "
      " + , "
    1. The second note.↩︎

    2. " + , "
    " + , "
    " , "

    Second section

    " , "

    Some more text.

    " ] , test (htmlWithOpts def{writerReferenceLocation=EndOfSection}) "at the end of a section" $ noteTestDoc =?> - concat + T.unlines [ "

    Page title

    " , "

    First section

    " , "

    This is a footnote.1 And this is a link.

    " - , "

    A note inside a block quote.2

    A second paragraph.

    " - , "

    1. Down here.↩︎

    2. The second note.↩︎

    " + , "
    " + , "

    A note inside a block quote.2

    " + , "

    A second paragraph.

    " + , "
    " + , "
    " + , "
    " + , "
      " + , "
    1. Down here.↩︎

    2. " + , "
    3. The second note.↩︎

    4. " + , "
    " + , "
    " , "

    Second section

    " , "

    Some more text.

    " ] @@ -147,15 +177,28 @@ tests = noteTestDoc =?> -- Footnotes are rendered _after_ their section (in this case after the level2 section -- that contains it). - concat + T.unlines [ "
    " , "

    Page title

    " , "
    " , "

    First section

    " - , "

    This is a footnote.1 And this is a link.

    A note inside a block quote.2

    A second paragraph.

    " + , "

    This is a footnote.1 And this is a link.

    " + , "
    " + , "

    A note inside a block quote.2

    " + , "

    A second paragraph.

    " + , "
    " + , "
    " + , "
    " + , "
    " + , "
      " + , "
    1. Down here.↩︎

    2. " + , "
    3. The second note.↩︎

    4. " + , "
    " + , "
    " + , "
    " + , "

    Second section

    " + , "

    Some more text.

    " , "
    " - , "

    1. Down here.↩︎

    2. The second note.↩︎

    " - , "

    Second section

    Some more text.

    " , "
    " ] ] diff --git a/test/command/853.md b/test/command/853.md index bcc3b4654..518c6593b 100644 --- a/test/command/853.md +++ b/test/command/853.md @@ -12,8 +12,9 @@ class="citation">[CIT2002].

    CIT2002
    -

    This is the citation. It's just like a footnote, except the label -is textual.

    +
    +

    This is the citation. It's just like a footnote, except the label is +textual.

    diff --git a/test/writer.html4 b/test/writer.html4 index e2adcf5bc..1e255fa70 100644 --- a/test/writer.html4 +++ b/test/writer.html4 @@ -376,47 +376,58 @@ back.

    Tight using spaces:

    apple
    -
    red fruit +
    +red fruit
    orange
    -
    orange fruit +
    +orange fruit
    banana
    -
    yellow fruit +
    +yellow fruit

    Tight using tabs:

    apple
    -
    red fruit +
    +red fruit
    orange
    -
    orange fruit +
    +orange fruit
    banana
    -
    yellow fruit +
    +yellow fruit

    Loose:

    apple
    -

    red fruit

    +
    +

    red fruit

    orange
    -

    orange fruit

    +
    +

    orange fruit

    banana
    -

    yellow fruit

    +
    +

    yellow fruit

    Multiple blocks with italics:

    apple
    -

    red fruit

    +
    +

    red fruit

    contains seeds, crisp, pleasant to taste

    orange
    -

    orange fruit

    +
    +

    orange fruit

    { orange code block }

    orange block quote

    @@ -426,38 +437,49 @@ back.

    Multiple definitions, tight:

    apple
    -
    red fruit +
    +red fruit
    -
    computer +
    +computer
    orange
    -
    orange fruit +
    +orange fruit
    -
    bank +
    +bank

    Multiple definitions, loose:

    apple
    -

    red fruit

    +
    +

    red fruit

    -

    computer

    +
    +

    computer

    orange
    -

    orange fruit

    +
    +

    orange fruit

    -

    bank

    +
    +

    bank

    Blank line after term, indented marker, alternate markers:

    apple
    -

    red fruit

    +
    +

    red fruit

    -

    computer

    +
    +

    computer

    orange
    -

    orange fruit

    +
    +

    orange fruit

    1. sublist
    2. sublist
    3. diff --git a/test/writer.html5 b/test/writer.html5 index cdfcf042f..d8e89b3e2 100644 --- a/test/writer.html5 +++ b/test/writer.html5 @@ -379,47 +379,58 @@ back.

      Tight using spaces:

      apple
      -
      red fruit +
      +red fruit
      orange
      -
      orange fruit +
      +orange fruit
      banana
      -
      yellow fruit +
      +yellow fruit

      Tight using tabs:

      apple
      -
      red fruit +
      +red fruit
      orange
      -
      orange fruit +
      +orange fruit
      banana
      -
      yellow fruit +
      +yellow fruit

      Loose:

      apple
      -

      red fruit

      +
      +

      red fruit

      orange
      -

      orange fruit

      +
      +

      orange fruit

      banana
      -

      yellow fruit

      +
      +

      yellow fruit

      Multiple blocks with italics:

      apple
      -

      red fruit

      +
      +

      red fruit

      contains seeds, crisp, pleasant to taste

      orange
      -

      orange fruit

      +
      +

      orange fruit

      { orange code block }

      orange block quote

      @@ -429,38 +440,49 @@ back.

      Multiple definitions, tight:

      apple
      -
      red fruit +
      +red fruit
      -
      computer +
      +computer
      orange
      -
      orange fruit +
      +orange fruit
      -
      bank +
      +bank

      Multiple definitions, loose:

      apple
      -

      red fruit

      +
      +

      red fruit

      -

      computer

      +
      +

      computer

      orange
      -

      orange fruit

      +
      +

      orange fruit

      -

      bank

      +
      +

      bank

      Blank line after term, indented marker, alternate markers:

      apple
      -

      red fruit

      +
      +

      red fruit

      -

      computer

      +
      +

      computer

      orange
      -

      orange fruit

      +
      +

      orange fruit

      1. sublist
      2. sublist
      3. -- cgit v1.2.3 From 811601aa8b07bd07e07759ab9d1cfdac68e5f1f6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 22 Dec 2021 11:59:07 -0800 Subject: RTF writer: properly handle images in data URIs. See #7771. --- src/Text/Pandoc/Writers/RTF.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index 063371ebc..eeef3eaf3 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -43,10 +43,11 @@ rtfEmbedImage opts x@(Image attr _ (src,_)) = catchError (do result <- P.fetchItem src case result of (imgdata, Just mime) - | mime == "image/jpeg" || mime == "image/png" -> do + | mime' <- T.takeWhile (/=';') mime + , mime' == "image/jpeg" || mime' == "image/png" -> do let bytes = map (T.pack . printf "%02x") $ B.unpack imgdata filetype <- - case mime of + case mime' of "image/jpeg" -> return "\\jpegblip" "image/png" -> return "\\pngblip" _ -> throwError $ -- cgit v1.2.3 From 43a8931abf7f89b47bb949cfc119156fae41f020 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 22 Dec 2021 12:02:20 -0800 Subject: Add markua test files to extra-source-files. --- pandoc.cabal | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandoc.cabal b/pandoc.cabal index dc6a92a5f..cd948d253 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -296,6 +296,7 @@ extra-source-files: test/tables.ms test/tables.plain test/tables.markdown + test/tables.markua test/tables.mediawiki test/tables.tei test/tables.textile @@ -331,6 +332,7 @@ extra-source-files: test/writer.man test/writer.ms test/writer.markdown + test/writer.markua test/writer.plain test/writer.mediawiki test/writer.textile -- cgit v1.2.3 From 7954070b0141700e17b6bc986d134fed90de7a02 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 22 Dec 2021 22:51:53 +0100 Subject: JATS templates: add support for article subtitles --- data/templates/article.jats_publishing | 3 +++ data/templates/default.jats_articleauthoring | 3 +++ doc/jats.md | 11 +++++++++++ 3 files changed, 17 insertions(+) diff --git a/data/templates/article.jats_publishing b/data/templates/article.jats_publishing index 11902cae8..bb69404c2 100644 --- a/data/templates/article.jats_publishing +++ b/data/templates/article.jats_publishing @@ -81,6 +81,9 @@ $endif$ $if(title)$ $title$ +$if(subtitle)$ +${subtitle} +$endif$ $endif$ $if(author)$ diff --git a/data/templates/default.jats_articleauthoring b/data/templates/default.jats_articleauthoring index 66a4157d7..8cf89fa68 100644 --- a/data/templates/default.jats_articleauthoring +++ b/data/templates/default.jats_articleauthoring @@ -14,6 +14,9 @@ $endif$ $if(title)$ $title$ +$if(subtitle)$ +${subtitle} +$endif$ $endif$ $if(author)$ diff --git a/doc/jats.md b/doc/jats.md index bebb2536a..7eca75c8e 100644 --- a/doc/jats.md +++ b/doc/jats.md @@ -336,12 +336,21 @@ Metadata Values : Additional notes concerning the whole article. Added to the article's frontmatter via the [``][elem:notes] element. +`subtitle` +: Subordinate part of the document title. Added to the + document's front matter as a + [``][elem:article-title] element. + `tags` : list of keywords. Items are used as contents of the [``][elem:kwd] element; the elements are grouped in a [``][elem:kwd-group] with the [`kwd-group-type`][attr:kwd-group-type] value `author`. +`title` +: The article title. Added to the document's front matter via the + [``][elem:article-title] element. + Required Metadata ----------------- @@ -378,6 +387,7 @@ Required metadata values: [elem:abstract]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/abstract.html [elem:article-id]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/article-id.html [elem:article-meta]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/article-meta.html +[elem:article-title]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/article-title.html [elem:copyright-holder]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/copyright-holder.html [elem:copyright-statement]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/copyright-statement.html [elem:copyright-year]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/copyright-year.html @@ -400,6 +410,7 @@ Required metadata values: [elem:string-name]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/string-name.html [elem:subj-group]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/subj-group.html [elem:subject]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/subject.html +[elem:subtitle]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/subtitle.html [elem:surname]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/surname.html [elem:xref]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/xref.html -- cgit v1.2.3 From ddd1b856087b7620d9b314026a76dd53d52d65b6 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 23 Dec 2021 08:45:39 +0100 Subject: JATS templates: fix affiliation tagging in articleauthoring output Affiliations were `xlink`ed even in the articleauthoring tag set, but `` are not allowed as children of `contrib-group` elements in that tag set. Each affiliation must be listed directly in the contrib element. --- data/templates/affiliations.jats | 42 +++++++++++++--------------- data/templates/article.jats_publishing | 12 +++++++- data/templates/default.jats_articleauthoring | 3 +- doc/jats.md | 19 ++++++++++--- 4 files changed, 47 insertions(+), 29 deletions(-) diff --git a/data/templates/affiliations.jats b/data/templates/affiliations.jats index 93238d22e..2df99d75e 100644 --- a/data/templates/affiliations.jats +++ b/data/templates/affiliations.jats @@ -1,38 +1,36 @@ $-- $-- Affiliations $-- -$for(affiliation)$ $-- wrap affiliation if it has a known institution identifier -$if(affiliation.group)$ -$affiliation.group$ +$if(it.group)$ +${it.group} $endif$ -$if(affiliation.department)$ -$affiliation.department$ +$if(it.department)$ +${it.department} $endif$ -$if(affiliation.organization)$ -$affiliation.organization$ +$if(it.organization)$ +${it.organization} $else$ -$affiliation.name$ +${it.name} $endif$ -$if(affiliation.isni)$ -$affiliation.isni$ +$if(it.isni)$ +${it.isni} $endif$ -$if(affiliation.ringgold)$ -$affiliation.ringgold$ +$if(it.ringgold)$ +${it.ringgold} $endif$ -$if(affiliation.ror)$ -$affiliation.ror$ +$if(it.ror)$ +${it.ror} $endif$ -$for(affiliation.pid)$ -$affiliation.pid.id$ +$for(it.pid)$ +${it.id} $endfor$ -$if(affiliation.street-address)$, -$for(affiliation.street-address)$ -$affiliation.street-address$$sep$, +$if(it.street-address)$, +$for(it.street-address)$ +${it}$sep$, $endfor$ -$else$$if(affiliation.city)$, $affiliation.city$$endif$$endif$$if(affiliation.country)$, -$affiliation.country$$endif$ +$else$$if(it.city)$, $it.city$$endif$$endif$$if(it.country)$, +$it.country$$endif$ -$endfor$ diff --git a/data/templates/article.jats_publishing b/data/templates/article.jats_publishing index bb69404c2..47ab8f197 100644 --- a/data/templates/article.jats_publishing +++ b/data/templates/article.jats_publishing @@ -106,15 +106,25 @@ $endif$ $if(author.email)$ $author.email$ $endif$ +$-- if affiliations are listed separately, then create links. Otherwise +$-- include them here. +$if(affiliation)$ $for(author.affiliation)$ $endfor$ +$else$ +$for(author.affiliation)$ +${ it:affiliations.jats() } +$endfor$ +$endif$ $if(author.cor-id)$ * $endif$ $endfor$ -${ affiliations.jats() } +$for(affiliation)$ +${ it:affiliations.jats() } +$endfor$ $endif$ $if(article.author-notes)$ diff --git a/data/templates/default.jats_articleauthoring b/data/templates/default.jats_articleauthoring index 8cf89fa68..29abe86c5 100644 --- a/data/templates/default.jats_articleauthoring +++ b/data/templates/default.jats_articleauthoring @@ -40,14 +40,13 @@ $if(author.email)$ $author.email$ $endif$ $for(author.affiliation)$ - +${ it:affiliations.jats() } $endfor$ $if(author.cor-id)$ * $endif$ $endfor$ -${ affiliations.jats() } $endif$ $if(copyright)$ diff --git a/doc/jats.md b/doc/jats.md index 7eca75c8e..9b8351840 100644 --- a/doc/jats.md +++ b/doc/jats.md @@ -45,10 +45,21 @@ Metadata Values element. `affiliation` - : list of affiliation identifiers; marks the organizations - with which an author is affiliated. Each identifier in this - list must also occur as the `id` of an affiliation listed in - the top-level `affiliation` list. + : either full affiliation entries as described in field + `affiliation`, or a list of affiliation identifiers. + + The identifiers link to the organizations with which an + author is affiliated. Each identifier in this list must + also occur as the `id` of an affiliation listed in the + top-level `affiliation` list. + + If the top-level `affiliation` field is set, then this + entry assumed to be a list of identifiers, and a list of + full entries if that field is unset. + + Full entries must be given if the articleauthoring tag + set it used, as affiliation links are not allowed in that + schema. `equal-contrib` : boolean attribute used to mark authors who contributed -- cgit v1.2.3 From fae63b09bb5034b961118181d80a4377d12d223b Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 23 Dec 2021 15:48:09 +0100 Subject: Lua: use released pandoc-lua-marshal-0.1.3. Inlines, Blocks, and List objects now have an `__eq` metamethod, testing equality by comparing two lists element-wise. --- cabal.project | 5 ----- doc/lua-filters.md | 16 ++++++++++++++++ stack.yaml | 3 +-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/cabal.project b/cabal.project index f0365d5da..3d89d63ab 100644 --- a/cabal.project +++ b/cabal.project @@ -3,11 +3,6 @@ tests: True flags: +embed_data_files constraints: aeson >= 2.0.1.0 -source-repository-package - type: git - location: https://github.com/pandoc/pandoc-lua-marshal - tag: f81ec19006cc4d0476f199d1fb913bac4af0a0d8 - source-repository-package type: git location: https://github.com/jgm/texmath.git diff --git a/doc/lua-filters.md b/doc/lua-filters.md index af3342826..440d06653 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3727,6 +3727,22 @@ methods and convenience functions. Returns: a new list containing all elements from list1 and list2 +[`pandoc.List:__eq (a, b)`]{#pandoc.list:__concat} + +: Compares two lists for equality. The lists are taken as equal + if and only if they are of the same type (i.e., have the same + non-nil metatable), have the same length, and if all elements + are equal. + + Parameters: + + `a`, `b`: + : any Lua object + + Returns: + + - `true` if the two lists are equal, `false` otherwise. + ## Methods [`pandoc.List:clone ()`]{#pandoc.list:clone} diff --git a/stack.yaml b/stack.yaml index 492f39cf0..94121b116 100644 --- a/stack.yaml +++ b/stack.yaml @@ -26,6 +26,7 @@ extra-deps: - lua-2.0.2 - tasty-hslua-1.0.0 - tasty-lua-1.0.0 +- pandoc-lua-marshal-0.1.3 - pandoc-types-1.22.1 - commonmark-0.2.1.1 - commonmark-extensions-0.2.2.1 @@ -37,8 +38,6 @@ extra-deps: commit: 46df85d747f4f233157d3476683264232a4f58be - git: https://github.com/jgm/ipynb.git commit: 00246af10885c2ad4413ace4f69a7e6c88297a08 -- git: https://github.com/pandoc/pandoc-lua-marshal - commit: f81ec19006cc4d0476f199d1fb913bac4af0a0d8 - git: https://github.com/jgm/commonmark-hs commit: 4d460b206e0b1872376db86cadf7a4567eeddaed subdir: commonmark-pandoc -- cgit v1.2.3 From e54f6dcd7a6367d6d6408a4a5151b703aef3c533 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 23 Dec 2021 18:45:20 +0100 Subject: JATS template: fix position of contrib affiliations in authoring set Any `` element must come before any `` element. --- data/templates/affiliations.jats | 2 +- data/templates/default.jats_articleauthoring | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/templates/affiliations.jats b/data/templates/affiliations.jats index 2df99d75e..17c3cf164 100644 --- a/data/templates/affiliations.jats +++ b/data/templates/affiliations.jats @@ -1,7 +1,7 @@ $-- $-- Affiliations $-- - + $-- wrap affiliation if it has a known institution identifier $if(it.group)$ ${it.group} diff --git a/data/templates/default.jats_articleauthoring b/data/templates/default.jats_articleauthoring index 29abe86c5..01042b001 100644 --- a/data/templates/default.jats_articleauthoring +++ b/data/templates/default.jats_articleauthoring @@ -36,12 +36,12 @@ $elseif(author.name)$ $else$ $author$ $endif$ -$if(author.email)$ -$author.email$ -$endif$ $for(author.affiliation)$ ${ it:affiliations.jats() } $endfor$ +$if(author.email)$ +$author.email$ +$endif$ $if(author.cor-id)$ * $endif$ -- cgit v1.2.3 From fbd2c8e376eea5eccc0b799f8e48d10c7ab8b6d9 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 25 Dec 2021 20:47:29 +0100 Subject: Lua: improve handling of empty caption, body by `from_simple_table` Create truly empty table caption and body when these are empty in the simple table. Fixes: #7776 --- src/Text/Pandoc/Lua/Module/Utils.hs | 4 ++-- test/lua/module/pandoc-utils.lua | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index eabb2b532..02307cf7a 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -197,10 +197,10 @@ from_simple_table :: SimpleTable -> LuaE PandocError NumResults from_simple_table (SimpleTable capt aligns widths head' body) = do Lua.push $ Table nullAttr - (Caption Nothing [Plain capt]) + (Caption Nothing [Plain capt | not (null capt)]) (zipWith (\a w -> (a, toColWidth w)) aligns widths) (TableHead nullAttr [blockListToRow head' | not (null head') ]) - [TableBody nullAttr 0 [] $ map blockListToRow body] + [TableBody nullAttr 0 [] $ map blockListToRow body | not (null body)] (TableFoot nullAttr []) return (NumResults 1) where diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua index 0475e96ec..4cf2c84a7 100644 --- a/test/lua/module/pandoc-utils.lua +++ b/test/lua/module/pandoc-utils.lua @@ -302,5 +302,32 @@ return { -- reversible assert.are_same(simple_table, utils.to_simple_table(tbl)) end), + test('empty caption', function () + local simple_table = pandoc.SimpleTable( + {}, + {pandoc.AlignDefault}, + {0}, + {{pandoc.Plain 'a'}}, + {{{pandoc.Plain 'b'}}} + ) + local tbl = utils.from_simple_table(simple_table) + assert.are_equal( + pandoc.Blocks{}, + tbl.caption.long + ) + assert.is_nil(tbl.caption.short) + end), + test('empty body', function () + local simple_table = pandoc.SimpleTable( + pandoc.Inlines('a nice caption'), + {pandoc.AlignDefault}, + {0}, + {{pandoc.Plain 'a'}}, + {} + ) + local tbl = utils.from_simple_table(simple_table) + tbl.bodies:map(print) + assert.are_same(pandoc.List(), tbl.bodies) + end), } } -- cgit v1.2.3 From 8bd22270c8ac5d4f76164f8c5854ba26e901e161 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 28 Dec 2021 12:35:22 +0100 Subject: doc/lua-filters.md: improve documentation of `make_sections` --- doc/lua-filters.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 440d06653..eba4dcfe9 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3359,9 +3359,21 @@ non-null, `Header` levels will be reorganized so that there are no gaps, and so that the base level is the level specified. +Parameters: + +`number_sections` +: whether section divs should get an additional `number` + attribute containing the section number. (boolean) + +`base_level` +: shift top-level headings to this level. (integer|nil) + +`blocks` +: list of blocks to process ([Blocks](#type-blocks)) + Returns: -- List of [Blocks](#type-block). +- [Blocks](#type-blocks). Usage: -- cgit v1.2.3 From 7d56650e0137daf504fdd79187811f091d4eee37 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 28 Dec 2021 16:06:25 -0800 Subject: OpenDocument writer: fix vertical align bug with display math. Previously some displayed formulas would be floated above a preceding text line. This is fixed by setting vertical-rel to 'text' rather than 'paragraph-content'. Closes #7777. --- src/Text/Pandoc/Writers/OpenDocument.hs | 2 +- test/command/6792.md | 2 +- test/writer.opendocument | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index a42c5df64..8af64969b 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -192,7 +192,7 @@ formulaStyle mt = inTags False "style:style" ,("style:vertical-rel", "text")] else [("style:vertical-pos", "middle") - ,("style:vertical-rel", "paragraph-content") + ,("style:vertical-rel", "text") ,("style:horizontal-pos", "center") ,("style:horizontal-rel", "paragraph-content") ,("style:wrap", "none")] diff --git a/test/command/6792.md b/test/command/6792.md index 3d31942fe..253009d46 100644 --- a/test/command/6792.md +++ b/test/command/6792.md @@ -22,7 +22,7 @@ - + diff --git a/test/writer.opendocument b/test/writer.opendocument index 9e6ef336e..3095cef41 100644 --- a/test/writer.opendocument +++ b/test/writer.opendocument @@ -1017,7 +1017,7 @@ - + -- cgit v1.2.3 From d960282b105a6469c760b4308a3b81da723b7256 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 28 Dec 2021 16:31:54 -0800 Subject: Use `splitDirectories` istead of `splitPath`. We were using `splitPath` in two places in the code where `splitDirectories` should have been used. This led to a test for `..` in paths in `extractMedia` failing, so that images with `..` in the path name could be extracted outside the directory specified by `extractMedia`. It also led a test for `media` in resource paths to fail in the docx reader. --- src/Text/Pandoc/MediaBag.hs | 2 +- src/Text/Pandoc/Readers/Docx/Parse.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/MediaBag.hs b/src/Text/Pandoc/MediaBag.hs index 098e484ee..eb4f3110c 100644 --- a/src/Text/Pandoc/MediaBag.hs +++ b/src/Text/Pandoc/MediaBag.hs @@ -80,7 +80,7 @@ insertMedia fp mbMime contents (MediaBag mediamap) = uri = parseURI fp newpath = if isRelative fp && isNothing uri - && ".." `notElem` splitPath fp + && ".." `notElem` splitDirectories fp then T.unpack fp' else showDigest (sha1 contents) <> "." <> ext fallback = case takeExtension fp of diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index 0021741ed..87a3aebef 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -505,7 +505,7 @@ archiveToRelationships archive docXmlPath = filePathIsMedia :: FilePath -> Bool filePathIsMedia fp = - "media" `elem` splitPath (takeDirectory fp) + "media" `elem` splitDirectories (takeDirectory fp) lookupLevel :: T.Text -> T.Text -> Numbering -> Maybe Level lookupLevel numId ilvl (Numbering _ numbs absNumbs) = do -- cgit v1.2.3