Commit graph

6355 commits

Author SHA1 Message Date
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 " 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 .
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 .
Support list number styles.  Closes .
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: 
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 .
2018-11-16 11:29:15 -08:00
John MacFarlane
e61f632531 HTML reader: parse <small> as a Span with class "small".
Closes .
2018-11-15 22:36:01 -08:00
John MacFarlane
e61d1d0da9 Asciidoc writer: Render Spans using [#id .class]#contents#.
See .
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 .

Note that this doesn't address the original issue in ,
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
John MacFarlane
52a57a5362 LaTeX writer: don't emit [<+->] unless beamer output,
even if `writerIncremental` is True.

See .
2018-11-12 09:43:12 -08:00
John MacFarlane
5bc38a741b Exactly match GitHub's identifier generating algorithm.
See .
2018-11-11 20:45:38 -08:00
John MacFarlane
a36d202e86 Text.Pandoc.Shared: add parameter to uniqueIdent, inlineListToIdentifier.
The parameter is Extensions. This allows these functions to
be sensitive to the settings of `Ext_gfm_auto_identifiers` and
`Ext_ascii_identifiers`.

This allows us to use `uniqueIdent` in the CommonMark reader,
replacing some custom code.

It also means that `gfm_auto_identifiers` can now be used
in all formats.

Semantically, `gfm_auto_identifiers` is now a modifier of
`auto_identifiers`; for identifiers to be set, `auto_identifiers`
must be turned on, and then the type of identifier produced
depends on `gfm_auto_identifiers` and `ascii_identifiers` are set.

Closes .
2018-11-11 13:46:23 -08:00
John MacFarlane
ca17ae5246 Remove ascii_identifiers from githubMarkdownExtensions.
GitHub doesn't seem to strip non-ascii characters.
2018-11-11 11:04:34 -08:00
John MacFarlane
6b4b7a4ba3 Clean up toIdent in CommonMark reader.
This partially addresses , fixing a bad interaction between
the `ascii_identifiers` extension and the `gfm_auto_identifiers`
extension, and creating identifiers that match the ones GitHub
produces.

This code still needs to be put somewhere common, so the
`gfm_auto_identifiers` extension will work with other formats.
2018-11-11 10:33:04 -08:00
Albert Krewinkel
73ccc7f3d0
Fix CPP conditional for TH pragma
The condition was from an earlier version.
2018-11-11 14:10:53 +01:00
Alexander Krotov
2f583dab9d Remove Functor and Applicative constraints where Monad already exists 2018-11-08 14:41:07 +03:00
John MacFarlane
846e231d18
Merge pull request from lierdakil/docx-image-bookmarks
Docx image and code block bookmarks
2018-11-07 15:29:09 -08:00
John MacFarlane
65ca95eeea Texinfo writer: add blank line before @menu section.
Closes .
2018-11-07 15:27:02 -08:00
Albert Krewinkel
ff55530c03
T.P.App: fix regression in output format heuristics
This fix is necessary due to a rebasing error introduced in commit
418bd42df8
2018-11-07 21:36:36 +01:00
Albert Krewinkel
12f6cf13ad
T.P.App: extract submodule T.P.App.FormatHeuristics
Format guessing is used for input and output options and should be
shared.
2018-11-07 21:29:48 +01:00
Nikolay Yakimov
d3c8acd07b
[Docx Writer] Add bookmarks to code blocks 2018-11-07 23:17:35 +03:00
Nikolay Yakimov
06e207c662
[Docx Writer] Add bookmarks to images 2018-11-07 23:17:26 +03:00
Nikolay Yakimov
c6e85178e5
[Docx Writer] Refactor common bookmark creation code into a function 2018-11-07 23:16:24 +03:00
Albert Krewinkel
62a5f6fa85 ICML writer: fix missing type signature warning 2018-11-07 09:52:12 +01:00
John MacFarlane
6619b96dd7 Text.Pandoc.Pretty: don't render BreakingSpace at end of line...
or beginning of line.

Closes .
2018-11-06 22:54:43 -08:00
John MacFarlane
985db7b0a8 ICML writer: consolidate adjacent strings, inc. spaces.
This avoids chunking up the output unnecessarily into
separate elements.
2018-11-06 22:54:25 -08:00
Albert Krewinkel
dae3a0e3d2
T.P.App: extract Opt into separate module
The new Opt module has only a few dependencies. This is important for
compile-times during development, as Template Haskell containing modules
are be recompiled whenever a (transitive) dependency changes.
2018-11-06 21:31:12 +01:00
John MacFarlane
8c61fe8d6a Use DERIVE_JSON_VIA_TH in Text.Pandoc.Filter.
Previously AVOID_TEMPLATE_HASKELL was used (with the opposite
valence).  I assume this was a leftover from an earlier version.
2018-11-05 15:06:55 -08:00
Alexander Krotov
6a5661da63 hlint Muse writer 2018-11-06 00:04:33 +03:00
John MacFarlane
f14396011e CommonMark writer: make sure --ascii affects quotes, super/subscript. 2018-11-05 09:55:15 -08:00
quasicomputational
a747268823 CommonMark writer: respect --ascii () 2018-11-05 09:33:10 -08:00
John MacFarlane
511d647290 XML: toHtml5Entities: prefer shorter entities...
when there are several choices for a particular character.
2018-11-04 22:15:53 -08:00
Alexander Krotov
0c84630549 Muse writer: add support for --reference-location=
Address 
2018-11-05 08:42:52 +03:00
Albert Krewinkel
dc150df8e1
Add cabal flag derive_json_via_th
Disabling the flag will cause derivation of ToJSON and FromJSON
instances via GHC Generics instead of Template Haskell. The flag is
enabled by default, as deriving via Generics can be slow (see ).
2018-11-04 20:51:08 +01:00