6604 Commits
Author SHA1 Message Date
John MacFarlane b4f434ae0d Add pdf to list of output formats (--list-output-formats).
Closes #5938.
2019-11-26 09:28:05 -08:00
John MacFarlane 421ae44cdf EPUB writer: Fix regression with `--css option.
Closes #5937.
2019-11-25 17:50:27 -08:00
John MacFarlane ce0a4f8c47 RST writers: Use grid tables for 1-column tables.
With simple tables, we have a clash with heading syntax.
Closes #5936.
2019-11-25 07:31:28 -08:00
John MacFarlane 659ee98176 Add unexported Text.Pandoc.Readers.Metadata.
For YAML metadata parsing. A step in the direction of #5914.
No API change.
2019-11-24 11:50:28 -08:00
Albert Krewinkel d948e13fea Jira writer: improve escaping of special chars (#5925)
Backslash-escaping is used instead of HTML entities, as escaped
characters are easier to read this way. Furthermore, Confluence, which
seems to use a subset of Jira markup, seems to get confused by HTML
entities.
2019-11-22 07:57:24 -08:00
Jose Luis Duran ff8d143836 LaTeX reader: parse \micro siunitx unit command (#5921)
This was somehow missed in 884aef31c5.
2019-11-21 09:22:53 -08:00
John MacFarlane 5a7a4451ca TEI writer: don't strip hash from internal links.
Closes #5922.
2019-11-21 09:21:15 -08:00
Brian Wignall a946424e3c Fix typos (#5919) 2019-11-20 09:44:23 -08:00
John MacFarlane c1b51b1282 Improve markdown escaping in list items.
Closes #5918.
2019-11-19 22:33:14 -08:00
Alexander Krotov 33d2a1a84f DokuWiki reader: parse markup inside monospace ('') (#5917)
Fixes #5916
2019-11-18 15:05:19 -08:00
John MacFarlane 73fb9496bc Reverted the behavior change with --title-prefix.
It now implies `--standalone` again, as before.
2019-11-17 17:35:50 -08:00
John MacFarlane 147ef90fde Ensure that options imply --standalone even in defaults file.
Certain options (`--self-contained`, `--include-in-header`, etc.)
imply `--standalone`.  We now handle this after option parsing
so that it affects options specified in defaults files too.

Behavior change: `--title-prefix` no longer implies `--standalone`.
2019-11-17 17:21:55 -08:00
John MacFarlane 1bf17a7c87 Ms writer: boldface definition terms in DefinitionLists.
Like LaTeX, ConTeXt.
2019-11-16 19:01:53 -08:00
John MacFarlane 202d404d65 ConTeXt writer: set csl-hanging-ident variable if needed. 2019-11-16 18:21:33 -08:00
John MacFarlane 2a44140e11 ConTeXt writer: Use special environment for CSL references. 2019-11-16 17:31:47 -08:00
John MacFarlane 8683cb596d ConTeXt writer: use braces, not start/stop, for inline language tags.
This prevents unwanted gobbling of spaces.
2019-11-16 17:31:47 -08:00
John MacFarlane 5bd6d966f4 Add Ext_smart to list of possible extensions for HTML. 2019-11-16 16:58:10 -08:00
John MacFarlane 1f69162ffd RST writer: Improve spacing for tables with no width information.
If a simple table would be too wide, we use a grid table.
The code for generating grid tables has been adjusted to
give more intelligent column widths when widths aren't
given. (This also affects the markdown writer.)

Closes #5899.
2019-11-15 23:09:53 -08:00
Andrew Dunning 6c1692ea22 LaTeX Reader: Add KOMA-Script metadata commands (#5910)
Add all titling commands to existing definition for `\dedication`.
2019-11-15 08:45:18 -08:00
John MacFarlane bfa6c0b57d Default files: Allow leaving input-files blank again.
Leaving it blank yields a Nothing value (interpreted as stdin).
Providing an empty list is intepreted as no input.

This resolves one part of #5888.
2019-11-14 21:46:35 -08:00
John MacFarlane 81fae63a54 Change optInputFiles to a Maybe [FilePath].
`Nothing` means: nothing specified.
`Just []` means: an empty list specified (e.g. in defaults).
Potentially these could lead to different behavior: see #5888.
2019-11-14 18:42:55 -08:00
John MacFarlane 871bfaf794 Writers.Shared: Clean up code for adding metadata to variables. 2019-11-14 11:01:43 -08:00
John MacFarlane 703cbf437c Markdown reader: use take1WhileP for table row. 2019-11-14 08:10:53 -08:00
John MacFarlane cc5afbb834 Markdown reader: Use take1WhileP for str.
This yields a small but measurable performance improvement.
2019-11-14 07:58:50 -08:00
John MacFarlane db6e9de091 Parsing: Rename takeWhileP -> take1WhileP and clean it up.
(It doesn't match the empty sequence.)
2019-11-14 07:49:32 -08:00
John MacFarlane a60eb60a3d Allow combining -Vheader-includes and --include-in-header.
Closes #5904.
2019-11-14 07:48:19 -08:00
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 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 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
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
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 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 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 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
Dmitry Pogodin 270ffe6ab5 Place caption before table in OpenDocument format. (#5869)
Closes #5681.
2019-11-03 07:17:05 -08:00