Commit graph

1184 commits

Author SHA1 Message Date
Bryan O'Sullivan
2150903230 DocBook reader: document/test "type" as implemented 2014-12-08 23:17:27 -08:00
Bryan O'Sullivan
aaf93d8f4e Fix test suite 2014-12-08 23:16:21 -08:00
Bryan O'Sullivan
fe1d147187 DocBook reader: add support for classname 2014-12-08 23:12:06 -08:00
Bryan O'Sullivan
33fdb6bc15 DocBook reader: add support for calloutlist and callout
We treat a calloutlist as a bulleted list. This works well in practice.
2014-12-08 22:26:09 -08: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
d8fde9547e Reverted "omit blank lines after list items," better fix for #1777.
Now we do as before, including blank lines after list items in
loose lists (even though RST doesn't care -- this is just a matter
of visual appeal).  But we chomp any excess whitespace after the
last list item, which solves #1777.
2014-11-25 12:34:44 -08:00
John MacFarlane
25e2c42347 RST writer: Omit blank lines after list items.
They are optional in RST (except after the last list item,
of course).

Fixes #1777.
2014-11-25 12:24:33 -08:00
John MacFarlane
9e5a8de95a Removed extra </body> tag from tests/html-reader.html. 2014-11-16 20:46:45 -08: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
Caleb McDaniel
bd245450c4 Add tests for external links with anchors 2014-11-13 00:42:58 -05: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
Albert Krewinkel
e6cd8c9077 Org reader: allow empty links for gitit interop
While empty links are not allowed in Emacs org-mode,  Pandoc org-mode
should support them: gitit relies on empty links as they are used to
create wiki links.

Fixes jgm/gitit#471
2014-11-05 23:15:28 +01:00
Albert Krewinkel
daaf635806 Org reader: absolute, relative paths in links
The org reader was to restrictive when parsing links, some relative
links and links to files given as absolute paths were not recognized
correctly.  The org reader's link parsing function was amended to handle
such cases properly.

This fixes #1741
2014-11-05 22:27:25 +01:00
John MacFarlane
f3ac41937d DokuWiki writer: Better handling of block quotes.
This change ensures that multiple paragraph blockquotes are
rendered using native `>` rather than as HTML.

Closes #1738.
2014-11-04 14:52:19 -08:00
Alexander Sulfrian
79f25fb9ce TWiki Reader: add basic syntax test 2014-10-30 20:02:05 +01:00
Jesse Rosenthal
60846471a3 Docx test: Remove Danish header test.
Redundant, now that we're testing for a more generalized sort of
internationalized blocks.
2014-10-25 16:02:31 -04:00
Jesse Rosenthal
c0ddcb359e Docx reader: add tests for i18n headers.
This tests blockquotes and headers in Russian. Previous tests make sure
that this doesn't produce a regression in en-us Header and Blockquotes.
2014-10-25 16:00:27 -04:00
John MacFarlane
e16683b539 HTML writer: Make header attributes work outside top level.
Previously they only appeared on top level header elements.
Now they work e.g. in blockquotes.

Closes #1711.
2014-10-23 10:27:14 -07:00
John MacFarlane
78bdc08de7 Merge pull request #1706 from tarleb/org-symbol-entities
Org reader: parse LaTeX-style MathML entities
2014-10-21 10:11:19 -07:00
John MacFarlane
7f6bbfadf4 Pretty: Make CR + BLANKLINE = BLANKLINE.
This fixes an extra blank line we were getting at the end
of markdown fragments (as well as rst, org, etc.)

Closes #1705.
2014-10-20 20:26:08 -07:00
Albert Krewinkel
a5eb02f6a7 Org reader: parse LaTeX-style MathML entities
Org supports special symbols which can be included using LaTeX syntax,
but are actually MathML entities.  Examples for this are
`\nbsp` (non-breaking space), `\Aacute` (the letter A with accent acute)
or `\copy` (the copyright sign ©).

This fixes #1657.
2014-10-20 22:57:36 +02:00
John MacFarlane
d7169c715d Parsing: fixed inlineMath so it handles \text{..} containing $.
For example: `$x = \text{the $n$th root of $y$}`.  Closes #1677.
2014-10-19 16:42:56 -07:00
John MacFarlane
84f6b1e41a Merge pull request #1680 from shelf/master
Respect indent when parsing Org bullet lists
2014-10-18 13:20:27 -07:00
John MacFarlane
31713d572a Merge pull request #1700 from tarleb/org-emphasis-fix
Org reader: fix rules for emphasis recognition
2014-10-18 13:19:42 -07:00
Albert Krewinkel
e3c36ed6ce Org reader: Drop COMMENT document trees
Document trees under a header starting with the word `COMMENT` are
comment trees and should not be exported.  Those trees are dropped
silently.

