Commit graph

348 commits

Author SHA1 Message Date
Alexander Krotov
56685e8735 Muse reader: parse <verse> tag in one pass
instead of using parseFromString.

This change makes it possible to have verbatim </verse> tag
inside verse.
2018-08-31 16:43:07 +03:00
Alexander Krotov
d74c63d6d3 Fix a typo: s/afeter/after/ 2018-08-30 16:02:46 +03:00
Alexander Krotov
81131ef5d1 Muse reader: don't allow digits after closing marker in lightweight markup
This change makes reader more compatible with Emacs Muse
2018-08-12 21:20:07 +03:00
John MacFarlane
581a3514ca RST reader: improve parsing of inline interpreted text roles.
* Use a Span with class "title-reference" for the default
  title-reference role.
* Use B.text to split up contents into Spaces, SoftBreaks, and Strs
  for title-reference.
* Use Code with class "interpreted-text" instead of Span and Str for
  unknown roles.  (The RST writer has also been modified to round-trip
  this properly.)
* Disallow blank lines in interpreted text.
* Backslash-escape now works in interpreted text.
* Backticks followed by alphanumerics no longer end interpreted text.

Closes #4811.
2018-08-05 09:56:43 -07:00
Francesco Occhipinti
2661658a69 RST writer: use titleblock instead of title variable for title block
Closes #4803

After this commit use `$titleblock$` in order to get what was contained
in `$title$` before, that is a title and subtitle rendered according to
the official rST method:
http://docutils.sourceforge.net/docs/user/rst/quickstart.html#document-title-subtitle. from

With this commit, the `$title$` and `$subtitle$` metadata are available and they
simply carry the metadata values.  This opens up more possibilities in templates.
2018-08-01 12:32:16 -07:00
Albert Krewinkel
fb94c0f6a1 Lua Utils module: add function blocks_to_inlines (#4799)
Exposes a function converting which flattenes a list of blocks into a
list of inlines. An example use case would be the conversion of Note
elements into other inlines.
2018-07-30 10:55:25 -07:00
danse
be2d7921cb RST reader: remove support for nested inlines.
RST does not allow nested emphasis, links, or other inline
constructs.

Closes #4581, double parsing of links with URLs as
link text.  This supersedes the earlier fix for #4581
in 6419819b46.

Fixes #4561, a bug parsing with URLs inside emphasis.

Closes #4792.
2018-07-24 15:35:50 -07:00
Albert Krewinkel
4e899eb9c8
Org reader: fix parsers relying on parseFromString
Emphasis was not parsed when it followed directly after some block types
(e.g., lists).

The org reader uses a wrapper for the `parseFromString` function to
handle org-specific state. The last position of a character allowed
before emphasis was reset incorrectly in this wrapper. Emphasized text
was not recognized when placed directly behind a block which the reader
parses using `parseFromString`.

Fixes: #4784
2018-07-23 22:05:41 +02:00
Anders Waldenborg
ec30fb37c1 Wrap emojis in span nodes (#4759)
Text.Pandoc.Emoji now exports `emojiToInline`, which returns a Span inline containing the emoji character and some attributes with metadata (class `emoji`, attribute `data-emoji` with emoji name).  Previously, emojis (as supported in Markdown and CommonMark readers, e.g "😄")
were simply translated into the corresponding unicode code point.  By wrapping them in Span
nodes, we make it possible to do special handling such as giving them a special font
in HTML output.  We also open up the possibility of treating them differently when the
`--ascii` option is selected (though that is not part of this commit).

Closes #4743.
2018-07-15 15:14:40 -07:00
Alexander Krotov
41cf6d540f More spellcheck 2018-07-02 19:07:28 +03: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
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
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
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
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
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
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
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
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