Merged cells in a table were ignored: a merged cell's text stayed in
its first cell, and every cell it covered was read as an empty cell of
its own.
A cell's `gridSpan` and `rowSpan` now become its column and row span,
and the cells it covers (`hMerge`, `vMerge`) are left out. As a cell
can't span the header row and the body, a span from the header row is
kept to that row; the body cells it covered become empty cells. Row
spans are clipped to the rows there are.
The test fixture was written with python-pptx 1.0.2.
Slides hidden from the slide show (`show="0"` on `p:sld`) were read
like any other, with nothing to tell them apart. They are still read,
now with the class `hidden` on their header.
The MANUAL now says how slides are read: a level-2 heading with the
identifier `slide-N`, then the slide's content.
The test fixture was written with python-pptx 1.0.2.
Discussed in #12023.
Key caches on a hash of the dependency plan, computed by a new composite
action, so that CI, nightly, and release candidate builds use the same
cabal store. Use the same cabal version everywhere and pass
`--enable-tests`, since both affect the unit ids of dependencies.
Nightly now uses cabal build and list-bin, because cabal install
doesn't accept `--enable-tests`.
Save caches only on pushes to main. Replace secrets.CACHE_VERSION,
which is empty in PRs from forks, so that those PRs restore main's
caches instead of rebuilding and saving their own.
Pass --enable-tests to cabal test on Linux, so that it doesn't
recompile everything compiled by cabal build.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Numbers were rendered with Haskell's `show`: 0.05 became 5.0e-2,
12345678 became 1.2345678e7, 21 became 21.0, and floating-point noise
showed (0.30000000000000004). Booleans became 1.0 and 0.0.
Numbers are now rendered as Excel's General format renders them, except
that they aren't rounded to fit a column: at most 15 significant digits
(Excel's precision) and no trailing zeros. Numbers with 12 or more
digits before the decimal point use scientific notation, as General
does, but keep all their digits (1.23456789012E+11); so do numbers
below 1e-9. Booleans read as TRUE and FALSE.
Cells with another number format (dates, percentages, fixed decimals)
are still rendered this way.
The test fixture was written part by part with a Python script.
Discussed in #12023.
Number formats were ignored, so a date came out as its serial number
(45231.0 rather than 2023-11-01).
The reader now reads the custom number formats (`numFmts`) and each
cell format's `numFmtId`. A number in a cell whose format shows a date
or time is rendered as an ISO 8601 date (2023-11-01), a time (14:30, or
14:30:05 if the format shows seconds), or both, joined by a space. The
formats recognised are the built-in ones (14-22, 45 and 47) and custom
ones whose first section has a date or time token (y, m, d, h, s)
outside quoted text, escapes and brackets. The workbook's 1904 date
system is honoured, as is the 1900 system's nonexistent 29 February
1900.
Durations, such as built-in format 46 (`[h]:mm:ss`) or a custom `[h]:mm`,
are left as numbers, as are negative numbers and day 0 under a format
that shows the date.
The test fixtures were written part by part with a Python script.
Discussed in #12023.
A cell's style index (`s`) refers to a cell format in `cellXfs`, which
refers to a font by `fontId`. The reader used the style index as a font
index directly, so cells got another cell format's bold and italic. In
80 test workbooks, a fifth of the non-empty cells had the wrong
emphasis.
Fonts are now looked up through the cell format.
The test fixture was written part by part with a Python script. Its
cell formats point at the fonts out of order.
Emph within emph becomes upright. This is important for correct
formatting of titles in CSL, among other things. LaTeX does this
automatically, and in HTML we achieve it via CSS.
Closes#11961.
Cells of type `inlineStr` keep their text in an `is` element rather
than in `v`, so they were read as empty and dropped. openpyxl writes
every string this way.
Rich-text shared strings were read by joining the text of all their
descendants with spaces. A run boundary inside a word or before
punctuation added a space ("Hel lo", "< 100T"), and phonetic runs
(`rPh`) leaked into the text.
Both now take the text of their `t`, or of their runs' `t`,
concatenated as written, skipping phonetic runs.
The test fixture was written part by part with a Python script.
Closes#12014.
Relationship targets were turned into archive paths by prefixing
`xl/`. OPC also allows targets relative to the package root, starting
with `/`, and openpyxl (and so pandas) writes worksheet targets that
way, so every workbook they write failed with "Entry not found:
xl//xl/worksheets/sheet1.xml". A root relationship to
`/xl/workbook.xml` failed the same way.
Targets are now resolved as OPC specifies: a target starting with `/`
from the package root, any other relative to the folder of the part
that holds the relationship. This applies to the workbook, worksheets,
shared strings and styles.
The test fixture was written part by part with a Python script, using
absolute targets throughout.
Closes#12013.
Only the top-level children of a slide's shape tree were parsed, so
everything inside a group shape (`p:grpSp`) was dropped silently: text
boxes, pictures and tables. Groups, including nested ones, are now
replaced by the shapes they contain, in document order.
The test fixture was written with python-pptx 1.0.2.
Closes#12017.
The text of a paragraph was built by joining all its `a:t` elements
with spaces. A run boundary can fall anywhere, often inside a word or
before punctuation, so "Ever|worker" read as "Ever worker" and
"openai|, anthropic" as "openai , anthropic". Line breaks (`a:br`)
were dropped, and each paragraph went into a single Str.
Runs and fields are now concatenated as written, `a:br` becomes a
LineBreak, and the text is split into Str and Space with the builder.
Slide titles, table cells and SmartArt nodes, which are built from the
same text, get the same treatment; their paragraphs are still joined
with a space.
The helpers live in Text.Pandoc.Readers.OOXML.Shared, as SmartArt
can't import from Shapes.
The test fixture was written with python-pptx 1.0.2.
Closes#12016.
Since #10308, the presence of a .toc file forced a rerun after every
run, so documents with a TOC always got the maximum of 4 runs, while
the comment (and #10308) only require 3.
Co-authored-by: Alain Lesage <15161099+Alain-L@users.noreply.github.com>
Without `+styles`, consecutive "Source Code" paragraphs are combined
into a single code block by `combineBlocks`. With `+styles`, each
paragraph is first wrapped in a `Div` carrying its `custom-style`
attribute, so the `CodeBlock` case no longer matched and every line
became its own `Div [CodeBlock]`.
Add a case that merges adjacent `Div [CodeBlock]` blocks when both the
`Div` and the `CodeBlock` attributes are equal.
Closes#9183.
filterIpynbOutput stripped ANSI escapes from output code blocks by
rebuilding the text one character at a time with T.cons, so time was
quadratic in the length of the output. A notebook with one 32,000-line
stream output took 4.3 s to convert to HTML; the notebooks attached to
#7744 took 42 s. Split at each ESC [ with T.breakOn and join the pieces
once instead. Output is unchanged.
Add test/command/7744.md, since nothing tested the stripping itself.
Closes#7744.
These can be put in cabal.project.local.
This will ensure that the same options are used by HLS,
so that rebuilds aren't needed.
An alternative approach would be to use a different build
directory (dist-newstyle) for the unoptimized make build target.
Such dates produced an empty dc:date, which epubcheck rejects.
They are now dropped; if no date remains, the current time is used,
as when no date is given.
Co-authored-by: Alain Lesage <15161099+Alain-L@users.noreply.github.com>
When content precedes the first level-1 header, a header with the
title is added. Its generated identifier could duplicate an existing
header's, so the TOC and internal links pointed to the wrong chapter.
Co-authored-by: Alain Lesage <15161099+Alain-L@users.noreply.github.com>
Extends the fix for #11888 (c8c68ec0a) to footnote definitions in
the Markdown reader and to grid table cells. Otherwise, when one of
these ends a file, relative paths in it can be rebased against the
next file on the command line.
Closes#12001.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since 3.2.1 these characters could no longer precede an inline
markup start-string or a bare URI or email address, although the
reStructuredText spec allows them. So <https://example.com> was not
a link and <jane-doe@example.com> became a link to doe@example.com.
Also implement the rule that a start-string between an opening
character and its closing counterpart, as in (*) or "*", is not
inline markup.
The contents of footnotes, endnotes and comments were read with the
namespace prefixes declared in word/document.xml rather than in their
own parts. If word/footnotes.xml, word/endnotes.xml or word/comments.xml
declared a prefix that document.xml did not, such as `r` or `m`, the
elements using it were dropped: a hyperlink in a footnote lost its text,
and an equation in an endnote or comment disappeared. They are now read
with the namespace maps that archiveToNotes and archiveToComments
already compute.
Closes#11991.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>