Commit graph

1227 commits

Author SHA1 Message Date
John MacFarlane
f3133a8e9e Merge pull request #2570 from mb21/rst-reader-imgattrs
Image attributes
2015-12-13 20:29:13 -08:00
John MacFarlane
a924a3f43d Fixed ICML image syntax for local files.
`file:filename` rather than `file://./filename`.

I think this is right; it matches what we had before
with people actually using the ICML writer, and seems
to match examples in the spec.  I don't
have a copy of InDesign I can test on, though.
@DigitalPublishingToolkit and @mb21, can you have
a look?
2015-12-13 20:19:34 -08:00
mb21
37931cb0c5 Docx reader: image attributes 2015-12-13 21:40:13 +01:00
mb21
30644b291b RST reader: image attributes 2015-12-13 21:40:12 +01:00
John MacFarlane
202d848fb3 Fixed tests. 2015-12-12 16:22:31 -08:00
John MacFarlane
d6a4c70ef8 Test fixes. 2015-12-12 12:58:31 -08:00
John MacFarlane
af7e782436 Modified readers to emit SoftBreak when appropriate. 2015-12-12 09:31:51 -08:00
John MacFarlane
536b6bf538 Implemented SoftBreak and new --wrap option.
Added threefold wrapping option.

* Command line option: deprecated `--no-wrap`, added
  `--wrap=[auto|none|preserve]`
* Added WrapOption, exported from Text.Pandoc.Options
* Changed type of writerWrapText in WriterOptions from
  Bool to WrapOption.
* Modified Text.Pandoc.Shared functions for SoftBreak.
* Supported SoftBreak in writers.
* Updated tests.
* Updated README.

Closes #1701.
2015-12-11 23:55:08 -08:00
John MacFarlane
e5c72caf29 LaTeX template changes:
- only pass options to color package if colorlinks is set
- make definition of `\euro` conditional in xelatex/lualatex,
  as it is already for pdflatex

(Andrew Dunning)
2015-12-03 10:45:11 -08:00
John MacFarlane
7b66f84b80 Fixed man template so disabling hyphenation actually works.
The command needs to come after .TH.
2015-12-03 10:38:48 -08:00
John MacFarlane
57350d9468 Added bodyless pipe table test case.
See #2556.
2015-11-24 20:29:44 -08:00
John MacFarlane
2eb5d2dc42 LaTeX reader: Use curly quotes for unmatched `.
Partially addresses #2555.

Note that there's still a problem with the code sample given.
2015-11-23 23:44:39 -08:00
John MacFarlane
b20ecbedc4 AsciiDoc writer: Fixed code blocks.
Closes #1861.
2015-11-23 21:29:21 -08:00
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