Commit graph

3347 commits

Author SHA1 Message Date
Raniere Silva
13f74d018b Add support to GAP 2015-12-03 08:23:26 -02:00
mb21
d901a3da03 Textile Reader: image attributes
closes #2515
2015-12-03 00:06:18 +01:00
mb21
1f379da94b Parse CSS that doesn't contain the optional semicolon 2015-12-02 23:56:44 +01:00
John MacFarlane
622f09617e Docx writer: better handling of PDF images.
Previously we tried to get the image size from the image even
if an explicit size was specified.  Since we still can't get
image size for PDFs, this made it impossible to use PDF images
in docx.

Now we don't try to get the image size when a size is already
explicitly specified.
2015-12-01 00:23:03 -08:00
John MacFarlane
6d91fb2563 Markdown writer: use raw HTML for link/image attributes when
the `link_attributes` extension is unset and `raw_html` is set.

Closes #2554.
2015-11-24 23:28:52 -08:00
John MacFarlane
33d328f1cf Allow pipe tables with no body rows.
Previously this raised a runtime error.

Closes #2556.
2015-11-24 20:23:06 -08:00
John MacFarlane
c73ae81628 LaTeX reader: Improved smart quote parsing.
This fixes redering of unmatched quotes.
Closes #2555.
2015-11-24 17:20:15 -08:00
John MacFarlane
ce5583460c Improved fetchItem so that C:/Blah/Blah.jpg isn't treated as URL.
The Haskell URI parsing routines will accept "C:" as a scheme,
so we rule that out manually.

This helps with `--self-contained` and absolute Windows paths.
See
http://stackoverflow.com/questions/33899126/rchart-in-markdown-doesnt-render-due-to-invalidurlexception-from-pandoc
2015-11-24 11:05:31 -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
2633dc2f5e Beamer writer: mark frame as fragile when it contains verbatim.
Closes #1613.
2015-11-23 23:07:56 -08:00
John MacFarlane
b20ecbedc4 AsciiDoc writer: Fixed code blocks.
Closes #1861.
2015-11-23 21:29:21 -08:00
John MacFarlane
4361dc0245 Define a meta-json variable for all writers.
This contains a JSON version of all the metadata, in the
format selected for the writer.

So, for example, to get just the YAML metadata, you can
run pandoc with the following custom template:

    $meta-json$

Closes #2019.  The intent is to make it easier for static
site generators and other tools to get at the metadata.
2015-11-23 20:40:27 -08:00
Jesse Rosenthal
07b8a456b1 Docx Reader: Remove DummyListItem type
Change 5527465c introduced a `DummyListItem` type in Docx/Parse.hs. In
retrospect, this seems like it mixes parsing and iterpretation
excessively. What's *really* going on is that we have a list item
without and associate level or numeric info. We can decide what to do
what that in Docx.hs (treat it like a list paragraph), but the parser
shouldn't make that decision.

This commit makes what is going on a bit more explicit. `LevelInfo` is
now a Maybe value in the `ListItem` type. If it's a Nothing, we treat
it as a ListParagraph. If it's a Just, it's a normal list item.
2015-11-23 11:50:49 -05:00
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