This closes #1678.
2014-10-18 22:11:53 +02:00
Albert Krewinkel
d571bec454 Org reader: fix rules for emphasis recognition
Things like `/hello,/` or `/hi'/` were falsy recognized as emphasised
strings.  This is wrong, as `,` and `'` are forbidden border chars and
may not occur on the inner border of emphasized text.  This patch
enables the reader to matches the reference implementation in that it
reads the above strings as plain text.
2014-10-18 12:47:59 +02:00
Timothy Humphries
f1f56e8533 Fix indent issue for definition lists
Tidy up fix for #1650, #1698 as per comments in #1680.
Fix same issue for definition lists with the same method.
2014-10-17 20:06:25 -04:00
Bjorn Buckwalter
7960013cd4 Escape spaces. Fixes jgm/pandoc#1694. 2014-10-15 21:06:41 +02:00
Timothy Humphries
4f4b0f031d Respect indent when parsing Org bullet lists
Fixes issue with top-level bullet list parsing.
Previously we would use `many1 spaceChars` rather than respecting
the list's indent level. We also permitted `*` bullets on unindented
lists, which should unambiguously parse as `header 1`.
Combined, this meant headers at a different indent level were
being unwittingly slurped into preceding bullet lists, as per
Issue #1650.
2014-10-12 03:18:36 -04:00
John MacFarlane
fe6d43b3e0 Merge pull request #1601 from jkr/windowsfix
Fix path-slashes inside archive for windows
2014-09-27 16:21:17 -07:00
Matthew Pickering
fa2d11c954 Update tests for #1649 2014-09-27 22:40:25 +01:00
Artyom
bc115ffc2d Fix 'Ext_lists_without_preceding_blankline' bug.
* Fixes #1636.
  * Adds a test.
2014-09-26 13:32:08 +04:00
mpickering
c0b9ad4c5d EPUB Tests: Seperating image testing from other features 2014-09-25 13:33:25 +01:00
mpickering
cc07d0c6bf Shared: Make collapseFilePath OS-agnostic 2014-09-25 12:42:53 +01:00
John MacFarlane
0de27f3579 Updated tests for #1616 change. 2014-09-09 10:09:05 -07:00
Jesse Rosenthal
8d22bf26ab LaTeX writer: Test for protecting images in header. 2014-09-09 11:05:47 -04:00
Jesse Rosenthal
f56e0e958a Docx reader: Add test for polyglot headers.
Only Danish at the moment.
2014-09-05 22:07:06 -04:00
Jesse Rosenthal
313355e373 Org reader: Update Tests
Test for markup after blank line.
2014-09-04 19:55:53 -04:00
Jesse Rosenthal
08359c44e4 Docx Reader: Add tests for numbered headers. 2014-09-04 19:39:49 -04:00
Jesse Rosenthal
a6eead7f26 Docx reader: Modify mediabag test accordingly. 2014-09-02 14:05:54 -04:00
Jose Luis Duran
9557eb6f8e LaTeX writer: Use a declaration for tight lists
Currently, pandoc has hard-coded the following in order to make tight lists in
LaTeX:

```hs
text "\\itemsep1pt\\parskip0pt\\parsep0pt"
```

Which is fine, but does not allow customizations.  For example, the `memoir`
class already has a `\tightlist` declaration for this purpose:

```tex
\newcommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
```

I'm proposing to use a similar solution:

```diff
@@ In Writers/LaTeX.hs:
-then text "\\itemsep1pt\\parskip0pt\\parsep0pt"
+then text "\\tightlist"

@@ In templates/default.latex:
+\newcommand{\tightlist}{%
+  \setlength{\itemsep}{1pt}\setlength{\parskip}{0pt}\setlength{\parsep}{0pt}}
```

This allows us to customize the tightness to our needs.

Backward Compatibility

If a person is using a custom LaTeX template (not based upon the `memoir`
class), the `\tightlist` declaration must be added.
2014-09-01 05:08:24 +00:00
John MacFarlane
3533218d6d Merge pull request #1594 from jkr/itemFix
Item fix
2014-08-31 19:31:38 -07:00
Jesse Rosenthal
dfc8ab5a6a LaTeX writer: Add tests for header-in-item. 2014-08-31 16:05:20 -04:00
John MacFarlane
598d3ee23b Markdown reader: better handling of paragraph in div.
Previously text that ended a div would be parsed as Plain
unless there was a blank line before the closing div tag.

Test case:

    <div class="first">
    This is a paragraph.

    This is another paragraph.
    </div>

Closes #1591.
2014-08-31 12:55:47 -07:00
John MacFarlane
374bb3c147 DokuWiki writer: Make tables prettier by aligning columns.
Also cleaned up crufty code and added tests.
2014-08-30 21:24:33 -07:00
John MacFarlane
a8273009ba Textile reader: Improved table support.
We can now handle all different alignment types, for simple
tables only (no captions, no relative widths, cell contents just
plain inlines).  Other tables are still handled using raw HTML.

Addresses #1585 as far as it can be addresssed, I believe.
2014-08-30 20:34:42 -07:00
Jesse Rosenthal
4eb9769a4c Dokuwiki writer: Add a test for multiblock table cells.
We have to add a new file, because the original table tests don't look
for this.
2014-08-30 15:34:40 -04:00
John MacFarlane
218633548f Merge pull request #1574 from jlduran/latex-horizontal-rule
LaTeX writer: Make Horizontal Rules more flexible
2014-08-29 21:40:55 -07:00
John MacFarlane
017d44af1d Merge branch 'ugly-tables' of https://github.com/jlduran/pandoc into jlduran-ugly-tables 2014-08-29 21:24:36 -07:00
Jose Luis Duran
4c684561ee LaTeX writer: Add \strut to fix multiline tables
See: http://tex.stackexchange.com/questions/34971
2014-08-29 13:54:08 +00:00
Jesse Rosenthal
3b5a868533 Docx reader: update tests for new table behavior. 2014-08-28 14:39:04 -04:00
Jose Luis Duran
1fc665c07d LaTeX writer: Make Horizontal Rules more flexible
Currently, pandoc has hard-coded the following in order to make horizontal
rules in LaTeX:

