This allows the project to be built using `nix build` and run
using `nix run`.
The basis for this is @srid's work in #11707, with some
simplifications and improvements added on.
stack.yaml is used as a source of truth for the versions to use,
including for git repositories.
Closes#11707.
Previously ordered lists starting with a code block did not
round trip. Pandoc uses an indented code block, and according
to commonmark rules only one space is gobbled after the list
marker; however, pandoc added two. This has now been fixed.
An incidental change fixes an oddity in markua list indentation.
Closes#11762.
Given RST like
.. _target:
See |sub|.
.. |sub| replace:: `text <target_>`_
'pandoc -f rst -t html' produces
<div id="target">
<p>See <a href="##REF##target">text</a>.</p>
</div>
instead of the expected
<div id="target">
<p>See <a href="#target">text</a>.</p>
</div>
It formerly worked and regressed with c8fda8f4d ("RST reader: Use a new
one-pass parsing strategy."), release 3.6.
What happens is that during parsing pass 1 the `replace::` value `text
<target_>`_ is parsed to
Link nullAttr [Str "text"] ("##REF##target", "")
and is stored in ParserState's substitution table. Separately, '|sub|'
usage is parsed to
Link nullAttr [Str "|sub|"] ("##SUBST##|sub|", "")
and is stored in the document tree. resolveReferences then replaces the
placeholder in the document node with substitution table node during
walkM. However, the freshly substituted ##REF## placeholder was not
revisited further, and appeared unresolved in the output.
To fix it, we resolve the node recursively until the result contains no
more placeholder. We must protect from self-references to avoid
endless recursion.
Previously, when a slide contained bullet points before and after a
table, content would be split across multiple slides or use a two-column
layout that didn't preserve the source order.
This change:
1. Modified `splitBlocks'` in Presentation.hs to continue accumulating
content after tables instead of immediately splitting to a new slide.
2. When a slide has a table with surrounding text, use ContentSlide
(single column) instead of ContentWithCaptionSlide (two columns)
to preserve content order.
3. Added vertical stacking in Output.hs (shapesToElementsStacked) to
properly position multiple shapes (tables + text) within a content
area. Space is allocated proportionally based on content size
(paragraphs and table rows).
Closes#11433.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Chris Callison-Burch <ccb+github@upenn.edu>
`t2t` is now supported as an output format, producing Txt2Tags
markup (<https://txt2tags.org>). The writer covers headers, lists
(bullet, ordered, definition), tables, links, images, code blocks,
inline formatting, and raw txt2tags/HTML passthrough.
[API change]
Adds a new module Text.Pandoc.Writers.Txt2Tags, exporting
`writeTxt2Tags`. Also exported from Text.Pandoc.Writers.
Co-authored-by: luginf <alan@luginf>
Clarify the risks of using pandoc in a web service and explain
how to do so more safely. Note some specific vulnerabilities
with the pdf-engine `wkhtmltopdf`.
This incorporates the suggestions made in #11262 and also
benefits from a report by Kai Aizen.
When the `float` class is attached to a table, a standard
floating `table` will be generated instead of a `longtable`.
Placement can be specified via the `latex-placement` attribute.
This will help, especially, those who use two-column layouts,
since `longtable` is incompatible with these.
Small change to the default LaTeX template: the `caption`
package is included and a default spacing set between the caption
and the table.
Closes#1023.
Modified default template to remove custom show rule for
terms. Instead, we use a set rule to set hanging-indent.
For tight list items consisting of just one Plain block,
we no longer create a `#block` for the definition; this allows
it to remain on the same line as the term.
This just affects whether a blank line is emitted in the markup.
Note that pandoc's default template contains a show rule for
terms that will make these blank lines irrelevant, but this change
allows one to use tight lists with custom templates.
The fontsize is specified in a variable or metadata field
and passed through the renderer via a Reader monad.
Closes#11750.
Co-Authored-By: Claude <noreply@anthropic.com>
Previously it would sometimes create doubled section divs.
By leaving the inner heading's id on the heading itself, and
then consolidating the inner and outer section divs, we can
avoid this undesirable result.
Closes#11745.