Commit Graph
16765 Commits
Author SHA1 Message Date
John MacFarlane ecb59e1cde SelfContained: fix calculation of svg width and height.
We were computing width and height from viewBox incorrectly.
See #8969.
2023-07-26 09:49:37 -06:00
John MacFarlane d7c43fda32 Add clause for svg to default CSS for HTML.
Suggested at #8969.
2023-07-26 09:15:24 -06:00
John MacFarlane 704a07d963 SelfContained: Improve inline SVGs.
- 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-25 23:24:43 -06:00
John MacFarlane 77e01242da Typst writer: escape //.
So it doesn't get interpreted as a comment.

Closes #8966.
2023-07-25 09:23:16 -06:00
John MacFarlane c06b9ab331 ChunkedHTML writer: Fix regression including mathjax script.
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-25 08:36:31 -06:00
John MacFarlane 5b493c2733 changelog: make note of new CVE. 2023-07-25 08:18:34 -06:00
John MacFarlane 7a33ebce7f Bump pandoc-cli version to 0.1.1.1. pandoc-cli-0.1.1.1 2023-07-21 08:25:37 -07:00
John MacFarlane b6ae1faed8 Fix typo in stack.yaml. 3.1.6 2023-07-20 22:38:03 -07:00
John MacFarlane a8d5970cd1 Bump version on man page 2023-07-20 22:36:28 -07:00
John MacFarlane 35070cdf2c Bump to 3.1.6. 2023-07-20 22:35:14 -07:00
John MacFarlane b70d906ef6 Update changelog. 2023-07-20 22:35:01 -07:00
John MacFarlane 9bd01c6e6a Fix spurious skylighting entry in stack.yaml. 2023-07-20 22:18:20 -07:00
John MacFarlane 42915f214c Update manual date, man page. 2023-07-20 22:15:17 -07:00
John MacFarlane 0c98f42725 Use released skylighting, typst. 2023-07-20 22:14:28 -07:00
John MacFarlane eddedbfc14 Fix new variant of the vulnerability in CVE-2023-35936.
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-20 11:51:28 -07:00
John MacFarlane db2594aed4 Use latest dev typst-hs. 2023-07-19 22:27:48 -07:00
John MacFarlane 4d3c347f66 Use latest dev skyligting-core and typst. 2023-07-19 18:39:04 -07:00
John MacFarlane ce2b023e13 Refine command line option preprocessor and add tests for #8956.
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-19 15:21:39 -07:00
John MacFarlane eb090c50ff Fix errors for illegal output formats.
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-19 15:09:12 -07:00
John MacFarlane b411aa4085 Add test for #8956. 2023-07-19 15:03:38 -07:00
John MacFarlane bec5429e4f Fix regression on short boolean arguments.
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-19 11:56:58 -07:00
John MacFarlane 5b2128512d Deprecate decodeArg which is now a no-op.
This was needed for old base versions only.
2023-07-19 11:56:43 -07:00
John MacFarlane cfc1d6a7b9 JATS writer: don't use <code> for inline code.
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-18 17:09:45 -07:00
John MacFarlane 52dc8342ab Change Windows release build to use cabal instead of stack.
Use ghc 9.2 to address #8955.
2023-07-18 17:01:25 -07:00
John MacFarlane c62705529a Fix typo on error message for incorrect --preserve-tabs argument.
Thanks @fsoedjede
2023-07-18 07:58:14 -07:00
John MacFarlane ca0564084a Switch back to using ghc 9.2 for linux binary releases.
This should address the problem noted in #8947. With ghc 9.4+,
we were getting AVX instructions in the amd64 binary, which aren't
supported on older hardware. For maximum compatibility we switch
back to ghc 9.2, which doesn't cause the problem. However, we haven't
fully diagnosed the problem, and as documented ghc shouldn't be doing
this.

Note that this doesn't fix the similar problem for the Windows
build (#8955), since that uses stack; we'd need to switch to cabal or
use an older version of stackage lts.
2023-07-17 22:40:37 -07:00
John MacFarlane e5fe3d5339 Fix typo from last commit. 2023-07-16 18:08:27 -07:00
John MacFarlane dff830f877 Capitalize option errors. 2023-07-16 10:54:32 -07:00
John MacFarlane a5a2248df8 Make --epub-title-page's argument optional.
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-16 10:51:18 -07:00
John MacFarlane 7a04fe365a Improve errors for incorrect command-line option values.
Always give the name of the relevant argument.
See #8879.
2023-07-16 10:50:12 -07:00
John MacFarlane c6ac1749ee Docx reader: use SVG version of image if present.
Previously the backup PNG was exported even if an SVG was
present, but the SVG should be preferred.

Closes #7244.
2023-07-14 13:14:05 -07:00
John MacFarlane a97b270b28 Fix bugs in implementation of #8948. 2023-07-13 07:49:13 -07:00
John MacFarlane fc78ebf496 HTML writer: don't make line blocks sensitive to --wrap.
Closes #8952.
2023-07-12 12:40:16 -07:00
John MacFarlane 29c5afb305 RST writer: fix figure handling.
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-12 09:13:32 -07:00
John MacFarlane 21b51d214d CI: don't trigger ci on changes to cirrus config. 2023-07-12 08:23:50 -07:00
John MacFarlane a31cb2ab62 Revert "Cirrus amd64 build: disable simdutf flag"
This reverts commit 3e870525da.
2023-07-12 08:03:59 -07:00
John MacFarlane 3e870525da Cirrus amd64 build: disable simdutf flag 2023-07-12 07:31:10 -07:00
John MacFarlane ce7146da9a Allow latest commonmark-extensions.
This allows entities in wikilinks.
2023-07-12 07:31:10 -07:00
John MacFarlane 0efba28919 Fix cirrus for amd64. 2023-07-11 15:54:52 -07:00
John MacFarlane 6216c20162 Cirrus build: a better way to print info about dependent packages. 2023-07-11 14:56:53 -07:00
John MacFarlane 0273ff3b31 Add -v to cirrus build script. 2023-07-11 14:46:33 -07:00
John MacFarlane 100473377d SelfContained: Tweak identifier generation for svgs...
so the difference between line endings between Windows and Unix
is ignored.

This allows test output to be deterministic across OS versions.
2023-07-11 14:24:31 -07:00
John MacFarlane 3eaff8de8a Cirrus build script: print cabal freeze file...
so we can see exactly what dependencies this version was built with.
2023-07-11 14:18:19 -07:00
John MacFarlane 94832af98a SelfContained: Use inline svg instead of data uris...
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-11 10:59:33 -07:00
John MacFarlane 3496109d49 Typst reader: fix regression in recognition of display math.
The last release caused all math to be parsed as inline math.
Closes #8949.
2023-07-10 21:24:23 -07:00
John MacFarlane 79091f9910 Docx writer: Copy "mirror margins" property from reference.docx.
Closes #8946.
2023-07-09 22:15:51 -07:00
John MacFarlane c7c7da3f92 Update changelog. 3.1.5 2023-07-07 07:51:56 -07:00
John MacFarlane 9eb42d01ce Fix babel name for fa (should be "persian"). Closes #8944.
Affects LaTeX writer.
2023-07-07 07:48:47 -07:00
hseg e0ea7d5297 Fix build (transitive dep not in lts) (#8945)
Commit 921b0949f4 bumped the skylighting-core
version, which requires a newer version of xml-conduit than is available in
lts-21.0.
Bump the version in stack.yaml
2023-07-07 07:44:59 -07:00
John MacFarlane 7c71eebafe Update AUTHORS.md. 2023-07-06 23:21:15 -07:00