Commit graph

965 commits

Author SHA1 Message Date
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
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
John MacFarlane
d599c4cdab Added Attr field to Header.
Previously header ids were autogenerated by the writers.
Now they are generated (unless supplied explicitly) in the
markdown parser, if the `header_identifiers` extension is
selected.

In addition, the textile reader now supports id attributes on
headers.
2013-01-09 09:30:05 -08:00
John MacFarlane
8ff81dc9ca Updated tests for tight/loose lists.
Taking into account new context/latex output, and fixing
some bugs in the test suite Tests.Helpers and Tests.Writers.ConTeXt.
(We had the wrong order of expected/actual in the diff output.)
2013-01-07 20:58:49 -08:00
John MacFarlane
8c48bd8feb Don't put the text of an autolink in Code font. 2013-01-06 20:51:51 -08:00
John MacFarlane
300f8528da Mediawiki reader: interpret HTML in verbatim contexts as text.
Thanks to Jeff Runningen for reporting that mediawiki works
this way.
2013-01-06 19:35:40 -08:00
John MacFarlane
7d74a916ff Updated table tests for latex writer changes. 2013-01-05 20:03:50 -08:00
John MacFarlane
91e8d80eee MediaWiki writer: use <code> not <tt> for Code. 2013-01-04 23:16:49 -08:00
John MacFarlane
0f9e2c2320 Added css to preserve spaces in <code> tags.
Thanks to Dirk Laurie.
2013-01-04 23:02:22 -08:00
John MacFarlane
3d7608d855 Updated tests for latest highlighting-kate version. 2013-01-04 19:48:02 -08:00
John MacFarlane
5a4f7ec595 Added tests for implicit header references. 2013-01-03 20:43:44 -08:00
John MacFarlane
56ff5e1845 Updated test runner for changes in pandoc. 2013-01-03 11:20:10 -08:00
John MacFarlane
0675346e76 Fixed test suite to use Diff 0.2 API. 2013-01-02 11:41:22 -08:00
John MacFarlane
4cd573c61f Textile reader/writer: Fixed autolinks.
Previously the textile reader and writer incorrectly implented
RST-style autolinks for URLs and email addresses.

This has been fixed.  Now an autolink is done this way:

    "$":http://myurl.com
2012-11-06 16:05:17 -08:00
John MacFarlane
9d0b011869 RST writer: Don't add ":align: center" to figures. 2012-11-04 18:33:35 -08:00
John MacFarlane
06300e59d5 Removed citationSuppressParens.
Makefile: Use citeproc-0.3.6 release.
2012-10-28 09:36:15 -07:00
John MacFarlane
6f2347635c LaTeX reader: Initialize citationSuppressParens field. 2012-10-22 19:17:00 -07:00
John MacFarlane
cfab8eaecb Revert "LaTeX reader: Use new suppressParens option for footnote citations."
This reverts commit 7499499b68.

Conflicts:

	src/Text/Pandoc/Readers/LaTeX.hs
2012-10-21 23:16:23 -07:00
John MacFarlane
bfddcb46dc Revert "Adjust LaTeX reader test for last change."
This reverts commit ea34087cde.
2012-10-21 23:14:42 -07:00
John MacFarlane
ca583a340f Updated lhs-test.latex for new highlighting-kate treatment of `. 2012-10-20 23:54:05 -07:00
John MacFarlane
ea34087cde Adjust LaTeX reader test for last change. 2012-10-15 20:01:07 -07:00