Commit graph

3334 commits

Author SHA1 Message Date
John MacFarlane
a008e57ddf hlint fixes 2015-11-22 07:43:48 -08:00
John MacFarlane
f7e37141e5 hlint fixes 2015-11-22 07:42:11 -08:00
John MacFarlane
bbb3d8d442 hlint changes 2015-11-22 07:40:26 -08:00
John MacFarlane
a7f6241f50 hlint fixes. 2015-11-22 07:38:51 -08:00
John MacFarlane
4b293a6a54 hlint fixes. 2015-11-22 07:37:51 -08:00
John MacFarlane
c5b9ae3060 ImageSize: use safeRead instead of readMaybe.
readMaybe is only provided in base 4.6+.
2015-11-21 08:46:01 -08:00
John MacFarlane
73e2d7976c Renamed link attribute extensions.
* Old `link_attributes` -> `mmd_link_attributes`
* Recently added `common_link_attributes` -> `link_attributes`

Note: this change could break some existing workflows.
2015-11-19 23:17:50 -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
John MacFarlane
1ad296dc69 Merge pull request #2532 from michaelbeaumont/fix-2530
Interpret pauses correctly for all headers
2015-11-19 21:06:53 -08:00
John MacFarlane
fdc81be7d2 Merge pull request #2506 from adunning/patch-1
Remove redundant `center` variable for reveal.js.
2015-11-19 21:03:31 -08:00
John MacFarlane
ed1173ace6 Rationalized behavior of --no-tex-ligatures and --smart.
This change makes `--no-tex-ligatures` affect the LaTeX reader
as well as the LaTeX and ConTeXt writers.  If it is used,
the LaTeX reader will parse characters `` ` ``, `'`, and `-`
literally, rather than parsing ligatures for quotation marks
and dashes.  And the LaTeX writer will print unicode quotation
mark and dash characters literally, rather than converting
them to the standard ASCII ligatures.

Note that `--smart` has no affect on the LaTeX reader.

`--smart` is still the default for all input formats when
LaTeX or ConTeXt is the output format, *unless* `--no-tex-ligatures`
is used.

Some examples to illustrate the logic:

```
% echo "'hi'" | pandoc -t latex
`hi'
% echo "'hi'" | pandoc -t latex --no-tex-ligatures
'hi'
% echo "'hi'" | pandoc -t latex --no-tex-ligatures --smart
‘hi’
% echo "'hi'" | pandoc -f latex --no-tex-ligatures
<p>'hi'</p>
% echo "'hi'" | pandoc -f latex
<p>’hi’</p>
```

Closes #2541.
2015-11-19 20:30:41 -08:00
Jesse Rosenthal
da4103bc42 Docx reader: Clean up commented-out function
A residue of a recent change was left around in the form of a
commented-out function. Let's clean that up.
2015-11-18 14:06:13 -05:00
Jesse Rosenthal
5527465c77 Docx reader: Handle dummy list items.
These come up when people create a list item and then delete the
bullet. It doesn't refer to any real list item, and we used to ignore
it.

We handle it with a DummyListItem type, which, in Docx.hs, is turned
into a normal paragraph with a "ListParagraph" class. If it follow
another list item, it is folded as another paragraph into that item. If
it doesn't, it's just its own (usually indented, and therefore
block-quoted) paragraph.
2015-11-18 13:02:57 -05:00
John MacFarlane
995f28ff07 Haddock writer: omit formatting inside links.
It isn't supported by Haddock.

Closes #2515.
2015-11-16 20:53:01 -08:00
John MacFarlane
469338a272 Textile reader: skip over attribute in image source.
We don't have a place yet for styles or sizes on images, but
we can skip the attributes rather than incorrectly taking them
to be part of the filename.

Closes #2515.
2015-11-16 20:43:07 -08: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
John MacFarlane
74cf52728e HTML writer: Include example class for example lists.
Closes #2524.
2015-11-16 09:57:28 -08:00
John MacFarlane
593cbd8142 Docx writer: insert space between footnote ref and footnote.
This matches Word's default behavior.  Closes #2527.
2015-11-15 07:53:40 -08:00
John MacFarlane
8f5ff7075c Derive Generic instances for types in Text.Pandoc.Options. 2015-11-14 17:46:55 -08:00
John MacFarlane
420c86b69a Allow more customization of opendocument styles.
Automatic styles can now be inserted in the template,
since the template, not the writer, now provides the
enclosing `<office:automatic-styles>` tags.

Closes #2520.
2015-11-14 17:19:25 -08:00
michaelbeaumont
8b289326a7 Interpret pauses correctly for all headers
Previously, when using headers below the slide level, pauses are left
uninterpreted into pauses. In my opinion, unexpected behavior but
intentional looking at the code.

Fixes #2530
2015-11-15 01:37:39 +01:00
Jesse Rosenthal
e5b374e2ca Follow relationships correctly in foot/endnotes.
There are separate relationship (link) files for foot and
endnotes. These had previously been grouped together which led to
links not working correctly in notes. This should finally fix that.
2015-11-14 13:41:34 -05:00
John MacFarlane
37285b432c Text.Pandoc.Emoji: use hex escapes instead of Unicode in source.
Some of the unicode characters cause ghc parse errors in older
ghc versions.
2015-11-13 14:18:02 -08: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
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
Andrew Dunning
6c27e5f2c1 Remove redundant center variable for reveal.js.
This is no longer needed with the updates to the template in da139313d2
2015-11-09 09:38:12 -05: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