summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2023-08-06ODT writer: Use a style for Highlighted, so color can be adjusted.John MacFarlane
2023-08-05HTML reader: properly calculate RowHeadColumns.John MacFarlane
The previous algorithm did not handle rowspans; this one does. Closes #8984.
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-05HTML reader: fix bug in calculation of RowHeadColumns.John MacFarlane
We were adding up cells, not colspans. Note: there may still be incorrect results in the presence of rowspans. See https://github.com/jgm/pandoc/issues/8984#issuecomment-1666467926
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-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-08-04Remove redundant import.John MacFarlane
2023-08-04OpenDocument writer: add syntax highlighting tags for CodeBlock.John MacFarlane
We still aren't injecting the style, but this will improve things. See #6710.
2023-08-04Support highlighted text in ODT/OpenDocument writers.John MacFarlane
See #8960. This is a prelimary fix. A better fix would use a named style so colors could be adjusted.
2023-07-27SelfContained: retain attributes in svg tag...John MacFarlane
when referring to another svg's content using `<use>`. Closes #8969.
2023-07-27SelfContained: Allow units in width and height for svg.John MacFarlane
Units are optional but allowed.
2023-07-26SelfContained: don't coerce calculated width/height to Int.John MacFarlane
Fractional values are okay. See #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-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-25ChunkedHTML writer: Fix regression including mathjax script.John MacFarlane
The fix for #8620 caused the mathjax script to be included when the table of contents but not the body text of a page contains math. But it broke the case where the table of contents doesn't contain math but the page does. This patch fixes the issue. Closes #8967.
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-19Fix errors for illegal output formats.John MacFarlane
Previously if you did `pandoc -s -t bbb`, it would give you an error about the missing bbb template instead of saying that it's not a supported output format.
2023-07-19Fix regression on short boolean arguments.John MacFarlane
In 3.1.5 boolean arguments were allowed an optional argument (true|false). This created a regression for uses of fused short arguments, e.g. `-somyfile.html`, which was equivalent to `-s -omyfile.html`, but now raised an error because pandoc attempted to parse `o` as a boolean `true` or `false`. This change adds a preprocessing step on the raw arguments before they are sent to the option parser. In this preprocessing step, `-somyfile.html` would be split into two arguments, `-s` and `-omyfile.html`. The splitting happens when a short boolean option is followed by another short option. Closes #8956.
2023-07-19Deprecate decodeArg which is now a no-op.John MacFarlane
This was needed for old base versions only.
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-18Fix typo on error message for incorrect --preserve-tabs argument.John MacFarlane
Thanks @fsoedjede
2023-07-16Fix typo from last commit.John MacFarlane
2023-07-16Capitalize option errors.John MacFarlane
2023-07-16Make --epub-title-page's argument optional.John MacFarlane
It takes a boolean argument, and now that all of our boolean flags take such an argument, we can make this one optional for consistency.
2023-07-16Improve errors for incorrect command-line option values.John MacFarlane
Always give the name of the relevant argument. See #8879.
2023-07-14Docx reader: use SVG version of image if present.John MacFarlane
Previously the backup PNG was exported even if an SVG was present, but the SVG should be preferred. Closes #7244.
2023-07-13Fix bugs in implementation of #8948.John MacFarlane
2023-07-12HTML writer: don't make line blocks sensitive to `--wrap`.John MacFarlane
Closes #8952.
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: Tweak identifier generation for svgs...John MacFarlane
so the difference between line endings between Windows and Unix is ignored. This allows test output to be deterministic across OS versions.
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-09Docx writer: Copy "mirror margins" property from reference.docx.John MacFarlane
Closes #8946.
2023-07-07Fix babel name for fa (should be "persian"). Closes #8944.John MacFarlane
Affects LaTeX writer.
2023-07-06Typst reader: filter out CR in raw.John MacFarlane
2023-07-06Typst reader: handle blockish content for link element.John MacFarlane
2023-07-06Rewrite Typst reader.John MacFarlane
This structure should make it easier to add new block and inline handlers.
2023-07-06Typst reader: allow block-level content in text element.John MacFarlane
2023-07-05MediaWiki reader: revise treatment of "link trail."John MacFarlane
Previously we only included ASCII letters. That is correct for English but not for, e.g., Spanish (see comment in #8525). A safer approach is to include all letters except those in the CJK unified ideograph ranges.
2023-07-05Use latest dev typst-hs.John MacFarlane
2023-07-05Typst reader: handle style, align, place in inline contexts too.John 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-04Typst writer: support `unlisted` class in headings.John MacFarlane
Closes #8941.
2023-07-03Get things working with latest dev version of typst.John MacFarlane
This supports package loading (as long as the package has been cached or is local).
2023-07-02Update line-through for asciidoc writer to custom inline style (#8934)Kevin Broch
Closes #8933
2023-07-01Typst writer: some math improvements.John MacFarlane
2023-07-01Docx writer: make relative widths work in tables.John MacFarlane
This didn't work before because we were missing an attribute that tells Word to used fixed widths rather than computing optimal ones.