Commit graph

14678 commits

Author SHA1 Message Date
John MacFarlane
39d019ca73 Use lts-18.0 stack resolver. 2021-06-20 18:17:38 -07:00
John MacFarlane
a8556ac06c Require commonmark 0.2.1. 2021-06-20 17:46:47 -07:00
John MacFarlane
3fb5499dd6 insertMediaBag: ensure we get sane mediaPath for URLs.
Long URLs cannot be treated as mediaPaths, but System.FilePath's
`isRelative` often returns True for them.  So we add a check
for an absolute URL.  We also ensure that extensions are derived
only from the path portion of URLs (previously a following query
was being included).

Closes #7391.
2021-06-18 13:19:24 -07:00
John MacFarlane
961268446c Rephrase section on unsafe HTML in manual. 2021-06-14 12:36:05 -07:00
John MacFarlane
62533053da
Add link to the manual's note on security to SECURITY.md. 2021-06-14 10:35:29 -07:00
John MacFarlane
115962079e
Create SECURITY.md 2021-06-14 09:15:23 -07:00
John MacFarlane
2d966c4c2d Update changelog date. 2021-06-13 09:53:01 -07:00
John MacFarlane
7ab5c2057b Update changelog. 2021-06-12 14:02:00 -07:00
John MacFarlane
cfa26e3ca0 Docx reader: handle absolute URIs in Relationship Target.
Closes #7374.
2021-06-12 13:56:09 -07:00
John MacFarlane
ea53a1dc5c Markdown writer: allow pipe_tables to be disabled for commonmark...
(commonmark_x, gfm).  Closes #7375.
2021-06-12 10:20:19 -07:00
John MacFarlane
b0cd6c6224 Fix regression in citeproc processing.
If inline references are used (in the metadata `references` field),
we should still only include in the bibliography items that are
actually cited -- unless `nocite` is used.

Closes #7376.
2021-06-12 10:16:44 -07:00
John MacFarlane
ea88979aa2 Make parts of the bug report templates HTML comments. 2021-06-11 13:29:21 -07:00
John MacFarlane
a916c4bce4 Revise issue report "dashboard." 2021-06-11 13:15:22 -07:00
John MacFarlane
b01a7aa66c Add note about asking questions to bug report template. 2021-06-11 09:53:07 -07:00
John MacFarlane
55e9ca7c78 Fix line breaks in issue templates. 2021-06-11 09:51:19 -07:00
John MacFarlane
2390f58a07 Fix link to contributing guidelines. 2021-06-11 09:50:01 -07:00
John MacFarlane
01bae106bf Add contributing guidelines to issue menu. 2021-06-11 09:47:17 -07:00
John MacFarlane
1abac223c2 More honing of issue templates. 2021-06-11 09:45:13 -07:00
John MacFarlane
85f1e1f306 Remove pull requset template. 2021-06-11 09:39:27 -07:00
John MacFarlane
c9b354e15f Add pull request template. 2021-06-11 09:37:37 -07:00
John MacFarlane
6d471a4a28 Improve issue templates. 2021-06-11 09:37:27 -07:00
John MacFarlane
d46e0551fe Revert "Remove md versions of issue templates."
This reverts commit 61c0e0bbfb.
2021-06-11 09:17:59 -07:00
John MacFarlane
61c0e0bbfb Remove md versions of issue templates. 2021-06-11 09:15:22 -07:00
John MacFarlane
1fe07e6387 Update issue templates 2021-06-11 09:13:49 -07:00
John MacFarlane
8d1853bd36 Fancier issue templates.
Based on Doom Emacs's templates.
2021-06-11 09:06:47 -07:00
John MacFarlane
67b3c36a93 Bump to 2.14.0.2, update chaneglog and manual. 2021-06-10 22:47:53 -07:00
John MacFarlane
3776e828a8 Fix MediaBag regressions.
With the 2.14 release `--extract-media` stopped working as before;
there could be mismatches between the paths in the rendered document and
the extracted media.

This patch makes several changes (while keeping the same API).

The `mediaPath` in 2.14 was always constructed from the SHA1 hash of
the media contents.  Now, we preserve the original path unless it's
an absolute path or contains `..` segments (in that case we use a path
based on the SHA1 hash of the contents).

When constructing a path from the SHA1 hash, we always use the
original extension, if there is one. Otherwise we look up an
appropriate extension for the mime type.

`mediaDirectory` and `mediaItems` now use the `mediaPath`, rather
than the mediabag key, for the first component of the tuple.
This makes more sense, I think, and fits with the documentation
of these functions; eventually, though, we should rework the API so that
`mediaItems` returns both the keys and the MediaItems.

Rewriting of source paths in `extractMedia` has been fixed.