```hs
"\\begin{center}\\rule{3in}{0.4pt}\\end{center}"
```

Which is fine, but does not allow customizations.  It also does not take into
consideration the current line width.

I'm proposing this change:

```diff
@@ In Writers/LaTeX.hs:
-"\\begin{center}\\rule{3in}{0.4pt}\\end{center}"
+"\\begin{center}\\rule{0.5\\linewidth}{\\linethickness}\\end{center}"
```
2014-08-28 03:12:37 +00:00
Jose Luis Duran
f1d330b7b5 LaTeX writer: Fix tables
- [x] Fix a bug introduced in 66378062b6, which
  causes the table caption to repeat across all pages
- [x] Address the issues discussed
  [here](https://groups.google.com/forum/#!msg/pandoc-discuss/qMu6_5lYy0o/ZAU7lzAIKw0J)
  regarding the extra vertical space.
  - [ ] NOTE: This will cause multiline table cells to appear unpadded. See
    http://tex.stackexchange.com/questions/34971
  - [x] Use [`\tabularnewline`](http://tex.stackexchange.com/questions/78796)
    instead of `\\`.
2014-08-28 02:02:20 +00:00
John MacFarlane
17f71002ae Merge pull request #1553 from mpickering/master
Txt2Tags reader: Header is now parsed only if standalone flag is set
2014-08-21 16:42:28 -07:00
mpickering
2a7319541d Txt2Tags Reader: Parse Meta information
The header is now parsed as meta information. The first line is the
`title`, the second is the `author` and third line is the `date`.
2014-08-21 17:09:40 +01:00
mpickering
2cd049a1bf Txt2Tags reader: Header is now parsed only if standalone flag is set 2014-08-20 18:11:37 +01:00
John MacFarlane
13469af843 More test updates. 2014-08-20 09:47:47 -07:00
John MacFarlane
7e69f4a4fa Updated tests. 2014-08-20 09:23:19 -07:00
John MacFarlane
9d52ecdd42 HTML reader: Parse appropriately styled span as SmallCaps. 2014-08-16 22:57:00 -07:00
Jesse Rosenthal
180f5cbe63 Docx reader: Test for character styles. 2014-08-16 14:05:56 -04:00
John MacFarlane
8bf39cf6d6 Markdown reader: Better handle quote characters in inline links.
This was previously failing to be recognized as a link:

    [Test](http://en.wikipedia.org/wiki/Ward's_method)

Closes #1534.
2014-08-14 10:59:27 -07:00
John MacFarlane
e917bcc124 Make raw_tex extension non-default for textile reader, writer.
Enable `raw_tex` extension in textile writer.

Closes #1532.
2014-08-14 09:49:31 -07:00
John MacFarlane
76d14bcc11 Old tests: better path for test program. 2014-08-13 12:20:25 -07:00
John MacFarlane
fc17b3bd41 Make options work with test-pandoc. 2014-08-13 12:19:42 -07:00
John MacFarlane
40e67b8737 Revised tests directory.
Renamed some tests, introducing subsidiary directories
for fb2, docx, epub.

Cleaned up tests in cabal file.

Combined dokuwiki-writer and dokuwiki_inline_formatting tests.
2014-08-13 11:16:50 -07:00
John MacFarlane
1d6e1cf9f3 Removed special testHook from Setup.
This was just too fragile and dependent on a changing Cabal API
(see #1526).

Instead of passing the bulid directory to the test program, we
now let the test program find itself (using executable-path)
and then find the pandoc executable relative to itself.
2014-08-13 08:12:07 -07:00
John MacFarlane
7684b24959 Merge pull request #1528 from mpickering/epubtitlepage
EPUB Reader: Ignores titlepage attribute
2014-08-12 16:56:38 -07:00
Matthew Pickering
063ba81622 EPUB Tests: Added wasteland test
This epub contains many epub:type elements including footnotes and
titlepage.
2014-08-13 00:25:18 +01:00
John MacFarlane
81157c7cc6 HTML writer: use 'uri' or 'email' class for autolinks.
This allows them to be styled specially.

Closes #1501.
2014-08-12 15:49:43 -07:00
John MacFarlane
3653018a70 Added mathml tests for docbook reader. 2014-08-12 14:10:52 -07:00
John MacFarlane
f97ec6db2c Markdown reader: Improved parsing of indented code in list items.
Indented code at the beginning of a list item must be indented eight
spaces from the margin (or from the edge of the container), or four
spaces past the list marker, whichever is farther.

Some examples in `tests/markdown-reader-more.txt`.
2014-08-12 11:10:48 -07:00
Jesse Rosenthal
45ec035e93 Docx reader: combine inlines properly in dropcaps.
Make sure that adjacent inlines are combined properly in dropcaps. This
updates the test results as well.
2014-08-11 23:31:16 -04:00
Jesse Rosenthal
0808449547 Docx: Add dropcap tests. 2014-08-11 23:10:50 -04:00
John MacFarlane
31811657fa Merge pull request #1521 from jkr/emptyEmph
Discard empty formatters
2014-08-11 14:44:08 -07:00
Jesse Rosenthal
241ef57bb2 Docx reader test: Add an emphasized space to normalize test.
This should be ignored, so the output should be the same as the previous
test.
2014-08-11 15:11:28 -04:00
John MacFarlane
6fae136cbb Textile reader: list and HTML block parsing improvements.
Closes #1513.

Lists can now start without an intervening blank line.
Also, html block-level tags that don't start a line are parsed
as RawInline and don't interrupt paragraphs, as in RedCloth.
2014-08-11 11:22:39 -07:00
Matthew Pickering
853830d12b Docx Parse: Updated tests 2014-08-11 10:30:32 -04:00
Matthew Pickering
f33ae631f3 Improved EPUB Tests
Rewrote features test to remove all unimplemented features.

There are now all three examples of where an image can be included in
the test.
  1. Cover image
  2. As a spine elemnt
  3. In the document

Tests have also been added to make sure that the mediabag contains all
these images after processing.
2014-08-10 14:58:53 +01:00
John MacFarlane
7ec8dd956f Removed OMath module, depend on texmath >= 0.8. 2014-08-10 06:19:41 -07:00
Matthew Pickering
ecb42cc002 Docx Tests: Updated for reading sym element 2014-08-09 22:37:12 -04:00
Matthew Pickering
5bedaba080 Added test for sym element 2014-08-09 22:37:12 -04:00
Matthew Pickering
d0fbe5b751 Updated EPUB tests 2014-08-09 23:06:16 +01:00
John MacFarlane
bc06ef0edb Merge branch 'newbranch' of https://github.com/mpickering/pandoc into mpickering-newbranch
Conflicts:
	src/Text/Pandoc/Readers/EPUB.hs
2014-08-08 22:22:55 -07:00
John MacFarlane
a4a6b6f28c Plain writer: Use ALL CAPS for level 1 headers. 2014-08-08 15:20:29 -07:00
Matthew Pickering
5b5e53024d Added tests for collapseFilePath 2014-08-08 22:31:02 +01:00
John MacFarlane
f723a0575d Markdown writer: Respect -raw_html.
pandoc -t markdown-raw_html should not emit any raw HTML, even
span and div tags that go with pandoc Span and Div elements.

Cleaned up a bit of the logic with extensions and plain.
2014-08-08 13:34:57 -07:00
John MacFarlane
7b47042ae6 Textile reader: fixed list parsing bug. Closes #1500. 2014-08-08 12:18:47 -07:00
John MacFarlane
10b662c120 EPUB test renaming.
Renamed epub test files so they're identified more clearly as
epub:  features.{epub,native} -> epub.features.{epub,native},
and similarly with formatting.{epub,native}.

Added epub test files to cabal file, so they'll be included in
the tarball.
2014-08-07 22:25:06 -07:00
John MacFarlane
94466c0060 HTML reader: Really ignore DOCTYPE and xml declarations.
This actually does what d71b013841
said it did.

Revised epub tests to remove the repeated DOCTYPE and xml tags.
2014-08-07 22:12:44 -07:00
John MacFarlane
3c4079edc8 Merge pull request #1488 from mpickering/epubfixes
EPUB Reader: Improved image extraction
2014-08-07 19:00:32 -07:00
Matthew Pickering
090b2da267 EPUB tests: Updated test file 2014-08-07 22:56:30 +01:00
Jesse Rosenthal
98d14b2b2a Docx reader: Test inline image code. 2014-08-07 15:34:49 -04:00
John MacFarlane
4630cff2a6 Merge branch 'epubend' of https://github.com/mpickering/pandoc into mpickering-epubend
Conflicts:
	pandoc.cabal
2014-08-04 07:36:18 -07:00
Artyom Kazak
ec88d47f23 Correctly implement capitalisation.
Using `map toUpper` to capitalise text is wrong, as e.g.
“Straße” should be converted to “STRASSE”, which is 1 character
longer. This commit adds a `capitalize` function and replaces
2 identical implementations in different modules (`toCaps` and
`capitalize`) with it.
2014-08-03 17:37:37 +04:00
John MacFarlane
1b9371cfdf Merge branch 'underline-option' of https://github.com/jkr/pandoc 2014-07-31 16:40:20 -07:00
Jesse Rosenthal
43ca784d1c Update docx test to interpret single underline as emph. 2014-07-31 18:46:43 -04:00
Matthew Pickering
0ae2c1f146 EPUB Reader: Added tests 2014-07-31 21:39:50 +01:00
Jesse Rosenthal
96ad37536e Remove now unneeded JSON test file. 2014-07-31 15:47:45 -04:00
Jesse Rosenthal
ed71e9b31d Docx tests: rewrite mediabag tests.
This will allow us to test the whole mediabag (making sure, for example,
that images are added with the correct keys) instead of just individual
extracted images. We compare each entry in the media bag to an image
extracted on the fly from the docx. As a result, we only need one file
to test with.

The image in the current tests was also replaced with a smaller one.
2014-07-31 15:47:45 -04:00
John MacFarlane
6dd2418476 New module, Text.Pandoc.MediaBag.
Moved `MediaBag` definition and functions from Shared:
`lookupMedia`, `mediaDirectory`, `insertMedia`, `extractMediaBag`.
Removed `emptyMediaBag`; use `mempty` instead, since `MediaBag`
is a Monoid.
2014-07-31 12:00:21 -07:00
John MacFarlane
00662faefb Made MediaBag a newtype, and added mime type information to media.
Shared now exports functions for interacting with a MediaBag:

- `emptyMediaBag`
- `lookuMedia`
- `insertMedia`
- `mediaDirectory`
- `extractMediaBag`
2014-07-31 11:05:35 -07:00
Jesse Rosenthal
4d1d8a4b6f Docx test: Test image from media bag. 2014-07-30 22:32:55 -04:00
Jesse Rosenthal
b24b328906 Docx tests: Add test image.
This is the cow image extracted from `docx.image.docx`.
2014-07-30 22:32:27 -04:00
Jesse Rosenthal
16f88edb3b Docx tests: Added media test comparison function.
Also tell pandoc.cabal that we'll be needing base64, since we want to
compare strings here.
2014-07-30 22:31:38 -04:00
John MacFarlane
3e26fb517d Updated RTF writer tests. 2014-07-30 15:30:51 -07:00
Jesse Rosenthal
941df1b0de Docx reader: change tests to make use of media bag. 2014-07-30 12:46:53 -04:00
John MacFarlane
8c2ed54e2e LaTeX writer: use \(..\) instead of $..$ for inline math.
Closes #1464.
2014-07-29 20:45:49 -07:00
John MacFarlane
8d4eebaff4 Merge pull request #1463 from jkr/metadata
Make metadata out of styled pars
2014-07-29 11:15:34 -07:00
Jesse Rosenthal
54708da371 Add and update docx tests in pandoc.cabal. 2014-07-29 13:05:19 -04:00
Jesse Rosenthal
840108a9c1 Docx reader: Make metavalues out of styled paragraphs.
This will make paragraphs styled with `Author`, `Title`, `Subtitle`,
`Date`, and `Abstract` into pandoc metavalues, rather than text. The
implementation only takes those elements from the beginning of the
document (ignoring empty paragraphs).

Multiple paragraphs in the `Author` style will be made into a metaList,
one paragraph per item. Hard linebreaks (shift-return) in the paragraph
will be maintained, and can be used for institution, email, etc.
2014-07-29 13:03:01 -04:00
John MacFarlane
c302ab3133 Markdown writer: More improvements to 'plain' output, updated tests.
Math now appears in unicode if possible, without the distracting
italics around identifiers.

Blank lines around headers are more consistent.

Footnotes appear in regular [n] style.
2014-07-27 07:57:23 -07:00
Matthew Pickering
e340a7da02 Txt2Tags Reader: Added tests 2014-07-27 00:12:57 +01:00
John MacFarlane
18f4490482 Fixed runtime error with compactify'DL on certain lists.
Closes #1452.  Added test.
2014-07-25 10:53:04 -07:00
John MacFarlane
9c3f7688ee DocBook reader: Better handle elements inside code environments.
Of course, we can't include structure in the code block, but
this way we at least preserve the text.  Closes #1449.
2014-07-23 10:06:36 -07:00
John MacFarlane
98c7ada061 HTML reader: parse Div and Span elements even without --parse-raw.
Closes #1434.
2014-07-20 21:43:54 -07:00
John MacFarlane
4af8eed764 Markdown reader: revised definition list syntax (closes #1429).
* This change brings pandoc's definition list syntax into alignment
  with that used in PHP markdown extra and multimarkdown (with the
  exception that pandoc is more flexible about the definition markers,
  allowing tildes as well as colons).

* Lazily wrapped definitions are now allowed; blank space is required
  between list items; and the space before definition is used to
  determine whether it is a paragraph or a "plain" element.

* For backwards compatibility, a new extension,
  `compact_definition_lists`, has been added that restores the behavior
  of pandoc 1.12.x, allowing tight definition lists with no blank space
  between items, and disallowing lazy wrapping.
2014-07-20 16:33:59 -07:00
John MacFarlane
87096c64f8 Org reader: text adjacent to a list yields a Plain, not Para.
This gives better results for tight lists.  Closes #1437.

An alternative solution would be to use Para everywhere, and
never Plain.  I am not sufficiently familiar with org to know
which is best.  Thoughts, @tarleb?
2014-07-20 12:56:01 -07:00
John MacFarlane
0f01421f81 AsciiDoc writer: Double markers in intraword emphasis.
Closes #1441.
2014-07-20 12:24:53 -07:00
Craig S. Bosma
1bb4f0c497 Org reader: Respect :exports header arguments on code blocks
Adds support to the org reader for conditionally exporting either the code block,
results block immediately following, both, or neither, depending on the value
of the `:exports` header argument. If no such argument is supplied, the default
org behavior (for most languages) of exporting code is used.
2014-07-17 10:23:22 -05:00
John MacFarlane
047f9b3714 Merge pull request #1430 from jkr/anchor-fix-2
Fix auto identified headers when already auto-id'ed
2014-07-15 20:27:28 -07:00
John MacFarlane
c24ab14918 LaTeX writer: Use \nolinkurl in email autolinks.
This allows them to be styled using `\urlstyle{tt}`.

Thanks to Ulrike Fischer for the solution.
2014-07-15 16:42:39 -07:00
Jesse Rosenthal
643435f1de Docx reader: Add test
Test auto ident header anchors with pandoc-generated pandoc.
2014-07-15 18:32:19 +01:00
John MacFarlane
3e95fd586d Use raw HTML for complex block quotes.
As far as I can see, dokuwiki markup is pretty limited in what
can go in a `>` block quote:  just a single line of paragraph
text.  (#1398)
2014-07-13 16:15:45 -07:00
John MacFarlane
81088281de DokuWiki writer: Use raw HTML for complex lists...
as in the mediawiki writer.  The dokuwiki markup isn't able
to handle multiple block-level items within a list item, except
in a few special cases (e.g. code blocks, and these must be started
on the same line as the preceding paragraph).  So we fall back to
raw HTML for these.

Perhaps there is a better solution.  We can "fake" multiple
paragraphs within list items using hard line breaks (`\\`), but
we must keep everything on one line.

(#1398)
2014-07-13 16:04:29 -07:00
John MacFarlane
0ba2f0b8f9 DokuWiki writer: Normalize to collapse adjacent raw HTML blocks. 2014-07-13 15:48:01 -07:00
John MacFarlane
15956fcac7 DokuWiki writer: Updated tests. 2014-07-13 15:45:59 -07:00
John MacFarlane
5df812f7eb Merge branch 'claremacrae-dokuwiki'.
Use removeFormatting from Shared instead of the custom unfancy
function.
2014-07-13 14:44:53 -07:00
John MacFarlane
ff86702a95 Added failing test for issue #1121. 2014-07-10 14:23:20 -07:00
John MacFarlane
66378062b6 LaTeX writer: Put table captions above tables.
The standard seems to be captions above tables.  (See
http://tex.stackexchange.com/questions/3243/why-should-a-table-caption-be-placed-above-the-table)
2014-07-10 13:06:41 -07:00
Clare Macrae
c7431283d6 DokuWiki writer: Remove broken formatting from headings (#1398) 2014-07-08 22:05:04 +01:00
John MacFarlane
d1ac594d4a Added test for issue #1330. 2014-07-07 22:27:28 -06:00
John MacFarlane
f96a2b91f5 Reorganized some markdown tests. 2014-07-07 22:21:04 -06:00
John MacFarlane
3d2f2ec0c6 Updated dokuwiki tests for latest changes to testsuite.native. 2014-07-07 16:25:41 -06:00
John MacFarlane
616cf6c539 Merge branch 'dokuwiki' of https://github.com/claremacrae/pandoc into claremacrae-dokuwiki 2014-07-07 16:15:35 -06:00
John MacFarlane
e4263d306e Revamped raw HTML block parsing in markdown.
- We no longer include trailing spaces and newlines in the
  raw blocks.
- We look for closing tags for elements (but without backtracking).
- Each block-level tag is its own RawBlock; we no longer try to
  consolidate them (though `--normalize` will do so).

Closes #1330.
2014-07-07 15:53:59 -06:00
Clare Macrae
5e25bff392 Revert "DokuWiki writer: Whitespace to a testsuite output file."
This reverts commit 23d71b13e7.

This is now resulting in a testsuite failure, and I can't see why
it didn't do so before
2014-07-02 22:48:04 +01:00
Clare Macrae
0c6f06b8a4 DokuWiki writer: Span no longer swallows text 2014-07-02 22:40:34 +01:00
Clare Macrae
7647d87657 DokuWiki writer: Add new test showing that span swallows content. 2014-07-02 22:26:11 +01:00
Clare Macrae
23d71b13e7 DokuWiki writer: Whitespace to a testsuite output file.
This doesn't change the testsuite behaviour, but it does mean that
all the testsuite output files are exactly identical to the 
output obtained by running the current pandoc.
2014-07-02 22:10:20 +01:00
Clare Macrae
61cc983bea DokuWiki writer: Retain unknown RawBlock and RawInline text
This added \cite and \begin latex to the testuite output.
2014-07-02 21:40:12 +01:00
Clare Macrae
d234157d25 DokuWiki output: Implement blockquotes properly
TODO Also implement nested blockquotes.
2014-07-02 21:26:24 +01:00
Clare Macrae
3cb76d9560 Merge branch 'master' of git://github.com/jgm/pandoc into dokuwiki 2014-07-01 22:10:08 +01:00
Clare Macrae
244c4eee74 Remove stray <div> and </div> from DokuWiki output (#386) 2014-07-01 21:42:21 +01:00
Clare Macrae
0727579167 Improved HTML Blocks in DokuWiki output (#386)
For example, this fixes the display of a broken table, and 
it also fixes the various  HTML horizontal rules.
2014-07-01 21:21:09 +01:00
John MacFarlane
3fbbafd391 Rewrote normalize for efficiency. (Closes #1385.)
* Added normalizeInlines, normalizeBlocks.
* Type signature is now more narrow, `Pandoc -> Pandoc` instead of
  `Data a :: a -> a`.  Some users may need to change their uses of
  `normalize` to the newly exported `normalizeInlines` or
  `normalizeBlocks`.
2014-06-29 23:05:08 -07:00
Jesse Rosenthal
1405e7b709 Docx reader: Add tests for hanging indent handline.
We want to treat it as a plain paragraph if the hanging amount is
greater to or equal to the left indent---i.e., if the first line has
zero indentation. But we still want it to be a block quote if it starts
to the right of the margin. Someone might format verse with wrapping
lines with a hanging indent, for example.
2014-06-29 23:37:00 -04:00
Clare Macrae
fdbf52b1cc Updated DokuWiki code and tests to work with latest code from jgm.
The new code was got from inspecting changes in MediaWiki.hs

This slightly changes the output of Div blocks, but I'm not 
convinced the original behaviour was really correct anyway.

The code for handling Span does nothing for now, until I can 
work out the desired behaviour, and add tests for it.
2014-06-29 21:15:17 +01:00
Clare Macrae
717e16660d Merge remote-tracking branch 'jgm/master' into dokuwiki 2014-06-29 19:22:31 +01:00
Jesse Rosenthal
7fb74d88fb Update docx tests to reflect new expected behavior
Now doing auto ids for all headers, so tests should reflect that.
2014-06-28 17:47:00 -04:00
Jesse Rosenthal
b152145d6d Change test result to match new behavior. 2014-06-28 04:00:17 -04:00
Jesse Rosenthal
afdc0af779 Track changes tests. 2014-06-25 16:13:59 -04:00
Jesse Rosenthal
a2b6ab847c Docx reader: Add tests for basic track changes
This is what seems like the sensible default: read in insertions, and
ignore deletions. In the future, it would be good if options were
available for either taking in deletions or keeping both in some
scriptable format.
2014-06-25 11:09:28 -04:00
Jesse Rosenthal
2621482d69 Docx Reader: add failing defintion list tests. 2014-06-24 12:11:57 -04:00
Jesse Rosenthal
21295c5ab5 Docx reader: add failing tests for inline code and code blocks. 2014-06-24 10:33:49 -04:00
John MacFarlane
ac6756009f Merge pull request #1366 from jkr/reducible3
Docx rewrite and cleanup (in terms of Reducible typeclass)
2014-06-23 14:33:38 -07:00
Jesse Rosenthal
9b954fa855 Add test for correctly trimming spaces in formatting.
This used to be fixed in the tree-walking. We need to make sure we're doing it
right now.
2014-06-23 17:08:26 -04:00
John MacFarlane
87ab01637e LaTeX writer: Use \textquotesingle for ' in inline code.
Otherwise we get curly quotes in the PDF output.
Closes #1364.
2014-06-23 12:51:10 -07:00
Jesse Rosenthal
ed43513087 Docx reader tests: add tests for normalization deep in blocks. 2014-06-22 01:58:41 -04:00
Jesse Rosenthal
b3df3a3861 Docx reader tests: Correct normalize test. 2014-06-22 01:56:33 -04:00
Jesse Rosenthal
ca4add679c Add normalization test.
Add torture-test for new normalization functions.

One problem that this test demonstrates is that word has a tendency to
turn off formatting at a space, and then turn it back on after. I'm not
sure yet whether this is something we should fix.
2014-06-22 00:46:19 -04:00
Jesse Rosenthal
a4508d7fcf Docx reader tests: Introduce NoNormPandoc type.
This is just a wrapper around Pandoc that doesn't normalize with
`toString`. We want to make sure that our own normalization process
works. If, in the future, we are able to hook into the builder's
normalization, this will be removed.
2014-06-20 18:37:52 -04:00
John MacFarlane
12efffa85a LaTeX writer: Fixed strikeout + highlighted code. Closes #1294.
Previously strikeout highlighted code caused an error.
2014-06-20 10:24:30 -07:00
Jesse Rosenthal
da0d1d27ac Add tabs tests. 2014-06-19 19:33:22 -04:00
Jesse Rosenthal
d19996d743 Fix notes test.
This previously allowed spaces at the beginning of a paragraph.
2014-06-19 19:29:59 -04:00
Jesse Rosenthal
ceb742b124 Add ReaderOptions to the docx tests
This will allow for testing different media embedding (in addition to
any other applicable options.)
2014-06-19 12:16:53 -04:00
John MacFarlane
00281559bf Haddock writer: Use _____ for hrule.
Avoids interpretation as list.
2014-06-19 00:28:23 -07:00
John MacFarlane
95b6ffcef6 Updated haddock writer tests. 2014-06-18 18:11:08 -07:00
John MacFarlane
c4182b39ca Small fix to haddock "tables". 2014-06-18 18:08:41 -07:00
John MacFarlane
bc037b69a4 Revised haddock reader tests for changes in reader. 2014-06-18 18:04:08 -07:00
John MacFarlane
cf15b929f8 Added haddock writer tests. 2014-06-18 17:55:21 -07:00
John MacFarlane
9fc5c8d7af Rewrote haddock reader to use haddock-library.
This brings pandoc's rendering of haddock markup in line
with the new haddock.

Note that we preserve line breaks in `@` code blocks, unlike
the earlier version.

Modified tests pass.  More tests would be good.
2014-06-18 14:18:55 -07:00
John MacFarlane
bbe99003f8 Naming: Use Docx instead of DocX.
For consistency with the existing writer.
2014-06-16 22:44:40 -07:00
John MacFarlane
bec9f3c641 Merge branch 'docx' of https://github.com/jkr/pandoc into jkr-docx 2014-06-16 22:16:45 -07:00
John MacFarlane
78ee2416d1 Org reader: make tildes create inline code.
Closes #1345.  Also relabeled 'code' and 'verbatim' parsers
to accord with the org-mode manual.

I'm not sure what the distinction between code and verbatim
is supposed to be, but I'm pretty sure both should be represented
as Code inlines in pandoc.  The previous behavior resulted in the
text not appearing in any output format.
2014-06-16 22:03:26 -07:00
John MacFarlane
e7d6b2e6ad Updated HTML reader table test - should be simple table. 2014-06-16 15:15:35 -07:00
John MacFarlane
9090c549aa Added failing HTML reader test for table.
See #1341.
2014-06-16 15:12:10 -07:00
Jesse Rosenthal
6b939134e7 Add DocX tests to test-pandoc.hs 2014-06-16 07:18:52 -04:00
Jesse Rosenthal
f928e4c8dc Add DocX automated tests.
Note this makes use of input and output files in the tests/ dir.
2014-06-16 07:18:40 -04:00
John MacFarlane
0bd8d5f86b Updated tests for c8bc70a6bb. 2014-06-01 23:39:15 -07:00
John MacFarlane
e656658af8 Merge pull request #1302 from tarleb/inline-latex
Org reader: support for inline LaTeX
2014-05-28 09:26:48 -07:00
John MacFarlane
2e80613451 Markdown reader: inline math must have nonspace before final $.
Closes #1313.
2014-05-27 11:59:28 -07:00
Albert Krewinkel
3238a2f919 Org reader: support for inline LaTeX
Inline LaTeX is now accepted and parsed by the org-mode reader.  Both,
math symbols (like \tau) and LaTeX commands (like \cite{Coffee}), can be
used without any further escaping.
2014-05-20 22:29:21 +02:00
Albert Krewinkel
ceeb701c25 Org reader: support Pandocs citation extension
Citations are defined via the "normal citation" syntax used in markdown,
with the sole difference that newlines are not allowed between "[...]".
This is for consistency, as org-mode generally disallows newlines
between square brackets.

The extension is turned on by default and can be turned off via the
default syntax-extension mechanism, i.e. by specifying "org-citation" as
the input format.
Move `citeKey` from Readers.Markdown into Parsing

The function can be used by other readers, so it is made accessible for
all parsers.
2014-05-14 15:00:26 +02:00
Albert Krewinkel
c5fd631b55 Org reader: Fix block parameter reader, relax constraints
The reader produced wrong results for block containing non-letter chars
in their parameter arguments.  This patch relaxes constraints in that it
allows block header arguments to contain any non-space character (except
for ']' for inline blocks).

Thanks to Xiao Hanyu for noticing this.
2014-05-10 11:35:54 +02:00
Albert Krewinkel
07694b3018 Org reader: Fix parsing of blank lines within blocks
Blank lines were parsed as two newlines instead of just one.
Thanks to Xiao Hanyu (@xiaohanyu) for pointing this out.
2014-05-09 18:23:23 +02:00
Albert Krewinkel
757c4f68f3 Org reader: Support arguments for code blocks
The general form of source block headers
(`#+BEGIN_SRC <language> <switches> <header arguments>`) was not
recognized by the reader.  This patch adds support for the above form,
adds header arguments to the block's key-value pairs and marks the block
as a rundoc block if header arguments are present.

This closes #1286.
2014-05-09 18:08:30 +02:00
John MacFarlane
e7b42947bf Updated tests for template changes. 2014-05-06 20:20:28 -07:00
Albert Krewinkel
71bd4fb2b3 Org reader: Read inline code blocks
Org's inline code blocks take forms like `src_haskell(print "hi")` and
are frequently used to include results from computations called from
within the document.  The blocks are read as inline code and marked with
the special class `rundoc-block`.  Proper handling and execution of
these blocks is the subject of a separate library, rundoc, which is
work in progress.

This closes #1278.
2014-05-06 13:21:26 +02:00
John MacFarlane
1e50424892 Added test for #1154. 2014-05-04 08:19:48 -07:00
John MacFarlane
6b532c2131 Added Tests.Writer.AsciiDoc to repository. 2014-05-03 22:33:36 -07:00
John MacFarlane
41c89d51c7 AsciiDoc writer: Added test for empty table cells. 2014-05-03 21:24:20 -07:00
John MacFarlane
abd3a039b9 DocBook writer: Small tweaks to last commit.
* Use isTightList from Shared.
* Adjust writer test, since isTightList is a bit different from what
  was used before.

Closes #1250.
2014-05-03 20:45:38 -07:00
Neil Mayhew
ccbf4fc9c2 Distinguish tight and loose lists in Docbook output
Determined by the first block of the first item being Plain.
2014-05-03 18:37:02 -07:00
John MacFarlane
4c43824203 Fixed empty reference links. Closes #1186.
Includes test.
2014-05-02 22:58:47 -07:00
John MacFarlane
007eb96e06 Markdown reader: Make one-column pipe tables work.
Closes #1218.
2014-05-01 09:23:21 -07:00
John MacFarlane
b306405caa Merge pull request #1272 from tarleb/link-types
Org reader: add support for custom link types
2014-05-01 08:44:05 -07:00
Albert Krewinkel
8726eebcd3 Org reader: Add support for custom link types
Org allows users to define their own custom link types.  E.g., in a
document with a lot of links to Wikipedia articles, one can define a
custom wikipedia link-type via

    #+LINK: wp https://en.wikipedia.org/wiki/

This allows to write [[wp:Org_mode][Org-mode]] instead of the
equivallent [[https://en.wikipedia.org/wiki/Org_mode][Org-mode]].
2014-05-01 11:50:32 +02:00