Commit graph

5844 commits

Author SHA1 Message Date
John MacFarlane
963ba931a6 Moved isArgTok to Readers.LaTeX.Parsing. 2018-10-01 22:09:45 -07:00
John MacFarlane
799cd5db7a Moved babelLangToBCP, polyglossiaLangToBCP to new module...
Text.Pandoc.Readers.LaTeX.Lang (unexported).
2018-10-01 21:27:20 -07:00
Albert Krewinkel
9abdbb2783
Lua filters: report traceback when an error occurs
A proper Lua traceback is added if either loading of a file or execution
of a filter function fails. This should be of help to authors of Lua
filters who need to debug their code.
2018-10-01 16:32:11 +02:00
Albert Krewinkel
1ffe47b9b9
Lua Util: add missing docstring to defineHowTo 2018-10-01 11:09:34 +02:00
John MacFarlane
36f1846cc3 Implement --ascii (writerPreferAscii) in writers, not App.
Now the `write*` functions for Docbook, HTML, ICML, JATS,
Man, Ms, OPML are sensitive to `writerPreferAscii`.  Previously
the to-ascii translation was done in Text.Pandoc.App, and
thus not available to those using the writer functions
directly.

In addition, the LaTeX writer is now sensitive to
`writerPreferAscii` and to `--ascii`.  100% ASCII
output can't be guaranteed, but the writer will use
commands like `\"{a}` and `\l` whenever possible,
to avoid emiting a non-ASCII character.

A new unexported module, Text.Pandoc.Groff, has been
added to store functions used in the different groff-based
writers.
2018-09-30 22:32:00 -07:00
John MacFarlane
0a8d212a09 Text.Pandoc.Options: add writerPreferAscii to WriterOptions.
[API change]
2018-09-30 21:09:06 -07:00
John MacFarlane
aebe5fe99e LaTeX reader: simplified accent code using unicode-transforms.
New dependency on unicode-transforms package for normalization.
2018-09-30 10:25:17 -07:00
John MacFarlane
966bd94ba2 LaTeX writer: Fix description lists contining highlighted code.
Closes #4662.
2018-09-29 23:29:32 -07:00
John MacFarlane
190ee279c9 LaTeX reader: allow verbatim blocks ending with blank lines.
Closes #4624.
2018-09-29 10:57:11 -07:00
John MacFarlane
c6d56f026f LaTeX reader: support breq math environments: dmath, dgroup, darray. 2018-09-29 10:18:09 -07:00
John MacFarlane
9dac993835 Added Text.Pandoc.Readers.LaTeX.Parsing (unexported).
This collects some of the general-purpose code from the LaTeX
reader, with the aim of making the module smaller. (We've been
having out-of-memory issues compiling this module on CI.)
2018-09-28 10:33:32 -07:00
leungbk
4f9ab7e032 Parse empty argument array in inline src blocks.
`enclosedByPair` alone does not the handle the empty array properly since it uses `many1Till`.
2018-09-28 14:05:14 +02:00
John MacFarlane
0b3e885a00 HTML writer: avoid adding extra section nestings for revealjs.
Previously revealjs title slides at level (slidelevel - 1)
were nested under an extra section element, even when
the section contained no additional (vertical) content.
That caused problems for some transition effects.
See hakimel/reveal.js#1947.
2018-09-27 21:09:03 -07:00
John MacFarlane
53657798cd JATS writer: remove 'role' attribute on 'bold' and 'sc' elements.
The JATS spec does not allow these.

