Commit graph

328 commits

Author SHA1 Message Date
Albert Krewinkel
b7a8620b43
Org tests: group export settings test for Org reader 2020-06-28 19:25:57 +02:00
Albert Krewinkel
e3a6d651e1
Org reader: update behavior of author, keywords export settings
The behavior of the `#+AUTHOR` and `#+KEYWORD` export settings has
changed: Org now allows multiple such lines and adds a space between the
contents of each line. Pandoc now always parses these settings as meta
inlines; setting values are no longer treated as comma-separated lists.
Note that a Lua filter can be used to restore the previous behavior.
2020-06-28 18:01:30 +02:00
Albert Krewinkel
8dce28d949
Org reader: read description lines as inlines
`#+DESCRIPTION` lines are treated as text with markup. If multiple such
lines are given, then all lines are read and separated by soft
linebreaks.

Closes: #6485
2020-06-27 09:11:00 +02:00
Albert Krewinkel
9e6e9a7221
Org reader: honor tex export option
The `tex` export option can be set with `#+OPTION: tex:nil` and allows
three settings:

 - `t` causes LaTeX fragments to be parsed as TeX or added as raw TeX,
 - `nil` removes all LaTeX fragments from the document, and
 - `verbatim` treats LaTeX as text.

The default is `t`.

