Commit graph

12966 commits

Author SHA1 Message Date
John MacFarlane
a1f69b1c7d Fix regression preventing header-includes from being set using -V.
See #5904.
2019-11-14 05:48:20 -08:00
Albert Krewinkel
e43c2e75a1 RST writer: fix backslash escaping after strings
The check whether a complex inline element following a string must be
escaped, now depends on the last character of the string instead of the
first.

Fixes: #5906
2019-11-14 14:46:32 +01:00
John MacFarlane
8ff7fd484f Fix regression introduced by last commit. 2019-11-13 22:46:24 -08:00
John MacFarlane
3982b23428 Markdown reader: don't parse footnote body unless extension enabled. 2019-11-13 21:19:06 -08:00
John MacFarlane
cbcaf19174 Add test for #5881. 2019-11-13 17:07:44 -08:00
John MacFarlane
ec043e0d97 Default files: combine with prior values when appropriate.
Certain command-line arguments can be repeated:
`--metadata-file`, `--css`, `--include-in-header`,
`--include-before-body`, `--include-after-body`, `--variable`,
`--metadata`, `--syntax-definition`.  In these cases, values
specified in default files should be added to the list rather
than replacing values specified earlier on the command line
(perhaps in other default files).

So, for example, if one does

    pandoc --variable foo=3 --defaults d1 --defaults d2

and `d1` sets the variable `bar` and `d2` sets `baz`,
all three variables will be set.

Closes #5894.
2019-11-13 16:51:02 -08:00
John MacFarlane
28a1f50111 Update manual in light of last change. 2019-11-13 16:33:49 -08:00
John MacFarlane
4c4e3066d6 Use atx-headers rather than setext-headers in defaults file...
for consistency with CLI options.  See #5894.
2019-11-13 16:30:36 -08:00
John MacFarlane
5c0b3743be Ensure there's a blank line before RST tables.
Closes #5898.
2019-11-13 10:10:55 -08:00
Albert Krewinkel
791043772b
doc/lua-filters.md: mention which Lua version is shipped with pandoc
See: #5892
2019-11-13 08:48:34 +01:00
despresc
90e436d496 Switch to new pandoc-types and use Text instead of String [API change].
PR #5884.

+ Use pandoc-types 1.20 and texmath 0.12.
+ Text is now used instead of String, with a few exceptions.
+ In the MediaBag module, some of the types using Strings
  were switched to use FilePath instead (not Text).
+ In the Parsing module, new parsers `manyChar`, `many1Char`,
  `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`,
  `mantyUntilChar` have been added: these are like their
  unsuffixed counterparts but pack some or all of their output.
+ `glob` in Text.Pandoc.Class still takes String since it seems
  to be intended as an interface to Glob, which uses strings.
  It seems to be used only once in the package, in the EPUB writer,
  so that is not hard to change.
