Commit graph

388 commits

Author SHA1 Message Date
Yan Pas
7741cdbf04 added old-style test 2018-10-17 00:21:52 +03:00
Yan Pas
ce27bf9a02 builders 2018-10-16 03:12:06 +03:00
Yan Pas
3fed62611e tests, commented debug functions 2018-10-14 00:57:15 +03:00
Yan Pas
27467189ab Merge branch 'master' into groff_reader 2018-10-07 18:10:01 +03:00
Alexander Krotov
5f7799ac8f Muse reader: allow table caption to contain "+" 2018-10-05 11:58:41 +03:00
leungbk
4f9ab7e032 Parse empty argument array in inline src blocks.
`enclosedByPair` alone does not the handle the empty array properly since it uses `many1Till`.
2018-09-28 14:05:14 +02:00
John MacFarlane
13f8f3c1a8 HTML, Muse reader tests: reduce time taken by round-trip test. 2018-09-27 09:47:09 -07:00
Albert Krewinkel
56fe5b559e
Use hslua v1.0.0 2018-09-24 20:11:27 +02:00
Alexander Krotov
389ffa3045 Muse reader tests: more tests
Check that indented blocks that end in self-terminating blocks (such as block tags and verse) can be terminated by paragraphs.
2018-09-22 20:28:11 +03:00
Alexander Krotov
dd5d234c6a Muse reader: do not allow code markup to be followed by digit 2018-09-21 13:07:56 +03:00
John MacFarlane
136bf901aa Markdown reader: distinguish autolinks in the AST.
With this change, autolinks are parsed as Links with
the `uri` class. (The same is true for bare links, if
the `autolink_bare_uris` extension is enabled.)  Email
autolinks are parsed as Links with the `email` class.
This allows the distinction to be represented in the
URI.

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

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

Closes #4913.
2018-09-19 14:53:29 -07:00
Albert Krewinkel
dba5c8d4e3
Lua filter tests: produce better error on test failure 2018-09-19 21:36:19 +02:00
danse
db2a68d089 parse rST inlines containing newlines closing #4912
this eliminates a regression error introduced after pandoc 2.1.1,
affecting rST inline parsing. see the issue for details
2018-09-18 13:31:09 +02:00
Alexander Krotov
71776661cd Muse writer: replace newlines in strings with spaces 2018-09-16 21:05:57 +03:00
Alexander Krotov
3f8891b26f Enable tables in HTML round trip test 2018-09-11 19:24:00 +03:00
Alexander Krotov
ca420983aa HTML reader tests: accept Blocks in round trip test 2018-09-11 19:23:46 +03:00
Alexander Krotov
0ac3512cfe Muse reader tests: accept Blocks instead of Block in round trip test
This way testcase can be shrinked better up to removing all blocks completely.
2018-09-11 14:22:09 +03:00
Alexander Krotov
1aac754359 Muse writer: set envInsideBlock = True when rendering notes 2018-09-11 14:10:20 +03:00
Alexander Krotov
e6ba0cc893 HTML writer: always output <dt> element, even if it is empty
Fixes #4883
2018-09-11 13:20:11 +03:00
Alexander Krotov
165a61095c Muse writer: check for whitespace in the beginning and end of Str's 2018-09-11 11:49:11 +03:00
Alexander Krotov
cb28cab489 Muse writer: escape -, ; and > in the beginning of strings 2018-09-11 11:35:25 +03:00
Alexander Krotov
c899b4e89d Muse writer: escape list markers in the beginning of notes 2018-09-11 04:15:32 +03:00
Alexander Krotov
00b2b0feb6 Muse writer: normalize inline list before testing if tags should be used 2018-09-11 01:36:11 +03:00
Alexander Krotov
c2b97c4b80 Muse writer: use tags instead of lightweight markup for empty strings 2018-09-11 00:39:37 +03:00
Alexander Krotov
1b9dd3e06b Remove RawBlock from HTML round trip tests 2018-09-10 14:28:28 +03:00
Alexander Krotov
4467fe6d38 HTML reader: test round trip property 2018-09-10 12:15:27 +03:00
Albert Krewinkel
275afec38a Org reader: respect export option p for planning info
Inclusion of planning info (*DEADLINE*, *SCHEDULED*, and *CLOSED*) can
be controlled via the `p` export option: setting the option to `t` will
add all planning information in a *Plain* block below the respective
headline.
2018-09-06 20:57:21 +02:00
Alexander Krotov
0b7001c318 Muse reader: close the </quote> in indented tag test
There is already a separate test for unclosed </quote>.
2018-09-06 19:57:24 +03:00
Albert Krewinkel
ceec26f647 Org reader: strip planning info from output
Planning info is parsed, but not included in the output (as is the
default with Emacs Org-mode).

Fixes: #4867
2018-09-05 17:12:54 +02:00
Alexander Krotov
bec2023265 hlint Muse writer tests 2018-09-04 11:00:44 +03:00
Alexander Krotov
66f3b00206 Remove redundant $ 2018-09-04 10:53:37 +03:00
Alexander Krotov
02e68859eb Muse reader: autonumber sections in the correct order
Parsing now stops at each section header to ensure the
header is registered before parsing of the next section starts.
2018-09-02 17:37:19 +03:00
Alexander Krotov
6ea6011ca6 Muse writer: use lightweight markup when possible 2018-09-02 03:29:27 +03:00
Alexander Krotov
23ed97f081 Muse reader: allow newline after opening "*" or "**"
Emacs Muse allows this.
2018-09-02 01:03:43 +03:00
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
Yan Pas
1ce067fc2a tests, parsing fixes 2018-05-23 00:20:30 +03:00
Yan Pas
b0b41cbbe6 Merge branch 'master' into groff_reader 2018-05-12 11:42:39 +03:00