`fillMediaBag` has been modified so that it doesn't modify
image paths (that was part of the problem in #7345).

We now do path normalization (e.g. `\` separators on Windows) only
in writing the media; the paths are left unchanged in the image
links (sensibly, since they might be URLs and not file paths).

These changes should restore the original behavior from before 2.14.

Closes #7345.
2021-06-10 16:47:02 -07:00
John MacFarlane
aa79b3035c T.P.MIME, extensionFromMimeType: add a few special cases.
When we do a reverse lookup in the MIME table, we just get the
last match, so when the same mime type is associated with several
different extensions, we sometimes got weird results, e.g. `.vs`
for `text/plain`.  These special cases help us get the most standard
extensions for mime types like `text/plain`.
2021-06-10 16:36:54 -07:00
Albert Krewinkel
c7dd33d5aa
Docx writer: fix handling of empty table headers
A table header which does not contain any cells is now treated as an
empty header.

Fixes: #7369
2021-06-10 18:36:49 +02:00
Albert Krewinkel
55bcd4b4fb
Lua utils: fix handling of table headers in from_simple_table
Passing an empty list of header cells now results in an empty table
header.

Fixes: #7369
2021-06-10 18:36:49 +02:00
John MacFarlane
76e5f047b0 Citeproc: avoid duplicate classes and attributes on refs div. 2021-06-08 17:51:53 -07:00
Albert Krewinkel
e66960fe4f
using-the-pandoc-api.md: switch from String to Text
Fixed examples that would no longer compile with current library
versions, as the API now uses Text instead of String in most places.
2021-06-08 12:38:20 +02:00
Sebastian Humenda
39afd4297f Mention GladTeX for EPUB export
This updates the manual and the web site about the GladTeX usage.
2021-06-07 19:17:39 -06:00
Albert Krewinkel
94e8a650fb
CONTRIBUTING.md: update modules overview 2021-06-07 20:10:56 +02:00
John MacFarlane
21cc52abe3 LaTeX writer: Fix regression in table header position.
In recent versions the table headers were no longer bottom-aligned
(if more than one line).  This patch fixes that by using minipages
for table headers in non-simple tables.

Closes #7347.
2021-06-05 14:13:58 -06:00
Jan Tojnar
c550bf8482 CommonMark writer: do not use simple class for fenced-divs
In https://github.com/jgm/pandoc/pull/7242, we introduced a simple attribute style for for code blocks and fenced divs with a single class but turns out the CommonMark extension does not support it for fenced divs.

https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/fenced_divs.md
2021-06-05 13:51:18 -06:00
Jan Tojnar
7a3ee9d3d8 CommonMark writer: do not throw away attributes when Ext_attributes is enabled
Ext_attributes covers at least the following:

- Ext_fenced_code_attributes
- Ext_header_attributes
- Ext_inline_code_attributes
- Ext_link_attributes
2021-06-05 13:51:18 -06:00
Jan Tojnar
c6f8c38c49 Markdown writer: re-use functions from Inline
Instead of duplicating linkAttributes and attrsToMarkdown, let’s just use those from the Inline module.
2021-06-05 13:51:18 -06:00
John MacFarlane
17a2f4c49d Require citeproc 0.4.0.1.
This fixes a bug which led to doubled "et al." in some
(rare) circumstances.
2021-06-05 10:04:30 -06:00
Jan Tojnar
c8ab8bccf2 DocBook reader: Add support for danger element
Added in DocBook 5.2:

- https://github.com/docbook/docbook/pull/64
- https://tdg.docbook.org/tdg/5.2/danger.html
2021-06-05 08:02:21 -06:00
Jan Tojnar
af9de925de DocBook writer: Remove non-existent admonitions
attention, error and hint are actually just reStructuredText specific.
danger was too until introduced in DocBook 5.2: https://github.com/docbook/docbook/issues/55
2021-06-05 08:02:21 -06:00
John MacFarlane
b6c04383e4 T.P.Class.IO: normalise path in writeMedia.
This ensures that we get `\` separators on Windows.
2021-06-03 18:34:38 -06:00
John MacFarlane
a54a19cca5 MANUAL: more details and a useful link for YAML syntax. 2021-06-02 22:48:56 -06:00
John MacFarlane
311736fb0a Text.Pandoc.PDF: only print relevant part of environment on --verbose. 2021-06-02 15:21:13 -06:00
John MacFarlane
2b5dad9912 Fix regression in 2.14 for generation of PDFs with SVGs.
Closes #7344.
2021-06-02 10:42:22 -06:00
John MacFarlane
3b628f7664 HTML writer: Don't omit width attribute on div.
Closes #7342.
2021-06-01 21:57:49 -06:00
John MacFarlane
2e4ef14d91 Markdown reader: fix pipe table regression in 2.11.4.
Previously pipe tables with empty headers (that is, a header
line with all empty cells) would be rendered as headerless
tables.  This broke in 2.11.4.

The fix here is to produce an AST with an empty table head
when a pipe table has all empty header cells.

Closes #7343.
2021-06-01 21:44:55 -06:00
John MacFarlane
abb59bd582 LaTeX reader: don't allow optional * on symbol control sequences.
Generally we allow optional starred variants of LaTeX commands
(since many allow them, and if we don't accept these explicitly,
ignoring the star usually gives acceptable results).  But we
don't want to do this for `\(*\)` and similar cases.

Closes #7340.
2021-06-01 13:54:51 -06:00
John MacFarlane
7225d4a612 Move tarball diet item from 2.14.0.1 to 2.14 in changelog.
This was actually part of the 2.14 release.
2021-05-31 22:53:12 -06:00
John MacFarlane
677ccb7138 Bump to 2.14.0.1; update changelog and man page. 2021-05-31 22:07:12 -06:00