Commit graph

1184 commits

Author SHA1 Message Date
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
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
Albert Krewinkel
f19d7233d8 Org reader: Fix parsing of loose lists
Loose lists (i.e. lists with blankline separated items), were parsed as
multiple lists, each containing a single item.  This patch fixes this
issue.
2014-04-18 08:34:06 +02:00
Albert Krewinkel
6d6724cf2c Org reader: Support more types of '#+BEGIN_<type>' blocks
Support for standard org-blocks is improved.  The parser now handles
"HTML", "LATEX", "ASCII", "EXAMPLE", "QUOTE" and "VERSE" blocks in a
sensible fashion.
2014-04-17 18:33:39 +02:00
Albert Krewinkel
0672f58a44 Org reader: Support footnotes 2014-04-17 13:23:14 +02:00
John MacFarlane
857fcff7d6 Merge pull request #1240 from neilmayhew/master
Docbook output of Line Blocks
2014-04-13 14:37:28 -07:00
John MacFarlane
86b4da9dec Merge pull request #1239 from tarleb/org-linebreak
Org linebreaks
2014-04-13 14:04:48 -07:00
Neil Mayhew
f22ce4ff28 Add some unit tests for Writers.Docbook
These are primarily aimed at testing the new treatment of line breaks,
but hopefully other tests can be added more easily now as features
and changes are implemented in the writer.

Adapted from Tests.Writers.HTML.tests.
2014-04-12 09:18:09 -06:00
Neil Mayhew
464d7a8e49 Improve handling of hard line breaks in Docbook writer
* Use a <literallayout> for the entire paragraph, not just for the
   newline character
 * Don't let LineBreaks inside footnotes influence the enclosing
   paragraph
2014-04-12 09:16:07 -06:00
Albert Krewinkel
82d4160bdc Org reader: Read linebreaks
Linebreaks are marked by the string `\\` at the end of a line.
2014-04-12 11:07:38 +02:00
Albert Krewinkel
36066699c3 Org writer: Fix output for linebreaks
Hard linebreaks in Org mode are represented by the string "\\" as the
last characters in a line.  Adds this feature to the Org-mode writer.
2014-04-12 10:47:49 +02:00
Albert Krewinkel
ae4280fba5 Org reader: Add support for figures
Support for figures (images with name and caption) is added.
2014-04-12 10:31:45 +02:00
Albert Krewinkel
6f19be7d40 Org reader: Fix parsing of sub-/superscript expressions
This fixes the org-reader's handling of sub- and superscript
expressions.  Simple expressions (like `2^+10`), expressions in
parentheses (`a_(n+1)`) and nested sexp (like `a_(nested()parens)`) are
now read correctly.
2014-04-11 11:05:42 +02:00
Albert Krewinkel
1715d7cee0 Org reader: Support more inline/display math variants
Support all of the following variants as valid ways to define inline or
display math inlines:

  - `\[..\]` (display)
  - `$$..$$` (display)
  - `\(..\)` (inline)
  - `$..$`   (inline)

This closes #1223.  Again.
2014-04-10 15:32:02 +02:00
Albert Krewinkel
030020236c Org reader: Precise rules for the recognition of markup
The inline parsers have been rewritten using the org source code as a
reference. This fixes a couple of bugs related to erroneous markup
recognition.
2014-04-09 15:26:06 +02:00
Albert Krewinkel
c47bd8404f Org reader: Support inline math (like $E=mc^2$)
Closes #1223.
2014-04-07 11:47:36 +02:00
Albert Krewinkel
480b33b710 Org reader: Add support for definition lists 2014-04-06 20:39:10 +02:00
John MacFarlane
24f438aa5f Textile reader: Better support for attributes.
Instead of being ignored, attributes are now parsed and
included in Span inlines.

The output will be a bit different from stock textile:
e.g. for `*(foo)hi*`, we'll get `<em><span class="foo">hi</span></em>`
instead of `<em class="foo">hi</em>`.  But at least the data is
not lost.
2014-04-05 21:02:12 -07:00
John MacFarlane
060a76a38e Textile reader: Improved treatment of HTML spans (%).
Closes #1115.
2014-04-05 20:41:38 -07:00
John MacFarlane
971dca588e Merge pull request #1219 from tarleb/org-images
Org-reader: support inline images, clean-up code, fix bugs
2014-04-05 15:12:40 -07:00
Albert Krewinkel
652c781e37 Org reader: Support inline images 2014-04-05 16:15:53 +02:00
Albert Krewinkel
fd98532784 Org reader: Fix parsing of nested inlines
Text such as /*this*/ was not correctly parsed as a strong, emphasised
word.  This was due to the end-of-word recognition being to strict as it
did not accept markup chars as part of a word.  The fix involves an
additional parser state field, listing the markup chars which might be
parsed as part of a word.
2014-04-05 16:14:40 +02:00
John MacFarlane
25763a8a35 DocBook reader/writer tests: use "authorgroup". 2014-04-04 21:41:44 -07:00
John MacFarlane
4ee92dce0c MediaWiki reader: Fixed bug in certain nested lists.
The bug: If a level 2 list was followed by a level 1 list, the first
item of the level 1 list would be lost.

