Commit graph

288 commits

Author SHA1 Message Date
Ophir Lifshitz
dfd06467ea Docx Reader: Create special punctuation test 2015-10-04 06:11:07 -04:00
John MacFarlane
6532950b26 MediaBag: ensure that / is always used as path separator. 2015-09-26 22:40:58 -07:00
John MacFarlane
9b033672e4 Merge pull request #2406 from tarleb/org-verse-fix
Make sure verse blocks can contain empty lines
2015-09-20 13:02:47 -07:00
Albert Krewinkel
8007dd97b5 Make sure verse blocks can contain empty lines
The previous verse parsing code made the faulty assumption that empty
strings are valid (and empty) inlines.  This isn't the case, so lines
are changed to contain at least a newline.

It would generally be nicer and faster to keep the newlines while
splitting the string.  However, this would require more code, which
seems unjustified for a simple (and fairly rare) block as *verse*.

This fixes #2402.
2015-09-19 22:02:43 +02:00
Nikolay Yakimov
5788f62ef5 [RST Writer] Don't normalize heading levels below input minimum 2015-09-19 17:45:54 +03:00
John MacFarlane
6dcfa7e07b Tests: docx writer tests now use "../data" for data directory.
This allows tests  to be run without installing first.
2015-09-09 10:39:20 -07:00
Juliusz Gonera
f1c87ed164 Org reader: add auto identifiers if not present on headers
Refs #2354

This should also fix the table of contents (--toc) when generating a html file
from org input
2015-08-15 07:57:48 +02:00
MarLinn
f068093555 Added odt reader
Fully implemented features:

* Paragraphs
* Headers
* Basic styling
* Unordered lists
* Ordered lists
* External Links
* Internal Links
* Footnotes, Endnotes
* Blockquotes

Partly implemented features:

* Citations
  Very basic, but pandoc can't do much more
* Tables
  No headers, no sizing, limited styling
2015-07-23 15:37:01 -07:00
John MacFarlane
8390d935d8 Updated tests and removed a skipSpaces....
we no longer need it with the change to toKey, and it
is expensive to skip spaces after every inline.
2015-07-23 15:35:18 -07:00
Ophir Lifshitz
53cb926232 Markdown Reader: Add basic tests for each header style 2015-07-23 02:31:24 -04:00
Ophir Lifshitz
0c7d0757d6 Markdown Reader: Add implicit header ref tests for headers with spaces 2015-07-23 02:31:03 -04:00
John MacFarlane
fa2c008ae5 Fix regression: allow HTML comments containing --.
Technically this isn't allowed in an HTML comment, but
we've always allowed it, and so do most other implementations.
It is handy if e.g. you want to put command line arguments
in HTML comments.
2015-07-21 22:44:18 -07:00
John MacFarlane
9e0fb844a9 Markdown reader: don't allow bare URI links or autolinks in link label.
Added test cases.

Closes #2300.
2015-07-14 13:16:40 -07:00
John MacFarlane
9cdfd4f649 Improved bare autolink detection.
Previously we disallowed `-` at the end of an autolink,
and disallowed the combination `=-`.

This commit liberalizes the rules for allowing punctuation in
a bare URI.

Added test cases.

One potential drawback is that you can no longer put a bare
URI in em dashes like this

    this uri---http://example.com---is an example.

But in this respect we now match github's treatment of bare URIs.

Closes #2299.
2015-07-14 10:24:39 -07:00
John MacFarlane
653a7bbe21 Removed tabs from source. 2015-07-10 10:35:58 -07:00
John MacFarlane
99fe8594d9 Avoid parsing partial URLs as HTML tags.
Closes #2277.
2015-07-10 10:33:27 -07:00
Lars-Dominik Braun
d9e17cb3f7 Tests.Readers.RST: Test metadata with inline markup too 2015-07-03 16:57:30 +02:00
Lars-Dominik Braun
8577007d9b Tests.Readers.RST: Group field list tests 2015-07-03 16:44:02 +02:00
Lars-Dominik Braun
68b6b9f652 Readers.RST: Parse field list name
“Inline markup is parsed in field names.” [1]

