Commit graph

1200 commits

Author SHA1 Message Date
John MacFarlane
0a6aaf5e1b Added emoji extension to Markdown.
This is enabled by default in `markdown_github`.
Added `Ext_emoji` to `Extension` in `Text.Pandoc.Options` (API change).

Closes #2523.
2015-11-13 12:14:24 -08:00
John MacFarlane
0fd138167c Updated tests for template changes. 2015-11-12 16:09:41 -08:00
John MacFarlane
23b693c029 Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."
This reverts commit c423dbb5a3.
2015-11-09 10:08:22 -08:00
John MacFarlane
237c10992e Merge pull request #2505 from tarleb/org-header-markup-fix
Org reader: fix markup parsing in headers
2015-11-08 17:17:19 -08:00
John MacFarlane
c423dbb5a3 Use -XNoImplicitPrelude and 'import Prelude' explicitly.
This is needed for ghci to work with pandoc, given that we
now use a custom prelude.

Closes #2503.
2015-11-08 16:56:59 -08:00
Albert Krewinkel
e3b4844bd7 Org reader: fix markup parsing in headers
Markup as the very first item in a header wasn't recognized.  This was
caused by an incorrect parser state: positions at which inline markup
can start need to be marked explicitly by changing the parser state.
This wasn't done for headers.  The proper function to update the state
is now called at the beginning of the header parser, fixing this issue.

This fixes #2504.
2015-11-08 22:32:00 +01:00
John MacFarlane
eb8aee477d Pipe tables with long lines now get relative cell widths.
If a pipe table contains a line longer than the column
width (as set by `--columns` or 80 by default), relative
widths are computed based on the widths of the separator lines
relative to the column width.

This should solve persistent problems with long pipe tables in
LaTeX/PDF output, and give more flexibility for determining
relative column widths in other formats, too.

For narrower pipe tables, column widths of 0 are used,
telling pandoc not to specify widths explicitly in output
formats that permit this.

Closes #2471.
2015-10-30 12:37:08 -07:00
John MacFarlane
7843b5759a HTML writer: use width on whole table if col widths sum to < 100%.
Otherwise some browsers display the table with the columns
separated far apart.
2015-10-30 12:36:36 -07:00
John MacFarlane
532ae22c29 Textile reader: don't do smart punctuation unless explicitly asked.
Closes #2480.

Note that although smart punctuation is part of the textile
spec, it's not always wanted when converting from textile
to, say, Markdown.  So it seems better to make this an option.
2015-10-30 10:54:07 -07:00
John MacFarlane
1d53d452c3 LaTeX writer: add \protect to \hyperlink.
Thanks to Hadrien Mary for the problem and solution.

Closes #2490.
2015-10-28 09:37:05 -07:00
John MacFarlane
d5efa9b35c LaTeX writer: Use \hypertarget and \hyperlink for links.
This works correctly to link to Div or Span elements.
We now don't bother defining `\label` for Div or Span
elements.

Closes jgm/pandoc-citeproc#174.
2015-10-27 14:08:35 -07:00
John MacFarlane
7d4f174047 Template improvements (Andrew Dunning).
- Added `keywords` to HTML templates and fixed alignment.
- Updated dzslides template from source.
- Added `lang`, `dir`, `quotes` to HTML templates;
  always make author and date display conditional.
- Fixed `author` and `date` in asciidoc; added `keywords`, `abstract`.
- Updated tests.
2015-10-25 12:28:28 -07:00
John MacFarlane
45df87cf15 Merge pull request #2477 from tarleb/org-toggling-header-args
Org reader: allow toggling header args
2015-10-25 12:10:07 -07:00
Albert Krewinkel
27a8603278 Org reader: allow toggling header args
Org-mode allows to skip the argument of a code block header argument if
it's toggling a value.  Argument-less headers are now recognized,
avoiding weird parsing errors.

The fixes are not exactly pretty, but neither is the code that was
fixed.  So I guess it's about par for the course.  However, a rewrite of
the header parsing code wouldn't hurt in the long run.

Thanks to @jo-tham for filing the bug report.

This fixes #2269.
2015-10-25 08:54:00 +01:00
Albert Krewinkel
b27366780f Org reader: fix paragraph/list interaction
Paragraphs can be followed by lists, even if there is no blank line
between the two blocks.  However, this should only be true if the
paragraph is not within a list, were the preceding block should be
parsed as a plain instead of paragraph (to allow for compact lists).

