Commit graph

1214 commits

Author SHA1 Message Date
John MacFarlane
6a28923b9f Updated tests for context template changes. 2015-11-20 14:50:37 -08:00
John MacFarlane
e5573bca8f latex template changes.
* Removed setting of `subject` in PDF metadata.
  This used to be set to the subtitle, but really the subtitle
  need not give the subject.  Also, `subtitle` can contain formatting,
  so we'd need, at least, a plain text version for this.

* Moved `header-includes` before setting of `\title`, `\author`,
  etc.  This allows these macros to be redefined.

* Use `\subtitle` command for `subtitle`, instead of tacking it
  on to the title as before.  We give a no-op fallback definition if it is
  not defined.  This change should produce much better results
  in classes that support `\subtitle`.  With the default article
  class, which does not define `\subtitle`, subtitles will no
  longer be printed unless the user defines `\subtitle` and
  redefines `\maketitle`.

* Moved redefinitions of `\paragraph` and `\subparagraph` to
  before header-includes.
2015-11-20 14:40:27 -08:00
John MacFarlane
244cd5644b Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into mb21-new-image-attributes
* Bumped version to 1.16.
* Added Attr field to Link and Image.
* Added `common_link_attributes` extension.
* Updated readers for link attributes.
* Updated writers for link attributes.
* Updated tests
* Updated stack.yaml to build against unreleased versions of
  pandoc-types and texmath.
* Fixed various compiler warnings.

Closes #261.

TODO:

* Relative (percentage) image widths in docx writer.
* ODT/OpenDocument writer (untested, same issue about percentage widths).
* Update pandoc-citeproc.
2015-11-19 23:14:23 -08:00
Jesse Rosenthal
186a955bd0 Docx reader: Add test cases for dummy list items. 2015-11-18 14:03:10 -05:00
John MacFarlane
f096f032f0 ICML writer: better handling of math.
Instead of just printing the raw tex, we now try to fake
it with unicode characters.
2015-11-16 20:24:34 -08:00
Jesse Rosenthal
78c90bd749 Added test case for links in notes. 2015-11-14 13:49:02 -05:00
John MacFarlane
73e6333fae Merge pull request #2526 from tarleb/org-definition-lists-fix
Org reader: Require whitespace around def list markers
2015-11-13 14:07:56 -08:00
Albert Krewinkel
67cb2809fd Org reader: Require whitespace around def list markers
Definition list markers (i.e. double colons `::`) must be surrounded by
whitespace to start a definition item.  This rule was not checked
before, resulting in bugs with footnotes and some link types.

Thanks to @conklech for noticing and reporting this issue.

This fixes #2518.
2015-11-13 22:04:17 +01:00
John MacFarlane
028a605bf8 Merge pull request #2525 from tarleb/org-smart-fixes
Org reader: Fix emphasis rules for smart parsing
2015-11-13 12:27:23 -08:00
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
Albert Krewinkel
220f3d12b8 Org reader: Fix emphasis rules for smart parsing
Smart quotes, ellipses, and dashes should behave like normal quotes,
single dashes, and dots with respect to text markup parsing.  The parser
state was not updated properly in all cases, which has been fixed.

Thanks to @conklech for reporting this issue.

This fixes #2513.
2015-11-13 20:43:46 +01: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