summaryrefslogtreecommitdiff
path: root/test/command
AgeCommit message (Collapse)Author
2023-07-12RST writer: fix figure handling.John MacFarlane
This fixes a number of regressions from pandoc 2.x. Properly handle caption, alt attribute in figures. No longer treat a paragraph with a single image in it as a figure (we have a dedicated Figure element now). Closes #8930, closes #8871.
2023-07-11SelfContained: Use inline svg instead of data uris...John MacFarlane
for SVG images in HTML5. Closes #8948. Note that SelfContained does not have access to the writer name, so we check for HTML5 by determining whether the document starts with `<DOCTYPE! html>`. This means that inline SVG won't be used when generating document fragments. An API change could be contemplated to give more flexibility, but this is okay for now.
2023-07-05Make modern AsciiDoc the target for `asciidoc`.John MacFarlane
The AsciiDoc community now regards the dialect parsed by `asciidoctor` as the official AsciiDoc syntax, so it should be the target of our `asciidoc` format. Closes #8936. The `asciidoc` output format now behaves like `asciidoctor` used to. `asciidoctor` is a deprecated synonynm. For the old `asciidoc` behavior (targeting the Python script), use `asciidoc_legacy`. The templates have been consolidated. Instead of separate `default.asciidoctor` and `default.asciidoc` templates, there is just `default.asciidoc`. Text.Pandoc.Writers.AsciiDoc API changes: - `writeAsciiDoc` now behaves like `writeAsciiDoctor` used to. - `writeAsciiDoctor` is now a deprecated synonym for `writeAsciiDoc`. - New exported function `writeAsciiDocLegacy` behaves like `writeAsciDoc` used to.
2023-06-24Update #8764 command test for latest change to HTML table parser (#8634).John MacFarlane
2023-06-22LaTeX reader: support alt text on images. (#8745)Albert Krewinkel
Closes: #8743
2023-06-19Make `implicit_figures` work again in commonmark reader.John MacFarlane
Support for this (introduced in #6350) disappeared when we made an architectural change.
2023-06-07Parse references title from ref-list in JATS reader.John MacFarlane
Closes #8365.
2023-06-07JATS writer: include title in ref-list.John MacFarlane
Previously the reference title ended up in a separate section at the back of the body instead of in the ref-list in the back matter. Closes #8364.
2023-06-06Add typst reader.John MacFarlane
New module Text.Pandoc.Readers.Typst [API change].
2023-05-04Markdown reader: disallow escaping of `~` and `"` in markdown_strictAlbert Krewinkel
This matches the behavior of the legacy `markdown.pl` as well as what is described in the manual. Fixes: #8777
2023-05-04LaTeX reader: ignore args to column type in `\multicolumn`.Albert Krewinkel
The `\multicolumn` command takes the column type as the second argument. Types like `p` take an additional argument, which is now ignored and no longer causes the table parser to fail. Fixes: #8789
2023-05-01Writers.OpenDocument: handle row header column cells as header cellsMichael Stahl
The previous commit prevented header column cells from being dropped on the floor, this one changes the paragraph style to "Table_20_Heading". Note that for the test input, the result is not correct: the AnnotatedTable type cannot represent the HTML input properly, as it only has a concept of header rows and header columns, but HTML can have an individual cell that is a header (not 100% sure but they way i read https://html.spec.whatwg.org/#header-and-data-cell-semantics the <th> cell here is both a row header cell and a column header cell while the other cells in the row and column are not header cells), and header cells may even appear "in the middle" of a table (see example in https://html.spec.whatwg.org/#the-th-element). So while this appears like it's the right thing to do for Writer.OpenDocument, it's not clear if this is going to make things better or worse overall. Fixes: #8764
2023-05-01Writers.OpenDocument: handle row header column cells as ordinary cellsMichael Stahl
While ODF 1.3 part 3 does specify a 9.1.11 <table:table-header-columns> element, in practice it's only implemented by spreadsheet applications, not word processors. So simply treat the row header columns as ordinary table columns, at least they don't get lost then. Fixes: #8764
2023-05-01Writers.OpenDocument: fix invalid text:p inside text:p from metaMichael Stahl
The only element in meta for which data/templates/default.opendocument allows block element content appears to be "abstract", which is already filtered out of meta' at this point, so simply convert all blocks to linebreak-separated inlines. Fixes: #8256
2023-04-28Writers.ODT: stop validator complaints by producing ODF 1.3Michael Stahl
The ODF validator complains about an invalid attribute style:contextual-spacing in styles.xml, ultimately an implementation error in whatever old version of LibreOffice that produced the data/odt/styles.xml (should have put it into an extension namespace). Fortunately the attribute was added to ODF 1.3, which was released a couple years ago. So the easiest fix is to simply produce ODF 1.3 instead of 1.2; it's supposed to be fully backward compatible.
2023-04-05Remove links from inside links in mediawiki writer (#8739)wgevaert
Co-authored-by: Wout Gevaert <wout@wikibase.nl>
2023-04-01Org reader: require abstract environment to use lowercaseAlbert Krewinkel
2023-03-29HTML writer: use first paragraph in task item as checkbox label.Albert Krewinkel
Closes: #8729
2023-03-26Moved a misplaced command test.John MacFarlane
2023-03-20HTML reader: fix behavior with `-native_spans-raw_html`.John MacFarlane
Previously with this configuration, `<span>`s were not treated as inline elements at all. Closes #8711.
2023-03-14HTML writer footnotes changes:John MacFarlane
When `--reference-location=section` or `=block`, use an `aside` element for the notes rather than a `section`. When `--reference-location=section`, include the `aside` element inside the section element, rather than outside. (In slide shows, this option causes footnotes on a slide to be displayed at the bottom of the slide.) Closes #8695.
2023-03-13Jira reader: add panel title as nested divAlbert Krewinkel
The title of a jira panel is added in a nested div as the first element of the div panel. Fixes: #8681
2023-03-05JATS reader: avoid generating duplicate figure captions.John MacFarlane
Closes #8669.
2023-03-03Asciidoc writer: Properly escape `|` in table cells.John MacFarlane
Closes #8665.
2023-03-01Make sure TSV reader doesn't gobble tabs as whitespace.John MacFarlane
Closes #8661.
2023-03-01Org reader: accept empty tablesAlbert Krewinkel
Fixes: #8659
2023-02-24RST reader: align with spec in syntax for role names.John MacFarlane
In particular, we now allow colons in row names. Closes #8653.
2023-02-22LaTeX writer: do not use longtable foot with BeamerAlbert Krewinkel
The table foot is made part of the table body, as otherwise it won't show up in the output. The root cause for this is that longtable cannot detect page breaks in Beamer. Fixes: #8638
2023-02-18JATS writer: include alt-text in `<graphic>`, `<inline-graphic>` elementsAlbert Krewinkel
Closes: #8631
2023-02-09Citeproc: Fix bug in metaValueToReference.John MacFarlane
This bug caused us to get some repeated content when converting MetaBlock to Inlines. Closes #8611.
2023-02-01Handle % in biblatex doi field.John MacFarlane
Closes #8595.
2023-02-01Add some diagnostics to newif test.John MacFarlane
2023-01-23LaTeX reader: Fix bug in macro resolution for environments.John MacFarlane
This is a regression in pandoc 3.0 that affects environments with arguments. Closes #8573.
2023-01-20HTML writer: don't omit newlines in task lists.John MacFarlane
2023-01-20HTML writer: don't disable checkboxes in task lists.John MacFarlane
Closes #8562.
2023-01-16Add tests for org tagsAlbert Krewinkel
These were intended to be part of commit 0cc908519.
2023-01-15Markdown, CommonMark: add support for wiki links. [API change]Albert Krewinkel
Adds the Markdown/CommonMark extensions `wikilinks_title_after_pipe` and `wikilinks_title_before_pipe`. The former enables links of style `[[Name of page|Title]]` and the latter `[[Title|Name of page]]`. Titles are optional in both variants, so this works for both: `[[https://example.org]]`, `[[Name of page]]`. The writer is modified to render links with title `wikilink` as a wikilink if a respective extension is enabled. Pandoc will use `wikilinks_title_after_pipe` if both extensions are enabled. Closes: #2923
2023-01-13Remove block constructor Null from the code base.John MacFarlane
It has been removed from pandoc-types.
2023-01-13Support complex figures. [API change]Albert Krewinkel
Thanks and credit go to Aner Lucero, who laid the groundwork for this feature in the 2021 GSoC project. He contributed many changes, including modifications to the readers for HTML, JATS, and LaTeX, and to the HTML and JATS writers. Shared (Albert Krewinkel): - The new function `figureDiv`, exported from `Text.Pandoc.Shared`, offers a standardized way to convert a figure into a Div element. Readers (Aner Lucero): - HTML reader: `<figure>` elements are parsed as figures, with the caption taken from the respective `<figcaption>` elements. - JATS reader: The `<fig>` and `<caption>` elements are parsed into figure elements, even if the contents is more complex. - LaTeX reader: support for figures with non-image contents and for subfigures. - Markdown reader: paragraphs containing just an image are treated as figures if the `implicit_figures` extension is enabled. The identifier is used as the figure's identifier and the image description is also used as figure caption; all other attributes are treated as belonging to the image. Writers (Aner Lucero, Albert Krewinkel): - DokuWiki, Haddock, Jira, Man, MediaWiki, Ms, Muse, PPTX, RTF, TEI, ZimWiki writers: Figures are rendered like Div elements. - Asciidoc writer: The figure contents is unwrapped; each image in the the figure becomes a separate figure. - Classic custom writers: Figures are passed to the global function `Figure(caption, contents, attr)`, where `caption` and `contents` are strings and `attr` is a table of key-value pairs. - ConTeXt writer: Figures are wrapped in a "placefigure" environment with `\startplacefigure`/`\endplacefigure`, adding the features caption and listing title as properties. Subfigures are place in a single row with the `\startfloatcombination` environment. - DocBook writer: Uses `mediaobject` elements, unless the figure contains subfigures or tables, in which case the figure content is unwrapped. - Docx writer: figures with multiple content blocks are rendered as tables with style `FigureTable`; like before, single-image figures are still output as paragraphs with style `Figure` or `Captioned Figure`, depending on whether a caption is attached. - DokuWiki writer: Caption and "alt-text" are no longer combined. The alt text of a figure will now be lost in the conversion. - FB2 writer: The figure caption is added as alt text to the images in the figure; pre-existing alt texts are kept. - ICML writer: Only single-image figures are supported. The contents of figures with additional elements gets unwrapped. - HTML writer: the alt text is no longer constructed from the caption, as was the case with implicit figures. This reduces duplication, but comes at the risk of images that are missing alt texts. Authors should take care to provide alt texts for all images. Some readers, most notably the Markdown reader with the `implicit_figures` extension, add a caption that's identical to the image description. The writer checks for this and adds an `aria-hidden` attribute to the `<figcaption>` element in that case. - JATS writer: The `<fig>` and `<caption>` elements are used write figures. - LaTeX writer: complex figures, e.g. with non-image contents and subfigures, are supported. The `subfigure` template variable is set if the document contains subfigures, triggering the conditional loading of the *subcaption* package. Contants of figures that contain tables are become unwrapped, as longtable environments are not allowed within figures. - Markdown writer: figures are output as implicit figures if possible, via HTML if the `raw_html` extension is enabled, and as Div elements otherwise. - OpenDocument writer: A separate paragraph is generated for each block element in a figure, each with style `FigureWithCaption`. Behavior for single-image figures therefore remains unchanged. - Org writer: Only the first element in a figure is given a caption; additional block elements in the figure are appended without any caption being added. - RST writer: Single-image figures are supported as before; the contents of more complex images become nested in a container of type `float`. - Texinfo writer: Figures are rendered as float with type `figure`. - Textile writer: Figures are rendered with the help of HTML elements. - XWiki: Figures are placed in a group. Co-authored-by: Aner Lucero <4rgento@gmail.com>
2023-01-11Use jira-wiki-markup 1.5.0Albert Krewinkel
Fixed issues with icon-like sequences at the beginning of words. Fixes: #8511
2023-01-05isURI: don't require non-ASCII characters to be escaped.John MacFarlane
Closes #8508.
2023-01-04Use `\toprule\noalign{}` instead of `\toprule()` in LaTeX tables.John MacFarlane
And similar for `\midrule` and `\bottomrule`. This facilitates redefining `\toprule`, `\midrule`, and `\bottomrule` without needing to gobble the ()s. Closes #8223.
2022-12-22Support "software" type in biblatex <-> CSL conversions.John MacFarlane
Closes #8504.
2022-12-20Shared: use LineBreak as default block sep in blocksToInlinesAlbert Krewinkel
This change also affects the `pandoc.utils.blocks_to_inlines` Lua function. Closes: #8499
2022-12-20Markdown writer: avoid HTML fallbacks in the generated TOC.Albert Krewinkel
The generated table of contents usually has IDs for each TOC link, allowing to link back to specific parts of the TOC. However, this leads to unidiomatic markup in formats like gfm, which do not support attributes on links and hence fall back to HTML. The IDs on TOC items are now removed in that case, leading to more aesthetic TOCs. Closes: #8131
2022-12-16ConTeXt writer: fix previous commit for some unlisted sectionsAlbert Krewinkel
Unlist sections even if `--top-level-division` is not defined.
2022-12-16ConTeXt writer: add support for unlisted, unnumbered headingsAlbert Krewinkel
Closes: #8486
2022-12-15Textile reader: handle empty paragraphs.John MacFarlane
Also, if attributes are added explicitly to a paragraph, put it in a Div with the attributes. Closes #8487.
2022-12-08Shared: change defaultBlocksSeparator to PARAGRAPH SEPARATORAlbert Krewinkel
This Unicode char (U+2029) is intended as a semantic separator between paragraphs; it is cleaner and less intrusive than the pilcrow sign that we used before. This also changes the default `sep` value used in the `pandoc.utils.blocks_to_inlines` Lua function.
2022-11-29DocBook writer: Fix position of textobject.John MacFarlane
It is a child of `inlinemediaobject`, not `imageobject`. Add regression tests for #8437. Closes #8437.