Commit graph

519 commits

Author SHA1 Message Date
Alexander Krotov
f39931fd6c Muse writer: escape definition list terms starting with list markers 2018-04-16 11:40:18 +03:00
Alexander Krotov
01f5ed14e6 Muse reader: don't allow footnote references inside links 2018-04-15 17:53:53 +03:00
Alexander Krotov
17767bd29d Muse writer: escape strings starting with space 2018-04-15 16:28:45 +03:00
Alexander Krotov
9cc2bf0295 Muse reader: allow URL to be empty
Muse writer can write links with empty URLs, so Muse reader should read them.
2018-04-15 14:50:46 +03:00
Alexander Krotov
6be0139145 Muse reader: require that comment semicolons are in the first column
Fixes #4551
2018-04-15 12:17:33 +03:00
John MacFarlane
d5b98c8c6e Man writer: Don't escape U+2019 as '.
Closes #4550.
2018-04-14 10:42:05 -07:00
Alexander Krotov
782ab73aa3 Muse writer: escape > less often
> should be escaped only when it can start verse, i.e., at the beginning of the line.
2018-04-10 23:38:30 +03:00
Alexander Krotov
52803e2960 Muse writer: don't break headers, line blocks and tables with line breaks 2018-04-09 04:24:08 +03:00
Alexander Krotov
44093930a8 Muse writer: correctly output empty headings 2018-04-09 04:10:05 +03:00
Alexander Krotov
17b0499516 Muse reader: add support for Text:Amuse multiline headings 2018-04-09 02:05:57 +03:00
Alexander Krotov
ebbd441d06 Muse reader: add support for <biblio> and <play> tags 2018-04-07 18:31:06 +03:00
John MacFarlane
7e99178a09 Changes to tests to accommodate changes in pandoc-types.
In https://github.com/jgm/pandoc-types/pull/36 we changed
the table builder to pad cells.  This commit changes tests
(and two readers) to accord with this behavior.
2018-04-05 10:14:06 -07:00
Alexander Krotov
f224567d52 FB2 writer: represent HorizontalRule as empty line
HorizontalRule corresponds to <hr> element in the default output
format, HTML. Current HTML standard defines <hr> element as
"paragraph-level thematic break". In typography it is often
represented by extra space or centered asterism ("⁂"), but since
FB2 does not support text centering, empty line (similar to extra space)
is the only solution.

Line breaks, on the other hand, don't generate <empty-line />
anymore. Previously line breaks generated <empty-line /> element
inside paragraph, which is not allowed. So, this commit addresses
issue #2424 ("FB2 produced by pandoc doesn't validate").

FB2 does not have a way to represent line breaks inside paragraphs.
They are replaced with LF character, which is not rendered by
FB2 readers, but at least preserves some information.
2018-04-05 19:53:36 +03:00
Alexander Krotov
87dda2109d Muse writer: escape horizontal rule only if at the beginning of the line 2018-04-05 19:49:09 +03:00
Alexander Krotov
2380845206 Muse reader: add <math> tag support 2018-04-02 17:19:26 +03:00
Alexander Krotov
ca78d93b40 Muse writer: place header IDs before header
See https://github.com/melmothx/text-amuse/issues/39
2018-04-02 15:58:37 +03:00
Alexander Krotov
aca4137c40 Muse writer: only escape brackets when necessary
It includes cases when they can be mistaken for footnotes
and links, as well as inside link description.
2018-04-01 19:39:18 +03:00
Alexander Krotov
bdb8424697 Muse writer: do not escape list markers unless preceded by space 2018-03-31 23:40:31 +03:00
Alexander Krotov
b379a2903a Muse writer: escape semicolons and markers after line break 2018-03-28 13:19:39 +03:00
Alexander Krotov
aa929e462d Muse reader: enable round-trip test
Close #4468
2018-03-25 23:04:54 +03:00
Alexander Krotov
79592db66c Muse reader: allow links to have empty descriptions 2018-03-25 22:16:45 +03:00
Alexander Krotov
a3f659d2c0 Muse writer: escape ordered list markers
Also reduced amount of <verbatim> tags in output to avoid escaping every "-" and word that ends in a full stop.
2018-03-25 19:28:23 +03:00
Alexander Krotov
c24c9efd98 Muse writer: enable --wrap=preserve for all tests by default 2018-03-25 18:31:28 +03:00
Alexander Krotov
c6232d0f7d Muse reader: require block <literal> tags to be on separate lines 2018-03-25 18:31:28 +03:00
Alexander Krotov
4a8993f9b0 Muse writer: improve span writing
Test more cases when span has or hasn't anchor, class and contents in different combinations.
2018-03-25 01:18:33 +03:00
Alexander Krotov
d58b961a6d Muse writer: do not join Span's doing normalization
Separate spans may have different semantics, for example if spans indicate syllables in a word.
2018-03-25 00:30:05 +03:00
Alexander Krotov
6f50733691 Muse writer: don't align ordered list items
It leads to problems with round-trip test,
because aligned line blocks can't be read back.
2018-03-21 17:33:27 +03:00
Jesse Rosenthal
f12348cab5 Powerpoint writer: add tests for improved speaker notes.
Tests speaker notes appearing after (and inside of) separating blocks.

Output checked on Windows10 (archlinux virtualbox), PowerPoint
2013. Not corrupted, and output as expected.
2018-03-21 10:07:07 -04:00
Alexander Krotov
81afcdfaf8 Muse writer: escape "]" in image title 2018-03-20 15:01:53 +03:00
Alexander Krotov
268c73c873 Muse writer: escape ";" to avoid accidental comments 2018-03-20 12:16:34 +03:00
Alexander Krotov
d63bba3066 Muse writer: escape "]" brackets in URLs as "%5D" 2018-03-20 12:16:34 +03:00
John MacFarlane
0ef56657ed Comment out Muse reader round-trip test.
It fails too often.  Perhaps a separate test program should
be used to hunt for round-trip bugs.
2018-03-18 12:43:36 -07:00
John MacFarlane
7e389cb3db Use NoImplicitPrelude and explicitly import Prelude.
This seems to be necessary if we are to use our custom Prelude
with ghci.