Closes #1213.
2014-04-01 10:36:23 -07:00
John MacFarlane
976f4f2d8f Added HTML reader tests for empty strong, emph. 2014-04-01 10:15:21 -07:00
Matthew Pickering
90269cb213 Tests updated to reflect changes to readers.
Previously normalisation was handled by the `normalizeSpaces` function. The behavoir of the builder monoid is slightly different and melds together more items such as consecutive strings and spaces adjacent to line breaks. The tests have been changed to reflect this.

All relevant tests passed when the string melding line of the builder monoid was commented out.
2014-04-01 13:53:34 +01:00
John MacFarlane
d7fbc40dff RTF writer: Fixed tables cells containing paragraphs.
This moves \intbl after \pard.
2014-03-24 15:12:32 -07:00
John MacFarlane
b9cc29e15a Merge pull request #1068 from jaimeMF/mw-images-langs
MediaWiki reader: Accept image links in more languages
2014-03-24 10:39:49 -07:00
John MacFarlane
f3c9d37885 HTML writer: Add colgroup around col tags.
Also affects EPUB writer.
Closes #877.
2014-03-05 13:01:23 -08:00
John MacFarlane
ae86e24ff6 Merge branch 'master' of https://github.com/mb21/pandoc into mb21-master 2014-03-04 10:15:43 -08:00
Albert Krewinkel
24b2ac43b0 Add a simple Emacs Org-mode reader
The basic structure of org-mode documents is recognized; however,
org-mode features like todo markers, tags etc. are not supported yet.
2014-03-04 10:40:40 +01:00
mb21
80511f1b34 InDesign ICML Writer 2014-02-28 13:35:35 +01:00
John MacFarlane
b677ce0663 Revised tests for new latex template. 2014-02-20 09:43:02 -08:00
Merijn Verstraaten
fe246ce01c Enhanced Pandoc's support for rST roles.
rST parser now supports:
    - All built-in rST roles
    - New role definition
    - Role inheritance

Issues/TODO:
    - Silently ignores illegal fields on roles
    - Silently drops class annotations for roles
    - Only supports :format: fields with a single format for :raw: roles,
      requires a change to Text.Pandoc.Definition.Format to support multiple
      formats.
    - Allows direct use of :raw: role, rST only allows indirect (i.e.,
      inherited use of :raw:).
2014-02-15 17:51:33 +01:00
Vaclav Zeman
08d80809c2
Update tests suite to expect \texorpdfstring. 2014-02-13 00:03:54 +01:00
John MacFarlane
9f3b2f6f5d Fixed mediawiki ordered list parsing.
Closes #1122.
2014-01-22 22:07:13 -08:00
John MacFarlane
3cad665afb Updated tests for latest texmath. 2014-01-07 23:35:30 -08:00
John MacFarlane
f3ee82373b HTML reader: Parse name/content pairs from meta tags as metadata.
Closes #1106.
2014-01-01 09:22:37 -08:00
John MacFarlane
8e79bbde1e Removed old MarkdownTest_1.0.3 directory (not currently used).
Closes #1104.
2013-12-27 13:36:28 -08:00
Henry de Valence
f6d151889c HLint: redundant parens
Remove parens enclosing a single element.
2013-12-19 20:43:25 -05:00
Henry de Valence
c35f5ba42d HLint: Remove lambdas. 2013-12-19 20:28:53 -05:00
John MacFarlane
f966295770 Don't use tilde code blocks with braced attributes in gfm output.
A consequence of this change is that the backtick form will be
preferred in general if both are enabled.  I think that is good,
as it is much more widespread than the tilde form.

Closes #1084.
2013-12-09 20:31:47 -08:00
John MacFarlane
bc2c0fd443 Small change to HTML reader tests.
"$" is now a special character.
2013-12-06 17:33:29 -08:00
Jose Luis Duran
fdaeec0c48 Add booktabs package for LaTeX tables
[ci skip]
2013-12-04 04:26:22 +00:00
John MacFarlane
7f09c1834d Markdown writer: Fix rendering of tight sublists.
E.g.

    - foo
        - bar
    - baz

Previously a spurious blank line was included before the last item.
Closes #1050.
2013-11-30 17:59:28 -08:00
John MacFarlane
7aa4d51968 ODT writer: Add draw:name attribute to draw:frame elements.
This is reported to be necessary to avoid an error from recent
versions of Libre Office when files contain more than one image.

Closes #1069.

Thanks to wmanley for reporting and diagnosing the problem.
2013-11-30 17:00:58 -08:00
John MacFarlane
dde484f809 Fixed tests for new ConTeXt writer behavior. 2013-11-30 16:34:32 -08:00
Jaime Marquínez Ferrándiz
303e42a94f MediaWiki reader: Accept image links in more languages
In some of the Wikipedia versions the local version of 'File' is used (for example 'Archivo' in Spanish)
2013-11-24 15:28:57 +01:00
John MacFarlane
526762bf22 ConTeXt writer: Use setupcaption to separate style from content.
Instead of adding 'nunumber' every time we place a figure...

