Replace list comprehension filters (which materialize the full
list) with 'any isPara', allowing early exit on the first match.
Co-Authored-By: Claude <noreply@anthropic.com>
Build the result as a Char list and T.pack once, instead of
repeatedly concatenating Text values (each O(n) in the result
length).
Co-Authored-By: Claude <noreply@anthropic.com>
Use the OverloadedStrings literal " " directly instead of
T.pack " ", avoiding an unnecessary pack call on every tab.
Co-Authored-By: Claude <noreply@anthropic.com>
MediaBag test used `inDirectory` (which calls `setCurrentDirectory`),
changing the process-wide CWD and causing other parallel tests
to fail with "does not exist" errors on relative paths.
Replace with absolute paths so the test no longer changes CWD.
Closes#11566.
Co-Authored-By: Claude <noreply@anthropic.com>
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 avoids an empty block for documents that lack metadata
information. The empty block causes problems if `#set page`
is used, as it will cause a page break.
Closes#11529.
Previously we were getting image size of 0 when a percentage
was specified for width or height on SVG. With this change,
we simply ignore these percentages (becaues ImageSize doesn't
know the size of the containing element).
Closes#11530.
Previously, when a w:p paragraph contained runs with textboxes,
the entire paragraph was replaced by just the textbox content,
discarding all other runs (including image-bearing runs).
Now we walk the paragraph's children in order, grouping
non-textbox content into copies of the original w:p and splicing
unwrapped textbox content in place, preserving the original order.
We also treat text inside a textbox containing an image as a
figure caption. (One often finds captioned images of this
kind in docx files.)
Closes#11510.
Closes#6893.
Closes#11412.
Closes#5394.
Closes#9633.
Co-Authored-By: Claude <noreply@anthropic.com>
...such as /media. This can be produced by the online version
of Word. (Desktop Word uses paths relative to word/.) With this change,
media stored at an absolute path will be stored with its original
name and not given a SHA1-based name.
Closes#11518.