Commit Graph

16986 Commits

Author SHA1 Message Date
John MacFarlane e7348b4f76 pandoc-server: Switch from base64 to base64-bytestring.
See #9233.
2023-12-06 09:11:28 -08:00
John MacFarlane 8b523749ae Revert "Use base64 instead of base64-bytestring."
This reverts commit 6625e9655e.

base64 is currently buggy on 32-bit systems. Closes #9233.
2023-12-06 08:05:53 -08:00
John MacFarlane dbbd70d4f8 Add tests for alerts gfm <-> docbook. 2023-12-05 16:52:49 -08:00
John MacFarlane fe351f1fd5 Fine-tuning on alerts.
Added a test to show that we can convert smoothly between
gfm, rst, and asciidoc alerts.
2023-12-05 09:38:47 -08:00
John MacFarlane 64bc8ab9c2 Revise commonmark-hs dependency again. 2023-12-05 09:09:40 -08:00
John MacFarlane 511366f8e5 Update tag for commonmark-hs. 2023-12-05 09:03:25 -08:00
John MacFarlane 6b1d6f0e7e Update commonmark-hs tag. 2023-12-05 08:55:21 -08:00
John MacFarlane fe03d4d133 Add alerts extension.
This enables GitHub style markdown alerts as a commonmark extension.

<https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts>