Closes #1067.
2013-11-22 19:51:07 -08:00
John MacFarlane
cf149fcf38 Fixed bug with intraword emphasis.
Closes #1066.
2013-11-22 19:41:08 -08:00
John MacFarlane
a3eba6ee84 LaTeX reader: Parse contents of curly quotes or matched " as quotes. 2013-11-18 20:28:27 -08:00
John MacFarlane
0fd2176e29 MediaWiki reader: Add automatic header identifiers. 2013-11-17 08:47:14 -08:00
John MacFarlane
b4441c940d HTML/EPUB footnotes: Put <sup> tag inside <a> tags.
This allows better control of formatting, since the `<a>`
tags have a distinguishing class.

Closes #1049.
2013-11-12 18:48:06 -08:00
John MacFarlane
0d95c15e83 TexMath: Export readTeXMath', which attends to display/inline.
Deprecate readTeXMath, and use readTeXMath' in all the writers.
Require texmath >= 0.6.5.
2013-11-01 14:28:24 -07:00
John MacFarlane
e63aafd620 Fix definition lists with internal links in terms (closes #1032).
This fix puts braces around a term that contains an internal
link, to avoid problems with square brackets.
2013-10-21 17:33:42 -07:00
John MacFarlane
9d6bca06ee Pass the buildDir as first argument to test suite.
Allows test suite to work with cabal sandboxes.
Previously we hard-coded the build directory.
2013-10-20 12:36:26 -07:00
John MacFarlane
e5feed00f7 MediaWiki reader: Trim contents of <math> tags.
Otherwise we get problems when converting to markdown.

Closes #1027.
2013-10-18 17:50:43 -07:00
John MacFarlane
a117a88137 Updated opendocument tests. 2013-09-24 18:41:46 -07:00
John MacFarlane
21f1bcb280 Markdown reader: unresolved citations fall back to original text.
Not ???.

Reason:  Less surprising, especially for people using @ as
in twitter.
2013-09-14 22:28:37 -07:00
John MacFarlane
71841de0f3 Mediawiki: Parse an image + caption in a para by itself as a figure. 2013-09-11 09:31:41 -07:00
John MacFarlane
8d43e08ce7 Markdown writer: Fixed bugs in YAML header output. 2013-09-06 22:26:38 -07:00
John MacFarlane
9b0b9b6e03 Markdown reader: Don't autolink a bare URI that is followed by </a>.
Closes #937.
2013-09-01 15:18:56 -07:00
John MacFarlane
90c49b0aae Use registerHeader in Textile reader.
This produces automatic header identifiers, unless `auto_identifiers`
extension is disabled.

Closes #967.
2013-09-01 09:22:55 -07:00
John MacFarlane
9282f63278 Use registerHeader in RST and LaTeX readers.
This will give automatic unique identifiers, unless
`-auto_identifiers` is specified.
2013-09-01 09:13:31 -07:00
claremacrae
78ae3c2492 Implement definition lists in dokuwiki writer (#386) - credit: James Smaldon 2013-08-28 08:09:42 +01:00
John MacFarlane
4e4c948b41 Added markdown citation parsing test. 2013-08-26 22:30:27 -07:00
John MacFarlane
e7a4bcc6fe Merge pull request #961 from nougad/add_latex_listings_label
Write id for code block to label attr in latex when listing is used
2013-08-25 20:48:38 -07:00
John MacFarlane
152d2919ab Removed tests relating to citation processing. 2013-08-25 07:41:37 -07:00
John MacFarlane
deb59b6235 Removed dependency on citeproc-hs.
Going forward we'll use pandoc-citeproc, as an external filter.

The `--bibliography`, `--csl`, and `--citation-abbreviation` fields
have been removed.  Instead one must include `bibliography`, `csl`,
or `csl-abbrevs` fields in the document's YAML metadata.  The filter
can then be used as follows:

    pandoc --filter pandoc-citeproc

The `Text.Pandoc.Biblio` module has been removed.  Henceforth,
`Text.CSL.Pandoc` from pandoc-citations can be used by library users.

The Markdown and LaTeX readers now longer format bibliographies and
citations.  That must be done using `processCites` or `processCites'`
from Text.CSL.Pandoc.

All bibliography-related fields have been removed from `ReaderOptions`
and `WriterOptions`: `writerBiblioFiles`, `readerReferences`,
`readerCitationStyle`.

API change.
2013-08-24 22:33:01 -07:00
claremacrae
fe1040d283 Added failing test for definition list output in dokuwiki writer (#386) 2013-08-23 08:26:07 +01:00
Florian Eitel
5f09cf7ff0 Write id for code block to label attr in latex when listing is used
The code:

    ~~~{#test}
    asdf
    ~~~

gets compiled to html:

    <pre id="test">
    asdf
    </pre>

So it is possible to link to the identifier `test`

But this doesn't happen on latex

When using the listings package (`--listings`) it is possible to set the
identifier using the `label=test` property:

    \begin{lstlisting}[label=id]
    hi
    \end{lstlisting}

And this is exactly what this patch is doing.

Modified LaTeX Reader/Writer and added tests for this.
2013-08-22 20:15:36 +02:00
John MacFarlane
b1d08a8aa8 Merge branch 'altcite' 2013-08-20 22:00:39 -07:00
John MacFarlane
7048c130ec Create Cite element even if no matching reference in the biblio.
* Add ??? as fallback text for non-resolved citations.
* Biblio:  Put references (including a header at the end of
  the document, if one exists) inside a Div with class "references".
  This gives some control over styling of references, and allows
  scripts to manipulate them.
* Markdown writer:  Print markdown citation codes, and disable
  printing of references, if `citations` extension is enabled.

NOTE:  It would be good to improve what citeproc-hs does for
a nonexistent key.
2013-08-20 20:47:06 -07:00
John MacFarlane
e8ddcfd997 Scale LaTeX tables so they don't exceed columnwidth. 2013-08-19 16:03:22 -07:00
claremacrae
6cc284cc8e Bullet and ordered lists now always simple in dokuwiki writer (#386) 2013-08-19 20:45:31 +01:00
claremacrae
883f119c87 Removed unnecessary line-break after hard break in dokuwiki writer (#386) 2013-08-19 08:09:52 +01:00
John MacFarlane
8d441af3da Adjusted writers and tests for change in parsing of div/span.
Textile, MediaWiki, Markdown, Org, RST will emit raw HTML div tags for divs.
Otherwise Div and Span are "transparent" block containers.
2013-08-18 14:36:40 -07:00
claremacrae
288329044a Stop plain text ** and __ becoming formatting in dokuwiki writer (#386) 2013-08-18 09:15:33 +01:00
claremacrae
b5b622f5b8 Stop plain text // becoming an italic marker in dokuwiki writer (#386)
When the original document had text containing //, this was previously
included, unchanged, in the dokuwiki output, and this interacted badly
with later, intended, formating text.
2013-08-18 08:57:32 +01:00
claremacrae
6d484bc55e Treat inline code blocks like <code> instead of <tt> in dokuwiki writer (#386)
Done because I noticed that in the Autolinks section of writer.dokuwiki, the URL in inlined code was getting auto-linked, when it wasn't supposed to.

This also meant that any inline code examples that had text that looked like dokuwiki syntax could break the formatting of later text.
2013-08-18 08:13:34 +01:00
claremacrae
2a4bbe5d4f Nasty hack to stop C comments in inline code becoming italics in dokuwiki writer (#386) 2013-08-17 22:28:07 +01:00
claremacrae
84c2c5f01d Add more tests for dokuwiki writer (#386) 2013-08-17 19:03:58 +01:00
claremacrae
2ae2fcde2f Add extra pair of test files for dokuwiki writer (#386)
I've found some incorrect behaviours with the dokuwiki output, for which
extra test cases will be needed - that aren't covered by the standard 
pandoc test input files.
2013-08-17 18:53:01 +01:00
claremacrae
0961d49912 Fixed inlined code in dokuwiki writer (#386) 2013-08-17 12:34:05 +01:00
claremacrae
4c48433a2a Don't add entities in <code> blocks in dokuwiki writer (#386) 2013-08-17 12:20:34 +01:00
claremacrae
573bd1b61b Implement <code> blocks in dokuwiki writer (#386) 2013-08-17 11:20:51 +01:00
claremacrae
eb4fe5e82c Implement table headings in dokuwiki writer (#386) 2013-08-17 08:48:29 +01:00
John MacFarlane
441a7aebf8 LaTeX writer: Avoid problem with footnotes in unnumbered headers.
Closes #940.
Added test case.
2013-08-16 13:03:38 -07:00
John MacFarlane
309024971c Updated tests for latest pandoc-types changes. 2013-08-16 12:25:21 -07:00
John MacFarlane
3e8bd8aa15 Updated for removed unMeta, unFormat in pandoc-types. 2013-08-14 23:24:45 -07:00
John MacFarlane
eb0c0b86ed ODT/OpenDocument writer: Minor changes for ODF 1.2 conformance.
See #939.  We leave the nonconforming contextual-spacing attribute,
which is provided by LibreOffice itself and seems to be supported.
2013-08-11 17:13:46 -07:00
claremacrae
48645a4755 Initial implementation of tables in dokuwiki writer (#386)
Todo: alignment, and headings
2013-08-11 22:22:07 +01:00
John MacFarlane
6f736dfa75 Added Tests.Walk.
This verifies that walk and query match the generic traversals.
2013-08-10 19:04:15 -07:00
John MacFarlane
210d7b7bce Updated tests for new Format. 2013-08-10 17:53:11 -07:00
John MacFarlane
cbfa932106 Adjustments for new Format newtype. 2013-08-10 17:24:54 -07:00
claremacrae
e5004bcff0 Implement strikeout in dokuwiki writer (#386) 2013-08-06 07:43:32 +01:00
John MacFarlane
4a84b78100 MediaWiki writer: Use native mediawiki tables instead of HTML.
Closes #720.
2013-08-03 23:05:14 -07:00
claremacrae
b14b2d6a85 Implement footnotes in dokuwiki writer (#386) 2013-07-28 19:19:33 +01:00
claremacrae
b5f86a665d Removed incorrect entity conversion in dokuwiki writer (#386) 2013-07-28 18:59:16 +01:00
claremacrae
51b8ce49f1 Implemented linebreaks in dokuwiki writer (#386) 2013-07-28 18:42:53 +01:00
Clare Macrae
5b04d063a1 Convert bullet and numbered lists in dokuwiki writer (#386) 2013-07-26 06:19:40 +01:00
Clare Macrae
97d81c8b10 Corrected part of the failing test for lists in dokuwiki writer (#386) 2013-07-26 05:10:05 +01:00
John MacFarlane
85cc140744 Textile reader: Improved handling of <pre> blocks.
* Closed #927 (a bug in which `<pre>` in certain contexts was
  not recognized as a code block).
* Remove internal HTML tags in code blocks, rather than printing
  them verbatim.
* Parse attributes on `<pre>` tag for code blocks.
2013-07-25 09:45:23 -07:00
John MacFarlane
af5705308a Test suite changes for new highlighting-kate version. 2013-07-23 20:31:49 -07:00
John MacFarlane
800c5490ec LaTeX reader: Don't add spurious ", " to citation suffixes.
This is added when needed in Text.Pandoc.Biblio anyway.
2013-07-21 11:44:49 -07:00
Clare Macrae
c561be95a1 Add failing test for bullet and numbered lists in dokuwiki writer (#386) 2013-07-15 20:20:37 +01:00
Clare Macrae
18565e149a Implement conversion of images in dokuwiki writer (#386) 2013-07-15 19:29:39 +01:00
Clare Macrae
b2a8731e32 Weak implementation of hyperlinks for dokuwiki (#386)
TODO Simplify the code
2013-07-15 09:35:04 +01:00
Alexander Kondratskiy
0b49f810f4 Fixing wrong numbered-list indentation in open document format 2013-07-14 14:33:58 -04:00
Clare Macrae
660fb24472 Implemented horizontal rule for dokuwiki (#386) 2013-07-14 15:03:40 +01:00
Clare Macrae
2afa4ec924 Implemented Emphasis (italic) and Strong (bold) for dokuwiki (#386) 2013-07-14 14:58:42 +01:00
Clare Macrae
a43e5983da Implemented correct output of dokuwiki (#386) 2013-07-14 14:24:20 +01:00
Clare Macrae
7eded47bcd Initial work to create dokuwiki writer (#386)
In this first version, all dokuwiki files are straight copies of the
media wiki counterparts.
2013-07-14 13:40:27 +01:00
John MacFarlane
35e2caa058 Updated a test whose output changed due to last commit. 2013-07-13 13:47:09 -07:00
John MacFarlane
9009a7e4a8 Markdown writer: Commas are okay in plain yaml scalars.
It's just commas with brackets that can cause problems.
2013-07-01 21:00:46 -07:00
John MacFarlane
e7a68fc7e8 Markdown writer: Render yaml title block fields in alpha order.
This makes the output predictable; previously it varied across
implementations.
2013-07-01 20:56:27 -07:00
John MacFarlane
19ad69b1c6 Improvements to yaml title block writer. 2013-07-01 16:28:34 -07:00
John MacFarlane
21a9b44609 Switched order of fields in yaml header (writer test). 2013-07-01 14:38:32 -07:00
John MacFarlane
2d46828b1c Revert "Markdown writer: Don't include variables in metadata."
This reverts commit 0ec8573347.
2013-07-01 14:17:04 -07:00
John MacFarlane
0ec8573347 Markdown writer: Don't include variables in metadata. 2013-07-01 12:48:13 -07:00
John MacFarlane
5d01e9a117 Markdown writer: Support yaml title block. 2013-06-30 23:37:27 -07:00
John MacFarlane
5cb0f0bbf1 ConTeXt writer: Properly handle tables without captions.
The old output only worked in MkII. This should work in MkIV
as well.

Closes #837.
2013-06-28 21:30:27 -07:00
John MacFarlane
dd96213c05 Man writer: give more fine-grained control in template.
Now the `title`, `section`, `header`, and `footer` can all be set
individually in metadata.  The `description` variable has been
removed.

Quotes have been added so that spaces are allowed in the title.

If you have a title that begins

    COMMAND(1) footer here | header here

pandoc will parse it as before into a title, section, header, and
footer.  But you can also specify these elements explicitly.

Closes #885.
2013-06-27 19:32:28 -07:00
John MacFarlane
79a4ea03e2 Stop escaping | in LaTeX math.
This caused problems with array environments.  Closes #891.
2013-06-26 20:54:31 -07:00
John MacFarlane
f7f32af293 Use latest chicago-author-date.csl. 2013-06-25 22:37:03 -07:00
John MacFarlane
243c56a880 Fixed 'authors' metadata parsing in reST.
Semicolons separate different authors.
2013-06-25 22:32:50 -07:00
John MacFarlane
08631ef1a3 Some test suite fixes for new metadata. 2013-06-25 22:32:50 -07:00
John MacFarlane
f869f7e08d Use new flexible metadata type.
* Depend on pandoc 1.12.
* Added yaml dependency.
* `Text.Pandoc.XML`: Removed `stripTags`.  (API change.)
* `Text.Pandoc.Shared`:  Added `metaToJSON`.
  This will be used in writers to create a JSON object for use
  in the templates from the pandoc metadata.
* Revised readers and writers to use the new Meta type.
* `Text.Pandoc.Options`: Added `Ext_yaml_title_block`.
* Markdown reader:  Added support for YAML metadata block.
  Note that it must come at the beginning of the document.
* `Text.Pandoc.Parsing.ParserState`:  Replace `stateTitle`,
  `stateAuthors`, `stateDate` with `stateMeta`.
* RST reader:  Improved metadata.
  Treat initial field list as metadata when standalone specified.
  Previously ALL fields "title", "author", "date" in field lists
  were treated as metadata, even if not at the beginning.
  Use `subtitle` metadata field for subtitle.
* `Text.Pandoc.Templates`:  Export `renderTemplate'` that takes a string
  instead of a compiled template..
* OPML template:  Use 'for' loop for authors.
* Org template: '#+TITLE:' is inserted before the title.
  Previously the writer did this.
2013-06-24 20:29:41 -07:00
John MacFarlane
a2b98ba218 Added test for #882. 2013-06-19 09:27:11 -07:00
John MacFarlane
6c5ba22c96 Added a test for #833. 2013-06-19 09:00:37 -07:00
John MacFarlane
b04dfde403 RST reader: don't insert paragraphs where docutils doesn't.
rst2html doesn't add `<p>` tags to list items (even when they are
separated by blank lines) unless there are multiple paragraphs in the
list.  This commit changes the RST reader to conform more closely to
what docutils does.

Closes #880.
2013-06-18 10:04:37 -07:00
John MacFarlane
50ba5a801a Textile reader: Correctly handle entities. 2013-06-11 10:16:54 -07:00
John MacFarlane
8d19e45b97 LaTeX writer: Always create labels for sections.
Previously the labels were only created when there were links to
the section in the document.

Closes #871.
2013-06-02 14:38:18 -07:00
John MacFarlane
fa978e1365 Use latest highlighting-kate and texmath.
Closes #849.
2013-05-07 20:22:09 -07:00
John MacFarlane
816a5540f4 Updated tests for template changes. 2013-05-07 19:50:23 -07:00
John MacFarlane
fdd5f26d14 Updated tests for changes in LaTeX template. 2013-04-26 08:59:18 -07:00
John MacFarlane
ff6db9eab1 Updated tests to match new docbook template. 2013-04-15 20:51:00 -07:00
John MacFarlane
5c03275a63 Haddock reader improvements.
- Correctly handle ghci sessions.
- Fixed spacing issues.
- Simplified code.
2013-04-14 21:39:05 -07:00
John MacFarlane
da13ad89ce Man writer: use one decimal place for column widths.
This, I hope, will fix test failures on GHC 7.6 due to
(presumably) different rounding or floating point multiplication.
2013-04-09 19:56:43 -07:00
John MacFarlane
6dbf1859a2 Update markdown writer tests for changes in author in titleblock.
Authors are now put on separate lines.
2013-04-09 18:17:06 -07:00
John MacFarlane
e938fc1ae2 Fixed Haddock reader bugs with list item spaces and examples.
Closes #824.
2013-04-09 18:12:54 -07:00
John MacFarlane
129899647e Fixed haddock test output.
- omit extra spaces in list items
- correct line breaks in ghci output
2013-04-08 09:08:41 -07:00
David Lazar
2c9ea89ff7 Haddock reader: add tests. 2013-04-04 23:19:02 -07:00
John MacFarlane
186b4f0100 Modified haddock reader test stubs so they pass, for now. 2013-03-28 17:22:39 -07:00
John MacFarlane
0b85ad7546 Added stubs for haddock reader tests.
Modify tests/haddock-reader.haddock and
tests/haddock-reader.native.
2013-03-28 15:58:09 -07:00
John MacFarlane
48b23d491d MediaWiki reader: Correctly handle indented preformatted text
without preceding or following blank line.
2013-03-28 10:48:00 -07:00
John MacFarlane
099b4b7769 Mediawiki: Fixed regression for <ref>URL</ref>.
`<` is no longer allowed in URLs, according to the uri parser
in Text.Pandoc.Parsing.

Added a test case.
2013-03-28 09:54:02 -07:00
John MacFarlane
5b4d239b85 Added OPML template, tests.
Minor fixes to OPML writer.
Improved OPML reader tests.
2013-03-20 10:17:59 -07:00
John MacFarlane
74d53f4347 Added Text.Pandoc.Readers.OPML, exporting readOPML.
The _note attribute is supported.  This is unofficial, but
used e.g. in OmniOutliner and supported by multimarkdown.
We treat the contents as markdown blocks under a section
header.

Added to documentation and tests.
2013-03-19 20:22:14 -07:00
John MacFarlane
835deee58b Markdown writer: New approach for citations.
* Reverts 1.11 change that caused citations to be rendered as
  markdown citations, even if `--biblio` was specified, unless
  `citation` extension is disabled.  Now, formatted citations
  are always printed if `--biblio` was specified.  If you want to
  reformat markdown keeping pandoc markdown citations intact,
  just don't specify `--biblio`.

* Reverted now unnecessary changes to Text.Pandoc.Biblio adding the raw
  block to mark the bibliography, and to Text.Pandoc.Writers.Markdown
  to remove the bibliography if `citations` not specified.

* If the content of a `Cite` inline is a `RawInline "latex"`, which
  means that a LaTeX citation command was parsed and `--biblio` wasn't
  specified, then render it as a pandoc markdown citation.  This means
  that `pandoc -f latex -t markdown`, without `--biblio`, will convert
  LaTeX citation commands to pandoc markdown citations.
2013-03-17 10:33:54 -07:00
John MacFarlane
cae52ecc31 Revert "LaTeX reader: citation handling changes."
This reverts commit f7229b1473.
2013-03-17 08:48:29 -07:00
John MacFarlane
db3d4113a2 Markdown reader: don't lose parentheses in URLs.
Added tests.  This fixes a regression from 1.10.x.  Closes #786.
2013-03-13 19:20:25 -07:00
John MacFarlane
f7229b1473 LaTeX reader: citation handling changes.
Previously, a LaTeX citation would always be parsed as a Citation
element, with the raw LaTeX in the [Inline] part.

Now, the LaTeX citation is parsed as a Citation element only if
`--biblio` was specified (i.e. only if there is a nonempty set
of references in readerReferences).  Otherwise it is parsed as
raw LaTeX.

This will make it possible to simplify some things in the markdown
writer.  It also makes the LaTeX reader behave more like the Markdown
reader.
2013-03-09 10:33:25 -08:00
John MacFarlane
af7e97b9f5 Markdown writer: Render citations as pandoc-markdown citations.
Previously citations were rendered as citeproc-formatted citations
by default.  Now we render them as pandoc citations, e.g. `[@item1]`,
unless the `citations` extension is disabled.

If you still want formatted citations in your markdown output,
use `pandoc -t markdown-citations`.
2013-03-07 16:38:19 -08:00
John MacFarlane
3b63cb0903 Hide Text.Pandoc.Highlighting.
* Moved code for translating listings language names to
  highlighting-kate names and back from LaTeX reader to Highlighting.
* Text.Pandoc.Highlighting no longer exposed (API change)
* Text.Pandoc.Highlighting exports toListingsLang, fromListingsLang
2013-03-05 22:09:42 -08:00
John MacFarlane
5b0b21b51d Added test for pipe table with spaces around header lines. 2013-03-02 19:06:12 -08:00
John MacFarlane
d5c2ace9ae Updated tests for latex template change (microtype). 2013-02-27 19:42:54 -08:00
John MacFarlane
07e8cedf2b Make implicit_header_references work with explicit header ids.
(Markdown reader.)
2013-02-21 19:53:35 -08:00
John MacFarlane
5e9145bb62 Textile reader: Handle attributes on headers.
Includes `[lang]`, `(class #id)`, `{color:red}` styles.
2013-02-16 18:29:12 -08:00
John MacFarlane
cc410a71b5 Allow & in emails (for entities).
Added tests for entities in titles and links.
Closes #723.
2013-02-15 23:02:17 -08:00
John MacFarlane
90f0dd15b6 HTML writer: Support header attributes.
Note:  The attributes go on the enclosing section or div
if `--section-divs` is specified.

Also fixed a regression (only now noticed) in html+lhs output.
Previously the bird tracks were being omitted.
2013-02-14 19:35:58 -08:00
John MacFarlane
f53e0a44ce DocBook writer: for linebreak, but newline in literallayout.
Closes #725.
2013-01-28 11:18:05 -08:00
John MacFarlane
cc17c794a1 Updated latex table tests. 2013-01-28 10:49:18 -08:00
John MacFarlane
29a17b1767 Merge pull request #733 from jrunningen/master
Mediawiki reader: Don't require blanklines after tables.
2013-01-28 09:42:59 -08:00
John MacFarlane
72d11ad20b Markdown/RST reader: Skip blank lines.
This fixes a subtle regression involving grid tables with
empty cells.  Closes #732.

Also added test for grid table with empty cells.
2013-01-27 22:13:05 -08:00
Jeff Runningen
efddb85d46 Mediawiki reader: Don't require blanklines after tables. 2013-01-27 23:15:46 -05:00
John MacFarlane
9d549ab683 RST writer: Use .. code:: language for code blocks with language.
Closes #721.
Also fixed whitespace in lhs tests.
2013-01-26 16:12:11 -08:00
John MacFarlane
daeb52d4e0 Eliminated use of TH in test suite. 2013-01-23 19:26:39 -08:00
John MacFarlane
f468db9277 LaTeX template: Use \urlstyle{same} to avoid monospace URLs. 2013-01-21 11:52:00 -08:00
John MacFarlane
26d30d6d38 Use proportional font for email autolinks with obfuscation.
Closes #714.
2013-01-21 11:28:35 -08:00
John MacFarlane
af84953781 Markdown reader: Fixed bug with headerless grid tables.
The 1.10 code assumed that each table header cell contains
exactly one block. That failed for headerless tables (0) and also
for tables with multiple blocks in a header cell.

The code is fixed and tests provided. Thanks to Andrew Lee for
pointing out the bug.
2013-01-21 09:52:24 -08:00
John MacFarlane
9cc1cf1f40 Fixed bug with escaped % in LaTeX reader.
Also added tests.  Closes #710.
2013-01-20 19:21:13 -08:00
John MacFarlane
27e7c57721 LaTeX test updates for latest changes to template & h-k. 2013-01-19 10:41:42 -08:00
John MacFarlane
2fbe611a96 Get rid of compiler warnings in Tests.Helpers. 2013-01-19 10:41:12 -08:00
John MacFarlane
809d74b86d Set locale encoding in test suite.
This prevents a "commit buffer (invalid argument)" error on
Windows.
2013-01-18 11:23:09 -08:00
John MacFarlane
8eab759a9c RTF writer: Added writeRTFWithEmbeddedImages.
* RTF writer:  Export writeRTFWithEmbeddedImages instead of
  rtfEmbedImage.
* Text.Pandoc: Use writeRTFWithEmbeddedImages for RTF.
* Moved code for embedding images in RTF out of pandoc.hs.
2013-01-18 10:33:37 -08:00
John MacFarlane
bf3a911a1c Changed Ext_autolink_urls -> Ext_autolink_bare_uris.
Added tests.
2013-01-15 12:44:50 -08:00
John MacFarlane
e9b3d5aa7a Added lots of tests for bare URIs. 2013-01-15 12:28:31 -08:00
John MacFarlane
e0e36ce543 Revised URI parser.
* It no longer uses Network.URIs URI parser, which is too restrictive
  (not allowing unicode URIs unless encoded).
* It allows many more schemes.
* It better handles punctuation so as to avoid capturing trailing
  punctuation in bare URLs.
2013-01-15 10:52:02 -08:00
John MacFarlane
7bc37e4414 Use 'fig:' instead of '\SOH' in title to indicate figure.
Revises 1a4b47e933
2013-01-15 08:46:09 -08:00
John MacFarlane
1a4b47e933 Implemented Ext_implicit_figures.
* In markdown reader, add a '\1' character to the beginning
  of the title of an image that is alone in its paragraph,
  if implicit_figures extension is selected.
* In writers, check for Para [Image alt (src,'\1':tit)] and treat
  it as a figure if possible.
* Updated tests.

This is a bit of a hack, but it allows us to make implicit_figures
an extension of the markdown reader, rather than the writers.
2013-01-14 20:53:08 -08:00
John MacFarlane
51e0bd277a Parsing: Fixed uri -- escape unicode URLs.
Otherwise Network.URI.parseURI fails on e.g. Chinese
URLs.  Changed an incorrect test in markdown-reader-more.
2013-01-14 17:38:34 -08:00
John MacFarlane
45895b561f RST writer: Fixes bug with links with duplicate text.
We now (a) use anonymous links for links with inline URLs, and
(b) use an inline link instead of a reference link if the
reference link would require a label that has already been
used for a different link.

Closes #511.
2013-01-13 23:00:05 -08:00
John MacFarlane
9ee9096d07 Added tests for markdown line blocks and explicit header attributes. 2013-01-13 18:03:15 -08:00
John MacFarlane
5c067bb457 RST reader: Line block improvements.
* Use nonbreaking spaces for initial indent (otherwise lost in HTML and
  LaTeX).
* Allow multiple paragraphs in a single line block.
2013-01-13 11:15:31 -08:00
John MacFarlane
5ecadd7bfa Use line block in RST writer when a paragraph contains linebreaks.
Previously linebreaks weren't supported in RST, since RST
has no native linebreak construct.
2013-01-13 09:25:56 -08:00
John MacFarlane
70e308f2f9 Escape | as \vert in LaTeX math.
This avoids a clash with highlighting-kate's macros, which
redefine | as a short verbatim delimiter.  Thanks to
Björn Peemöller for raising this issue.
2013-01-12 10:21:19 -08:00
John MacFarlane
f2aa5fd661 Fixed/simplified diff output for tests. 2013-01-12 10:21:07 -08:00