Commit graph

894 commits

Author SHA1 Message Date
Mauro Bieg
5809d5bef2 AsciiDoc Writer: escape square brackets at start of line (#4708)
closes #4545
2018-07-12 19:37:37 +02:00
Alexander Krotov
41cf6d540f More spellcheck 2018-07-02 19:07:28 +03:00
John MacFarlane
016e0a09e2 RST writer: don't treat 'example' as a syntax name.
This fixes conversions from org with example blocks.
Closes #4748.
2018-06-30 11:45:49 +02:00
Anders Waldenborg
904924d172 CommonMark reader: Handle ascii_identifiers extension (#4733)
Non-ascii characters were not stripped from identifiers even if the
`ascii_identifiers` extension was enabled (which is is by default for
gfm).

Closes #4742
2018-06-29 10:41:26 +02:00
Mauro Bieg
0459d1be26 TikiWiki reader: improve list parsing (#4723)
- remove trailing Space from list items
- parse lists that have no space after marker (fixes #4722)
2018-06-28 13:35:54 +02:00
Alexander Krotov
ebf4ed8944 Texinfo writer: use @sup and @sub instead of custom macros
Fixes #4728
2018-06-25 03:14:04 +03:00
John MacFarlane
48a505c5a0 Markdown reader: allow empty code spans.
E.g. `` ` ` ``.
2018-06-13 11:12:10 -07:00
Mauro Bieg
7e477db95c LaTeX Reader: parse figure label into Image id (#4704)
closes #4700
2018-06-13 10:41:30 -07:00
Alexander Krotov
b6305a63cd FB2 writer: convert Plain to Para in annotation
Address #2424
2018-06-12 15:32:30 +03:00
Alexander Krotov
54d16545c9 FB2 writer: fix order of items in title-info
Address issue #2424
2018-06-12 14:48:52 +03:00
John MacFarlane
a41222db3e Adjust command test not to use echo.
This is fraught on Windows.
2018-06-11 10:53:56 -07:00
John MacFarlane
edcfbccf5d Use skylighting 0.7.2. Adjust tests.
This should fix commercialhaskell/stackage#3719, once
a new release is made.
2018-06-09 13:34:21 -07:00
Mauro Bieg
905dee6ee3 beamer output: fix single digit column percentage (#4691)
fixes #4690
2018-06-07 10:50:14 -07:00
John MacFarlane
d32e866449 LaTeX reader: handle includes without surrounding blanklines.
In addition, `\input` can now be used in an inline context,
e.g. to provide part of a paragraph, as it can in LaTeX.

Closes #4553.
2018-06-01 09:25:10 -07:00
Alexander Krotov
5fbc981fc2 Muse reader: add support for floating images 2018-05-31 23:31:27 +03:00
Alexander Krotov
1f78efff3b Muse reader: add support for images with specified width 2018-05-31 01:07:51 +03:00
John MacFarlane
7119715a6a LaTeX reader rawLaTeXBlock: handle macros that resolve to a...
...`\begin` or `\end`.
Fixes #4667.
2018-05-30 12:49:01 -07:00
John MacFarlane
252ab9b773 Markdown writer: preserve implicit_figures with attributes...
...even if `implicit_attributes` is not set, by rendering in
raw HTML.

Fixes #4677.
2018-05-30 09:24:52 -07:00
Alexander Krotov
1100bfc0e6 Muse reader: parse image URLs without "guard" and "takeExtension" 2018-05-30 02:29:43 +03:00
Alexander Krotov
6907985e82 Muse reader: test image with space in filename 2018-05-27 22:22:04 +03:00
Yan Pas
1ce067fc2a tests, parsing fixes 2018-05-23 00:20:30 +03:00
John MacFarlane
58447bba98 rawLaTeXBlock: don't expand macros in macro definitions!
Closes #4653.  Note that this only affected LaTeX in markdown.
Added regression test.
2018-05-15 09:19:13 -07:00
John MacFarlane
2b89aaf04d Make internal links work in ODT/OpenDocument.
This adds proper bookmarks to the headers with non-null IDs.
Closes #4358.
2018-05-14 10:37:46 -07:00
Yan Pas
b0b41cbbe6 Merge branch 'master' into groff_reader 2018-05-12 11:42:39 +03:00
John MacFarlane
a00ca6f0d8 Removed inadvertently added .orig files from repository.
These were added by
96d10c72cc

Closes #4648.
2018-05-11 17:10:32 -07:00
John MacFarlane
c3d2572c5f Use texmath-0.11. 2018-05-10 12:10:35 -07:00
Yan Pas
ad19166bc3 fix build and tests 2018-05-09 20:40:37 +03:00
John MacFarlane
d3be567a73 Fix regression with tex math environments in HTML + MathJax.
Closes #4639.
2018-05-09 10:37:04 -07:00
John MacFarlane
81881ce470 Parsing: Lookahead for non-whitespace after single/double quote start.
Closes #4637.
2018-05-09 10:00:34 -07:00
Yan Pashkovsky
a337685fe0
Merge branch 'master' into groff_reader 2018-05-09 19:48:34 +03:00
John MacFarlane
5f33d2e0cd Another try at test-pandoc-utils.lua on windows. 2018-05-08 22:32:44 -07:00
John MacFarlane
691f38f3d6 test-pandoc-utils.lua - add diagnostic for windows test. 2018-05-08 22:08:23 -07:00
Yan Pas
c1617565fc basic manfile parsing 2018-05-09 03:24:45 +03:00
John MacFarlane
9f2af30c06 More adjustments to test-pandoc-utils.lua.
We need to find something that will work on windows.
2018-05-08 12:28:12 -07:00
John MacFarlane
fa4f3c5c17 test-pandoc-utils.lua - use tr instead of sed.
It should be installed on all *nix systems.
2018-05-08 11:51:50 -07:00
John MacFarlane
83fb9d5495 test-pandoc-utils.lua: workaround some local differences in 'echo'. 2018-05-08 11:22:10 -07:00
John MacFarlane
e6d85927ea test-pandoc-utils.lua: remove problems with missing /bin/false.
Previously it was assumed that the system would have `/bin/false`
and `/bin/sed`, and these tests were skipped otherwise.

On MacOS, these utilities are located in `/usr/bin`.

Fixed by just using `sed` and `false` -- these should always be
in the path.  Removed the "skipping" behavior, replaced with a
check for Windows.  On Windowns, we use `echo` and `cd`, which
should always exist.

Not yet checked on Windows.
2018-05-08 11:07:57 -07:00
John MacFarlane
40603dd4cd Support underline in docx writer.
Updated golden test and confirmed validity of file.

Closes #4633.
2018-05-08 10:17:51 -07:00
John MacFarlane
44f1c72b28 Add test for #4576.
Closes #4576.
2018-05-08 09:14:58 -07:00
Alexander Krotov
5879923422 Muse writer: add support for left-align and right-align classes
Address issue #4542
2018-05-07 14:54:20 +03:00
John MacFarlane
516025248e Update tests for #4605. 2018-05-01 21:26:08 -07:00
Alexander Krotov
4139e3e92b Test Lua filter converting display math to inline math 2018-04-29 16:20:38 +03:00
Francesco Occhipinti
8b01f03eaa RST writer: preserve empty inline parents in flatten (#4603) 2018-04-27 09:01:20 -07:00
Alexander
1927bc9aac Add FB2 reader (#4539) 2018-04-26 12:33:18 -07:00
John MacFarlane
619aaf29aa Merge branch 'fb2-hrblankline' of https://github.com/labdsf/pandoc into labdsf-fb2-hrblankline 2018-04-26 12:29:06 -07:00
John MacFarlane
a96c762a10 RST reader: fix anonymous redirects with backticks.
Closes #4598.
2018-04-26 12:23:25 -07:00
Francesco Occhipinti
eef1c211f5 RST reader: flatten nested inlines, closes #4368 (#4554)
nested inlines are not valid RST syntax, so we flatten them following
some readability criteria discussed in #4368.
2018-04-26 12:17:51 -07:00
Alexander Krotov
4d89a1db7f Muse reader: allow nested footnotes 2018-04-26 12:38:17 +03:00
John MacFarlane
aba0f7e063 Add tests for #4589 and #4594 (currently failing). 2018-04-25 23:04:08 -07:00
John MacFarlane
d0940c6e00 Ms template: Fix date.
Previously .ND was used, but this only works if you
have a title page, which we don't.  Thanks to @teoric.
2018-04-25 17:49:01 -07:00
John MacFarlane
16f36eee43 Removed deprecated ancient HTML math methods.
Removed `--latexmathml`, `--gladtex`, `--mimetex`, `--jsmath`, `-m`,
`--asciimathml` options.

Removed `JsMath`, `LaTeXMathML`, and `GladTeX` constructors from
`Text.Pandoc.Options.HTMLMathMethod` [API change].

Removed unneeded data file LaTeXMathML.js and updated tests.

Bumped version to 2.2.
2018-04-25 17:18:56 -07:00
John MacFarlane
97916f0881 Remove nonfree ICC profiles from thumbnails in test docx files.
Closes #4588.
2018-04-25 17:00:21 -07:00
John MacFarlane
dab3330a58 RST reader: allow < 3 spaces indent under directives.
Closes #4579.
2018-04-22 12:20:25 -07:00
John MacFarlane
076093fe62 Small test suite update. Markdown tables. 2018-04-21 14:16:24 -07:00
John MacFarlane
7fbe473b2e Markdown reader/writer: spacing adjustments in tables.
* Markdown writer now includes a blank line at the end
  of the row in a single-row multiline table, to prevent it from being
  interpreted as a simple table.  Closes #4578.
* Markdown reader does a better job computing the relative width of
  the last column in a multiline table, so we can round-trip tables
  without constantly shrinking the last column.
2018-04-21 13:06:57 -07:00
John MacFarlane
276894a2f2 RST writer: use more consistent indentation.
Previously we used an odd mix of 3- and 4-space indentation.
Now we use 3-space indentation, except for ordered lists,
where indentation must depend on the width of the list marker.

Closes #4563.
2018-04-19 13:47:16 -07:00
Alexander Krotov
caeb963447 FB2 writer: convert metadata value "abstract" to book annotation 2018-04-19 17:03:21 +03:00
Alexander Krotov
ce4326a4f1 Muse reader: allow "-" in anchors 2018-04-19 14:17:59 +03:00
Jesse Rosenthal
c5d8fab058 Docx reader tests: Test for combining adjacent code blocks. 2018-04-17 09:29:54 -04:00
Alexander Krotov
3443df6068 Markdown reader: add regression test for previous commit 2018-04-17 11:55:37 +03:00
Alexander Krotov
a8122987fc Muse reader: allow verse to be indented
Muse writer indents verse blocks in definition list more than necessary, so Muse reader should parse them.
2018-04-16 15:08:34 +03:00
Alexander Krotov
ce7301de02 Fix a typo in Muse reader testsuite comment 2018-04-16 12:12:25 +03:00
Alexander Krotov
f39931fd6c Muse writer: escape definition list terms starting with list markers 2018-04-16 11:40:18 +03:00
John MacFarlane
8ca012f139 Ms writer: font improvements.
* Use `\f[R]` rather than `\f[]` to reset.  The latter
  returns to the previous font, which gives unintended
  results in some cases.
* Use `\f[BI]` and `\f[CB]` in headers, instead of `\f[I]` and `\f[C]`,
  since the header font is automatically bold.
* Use `\f[CB]` rather than `\f[BC]` for monospace bold.

Closes #4552.
2018-04-15 22:44:16 -07: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
Alexander Krotov
f9aa2eb353 FB2 writer: output links inline instead of producing notes
Previously all links were turned into footnotes with unclickable URLs inside.
2018-04-07 17:12:55 +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
John MacFarlane
d77e8f45c9 LaTEX reader: properly resolve section numbers with \ref and chapters.
Closes #4529.
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
quasicomputational
13538ce6eb CommonMark writer: correctly ignore LaTeX raw blocks when not raw_tex (#4533)
Issue #4527.
2018-04-05 08:53:42 -07:00
Alexander Krotov
ff3ed5c9f8 FB2 writer: allow emphasis and notes in titles
Only <p> and <empty-line /> are allowed in titles,
but <p> has the same type as an ordinary paragraphs.
Therefore, there is no need to remove emphasis from titles.

Also, don't intersperse paragraph with empty lines.
2018-04-04 14:22:34 +03:00
Marc Schreiber
16523ea3d1 LaTeX reader: parse sloppypar environment (#4517) 2018-04-02 09:33:29 -07: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
John MacFarlane
b9602766d8 Textile reader: fixed tables with no body rows.
Previously these raised an exception.

Closes #4513.
2018-03-30 14:56:36 -07:00
John MacFarlane
5a79948e0c Mediawiki reader: improve table parsing.
This fixes detection of table attributes and also
handles `!` characters in cells.

Closes #4508.
2018-03-28 08:59:34 -07: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
Jesse Rosenthal
a295fed873 Update powerpoint golden tests:
Some internal changes in templating produced slightly different
xml. All have been checked, are not corrupt, and have output as expected.
2018-03-24 11:07:47 -04: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
3d21c184d4 Ms writer: don't escape hyphens.
Previously we escaped hyphens as `\-`, but that's a minus sign.
Closes #4467.

Updated changelog.
2018-03-18 14:52:03 -07: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
Marc Schreiber
155a2ac039 Add support to parse unit string of \SI command (closes #4296). 2018-03-17 20:59:20 -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
e5845f33ad Don't wrap lines in grid tables when --wrap=none (#4320)
* Annotate gridTable code with comments and abstract small functions
* Don't wrap lines in tables when `--wrap=none`.  Instead, expand cells, even if
   it results in cells that don't respect relative widths or surpass page column width.
* This change affects RST, Markdown, and Haddock writers.
2018-03-17 20:31:43 -07:00
Václav Haisman
2ddf2257dc Provide bidi package's option using \PassOptionsToPackage (#4357).
* Provide `bidi` package's option using `\PassOptionsToPackage`.  This avoid clash when   `polyglossia` loads it first and then it is loaded again for XeLaTeX when `latex-dir-rtl` defined.

* Adjust test suite for LaTeX template change.
2018-03-17 20:20:57 -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
John MacFarlane
be12ae3bca Better table handling for Haddock.
In the reader, we use the new Table type in Haddock.
Note that tables with col/rowspans will not translate
well into Pandoc.

In the writer, we now render tables always as grid tables,
since Haddock supports these.
2018-03-16 22:38:34 -07:00
John MacFarlane
b76c0e6a4a RST reader: Allow unicode bullet characters.
Closes #4454.
2018-03-14 17:33:00 -07:00
Jesse Rosenthal
85a65c6a51 Docx reader: add tests for nested smart tags. 2018-03-13 22:16:54 -04:00
John MacFarlane
17725a0661 Beamer: put hyperlink after \begin{frame}.
and not in the title.  If it's in the title, then we get
a titlebar on slides with the `plain` attribute, when
the id is non-null.  This fixes a regression from 1.9.x.

Closes #4307.
2018-03-13 10:03:51 -07: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
Mauro Bieg
a0da1e2723 Dokuwiki writer: fix LineBreaks in Tables (#4444)
fixes #4313
2018-03-11 18:20:36 -07: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
John MacFarlane
adefd86cd4 LaTeX reader: Fix regression in package options including underscore.
Closes #4424.
2018-03-02 09:33:18 -08: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
6824d0dc2c Muse writer: update writer.muse 2018-03-02 02:32:23 +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
9abcb4f201 Powerpoint writer: Use table styles
This will use the default table style in the reference-doc file. As a
result they will be easier when using in a template, and match the
color scheme.
2018-02-27 10:19:35 -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
Jesse Rosenthal
5ada5cceac Docx reader: Don't look up dependant run styles if +styles is enabled.
It makes more sense not to interpret -- otherwise using the original
document as the reference-doc would produce two of everything: the
interpreted version and the uninterpreted style version.
2018-02-23 14:35:30 -05:00
Alexander Krotov
8f8f0f8a60 Muse writer: don't indent nested definition lists 2018-02-23 22:07:53 +03:00
laptop1\Andrew
aadac3c891 Docx test: adjust test for fix of bug
This commit adjusts the test cases for the Docx writer after the fix of #3930.

- Adjusted test cases with inline images. The inline images now have the correct sizing, title and description.
- Modified the test case to include an image multiple times with different sizing each time.
- Tested on Windows 8.1 with Word 2007 (12.0.6705.5000) The files are not corrupted and display exactly what is expected.
2018-02-23 11:50:33 -05: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
8b7df2d915 Docx reader: Move pandoc inline styling inside custom-style span
Previously Emph, Strong, etc were outside the custom-style span. This
moves them inside in order to make it easier to write filters that act
on the formatting in these contents.

Tests and MANUAL example are changed to match.
2018-02-22 13:41:02 -05:00
Jesse Rosenthal
87e0728b87 Docx reader: Avoid repeated spans in custom styles.
The previous commit had a bug where custom-style spans would be read
with every recurrsion. This fixes that, and changes the example given
in the manual.
2018-02-22 13:27:34 -05: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
Jesse Rosenthal
b3f2efd35a Powerpoint writer: Update.golden tests.
Checked with Office 2013. No corruption and output as expected.
2018-02-19 15:31:20 -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
Jesse Rosenthal
112602232c Powerpoint writer: update golden test files
Since the template changed, some small elements of these test files
changed as well.

All of these were checked with Powerpoint 2013 on Windows
10 (VirtualBox). All had expected outcomes and no corruption.
2018-02-18 16:31:32 -05:00
John MacFarlane
377640402f LaTeX reader: Fixed comments inside citations. Closes #4374. 2018-02-17 23:06:54 -08:00
John MacFarlane
ded2e211ca TEI writer: Use 'xml:id', not 'id' attribute.
Closes #4371.
2018-02-16 10:41:22 -08: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
6dcb974423 AsciiDoc writer: do not output implicit heading IDs
Convert to asciidoc-auto_identifiers for old behaviour.

Fixes #4363
2018-02-13 23:19:34 +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
John MacFarlane
018d8aaee8 Updated rst writer test for template change. 2018-02-08 16:52:29 -08: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
John MacFarlane
ac08a887cf Markdown reader: Fix parsing bug with nested fenced divs.
Closes #4281.

Previously we allowed "nonindent spaces" before the
opening and closing `:::`, but this interfered with
list parsing, so now we require the fences to be
flush with the margin of the containing block.
2018-01-20 14:44:08 -08:00
John MacFarlane
957c0e110d RST reader: fix parsing of headers with trailing space.
This was a regression in pandoc 2.0.

Closes #4280.
2018-01-20 11:10:09 -08:00