summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-08-10Fix display of block elements in JATS reader (PR #8971)Julia Diaz
A number of block elements, like disp-quote, list, and disp-formula, were always treated as inlines if appearing inside paragraphs, even if their usage granted a separate block. The function isElementBlock has been refined to prevent this, and a number of specific parse cases have been added to parseBlock. Also, some minimal cleanup of the test file, in order for it to pass XML validation against the JATS DTD 1.3 (it was not compliant with the current or any previous versions of JATS). Closes #8889.
2023-08-09LaTeX writer: Improve escaping of URIs in href, url.John MacFarlane
Closes #8992.
2023-08-09Typst writer: put the label in right place for Div, use `#block`.John MacFarlane
Closes #8991. Previously we were putting the label at the beginning of the Div's contents, but according to the documentation such a label gets attached to the *preceding* element. We now use an explicit `#block` and add the label at the end.
2023-08-09HTML reader: avoid duplicate id on header and div.John MacFarlane
Closes #8991.
2023-08-05HTML reader: properly calculate RowHeadColumns.John MacFarlane
The previous algorithm did not handle rowspans; this one does. Closes #8984.
2023-08-05Add test for #8984.John MacFarlane
2023-08-05Revert "Revert "Update #8764 command test for latest change to HTML table ↵John MacFarlane
parser (#8634)."" This reverts commit acbc382ff4b45b9818884779b1e7100de445383d.
2023-08-05HTML reader: require unanimity for RowHeadColumns.John MacFarlane
Previously we used the max. #8634 switched to the min, but this had bad results. This commit sets the RowHeadColumns to the consensus value from all rows, or 0 if there is no consensus. See #8984.
2023-08-05Revert "Update TableBody RowHeadColumns caculation: change from max to min ↵John MacFarlane
(#8634)" This reverts commit f257c97170ba8db3b771135b98b198d5de2bdb5b. For the reason, see #8984. The change caused the "grid shape" of some tables to change.
2023-08-05Revert "Update #8764 command test for latest change to HTML table parser ↵John MacFarlane
(#8634)." This reverts commit 52d352a5ae5d66ec74a2c73aa95a8b2abc7ade3c.
2023-08-04OpenDocument writer: implement syntax highlighting.John MacFarlane
Still unimplemented: global background colors, line numbers. Closes #6710, obsoletes #6717.
2023-08-04Started implementing syntax highlighting for ODT.John MacFarlane
Currently only colors are supported, not other text styles. This change includes a new default opendocumnet template. See #6710.
2023-07-27SelfContained: retain attributes in svg tag...John MacFarlane
when referring to another svg's content using `<use>`. Closes #8969.
2023-07-26SelfContained: fix calculation of svg width and height.John MacFarlane
We were computing width and height from viewBox incorrectly. See #8969.
2023-07-26Add clause for svg to default CSS for HTML.John MacFarlane
Suggested at #8969.
2023-07-25SelfContained: Improve inline SVGs.John MacFarlane
- Ensure that width and height attributes don't get specified twice is both the img tag and the svg include them. - Omit unnecessary attributes xmlns, xmlns:xlink, and version on svg element. - Use 20 character rather than 40 character hashes for generated IDs. Closes #8965.
2023-07-25Typst writer: escape `//`.John MacFarlane
So it doesn't get interpreted as a comment. Closes #8966.
2023-07-20Fix new variant of the vulnerability in CVE-2023-35936.John MacFarlane
Guilhem Moulin noticed that the fix to CVE-2023-35936 was incomplete. An attacker could get around it by double-encoding the malicious extension to create or override arbitrary files. $ echo '![](data://image/png;base64,cHJpbnQgImhlbGxvIgo=;.lua+%252f%252e%252e%252f%252e%252e%252fb%252elua)' >b.md $ .cabal/bin/pandoc b.md --extract-media=bar <p><img src="bar/2a0eaa89f43fada3e6c577beea4f2f8f53ab6a1d.lua+%2f%2e%2e%2f%2e%2e%2fb%2elua" /></p> $ cat b.lua print "hello" $ find bar bar/ bar/2a0eaa89f43fada3e6c577beea4f2f8f53ab6a1d.lua+ This commit adds a test case for this more complex attack and fixes the vulnerability. (The fix is quite simple: if the URL-unescaped filename or extension contains a '%', we just use the sha1 hash of the contents as the canonical name, just as we do if the filename contains '..'.)
2023-07-19Refine command line option preprocessor and add tests for #8956.John MacFarlane
The substantive change here is the `-strue` will now work instead of being interpreted as `-s -true`. This is somewhat ad hoc, but I don't think we'll ever have an output format named `rue`, so it's probably okay.
2023-07-19Add test for #8956.John MacFarlane
2023-07-18JATS writer: don't use `<code>` for inline code.John MacFarlane
See #8889. The Taylor and Francis guide to JATS says that `<code>` is block level and not intended to be used inline within standard text.
2023-07-13Fix bugs in implementation of #8948.John MacFarlane
2023-07-12RST writer: fix figure handling.John MacFarlane
This fixes a number of regressions from pandoc 2.x. Properly handle caption, alt attribute in figures. No longer treat a paragraph with a single image in it as a figure (we have a dedicated Figure element now). Closes #8930, closes #8871.
2023-07-11SelfContained: Use inline svg instead of data uris...John MacFarlane
for SVG images in HTML5. Closes #8948. Note that SelfContained does not have access to the writer name, so we check for HTML5 by determining whether the document starts with `<DOCTYPE! html>`. This means that inline SVG won't be used when generating document fragments. An API change could be contemplated to give more flexibility, but this is okay for now.
2023-07-10Typst reader: fix regression in recognition of display math.John MacFarlane
The last release caused all math to be parsed as inline math. Closes #8949.
2023-07-06Add typst reader tests.John MacFarlane
Closes #8942.
2023-07-06Move test/tables.asciidoctor -> test/tables.asciidoc_legacy.John MacFarlane
2023-07-05Fix asciidoc testsJohn MacFarlane
2023-07-05Make modern AsciiDoc the target for `asciidoc`.John MacFarlane
The AsciiDoc community now regards the dialect parsed by `asciidoctor` as the official AsciiDoc syntax, so it should be the target of our `asciidoc` format. Closes #8936. The `asciidoc` output format now behaves like `asciidoctor` used to. `asciidoctor` is a deprecated synonynm. For the old `asciidoc` behavior (targeting the Python script), use `asciidoc_legacy`. The templates have been consolidated. Instead of separate `default.asciidoctor` and `default.asciidoc` templates, there is just `default.asciidoc`. Text.Pandoc.Writers.AsciiDoc API changes: - `writeAsciiDoc` now behaves like `writeAsciiDoctor` used to. - `writeAsciiDoctor` is now a deprecated synonym for `writeAsciiDoc`. - New exported function `writeAsciiDocLegacy` behaves like `writeAsciDoc` used to.
2023-07-02Update line-through for asciidoc writer to custom inline style (#8934)Kevin Broch
Closes #8933
2023-06-30Typst writer: improve handling of autolinks.John MacFarlane
Closes #8931.
2023-06-24Update #8764 command test for latest change to HTML table parser (#8634).John MacFarlane
2023-06-24Update TableBody RowHeadColumns caculation: change from max to min (#8634)Ruqi
This change sets RowHeadColumns to the minimum value of each row, which gives better results in cases where rows have different numbers of leading th tags.
2023-06-23Improve tests for fillMediaBag/extractMedia.John MacFarlane
Ensure that the current directory is not changed up if a test fails, and fix messages for the assertion failures.
2023-06-23Add tests for fillMediaBag/extractMedia.John MacFarlane
2023-06-22Retain image query parameters in dokuwiki reader (#8887)ech0
While converting dokuwiki syntax to gfm, the query parameters of images were stripped from the output. In general this makes sense, as the parameters' semantics are specific to dokuwiki. But it makes it impossible to access the query in a filter. This change retains the query parameters of image urls in the dokuwiki reader, by adding it as an extra query attribute.
2023-06-22Textile reader: Add support for link references (#8706)Stephen Altamirano
Textile supports what it calls "link alias", which are analogous to Markdown's reference-style links.
2023-06-22LaTeX reader: support alt text on images. (#8745)Albert Krewinkel
Closes: #8743
2023-06-19Make `implicit_figures` work again in commonmark reader.John MacFarlane
Support for this (introduced in #6350) disappeared when we made an architectural change.
2023-06-17Update tests for #8903John MacFarlane
2023-06-08Add footer and multiple body parsing to JATS table reader (#8795)Noah Malmed
Closes #8765.
2023-06-07Parse references title from ref-list in JATS reader.John MacFarlane
Closes #8365.
2023-06-07JATS writer: include title in ref-list.John MacFarlane
Previously the reference title ended up in a separate section at the back of the body instead of in the ref-list in the back matter. Closes #8364.
2023-06-06Add typst reader.John MacFarlane
New module Text.Pandoc.Readers.Typst [API change].
2023-06-06Improve title and label parsing in the JATS reader (#8840)Noah Malmed
Closes #8718.
2023-06-05Typst writer: use `#footnote` for notes.John MacFarlane
Closes #8893.
2023-05-09Rename test/docx/block_quotes_parse_indent.native for consistencyStephan Meijer
2023-05-08LaTeX writer: better fix for colspecs for multicolumn table.John MacFarlane
Improves on the last commit; closes #8831.
2023-05-08Introduce support for Intense Quote in Docx conversionStephan Meijer
This commit introduces support for the Intense Quote in Docx Conversion. Previously this was converted to a regular paragraph, but Intense Quote should be interpreted as a Quote in conversion.
2023-05-06Use latest texmathJohn MacFarlane