Commit graph

5550 commits

Author SHA1 Message Date
John MacFarlane
581a3514ca RST reader: improve parsing of inline interpreted text roles.
* Use a Span with class "title-reference" for the default
  title-reference role.
* Use B.text to split up contents into Spaces, SoftBreaks, and Strs
  for title-reference.
* Use Code with class "interpreted-text" instead of Span and Str for
  unknown roles.  (The RST writer has also been modified to round-trip
  this properly.)
* Disallow blank lines in interpreted text.
* Backslash-escape now works in interpreted text.
* Backticks followed by alphanumerics no longer end interpreted text.

Closes #4811.
2018-08-05 09:56:43 -07:00
Francesco Occhipinti
74a35b123c RST writer: allow images to be directly nested within links, closes #4810 (#4814) 2018-08-03 12:13:18 -07:00
Mauro Bieg
f83bdb1ac5 Better error message on -t pdf -o out.pdf (#4815)
closes #1155 (again)
2018-08-03 12:04:38 -07:00
Francesco Occhipinti
2661658a69 RST writer: use titleblock instead of title variable for title block
Closes #4803

After this commit use `$titleblock$` in order to get what was contained
in `$title$` before, that is a title and subtitle rendered according to
the official rST method:
http://docutils.sourceforge.net/docs/user/rst/quickstart.html#document-title-subtitle. from

With this commit, the `$title$` and `$subtitle$` metadata are available and they
simply carry the metadata values.  This opens up more possibilities in templates.
2018-08-01 12:32:16 -07:00
John MacFarlane
d3d932f42c Markdown reader: allow unquoted numbers, booleans as YAML mapping keys.
Previously in 2.2.2 you could not do

    ---
    0: bar
    ...

but only

    ---
    '0': bar
    ...

With this change, both forms work.
2018-07-30 23:04:53 -07:00
John MacFarlane
cbb662ca07 Use YAML.decode rather than YAML.decodeStrict.
(Minor)
2018-07-30 22:02:59 -07:00
John MacFarlane
78dca68a0a DocBook reader: metadata handling improvements.
Now we properly parse title and subtitle elements that are
direct children of book and article (as well as children of
bookinfo, articleinfo, or info).

We also now use the "subtitle" metadata field for subtitles,
rather than tacking the subtitle on to the title.
2018-07-30 14:38:38 -07:00
Albert Krewinkel
fb94c0f6a1 Lua Utils module: add function blocks_to_inlines (#4799)
Exposes a function converting which flattenes a list of blocks into a
list of inlines. An example use case would be the conversion of Note
elements into other inlines.
2018-07-30 10:55:25 -07:00
danse
be2d7921cb RST reader: remove support for nested inlines.
RST does not allow nested emphasis, links, or other inline
constructs.

Closes #4581, double parsing of links with URLs as
link text.  This supersedes the earlier fix for #4581
in 6419819b46.

Fixes #4561, a bug parsing with URLs inside emphasis.

Closes #4792.
2018-07-24 15:35:50 -07:00
John MacFarlane
50e8c3b107 MediaWiki writer: Avoid extra blank line in tables with empty cells.
Note that the old output is semantically identical, but the
new output looks better.

Closes #4794.
2018-07-24 11:38:24 -07:00
Albert Krewinkel
4e899eb9c8
Org reader: fix parsers relying on parseFromString
Emphasis was not parsed when it followed directly after some block types
(e.g., lists).

The org reader uses a wrapper for the `parseFromString` function to
handle org-specific state. The last position of a character allowed
before emphasis was reset incorrectly in this wrapper. Emphasized text
was not recognized when placed directly behind a block which the reader
parses using `parseFromString`.

Fixes: #4784
2018-07-23 22:05:41 +02:00
John MacFarlane
6419819b46 RST reader: fix double-link bug.
Link labels containing raw URLs were parsed as autolinks,
but links within links are not allowed.

Closes #4581.
2018-07-21 22:53:04 -07:00
John MacFarlane
34b229dd5a Fix for bug in parsing \include in markdown.
Starting in 2.2.2, everything after an `\input` (or `\include`)
in a markdown file would be parsed as raw LaTeX.
This commit fixes the issue and adds a regression test.

Closes #4781.
2018-07-19 17:44:16 -07:00
John MacFarlane
ac1a46b0cb rawLaTeXBlock: never retokenize macroDef. 2018-07-19 13:52:54 -07:00
John MacFarlane
d7edfbdf4d Fix regression finding templates in user data directory.
Under version 2.2.1 and prior pandoc found latex templates in the
templates directory under the data directory, but this no longer
works in 2.2.2.

MANUAL says: "If the template is not found, pandoc will search for it in
the templates subdirectory of the user data directory (see `--data-dir`)."

This commit fixes the regression, which stems from 07bce91.

Closes #4777.
2018-07-18 18:55:12 -07:00
John MacFarlane
af445b34d8 Make markdown and github writers respect the emoji extension. 2018-07-15 16:02:46 -07:00
Anders Waldenborg
ec30fb37c1 Wrap emojis in span nodes (#4759)
Text.Pandoc.Emoji now exports `emojiToInline`, which returns a Span inline containing the emoji character and some attributes with metadata (class `emoji`, attribute `data-emoji` with emoji name).  Previously, emojis (as supported in Markdown and CommonMark readers, e.g "😄")
were simply translated into the corresponding unicode code point.  By wrapping them in Span
nodes, we make it possible to do special handling such as giving them a special font
in HTML output.  We also open up the possibility of treating them differently when the
`--ascii` option is selected (though that is not part of this commit).

Closes #4743.
2018-07-15 15:14:40 -07:00
John MacFarlane
1579e57833 Support abbreviated units for siunitx (#4773). 2018-07-15 13:35:37 -07:00
John MacFarlane
339a9e1b8b LaTeX reader: be more forgiving in key/value option parsing.
We now allow arbitrary LaTeX values.

This helps with #4761. The `\maxwidth` is still not
propagated to the latex destination, but at least we don't
choke on parsing.
2018-07-15 12:53:42 -07:00
Mauro Bieg
5809d5bef2 AsciiDoc Writer: escape square brackets at start of line (#4708)
closes #4545
2018-07-12 19:37:37 +02:00
John MacFarlane
146555e636 PDF: revert fix for #4484 (only compress images on last run).
Closes #4755.

This will mean some increase in the time it takes to
produce an image-heavy PDF with xelatex, but it will
make tables of contents correct, which is more important.

Note that the production time should also be decreased
by the previous commit, which fixed a logic error
affecting the number of runs.  That change might mitigate
the effect of this one.
2018-07-06 23:51:20 +02:00
John MacFarlane
55e8cb07d0 PDF: Fix logic error in runTeXProgram.
We were running the tex program one more time than requested.
This should speed up pdf production.
2018-07-06 23:43:43 +02:00
Alexander Krotov
5479ea300a JATS reader: fix typo ("lable" instead of "label") 2018-07-02 18:31:46 +03:00
Alexander Krotov
f6dfb632ff Spellcheck comments 2018-07-02 18:30:37 +03:00
John MacFarlane
016e0a09e2 RST writer: don't treat 'example' as a syntax name.
This fixes conversions from org with example blocks.
Closes #4748.
2018-06-30 11:45:49 +02:00
John MacFarlane
5d78ad12b2 Fix compiler warnings. 2018-06-29 23:47:07 +02:00
John MacFarlane
e49b8304e4 Use HsYAML instead of yaml for translations, YAML metadata.
yaml wraps a C library; HsYAML is pure Haskell.
Closes #4747.  Advances #4535.
2018-06-29 23:21:25 +02:00
John MacFarlane
6ed114cb5d Use decodeEither' not decodeEither (deprecated). 2018-06-29 11:47:58 +02:00
Anders Waldenborg
904924d172 CommonMark reader: Handle ascii_identifiers extension (#4733)
Non-ascii characters were not stripped from identifiers even if the
`ascii_identifiers` extension was enabled (which is is by default for
gfm).

Closes #4742
2018-06-29 10:41:26 +02:00
John MacFarlane
edce81734e Avoid using deprecated 'decode' from yaml. 2018-06-28 17:38:58 +02:00
Mauro Bieg
0459d1be26 TikiWiki reader: improve list parsing (#4723)
- remove trailing Space from list items
- parse lists that have no space after marker (fixes #4722)
2018-06-28 13:35:54 +02:00
John MacFarlane
06bcb7c872 Remove network-uri flag and use 'Network.Socket'.
This removes a compiler warning.
There is no need for the old network-uri flag, since
network 2.6 was released in 2014.
2018-06-28 11:51:52 +02:00
John MacFarlane
45904ab27f LaTeX reader: Treat lilypond as a verbatim environment.
Closes #4725.
2018-06-25 22:16:58 +02:00
John MacFarlane
7eb08169aa Fixed typo in LaTeX writer. 2018-06-25 22:16:58 +02:00
Alexander Krotov
ebf4ed8944 Texinfo writer: use @sup and @sub instead of custom macros
Fixes #4728
2018-06-25 03:14:04 +03:00
John MacFarlane
48a505c5a0 Markdown reader: allow empty code spans.
E.g. `` ` ` ``.
2018-06-13 11:12:10 -07:00
Mauro Bieg
7e477db95c LaTeX Reader: parse figure label into Image id (#4704)
closes #4700
2018-06-13 10:41:30 -07:00
Raymond Ehlers
2c1a309c9f Beamer: Allow "noframenumbering" option (#4696)
As noted [here](https://tex.stackexchange.com/a/49805) ([beamer
commit here](ff70090f36)),
`noframenumbering` is an undocumented, but long existing option
to disable frame numbering for a particular slide. This is useful
to avoid numbering backup slides.
2018-06-12 10:39:20 -07:00
John MacFarlane
07bce91f4f Allow --template to take a URL argument. 2018-06-12 10:33:34 -07:00
John MacFarlane
4173460689 reveal.js writer and template: reuse mathjax URL...
...provided by the argument to `--mathjax` or the normal
pandoc default, rather than a hard-coded one in the template.

Closes #4701.
2018-06-12 09:35:27 -07:00
John MacFarlane
1e45bb0041 LaTeX reader: allow spaces around \graphicspath arguments.
Closes #4698.
2018-06-12 09:25:42 -07:00
Alexander Krotov
b6305a63cd FB2 writer: convert Plain to Para in annotation
Address #2424
2018-06-12 15:32:30 +03:00
Alexander Krotov
54d16545c9 FB2 writer: fix order of items in title-info
Address issue #2424
2018-06-12 14:48:52 +03:00
John MacFarlane
c1ae8d00ee LaTeX writer: properly handle footnotes in table captions.
Refactored code from figure captions to use in both places.

Closes #4683.
2018-06-07 21:30:14 -07:00
Mauro Bieg
905dee6ee3 beamer output: fix single digit column percentage (#4691)
fixes #4690
2018-06-07 10:50:14 -07:00
Adrian Sieber
9536eb7c79 Add missing re-export of "breezeDark" style (#4687) 2018-06-05 09:50:34 -07:00
Mauro Bieg
764bf86177 Regression: make --pdf-engine work with full paths (#4682)
Fixes #4681.
2018-06-03 13:59:11 -07:00
John MacFarlane
6ea706256d Support --number-sections in RST output...
via the "section-numbering" directive in standalone output.
2018-06-02 21:37:15 -07:00
John MacFarlane
d32e866449 LaTeX reader: handle includes without surrounding blanklines.
In addition, `\input` can now be used in an inline context,
e.g. to provide part of a paragraph, as it can in LaTeX.

Closes #4553.
2018-06-01 09:25:10 -07:00
mb21
0fc7d38544 Muse reader: get rid of non-exhaustive pattern match warning 2018-06-01 15:36:36 +02:00