Closes #4937.
2018-09-27 13:18:06 -07:00
John MacFarlane
99aae5d7cd HTML writer: omit unknown attributes in EPUB2 output.
This allows users to include `epub:type` attributes, which
will be passed through to epub3 but not epub2.
2018-09-27 09:47:22 -07:00
leungbk
6e8f31dab1 Force inline code blocks to honor export options.
`exportsCode` is moved from `Blocks.hs` to `Shared.hs` and exported accordingly.
2018-09-26 08:49:13 +02:00
Brian Leung
72363cd2fc Add support for multiprenote and multipostnote arguments in LaTeX. (#4930)
* Add support for multiprenote and multipostnote arguments.

The multiprenotes occur before the first prefix of a
multicite, and the multipostnotes follow the last suffix.

* Add test for multiprenote and multipostnote.
2018-09-25 20:49:13 -07:00
Albert Krewinkel
56fe5b559e
Use hslua v1.0.0 2018-09-24 20:11:27 +02:00
John MacFarlane
0272e63527
Merge pull request #4921 from pyssling/master
ODT Writer: Improve table header row style handling
2018-09-24 10:01:21 -07:00
Jonas Scholl
f15c8d1ab4 RTF writer: Fix build failure with ghc-8.6.1 caused by missing MonadFail instance. 2018-09-24 14:58:26 +02:00
Alexander Krotov
cd610da8cc Muse reader: replace inlineList with inline' 2018-09-24 14:37:54 +03:00
Alexander Krotov
6d16ea9c76 Muse reader: replace optionMaybe and fromMaybe with option 2018-09-24 10:57:45 +03:00
Nils Carlson
ce6e9e8817 ODT Writer: Improve table header row style handling
This changes the way styles for cells in the header row
and normal rows are handled in ODT tables.

Previously a new (but identical) style was generated for
every table, specifying the style of the cells within the table.

After this change there are two style definitions for table cells,
one for the cells in the header row, one for all other cells.

This doesn't change the actual styles, but makes post-processing
changes to the table styles much simpler as it is no longer
necessary to introduce new styles for header rows and there are
now only two styles where there was previously one per table.
2018-09-23 22:04:32 +00:00
John MacFarlane
4bc2b7eb5b LaTeX writer: fix a use of last that might take empty list.
If you ran with `--biblatex` and have an empty document (metadata
but no blocks), pandoc would previously raise an error because
of the use of `last` on an empty list.
2018-09-22 20:40:59 -07:00
Alexander Krotov
111e6ffa55 Muse reader: simplify tag parsers 2018-09-21 14:01:43 +03:00
Alexander Krotov
3067e57bd4 Muse reader: use isAlphaNum instead of isLetter and isDigit 2018-09-21 13:10:20 +03:00
Alexander Krotov
dd5d234c6a Muse reader: do not allow code markup to be followed by digit 2018-09-21 13:07:56 +03:00
Alexander Krotov
ca0bb5123e Muse reader: simplify ordered list parsing 2018-09-21 13:00:15 +03:00
Alexander Krotov
23725f3a20 Muse reader: rewrite headingStart in applicative style
and remove heading level limit
2018-09-21 12:26:29 +03:00
Alexander Krotov
e26313dd62 Muse reader: refactoring 2018-09-21 11:50:51 +03:00
John MacFarlane
b7b93d7609 Fix compiler warning. 2018-09-20 21:29:08 -07:00
Alexander Krotov
f57a8aa655 Muse reader: simplify <literal> tag parsers 2018-09-21 05:45:16 +03:00
Alexander Krotov
095fff7da1 Muse reader: cleanup and conversion to applicative style 2018-09-21 03:03:20 +03:00
Alexander Krotov
fedf1f213f Muse reader: simplify lchop 2018-09-21 02:57:06 +03:00
John MacFarlane
37c6f6adfe RST reader: fix bug with internal link targets.
They were gobbling up indented content underneath.
Closes #4919.
2018-09-20 11:15:03 -07:00
John MacFarlane
5b1fdeaf41 ConTeXt writer: change \ to / in Windows image paths.
We do this in the LaTeX writer, and it avoids problems.
Note that `/` works as a LaTeX path separator on Windows.
Closes #4918.
2018-09-20 09:36:44 -07:00
John MacFarlane
136bf901aa Markdown reader: distinguish autolinks in the AST.
With this change, autolinks are parsed as Links with
the `uri` class. (The same is true for bare links, if
the `autolink_bare_uris` extension is enabled.)  Email
autolinks are parsed as Links with the `email` class.
This allows the distinction to be represented in the
URI.

Formerly the `uri` class was added to autolinks by
the HTML writer, but it had to guess what was an autolink
and could not distinguish `[http://example.com](http://example.com)`
from `<http://example.com>`.  It also incorrectly recognized
`[pandoc](pandoc)` as an autolink.  Now the HTML writer
simply passes through the `uri` attribute if it is present,
but does not add anything.

The Textile writer has been modified so that the `uri`
class is not explicitly added for autolinks, even if it
is present.

Closes #4913.
2018-09-19 14:53:29 -07:00
Albert Krewinkel
4264a1b143
Lua filter: cleanup filter execution code 2018-09-19 21:36:13 +02:00
Alexander Krotov
8f841297df Muse reader: parse Text instead of String
Benchmark shows 7% improvement
2018-09-19 16:36:29 +03:00
Alexander Krotov
841784fb57 hlint Muse reader 2018-09-19 15:26:21 +03:00
Alexander Krotov
1b8c22de1d Muse reader: get rid of HTML parser dependency 2018-09-19 15:19:06 +03:00
Alexander Krotov
6be2e43397 Muse reader: use openTag and closeTag everywhere 2018-09-19 14:06:14 +03:00
Alexander Krotov
94b9561e05 Muse reader: make openTag return association list 2018-09-19 14:05:55 +03:00
Alexander Krotov
1feb62cb24 Muse reader: add openTag and closeTag functions 2018-09-19 13:22:25 +03:00
danse
db2a68d089 parse rST inlines containing newlines closing #4912
this eliminates a regression error introduced after pandoc 2.1.1,
affecting rST inline parsing. see the issue for details
2018-09-18 13:31:09 +02:00
John MacFarlane
44e4f7b292 Markdown reader: example_lists should work without startnum.
Closes  #4908.
2018-09-16 20:40:32 -07:00
Alexander Krotov
71776661cd Muse writer: replace newlines in strings with spaces 2018-09-16 21:05:57 +03:00
John MacFarlane
18fed9f586
Merge pull request #4906 from chris-martin/patch-2
Fix haddock on 'Ext_footnotes'
2018-09-16 09:49:11 -07:00
Alexander Krotov
25163bfe53 Muse writer: output headers without asterisks if not on the top level 2018-09-16 09:29:08 +03:00
Chris Martin
b2cc2a2424
Fix haddock on 'Ext_footnotes' 2018-09-15 18:32:58 -04:00