Commit Graph
17117 Commits
Author SHA1 Message Date
George Stagg 032f7c832f Add readMan to Text.Pandoc.Readers exports 2024-01-16 11:24:13 -08:00
dependabot[bot] ff753bdfa6 build(deps): bump cachix/install-nix-action from 24 to 25
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 24 to 25.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v24...v25)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-14 19:40:11 -08:00
Carlos Scheidegger d8ff4ff878 Fix changelog.md typo: 2023-2024 2024-01-08 08:39:02 -08:00
John MacFarlane 2dd98b967b T.P.PDF: reliably detect when TOC has changed.
Sometimes the TOC changes but there are no warnings: this happens
when no labels are present.  In this case we must rerun LaTeX.
So we now take the sha1 hash of the TOC file and rerun LaTeX if it
changes between runs.

Closes #9295.
2024-01-06 11:10:05 -08:00
John MacFarlane 9f58a55280 Typst reader: fix handling of \overline.
Due to a typo, it was being incorrectly rendered as an `\underset`.
Closes #9294.
2024-01-05 22:09:36 -08:00
John MacFarlane e24002ed75 T.P.PDF: increase max number of LaTeX runs to 4.
On some documents, 4 runs are needed (e.g. when a LastPage
reference is used). Closes #9299.
2024-01-05 21:35:55 -08:00
John MacFarlane 80303beb35 getting-started.md: refer to GH discussions instead of pandoc-discuss. 2024-01-05 21:35:55 -08:00
mh4ckt3mh4ckt1c4s dce7f7a6a8 Fix beamer highlighting 2024-01-05 22:26:49 -07:00
John MacFarlane b3a471b09f MANUAL.txt: Add <pre> to list of exceptions for...
`markdown_in_html_blocks` extension. Closes #9305.
2024-01-05 18:54:41 -08:00
John MacFarlane 5d33b5690a Replace references to pandoc-discuss with GitHub discussions. 2024-01-05 18:40:45 -08:00
John MacFarlane 714ed52213 Update AUTHORS.md. pandoc-cli-3.1.11.1 3.1.11.1 2024-01-05 14:55:56 -08:00
John MacFarlane 6d19f174d4 Whitespace cleanup. 2024-01-05 14:50:52 -08:00
John MacFarlane 13ff7d2ece Update man pages. 2024-01-05 14:50:43 -08:00
John MacFarlane 6533296fae Fix make binpath target. 2024-01-05 14:50:27 -08:00
John MacFarlane 89a6fa9b00 Bump pandoc-cli to 3.1.11.1. 2024-01-05 13:41:29 -08:00
John MacFarlane bef21275f2 Update manual date. 2024-01-05 13:41:23 -08:00
John MacFarlane 6b4dcb5db4 Bump to 3.1.11.1 and update changelog. 2024-01-05 13:40:11 -08:00
John MacFarlane 5cff32c575 OPML writer: respect --wrap options & --columns in contents of notes.
Closes #9297.
2024-01-04 16:45:02 -07:00
John MacFarlane 59e28b82b6 PDF: expand list of environment variables to display in verbose output.
Closes #9303.
2024-01-04 08:50:46 -07:00
John MacFarlane 87533e2d04 Add command test for #9293. 2023-12-30 22:09:13 -07:00
John MacFarlane 9a8f27b0fe MediaWiki reader: handle multiline math in list items.
Closes #9293.
2023-12-30 21:53:57 -07:00
Edwin Török 56df2f1c17 ci(commit-validation): use git to walk commits
The PR event doesn't include the actual commits, just a count and a URL
to fetch it.
But we can checkout the entire git history, we don't have so many
commits that we need to optimize this just yet.
And then we might as well use `git` itself to walk the commit history.

(Using the remote commits URL would be useful only if we'd want to do a
shallow clone because we have too many commits)

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-27 10:38:44 -08:00
John MacFarlane 17af220442 Add some explicit imports...
to avoid warnings with some GHC versions.
2023-12-26 23:06:38 -08:00
John MacFarlane c33750c4b2 commit-validation CI - another attempt. 2023-12-26 23:00:22 -08:00
Edwin Török 075cbb6419 fix(docx): support absolute header/footer paths
Header and footer references may be absolute in the reference.docx.
E.g. editing it with dotnet's Open-XML-SDK causes this error:

```
+ pandoc test.md -t docx --reference-doc referenceh.docx -o test.docx
word//word/header1.xml missing in reference docx
```

