| Age | Commit message (Collapse) | Author |
|
This PR aims to handle a common run field instruction (fieldInstr)
from docx format : REF, specifically those with the "link" switch \h.
In word software, you can create REF field instruction with the
Cross-reference button. You can create cross-reference to
many things such as Equation, Table, Title...
|
|
|
|
Fixed golden test regeneration in Docx reader test.
|
|
Patch credit: @mmourino.
Closes #8189. Closes #6959.
|
|
Previously we assumed that every table took up the full text
width. Now we read the text width from the document's
sectPr.
Closes #9837.
Closes #11147.
|
|
See #11019. Previously, centering tables in `reference.docx` would leave
the header row left-aligned. Why the OOXML 'standard' would allow table
elements to be aligned differently from the rest of the table in the
first place is anyone's guess.
|
|
|
|
This should allow one to include an image in a reference.docx and
reference it in an openxml template.
Closes #10759.
|
|
Closes #10394.
|
|
This reverts commit cbe67b9602a736976ef6921aefbbc60d51c6755a.
Word sets `w:firstColumn="1"` by default for tables. You have to find
the Table Design tab and explicitly uncheck "First Column" to make this
go away. In most cases, I don't think writers intend to designate
the first column as a row head, so this commit is going to produce
unexpected results. In addition, because of the table normalization
done by pandoc-type's `tableWith`, any table containing a colspanned
cell in the left-hand column will get broken if the first column is
designated a row head. For these reasons it seems best to revert this
change, which was made in response to #9495.
Closes #10627.
|
|
Previously we were only carrying over the reference doc's sectPr
at the end of the document, so it wouldn't affect the intermediate
sections that are now added if `--top-level-division` is `chapter`
or `part`. This could lead to bad results (e.g. page numbering
starting only on the last chapter).
Closes #10577.
|
|
|
|
Reader: When `w:tblLook` has `w:firstColumn` set (or an equivalent bit
mask), we set row heads = 1 in the AST.
Writer: set `w:firstColumn` in `w:tblLook` when there are row
heads. (Word only allows one, so this is triggered by any number
of row heads > 0.)
Closes #9495.
|
|
This can be overridden by a final sectPr element in the body
of the reference.docx.
It will only change things for `--top-level-division=chapter`,
since only top-level chapters are put in separate sections.
For that use it will mean that footnote numbers start over with
each chapter, which is usually what is wanted.
Closes #2773.
|
|
See #10171.
|
|
Closes #10242.
|
|
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.
|
|
In some cases we need to break up a long text run including
both western and East Asian text, so that the punctuation in
the western text doesn't become double-wide.
Closes #9817.
|
|
- Turn captioned images into Figure elements. Closes #9391.
- Improve the logic for associating elements with captions.
Closes #9358.
- Ensure that captions that can't be associated with an
element aren't just silently dropped. Closes #9610.
|
|
This also fixes a small bug in parsing delimiters in numbered lists,
which led to the default delimiter being used wrongly in some cases.
Closes #8211.
|
|
This is more useful. Use this in OpenXML and HTML writers.
|
|
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.
|
|
Closes #5662.
|
|
Also fix tests.
|
|
The new OpenXML template had spaces for metadata that need
to be filled with OpenXML fragments with the proper shape.
This patch ensures that everything is the right shape.
Closes #9828.
|
|
We do this when the text in the run contains any CJK characters.
This ensures that ambiguous code points (e.g. quotation marks)
will be represented as "wide" characters when together with CJK
characters.
Closes #9817.
|
|
|
|
|
|
|
|
The `--reference-doc` option allows customization of styles in docx
output, but it does not allow one to adjust the content of the output
(e.g., changing the order in which metadata, the table of contents,
and the body of the document are displayed), or adding boilerplate
text before or after the document body. For these changes, one can
now use `--template` with an OpenXML template. (See the default
`openxml` template for a sample.)
This patch also allows `--include-before-body` and
`--include-after-body` to be used with `docx` output.
The included files must be OpenXML fragments suitable for
inclusion in the document body.
Closes #8338 (`--include-before-body`, `--include-after-body`).
Closes #9069 (a custom template can be used to omit the
title page).
Closes #7256.
Closes #2928.
|
|
Center Subtitle, remove color.
|
|
When the last parPart before a header was a bookmark, no span with an
anchor was added for a bookmark in the header. But the function that
adds header anchors to the anchor map, needs a span with an anchor.
So this commit adds that span.
|
|
This includes using the sans-serif font Aptos instead of
the serif font Cambria.
See #7280.
|
|
We use the default styles for headings and the title instead
of what pandoc was using.
See #7280.
|
|
See #7280.
|
|
rom reference.docx. Closes #9522.
|
|
Normally these occur outside the table element itself, but they
should still be parsed as captions in this case.
Closes #9518.
|
|
The fix to #5947 caused all tables to be left indented.
This was necessary to avoid extra indentation in table cells
when a table appeared in a list item. This change makes
the changes conditional, so that they only affect tables
in list items.
Closes #9393.
|
|
Fixes #9273
```
[
{
"Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:b'.",
"Path": {
"NamespacesDefinitions": [
"xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\""
],
"Namespaces": {
},
"XPath": "/w:document[1]/w:body[1]/w:p[1]/w:r[7]/w:rPr[1]",
"PartUri": "/word/document.xml"
},
"Id": "Sch_UnexpectedElementContentExpectingComplex",
"ErrorType": "Schema"
}
]
```
Signed-off-by: Edwin Török <[email protected]>
|
|
Copying `endnotePr` causes validation errors, because it is now
referencing something that doesn't exist in the document:
```
{
"FilePath": "test/docx/golden/custom_style_reference.docx",
"ValidationErrors": "[{\"Description\":\"Element 'w:endnote' referenced by 'endnote@http://schemas.openxmlformats.org/wordprocessingml/2006/main:id' does not exist in part '/MainDocumentPart/EndnotesPart'. The reference value is '0'.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:settings[1]/w:endnotePr[1]/w:endnote[2]\",\"PartUri\":\"/word/settings.xml\"},\"Id\":\"Sem_MissingReferenceElement\",\"ErrorType\":\"Semantic\"},{\"Description\":\"Element 'w:endnote' referenced by 'endnote@http://schemas.openxmlformats.org/wordprocessingml/2006/main:id' does not exist in part '/MainDocumentPart/EndnotesPart'. The reference value is '-1'.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:settings[1]/w:endnotePr[1]/w:endnote[1]\",\"PartUri\":\"/word/settings.xml\"},\"Id\":\"Sem_MissingReferenceElement\",\"ErrorType\":\"Semantic\"}]"
}
```
For now don't copy this element, it wasn't copied before, and it doesn't
seem necessary to fix the ordering problems we had with settings.
Fixes: c9bf4da74 ("Docx writer: ensure that elements in settings are ordered correctly.")
Signed-off-by: Edwin Török <[email protected]>
|
|
```
{
"FilePath": "test/docx/golden/tables.docx",
"ValidationErrors": "[{\"Description\":\"The attribute 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:val' has invalid value 'true'. The Enumeration constraint failed.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:trPr[1]/w:tblHeader[1]\",\"PartUri\":\"/word/document.xml\"},\"Id\":\"Sch_AttributeValueDataTypeDetailed\",\"ErrorType\":\"Schema\"}]"
}
```
Although this one might actually be a bug in Open-XML-SDK similar to
this, or a subtle difference between standard versions:
https://github.com/dotnet/Open-XML-SDK/issues/780
Signed-off-by: Edwin Török <[email protected]>
|
|
They are equivalent, but OOXML-Validator complains:
```
{
"FilePath": "test/docx/golden/tables_separated_with_rawblock.docx",
"ValidationErrors": "[{\"Description\":\"The attribute 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:val' has invalid value 'start'. The Enumeration constraint failed.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:document[1]/w:body[1]/w:tbl[2]/w:tblPr[1]/w:jc[1]\",\"PartUri\":\"/word/document.xml\"},\"Id\":\"Sch_AttributeValueDataTypeDetailed\",\"ErrorType\":\"Schema\"},{\"Description\":\"The attribute 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:val' has invalid value 'start'. The Enumeration constraint failed.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:document[1]/w:body[1]/w:tbl[1]/w:tblPr[1]/w:jc[1]\",\"PartUri\":\"/word/document.xml\"},\"Id\":\"Sch_AttributeValueDataTypeDetailed\",\"ErrorType\":\"Schema\"}]"
}
```
pandoc already uses 'left' elsewhere, so be consistent, we still produce
the transitional schema, not the strict one which would have the 'start'
attribute.
Signed-off-by: Edwin Török <[email protected]>
|
|
From `make validate-docx-golden-tests2`:
```
{
"FilePath": "test/docx/golden/definition_list.docx",
"ValidationErrors": "[{\"Description\":\"The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:i'.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:document[1]/w:body[1]/w:p[3]/w:r[3]/w:rPr[1]\",\"PartUri\":\"/word/document.xml\"},\"Id\":\"Sch_UnexpectedElementContentExpectingComplex\",\"ErrorType\":\"Schema\"}]"
},
```
Signed-off-by: Edwin Török <[email protected]>
|
|
xmllint doesn't warn about this (maybe because the tag is empty?), but
the order doesn't match wml.xsd:
```
<w:rPr>
<w:color w:val="007020"/>
<w:b/>
</w:rPr>
```
And OOXMLValidatorCLI does warn about it:
```
{
"Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:b'.",
"Path": {
"NamespacesDefinitions": [
"xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\""
],
"Namespaces": {
},
"XPath": "/w:styles[1]/w:style[40]/w:rPr[1]",
"PartUri": "/word/styles.xml"
},
"Id": "Sch_UnexpectedElementContentExpectingComplex",
"ErrorType": "Schema"
}
```
Signed-off-by: Edwin Török <[email protected]>
|
|
annotationRef is not valid for `w:rPr`, only for `w:r` according to
wml.xsd.
See https://github.com/jgm/pandoc/issues/9269
Signed-off-by: Edwin Török <[email protected]>
|
|
The length here seems to refer to length in bytes (so twice as long in
hex):
```
./tmp/numbering-pretty.xml:4: element nsid: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}nsid', attribute '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}val': [facet 'length'] The value 'A990' has a length of '2'; this differs from the allowed length of '4'.
```
[This](https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.nsid?view=openxml-2.8.1) also documents the longer values.
Signed-off-by: Edwin Török <[email protected]>
|
|
Closes #9266.
|
|
The elements in pPr in lists were not properly ordered.
This doesn't seem to cause problems for Word, but it makes
validation fail and may pose problems for other consumers of
docx. Closes #9265.
|
|
The elements must occur in a specific order. This was being
messed up when integrating a custom reference.docx. Closes #9264.
|
|
Using `make test TESTARGS=--accept`
Signed-off-by: Edwin Török <[email protected]>
|