summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-01-29Typst writer escaping improvements.John MacFarlane
We no longer escape `(`. The reason we did this before (#9137) has been addressed in another way (#9252). We only escape `=`, `+`, `-` at the beginning of a line. We now also escape `/` at the beginning of a line. This should reduce unnecessary escapes. Closes #9386.
2024-01-27Regenerate epub tests with latest changes to EPUB reader.John MacFarlane
2024-01-26EPUB reader: don't put `#` characters in identifiers.John MacFarlane
2024-01-25Add some kerns where needed between quotes in LaTeX output.John MacFarlane
Closes #9371.
2024-01-23add testcaseGokul Rajiv
2024-01-22Org writer: escape special lines in code blocksAlbert Krewinkel
Fixes: #9218
2024-01-20LaTeX writer: create valid table even when table is empty.John MacFarlane
Closes #9350.
2024-01-18Markdown writer: fix output for pipe tables...John MacFarlane
...with a huge number of columns. Previously we got invalid pipe tables when the number of table columns exceeded the setting of `--columns`. Closes #9346.
2024-01-16DocBook reader: better handling of `<procedure>` and `<substeps>`.John MacFarlane
`<procedure>` now gets parsed as an ordered list, and `<substeps>` as a sublist. Closes #9341.
2024-01-16Add readMan to Text.Pandoc.Readers exportsGeorge Stagg
2024-01-05Typst reader: fix handling of `\overline`.John MacFarlane
Due to a typo, it was being incorrectly rendered as an `\underset`. Closes #9294.
2024-01-04OPML writer: respect `--wrap` options & `--columns` in contents of notes.John MacFarlane
Closes #9297.
2023-12-30Add command test for #9293.John MacFarlane
2023-12-26ODT/opendocument writers: properly handle highlighting styles.John MacFarlane
These styles were going into an office:styles element in content.xml, but this is invalid. Instead they must go in styles.xml. See #9287. The variable `highlighting-styles` no longer has any effect on the default opendocument template, and highlighting styles are not included in opendocument output.
2023-12-22Markdown writer: add table identifier at end of caption if present.John MacFarlane
Suggested at #9279.
2023-12-20Org reader: parse caption and label for grid tables.John MacFarlane
Closes #9279.
2023-12-20Remove html5shiv from default HTML5 template.John MacFarlane
I don't think we need to support IE < 9 any more!
2023-12-19fix(docx): sort inline elements in schema orderEdwin Török
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 <edwin@etorok.net>
2023-12-18LaTeX writer: omit superfluous page locator label...John MacFarlane
when used with `--natbib` or `--biblatex`. These will treat a bare number as a page locator, and they will be able to localize it. We borrow the code for stripping the locator label from the suffix from Citeproc code. Note that the recognition of the locator label is locale-sensitive; if `lang` is `de`, then `S. 33` is a page reference, and `p. 33` is not! Closes #9275.
2023-12-18fix(docx): fix validation error on endnotePrEdwin Török
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 <edwin@etorok.net>
2023-12-18fix(docx): fix validation error on w:tblHeaderEdwin Török
``` { "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 <edwin@etorok.net>
2023-12-18fix(docx): use left vs start consistentlyEdwin Török
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 <edwin@etorok.net>
2023-12-18fix(docx): fix validation error on inline w:i/w:iCs orderEdwin Török
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 <edwin@etorok.net>
2023-12-18fix(docx): fix OOXMLValidator error on KeywordTok outputEdwin Török
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 <edwin@etorok.net>
2023-12-18fix(docx): fix validation error on w:annotationRefEdwin Török
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 <edwin@etorok.net>
2023-12-18test(docx): also compare number of childrenEdwin Török
This detects if a tag gets added/removed, or moves within the hierarchy. Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-18fix(docx): fix validation error in w:nsidEdwin Török
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 <edwin@etorok.net>
2023-12-18Docx writer: fixed validation errors in tables.John MacFarlane
Closes #9266.
2023-12-18Docx writer: fix validation error.John MacFarlane
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.
2023-12-17Docx writer: ensure that elements in settings are ordered correctly.John MacFarlane
The elements must occur in a specific order. This was being messed up when integrating a custom reference.docx. Closes #9264.
2023-12-17test/docx/golden: regenerateEdwin Török
Using `make test TESTARGS=--accept` Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-14Typst writer: emit `;` after typst code...John MacFarlane
unless followed by space. Otherwise there's the potential that the typst code will swallow up a following character. Closes #9252.
2023-12-12Depend on texmath 0.12.8.6.John MacFarlane
This gives us less verbose typst math output.
2023-12-11Typst template fixes.John MacFarlane
2023-12-10LaTeX writer: fix bug with big footnotes inside emphasis (#9168)Hikaru Ibayashi
Closes #8982.
2023-12-09Typst writer: use quote for block quotes.John MacFarlane
Remove custom definitiion of blockquote in default template.
2023-12-08Docx writer: Use different style for block quotes in notes.John MacFarlane
Using "Footnote Block Text" for the style name, so it can be given a different font size if footnotes are. Closes #9243.
2023-12-08Docx writer: allow embedded fonts to be used in reference.docx.John MacFarlane
Closes #6728.
2023-12-08Update typst-hs commit and typst writer test.John MacFarlane
2023-12-05Add tests for alerts gfm <-> docbook.John MacFarlane
2023-12-05Fine-tuning on alerts.John MacFarlane
Added a test to show that we can convert smoothly between gfm, rst, and asciidoc alerts.
2023-12-04HTML5 writer footnote changes (aria-role, element type).John MacFarlane
* To conform to validator's expectations, `doc-footnote` role is used with `aside` and `doc-endnotes` with `section`. * `aside` is used only for notes at ends of sections or blocks; if all the notes come at the end of the document, `section` is used so we can have the `doc-endnotes` role.
2023-11-29LaTeX reader: handle otherlanguage environment...John MacFarlane
...and language-name environments like `\begin{french}...\end{french}`. Closes #9202.
2023-11-29Docx reader: unwrap content of shaped textboxes...Stephan Meijer
* #9214 text in shape format test document * #9214 support Text in Shape Format * #9214 remove irrelevant code
2023-11-25Update command test for SVG embedding changes.John MacFarlane
2023-11-22LaTeX writer: handle identifiers inside heading contents.John MacFarlane
`\phantomsection` can't be used in this case, so we need `\hypertarget`. Closes #9209.
2023-11-19Man reader: properly handle `.sp` macro inside lists and block quotes.John MacFarlane
Closes #9201.
2023-11-17LaTeX reader: fix theorem label parsing (#9198)Hikaru Ibayashi
Closes #8872. In the current implementation , theorem labels in `theoremEnvironment` are determined by the `LastLabel` in the current state. This approach works well when the `\label{label_name}` is placed at the end of the theorem body. However, when a label is placed at the beginning of the theorem (another common practice) and additional labels follow in the theorem body, `theoremEnvironment` incorrectly picks the last label (e.g., `\label{item2}` in #8872). This patch addresses the issue by extracting the label extraction independently of the `LastLabel` state.
2023-11-15Typst writer: better handling of tables with captions.John MacFarlane
We now put these in a figure with a caption argument. Closes #9194.
2023-11-15HTML reader: Fix handling of invalidly nested sublists.John MacFarlane
This revises the fix to #8150 (and the test case) and closes #9187. HTML in the (invalid) form: <ul> <li>L1</li> <ul> <li>L1.1</li> </ul> </ul> is treated by browsers like <ul> <li>L1 <ul> <li>L1.1</li> </ul> </li> </ul> not <ul> <li>L1 <li><ul> <li>L1.1</li> </ul> </li> </ul> as pandoc previously assumed. This change will give a similar treatment to <ul> <li>L1</li> <p>foobar</p> </ul> which also seems to match browser behavior.