There was already code in pandoc to handle relative vs absolute paths in
references, so use it.

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-26 22:51:28 -08:00
John MacFarlane 0ba8af939c commit validation CI: work with regular push as well as pr. 2023-12-26 22:49:50 -08:00
John MacFarlane b9b8343645 Fix commit-validation CI.
Hopefully. See #9286.
2023-12-26 22:46:56 -08:00
John MacFarlane b1a1f04168 ODT/opendocument writers: properly handle highlighting styles.
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-26 22:12:44 -08:00
John MacFarlane 3c178690e3 T.P.PDF: Ensure that we find all the LaTeX warnings requiring rerun.
This should fix a regression from 3.1.9 that led to incorrect
alignments in tables (and possibly other issues).

Closes #9284.
2023-12-24 12:26:35 -08:00
John MacFarlane 4672f35143 T.P.Chunks: Fine tune makeChunks.
* Ensure that chunks not based on sections (those with the
  "preamble" class) get unique identifiers, by appending chunk number.
* This will also ensure that they get unique path names when
  the path is generated from the identifier.

Closes #9281.
2023-12-22 11:57:26 -08:00
John MacFarlane 81521cee0d Markdown writer: add table identifier at end of caption if present.
Suggested at #9279.
2023-12-22 11:14:09 -08:00
John MacFarlane 36d1ec3e45 Org reader: parse caption and label for grid tables.
Closes #9279.
2023-12-20 16:55:10 -08:00
John MacFarlane 907b1192d1 Remove html5shiv from default HTML5 template.
I don't think we need to support IE < 9 any more!
2023-12-20 10:10:21 -08:00
John MacFarlane 6b6da8b154 Fix commit validation CI.
This CI action has been broken for a long time, giving us false
negatives.
2023-12-19 15:51:28 -08:00
John MacFarlane 9875993559 Fix commit-validation CI. 2023-12-19 15:33:25 -08:00
John MacFarlane 9d15289864 Attempt to fix commit-validation CI. 2023-12-19 15:31:50 -08:00
Edwin Török 2e9e23e908 ci(docx): add 2 CI rules to run the validation rules from the Makefile
Triggered only when the golden docx or the validator script changes.

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-19 15:00:23 -08:00
Edwin Török 712d746320 fix(docx): sort inline elements in schema order
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-19 15:00:23 -08:00
Edwin Török c6892bec24 ci(validate-docx-golden-tests2): fail on errors
The validator just prints errors, but always exited with nonzero.

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-19 15:00:23 -08:00
John MacFarlane 0e86a84e33 LaTeX writer: omit superfluous page locator label...
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-18 23:27:40 -08:00
John MacFarlane 2f6a66feb1 Docx reader: fix HYPERLINK with only switch and no argument.
The argument can apparently be omitted, and then we just have
a fragment URL.  Closes #9246.
2023-12-18 17:44:56 -08:00
Edwin Török 95432d3f4e test(docx): add workaround for mc:Ignorable
`make validate-docx-golden-tests` now passes

Fixes https://github.com/jgm/pandoc/issues/9269

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-18 17:15:03 -08:00
Edwin Török dbd1019a97 fix(docx): fix validation error on endnotePr
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-18 17:15:03 -08:00
Edwin Török 1e4775f069 fix(docx): fix validation error on w:tblHeader
```
    {
        "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-18 17:15:03 -08:00
Edwin Török fe8847bdaa fix(docx): use left vs start consistently
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-18 17:15:03 -08:00
Edwin Török 95dde29c5e fix(docx): fix validation error on inline w:i/w:iCs order
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-18 17:15:03 -08:00
Edwin Török c5780857e5 fix(docx): fix OOXMLValidator error on KeywordTok output
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-18 17:15:03 -08:00
Edwin Török 3e360f5a3e test(Makefile): add validate-docx-golden-test2
Add a validation rule based on OOXML-Validator which uses the
Open-XML-SDK shipped and maintained as part of dotnet.

This catches a few more issues compared to the .xsd.

Unfortunately currently this executable always exits with 0 even when
validation failed. That can be fixed later by invoking it from a script.

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-18 17:15:03 -08:00
Edwin Török 333b0dd2ff fix(docx): fix validation error on w:annotationRef
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-18 14:08:53 -08:00
Edwin Török 2477fb50ff test(docx): also compare number of children
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-18 14:08:53 -08:00