aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Writers
AgeCommit message (Collapse)Author
13 daysPPTX writer: support notes field in metadata for title slide (#11396)Chris Callison-Burch
This adds support for a `notes` field in the YAML metadata block that will be used as speaker notes for the title slide in PowerPoint output. Previously, there was no way to add speaker notes to the title slide since it is generated from metadata rather than from content blocks. The `::: notes` syntax only works for content slides. Example usage: --- title: My Presentation notes: | Welcome everyone to this presentation. Remember to introduce yourself. --- Closes #5844 (for PPTX output). Co-authored-by: Chris Callison-Burch <[email protected]>
2026-01-07Fix docx writer: skip directory entries when building media overrides (#11379)You Jiangbin
Pandoc's docx writer was previously adding an `<Override>` for `/word/media/` in `[Content_Types].xml` when the reference doc contains media, which violates OPC rules and causes Word to report corruption.
2025-11-30pptx writer: Handle reference doc without slides (#11310)Tuong Nguyen Manh
An empty `sldIdLst` is now added if the reference doc is missing one so that `modifySldIdLst` can replace it. To ensure PowerPoint doesn't say that the file will need fixing, the `sldIdLst` has to be placed after the `sldMasterIdLst`. I also added a test to ensure that if there are notes, they will be placed between the `sldMasterIdLst` and `sldIdLst`. Otherwise PowerPoint wouldn't show the slide of a note when viewing Notes Pages. Closes #7536.
2025-11-05Add BBCode writer (#11242)reptee
`bbcode` is now supported as an output format, as well as variants `bbcode_fluxbb` (FluxBB), `bbcode_phpbb` (phpBB), `bbcode_steam` (Hubzilla), `bbcode_hubzilla` (Hubzilla), and `bbcode_xenforo` (xenForo). [API change] Adds a new module Text.Pandoc.Writers.BBCode, exporting a number of functions. Also exports `writeBBCode`, `writeBBCodeSteam`, `writeBBCodeFluxBB`, `writeBBCodePhpBB`, `writeBBCodeHubzilla`, `writeBBCodeXenforo` from Text.Pandoc.Writers.
2025-09-08pptx writer: Handle single columnTuong Nguyen Manh
Add an additional guard for a single column to be able to process it.
2025-09-02Refactor highlighting options [API Change]Albert Krewinkel
A new command line option `--syntax-highlighting` is provided; it takes the values `none`, `default`, `idiomatic`, a style name, or a path to a theme file. It replaces the `--no-highlighting`, `--highlighting-style`, and `--listings` options. The `writerListings` and `writerHighlightStyle` fields of the `WriterOptions` type are replaced with `writerHighlightStyle`. Closes: #10525
2025-09-02Change `latex-pos` to `latex-placement`.John MacFarlane
2025-09-01LaTeX writer: control figure placement with attribute (#11094)Sean Soon
If a `latex-pos` attribute is present on a figure, it will be used as the optional positioning hint in LaTeX (e.g. `ht`). With implicit figures, `latex-pos` will be added to the figure (and removed from the image) if it is present on the image. Closes #10369.
2025-05-28Fix whitespace bugs.John MacFarlane
2025-05-28Adding support for sidebars to Asciidoc writerGreg
2025-05-26LaTeX writer: include alt option in `\includegraphics`.John MacFarlane
Closes #6095.
2025-03-17Markdown writer: avoid spaces after/before open/close delimiters.John MacFarlane
E.g. instead of rendering `x<em> space </em>y` as `x* space *y` we render it as `x *space* y`. Closes #10696.
2025-02-12Markdown writer: omit extra space after bullets.John MacFarlane
We used to insert extra spaces to ensure that the content respected the four-space rule. That is not really necessary now, since pandoc's markdown and most markdowns don't follow the four-space rule. Those who want the old behavior can obtain it by using `-t markdown+four_space_rule`. Closes #7172.
2024-12-28AsciiDoc writer: improve escaping.John MacFarlane
Closes #10385. Closes #2337. Closes #6424.
2024-10-01RST writer: change bullet list hang from 3 to 2.John MacFarlane
This accords with the style in the reference docs.
2024-07-27Docx writer: fix regression with nested lists.John MacFarlane
Closes #9994. The bug affects e.g. ordered lists with bullet sublists; after the sublist the top-level list reverts to bullets instead of being properly numbered. This regression was introduced in version 3.2.1 and was caused by commit f5531f1.
2024-06-23LaTeX writer: new method for ensuring images don't overflow.John MacFarlane
Previously we relied on graphicx internals and made global changes to Gin to force images to be resized if they exceed textwidth. This approach is brittle and caused problems with `\includesvg` (see #9660). The new approach uses a new macro `\pandocbounded` that is now defined in the LaTeX template. (Thanks here to Falk Hanisch in https://github.com/mrpiggi/svg/issues/60.) The LaTeX writer has been changed to enclose `\includegraphics` and `\includesvg` commands in this macro when they don't explicitly specify a width or height. In addition, the writer now adds `keepaspectratio` to the `\includegraphics` or `\includesvg` options if `height` is specified without width, or vice versa. Previously, this was set in the preamble as a global option. Compatibility issues: - If custom templates are used with the new LaTeX writer, they will have to be updated to include the new `\pandocbounded` macro, or an error will be raised because of the undefined macro. - Documents that specify explicit dimensions for an image may render differently, if the dimensions are greater than the line width or page height. Previously pandoc would shrink these images to fit, but the new behavior takes the specified dimensions literally. In addition, pandoc previously always enforced `keepaspectratio`, even when width and height were both specified, so images with width and height specified that do not conform to their intrinsic aspect ratio will appear differently. Closes #9660.
2024-06-04Docx writer: better formatting for task lists.John MacFarlane
Task lists are now properly formatted, with no bullet. In addition, we have removed an expensive generic traverse to remove Space elements, and replaced it with code in `inlinesToOpenXML`. This should give better performance; it also reduces XML size in the metadata, which wasn't previously affected by the de-Spacing. TODO: parse this in the reader so that we can have task lists round-trip. Closes #5198.
2024-04-23Markdown writer: don't use `raw_attribute` syntax for raw...John MacFarlane
blocks, unless there is no other option. Mainly this is motivated by #9677. If we put raw tex in a raw_attribute block, then the macros don't get interpreted when it is read again by pandoc's markdown reader.
2023-12-18test(docx): also compare number of childrenEdwin Török
This detects if a tag gets added/removed, or moves within the hierarchy. Signed-off-by: Edwin Török <[email protected]>
2023-12-10LaTeX writer: fix bug with big footnotes inside emphasis (#9168)Hikaru Ibayashi
Closes #8982.
2023-08-19LaTeX writer: improve internal links and targets.John MacFarlane
We no longer wrap section headings in a `\hypertarget`. This is unnecessary (hyperref creates an anchor based on the label) and it interferes with tagging. In addition, we now use `\hyperref` rather than `\hyperlink` for internal links. Currently `\hypertarget` is still being used for link anchors not on headings. Closes #8744. Thanks to @u-fischer.
2023-07-18JATS writer: don't use `<code>` for inline code.John MacFarlane
See #8889. The Taylor and Francis guide to JATS says that `<code>` is block level and not intended to be used inline within standard text.
2023-07-05Fix asciidoc testsJohn MacFarlane
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-05-09Rename test/docx/block_quotes_parse_indent.native for consistencyStephan Meijer
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-02-18JATS writer: include alt-text in `<graphic>`, `<inline-graphic>` elementsAlbert Krewinkel
Closes: #8631
2023-01-14Remove Null constructor from docsAlbert Krewinkel
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 <[email protected]>
2023-01-12Store "unnumbered" class in DocBook role attribute (#8481)lifeunleaded
Markdown allows marking a heading as unnumbered, which is stored as a class token internally. This change will recognize this particular class token and append it to the role attribute, or create a role attribute with it if needed. This does not imply any processing in DocBook but is intended to let customized stylesheets identify these sections and act accordingly. Closes #1402
2022-12-17ConTeXt writer: always use `\type` for inline codeAlbert Krewinkel
Inline codes that contained curly braces where previously rendered with `\mono`; this led to unexpected results when the presentation of `\type` was customized, as those changes would not have been applied to code rendered with `\mono`.
2022-11-19LaTeX writer: Use soul instead of ulem for strikeout, underline.John MacFarlane
This handles things like hyphenation, line breaks, and nonbreaking spaces better. Closes #8411.
2022-10-24Rename T.P.Writers.Docbook -> T.P.Writers.DocBook.John MacFarlane
Similarly, rename `writeDocbook` -> `writeDocBook`, for consistency with the DocBook reader's naming. [API change]
2022-10-02Officially deprecate writeJATS...John MacFarlane
in favor of writeJatsArchiving.
2022-09-28HTML Reader: Tests for 'tt' and 'code' elements (#8330).Justin Wood
tt is a deprecated element in HTML, but is still used in the wild in some places, support reading it as just another 'code' element. Commit 4abb9d0ad8dbb88fbc443a78d5a1b116cb7a5816 was originally part of this PR as well.
2022-09-27Fix small whitespace things.John MacFarlane
2022-08-22Org writer: keep code block attributes as header args.Albert Krewinkel
This allows to keep more information in the resulting `src` blocks, making it easier to roundtrip from or through Org. Org babel ignores unknown header arguments.
2022-08-22Org writer: add code block identifier as `#+name` to src blocks.Albert Krewinkel
2022-07-16RST writer: Fix missing spaces with nested inlines.John MacFarlane
Previously spaces around links inside italics were omitted. Closes #8182.
2022-06-21ConTeXt writer: support complex table structures. (#8116)Albert Krewinkel
The following table feature are now supported in ConTeXt: - colspans, - rowspans, - multiple bodies, - row headers, and - multi-row table head and foot. The wrapping `placetable` environment is also given a `reference` option with the table identifier, enabling referencing of the table from within the document.
2022-06-06ConTeXt writer: use "sectionlevel" environment for headings (#8106)Albert Krewinkel
The document hierarchy is now conveyed using the `\startsectionlevel`/`\stopsectionlevel` by default. This makes it easy to include pandoc-generated snippets in documents at arbitrary levels. The more semantic environments "chapter", "section", "subsection", etc. are used if the `--top-level-division` command line parameter is set to a non-default value. Closes: #5539
2022-02-23Tests: improve location reporting of failing testsAlbert Krewinkel
2022-02-06Docbook writer: Interpret links without contents as cross-references (#7360)Jan Tojnar
Links without text contents are converted to `<xref>` elements. DocBook processors will generate appropriate cross-reference text when presented with an xref element.
2022-01-29Use `[x]` not `[X]` for asciidoctor checklists.John MacFarlane
See #7798.
2022-01-18Docx writer: Separate tables even with RawBlocks between (#7844)Michael Hoffmann
Adjacent docx tables need to be separated by an empty paragraph. If there's a RawBlock between tables which renders to nothing, be sure to still insert the empty paragraph so that they will not collapse together. Fixes #7724
2022-01-16Support checklists in asciidoctor writer (#7832)Nikolai Korobeinikov
The checklist syntax (similar to `task_list` in markdown) seems to be an asciidoctor-only addition. Co-authored-by: ricnorr <[email protected]>
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-07Org writer: support starting number cookiesLucas Viana
This complements #7806 by supporting writing Org ordered lists that start at a specific number.
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.