Commit graph

14572 commits

Author SHA1 Message Date
Michael Hoffmann
565330033a
Don't incorporate externally linked images in EPUB documents (#7430)
Just like it is possible to avoid incorporating an image in EPUB by
passing `data-external="1"` to a raw HTML snippet, this makes the same
possible for native Images, by looking for an associated `external`
attribute.
2021-07-07 09:26:37 -07:00
Michael Hoffmann
e56e2b0e0b
Recognize data-external when reading HTML img tags (#7429)
Preserve all attributes in img tags.  If attributes have a `data-`
prefix, it will be stripped.  In particular, this preserves a
`data-external` attribute as an `external` attribute in the pandoc AST.
2021-07-06 16:06:29 -07:00
John MacFarlane
e7f8cc5786 T.P.PDF, convertImage: normalize paths.
This will avoid paths on Windows with mixed path separators,
which may cause problems with SVG conversion.

See #7431.
2021-07-06 10:39:47 -07:00
John MacFarlane
f88ebf3ebf Markdown reader: don't try to read contents in self-closing HTML tag.
Previously we had problems parsing raw HTML with self-closing
tags like `<col/>`. The problem was that pandoc would look
for a closing tag to close the markdown contents, but the
closing tag had, in effect, already been parsed by `htmlTag`.

This fixes the issue described in
<https://groups.google.com/d/msgid/pandoc-discuss/297bc662-7841-4423-bcbb-534e99bbba09n%40googlegroups.com>.
2021-07-06 10:22:07 -07:00
John MacFarlane
3ed37f0077 HTML reader: add col, colgroup to 'closes' definitions 2021-07-06 10:21:59 -07:00
John MacFarlane
3a31fe68ef Add command test for #7394.
And fix a small bug in handling of citations in notes, which
led to commas at the end of sentences in some cases.
2021-07-05 15:10:14 -07:00
John MacFarlane
77537b1765 Citeproc: cleanup and efficiency improvement in deNote. 2021-07-05 13:41:01 -07:00
John MacFarlane
ff26af59ac Revamp note citation handling.
Use latest citeproc, which uses a Span with a class rather
than a Note for notes.  This helps us distinguish between
user notes and citation notes.

Don't put citations at the beginning of a note in parentheses.
(Closes #7394.)
2021-07-05 13:19:33 -07:00
Mauro Bieg
de4da56079 document-css: reset overflow-wrap on code blocks
fixes #7423
2021-07-05 08:57:23 -07:00
John MacFarlane
95541294d3 Add FAQ on converting from/to PDF 2021-07-03 15:51:07 -07:00
John MacFarlane
972db3cdca Revert "LaTeX template: move title, author, date up to top of preamble."
This reverts commit cc088687b4
and PR #7295.

This fixes issues people had when using LaTeX commands defined later
in the preamble (or in some cases UTF-8 text) in the title or author
fields.  Closes #7422.
2021-07-03 15:34:42 -07:00
John MacFarlane
e00e5a4cc2 Add doc/faqs.md.
This is imported from the website; in the future the website
version will be drawn from here.

Added a FAQ on the use of `\AtEndPreamble` for cases when
the contents of `header-includes` need to refer to definitions
that come later in the preamble.  See #7422.
2021-07-03 15:19:39 -07:00
John MacFarlane
40a78ea05d Upgrade Debian 10 AMI for build-arm.sh. 2021-07-03 11:38:04 -07:00
John MacFarlane
8ef7aa1f81 CircleCI: change to using xcode 11.1.0 (macOS 10.14.4).
We previously built on 10.13, but 10.13 no longer gets
security updates and CirclCI is deprecating.
2021-07-03 10:36:41 -07:00
Aner Lucero
cb038bb312 HTML5 writer, remove aria-hidden when explicit atl text is provided. 2021-07-02 13:02:52 -07:00
John MacFarlane
0948af9cc5 Docx writer: Add table numbering for captioned tables.
The numbers are added using fields, so that Word can
create a list of tables that will update automatically.
2021-06-29 11:15:40 -07:00
John MacFarlane
a01ba4463f Docx writer: Fixed a couple bugs in Figure numbering. 2021-06-29 11:15:13 -07:00
John MacFarlane
a3d745e485 Docx writer: support figure numbers.
These are set up in such a way that they will work with Word's
automatic table of figures.

Closes #7392.
2021-06-29 09:56:21 -07:00
John MacFarlane
b7572db224 Use dev version of citeproc.
This eliminates double hyperlinks in author-in-text citations.
Author-only citations are no longer hyperlinked.
See jgm/citeproc#77.
2021-06-29 09:18:49 -07:00
Aner Lucero
f4ef652a41 Remove duplicated alt text in HTML output. 2021-06-29 09:02:13 -07:00
John MacFarlane
382be73d77 Use dev version of citeproc.
This fixes moving of punctuation inside quotes to conform to
the CSL spec: only comma and period are moved, not question
mark or exclamation point.
2021-06-28 22:56:16 -07:00
John MacFarlane
851d037b3e Improve punctuation moving with --citeproc.
Previously, using `--citeproc` could cause punctuation to move in
quotes even when there aer no citations. This has been changed;
now, punctuation moving is limited to citations.

In addition, we only move footnotes around punctuation if the
style is a note style, even if `notes-after-punctuation` is `true`.
2021-06-28 22:41:14 -07:00
John MacFarlane
97b0aa667c Allow $ characters in bibtex keys.
Closes #7409.
2021-06-28 13:34:12 -07:00
John MacFarlane
f045e59248 Text.Pandoc.Error: fix line calculations in reporting parsec errors.
Also remove a spurious initial newline in the error report.
2021-06-28 13:28:49 -07:00
John MacFarlane
4262898fe9 Set proper initial source name in parsing BibTeX.
(For better error messages.)
2021-06-28 13:28:02 -07:00
John MacFarlane
7ac8fcbcac Require commonmark-pandoc >= 0.2.2.1.
This fixes task lists with multiple paragraphs.
2021-06-28 12:20:12 -07:00
John MacFarlane
dd098d4e15 Markdown writer: put space between Plain and following fenced Div.
Closes #4465.
2021-06-28 11:33:22 -07:00
John MacFarlane
4a7a0cff29 ImageSize: Add Tiff constructor for ImageType.
[Minor API change]

This allows pandoc to get size information from tiff images.
Closes #7405.
2021-06-23 11:39:50 -07:00
John MacFarlane
235cdea629 reveal.js writer: Go back to setting boolean values for variables.
In a previous commit we used strings because boolean False
wouldn't render as `false`. This is changed in the dev
version ofdoctemplates, so we can go back to the more
straightforward approach.
2021-06-23 09:54:14 -07:00
John MacFarlane
7dcf727382 Use dev version of doctemplates. 2021-06-22 23:58:24 -07:00
John MacFarlane
227f675cc4 Update changelog. 2021-06-22 11:22:53 -07:00
John MacFarlane
1b07997f4a Fix regression with comment-only YAML metadata blocks.
Closes #7400.
2021-06-22 09:55:50 -07:00
John MacFarlane
086790d986 Fix unneeded import 2021-06-22 09:49:24 -07:00
John MacFarlane
8eed5b90d0 LaTeX writer: add strut at end of minipage if it contains...
line breaks.  Without them, the last line is shorter
than it should be, at least in some cases.
2021-06-21 23:33:00 -07:00
John MacFarlane
9867231779 Revert "LaTeX writer: put a strut after a line break (\\)."
This reverts commit e2a7ecb5f7.
2021-06-21 23:19:40 -07:00
John MacFarlane
e2a7ecb5f7 LaTeX writer: put a strut after a line break (\\).
This ensures that we have proper spacing before the next
line (which might e.g. be a table bottom border).
This gives better results in cases like test/command/7272.md.
2021-06-21 23:17:43 -07:00
John MacFarlane
0352f7845b Improve emailAddress in Text.Pandoc.Parsing.
Previously the parser would accept characters in domains
that are illegal in domains, and this sometimes caused it
to gobble bits of the following text.

Closes #7398.

Note that this change, by itself, caused some txt2tag reader
tests to fail. txt2tags allows bare email addresses with
a following form query.  So, in addition to the change
to emailAddress, we modify the txt2tags parser so it can
still handle these cases.
2021-06-21 22:35:07 -07:00
John MacFarlane
2ef2049b4e Update command test for change to LaTeX LineBreak handling. 2021-06-21 22:34:38 -07:00
John MacFarlane
ed3974a254 LaTeX writer: always use a minipage for cells with line breaks...
if width information is available.  Otherwise the way we treat them can
lead to content that overflows a cell.

Closes #7393.
2021-06-21 18:25:36 -07:00
John MacFarlane
eee648447a LaTeX writer: Use \strut instead of ~ before \\ in empty line. 2021-06-21 18:25:07 -07:00
John MacFarlane
14b2eb2aeb reveal.js writer: better handling of options.
Previously it was impossible to specify false values for
options that default to true; setting the option to false
just caused the portion of the template setting the option
to be omitted.

Now we prepopulate all the variables with their default
values, including them unconditionally and allowing them
to be overridden.
2021-06-21 16:40:52 -07:00
John MacFarlane
a39313eddb Fix test for #7397 2021-06-21 09:30:23 -07:00
John MacFarlane
82ad855f38 Markdown writer: Fix regression in code blocks with attributes.
Code blocks with a single class but nonempty attributes
were having attributes drop as a result of #7242.

Closes #7397.
2021-06-21 08:49:00 -07:00
John MacFarlane
0c4ed0045a Bump to 2.14.0.3, update changelog, require latest skylighting. 2021-06-20 19:25:43 -07:00
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