Thanks to @rgaiacs for bringing this up.

This fixes #2464.
2015-10-24 19:05:56 +02:00
John MacFarlane
a7150bb6b6 Fixed over-eager raw HTML inline parsing.
Tightened up the inline HTML parser so it disallows
TagWarnings.

This only affects the markdown reader when the `markdown_in_html_blocks`
option is disabled.

Closes #2469.
2015-10-22 21:18:06 -07:00
John MacFarlane
652b60f141 Updated tests for latex/context template changes. 2015-10-20 15:22:52 -07:00
John MacFarlane
82d2719e68 Fixed one test case. 2015-10-19 23:06:33 -07:00
John MacFarlane
b49ab06e96 Merge pull request #2458 from mb21/lang-inlines
LaTeX and ConTeXt writers: support lang attribute on divs and spans
2015-10-19 23:02:08 -07:00
John MacFarlane
d028dcb8a9 Updated tests for template changes. 2015-10-18 21:58:10 -07:00
John MacFarlane
448f5b151e Tests: Unset pandoc-version so we don't get the comment...
in the man writer test.  Otherwise this needs updating
every version bump.
2015-10-18 11:52:32 -07:00
mb21
fa2b26ddcb Added writers-lang-and-dir test, fixed ConTeXt writer test
The writers-lang-and-dir testGroup tests LaTeX and ConTeXt
writers' language and directionality output
2015-10-18 17:01:38 +02:00
John MacFarlane
047cb32dfc Use unicode super/subscripts for digits in plain output. 2015-10-15 14:35:01 -07:00
John MacFarlane
82b3e0ab97 Use custom Prelude to avoid compiler warnings.
- The (non-exported) prelude is in prelude/Prelude.hs.
- It exports Monoid and Applicative, like base 4.8 prelude,
  but works with older base versions.
- It exports (<>) for mappend.
- It hides 'catch' on older base versions.

This allows us to remove many imports of Data.Monoid
and Control.Applicative, and remove Text.Pandoc.Compat.Monoid.

It should allow us to use -Wall again for ghc 7.10.
2015-10-14 09:09:10 -07:00
John MacFarlane
74476e1f66 Fixed tests for template changes. 2015-10-13 20:50:40 -07:00
John MacFarlane
24f68654e9 RST writer: do header normalization only in "standalone" mode.
If we're producing a fragment, just skip normalization.
After all, the fragment might be somewhere in the middle
of the document.  It's more important for fragments to
have consistency in rendering (so they can be pieced
together) than to normalize.

This closes #2394.  It's simpler and more robust than
my earlier fix.
2015-10-12 23:00:27 -07:00
John MacFarlane
1e8a25ad69 Percent-encode more special characters in URLs.
HTML, LaTeX writers adjusted.
The special characters are '<','>','|','"','{','}','[',']','^', '`'.

Closes #1640, #2377.
2015-10-11 17:12:50 -07:00
John MacFarlane
0e78eba791 HTML reader/writer: better handling of "section" elements.
Previously `<section>` tags were just parsed as raw HTML
blocks.  With this change, section elements are parsed as
Div elements with the class "section".  The HTML writer will
use `<section>` tags to render these Divs in HTML5; otherwise
they will be rendered as `<div class="section">`.

Closes #2438.
2015-10-11 15:25:49 -07:00
John MacFarlane
e3a5abc64f Removed xltxtra, xunicode from LaTeX template.
Thanks Andrew Dunning.