2019-11-12 16:03:45 -08:00
John MacFarlane
d3966372f5
Clarify MANUAL.txt on --preserve-tabs 2019-11-11 17:08:11 -08:00
Brian Wignall
78399ccf90 Fix typos (#5896) 2019-11-11 11:29:01 -08:00
John MacFarlane
741b1f7fb4 Markdown reader: fix small super/subscript issue.
Superscripts and subscripts cannot contain spaces,
but newlines were previously allowed (unintentionally).
This led to bad interactions in some cases with footnotes.
E.g.

```
foo^[note]
bar^[note]
```

With this change newlines are also not allowed inside
super/subscripts.

Closes #5878.
2019-11-11 09:08:52 -08:00
Florian Beeres
bf2eb4f288 Change the implementation of htmlSpanLikeElements and implement <dfn> (#5882)
* Add HTML Reader support for `<dfn>`, parsing this as a Span with class `dfn`.
* Change `htmlSpanLikeElements` implementation to retain classes,
  attributes and inline content.
2019-11-11 08:55:58 -08:00
John MacFarlane
3bf5362898 DocBook reader: Fix bug with entities in mathphrase element.
Closes #5885.
2019-11-07 23:08:05 -08:00
John MacFarlane
b44a4c803e FIx typo in cabal.project. 2019-11-07 14:16:02 -08:00
John MacFarlane
20309691c3 Fix list fields in Opt so they aren't reversed.
Previously optIncludeInHeader, etc. were in reverse order.
This has been changed to promote #5881.

Note also that the `sourcefile` variable used to be sometimes
a string, sometimes a list (when there was more than one).
Now it is always a list.
2019-11-07 12:18:53 -08:00
John MacFarlane
9c7f75afb5 Change merge behavior for metadata.
Previously, if a document contained two YAML metadata blocks
that set the same field, the conflict would be resolved in favor
of the first. Now it is resolved in favor of the second (due to
a change in pandoc-types).

This makes the behavior more uniform with other things in pandoc
(such as reference links and `--metadata-file`).
2019-11-07 10:48:38 -08:00
John MacFarlane
e299212bf7 Add and apply filters in order (not reversed).
This changes `applyFilters` from Text.Pandoc.Filter so
that it does a left fold rather than a right fold, applying
the filters in the order listed. [behavior change]

The command-line arguments are accumulated in order instead
of reverse order.

A first step twoards #5881.
2019-11-06 15:42:41 -08:00
John MacFarlane
adad3c70b6 Allow singular input-file in defaults file.
Closes #5877.
2019-11-06 09:06:49 -08:00
John MacFarlane
803ab48a20 Use latest pandoc-citeproc 0.16.3.1 in binary packages. 2019-11-04 09:32:56 -08:00
John MacFarlane
8f3b3afc70 Update AUTHORS.md. 2019-11-04 09:07:05 -08:00
John MacFarlane
88e9843fc2 Update changelog.md. 2019-11-04 08:55:49 -08:00
John MacFarlane
bdc0f6cc9b Removed an unnecessary unpack. 2019-11-04 08:45:20 -08:00
Amogh Rathore
bd2bd9b19d HTML Reader/Writer - Add support for <var> and <samp> (#5861)
Closes #5799
2019-11-04 08:42:30 -08:00
John MacFarlane
fdc0f47519 PDF: don't assume tex log file is UTF8-encoded.
Fall back to latin1 if it can't be read as UTF-8.
Closes #5872.
2019-11-03 21:24:53 -08:00
Jesse Rosenthal
11945ea5ec Docx reader: Only use LTR when it is overriding BiDi setting
The left-to-right direction setting in docx is used in the spec only
for overriding an explicit right-to-left setting. We only process it
when it happens in a paragraph set with BiDi.

This is especially important for docs exported from Google Docs, which
explicitly (and unnecessarily) set "rtl=0" for every paragraph.

Closes: #5723
2019-11-03 21:25:56 -05:00
John MacFarlane
a6612b35c8 EPUB writer: ensure that lang variable is set on all chapters. 2019-11-03 15:11:17 -08:00
John MacFarlane
f515f984d4 Revise MANUAL's comment on table-mode. 2019-11-03 14:57:27 -08:00
John MacFarlane
530bfe5f5a Docx reader: fix list number resumption for sublists. Closes #4324.
The first list item of a sublist should not resume numbering
from the number of the last sublist item of the same level,
if that sublist was a sublist of a different list item.

That is, we should not get:

```
1. one
   1. sub one
   2. sub two
2. two
   3. sub one
```
2019-11-03 12:54:42 -08:00
John MacFarlane
e906e5ac23 Allow pdf output to stdout.
PDF output will not be output to the terminal, but can be
sent to stdout using either `-o -` or a pipe.

The intermediate format will be determined based on
the setting of `--pdf-engine`.

Closes #5751.
2019-11-03 11:44:00 -08:00
John MacFarlane
c4ff0b5564 Update changelog.md. 2019-11-03 08:41:05 -08:00
Dmitry Pogodin
270ffe6ab5 Place caption before table in OpenDocument format. (#5869)
Closes #5681.
2019-11-03 07:17:05 -08:00
John MacFarlane
8a2e87758e Fix metadata replacement example in lua-filters doc.
Closes #5851.

We avoid the failure with a boolean value by simply checking
to make sure we have a table before indexing.
2019-11-02 22:55:58 -07:00
John MacFarlane
311a20c6c5 RST reader: avoid spurious warning...
when resolving links to internal anchors ending with `_`.
Closes #5763.
2019-11-02 22:26:07 -07:00
John MacFarlane
65593043c3 LaTeX reader: Fixed dollar-math parsing...
...to ensure that space is left between a control seq and
a following word that would otherwise change its meaning.

Closes #5836.
2019-11-02 12:44:48 -07:00
John MacFarlane
f39c44f0ba Add test for #5836. 2019-11-02 12:27:15 -07:00
John MacFarlane
041cfbd5ee LaTeX untokenize: Ensure space between control sequence and following letter.
Closes #5836.
2019-11-02 12:20:04 -07:00
John MacFarlane
6c9a20b2d3 Test for macro definitions in LaTeX preamble. 2019-11-02 11:08:26 -07:00
John MacFarlane
7fac395284 LaTeX reader: Don't omit macro definitions defined in the preamble.
These were formerly omitted (though they still affected macro
resolution if `latex_macros` was set).  Now they are included in
the document.
2019-11-02 11:04:21 -07:00
John MacFarlane
15e1ca6441 Manual: clarify when macro definitions are passed as raw latex.
In Markdown input, they are always passed through.
In LaTeX, only if `latex_macros` is disabled.
2019-11-02 11:03:47 -07:00
John MacFarlane
db972b8ea0 LaTeX reader: parse macro defs as raw latex...
when `latex_macros` is disabled.  (When `latex_macros` is enabled,
we omit them, since pandoc is applying the macros itself.)

Previously, it was documented that the macro definitions got
passed through as raw latex regardless of whether `latex_macros`
was set -- but in fact they never got passed through.
2019-11-02 10:36:31 -07:00
John MacFarlane
724fd655e7 Add test case for #5845. 2019-11-02 09:40:08 -07:00
John MacFarlane
4b58384c0a LaTeX reader: fixed a hang/memory leak in certain circumstances.
We were using `grouped blocks` instead of `grouped block`.
This caused the reader to hang in an infinite loop
(with a memory leak) on e.g. `\parbox{1em}{#1}`.

Closes #5845.
2019-11-02 09:33:32 -07:00
John MacFarlane
180c96f9a0 Move extension-adding to applyDefaults 2019-11-02 08:27:03 -07:00
John MacFarlane
cebf0091ca Document how to use custom writers with --standalone.
Closes #5866.
2019-11-02 08:24:39 -07:00
John MacFarlane
02c579ff3c Revert "ALlow multiple comma-separated files for --defaults."
This reverts commit e96f3fd813.
2019-11-01 21:48:30 -07:00
John MacFarlane
e96f3fd813 ALlow multiple comma-separated files for --defaults. 2019-11-01 10:14:30 -07:00
John MacFarlane
1b69d5ed94 Factor out applyDefaults in T.P.A.CommandLineOptions. 2019-11-01 09:52:39 -07:00