aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2022-01-11Docx writer: Handle bullets correctly in lists by not reusing numIds (#7822)Michael Hoffmann
Make sure that we only create one bullet per list item in docx. In particular, when a div is a list item, its contained paragraphs will now no longer wrongly get individual bullets. This is accomplished by making sure that for each list, we only use the associated numId once. Any repeated use would add incorrect bullets to the document. Closes #7689
2022-01-10HTML writer: don't break attributes values when wrapping.John MacFarlane
2022-01-10Fix regression: allow blank lines in HTML attributes.John MacFarlane
The commit 7a9832166e36f77402d5e0259647e9f5c7ba4e58 had the effect that blank lines would be collapsed in HTML attributes. We also roll back a change that collapsed multiple spaces into one.
2022-01-09Org reader: support alphabetical (fancy) listsLucas Viana
This adds support for alphabetical lists in org by enabling the extension Ext_fancy_lists, mimicking the behaviour of Org Mode when org-list-allow-alphabetical is enabled. Enabling Ext_fancy_lists will also make Pandoc differentiate between the delimiters of ordered lists (periods or closing parentheses). Org does this differentiation by default when exporting to some formats (e.g. plain text) but does not in others (e.g. html and latex), so I decided to copy Pandoc's markdown reader behaviour.
2022-01-08Org writer: fix list items starting with a code block...John MacFarlane
or other non-paragraph content. Closes #7810.
2022-01-08Avoid blank lines after tight sublists in org, haddock.John MacFarlane
T.P.Writers.Shared `endsWithPlain` now returns True if the list ends with a list which ends with a Plain. See #7810.
2022-01-08Org writer: don't add blank line before lists.John MacFarlane
The code to do this was apparently copied over from the RST writer, but these blank lines aren't necessary or desirable in org. See #7810 comment 3.
2022-01-07Fix parsing of footnotes in `--metadata-file`.John MacFarlane
Closes #7813.
2022-01-07Org writer: support starting number cookiesLucas Viana
This complements #7806 by supporting writing Org ordered lists that start at a specific number.
2022-01-06MediaWiki writer: Remove redundant display text for wiki linksJesse Hathaway
Prior to this commit the MediaWiki writer always added the display text for a wiki link: * [[Help|Help]] * [[Bubbles|Everyone loves bubbles]] However the display text in the first example is redundant since MediaWiki uses the target as the default display text. The result being: * [[Help]] * [[Bubbles|Everyone loves bubbles]]
2022-01-06Org reader: support counter cookies in listsLucas Viana
This adds support for counter cookies in org lists. Such cookies are used to override the item counter in ordered lists. In org it is possible to set the counter at any list item, but since Pandoc AST does not support this, we restrict the usage to setting an offset for the entire ordered list, by using the cookie in the first list item. Note that even though unordered lists do not have counters, Org Mode still parses such cookies in unordered lists and suppresses them in the output, so we do the same. Also, even though org-list-allow-alphabetical is disabled in Emacs by default, for some reason alphabetical cookies are always parsed and used in Org Mode regardlessly of whether this option is enabled or the list style is decimal, so we do the same. E.g. 2. test 3. test Is parsed as an ordered list starting at 1, as before. This also conforms to Org Mode behaviour. 1. [@2] test 2. test Is now parsed as an ordered list starting at 2, so that it conforms to Org Mode behaviour. Note that when parsing 1. [@2] test 2. [@9] test the second cookie is silenced and the entire list starts at 2. This is because the current Pandoc AST does not support expressing a change in the counter at a specific item.
2022-01-05AsciiDoc writer: improve detection of intraword emphasis.John MacFarlane
Closes #7803.
2022-01-04Lua: add `pandoc.template` moduleAlbert Krewinkel
The module provides a `compile` function to use strings as templates.
2022-01-04Lua: add `pandoc.WriterOptions` constructorAlbert Krewinkel
2022-01-03DocBook reader: be sensitive to spacing="compact" in lists.John MacFarlane
When spacing="compact" is set, Para elements are turned into Plain, so we get a "tight" list. Closes #7799.
2022-01-02ConTeXt template: make title appear in PDF title bar.John MacFarlane
This is recommended for accessibility reasons. Note: doesn't work with macOS Preview.app. See https://groups.google.com/d/msgid/pandoc-discuss/m2lezx20jq.fsf%40MacBook-Pro-2.hsd1.ca.comcast.net
2022-01-02Odt: Add list-headerTuong Nguyen Manh
The list-header is a type of list-item. Therefore, it will be treated exactly like one.
2022-01-02Change reference.pptx to use 16:9 aspect ratio.John MacFarlane
This is now Powerpoint's default.
2022-01-02Copyright notices: update for 2022Albert Krewinkel
2022-01-01Org reader: allow trailing spaces after key/value pairs in directivesAlbert Krewinkel
Ensures that spaces at the end of attribute directives like `#+ATTR_HTML: :width 100%` (note the trailing spaces) are accepted.
2021-12-30Lua: allow binary (byte string) readers to be used with `pandoc.read`Albert Krewinkel
2021-12-28OpenDocument writer: fix vertical align bug with display math.John MacFarlane
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.
2021-12-25Lua: improve handling of empty caption, body by `from_simple_table`Albert Krewinkel
Create truly empty table caption and body when these are empty in the simple table. Fixes: #7776
2021-12-22HTML writer: make line breaks more consistent.John MacFarlane
- 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 `<dd>`. - Put newlines after block-level elements in footnote section.
2021-12-22Add text wrapping to HTML output.John MacFarlane
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.
2021-12-21Lua: simplify code of pandoc.utils.stringifyAlbert Krewinkel
Minor behavior change: plain strings nested in tables are now included in the result string.
2021-12-21Lua tests: add more tests for `pandoc.utils.stringify`.Albert Krewinkel
2021-12-21Lua: add tests for pandoc.utils.equalsAlbert Krewinkel
2021-12-21Lua: add new library function `pandoc.utils.type`.Albert Krewinkel
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.
2021-12-20Lua: use more natural representation for Reference valuesAlbert Krewinkel
Omit `false` boolean values, push integers as numbers.
2021-12-19Add a writer for Markua 0.10 (#7729)binaarinen
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.
2021-12-19Lua: fixup, should have been part of previous commitAlbert Krewinkel
2021-12-18Citeproc: avoid adding comma before an author-in-text citation...John MacFarlane
...in a note if it begins with a title (no author). Closes #7761.
2021-12-14Org reader: parse official org-cite citations.John MacFarlane
We also support the older org-ref style as a fallback. We no longer support the "markdown-style" citations. See #7329.
2021-12-14Org reader: remove support for "Berkeley style" citations.John MacFarlane
See #7329.
2021-12-13Org writer: add tests for org-cite citations, and improve support.John MacFarlane
2021-12-11fix(IpynbOutput)!: rank always favors output formatKolen Cheung
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.
2021-12-10Lua tests: remove roundtrip testsAlbert Krewinkel
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.
2021-12-10Powerpoint tests: shorten lines by grouping testsAlbert Krewinkel
This makes the test output more pleasant to read in narrow terminal windows.
2021-12-09ipynb writer: handle cell output with raw block of markdown (#7563)Kolen Cheung
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
2021-12-09Lua: update to latest pandoc-lua-marshal (0.1.1)Albert Krewinkel
- `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.
2021-12-07Add test for #7738.John MacFarlane
2021-12-06Ipynb reader & writer: properly handle cell "id".John MacFarlane
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.
2021-12-03Improve Markdown writer escaping.John MacFarlane
This fixes escaping for '#' in particular. Closes #7726.
2021-11-30Markdown reader: don't allow `^` at beginning of link or image label.John MacFarlane
This is reserved for footnotes. Fixes a regression introduced by 0a93acf. Closes #7723.
2021-11-29Lua: remove `pandoc.utils.text` (#7720)Albert Krewinkel
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
2021-11-28Lua: add constructors `pandoc.Blocks` and `pandoc.Inlines`Albert Krewinkel
The functions convert their argument into a list of Block and Inline values, respectively.
2021-11-27Lua: use package pandoc-lua-marshal (#7719)Albert Krewinkel
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.
2021-11-24LaTeX reader: Fix semantics of `\ref`.John MacFarlane
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.
2021-11-24LaTeX reader: omit visible content for `\label{...}`.John MacFarlane
Previously we included the text of the label in square brackets, but this is undesirable in many cases. See discussion in <https://github.com/jgm/pandoc/issues/813#issuecomment-978232426>.