Commit graph

6430 commits

Author SHA1 Message Date
John MacFarlane
15d3cf8070 HTML reader: handle empty start attribute.
See #5162.
2018-12-17 10:19:36 -08:00
John MacFarlane
ee60ba5252 Man/Ms writers: don't escape - as \-.
For discussion see
https://groups.google.com/forum/#!msg/pandoc-discuss/B-oiCXcQOVo/WO-BXVpICAAJ

The `\-` gets rendered in HTML and PDF as a unicode minus sign.
2018-12-13 11:24:51 -08:00
Mauro Bieg
e4340b384f ICML writer: support custom-styles (#5137)
see #2106
2018-12-12 14:51:14 -05:00
Jesse Rosenthal
448fb359e3 Docx: handle level overrides.
There can be overrides for the definitions of certain levels in
numbering definitions. This implements that behavior.

Closes: #5134
2018-12-10 19:24:56 -05:00
Jesse Rosenthal
2cb9a787ae Docx: add a levelOverride type. 2018-12-10 19:24:56 -05:00
Jesse Rosenthal
2cbd8a3351 Docx writer: Make Level into a real type.
It had previously been an alias for a tuple.
2018-12-10 19:24:56 -05:00
mb21
532c6a81e1 ICML writer: support unnumbered headers
closes #5140
2018-12-10 13:27:45 -05:00
John MacFarlane
d5e68d43be RST writer: don't wrap simple table header lines.
Closes #5128.
2018-12-05 17:10:33 -08:00
John MacFarlane
38200c0291 Strip out illegal XML characters in escapeXMLString.
Closes #5119.
2018-12-04 09:24:15 -08:00
John MacFarlane
4060df6891 Markdown writer: include needed whitespace after HTML figure.
We use HTML for a figure in markdown dialects that can't
represent it natively.

Closes #5121.
2018-12-03 15:10:13 -08:00
John MacFarlane
84a447a88b Fix warnings in Text.Pandoc.Process. 2018-11-30 08:32:04 -08:00
Albert Krewinkel
fe98c97b1c Text.Pandoc.Process: update pipeProcess
The implementation of `pipeProcess` was rewritten to fix sporadic
failures caused by prematurely closed pipes.
2018-11-30 11:23:26 -05:00
John MacFarlane
9f8de4be43 Improve error message for UTF-8 decoding errors.
Give the filename and the byte offset.

Closes #4765.
2018-11-29 15:59:33 -08:00
John MacFarlane
747f079bad Add PandocUTF8DecodingError constructor for PandocError.
[API change]
2018-11-29 15:59:10 -08:00
John MacFarlane
ec07a5298c Man reader: use mapLeft from Shared. 2018-11-29 13:28:56 -08:00
John MacFarlane
90f5dd88a4 Changed types of writeJSON and readJSON.
Previously they were not monadic; we now have them run in an
instance of the Pandoc monad, like the other readers and writers.

[API change]
2018-11-29 12:56:06 -08:00
John MacFarlane
62b4b84bd5 LaTeX reader: Support \inputminted (closes #5103). 2018-11-29 11:11:44 -08:00
John MacFarlane
77a40d6f34 MediaWiki writer: fix caption, use 'thumb' instead of 'frame'.
Captions used to have the word 'caption' prepended; this
has been removed.

Also, 'thumb' is used instead of 'frame' to allow images
to be resized.

Closes #5105.
2018-11-27 14:45:39 -08:00
John MacFarlane
edc651059e Fix parsing of citations and quotes after parentheses.
Starting with pandoc 2.4, citations and quoted inlines
were no longer recognized after parentheses.  This is
because of commit 9b0bd4ec6f,
which is reverted here.

The point of that commit was to allow relocation of
soft line breaks to before an abbreviation, so that
a nonbreaking space could be added after the
abbreviation.  Now we simply leave the soft line
break in place, even though this means that
we won't get a nonbreaking space after "Mr."
at the end of a line (and in LaTeX this may
result in a longer intersentential space).
Those who care about this issue should take care
not to end lines with an abbreviation, or to
insert nonbreaking spaces manually.

Closes #5099.
2018-11-25 22:29:54 -08:00
John MacFarlane
743d1b368f EPUB writer: handle calibre metadata.
Nodes of the form

    <meta name="calibre:series" content="Classics on War and Politics"/>

are now included from an epub XML metadata file.  You can also
include this information in your YAML metadata, like so:

    calibre:
      series: Classics on War and Policitics

In addition, ibooks-specific metadata can now be included via
an XML file. (Previously, it could only be included via YAML
metadata, see #2693.)

Closes #5098.
2018-11-24 20:34:54 -08:00
Alexander Krotov
bbe34da854 MediaWiki reader internals: remove unnecessary binding 2018-11-25 03:39:02 +03:00
John MacFarlane
8c90f34d15 Hlint suggestions. 2018-11-22 22:41:12 -05:00
John MacFarlane
cc4ec3feee RTF writer: fix warnings for skipped raw inlines. 2018-11-22 22:40:52 -05:00
John MacFarlane
c9691b91df OpenDocument writer: small amendment to #5095.
Level one lists should start at 0.5in rather than 0.75in.
(At least this is how LibreOffice behaves for me with a new
document.)
2018-11-22 22:02:08 -05:00
John MacFarlane
2e1366b3e0
Merge pull request #5095 from pyssling/master
ODT writer: Fix list indentation
2018-11-22 21:46:55 -05:00
Nils Carlson
eb82fd6b5e ODT writer: Fix list indentation
Previously lists were indented by half an inch on the first line
for each level of nesting. This resulted in lists that looked like
this:

1.      The first line of the list point text
the second line of the same list point.

Fix this and bring style into line with libreoffice standards:

    1.  The first line of the list point text
        the second line of the list point text.
2018-11-22 17:18:09 +00:00
John MacFarlane
1aa24245e9 HTML writer: use plain " instead of &quot; outside of attributes. 2018-11-21 22:25:18 -05:00
John MacFarlane
d333c283cc Docx writer: Fix bookmarks to headers with long titles.
Word has a 40 character limit for bookmark names.  In
addition, bookmarks must begin with a letter.  Since
pandoc's auto-generated identifiers may not respect
these constraints, some internal links did not work.

With this change, pandoc uses a bookmark name based
on the SHA1 hash of the identifier when the identifier
isn't a legal bookmark name.

Closes #5091.
2018-11-20 23:43:21 -05:00
John MacFarlane
2d265917b0 Fix compiler warning. 2018-11-19 17:20:49 -08:00
John MacFarlane
a5910c0a31 AsciiDoc writer: improve ordered lists.
Use `.`+ as list markers to support nested ordered lists.  Closes #5087.
Support list number styles.  Closes #5089.
2018-11-19 13:17:33 -08:00
Albert Krewinkel
c0d8b0abcb
Lua filters: test AST object equality via Haskell
Equality of Lua objects representing pandoc AST elements is tested by
unmarshalling the objects and comparing the result in Haskell. A new
function `equals` which performs this test has been added to the
`pandoc.utils` module.

Closes: #5092
2018-11-19 21:46:20 +01:00
John MacFarlane
a78bef17b9 For bibliography match Div with id 'refs', not class 'references'.
This was a mismatch between pandoc's docx, epub, latex, and markdown
writers and the behavior of pandoc-citeproc, which actually looks
for a div with id 'refs' rather than one with class 'references'.
2018-11-19 11:08:09 -08:00
John MacFarlane
1a679a4d6e LaTeX reader: cleaned up handling of dimension arguments.
Allow decimal points, preceding space.

Also require text 1.1+.
2018-11-19 00:17:22 -08:00
John MacFarlane
fda3e40163 LaTeX reader: don't allow arguments for verbatim, etc. 2018-11-18 23:50:36 -08:00
John MacFarlane
e86cbcd7e1 LaTeX reader: Allow space before bracketed options. 2018-11-18 23:50:21 -08:00
John MacFarlane
8a157ff839 LaTeX reader: allow optional arguments after \\ in tables. 2018-11-18 23:40:18 -08:00
John MacFarlane
681afbfaac LaTeX reader: improve parsing of \tiny, scriptsize, etc.
Parse as raw, but know that these font changing commands
take no arguments.
2018-11-18 23:32:02 -08:00
Alexander Krotov
5c643d535b FB2 reader: do not throw error for unknown elements in <body>
Some libraries include custom elements in their FB2 files.
2018-11-19 04:07:02 +03:00
Albert Krewinkel
1b15913b6e
Lua Utils module: improve stringify
Meta value strings (MetaString) and booleans (MetaBool) are now
converted to the literal string and the lowercase boolean name,
respectively. Previously, all values of these types were converted to
the empty string.
2018-11-17 17:40:16 +01:00
John MacFarlane
d532eb14eb HTML reader: allow tfoot before body rows.
Closes #5079.
2018-11-16 11:29:15 -08:00
John MacFarlane
e61f632531 HTML reader: parse <small> as a Span with class "small".
Closes #5080.
2018-11-15 22:36:01 -08:00
John MacFarlane
e61d1d0da9 Asciidoc writer: Render Spans using [#id .class]#contents#.
See #5080.
2018-11-15 22:29:15 -08:00
Alexander Krotov
f393f4ba10 Muse writer: output tables as grid tables if they have multi-line cells 2018-11-15 12:14:08 +03:00
Alexander Krotov
367e8cac18 Muse reader: trim whitespace before parsing grid table cells 2018-11-14 19:17:05 +03:00
Alexander Krotov
c61b67410a Muse reader: add grid tables support 2018-11-14 17:58:44 +03:00
Alexander Krotov
195b3af8b6 Muse writer: indent simple tables only on the top level 2018-11-14 15:10:38 +03:00
Alexander Krotov
d27384c109 Muse writer: simplify "simpleTable" 2018-11-14 14:48:38 +03:00
Alexander Krotov
6fd3bcceb9 Muse writer: remove outdated comments 2018-11-14 14:37:18 +03:00
John MacFarlane
1cfdd3662f HTML reader: allow thead containing a row with td rather than th.
See #5014.

Note that this doesn't address the original issue in #5014,
only an unrelated side-issue.
2018-11-13 14:49:12 -08:00
Alexander Krotov
4079697281 Muse writer: output tables with one column as grid tables 2018-11-13 18:44:56 +03:00