[1] http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#field-lists
2015-07-03 16:41:28 +02:00
Lars-Dominik Braun
3b2c50ed93 Fix RST reference names with special characters 2015-06-29 18:34:45 +02:00
Albert Krewinkel
385dcf5b99 Org reader: drop trees with a :noexport: tag
Trees having a `:noexport:` tag set are not exported.  This mirrors
default Emacs Org-Mode behavior.
2015-05-23 14:23:16 +02:00
Albert Krewinkel
d8e4a8bc10 Org reader: put header tags into empty spans
Org mode allows headers to be tagged:

``` org-mode
* Headline         :TAG1:TAG2:
```

Instead of being interpreted as part of the headline, the tags are now
put into the attributes of empty spans.  Spans without textual content
won't be visible by default, but they are detectable by filters.  They
can also be styled using CSS when written as HTML.

This fixes #2160.
2015-05-23 14:06:32 +02:00
John MacFarlane
e06810499e HTML reader: Support base tag.
We only support the href attribute, as there's no place for
"target" in the Pandoc document model for links.

Added HTML reader test module, with tests for this feature.

Closes #1751.
2015-05-13 20:53:19 -07:00
John MacFarlane
64b1394fe2 Make sure a closing </div> doesn't get included in a defn list item.
Closes #2127.
2015-05-03 15:06:40 -07:00
John MacFarlane
d9d88e58e1 Fixed regression with lists inside defintiion lists.
This fixes a regression (not in any released version) on
things like

    hi
    :   - there

Closes #2098.
2015-04-26 11:27:47 -07:00
John MacFarlane
095b05e4f9 EPUB tests: don't use joinPath, which varies across platforms.
Instead, use a forward-slash to join paths, regardless of the
platform. This matches the way MediaBag now works.

See
56e4ecab20 (commitcomment-10858449)
2015-04-22 17:38:59 -07:00
Nikolay Yakimov
c1ff165154 MD Reader: Tests for links/footnotes after citations
In-text citation suffix clashes with links and footnotes
2015-04-20 01:31:45 +03:00
John MacFarlane
343b6051da Added test case for #2062. 2015-04-18 19:00:18 -07:00
John MacFarlane
d20152e011 Markdown writer: improved escaping.
`<` should not be escaped as `\<`, for compatibility with
original Markdown.  We now escape `<` and `>` with entities.
Also, we now backslash-escape square brackets.

Closes #2086.
2015-04-18 10:58:50 -07:00
John MacFarlane
d3544dc6f7 Markdown definition lists: don't require indent for first line.
Previously the body of the definition (after the `:` or `~` marker)
needed to be in column 4.  This commit relaxes that requirement,
to better match the behavior of PHP Markdown Extra.  So, now
this is a valid definition list:

    foo
    : bar

This patch also helps resolve a potentially ambiguity with table
captions:

    foo

      : bar

      -----
      table
      -----

Is "bar" a definition, or the caption for the table?  We'll count
it as a caption for the table.

Closes #2087.
2015-04-18 10:13:32 -07:00
John MacFarlane
10e28ef750 More principled fix for #1820.
If the tag parses as a comment, we check to see if the
input starts with `<!--`. If not, it's bogus comment mode
and we fail htmlTag.

Includes test case.  Closes #1820.
2015-04-17 22:56:33 -07:00
John MacFarlane
764f677530 Merge branch 'latex-tightlist' of https://github.com/jlduran/pandoc into jlduran-latex-tightlist
Conflicts:
	data/templates