This extension is now default for `gfm`.
It can't be used with `markdown`, only with `commonmark` and variants.
2023-12-04 22:13:04 -08:00
John MacFarlane ff56d43b50 Use dev commonmark-extensions, commonmark-pandoc. 2023-12-04 19:52:43 -08:00
John MacFarlane 970189bc1d Use skylighting, skylighting-core 0.14.1. 2023-12-04 09:25:11 -08:00
John MacFarlane 41da8ad9e0 HTML5 writer footnote changes (aria-role, element type).
* 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-12-04 09:22:58 -08:00
John MacFarlane dbdb4d9c1f Typst writer: put inline image dimensions on enclosing box, not image.
Closes #9104.
2023-12-04 08:42:12 -08:00
John MacFarlane f8ba1280c6 Revert "Use latest dev skylighting, skylighting-core."
This reverts commit 780f4f569c.
2023-12-04 08:06:52 -08:00
John MacFarlane 780f4f569c Use latest dev skylighting, skylighting-core. 2023-12-04 07:59:13 -08:00
dependabot[bot] 251bfa8e94 Bump cachix/install-nix-action from 23 to 24 (#9234)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 23 to 24.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v23...v24)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-03 20:42:21 -08:00
John MacFarlane 80ea048bb2 LaTeX reader: handle otherlanguage environment...
...and language-name environments like
`\begin{french}...\end{french}`.
Closes #9202.
2023-11-29 21:22:03 -08:00
Stephan Meijer 2e8ecb3fba Docx reader: unwrap content of shaped textboxes...
* #9214 text in shape format test document

* #9214 support Text in Shape Format

* #9214 remove irrelevant code
2023-11-29 18:59:09 -08:00
John MacFarlane eff1790bbc Use latest dev typst-hs. 2023-11-29 14:28:02 -08:00
John MacFarlane 9901aa2a40 Docx reader: Improve handling of w:sym.
Add T.P.Readers.Docx.Symbols. This gives us a table to use to
resolve characters included in docx via w:sym element.

Use this table to resolve characters when symbol fonts are specified.

Closes #9220.
2023-11-28 11:50:26 -08:00
John MacFarlane 4259d64d25 Correct comment. 2023-11-28 10:23:56 -08:00
John MacFarlane 6149cec27a Update command test for SVG embedding changes. 2023-11-25 11:39:22 -05:00
John MacFarlane fc3d202e3f SelfContained: improve treatment of embedded SVGs.
- Ensure unique ids for elements by prefixing SVG id.
- Ensure SVG `id` attribute except when `use` element is used.
- Remove `width`, `height` attributes from svg element when `use`
  element is used. Instead, add `width` and `height` 100% to the
  `use` element. This seems to get the sizing right.

Closes #9206.

Ref: #8948.
2023-11-25 11:35:10 -05:00
John MacFarlane f7f2a016d9 Shared.renderTags': use minimized tag for rect. 2023-11-25 10:58:43 -05:00
John MacFarlane 6c4f938192 Shared.renderTags': allow svg path element to be minimized. 2023-11-25 00:03:53 -05:00
John MacFarlane a2a0f73eb8 LaTeX writer: handle identifiers inside heading contents.
`\phantomsection` can't be used in this case, so we need `\hypertarget`.
Closes #9209.
2023-11-22 23:24:55 -05:00
John MacFarlane 49e64c1451 Man reader: properly handle .sp macro inside lists and block quotes.
Closes #9201.
2023-11-19 10:45:05 -08:00
Hikaru Ibayashi a3fba6d83e LaTeX reader: fix theorem label parsing (#9198)
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-17 18:49:03 -08:00
John MacFarlane 267b84e1d9 Ensure we use .svg not .svgz as extension for image/svg+xml mime type.
See #9195.
2023-11-17 10:26:09 -08:00
John MacFarlane 1880d75e7c T.P.Class.IO.openURL improvements for data uris.
- Only treat as base64 if ';base64' is present.
- Otherwise treat as UTF-8 (not 100% reliable but should cover most
  other cases).
- Strip off ';base64' (or ';charset=...' or whatever) from mime type.

This last change addresses #9195 (problems with data URIs in
conversion to docx).
2023-11-17 10:13:22 -08:00
John MacFarlane 3591733e19 Typst writer: better handling of tables with captions.
We now put these in a figure with a caption argument.

Closes #9194.
2023-11-15 21:17:06 -08:00
John MacFarlane 13e1b49224 HTML reader: Fix handling of invalidly nested sublists.
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.
2023-11-15 14:40:00 -08:00
John MacFarlane cd48bf4059 Markdown reader: don't change newlines to spaces in math.
Preserve them: otherwise we can get unwanted results if there's
a `%` comment. Closes #9193.
2023-11-15 10:06:22 -08:00
John MacFarlane 0283cdc200 Update typst writer to typst 0.9 citation format.
Closes #9188.
2023-11-14 19:55:03 -08:00
Ian Max Andolina e562d23bc7 Update default.typst to support csl (#9186)
Typst now supports CSL for its native citation engine, so pandoc
should use a specified `csl` style in the template, falling back to
`bibliographystyle` if `csl` is not specified.

https://typst.app/docs/reference/meta/bibliography/
2023-11-14 19:46:18 -08:00
John MacFarlane 7db44d77b2 MediaWiki reader: allow attribute keys with hyphens.
Closes #9178.
2023-11-13 15:05:43 -08:00
John MacFarlane 9fbdd95f3d MANUAL.txt: update defaults file docs for bibliography fields.
Recommend using top-level `bibliography` `csl`, etc. instead
of a nested `metadata` field. Reason: `${USERDATA}` and `${HOME}`
are only expanded in these contexts, not in `metadata`.

See #9173.
2023-11-09 08:10:46 -08:00
John MacFarlane 69bbb8903f Update to latest dev typst-hs. 2023-11-07 12:51:18 -08:00
John MacFarlane 7d7ae7deef Use dev version of typst-hs. 2023-11-07 08:22:29 -08:00
Stephan Meijer 56f7f11473 ODT reader: Support attr text:continue-numbering (#8998)
Closes #8979.
2023-11-06 19:15:37 -08:00
John MacFarlane 76cd115d3b Markdown reader: make attributes work with reference links.
Closes #9171.
2023-11-05 21:27:03 -08:00
John MacFarlane 6fdebc4afd T.P.Shared: export combineAttr.
[API change]
2023-11-05 21:26:37 -08:00
John MacFarlane 9400f75506 JATS writer: handle case where there is material after refs div.
Previously in such cases the references were not being moved to
back matter. Closes #9166.
2023-11-04 09:46:46 -07:00
John MacFarlane bb36f127e2 LaTeX template: include bookmark package unconditionally.
This package produces better PDF bookmarks than hyperref
and does it on the first pass.

As a consequence, we now default to running LaTeX only
once in producing a PDF (instead of twice). If a table
of contents is present, we still have to run three times
to get the page numbers.
2023-11-03 10:40:38 -07:00
John MacFarlane 5132f1ef33 T.P.RoffChar: escape - as \-.
The groff_man (7)` man page indicates that `-` characters will be
treated as typographic hyphens and are not appropriate for cases
where the output should be copy-pasteable as an ASCII
hyphen-minus character.  (E.g. in command line options.)

However, until a recent update groff man did not actually do this;
it treated `-` and `\-` the same.  With the new update (1.23.0)
the two are distinguished (see https://lwn.net/Articles/947941/
for background), so now it is important that pandoc escape `-`.

This reverts ee60ba5252.
That change was motivated by a problem with backslash-escaping
`-` in a filename for .PSPIC. That's simply a separate issue;
we shouldn't do the normal escapes in such a context. It has
been addressed in the previous commit.
2023-11-02 19:36:25 -07:00
John MacFarlane 051fa7d574 Ms writer: don't do normal escapes in filename arguments...
for PSPIC etc.

Note: I haven't been able to figure out how to make it
work if the filename contains a `"` character.
2023-11-02 19:35:34 -07:00
John MacFarlane db92f61f1e Citeproc: don't link citations if suppress-bibliography specified.
For there will be nothing to link to. Closes #9163.
2023-11-02 11:03:54 -07:00
John MacFarlane d3d0406515 weeder.dhall -> weeder.toml 2023-10-30 17:40:29 -07:00
John MacFarlane 0f3211c339 Shared: improve isTightList...
so that it recognizes an item containing only a list which is
itself tight as potentially an item in a tight list.

Closes #9161.
2023-10-28 10:07:13 -07:00
John MacFarlane 196bf96932 epub.css: add styling for sup and sub.
Closes #9160.
2023-10-28 09:46:56 -07:00
John MacFarlane 9fcb0a0182 Update AUTHORS.md. 3.1.9 2023-10-27 12:59:49 -07:00