Closes #4464.
2018-03-18 10:46:28 -07:00
John MacFarlane
dfa1dc164a hlint fixes. 2018-03-17 22:00:55 -07:00
Francesco Occhipinti
ba965d1736 RST writer: filter out empty inline containers (#4434).
There is nothing in RST that corresponds to e.g. `Emph []`, so we just filter out elements like this.
2018-03-17 20:39:26 -07:00
Francesco Occhipinti
65cc909fde RST writer: strip whitespace within inlines, closes #4327 (#4329)
+ Whitespace is ignored at the beginning and end of emphasis, as per
  <http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup>.
+ Export `stripLeadingTrailingSpace` from `Text.Pandoc.Writers.Shared`.
2018-03-17 19:21:27 -07:00
John MacFarlane
049dacf85f Removed redundant import of <> 2018-03-17 17:17:47 -07:00
Jesse Rosenthal
85a65c6a51 Docx reader: add tests for nested smart tags. 2018-03-13 22:16:54 -04:00
Alexander Krotov
3ee45a7357 Muse reader: compare first rewrite to the second in round-trip test 2018-03-12 15:09:27 +03:00
Alexander Krotov
c3fbc492c8 Muse reader: require closing tag to have the same indentation as opening 2018-03-12 14:24:50 +03:00
Alexander Krotov
f0a029ac51 Muse reader: do not reparse blocks inside unclosed block tag
Fixes #4425
2018-03-12 13:44:27 +03:00
Alexander Krotov
19fd98e452 Muse writer: support spans with anchors 2018-03-12 01:47:20 +03:00
Alexander Krotov
9bcd090848 Muse reader: parse <class> tag
<class> tag is supported by Emacs Muse
2018-03-10 07:27:41 +03:00
Alexander Krotov
1884ee6083 Muse writer: replace smallcaps with emphasis before normalization 2018-03-07 20:10:19 +03:00
Alexander Krotov
ff8e59a174 Muse writer: output smallcaps as emphasis 2018-03-07 19:11:27 +03:00
Alexander Krotov
f8e255053d Muse writer: write empty inline lists as <verbatim></verbatim> 2018-03-07 18:35:04 +03:00
Alexander Krotov
1b1b6f02d5 Muse writer: escape "-" to avoid creating bullet lists 2018-03-07 15:19:36 +03:00
Alexander Krotov
4d2bf177fc Muse reader: do not produce empty Str element for unindented verse lines 2018-03-07 14:24:16 +03:00
Alexander Krotov
31b4387a6b Muse writer: fix math expansion for more than one expression per paragraph 2018-03-06 12:58:20 +03:00
Nokome Bentley
7d193b2aad Remove extraneous, significant whitespace in JATS writer output (#4335)
This patch fixes some cases where the JATS writer was introducing
semantically significant whitespace by indenting and wrapping tags.
Note that the JATS spec has a content model for `<p>` tags of `(#PCDATA | ...`.
Any tag where `#PCDATA` children are possible should not have any
indentation. The same is true for `<th>`, `<td>`, `<term>`, `<label>`.
2018-03-05 09:44:34 -08:00
Alexander Krotov
7da6e4390c Muse writer: expand math before inline list normalization 2018-03-05 19:50:19 +03:00
Alexander Krotov
a71a1fec69 Muse reader: fix indentation requirements for footnote continuations 2018-03-03 03:33:02 +03:00
Alexander Krotov
a01573692a Muse reader: enable <literal> tags even if amuse extension is enabled
Amusewiki disables <literal> tags for security reasons.
If user wants similar behavior in pandoc, RawBlocks and RawInlines
can be removed or replaced with filters.
2018-03-02 12:52:39 +03:00
Alexander Krotov
9dbd59a7c1 Muse writer: join strings during inline normalization 2018-03-02 01:45:01 +03:00
Alexander Krotov
177c5120a5 Muse reader: do not consume whitespace while looking for closing end tag
Fix for a bug caught by round-trip test.
2018-03-02 01:01:50 +03:00
Alexander Krotov
55c4b9982c Muse reader: convert alphabetical list markers to decimal in round-trip test
Alphabetical lists are an addition of Text::Amuse.
They are not present in Emacs Muse and can be ambiguous
when list starts with "i.", "c." etc.
2018-03-02 00:33:16 +03:00
Jesse Rosenthal
7d3e7a5a6d Docx reader: Handle nested sdt tags.
Previously we had only unwrapped one level of sdt tags. Now we recurse
if we find them.

Closes: #4415
2018-02-28 16:32:20 -05:00
Alexander Krotov
cc34771928 Muse reader: add test for verse tag with one empty line 2018-02-28 14:43:36 +03:00
Alexander Krotov
8b1630aae0 Muse writer: change verse markup
Use "> " instead of <verse> tag
2018-02-28 14:42:43 +03:00
Alexander Krotov
1d57f7a641 Muse writer: remove empty strings during inline normalization 2018-02-28 14:26:11 +03:00
Alexander Krotov
a7ac590b08 Muse reader: allow <quote> and other tags to be indented 2018-02-28 12:11:56 +03:00
Jesse Rosenthal
0287530a67 Powerpoint writer: use trim from Shared
Instead of writing my own.
2018-02-27 11:28:15 -05:00
Jesse Rosenthal
cdaa80e718 Powerpoint writer: add test for table and list syntax
These were never added when the tests were first created.

Output files checked in MS PowerPoint 2013 (Windows 10, VBox). No
corruption, and output as expected.
2018-02-27 09:34:24 -05:00
Jesse Rosenthal
cdbe45e8ee Powerpoint writer: Remove empty slides
Make sure there are no empty slides in the pptx output. Because of the
way that slides were split, these could be accidentally produced by
comments after images.

When animations are added, there will be a way to add an empty slide
with either incremental lists or pauses.

Test outputs checked with MS PowerPoint (Office 2013, Windows 10,
VBox). Both files have expected output and are not corrupted.
2018-02-27 09:12:17 -05:00
Albert Krewinkel
6ed7926bb4
Org reader tests: move citation tests to separate module 2018-02-26 21:18:13 +01:00
Albert Krewinkel
66368ab330
Tests/Lua: fix tests on windows 2018-02-25 08:06:52 +01:00
Yan Pas
fd3676a568 initial 2018-02-25 03:34:17 +03:00
Albert Krewinkel
b5bd8a9461
Lua: register script name in global variable
The name of the Lua script which is executed is made available in the
global Lua variable `PANDOC_SCRIPT_FILE`, both for Lua filters and
custom writers.

Closes: #4393
2018-02-24 22:43:28 +01:00
Alexander Krotov
39dd7c794b Muse reader: allow single colon in definition list term 2018-02-24 02:38:10 +03:00
Alexander Krotov
8f8f0f8a60 Muse writer: don't indent nested definition lists 2018-02-23 22:07:53 +03:00
Alexander Krotov
2eab8f4654 Muse reader: improve verse parsing
Now verse marked up with ">" (in contrast to <verse> tag) can be placed
inside lists.
2018-02-23 18:02:04 +03:00
Jesse Rosenthal
ffcecfacb1 Docx reader tests: test custom style extension. 2018-02-22 13:05:44 -05:00
Albert Krewinkel
00d20ccd09
Org reader: allow changing emphasis syntax
The characters allowed before and after emphasis can be configured via
`#+pandoc-emphasis-pre` and `#+pandoc-emphasis-post`, respectively. This
allows to change which strings are recognized as emphasized text on a
per-document or even per-paragraph basis. The allowed characters must be
given as (Haskell) string.

    #+pandoc-emphasis-pre: "-\t ('\"{"
    #+pandoc-emphasis-post: "-\t\n .,:!?;'\")}["

If the argument cannot be read as a string, the default value is
restored.

Closes: #4378
2018-02-21 22:43:18 +01:00
Jesse Rosenthal
f6eac1ad7e Powerpoint writer tests: Test everything with template as well
Modify the PowerPoint tests to run all the tests with
template (--reference-doc) as well. Because there are so many
interlocking pieces, bugs can pop up in weird places when using
templates, since it changes how the writer builds its output
file.

For example, I recently discovered a bug in which speaker notes worked
fine and templating worked fine elsewhere, but templating with speaker
notes produced a file that would crash MS PowerPoint. That particular
bug was fixed, but this will forces us to check for that with each new
change.
2018-02-19 20:04:39 -05:00
Alexander Krotov
5a9d7d20dd Move manyUntil to Text.Pandoc.Parsing and use it in Txt2Tags reader 2018-02-19 19:23:30 +03:00
Jesse Rosenthal
32e6ae4347 Powerpoint writer: Add tests for speaker notes. 2018-02-18 16:31:32 -05:00
Alexander Krotov
0e4b8ae362 Muse reader: prioritize lists with roman numerals over alphabetical lists
This is to make sure "i." starts a roman numbered list,
instead of a list with letter "i" (followed by "j", "k", ...").
2018-02-16 12:53:41 +03:00
danse
e6ff7f7986 Docx reader: Pick table width from the longest row or header
This change is intended to preserve as much of the table content as
possible

Closes #4360
2018-02-15 15:06:01 -05:00
Alexander Krotov
82a0ceaf18 Muse reader: fix directive parsing
This fixes bugs introduced in commit 4bfab8f04c.
2018-02-15 18:17:24 +03:00
Alexander Krotov
9131d62c9b Muse writer: use unicode quotes for quoted text 2018-02-15 14:33:25 +03:00
Alexander Krotov
42e39fbd26 Muse reader: parse definition lists with multiple descriptions 2018-02-13 14:34:45 +03:00
Alexander Krotov
8aed3652c2 Muse reader: refactor to avoid reparsing
Lists are parsed in linear instead of exponential time now.

Contents of block tags, such as <quote>, is parsed directly,
without storing it in a string and parsing with parseFromString.

Fixed a bug: headers did not terminate lists.
2018-02-12 17:30:57 +03:00
Alexander Krotov
3480a8acc2 Muse reader: paragraph indentation does not indicate nested quote
Muse allows indentation to indicate quotation or alignment,
but only on the top level, not within a <quote> or list.

This patch also simplifies the code by removing museInQuote
and museInList fields from the state structure.
Headers and indented paragraphs are attempted to be parsed
only at the topmost level, instead of aborting parsing with guards.
2018-02-12 04:57:56 +03:00
Alexander Krotov
450a200637 Muse reader: test empty quote tag 2018-02-11 19:45:16 +03:00
Alexander Krotov
1dfda7e204 Muse reader: require that block tags are on separate lines
Text::Amuse already explicitly requires it anyway.
Supporting block tags on the same line as contents makes
it hard to combine closing tag parsers with indentation parsers.
Being able to combine parsers is required for no-reparsing refactoring
of Muse reader.
2018-02-11 19:35:58 +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
d777fe8bbe Muse writer: write image width specified in percent in Text::Amuse mode 2018-02-03 18:36:38 +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
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
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
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
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
Alexander Krotov
6337539e32 Muse reader: fix matching of closing inline tags 2018-01-24 14:16:56 +03:00
Jesse Rosenthal
f0671bf4c7 Powerpoint writer tests: hlint cleanups. 2018-01-23 13:30:23 -05: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
Jesse Rosenthal
5cdac2607d Powerpoint writer tests: simplify updating function
We had previously re-read the native file and converted it to
Powerpoint. But we have already done that in constructing the test
archive. So now we just convert the archive back to a bytestring and
write it to disk.
2018-01-22 09:55:41 -05:00
Jesse Rosenthal
0e48c216bc Powerpoint tests: Convert to golden tests
This will allow us to rebuild the pptx files in the test dir more
easily if we make a change in the writer.
2018-01-22 09:14:00 -05:00
Alexander Krotov
e9ed4832ed Muse writer: join code with different attributes during normalization 2018-01-22 16:27:14 +03:00
Alexander Krotov
288065cfd4 Muse writer: indent lists inside Div 2018-01-22 16:24:44 +03:00
Jesse Rosenthal
54526525bf Powerpoint writer tests: New test framework for pptx.
Previously we had tested certain properties of the output PowerPoint
slides. Corruption, though, comes as the result of a numebr of
interrelated issues in the output pptx archive. This is a new
approach, which compares the output of the Powerpoint writer with
files that we know to (a) not be corrupt, and (b) to show the desired
output behavior (details below). This commit introduces three tests
using the new framework. More will follow.

The test procedure: given a native file and a pptx file, we generate a
pptx archive from the native file, and then test:

1. Whether the same files are in the two archives

2. Whether each of the contained xml files is the same. (We skip time
   entries in `docProps/core.xml`, since these are derived from IO. We
   just check to make sure that they're there in the same way in both
   files.)

3. Whether each of the media files is the same.

Note that steps 2 and 3, though they compare multiple files, are one
test each, since the number of files depends on the input file (if
there is a failure, it will only report the first failed file
comparison in the test failure).
2018-01-21 12:15:35 -05:00
Alexander Krotov
98f0e2053e Muse reader: remove multiple descriptions during round-trip tests 2018-01-20 18:34:42 +03:00
Alexander Krotov
e1cc9d9abc Muse reader: enable definition lists in round-trip test 2018-01-20 14:09:44 +03:00
John MacFarlane
b8ffd834cf hlint code improvements. 2018-01-19 21:25:24 -08:00
John MacFarlane
46cd6429d8
Merge pull request #4259 from italia/4248
in RST writer insert comment between lists and quotes, closes #4248
2018-01-19 18:33:07 -07:00
Alexander Krotov
22b69b557e Muse reader: fix parsing of nested definition lists 2018-01-20 02:14:27 +03:00
danse
2165efef7e in RST writer insert comment between lists and quotes, closes #4248 2018-01-19 15:57:54 +01:00
Alexander Krotov
01499b766b Muse writer: support definitions with multiple descriptions
Muse reader does not support this syntax yet, but Emacs Muse parses
it correctly.
2018-01-19 15:00:00 +03:00
Alexander Krotov
7680e9b964 Muse reader: require only one space for nested definition list indentation 2018-01-19 14:16:20 +03:00
Alexander Krotov
19d2576223 Muse reader: parse definition list terms without parseFromString 2018-01-19 01:50:17 +03:00
Alexander Krotov
a516198d47 Muse reader: fix parsing of code at the beginning of paragraph 2018-01-18 15:35:43 +03:00
Alexander Krotov
5f57094a47 Muse reader: refactor definition list parsing
Test with wrong indentation is removed,
because now it is parsed as nested lists.
Emacs Muse and Text::Amuse don't have the same
behavior anyway.
2018-01-18 14:55:07 +03:00
Alexander Krotov
9986ccb333 Muse reader: parse "~~" as non-breaking space in Text::Amuse mode
Latest Text::Amuse supports "~~"
2018-01-18 02:46:02 +03:00
Alexander Krotov
ab85143e8a Muse reader: refactor list parsing
Now list item contents is parsed as blocks,
without resorting to parseFromString.

Only the first line of paragraph has to
be indented now, just like in Emacs Muse
and Text::Amuse.

Definition lists are not refactored yet.

See also: issue #3865.
2018-01-18 02:17:26 +03:00
Jesse Rosenthal
004f60bf26 Docx reader: Add test for hyperlinks in instrText tag
This is difficult to recreate with a modern version of Word, so I'm
using the file submitted with the bug report. It would be preferable
to find a smaller example with Latin characters, though, so as not to
confuse the issue being tested.
2018-01-16 13:22:02 -05:00
Henri Menke
6910267abf ConTeXt writer: Use xtables instead of Tables (#4223)
- Default to xtables for context output.
- Added `ntb` extension (affecting context writer only) to use Natural Tables instead.
- Added `Ext_ntb` constructor to `Extension` (API change).
2018-01-15 18:38:33 -07:00
John MacFarlane
d9584d73f9 Markdown reader: Improved inlinesInBalancedBrackets.
The change both improves performance and fixes a
regression whereby normal citations inside inline notes
were not parsed correctly.

Closes jgm/pandoc-citeproc#315.
2018-01-14 12:24:21 -08:00
John MacFarlane
e5abee82f2 Shorten unbalanced brackets test.
It was taking a lot of time.
2018-01-14 12:24:21 -08:00
Albert Krewinkel
2c71604554
data/pandoc.lua: add attr, listAttributes accessors
Elements with attributes got an additional `attr` accessor. Attributes
were accessible only via the `identifier`, `classes`, and `attributes`,
which was in conflict with the documentation, which indirectly states
that such elements have the an `attr` property.
2018-01-13 23:24:13 +01:00
Albert Krewinkel
e0cb0dab18
data/pandoc.lua: accept single block as singleton list
Every constructor which accepts a list of blocks now also accepts a
single block element for convenience.  Furthermore, strings are accepted as
shorthand for `{pandoc.Str "text"}` in constructors.
2018-01-13 22:32:22 +01:00
Albert Krewinkel
9fdd266677
data/pandoc.lua: accept singleton inline as a list
Every constructor which accepts a list of inlines now also accepts a
single inline element for convenience.
2018-01-13 18:52:17 +01:00
Albert Krewinkel
6528082401
Lua filters: improve error messages
Provide more context about the task which caused an error.
2018-01-12 21:28:27 +01:00
Albert Krewinkel
5b852f8d2a
Lua filters: make PANDOC_READER_OPTIONS available
The options which were used to read the document are made available to
Lua filters via the `PANDOC_READER_OPTIONS` global.
2018-01-12 18:54:19 +01:00
Albert Krewinkel
78b142b880
data/pandoc.lua: cleanup code, remove cruft 2018-01-08 23:26:38 +01:00
Albert Krewinkel
f5dec4bdc1
Lua: make pandoc-types version available as PANDOC_API_VERSION
The current pandoc-types version is made available to Lua programs in
the global PANDOC_API_VERSION. It contains the version as a list of
numbers.
2018-01-07 14:06:34 +01:00
Albert Krewinkel
043740d32b
Lua: make pandoc version available as PANDOC_VERSION
The current pandoc version is made available to Lua programs in the
global PANDOC_VERSION.  It contains the version as a list of numbers.
2018-01-07 13:43:03 +01:00
Jesse Rosenthal
bf15258d3b Powerpoint writer: Set default slidelevel correctly.
We had previously defaulted to slideLevel 2. Now we use the correct
behavior of defaulting to the highest level header followed by
content. We change an expected test result to match this behavior.
2018-01-03 21:58:39 -05:00
Jesse Rosenthal
a5b71a3c7f Docx reader: Add tests for paragraph insertion/deletion. 2018-01-02 11:32:48 -05:00
Jesse Rosenthal
3f30455b49 Docx reader: tests for overlapping targets (anchor spans). 2017-12-31 09:36:42 -05:00
Jesse Rosenthal
475b0dcb66 Docx reader: tests for removing unused anchors. 2017-12-30 22:43:33 -05:00
Alexander Krotov
551aec7b01 Muse reader: enable round trip test
Closes #4107
2017-12-30 20:32:16 +03:00
Jesse Rosenthal
76442a791c Powerpoint Writer tests: Add quickcheck tests for content types.
We want to make sure we always have an override for each xml file in
the content types file.
2017-12-29 10:43:36 -05:00
Jesse Rosenthal
859815e4c7 Powerpoint writer test: more slide number tests
Add test for custom slide-level header, and notes slides.
2017-12-29 06:36:23 -05:00
John MacFarlane
3494b6efd3 Powerpoint writer tests: use IO.
Otherwise we can't find the data files when compiled
with -embed_data_files.
2017-12-28 12:06:38 -08:00
John MacFarlane
fa79e003b3 Use insertInFileTree in powerpoint test. 2017-12-28 10:26:54 -08:00
John MacFarlane
ddd6a89247 Text.Pandoc.Class: add insertInFileTree (API change).
This gives a pure way to insert an ersatz file into a FileTree.

In addition, we normalize paths both on insertion and on
lookup, so that "foo" and "./foo" will be judged equivalent.
2017-12-28 10:23:09 -08:00
John MacFarlane
2dd01b2071 Fixed warning in powerpoint writer test. 2017-12-28 08:54:42 -08:00
Jesse Rosenthal
c1fbf7257b PowerPoint writer: Introduce beginning of tests
This is the beginning of a test suite for the powerpoint
writer. Initial tests are for the number of slides.

Note that at the moment it does not test against corruption in
Microsoft PowerPoint; it just tests that certain outcomes work as
expected. More tests will be added.

This test framework uses the PandocPure monad introduced with Pandoc 2.0.
2017-12-28 10:51:03 -05:00
Albert Krewinkel
c6b5d65161
Org smart test: drop superfluous import
Keeps GHC 7.8 and GHC 7.10 happy.
2017-12-28 14:51:03 +01:00
Albert Krewinkel
e5c8b65004
Org reader: support minlevel option for includes
The level of headers in included files can be shifted to a higher level
by specifying a minimum header level via the `:minlevel` parameter. E.g.
`#+include: "tour.org" :minlevel 1` will shift the headers in tour.org
such that the topmost headers become level 1 headers.

Fixes: #4154
2017-12-28 14:16:04 +01:00
Albert Krewinkel
2d443ecb07
Break-up org reader test file
The org reader test file had grown large, to the point that editor
performance was negatively affected in some cases. The tests are spread
over multiple submodules, and re-combined into a tasty TestTree in the
main org reader test file.
2017-12-28 14:15:58 +01:00
John MacFarlane
e23e1f3c22 Added tests for custom writer. 2017-12-27 09:15:45 -08:00
Jesse Rosenthal
d71165c8e2 Docx reader: add tests for structured document tags unwrapping. 2017-12-27 10:03:00 -05:00
Albert Krewinkel
59a4745457
Lua modules: add function pandoc.utils.hierarchicalize
Convert list of Pandoc blocks into (hierarchical) list of Elements.
2017-12-23 23:29:24 +01:00
Albert Krewinkel
2c66a42ab8
Lua modules: add function pandoc.utils.normalize_date
The function parses a date and converts it (if possible) to "YYYY-MM-DD"
format.
2017-12-23 13:43:22 +01:00
Albert Krewinkel
35f0567a8f
Lua modules: add function pandoc.utils.to_roman_numeral
The function allows conversion of numbers below 4000 into roman
numerals.
2017-12-23 13:42:35 +01:00
Albert Krewinkel
23edb958db
Lua modules: add stringify function to pandoc.utils
The new function `pandoc.utils.stringify` converts any AST element to a
string with formatting removed.
2017-12-22 20:09:37 +01:00
John MacFarlane
af04881655
Merge pull request #4177 from stencila/jats-xml-reader
Add Basic JATS reader based on DocBook reader
2017-12-21 23:16:03 -07:00
Hamish Mackenzie
d853571397 Improve support for code language in JATS 2017-12-22 15:24:54 +13:00
Alexander Krotov
0405c5b461 Muse reader: parse anchors immediately after headings as IDs 2017-12-21 15:52:10 +03:00
Albert Krewinkel
299e452463
Test more pandoc Lua module functions
The functions `sha1`, `read`, and `pipe` are now tested.

Change: minor
2017-12-20 21:36:41 +01:00
Alexander Krotov
b5e62a5c09 Muse reader: require that note references does not start with 0 2017-12-20 14:00:30 +03:00
Hamish Mackenzie
5d3c9e5646 Add Basic JATS reader based on DocBook reader 2017-12-20 13:54:02 +13:00
Alexander Krotov
f6abf15832 Muse reader: parse empty comments correctly 2017-12-19 04:23:32 +03:00
John MacFarlane
79c3f57c47 Added tests of latex tokenizer.
This should help prevent regressions like #4159.
2017-12-15 10:13:43 -08:00
John MacFarlane
3361f85f8e
Merge pull request #4148 from stencila/jats-figures
fig, table-wrap & caption Divs for JATS writer
2017-12-14 13:45:23 -07:00
John MacFarlane
52a8116e71
Merge pull request #4153 from tarleb/unify-lua-init
Unify lua initalization
2017-12-13 21:42:06 -07:00
Jesse Rosenthal
440533643e Docx writer: Add tests for list continuation. 2017-12-13 15:16:44 -05:00
Albert Krewinkel
4c64af4407
Custom writer: use init file to setup Lua interpreter
The same init file (`data/init`) that is used to setup the Lua
interpreter for Lua filters is also used to setup the interpreter of
custom writers.lua.
2017-12-13 21:15:41 +01:00
Hamish Mackenzie
ec1693505c fig, table-wrap & caption Divs for JATS writer
Support writing <fig> and <table-wrap> elements with <title> and
<caption> inside them by using Divs with class set to on of
fig, table-wrap or cation.  The title is included as a Heading
so the constraint on where Heading can occur is also relaxed.

Also leaves out empty alt attributes on links.
2017-12-13 12:06:22 +13:00
Albert Krewinkel
d5b1c7b767
Lua filters: refactor lua module handling
The integration with Lua's package/module system is improved: A
pandoc-specific package searcher is prepended to the searchers in
`package.searchers`. The modules `pandoc` and `pandoc.mediabag` can now
be loaded via `require`.
2017-12-02 23:07:29 +01:00
Alexander Krotov
e536c4d9c9 hlint Muse reader and tests 2017-12-06 19:38:25 +03:00
Alexander Krotov
6fd3cdac46 Muse reader: add test for #disable-tables directive in Emacs mode 2017-12-06 19:35:01 +03:00
Alexander Krotov
3ae359721d Muse reader: don't allow emphasis to be preceded by letter 2017-12-06 19:04:35 +03:00
John MacFarlane
ae60e0196c Add empty_paragraphs extension.
* Deprecate `--strip-empty-paragraphs` option.  Instead we now
  use an `empty_paragraphs` extension that can be enabled on
  the reader or writer.  By default, disabled.

* Add `Ext_empty_paragraphs` constructor to `Extension`.

* Revert "Docx reader: don't strip out empty paragraphs."
  This reverts commit d6c58eb836.

* Implement `empty_paragraphs` extension in docx reader and writer,
  opendocument writer, html reader and writer.

* Add tests for `empty_paragraphs` extension.
2017-12-04 14:56:57 -08:00
Alexander Krotov
ed261e5832 Muse reader: add underline support in Emacs Muse mode 2017-12-04 15:59:26 +03:00
John MacFarlane
d6c58eb836 Docx reader: don't strip out empty paragraphs.
We now have the `--strip-empty-paragraphs` option for that,
if you want it.  Closes #2252.

Updated docx reader tests.

We use stripEmptyParagraphs to avoid changing too
many tests.  We should add new tests for empty paragraphs.
2017-12-02 16:51:31 -08:00
Alexander Krotov
7751391fce Muse reader: correctly remove indentation from notes
Exactly one space is required and considered to be part of the marker.
2017-11-29 05:12:25 +03:00
John MacFarlane
5a225aa603 Temporarily disable round-trip block test for muse reader.
See #4107.
2017-11-28 16:13:01 -08:00
Alexander Krotov
c2993a6fc6 Muse reader: parse "~~" as non-breaking space in Emacs mode 2017-11-27 12:25:06 +03:00
Alexander Krotov
00004f042c Muse reader: make code blocks round trip 2017-11-27 04:54:23 +03:00
Alexander Krotov
bdad8c1d69 Muse reader: drop common space prefix from list items 2017-11-26 22:14:18 +03:00
Alexander Krotov
a8ac673285 Muse reader: Add partial round trip test 2017-11-26 02:01:39 +03:00
Alexander Krotov
ea2ea455b3 Muse reader: don't interpret XML entities 2017-11-25 22:46:25 +03:00
Alexander Krotov
77af25b4c3 Muse reader: parse markup in definition list terms 2017-11-24 14:02:43 +03:00
Alexander Krotov
137c7c2a65 Muse reader: allow definition to end with EOF 2017-11-24 13:16:09 +03:00
Alexander Krotov
fe74436540 Muse writer: test that inline math conversion result is normalized
Without normalization this test produced
<em>a</em><em>b</em><em>c</em>
2017-11-24 12:35:25 +03:00
Alexander Krotov
0cfd764d27 Muse: move inline list normalization to writer 2017-11-24 12:17:20 +03:00
Albert Krewinkel
cd85c73ded
Org reader: allow empty list items
Fixes: #4090
2017-11-22 22:53:24 +01:00
Alexander Krotov
75e2a1104c Muse reader: allow list items to be empty 2017-11-22 18:49:07 +03:00
Alexander Krotov
0b63ac2db1 Muse reader: add ordered list test 2017-11-22 18:48:45 +03:00
Alexander Krotov
454062eccd Muse writer: escape hash symbol 2017-11-22 16:17:30 +03:00
Alexander Krotov
c8ab4789b6 Muse reader: add more multiline definition tests 2017-11-22 15:23:09 +03:00
Alexander Krotov
7e42857ed8 Muse writer: escape "----" to avoid accidental horizontal rules 2017-11-22 01:39:20 +03:00
Alexander Krotov
351765d4ad Muse reader: concatenate inlines of the same type 2017-11-22 01:22:43 +03:00
Alexander Krotov
df3a80cc97 Muse writer: escape only </code> inside code tag
Additional <verbatim> is not needed as <code> is verbatim already.
2017-11-22 01:22:43 +03:00
Alexander Krotov
6c17117ef2 Muse reader: add inline <literal> support 2017-11-21 19:53:55 +03:00
Alexander Krotov
59f537c31f Muse reader: test <literal> blocks 2017-11-21 19:01:53 +03:00
Albert Krewinkel
849900c516 data/pandoc.lua: enable table-like behavior of attributes (#4080)
Attribute lists are represented as associative lists in Lua. Pure
associative lists are awkward to work with. A metatable is attached to
attribute lists, allowing to access and use the associative list as if
the attributes were stored in as normal key-value pair in table.

Note that this changes the way `pairs` works on attribute lists. Instead
of producing integer keys and two-element tables, the resulting iterator
function now returns the key and value of those pairs.  Use `ipairs` to
get the old behavior.

Warning: the new iteration mechanism only works if pandoc has been
compiled with Lua 5.2 or later (current default: 5.3).

The `pandoc.Attr` function is altered to allow passing attributes as
key-values in a normal table. This is more convenient than having to
construct the associative list which is used internally.

Closes #4071
2017-11-20 09:37:40 -08:00
Alexander Krotov
82bcda80c6 Muse reader: count only one space as part of list item marker 2017-11-19 04:40:00 +03:00
Alexander Krotov
163af3fdee Muse reader: produce SoftBreaks on newlines
Now wrapping can be preserved with --wrap=preserve
2017-11-19 02:37:52 +03:00
Albert Krewinkel
53aafd6643 Lua filters: preload text module (#4077)
The `text` module is preloaded in lua. The module contains some UTF-8
aware string functions, implemented in Haskell.  The module is loaded on
request only, e.g.:

    text = require 'text'
    function Str (s)
      s.text = text.upper(s.text)
      return s
    end
2017-11-18 13:24:06 -08:00
Alexander Krotov
6018a2324d Muse reader: Add Text::Amuse footnote extensions
Footnote end is indicated by indentation,
so footnotes can be placed anywhere in the text,
not just at the end of it.
2017-11-18 23:43:02 +03:00
Alexander Krotov
3a83b3843d Replace "emacs" extension with "amuse" extension
It makes clear that extension is related to Muse markup.
2017-11-13 18:41:49 +03:00
Alexander Krotov
df4cb20f29 Muse reader: accept Emacs Muse definition lists
Emacs Muse does not require indentation.
2017-11-12 18:08:41 +03:00
Alexander Krotov
3cee9c8976 FB2 writer: Add "unrecognised" genre to <title-info>
XML schema requires at least one genre.
2017-11-01 13:31:16 +03:00
Alexander Krotov
8a5541dca8 FB2 writer: remove <annotation> from <body>
<annotation> is not allowed inside <body> according to FictionBook2 XML schema. Besides that, the same information is already placed inside <description>.

Related bug: #2424
2017-11-01 13:08:52 +03:00
John MacFarlane
1f393f1a8b
Merge pull request #4001 from labdsf/fb2-tests
Add new style FB2 tests
2017-11-01 00:37:29 -04:00
Sascha Wilde
03361f0a68 Creole reader: additional test on nowiki-block after para. 2017-10-31 22:26:35 +01:00
Sascha Wilde
fa67d6e86f Creole reader: fixed lists with trailing white space. 2017-10-31 18:55:27 +01:00
John MacFarlane
6a1476e7e2 Export all of Text.Pandoc.Class from Text.Pandoc. 2017-10-29 15:00:49 -07:00
Sascha Wilde
e8be4b0b6d Creole reader (#4002)
* Basic skeleton for creole reader.

No real functionality besides preliminary bold and italics yet.

* Creole: add support for bold/italic with implicit end at paragraph end.

* Creole: add support for headings.

* Creole: add support for tilde escaped chars.

* Basic skeleton for creole reader.

No real functionality besides preliminary bold and italics yet.

* Creole: add support for bold/italic with implicit end at paragraph end.

* Creole: add support for headings.

* Creole: add support for tilde escaped chars.

* Add a test suite for the creole parser

So far this covers only things the parser already supports.

* Added simple parsing of flat unordered lists.

* Added tests for unordered lists in creole.

* First, wrong(!) implementation of sublists.

Fails test, as sublists should not be embedded in a list item!

* Implementation of unordered sublists.

* Added support for ordered lists to creole reader.

* Added utility function to append parsers to Creole reader.

* Creole reader: Fixed list item end detection in sub lists.

* Tests for creole reader: added more tests for lists.

Covering ordered and unordered tests, even mixed.  Tests for
formatting in list items still missing...

* Added "nowiki" blocks.  One exception rule is missing...

* Creole reader: nowiki: implemented exception for curly brackets.

* Creole reader: added inline nowiki.

* Creole reader: added horizontalRule.

* Creole reader: added auto linking of URIs.

* Creole reader: detect horizontalRule as para end.

Used the opportunity for a little refactoring.

* Creole reader: added forced line breaks.

Including test.

* Creole reader: implement wiki links.

* Creole reader: added image support.

* Creole reader: support images as links.

* Creole reader: implemented placeholder -- by simply dropping them.

* Creole reader: added tests for links.

After observing a regression, it was really time...  ;-)

* Creole reader: fixed links with names.

* Creole reader: allow space after first of enclosing tags.

Space after the start of formatting tags are allowed with creole,
e.g. "there is // italic text // in here" is legal.

This problem was discovered using the creole1.0test.txt document from
http://www.wikicreole.org/wiki/Creole1.0TestCases

See l.57:
# // italic item 3 //

* Creole reader: fixed links without names.

* Creole reader: Tests, sorted into groups.

* Creole reader: implemented tables.

* Removed redundant import.

* Creole reader: add correct escaping of links.

* Creole reader: allow handling of e.g. links in parenthesis and quotes.

* Creole reader: Modified disclaimer as most of the code is actually by me.

* Creole reader: Tests: added escaped links.

* Creole reader: preserve leading and trailing space in bold/italic.

* Creole reader: detect tables without a leading blank line.

* Creole Reader: added official creole1.0test.txt as "old" test.

The base document was downloaded from
http://www.wikicreole.org/wiki/Creole1.0TestCases.
The Wiki, and therefore the test document is

Copyright (C) by the contributors.
Some rights reserved, license CC BY-SA.

http://creativecommons.org/licenses/by-sa/1.0/
2017-10-29 13:28:50 -04:00
Alexander Krotov
d99776ea04 Add new style FB2 tests 2017-10-28 21:08:48 +03:00
John MacFarlane
ff16db1aa3 Automatic reformating by stylish-haskell. 2017-10-27 20:28:29 -07:00
John MacFarlane
a2a14f9029 Removed old adjacent_links test for docx reader.
See #2270 for background -- this test blocked the consistent
underline change and was hard to revise, so for now we are
removing it.
2017-10-27 16:09:44 -07:00
hftf
7f8a3c6cb7 Consistent underline for Readers (#2270)
* Added underlineSpan builder function.  This can be easily updated if needed. The purpose is for Readers to transform underlines consistently.

* Docx Reader: Use underlineSpan and update test

* Org Reader: Use underlineSpan and add test

* Textile Reader: Use underlineSpan and add test case

* Txt2Tags Reader: Use underlineSpan and update test

* HTML Reader: Use underlineSpan and add test case
2017-10-27 18:45:00 -04:00
Sascha Wilde
66fd3247ea Creole reader (#3994)
This is feature complete but not very thoroughly tested yet.
2017-10-26 19:19:28 -04:00
Ben Firshman
9046dbadb1
Latex reader: Skip spaces in image options 2017-10-17 16:42:11 +03:00
Ben Firshman
d73fdbf895
Add tests for existing \includegraphics behaviour 2017-10-17 15:09:55 +03:00
Albert Krewinkel
f176ad6f21
Org reader: end footnotes after two blank lines
Footnotes can not only be terminated by the start of a new footnote or a
header, but also by two consecutive blank lines.
2017-10-08 14:17:26 +02:00
bucklereed
c359bdd9b1 LaTeX reader: read polyglossia/babel \text($LANG){...}. 2017-10-06 12:17:50 +01:00
Albert Krewinkel
514662e544
Org reader: support \n export option
The `\n` export option turns all newlines in the text into hard
linebreaks.

Closes #3950
2017-10-02 23:11:58 +02:00
John MacFarlane
f3a80034ff Removed writerSourceURL, add source URL to common state.
Removed `writerSourceURL` from `WriterOptions` (API change).
Added `stSourceURL` to `CommonState`.
It is set automatically by `setInputFiles`.

Text.Pandoc.Class now exports `setInputFiles`, `setOutputFile`.

The type of `getInputFiles` has changed; it now returns `[FilePath]`
instead of `Maybe [FilePath]`.

Functions in Class that formerly took the source URL as a parameter
now have one fewer parameter (`fetchItem`, `downloadOrRead`,
`setMediaResource`, `fillMediaBag`).

Removed `WriterOptions` parameter from `makeSelfContained` in
`SelfContained`.
2017-09-30 16:11:20 -05:00
Albert Krewinkel
2f47e04206
Text.Pandoc.Lua: add mediabag submodule 2017-09-30 09:57:03 +02:00
Alexander Krotov
b5d064e8f0 Muse reader: parse anchors 2017-09-28 14:57:24 +03:00
Alexander Krotov
2cdb8fe2e6 Muse reader: test metadata parsing 2017-09-26 19:31:10 +03:00
Albert Krewinkel
3a7663281a
Org reader: update emphasis border chars
The org reader was updated to match current org-mode behavior: the set
of characters which are acceptable to occur as the first or last
character in an org emphasis have been changed and now allows all
non-whitespace chars at the inner border of emphasized text (see
`org-emphasis-regexp-components`).

Fixes: #3933
2017-09-25 09:31:29 +02:00
John MacFarlane
ddecd72783 Merge pull request #3911 from labdsf/muse-reader-braces
Muse reader: parse {{{ }}} example syntax
2017-09-11 14:01:05 -07:00
Alexander Krotov
8e4ee66563 Muse reader: allow inline markup to be followed by punctuation
Previously code was not allowed to be followed by comma,
and emphasis was allowed to be followed by letter.
2017-09-11 18:34:32 +03:00
Alexander Krotov
508c3a64d8 Muse reader: parse {{{ }}} example syntax 2017-09-11 18:17:28 +03:00
Alexander Krotov
27cccfac84 Muse reader: parse verbatim tag 2017-09-11 12:13:09 +03:00
Alexander Krotov
afedb41b17 Muse reader: trim newlines from <example>s 2017-09-10 12:42:24 +03:00
Alexander Krotov
2230371304 Muse reader: debug inline code markup 2017-09-09 16:39:06 +03:00
Alexander
743413a5b5 Muse reader: Allow finishing header with EOF (#3897) 2017-09-06 08:48:06 -07:00
Alexander
350c282f20 Muse reader: require at least one space char after * in header (#3895) 2017-09-05 09:41:27 -07:00
Alexander
c09b586147 Muse reader: parse <div> tag (#3888) 2017-09-04 21:22:40 -07:00
Alexander
14f813c3f2 Muse reader: parse verse markup (#3882) 2017-08-29 12:40:34 -07:00
Alexander
05bb8ef4aa RST reader: handle blank lines correctly in line blocks (#3881)
Previously pandoc would sometimes combine two line blocks separated by blanks, and ignore trailing blank lines within the line block.

Test is checked to be consisted with http://rst.ninjs.org/
2017-08-28 07:48:46 -07:00
Alexander
e6f767b581 Muse reader: parse <verse> tag (#3872) 2017-08-25 07:09:28 -07:00
bucklereed
c80e26f888 LaTeX reader: RN and Rn, from biblatex (#3854) 2017-08-24 09:45:58 -07:00
Alexander
5d74932578 Muse reader: avoid crashes on multiparagraph inline tags (#3866)
Test checks that behavior is consistent with Amusewiki
2017-08-22 23:12:34 -07:00
Alexander
c7d4fd8cf1 Muse reader: do not allow closing tags with EOF (#3863)
This behavior is compatible to Amusewiki
2017-08-22 16:34:18 -07:00
Albert Krewinkel
41baaff327
Text.Pandoc.Lua: support Inline and Block catch-alls
Try function `Inline`/`Block` if no other filter function of the
respective type matches an element.

Closes: #3859
2017-08-22 23:30:48 +02:00
Albert Krewinkel
56fb854ad8
Text.Pandoc.Lua: respect metatable when getting filters
This change makes it possible to define a catch-all function using lua's
metatable lookup functionality.

    function catch_all(el)
      …
    end

    return {
      setmetatable({}, {__index = function(_) return catch_all end})
    }

A further effect of this change is that the map with filter functions
now only contains functions corresponding to AST element constructors.
2017-08-22 22:56:51 +02:00
Alexander
0a839cbdc9 Muse reader: add definition list support (#3860) 2017-08-21 21:08:44 -07:00
John MacFarlane
d1444b4ecd RST reader/writer: support unknown interpreted text roles...
...by parsing them as Span with "role" attributes.
This way they can be manipulated in the AST.

Closes #3407.
2017-08-17 16:01:44 -07:00
John MacFarlane
38578ad06c Test fixes so we can find data files.
In old tests & command tests, we now set the environment variable
pandoc_datadir.

In lua tests, we set the datadir explicitly.
2017-08-14 13:03:26 -07:00
John MacFarlane
c7cbd3ddc2 Fixed command tests to set local path.
Previously we just tacked on a directory to the command
line, but that didn't work when we e.g. used a pipe for round tripping,
with two invocations of pandoc.
2017-08-13 23:59:38 -07:00
Albert Krewinkel
2dc3dbd68b Use hslua >= 0.7, update Lua code 2017-08-13 14:23:54 +02:00
John MacFarlane
7892dcd353 Command tests; print stderr when a test fails. 2017-08-11 22:09:15 -07:00
John MacFarlane
83d856ee6c Fixed writer tests not to use writerUserDataDir. 2017-08-10 23:51:42 -07:00
John MacFarlane
ac18ff90b2 Org reader: use org-language attribute rather than data-org-language. 2017-08-09 09:45:17 -07:00
John MacFarlane
96933c6043 Org reader: use tag-name attribute instead of data-tag-name. 2017-08-09 09:26:57 -07:00
bucklereed
db55f7c1b2 HTML reader: parse <main> like <div role=main>. (#3791)
* HTML reader: parse <main> like <div role=main>.

* <main> closes <p> and behaves like a block element generally
2017-08-09 09:10:12 -07:00
Alexander
b50de96502 Muse writer: insert two blanklines between lists of the same type (#3844) 2017-08-08 14:05:49 -07:00