Commit graph

10422 commits

Author SHA1 Message Date
John MacFarlane
018d8aaee8 Updated rst writer test for template change. 2018-02-08 16:52:29 -08:00
John MacFarlane
d0e49e0a8a rst template: remove definition of 'math' role as raw.
This used to be needed prior to v 0.8 of docutils, but
now math support is built-in.
2018-02-08 16:31:19 -08:00
Alexander Krotov
5b3247d0b2 Muse reader: rename "literal" to "literalTag" 2018-02-06 01:35:41 +03:00
Alexander Krotov
fe5fd12812 Muse reader: avoid reparsing at the top level
Blocks following paragraphs are parsed only once at the top level.
Lists still take exponential time to parse, but this time is not
doubled anymore when this list terminates paragraph.
2018-02-06 01:35:41 +03:00
Alexander Krotov
e645510d54 Muse reader: implement paraUntil
paraUntil does not discard the result of the following block parsing.
This change is a part of Muse reader refactoring to avoid reparsing.
2018-02-06 01:35:41 +03:00
Adam Brandizzi
1a8840f41a INSTALL.md: mentioning Stack version. (#4343) 2018-02-05 11:49:56 -08:00
jarlg
ccc80bdab1 Update default.nix to current nixpkgs-unstable for hslua-0.9.5 (#4348) 2018-02-05 11:04:13 -08:00
Alexander Krotov
c74d2064a7 Muse reader: avoid parsing newline after paragraph twice
Removed lookAhead from blankline, so it is consumed.
2018-02-05 02:57:03 +03:00
Alexander Krotov
1a06f0ecfb Muse reader: make block parsers responsible for parsing newline
Block parsers must always stop after newline or at the end of file.
2018-02-05 01:44:31 +03:00
Alexander Krotov
6c45f8c8f6 Muse reader: test that two blank lines after verse can separate list items
Unlike paragraph and <quote> tag parsers, verse parser consumes newline.
For this reason only three or more blank lines can separate list items.
2018-02-05 01:39:38 +03:00
Alexander Krotov
3b667c54ea Muse reader: test that lists can be separated with two blanklines after blockquote
Existing tests only checked this for paragraphs.
2018-02-05 00:25:31 +03:00
Alexander Krotov
ca4a61a348 Muse reader: simplify listItemContents' with sepBy1 2018-02-04 19:19:55 +03:00
John MacFarlane
5439e29dd9 C -> c. 2018-02-03 11:22:25 -08:00
Alexander Krotov
d777fe8bbe Muse writer: write image width specified in percent in Text::Amuse mode 2018-02-03 18:36:38 +03:00
John MacFarlane
eeafb3fa77 Determine image size for PDFs.
Closes #4322.
2018-02-02 10:00:14 -08:00
John MacFarlane
e232faf5ee Use latest pandoc-citeproc. 2018-02-01 11:56:43 -08:00
John MacFarlane
8bdbdc24de TEI writer: Use height instead of depth for images.
Closes #4331.
2018-02-01 11:38:33 -08:00
John MacFarlane
c501942866 Bump blaze-markup, blaze-html lower bounds to 0.8, 0.9.
This is needed because the type constructor Empty in MarkupM
has changed, and the HTML writer assumes the constructor has
an argument.

Closes #4334.
2018-02-01 10:08:53 -08:00
Alexander Krotov
00b7ab8d00 Muse reader: replace ParserState with MuseState 2018-01-31 01:38:42 +03:00
Alexander Krotov
309595aff3 Export list marker parsers from Text.Pandoc.Parsing 2018-01-31 01:33:11 +03:00
Alexander Krotov
9ff8bc64f9 Muse writer: don't wrap displayMath into <verse>
<verse> is a block tag and displayMath is an inline element.
Writing <verse> around displayMath could result in nested
<verse> tags.
2018-01-30 00:33:02 +03:00
Alexander Krotov
b7d8930dc0 Muse writer: escape nonbreaking space ("~~") 2018-01-29 12:54:43 +03:00
Alexander Krotov
37271fabee Muse reader: simplify block tag parsing code 2018-01-29 12:07:40 +03:00
Alexander Krotov
ff31602267 Muse reader: parse inline <literal> without parseFromString 2018-01-29 04:58:43 +03:00
Alexander Krotov
60b2863e90 Muse reader: parse <comment> and <verbatim> without parseFromString 2018-01-29 04:52:51 +03:00
Daniel Lublin
d2e4790b50 MANUAL.txt: self-contained implies standalone (#4304) 2018-01-28 11:25:34 -08:00
Adam Brandizzi
8fa9912005 CONTRIBUTING.md: label was renamed. (#4310)
See https://groups.google.com/forum/#!msg/pandoc-discuss/mrFsj5RzNFA/Pnd3zubWBwAJ;context-place=searchin/pandoc-discuss/%22good$20first$20issue%22%7Csort:date
2018-01-28 11:17:26 -08:00
Alexander Krotov
264a25e5e9 Muse reader: parse verse tag contents without parseFromString 2018-01-28 22:09:47 +03:00
Alexander Krotov
05275be2cb Muse reader: make verseLine return Inlines, not String 2018-01-28 08:49:55 +03:00
Alexander Krotov
4bfab8f04c Muse reader: parse directives without parseFromString 2018-01-28 07:51:38 +03:00
Alexander Krotov
248f6076bc Muse reader: fix parsing of trailing whitespace
Newline after whitespace now results in softbreak
instead of space.
2018-01-28 03:18:29 +03:00
Alexander Krotov
75762ee0dc Muse reader: simplify paragraph parsing
Blank lines are already handled by blockElements.
2018-01-28 02:32:41 +03:00
Jesse Rosenthal
de6ae29be5 Docx writer tests: correct test name. 2018-01-27 17:47:07 -05:00
Jesse Rosenthal
ebcd04f57a Docx writer tests: Add tests for custom styles 2018-01-27 11:46:41 -05:00
Jesse Rosenthal
a66bfd9071 Add docx golden tests to cabal file. 2018-01-27 08:09:01 -05:00
Jesse Rosenthal
b3449a84aa Docx writer tests: Use new golden framework
These are based off the reader tests, with some removed (where the
reader output was identical, based on different docx inputs). There
are still more to be added. In particular, tests for custom-styles
need to be added.

All golden docx files have been checked in MS Word
2013 (windows). There is no corruption.

There is questionable output in the `tables` test: the three tables
seemed to be joined. This will be addressed in a future commit, and
the golden docx file will be changed.
2018-01-27 08:08:25 -05:00
Jesse Rosenthal
9cf9f1f89d Docx writer: make more deterministic to facilitate testing
This will allow us to compare files directly in a golden test. Times
are still based on IO, but we will be able to safely skip those.

Changes:

 - `getUniqueId` now calls to the state to get an incremented digit,
   instead of calling to P.uniqueHash.

 - we always start the PRNG in mkNumbering/mkAbstractNum with the same
   seed (1848), so our randoms should be the same each time.
2018-01-27 07:44:53 -05:00
Jesse Rosenthal
ae2157fe8b Docx writer: Fix ids in comment writing
Comments from `--track-changes=all` were producing corrupt docx,
because the writer was trying to get id from the `(ID,_,_)` field of
the attributes, and ignoring the "id" entry in the key-value pairs. We
now check both.

There is a larger conversation to be had about the right way to treat
"id" and "class" entries in kvs, but this fix will correctly interpret
the output of the docx reader work.
2018-01-27 07:41:55 -05:00
Jesse Rosenthal
61f80e795d Tests: Abstract powerpoint tests out to OOXML tests.
There is very little pptx-specific in these tests, so we abstract out
the basic testing function so it can be used for docx as well. This
should allow us to catch some errors in the docx writer that slipped
by the roundtrip testing.
2018-01-25 15:29:50 -05:00
Henri Menke
751b5ad010 ConTeXt writer: new section syntax and --section-divs (#4295)
Fixes #2609.

This PR introduces the new-style section headings: `\section[my-header]{My Header}` -> `\section[title={My Header},reference={my-header}]`.

On top of this, the ConTeXt writer now supports the `--section-divs` option to write sections in the fenced style, with `\startsection` and `\stopsection`.
2018-01-25 11:56:28 -08:00
Jesse Rosenthal
0d7aedca58 Dock writer: Fix deletion track changes
This had been mistakenly written as a second insertion function.

Closes: #4303
2018-01-25 10:42:01 -05:00
Alexander Krotov
6337539e32 Muse reader: fix matching of closing inline tags 2018-01-24 14:16:56 +03:00
Alexander Krotov
763126dae0 Muse reader: remove block function 2018-01-24 13:58:43 +03:00
Albert Krewinkel
517f65a7cc
Lua filters: store constructors in registry
Lua functions used to construct AST element values are stored in the Lua
registry for quicker access. Getting a value from the registry is much
faster than getting a global value (partly to idiosyncrasies of hslua);
this change results in a considerable performance boost.
2018-01-23 21:29:58 +01:00
Albert Krewinkel
2e0bb77334
Lua: move getTag from StackInstances to Util
Change: minor
2018-01-23 21:29:52 +01:00
Jesse Rosenthal
f0671bf4c7 Powerpoint writer tests: hlint cleanups. 2018-01-23 13:30:23 -05:00
John MacFarlane
be929bcc80
Merge pull request #4291 from hmenke/xtables
ConTeXt writer: xtables: correct wrong usage of caption
2018-01-22 13:26:55 -07:00
Henri Menke
71bbadb793
ConTeXt writer: xtables: correct wrong usage of caption 2018-01-23 09:15:59 +13:00
Jesse Rosenthal
f8640fdff0 Powerpoint writer tests: add tests for two-column layout and images
Powerpoint output checked in MS PowerPoint 2013 (Windows)
2018-01-22 14:06:47 -05:00
Jesse Rosenthal
145c3f54f9 Powerpoint writer: Add further tests
Tests added for:

 - table of contents
 - endnotes
 - endnotes with table of contents

Powerpoint output checked in MS PowerPoint 2013 (Windows)
2018-01-22 11:52:03 -05:00