Updated tests and changelog.
2015-10-10 16:12:50 -07:00
John MacFarlane
72b038d201 Merge pull request #2412 from frerich/reader/docbook/xref_support
Added support for <xref> tag in DocBook reader
2015-10-10 14:18:28 -07:00
John MacFarlane
dd29289806 Adjusted man writer test for latest template changes. 2015-10-10 13:41:52 -07:00
John MacFarlane
869e800bbb Merge pull request #2432 from hftf/hyphens
Docx Reader: Parse soft and non-breaking hyphen elements
2015-10-04 21:56:29 -07:00
John MacFarlane
e32ab441be Updated tests for changes to latex template. 2015-10-04 21:52:08 -07:00
Ophir Lifshitz
dfd06467ea Docx Reader: Create special punctuation test 2015-10-04 06:11:07 -04:00
John MacFarlane
6532950b26 MediaBag: ensure that / is always used as path separator. 2015-09-26 22:40:58 -07:00
Frerich Raabe
eee992520c Improve text generated for <xref> by employing docbook-xsl heuristics
docbook-xsl, a set of XSLT scripts to generate HMTL out of DocBook,
tries harder to generate a nice xref text. Depending on the element
being linked to, it looks at the title or other descriptive child
elements. Let's do that, too.
2015-09-24 18:28:51 +02:00
Frerich Raabe
35f12b5095 Added proper support for DocBook 'xref' elements
'xref' is used to create cross references to other parts of the
document. It is an empty element - the cross reference text depends on
various attributes. Quoting 'DocBook: The Definitive Guide':

  1. If the endterm attribute is specified on xref, the content of the
  element pointed to by endterm will be used as the text of the
  cross-reference.

  2. Otherwise, if the object pointed to has a specified XRefLabel, the
  content of that attribute will be used as the cross-reference text.
2015-09-24 18:26:55 +02:00
John MacFarlane
9b033672e4 Merge pull request #2406 from tarleb/org-verse-fix
Make sure verse blocks can contain empty lines
2015-09-20 13:02:47 -07:00
Albert Krewinkel
8007dd97b5 Make sure verse blocks can contain empty lines
The previous verse parsing code made the faulty assumption that empty
strings are valid (and empty) inlines.  This isn't the case, so lines
are changed to contain at least a newline.

It would generally be nicer and faster to keep the newlines while
splitting the string.  However, this would require more code, which
seems unjustified for a simple (and fairly rare) block as *verse*.

This fixes #2402.
2015-09-19 22:02:43 +02:00
Nikolay Yakimov
5788f62ef5 [RST Writer] Don't normalize heading levels below input minimum 2015-09-19 17:45:54 +03:00
John MacFarlane
6dcfa7e07b Tests: docx writer tests now use "../data" for data directory.
This allows tests  to be run without installing first.
2015-09-09 10:39:20 -07:00
John MacFarlane
8ae0c857f9 Use real jpg (not empty) for docx tests to avoid warning. 2015-08-15 10:40:22 -07:00
John MacFarlane
1f00a5395f RST reader: better handling of indirect roles.
Previously the parser failed on this kind of case

    .. role:: indirect(code)

    .. role:: py(indirect)
       :language: python

    :py:`hi`

Now it currectly recognizes `:py:` as a code role.

The previous test for this didn't work, because the
name of the indirect role was the same as the language
defined its parent, os it didn't really test for this
behavior.  Updated test.
2015-08-15 10:22:47 -07:00
John MacFarlane
8c579a5daa Merge pull request #2360 from jg/issue-2354
Org reader: add auto identifiers if not present on headers
2015-08-15 09:47:56 -07:00
Juliusz Gonera
f1c87ed164 Org reader: add auto identifiers if not present on headers
Refs #2354

This should also fix the table of contents (--toc) when generating a html file
from org input
2015-08-15 07:57:48 +02:00
John MacFarlane
7b8c005d07 EPUB reader: stop mangling external URLs.
Closes #2284.

Note the changes to the test suite. In each case, a mangled
external link has been fixed, so these are all positive.
2015-08-10 16:35:43 -07:00
John MacFarlane
3ad474e2cf Updated html reader for new automatic header attributes. 2015-08-08 20:55:40 -07:00
John MacFarlane
467e3be700 MediaWiki reader: handle unquoted table attributes.
Closes #2355.
2015-08-08 20:55:00 -07:00
John MacFarlane
74c31abb1a Merge pull request #2327 from hftf/list-style
HTML Reader: Correctly parse inline list-style(-type) for <ol>
2015-08-07 11:08:53 -07:00
John MacFarlane
0baaa1080a Pipe tables: allow indented columns.
Previously the left-hand column could not start with 4 or
more spaces indent.  This was inconvenient for right-aligned
left columns.

Note that the first (header column) must still have 3 or fewer
spaces indentation, or the table will be treated as an indented
code  block.
2015-07-27 10:24:06 -07:00