Commit graph

1167 commits

Author SHA1 Message Date
Karl Pettersson
5303791bc4 Customizable type of PDF/A for the ConTeXt writer (issue #5608) (#5610)
* Let the user choose type of PDF/A generated with ConTeXt (closes #5608)
* Updated ConTeXt test documents for changes in tagging
* Updated color profile settings in accordance with ConTeXt wiki
* Made ICC profile and output intent for PDF/A customizable
* Read pdfa variable from meta (and updated manual)
2019-07-15 11:55:04 -07:00
John MacFarlane
968d2046a3 Update test for new skylighting. 2019-07-14 10:48:14 -07:00
Alexander Krotov
0713cb65bc Muse: add RTL support
Closes #5551
2019-07-14 18:22:52 +03:00
Vasily Alferov
f6c92c7523 Fix #4499: add mbox and hbox handling to LaTeX reader (#5586)
When `+raw_tex` is enabled, these are passed through literally.
Otherwise, they are handled in a way that emulates LaTeX's behavior.
2019-07-13 16:55:41 -07:00
John MacFarlane
7bc9eab846
Merge pull request #5589 from blmage/fix-3992
Add support for EPUB2 covers (fix #3992)
2019-07-13 16:48:09 -07:00
John MacFarlane
4a5e727c8c Man writer: Improved definition list term output.
Now we boldface code but not other things. This matches the
most common style in man pages (particularly option lists).

Also, remove a regression in the last commit in which 'nowrap'
was removed.
2019-07-13 16:41:43 -07:00
John MacFarlane
d0bf7efe95 Man writer: fixed boldfacing of definition terms.
Previously the bold-facing would be interrupted by
other formatting, because we used `.B`.

Closes #5620.
2019-07-13 16:12:28 -07:00
John MacFarlane
a16311c225
Merge pull request #5606 from blmage/odt-frames
Improve the parsing of frames in ODT documents
2019-07-13 15:53:58 -07:00
John MacFarlane
1784161946 LaTeX reader: Properly handle \providecommand and environment...
They are now ignored if the corresponding command or environment
is already defined.

Closes #5635.
2019-07-13 15:51:33 -07:00
mb21
6cf5c3f6ac fix filename and issue reference of previous commit 2019-07-13 12:03:45 +02:00
John MacFarlane
6d30d3e0b3 Pass through aria- attributes to HTML5.
Also document addition of data- prefix to unknown attributes.

Closes #5646.
2019-07-12 17:03:01 -07:00
Brian Leung
1d9ff85b45 RST reader: keep name property in imgAttr. (#5637)
Closes #5619.
2019-07-10 18:35:01 -07:00
Arfon Smith
020e2a06d5 Updating JATS template to v1.1dtd (#5632)
* Updating JATS template to v1.1dtd

* Update writer.jats
2019-07-06 23:31:02 +02:00
Brian Leung
9c4ba81357 Markdown reader: handle inline code more eagerly within lists. (#5628)
Closes #5627.
2019-07-06 23:14:21 +02:00
Pete Ryland
24c781039f Fix redundant constraint warnings. (#5625) 2019-07-02 10:29:34 +02:00
martinfrancois
4b73544087 add tests for EPUB2 and EPUB3 cover reader 2019-06-22 22:07:26 +02:00
oquechy
f0edf60364 Support epigraph command in LaTeX Reader.
Closes #3523.
2019-06-21 18:27:26 +02:00
blmage
449c133406 Add a test for MathML formulas in ODT documents 2019-06-20 21:55:31 +02:00
Jeroen de Haas
e67f4c58f2 Powerpoint code formatting is now context dependent (#5573)
This commit alters the way in which the Powerpoint writer treats
inline code and code blocks.

- Inline code is now formatted at the same size as the surrounding
  text.
- Code blocks are now given a margin and font size according to their
  level.
- Furthermore this commit allows changing the font with which code is
  formatted via the `monofont` option.

Tested in
- PowerPoint 365 for Windows - 1808 (Build 10730.20344 Click-to-Run)
- PowerPoint 365 for Mac - 16.26 (19060901)
2019-06-14 08:42:06 -07:00
John MacFarlane
2cd1c7b30f Update test for skylighting 0.8.1.1. 2019-06-13 19:33:52 -07:00
John MacFarlane
fa50da3030 OpenDocument writer: Avoid duplicate attributes.
We use the innermost attribute in nested cases.

Closes #4634.
2019-06-12 21:51:09 -07:00
Albert Krewinkel
11bb862767 Lua: add a clone() method to all AST elements (#5572)
Closes: #5568
2019-06-12 09:58:38 -07:00
John MacFarlane
bec95c97ac LaTeX writer: Don't highlight code in headings.
This causes compilation errors, and I don't know how
to work around them.  Closes #5574.
2019-06-11 20:47:29 -07:00
John MacFarlane
9725522a7f Revert "JATS template: don't include journal-meta unless 'journal'..."
This reverts commit 193b5cceba.

journal-meta is required.  Better to include it even if it
doesn't validate through lack of required fields.
2019-06-11 17:31:52 -07:00
John MacFarlane
193b5cceba JATS template: don't include journal-meta unless 'journal'...
...is set in metadata.

Otherwise we get validation errors.
2019-06-11 17:08:40 -07:00
John MacFarlane
5bbaedac57 JATS writer: ensure validity of pub-date.
We try to parse the date and convert to year, month, day,
as expected in pub-date.  We also add an iso-8601-date attribute
if possible.
2019-06-11 17:01:36 -07:00
John MacFarlane
f7c0d2fb3f JATS writer: don't use break element for LineBreak.
It's only allowed in a few special contexts, and not in
p elements.
2019-06-11 16:19:12 -07:00
John MacFarlane
bb68c183b3 JATS writer: don't embed string-name in string.
That's illegal with this DTD.
2019-06-11 16:16:05 -07:00
Albert Krewinkel
6704b66c33
test/lua/module/pandoc.lua: fix non-determinism in test 2019-06-11 21:17:06 +02:00
Albert Krewinkel
7f9b32e36a
data/pandoc.lua: fix deletion of nonexistent attributes
Fixes: #5569
2019-06-11 19:48:00 +02:00
Albert Krewinkel
03b9f3d5f3
Lua pandoc module: better tests for Attr and AttributeList 2019-06-11 19:48:00 +02:00
John MacFarlane
550d949b9e JATS writer: wrap elements with p when needed.
The JATS spec restricts contents of certain
elements (fn, list-item); this patch wraps
elements that can't go in these contexts inside
p elements with specific-use "wrapper", so the
documents will conform.

Closes #5570.
2019-06-11 10:36:34 -07:00
John MacFarlane
3febd81cbc LaTeX writer: Use mbox to get proper behavior inside \sout.
Closes #5529.
2019-06-10 15:02:48 -07:00
John MacFarlane
59529e408b Asciidoc writer: use doubled ## when necessary for spans.
Closes #5566.
2019-06-10 14:47:04 -07:00
John MacFarlane
2e12106a90 Asciidoc writer: ensure correct nesting strong/emph.
Closes #5565.
2019-06-10 14:42:08 -07:00
Alexander Krotov
814c3af4df Muse reader: test that links inside image descriptions work 2019-06-09 14:08:37 +03:00
John MacFarlane
05ae9f265f Roll back automatic figure/table numbering in ODT/OpenDocument.
This was added in pandoc 2.7.2, but it makes it impossible
to use pandoc-crossref. So this has been rolled back for now,
until we find a good solution to make this behavior optional
(or a creative way to let pandoc-crossref and this feature
to coexist).

See #5474.
2019-06-08 14:17:52 -07:00
John MacFarlane
d1df2b2783 LaTeX reader: pass through unknown listings language as class.
Previously if the language was not in the list of listings-
supported languages, it would not be added as a class, so
custom syntax highlighting could not be used.

Closes #5540.
2019-06-08 12:25:34 -07:00
John MacFarlane
d8b4e45be0 LaTeX writer: Include inline code attributes with --listings.
Closes #5420.
2019-06-07 10:03:10 -07:00
Albert Krewinkel
1c36857465 Add jira writer (#5548)
This adds support for Atlassian's jira markup.

Closes #2497
2019-06-05 17:52:23 -04:00
John MacFarlane
10615420de Include trailing {}s in raw latex commands.
Change is in rawLaTeXInline in LaTeX reader, but
it affects the markdown reader and other readers
that allow raw LaTeX.

Previously, trailing `{}` would be included for
unknown commands, but not for known commands.
However, they are sometimes used to avoid a trailing
space after the command.  The chances that a `{}`
after a LaTeX command is not part of the command
are very small.

Closes #5439.
2019-06-04 21:20:11 -07:00
John MacFarlane
f82d91eb49 Markdown reader: don't create implicit reference for empty header.
Closes #5549.
2019-06-04 08:39:54 -07:00
John MacFarlane
928681ca04 Avoid unwanted interpretation of def list term as other kind of block,
e.g. ordered list item, in Markdown writer.

Closes #554.
2019-06-03 09:51:19 -07:00
Albert Krewinkel
7db3d9ab04
Textile writer: fix closing tag for math output
Opening and closing tag for math output match now.
2019-06-01 10:16:00 +02:00
Albert Krewinkel
f7222370af
Lua modules: test pandoc.mediabag 2019-05-30 08:44:40 +02:00
Albert Krewinkel
3c3e9a12cd
Lua Version type: shorten "version too old" message 2019-05-29 22:59:45 +02:00
John MacFarlane
e871d65b67
Merge pull request #5526 from tarleb/richer-version-type
Lua: add Version type to simplify comparisons
2019-05-29 12:05:04 -04:00
John MacFarlane
1de7b20ebb
Merge pull request #5497 from mb21/html-writer-video-audio
Output HTML5 video and audio elements
2019-05-29 12:01:12 -04:00
John MacFarlane
970b820f47 HTML reader: misc. epub related fixes.
- With epub extensions, check for epub:type in addition to type.
- Fix problem with noteref parsing which caused block-level
  content to be eaten with the noteref.
- Rename pAnyTag to pAny.
- Refactor note resolution.
2019-05-29 08:15:50 -07:00
Albert Krewinkel
505f5bf5d9
Lua: add Version type to simplify comparisons
Version specifiers like `PANDOC_VERSION` and `PANDOC_API_VERSION` are
turned into `Version` objects. The objects simplify version-appropriate
comparisons while maintaining backward-compatibility.

A function `pandoc.types.Version` is added as part of the newly
introduced module `pandoc.types`, allowing users to create version
objects in scripts.
2019-05-29 10:07:43 +02:00
mb21
a58304e00e HTML writer: output video and audio elements
depending on file extension of the image path
2019-05-29 09:43:50 +02:00
John MacFarlane
2ad5dacf87 Remove command test for #5517.
We need a better test that works cross-platform.
Until then, removing this.

Closes #5528.
2019-05-28 12:45:31 -07:00
Mauro Bieg
3f57f49033 HTML writer: emit empty alt tag in figures (#5518)
The same text is already in the <figcaption> and
screen-readers would read it twice, see #4737
2019-05-28 12:31:41 -04:00
John MacFarlane
8a5b9ac868 Add test for relative file: URI to #5517. 2019-05-28 09:05:28 -07:00
Mauro Bieg
214da7217b Fix handling of file: URL scheme in downloadOrRead (#5522)
Move up the pattern match to be reachable, closes #5517.

Previously `file:/` URLs were handled wrongly and pandoc attempted
to make HTTP requests, which failed.
2019-05-28 11:51:21 -04:00
John MacFarlane
3593dcda61 Use skylighting 0.8. 2019-05-27 12:15:43 -07:00
Mauro Bieg
d07ed83d70 consolidate simple-table detection (#5524)
add `onlySimpleTableCells` to `Text.Pandoc.Shared`

[API change]

This fixes an inconsistency in the HTML reader, which did not treat tables with `<p>` inside cells as simple.
2019-05-27 13:53:19 -04:00
Alexander Krotov
f807f5b383 Muse reader: allow images inside link descriptions 2019-05-25 19:17:16 +03:00
Alexander Krotov
7514277454 HTML reader: trim definition list terms 2019-05-25 18:36:56 +03:00
Alexander Krotov
19f9eed0bb Muse writer: do not escape empty line after <br> 2019-05-25 17:54:31 +03:00
John MacFarlane
aef71894ce Markdown writer: Ensure the code fence is long enough.
Previously too few backticks were used when the code block
contained an indented line of backticks.  (Ditto tildes.)

Cloess #5519.
2019-05-22 15:21:15 -07:00
Jesse Rosenthal
ed73bd28e5 Markdown writer: Handle labels with integer names
Previously if labels had integer names, it could produce a conflict
with auto-labeled reference links. Now we test for a conflict and find
the next available integer.

Note that this involves adding a new state variable `stPrevRefs` to
keep track of refs used in other document parts when using
`--reference-location=block|section`

Closes #5495
2019-05-21 12:19:59 -04:00
Albert Krewinkel
6208d4e7fc Improve output of Lua tests (#5499)
This makes use of tasty-lua, a package to write tests in Lua
and integrate the results into Tasty output. Test output becomes
more informative: individual tests and test groups become visible
in test output. Failures are reported with helpful error messages.
2019-05-20 12:52:28 -04:00
John MacFarlane
e87b54dcad JATS writer: properly handle footnotes.
"Best Practice: When footnotes are grouped at the end of an article,
wrap them in a `<fn-group>` and use an `<xref>` element in the text, as
usual, to tie each footnote in the list to a particular location in the
text."

Closes #5511.
2019-05-16 21:39:03 -07:00
Alexander Krotov
2e13c0a451 FB2 writer: do not wrap note references into <sup> and brackets
Existing FB2 readers, such as FBReader, already display links with type="note" as a superscript.
2019-05-15 13:31:07 +03:00
Albert Krewinkel
8b00bc6029
Org reader: fix planning elements in headers level 3 and higher
Planning info is now always placed before the subtree contents.
Previously, the planning info was placed after the content if the
header's subtree was converted to a list, which happens with headers of
level 3 and higher per default.

Fixes: #5494
2019-05-13 22:55:13 +02:00
Albert Krewinkel
00ef03827e
Org reader: omit, but warn about unknown export options
Unknown export options are properly ignored and omitted from the output.
2019-05-13 22:25:04 +02:00
Mauro Bieg
1d033a2691 add test/tables.xwiki to git and pandoc.cabal (#5498) 2019-05-12 10:37:37 -04:00
Albert Krewinkel
da9638e6a3
Org writer: always indent src blocks content by 2 spaces
Emacs always uses two spaces when indenting the content of src blocks,
e.g., when exiting a `C-c '` edit-buffer. Pandoc used to indent contents
by the space-equivalent of one tab, but now always uses two spaces, too.

Closes: #5440
2019-05-12 14:49:52 +02:00
Alexander Krotov
5c7ad59ffe FB2 reader: add notes parsing test 2019-05-11 12:10:20 +00:00
John MacFarlane
98ee6ca289 Asciidoc writer: use ` +...+ ` form for inline code.
The old `` `a__b__c` `` yields emphasis inside code in asciidoc.
To get a pure literal code span, use `` `+a__b__c+` ``.
2019-05-05 21:57:30 -07:00
John MacFarlane
5affa30e8a Asciidoc writer: use proper smart quotes with asciidoctor.
Asciidoctor has a different format for smart quotes.
Closes #5487.
2019-05-05 21:47:15 -07:00
Albert Krewinkel
33e2d46dbe
Org reader: prefer plain symbols over math symbols
Symbols like `\alpha` are output plain and unemphasized, not as math.

Fixes: #5483
2019-05-05 14:48:37 +02:00
Albert Krewinkel
7e7bc3493e
Org reader: recognize emphasis after TODO/DONE keyword
Fixes: #5484
2019-05-05 13:53:11 +02:00
Albert Krewinkel
786594b23b Lua: add pandoc.system module (#5468)
The `system` Lua module provides utility functions to interact with the
operating- and file system. E.g.

    print(pandoc.system.get_current_directory())

or

    pandoc.system.with_temporary_directory('tikz', function (dir)
      -- write and compile a TikZ file with pdflatex
    end)
2019-05-04 01:06:30 -04:00
John MacFarlane
a20323033e Fix footnote in image caption.
Regression!  The fix for #4683 broke this case.
2019-05-01 16:56:37 -07:00
John MacFarlane
f11d0c9dc8 HTML: prevent gratuitious emojification on iOS.
iOS chooses to render a number of Unicode entities,
including '↩', as big colorful emoji.  This can be
defeated by appending Unicode
VARIATION SELECTOR-15'/'VARIATION SELECTOR-16'.
So we now append this character when escaping
strings, for both '↩' and '↔'.

If other characters prove problematic, they can
simply be added to needsVariationSelector.

Closes #5469.
2019-04-30 22:32:52 -07:00
Alexander Krotov
2b2d9baaa8 Muse writer tests: compare Text without converting to [Char] 2019-04-28 03:21:14 +03:00
John MacFarlane
e409509a68 RST writer: treat Span as transparent.
Previously an Emph inside a Span was being treated as
nested markup and ignored.  With this patch, the Span
is just ignored.

Closes #5446.
2019-04-15 09:48:11 -07:00
John MacFarlane
6d19c08e9f LaTeX template: Add pdflang to hypersetup if lang is set.
Closes #5443.
2019-04-11 16:58:36 -07:00
John MacFarlane
4f572ddf69 Vimwiki reader: improve handling of internal links.
1) Don't append `.html`
2) Add `wikilink` title

This mirrors behavior of other wiki readers.  Generally the
`.html` extension is not wanted.  It may be important for
output to HTML in certain circumstances, but it can always
be added using a filter that matches on links with title
`wikilink`.

Note that if you have a workflow that uses pandoc to convert
vimwiki to readable HTML pages, you may need to add such a
filter to reproduce current behavior.

Here is a filter that does the job:

```lua
function Link(el)
    if el.title == 'wikilink' then
      el.target = el.target .. ".html"
    end
    return el
end
```

Save this as `fixlinks.lua` and use with `--lua-filter fixlinks.lua`.

Closes #5414.
2019-04-05 10:04:28 -07:00
Jesse Rosenthal
ab5c701343 PowerPoint writer: expand builtin reference doc to model all layouts
The previous built-in reference doc had only title and content
layouts. Add in a section-header slide and a two-content slide, so
users can more easily modify it to build their own templates.

Golden files needed to be regenerated. Checked on MS PowerPoint 2013.
2019-04-05 08:50:39 -04:00
Jesse Rosenthal
7ac860be74 PowerPoint tests: Regenerate golden files
Due to viewProps change in 61dc0f9f.

Golden files checked on PowerPoint 2013 (Win 10 on virtualbox).
2019-04-04 10:46:30 -04:00
John MacFarlane
23df94e30a Update command test #5416 to make it windows friendly 2019-04-02 17:59:47 -07:00
Andrew Dunning
3d1409347a LaTeX template: Ensure correct heading/table order (#5421)
Improve the workaround for #1658, adapting a solution by @u-fischer in
<https://github.com/latex3/latex2e/issues/131> that works whether or not
the `indent` variable is enabled.

Remove `subparagraph` variable in LaTeX template.  The default is now
to use run-in style for level 4 and 5 headings (`\paragraph` and `\subparagraph`).
To get the previous default behavior (where these were formatted as blocks,
like `\subsubsection`), set the `block-headings` variable.

An example is given in the manual of reformatting the appearance of headings
more thoroughly using KOMA-Script.

Closes #5365.
2019-04-02 18:18:36 -06:00
John MacFarlane
40b60a911c Actually run the xwiki writer tests. 2019-04-02 17:11:35 -07:00
Derek Chen-Becker
45944b51a0 Add XWiki Support (#4167)
Add XWiki Support

Closes #1800
2019-04-02 17:27:02 -06:00
Mauro Bieg
0fa6951dc1 Dokuwiki Reader fix: parse single curly brace (#5417)
fixes #5416
2019-04-01 11:36:47 -06:00
Jesse Rosenthal
0d1fc7dfff PowerPoint writer: add test for speaker notes after metadata. 2019-03-31 17:09:00 -04:00
Jesse Rosenthal
efa6304eee Pptx writer: test for speaker notes after breaking header. 2019-03-30 22:52:31 -04:00
John MacFarlane
93ee73e1dc LaTeX writer: Avoid inadvertently creating ? or ! ligatures.
These are upside down ? and !, resp.

Closes #5407.
2019-03-29 10:04:22 -07:00
John MacFarlane
40865958ce Markdown reader: fenced div takes priority over setext header.
For

    ::: {.cell}
    ---
    :::
2019-03-28 17:39:22 -07:00
Andrew Dunning
c21db81efd LaTeX template: Add pandoc to PDF metadata (#5388)
Credits pandoc in content creator metadata (the default is 'LaTeX with hyperref').
2019-03-25 22:36:14 -06:00
John MacFarlane
052684712b HTML reader: read data-foo attribute into foo.
The HTML writer adds the `data-` prefix for HTML5
for nonstandard attributes.  But the attributes are
represented in the AST without the `data-` prefix,
so we should strip this when reading HTML.

Closes #5392.
2019-03-25 08:43:59 -07:00
Andrew Dunning
e91af0a8a3 LaTeX template: Group graphics-related code (#5389)
* LaTeX template: Group graphics-related code

The default figure placement was added in <f3ab4bc2b9>; there does not appear to have been a reason for placing it at the end of the preamble.

* Update tests
2019-03-22 22:35:55 -06:00
John MacFarlane
1e60776226 LaTeX writer: Fix footnotes in table caption and cells.
This fixes a bug wherein footnotes appeared in the wrong
order, and with duplicate numbers, when in table captions
and cells.

We now use regular `\footnote` commands, even in the table
caption and the minipages containing cells. Apparently
longtable knows how to handle this.

Closes #5367.
2019-03-22 11:55:41 -07:00
John MacFarlane
66e5f0ff8d Docx writer: Use w:br without attributes for line breaks.
We previously added the attribute `type="textWrapping"`, but
this causes problems on Word Online.

Closes #5377.
2019-03-21 09:28:16 -07:00
John MacFarlane
6be8f4e953 Improved fix to #5340 and added test. 2019-03-18 16:53:36 -07:00
John MacFarlane
3880a23de9 Properly escape attributes in Markdown writer.
Closes #5369.
2019-03-17 18:15:47 -07:00
John MacFarlane
ebd7035a2a Add test case for #5368. 2019-03-17 18:02:59 -07:00