Commit graph

969 commits

Author SHA1 Message Date
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
John MacFarlane
ac104c4fdb Updated tests for new LaTeX template. 2014-04-30 23:29:10 -07:00
John MacFarlane
eaba340b93 RST reader: Some fixes to last change, and use "author" not "authors".
(in metadata)
2014-04-30 11:28:18 -07:00
John MacFarlane
093229dc35 ConTeXt writer: Improved autolinks.
Closes #1270.
2014-04-30 08:58:10 -07:00
John MacFarlane
f8a34f1694 Added Cite to Arbitrary instance.
See #1269.  This reveals some test failures.
2014-04-29 18:32:42 -07:00
John MacFarlane
b6ae5d5e99 ADded SmallCaps to Arbitrary instance. 2014-04-29 18:14:39 -07:00
John MacFarlane
f81fc6c3bd Update latex reader test for change in latex reader.
We use 'author' for metadata, not 'authors'.
2014-04-26 12:32:22 -07:00
John MacFarlane
60297089f6 Merge pull request #1265 from tarleb/org-links
Improvements handling of internal links
2014-04-25 08:08:00 -07:00
Albert Krewinkel
2eec20d92f Org reader: Enable internal links
Internal links in Org are possible by using an anchor-name as the target
of a link:

[[some-anchor][This]] is an internal link.

It links <<some-anchor>> here.
2014-04-25 15:29:28 +02:00
John MacFarlane
e6333a9d7c Markdown writer: Use proper escapes to avoid unwanted lists.
Previously we used 0-width spaces, an ugly hack.

Closes #980.
2014-04-24 16:44:49 -07:00
Albert Krewinkel
c128daba9d Org reader: Recognize plain and angle links
This adds support for plain links (like http://zeitlens.com) and angle
links (like <http://moltkeplatz.de>).
2014-04-24 17:55:24 +02:00
Albert Krewinkel
8276449520 Org reader: Allow for compact definition lists
Use `Text.Pandoc.Shared.compactify'DL` to allow for compact definition
lists.
2014-04-19 15:13:16 +02:00
Albert Krewinkel
8e91d362a3 Org reader: Fix parsing of footnotes
Footnotes can consist of multiple blocks and end only at a header or at
the beginning of another footnote.  This fixes the previous behavior,
which restricted notes to a single paragraph.
2014-04-19 14:40:46 +02:00
Albert Krewinkel
6ded3d41d9 Org reader: Apply captions to code blocks and tables
The `Table` blocktype already takes the caption as an argument, while code
blocks are wrapped in a `Div` block together with a labelling `Span`.
2014-04-19 10:41:45 +02:00
Albert Krewinkel
09441b65a8 Org reader: Add support for plain LaTeX fragments
This adds support for LaTeX fragments like the following:

```
\begin{equation}
\int fg \mathrm{d}x
\end{equation}
```
2014-04-18 10:22:54 +02:00