Commit graph

268 commits

Author SHA1 Message Date
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
Jesse Rosenthal
9654514e8a Docx reader: add test for verbatim in sub/superscript. 2015-02-21 08:45:38 -05:00
Jesse Rosenthal
2995526772 Docx reader: Add tests for new list style parsing. 2015-02-19 00:24:04 -05:00
Matthew Pickering
1a7a99161a Update tests 2015-02-18 21:09:07 +00:00
Matthias C. M. Troffaes
dccd408a9c Allow digit as first character of a citation key.
* Update parser to recognize citation keys starting with a digit.
* Update documentation accordingly.
* Test case added.

See https://github.com/jgm/pandoc-citeproc/issues/97
2015-02-18 15:30:17 +00:00
Jesse Rosenthal
616e211f36 Docx reader: test lists in table cells. 2015-02-13 09:08:07 -05:00
Jesse Rosenthal
e88119f2d1 Docx Reader: Add test for VML images.
Since images are often visually (not structurally) placed on the page,
people might not always get the results they're looking for here.
2015-01-21 13:41:16 -05:00
John MacFarlane
47c360e079 Improved texorpdfstring patch #1148.
* Make LaTeX reader recognize texorpdfstring.
* Don't use texorpdfstring unless it's actually needed.
* Fix tests.
2014-12-15 10:06:03 -08:00
John MacFarlane
544f3e5b45 Merge branch 'use-texorpdfstring' of https://github.com/wilx/pandoc into wilx-use-texorpdfstring
Conflicts:
	src/Text/Pandoc/Writers/LaTeX.hs
	tests/Tests/Writers/LaTeX.hs
2014-12-15 10:01:50 -08:00
John MacFarlane
a864e9a348 Merge pull request #1805 from bergey/rst
RST Reader - Improved Role Support
2014-12-15 09:06:45 -08:00
John MacFarlane
1d3ca088f2 Merge pull request #1813 from tarleb/file-links
Org reader: properly handle links to `file:target`
2014-12-14 13:36:34 -08:00
Albert Krewinkel
4d85b17fc5 Org reader: properly handle links to file:target
Org links like `[[file:target][title]]` were not handled correctly,
parsing the link target verbatim.  The org reader is changed such that
the leading `file:` is dropped from the link target.

This is related to issues #756 and #1812.
2014-12-14 21:30:10 +01:00
John MacFarlane
2b08e32a90 Fixe autolinks with following punctuation.
Closes #1811.
The price of this is that autolinked bare URIs can no longer
contain `>` characters, but this is not a big issue.
2014-12-14 12:20:33 -08:00
Daniel Bergey
689fb112bf RST Reader: compute Attrs when role is defined
Move recursive role lookup from renderRole to addNewRole.  The Attr value
will be the same for every occurance of this role, so there's no reason
to compute it every time.  This allows simplifying the
stateRstCustomRoles map considerably.

We could go even further, and remove the fmt and attr arguments to
renderRole, which are null except for custom roles.
2014-12-12 14:45:45 +00:00
Daniel Bergey
4e040160e0 WIP: tests for RST roles 2014-12-12 14:45:45 +00:00
Matthew Pickering
48e2586ec8 Merge pull request #1746 from shelf/dw-ext-images
DokuWiki writer: fix external images
2014-12-08 23:55:36 +00:00
Daniel Bergey
74c1b547c2 parse RST class directives
The class directive accepts one or more class names, and creates a Div
value with those classes.  If the directive has an indented body, the
body is parsed as the children of the Div.  If not, the first block
folowing the directive is made a child of the Div.

This differs from the behavior of rst2xml, which does not create a Div
element.  Instead, the specified classes are applied to each child of
the directive.  However, most Pandoc Block constructors to not take an
Attr argument, so we can't duplicate this behavior.
2014-12-01 18:22:03 +00:00
Daniel Bergey
2cdfa5eb20 parse RST quoted literal blocks
closes #65
RST quoted literal blocks are the same as indented literal blocks (which
pandoc already supports) except that the quote character is preserved in
each line.

This includes test cases for the quoted literal block, as well as
additional tests for line blocks and indented literal blocks, to verify
that these are unaffected by the changes.
2014-12-01 18:22:03 +00:00
John MacFarlane
46d343f474 Fixed bug in org with bulleted lists:
- a
   - b
   * c

was being parsed as a list, even though an unindented `*`
should make a heading.  See
<http://orgmode.org/manual/Plain-lists.html#fn-1>.
2014-11-13 23:40:18 -08:00
John MacFarlane
43c1978fae Merge pull request #1645 from neongreen/issue1636
Fix 'Ext_lists_without_preceding_blankline' bug.
2014-11-12 09:05:29 -08:00
Timothy Humphries
98161afa1a DokuWiki writer: add external_images test
Add test for #1739.
2014-11-09 02:18:58 -05:00