Commit graph

1087 commits

Author SHA1 Message Date
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