Closes: #4070
2020-06-25 20:31:33 +02:00
John MacFarlane
b1561d8e47 Use native Underline instead of Span in Jira 2020-06-22 17:55:57 -07:00
Albert Krewinkel
f5d7d41cbd
Recognize images with uppercase extensions
Fixes: #6472
2020-06-20 18:14:18 +02:00
Vaibhav Sagar
9c2b659eeb
Support new Underline element in readers and writers (#6277)
Deprecate `underlineSpan` in Shared in favor of `Text.Pandoc.Builder.underline`.
2020-04-28 07:53:06 -07:00
John MacFarlane
aff2500d46 More fixes for round-trip tests of HTML reader.
We exclude tables that have default widths but non-simple
content, as these can't really round-trip.
2020-04-19 17:21:19 -07:00
John MacFarlane
573214a06a Fixed round-trip HTML tests.
Exclude tables with cells with line breaks because they don't
currently round-trip.  (Table goes from being simple to having
explicit widths.)
2020-04-18 20:57:28 -07:00
despresc
c7814f31e1 Use the new builders, modify readers to preserve empty headers
The Builder.simpleTable now only adds a row to the TableHead when the
given header row is not null. This uncovered an inconsistency in the
readers: some would unconditionally emit a header filled with empty
cells, even if the header was not present. Now every reader has the
conditional behaviour. Only the XWiki writer depended on the header
row being always present; it now pads its head as necessary.
2020-04-15 23:03:22 -04:00
despresc
4e34d366df Adapt to the newest Table type, fix some previous adaptation issues
- Writers.Native is now adapted to the new Table type.

- Inline captions should now be conditionally wrapped in a Plain, not
  a Para block.

- The toLegacyTable function now lives in Writers.Shared.
2020-04-15 23:03:22 -04:00
despresc
7254a2ae0b Implement the new Table type 2020-04-15 23:03:22 -04:00
Nikolay Yakimov
83c1ce1d77
Markdown Reader: Fix inline code in lists (#6284)
Closes #6284.

Previously inline code containing list markers was sometimes parsed incorrectly.
2020-04-15 16:20:01 -07:00
Albert Krewinkel
c3f539364a
Jira: support citations, attachment links, and user links
Closes: #6231
Closes: #6238
Closes: #6239
2020-04-04 14:27:27 +02:00
Albert Krewinkel
d867cac8ca
Jira reader: resolve parsing issues of blockquote, color
Parsing problems occurring with block quotes and colored text have been
resolved.

Fixes: #6233
Fixes: #6235
2020-04-03 13:25:52 +02:00
Albert Krewinkel
7df0710094
Jira reader: use span with class underline for inserted text
Jira text which is marked as `+inserted+` is converted into pandoc's
default representation for underlined text: a span with class
`underline`. Previously, the span was marked with the non-standard class
`inserted`.

Closes: #6237
2020-03-31 10:04:55 +02:00
Albert Krewinkel
69a3fa5708
Jira reader: retain image attributes
Jira images attributes as in `!image.jpg|align=right!` are retained as
key-value pairs. Thumbnail images, such as `!example.gif|thumbnail!`,
are marked by a `thumbnail` class in their attributes.

Related to #6234.
2020-03-30 22:03:52 +02:00
Joseph C. Sible
7233a7a932
More cleanup (#6209)
* Simplify by collapsing a do block into a single <$>
* Remove an unnecessary variable: `all` takes any Foldable, so only blocksToInlines needs toList.
2020-03-28 22:48:47 -07:00
Albert Krewinkel
44f8c2725e
Jira reader: fix parsing of tables without preceding blankline
A bug was fixed which caused faulty parsing if a table was not preceded
by a newline and the first table cell had no space after the initial `|`
characters.

Fixes: #6198
2020-03-19 21:27:35 +01:00
Albert Krewinkel
81d46435f6
Jira reader: fix parsing of strikeout, emphasis
A bug was fixed which caused non-emphasized text containing digits and/or
non-special symbols (like dots) to sometimes be parsed incorrectly.

Fixes: #6196
2020-03-18 21:32:05 +01:00
Albert Krewinkel
11b5f1e40b
Update copyright year (#6186)
* Update copyright year

* Copyright: add notes for Lua and Jira modules
2020-03-13 09:52:47 -07:00
Albert Krewinkel
7eb9914841
Jira reader: support colored inline text, indented lists
* Support for colored inlines has been added.
* Lists are now allowed to be indented; i.e., lists are still recognized
  if list markers are preceded by spaces.

Closes: #6183, #6184
2020-03-13 09:52:28 +01:00
John MacFarlane
aaf296508a Fix man reader test for previous change. 2020-03-05 19:34:17 -08:00
Joseph C. Sible
12c75701be
Use <$> instead of >>= and return (#6128) 2020-02-08 09:12:01 -08:00
John MacFarlane
4c3db9273f Apply linter suggestions. Add fix_spacing to lint target in Makefile. 2020-02-07 09:08:22 -08:00
John MacFarlane
80a0e56a5d HTML reader tests: modify round-trip tests...
to avoid a special failure case involving makeSections.
2019-12-21 12:15:35 -08:00
Albert Krewinkel
0a3cc7260c
Org reader: fix parsing problem for colons in headline
Fixed a problem where words surrounded by colons could causing parse
failures in some cases when they occurred in headers.

Fixes: #5993
2019-12-19 20:38:51 +01:00
Albert Krewinkel
5bd2d28b19
Org reader: wrap named table in div, using name as id
Closes: #5984
2019-12-18 22:28:26 +01:00
Albert Krewinkel
96c80b156d Add jira reader (#5913)
Closes #5556
2019-12-17 21:07:46 -08:00
Alexander Krotov
33d2a1a84f DokuWiki reader: parse markup inside monospace ('') (#5917)
Fixes #5916
2019-11-18 15:05:19 -08:00
despresc
90e436d496 Switch to new pandoc-types and use Text instead of String [API change].
PR #5884.

+ Use pandoc-types 1.20 and texmath 0.12.
+ Text is now used instead of String, with a few exceptions.
+ In the MediaBag module, some of the types using Strings
  were switched to use FilePath instead (not Text).
+ In the Parsing module, new parsers `manyChar`, `many1Char`,
  `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`,
  `mantyUntilChar` have been added: these are like their
  unsuffixed counterparts but pack some or all of their output.
+ `glob` in Text.Pandoc.Class still takes String since it seems
  to be intended as an interface to Glob, which uses strings.
  It seems to be used only once in the package, in the EPUB writer,
  so that is not hard to change.
2019-11-12 16:03:45 -08:00
Amogh Rathore
bd2bd9b19d HTML Reader/Writer - Add support for <var> and <samp> (#5861)
Closes #5799
2019-11-04 08:42:30 -08:00
John MacFarlane
530bfe5f5a Docx reader: fix list number resumption for sublists. Closes #4324.
The first list item of a sublist should not resume numbering
from the number of the last sublist item of the same level,
if that sublist was a sublist of a different list item.

That is, we should not get:

```
1. one
   1. sub one
   2. sub two
2. two
   3. sub one
```
2019-11-03 12:54:42 -08:00
Albert Krewinkel
909083090a
Org reader: fix parsing of empty comment lines
Comment lines in Org-mode can be completely empty; both of these line
should produce no output:

    # a comment
    #

The reader used to produce a wrong result for the latter, but ignores
that line as well now.

Fixes: #5856
2019-10-27 23:00:30 +01:00
Amogh Rathore
d50f46d26d Add Reader support for HTML <samp> element (#5843)
The `<samp>` element is parsed as a Span with class `sample`.
Closes #5792.
2019-10-23 08:44:24 -07:00
Alexander Krotov
a1977dd2d6 Muse reader: do not allow closing asterisks to be followed by "*" 2019-10-15 16:36:05 +03:00
Alexander Krotov
d5c13dd438 Muse reader: do not split series of asterisks into symbols and emphasis
Fixes #5821
2019-10-15 01:55:32 +03:00
Alexander Krotov
13e0ac1104 Muse reader: do not terminate emphasis on "*" not followed by space 2019-10-15 01:02:54 +03:00
Alexander Krotov
6a9cafc67a hlint Muse reader tests 2019-10-04 18:28:53 +03:00
Nikolay Yakimov
c113ca6717 [Docx Reader] Use style names, not ids, for assigning semantic meaning
Motivating issues: #5523, #5052, #5074

Style name comparisons are case-insensitive, since those are
case-insensitive in Word.

w:styleId will be used as style name if w:name is missing (this should
only happen for malformed docx and is kept as a fallback to avoid
failing altogether on malformed documents)

Block quote detection code moved from Docx.Parser to Readers.Docx

Code styles, i.e. "Source Code" and "Verbatim Char" now honor style
inheritance

Docx Reader now honours "Compact" style (used in Pandoc-generated docx).
The side-effect is that "Compact" style no longer shows up in
docx+styles output. Styles inherited from "Compact" will still
show up.

Removed obsolete list-item style from divsToKeep. That didn't
really do anything for a while now.

Add newtypes to differentiate between style names, ids, and
different style types (that is, paragraph and character styles)

Since docx style names can have spaces in them, and pandoc-markdown
classes can't, anywhere when style name is used as a class name,
spaces are replaced with ASCII dashes `-`.

Get rid of extraneous intermediate types, carrying styleId information.
Instead, styleId is saved with other style data.

Use RunStyle for inline style definitions only (lacking styleId and styleName);
for Character Styles use CharStyle type (which is basicaly RunStyle with styleId
and StyleName bolted onto it).
2019-09-21 11:18:15 -07:00
John MacFarlane
45b7636307 Revert "FB2 reader test: better diagnostics on failure."
This reverts commit c65af7d1a2.
2019-09-15 10:27:19 -07:00
John MacFarlane
c65af7d1a2 FB2 reader test: better diagnostics on failure. 2019-09-15 09:06:38 -07:00
John MacFarlane
88a0327579 FB2 reader test: Another attempt to fix test failure on GitHub CI. 2019-09-14 10:37:19 -07:00
John MacFarlane
7ecae69e27 Revert "FB2 reader test: filter CRs."
This reverts commit e35147d715.
2019-09-13 22:08:42 -07:00
John MacFarlane
e35147d715 FB2 reader test: filter CRs.
This may help with the test failure on GitHub CI.

b59e6d0376/checks
2019-09-13 16:50:00 -07:00
John MacFarlane
e4cca4cf67 Roff readers: better parsing of groups.
We now allow groups where the closing `\\}` isn't at the
beginning of a line.

Closes #5410.
2019-09-04 09:24:42 -07:00
John MacFarlane
b35fae6511 Use doctemplates 0.3, change type of writerTemplate.
* Require recent doctemplates.  It is more flexible and
  supports partials.
* Changed type of writerTemplate to Maybe Template instead
  of Maybe String.
* Remove code from the LaTeX, Docbook, and JATS writers that looked in
  the template for strings to determine whether it is a book or an
  article, or whether csquotes is used. This was always kludgy and
  unreliable.  To use csquotes for LaTeX, set `csquotes` in your
  variables or metadata. It is no longer sufficient to put
  `\usepackage{csquotes}` in your template or header includes.
  To specify a book style, use the `documentclass` variable or
  `--top-level-division`.
* Change template code to use new API for doctemplates.
2019-07-28 19:25:45 -07:00
Albert Krewinkel
63c65c89da
Org reader: accept ATTR_LATEX in block attributes
Attributes for LaTeX output are accepted as valid block attributes;
however, their values are ignored.

Fixes: #5648
2019-07-22 08:12:22 +02:00
Alexander Krotov
0713cb65bc Muse: add RTL support
Closes #5551
2019-07-14 18:22:52 +03:00
John MacFarlane
7bc9eab846
Merge pull request #5589 from blmage/fix-3992
Add support for EPUB2 covers (fix #3992)
2019-07-13 16:48:09 -07:00