Commit graph

3252 commits

Author SHA1 Message Date
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
d8080db7f7 Allow :// in citation keys.
Closes jgm/pandoc-citeproc#166.
2015-11-13 11:00:56 -08:00
John MacFarlane
c80c0df1fe EPUB writer: don't download linked media when data-external attribute set.
By default pandoc downloads all linked media and includes it in the
EPUB container.  This can be disabled by setting `data-external`
on the tags linking to media that should not be downloaded.

Example:

    <audio controls="1">
     <source src="http://www.sixbarsjail.it/tmp/bach_toccata.mp3"
     type="audio/mpeg"></source>
    </audio>

Closes #2473.
2015-11-12 13:27:41 -08:00
John MacFarlane
83b1aa042d LaTeX writer: set colorlinks...
if `linkcolor`, `urlcolor`, `citecolor`, or `toccolor` is set.

Closes #2508.
2015-11-12 12:37:20 -08:00
John MacFarlane
64b32e1e81 Fixed shadowing error. 2015-11-09 11:25:05 -08:00
John MacFarlane
c1e474f005 Restored Text.Pandoc.Compat.Monoid.
Don't use custom prelude for latest ghc.

This is a better approach to making 'stack ghci' and 'cabal repl'
work.  Instead of using NoImplicitPrelude, we only use the custom
prelude for older ghc versions.  The custom prelude presents a
uniform API that matches the current base version's prelude.
So, when developing (presumably with latest ghc), we don't
use a custom prelude at all and hence have no trouble with ghci.

The custom prelude no longer exports (<>):  we now want to
match the base 4.8 prelude behavior.
2015-11-09 11:19:25 -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
5a9ca26172 Merge pull request #2502 from minoki/latex-comment-environment
LaTeX reader: Handle `comment` environment.
2015-11-08 17:57:52 -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
ARATA Mizuki
94500f7469 LaTeX reader: Handle comment environment.
The `comment` environment is handled in a similar way to the `verbatim` environment, except that its content is discarded.
2015-11-08 02:24:25 +09:00
John MacFarlane
411a25306c LaTeX writer: properly handle footnotes in captions.
Closes #1506.
2015-11-01 15:30:05 -08:00
John MacFarlane
c4ea64203a LaTeX writer: avoid footnotes in list of figures.
Footnotes aren't allowed in the list of figures.  This
patch causes footnotes to be stripped from captions when
entered into the list of figures.

Footnotes still don't actually WORK in captions in latex/pdf,
but at least an error is no longer raised.

See #1506.
2015-11-01 13:42:36 -08: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
fb1843ecde Fixed omitted url(...) in CSS data-uri with --self-contained.
Fixes #2489.
2015-10-28 10:06:40 -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
3ea444666a Markdown reader: improved parser for mmd_title_block.
We now allow blank metadata fields.  These were explicitly
disallowed before.

For background see #2026.  The issue in #2026 has since
been fixed in another way, so there is no need to forbid
blank metadata fields.
2015-10-26 22:06:34 -07:00
nickbart1980
143093eabd Added de-CH-1901, fixed el-polyton
el-polyton, not el-poly, see http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
2015-10-26 10:34:32 +00:00
John MacFarlane
89d399b6b1 Merge pull request #2481 from mb21/textarabic
LaTeX writer: \textarabic fix
2015-10-25 12:42:41 -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
mb21
f3f6483510 LaTeX writer: \textarabic fix 2015-10-25 18:31:35 +01: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
a21833b638 Avoid compiler warning for unused identifier. 2015-10-22 21:05:52 -07:00
John MacFarlane
317d9eea17 Changed § to % in operators from Odt.Arrows.Utils.
This prevents problems building haddocks with "C" locale.

Closes #2457.
2015-10-22 17:54:58 -07:00
John MacFarlane
48b68aac43 Textile writer: support start number in ordered lists.
e.g. `#3`.

Partially addresses #2465.
TBD: reader support.
2015-10-22 12:37:40 -07:00
John MacFarlane
8193ebcd99 Allow use of ConTeXt to generate PDFs.
pandoc my.md -t context -o my.pdf

will now create a PDF using ConTeXt rather than LaTeX.

Closes #2463.
2015-10-20 08:16:17 -07:00
mb21
9328f4cd3d LaTeX and ConTeXt writers: support lang attribute on divs and spans
For LaTeX, also collect lang and dir attributes on spans and divs to set the lang,
otherlangs and dir variables if they aren’t set already. See #895.
2015-10-18 17:01:37 +02:00
John MacFarlane
7f4b78c064 Text.Pandoc.Data: store paths in dataFiles using posix separators.
This way we have uniform separators, whether on Windows or Linux.

This should solve a problem where on some Windows versions
the data files weren't being found.

Closes #2459.
2015-10-17 22:04:02 -07:00
John MacFarlane
34d53aff6e Remove compiler warning with embed_data_files. 2015-10-17 21:21:52 -07:00
John MacFarlane
2357e61748 LaTeX reader: fixed longtable support. 2015-10-15 23:15:40 -07:00
John MacFarlane
504bf3f8e7 Support all frame attributes in Beamer. 2015-10-15 15:11:07 -07:00
John MacFarlane
047cb32dfc Use unicode super/subscripts for digits in plain output. 2015-10-15 14:35:01 -07:00
John MacFarlane
6dc3b6585d More changes to avoid compiler warnings on ghc 7.10.
* CPP around deprecated `parseTime`.
* Text.Pandoc.Compat.Locale -> Text.Pandoc.Compat.Time,
  now exports Data.Time.
2015-10-14 10:06:18 -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
198862ee40 LaTeX writer: add \protect to \hyperdef in inline context.
This way we don't get an error when this is used as a moveable
argument.

Closes #2136.
2015-10-13 21:48:14 -07:00
John MacFarlane
25e0e0bd2a epub with --webtex: include image file rather than data: URI.
Closes #2363.
2015-10-13 21:19:43 -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
fb51077712 Revert "RST writer: tweaks to header normalization."
This reverts commit 476b383c57.
2015-10-12 22:44:37 -07:00
John MacFarlane
476b383c57 RST writer: tweaks to header normalization.
These changes are intended to make the writer more
useful to people who are processing small fragments,
which may for example look like this:

    ### third level header from previous section

    ## second level header

Previously such fragments got turned into two
headers of the same level.  The new algorithm
avoids doing any normalization until we hit the
minimal-level header in the fragment (here, the
second level header).

Closes #2394.
2015-10-12 22:04:40 -07:00
John MacFarlane
0b91c73456 Removed unnecessary import. 2015-10-11 17:27:00 -07:00