2015-04-17 19:23:13 -07:00
John MacFarlane
28ca8566ab Merge pull request #1954 from mcmtroffaes/feature/citekey-firstchar-alphanum
Allow digit as first character of a citation key.
2015-04-17 19:10:37 -07:00
John MacFarlane
44fcc5f96e Merge pull request #2079 from lierdakil/rst-normalize-headings
RST Writer: Normalize headings to sequential levels
2015-04-17 19:06:25 -07:00
Nikolay Yakimov
94e4a5ec44 MD Reader: Test for smart ' after inline math 2015-04-18 00:53:20 +03:00
Nikolay Yakimov
4b7ddeb63f RST Writer: Tests for rubrics and heading normalization 2015-04-16 19:27:33 +03:00
Nikolay Yakimov
251ce0738d LaTeX Reader: Test for ^^ character escapes 2015-04-13 03:22:39 +03:00
John MacFarlane
2d2e4c9ab2 Merge branch 'master' of https://github.com/rootzlevel/pandoc into rootzlevel-master
Conflicts:
	src/Text/Pandoc/Readers/Org.hs
2015-03-28 21:09:38 -07:00
John MacFarlane
6a3a04c428 Merge branch 'errortype' of https://github.com/mpickering/pandoc into mpickering-errortype
Conflicts:
	benchmark/benchmark-pandoc.hs
	src/Text/Pandoc/Readers/Markdown.hs
	src/Text/Pandoc/Readers/Org.hs
	src/Text/Pandoc/Readers/RST.hs
	tests/Tests/Readers/LaTeX.hs
2015-03-28 12:12:48 -07:00
John MacFarlane
619b2e8ca2 Merge pull request #1968 from lierdakil/issue1607
Fixes for multiple docx writer style bugs.
2015-03-16 12:02:40 -07:00
John MacFarlane
0deb7c507d Merge pull request #1989 from zudov/shortcut_ref_link_pr
Support shortcut reference links in markdown writer
2015-03-15 11:58:30 -07:00
Konstantin Zudov
b9f77ed03d Support shortcut reference links in markdown writer
Issue #1977

Most markdown processors support the [shortcut format] for reference links.
Pandoc's markdown reader parsed this shortcuts unoptionally.
Pandoc's markdown writer (with --reference-links option) never shortcutted links.

This commit adds an extension `shortcut_reference_links`. The extension is
enabled by default for those markdown flavors that support reading shortcut
reference links, namely:

    - pandoc
    - strict pandoc
    - github flavoured
    - PHPmarkdown

If extension is enabled, reader parses the shortcuts in the same way as
it preveously did. Otherwise it would parse them as normal text.

If extension is enabled, writer outputs shortcut reference links unless
doing so would cause problems (see test cases in `tests/Tests/Writers/Markdown.hs`).
2015-03-10 20:32:24 +02:00
Craig S. Bosma
513221f822 Org reader: add support for smart punctuation 2015-03-09 07:11:53 -05:00
Mathias Schenner
12bf0ff3e5 LaTeX reader: allow non-empty colsep in tables
The `tabular` environment allows non-empty column separators
with the "@{...}" syntax. Previously, pandoc would fail to
parse tables if a non-empty colsep was present. With this
commit, these separators are still ignored, but the table gets
parsed. A test case is included.
2015-03-08 15:47:39 +01:00
Mathias Schenner
1e3ef0e36f LaTeX reader: allow valign argument in tables
The `tabular` environment takes an optional parameter for
vertical alignment. Previously, pandoc would fail to parse
tables if this parameter was present. With this commit,
the parameter is still ignored, but the table gets
parsed. A test case is included.
2015-03-08 15:39:18 +01:00
Mathias Schenner
4f9a10619f LaTeX reader: add some test cases for simple tables 2015-03-08 15:17:09 +01:00
Nikolay Yakimov
59c4d28d8c Docx Writer: Tables test 2015-03-08 04:42:50 +03:00
Nikolay Yakimov
a82dedf1ff Lists test 2015-03-08 03:59:48 +03:00
Nikolay Yakimov
ae07d5ed49 Initial tests for writer 2015-03-03 14:37:02 +03:00
Hans-Peter Deifel
5871955169 Org reader: Add test for image links
Tests for image links with non-image targets, as introduced in
commit 2ca5101.
2015-02-26 13:11:50 +01:00