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.
Inline images now emit `text:anchor-type=as-char` on their `draw:frame`,
anchoring the frame as a character so it flows with the surrounding text.
Without this, consumers default to paragraph anchoring and float the frame
beside (or after) the following paragraph.
When both width and height are given and the width is a percentage,
the width is now resolved against the reference document text area width,
mirroring how the docx writer derives its print width from the reference docx
section properties. The height follows the aspect ratio.
(or equivalent, e.g. 'i'). This brings the markdown
parser in line with commonmark, and avoids a lot of
unintended list starts. Closes#11735.
Note that ordered lists that are not sublists may
still start with numbers other than 1.
...strings that are numbers beginning with 0 or ending with 0 and
having a decimal point. Otherwise they will read as YAML numbers
and potentially be modified (e.g. 3.10 -> 3.1).
It would be better to fix this on the reader side, but since
we use a standard YAML parser it's hard to see how.
Closes#11715.
Headings without an explicit label can now be assigned automatic
identifiers based on the heading text, making them linkable in a
generated table of contents. The extension is available for the
typst reader but is off by default; enable it with
`-f typst+auto_identifiers`. The related `gfm_auto_identifiers` and
`ascii_identifiers` extensions are also made available.
Closes#11041.
Text.Pandoc.Readers.Typst.Parsing: PState gains sOptions,
sIdentifiers, and sLogMessages fields, and now has
HasReaderOptions, HasIdentifierList, and HasLogMessages
instances, allowing reuse of the shared registerHeader. (Not an
API change.)
Co-Authored-By: Claude <noreply@anthropic.com>
Previously we failed to detect horizontal rules when the
underlying XML contained text elements for semantically
insignificant whitespace. We also failed to handle the case
where a paragraph contains text and has a bottom border
property: this seems to be what Word does when you insert
a horizontal rule, e.g. by typing a series of hyphens or #
characters.
Closes#11689.
Closes#11682.
Fixes two bugs that caused a simple table to be read as a cascade of
nested tables:
* `\plain` reset the entire property record (including the in-table
flag) via `const def`. When a cell paragraph used `\plain` after
`\intbl`, the in-table flag was cleared, so the next `\cell` closed
the partially-built table and embedded it inside a new cell. Per the
RTF spec, `\plain` should reset only character formatting, so it now
preserves paragraph/context properties (in-table, list level, outline
level, hyperlink, anchor).
* `\row` was ignored and only `\trowd` started a new row. Real-world
RTF often emits a single `\trowd` and separates rows with `\row`, so
every cell ended up in one row. Both `\trowd` and `\row` now begin a
fresh row (only when the current one has cells), and empty trailing
rows are dropped when closing the table.
Co-Authored-By: Claude <noreply@anthropic.com>
Add support for the `auto_identifiers`, `gfm_auto_identifiers`, and
`ascii_identifiers` extensions in the man reader. Section headings
parsed from .SH and .SS macros now receive auto-generated id
attributes when the extension is enabled, enabling `--toc` to
produce working anchor links.
- Add `autoIdExtensions` to default man extensions [behavior change]
- Add `HasReaderOptions`, `HasLogMessages` and `HasIdentifierList` to
`ManState` to run `registerHeader`
Closes#8852.
Like the other table syntaxes (pipe, simple, and multiline tables) and
block-level constructs generally, a grid table may now be indented by up
to three spaces and still be recognized as a table. Previously the
grid-table parser required the table to begin at the left margin, so an
indented grid table was parsed as a paragraph.
The leading indentation is stripped uniformly from each line before the
table is parsed, so an indented grid table produces the same AST as its
non-indented equivalent.
Adds a command test.
Previously the OpenDocument writer emitted a fresh automatic style
(L1..Ln, P1..Pn, T1..Tn) for nearly every list, list-item paragraph,
block quote, preformatted block, and inline text style. This produced
large ODT files, made `--reference-doc` customization ineffective (the
user's predefined styles were never referenced), and gave each list its
own indentation independent of any containing block quote.
This commit teaches the writer to reference the predefined styles that
LibreOffice ships and that pandoc's reference.odt now exports:
- Bullet lists use `List_20_1`; ordered lists with default start and
decimal format use `Numbering_20_1`. Non-default ordered lists
generate a single named override style (`Pandoc_Numbering_N`)
memoised by (ListNumberStyle, ListNumberDelim); a non-default start
value with the default format is expressed via `text:start-value`
on the `text:list` element instead of a new style.
- List-item paragraphs use `List_20_Bullet[_Tight]` and
`List_20_Number[_Tight]`. The Tight variants are pandoc-specific
(zero top/bottom margin) and are injected into the user's
reference.odt if missing, just like the Skylighting token styles.
- Block quotes use the predefined `Quotations` paragraph style
directly. Nested block quotes use a single automatic style that
inherits from Quotations and only adds extra margin-left, so a list
inside a block quote now inherits its container's indent (#2747).
- Preformatted blocks use `Preformatted_20_Text` directly.
- Emphasis, Strong, Strikeout, Subscript, Superscript and Code spans
use the predefined `Emphasis`, `Strong_20_Emphasis`, `Strikeout`,
`Subscript`, `Superscript` and `Source_20_Text` text styles.
- `paraStyle`/`paraStyleFromParent` no longer emit a wrapper automatic
style when its only attribute would be `parent-style-name`; the
parent name is returned directly.
Closes#9136.
Closes#5086.
Closes#2747.
Closes#3426.
Closes#7336.
Co-authored by: Claude Opus 4.7.
We parse these as DefinitionList items, but we previously
sometimes stopped prematurely in including material in the
definition. We should include everything until we hit a new
indentation-changing macro.
Closes#11668.
This change ensures that raw content marked `epub2` will appear in (only) EPUBv2 output
and content marked `epub3` will appear in (only) EPUBv3 output.
This allows one to pass parameters to typst, which are available
at `sys.inputs`, just as `typst` itself does with its `--input`
option.
[API changes]
* ReaderOptions has a new field `readerTypstInputs`.
* Opt has a new field `optTypstInputs`.
Closes#11588.
For paragraphs beginning with literal `#`, `*`, or other things
that would otherwise produce lists, we insert `<nowiki></nowiki>`
rather than (as previously) `\`. `\` does not work to escape
these.
Closes#11563.
- Properly handle the case where the first item is an indented
code block. (Closes #11542.)
- Use correct indentation when `four_space_rule` extension is
disabled.
This change allows users to style images in InDesign bysetting the
`object-style` attribute in a pandoc Image, which is mapped to the
AppliedObjectStyle attribute in the Rectangle element around
an Image element in the resulting ICML.
RevealJS defaults scrollProgress to 'auto', but the writer was
setting it to true. Use lookupMeta to distinguish between
MetaBool True, MetaBool False, and unset (defaulting to 'auto').
The template uses a helper variable scrollProgressAuto since
pandoc templates cannot distinguish a MetaString "auto" from
MetaBool True in a single variable.
Remove quotes from scrollActivationWidth (should be a number,
not a string). Use $if/$else$ guard for scrollSnap so that
`false` renders as a boolean literal rather than the string
'false'. Add /nowrap to scrollSnap and scrollLayout.
This borrows a test case taken mostly from #11394 by @mcanouil
but the code is fresh. The behavior is similar to what we
have with the HTML and LaTeX writers.
Obsoletes #11394.
Co-authored by @mcanouil and Claude Opus 4.6.
These commands allow separating the footnote mark from its content,
useful in tables, minipages, and other contexts where \footnote
cannot be used directly.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Closes#11450.