Commit graph

3161 commits

Author SHA1 Message Date
John MacFarlane
48eaadc57f Fixed pipe tables -- headerless tables are not allowed.
GFM and PHP Markdown Extra pipe tables require headers.
Previously pandoc allowed pipe tables not to include headers,
and produced headerless pipe tables in Markdown output, but this
was based on a misconception about pipe table syntax. This
commit fixes this.

Note:  If you have been using headerless pipe tables, this may
cause existing tables to break.

Closes #1996.
2015-03-07 10:40:13 -08:00
Sumit Sahrawat
ad9e4cde9d Fix issue #969, #1779 by providing --latex-engine-opt 2015-03-04 15:25:56 +05:30
Nikolay Yakimov
65c80822e7 Code cleanup 2015-03-03 13:08:52 +03:00
Nikolay Yakimov
409111f647 Started moving StyleMap out of writer code 2015-03-01 22:57:35 +03:00
Nikolay Yakimov
13daf3ed6a Update Docx writer for 1cb601d reference.docx 2015-03-01 18:49:44 +03:00
John MacFarlane
4f0c5c3080 HTML writer: include raw latex blocks if --mathjax specified.
Closes #1938.
2015-02-25 21:40:40 -08:00
John MacFarlane
4b43531a70 Markdown writer: don't emit span tags if plain or raw HTML disabled. 2015-02-25 21:15:28 -08:00
John MacFarlane
7af3e23bdf Define isRight since it's only in recent versions of Data.Either. 2015-02-25 14:45:00 -08:00
John MacFarlane
9a5e081073 Markdown writer: Avoid introducing spurious list items through wrapping.
Closes #1946.
2015-02-25 10:16:05 -08:00
John MacFarlane
8e404aaca0 LaTeX writer: recognize book documentclass if set in metadata.
This sets `--chapters` implicitly if the documentclass in metadata
is a book documentclass.  Previously this was done only if a book
documentclass was set in a variable.

Closes #1971.
2015-02-25 08:57:30 -08:00
John MacFarlane
47bfdca049 Markdown reader: check for tex macros after indented code.
Closes #1973.
2015-02-25 08:33:42 -08:00
Hans-Peter Deifel
2ca5101113 Org reader: Allow image links with non-image targets
Org-Mode's own html exporter converts the following org link:

  [[http://example.com][https://www.haskell.org/static/img/logo.png]]

to

  <a href="http://example.com">
  <img src="https://www.haskell.org/static/img/logo.png" alt="logo.png" />
  </a>

but pandoc generates:

  <a href="http://example.com">
  <a href="https://www.haskell.org/static/img/logo.png" class="uri">
   https://www.haskell.org/static/img/logo.png
  </a>
  </a>

which is useless. With this patch, it generates:

  <a href="http://example.com">
  <img src="https://www.haskell.org/static/img/logo.png" alt="" />
  </a>
2015-02-25 16:58:48 +01:00
John MacFarlane
ae3142f919 Docbook writer: don't print empty id attributes.
Thanks to Steve Horne for reporting.
2015-02-25 06:59:43 -08:00
Nikolay Yakimov
ba153585db Comment out unused functions to make CI happy 2015-02-24 02:34:46 +03:00
Nikolay Yakimov
908a47e4b9 Treat some ambiguous styles as custom for now
* Author
* Abstract
* Compact
* ImageCaption
* TableCaption
* DefinitionTerm
* Definition
* FirstParagraph
2015-02-24 02:31:14 +03:00
Nikolay Yakimov
47c70b9131 Do not lookup custom styles 2015-02-23 02:05:32 +03:00
Nikolay Yakimov
7ae7f0c051 Also skip SourceCode style if exists 2015-02-23 01:53:47 +03:00
Nikolay Yakimov
8b3acde9de If --no-highlight is set, remove *Tok styles. 2015-02-22 23:25:12 +03:00
Nikolay Yakimov
80715ecd7a Prototype fix for #1872 2015-02-22 00:19:58 +03:00
Nikolay Yakimov
5cdd11725c Initial stab at more involved fix for #1607
This patch attempts to build a style name -> style id mapping based on styles.xml from reference doc, and changes pStyle and rStyle to accept style name as a parameter instead of styleId. There is a fallback mechanic that removes spaces from style name and returns it as style id, but it likely won't help much.

Style names are matched lower-case, since headings and `footnote text` have lowercase names.
2015-02-21 22:20:18 +03:00
Jesse Rosenthal
a7c67c897e Docx reader: Minor cleanup.
The previous commits had some code repetition. This just makes it a bit
easier to read.
2015-02-21 09:18:53 -05:00
Jesse Rosenthal
55d2ce751a Docx reader: allow sub/superscript verbatims.
Verbatim usually shuts off all other run styles, but we don't want it to
shut off sub/superscript.
2015-02-21 08:41:09 -05:00
Matthew Pickering
274efc4a71 LaTeX Writer: Don't use listings in headers
Fixes #1963
2015-02-20 09:35:36 +00:00
Jesse Rosenthal
a01913b45c Docx reader: Allow numbering in the style file.
This allows inherited styles with numbering (lists). It works like this:

 1. check to see if the style has numbering info.
 2. if the paragraph has explicit numbering info in the doc that takes
 precedence.
 3. if not we use the numbering info in the style, if it's there.
 4. otherwise normal paragraph.

We no longer assume it's not a numbering element if it doesn't have an
explicit level---we just set that level to 1. (In the style files, the
examples I've seen don't have that explicit level.)
2015-02-19 00:17:04 -05:00
Matthew Pickering
ad39bc7009 Move utility error functions to Text.Pandoc.Shared 2015-02-18 21:09:07 +00:00
Matthew Pickering
48f442f477 Update haddocks and copyright notices 2015-02-18 21:09:07 +00:00
Matthew Pickering
be943a561f Update Pandoc.hs 2015-02-18 21:09:07 +00:00
Matthew Pickering
615aa94c3d Make safeRead safe.
Fixes #1801
2015-02-18 21:09:07 +00:00
Matthew Pickering
b02b5b9d5e Change return type of Txt2Tags reader 2015-02-18 21:09:07 +00:00
Matthew Pickering
6de6eae737 Change return type of Textile reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
f61db38290 Change return type of TWiki reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
2b7073860b Change return type of RST reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
4c91049345 Change return type of Org reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
db6baab217 Change return type of OPML reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
ef2a8107e2 Change return type of Native reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
41d9527533 Change return type of Mediawiki reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
acefbe99a9 Change return type of Markdown reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
b8acb9f541 Change return type of LaTeX reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
9f6a92d664 Change return type of Haddock reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
b9e04825cf Change return type of HTML reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
b935ef6de5 Change return type of EPUB reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
1b12340859 Change return type of Docx reader 2015-02-18 21:09:06 +00:00
Matthew Pickering
dcb4951aad Change return type of DocBook reader 2015-02-18 21:09:05 +00:00
Matthew Pickering
8381ac3b02 Add Text.Pandoc.Error module with PandocError type 2015-02-18 21:09:05 +00:00
Matthew Pickering
ef981492fd Remove partial function from Pretty 2015-02-18 20:11:08 +00:00
Matthew Pickering
bf8667660d Remove landmine from ImageSize 2015-02-18 20:11:08 +00:00
Matthias C. M. Troffaes
dccd408a9c Allow digit as first character of a citation key.
* Update parser to recognize citation keys starting with a digit.
* Update documentation accordingly.
* Test case added.

See https://github.com/jgm/pandoc-citeproc/issues/97
2015-02-18 15:30:17 +00:00
Matthew Pickering
9cd0bdb41a Factor out "returnState" into Parsing module 2015-02-18 12:50:21 +00:00
Matthew Pickering
febe5112af HLint changes 2015-02-18 12:50:21 +00:00
Matthew Pickering
13fb1d6101 Remove F Monad from Markdown reader 2015-02-18 12:50:21 +00:00
Matthew Pickering
dc450d80a1 Generalise signature of addWarning 2015-02-18 12:50:21 +00:00
Matthew Pickering
d4ab579dc3 Add check to see whether in a footnote to ParserState (to avoid circular footnotes) 2015-02-18 12:50:21 +00:00
Matthew Pickering
2b58060007 Remove F monad from Parsing 2015-02-18 12:50:21 +00:00
Matthew Pickering
9d77206827 Changed parseWithWarnings to the more general returnWarnings parser transformer 2015-02-18 12:50:21 +00:00
Matthew Pickering
e8677bae78 Remove F monad from Org Reader. 2015-02-18 12:50:21 +00:00
Matthew Pickering
7a649170be Added generalize function which can be used to lift specialised parsers.
Monad m => Parsec s st a -> Parsec T s st m a
2015-02-18 12:50:20 +00:00
John MacFarlane
3480189e8e ICML writer: Better handling of raw blocks and inlines.
Previously these were always escaped and printed verbatim.
Now they are ignored unless the format is "icml", in which
case they are passed through unescaped.

Closes #1951.
2015-02-17 08:50:48 -08:00
John MacFarlane
e32227f744 Allow wildcards in --epub-embed-font arguments.
Closes #1939.
2015-02-13 23:34:20 -08:00
John MacFarlane
d5469b30fe Improved building of data URIs in SelfContained.
Now base64 is used except for 'text/*' mime types.  Closes #1940.
2015-02-13 21:37:43 -08:00
Jesse Rosenthal
24fd0ad04d Docx reader: Handle lists correctly inside table cells.
Previously we didn't transform lists inside table cells.
2015-02-13 09:02:16 -05:00
Jesse Rosenthal
ba59e5447f Docx writer: Add footnotes id -1 and 0.
Word uses, by default, footnotes with id -1 and 0 for separators. If a
user modifies reference.docx, they will end up with a settings.xml file
that references these footnotes, but no such footnotes in the
document. This will produce a corruption error. Here we add these to the
document and settings.xml file, so future modifications won't break the file.
2015-02-12 09:21:41 -05:00
Jesse Rosenthal
96d5c8a5dc Docx Writer: Add "BodyText" Style
We apply a "BodyText" style to all unstyled paragraphs. This is,
essentially, the same as "Normal" up until now -- except that since not
everything inherits from "BodyText" (the metadata won't, for example, or
the headers or footnote numbers) we can change the text in the body
without having to make exceptions for everything.

This will still inherit from Normal, so if we want to
change *everything*, we can do it through "Normal".
2015-02-11 15:06:36 -05:00
Jesse Rosenthal
25ef68d266 Docx Writer: Use FirstParagraph style at beginning.
Before we had used `FirstParagraph` style after Headings, BlockQuotes,
and other blocks a user might not want an indentation after. We hadn't
actually used it for the first paragraph -- i.e. the opening of the
body. This makes sure the first body paragraph gets that style.
2015-02-10 21:05:13 -05:00
Jesse Rosenthal
daab4c3f22 Docx Writer: Implement FirstParagraph Style
Following the odt writer, we make the first text paragraph following an
image, blockquote, table, or heading into a "FirstParagraph" style. This
allows it to be styled differently, if the user wishes. The default is
for it to be the same as "Normal"
2015-02-09 23:22:52 -05:00
John MacFarlane
12962e2332 Merge pull request #1927 from freephile/master
update syntax for Images/Media files in MediaWiki
2015-02-07 20:33:33 -08:00
John MacFarlane
bd7cf8dbd5 Merge branch 'patch/fixTexinfoWrap' of https://github.com/timtylin/scholdoc into timtylin-patch/fixTexinfoWrap
Conflicts:
	src/Text/Pandoc/Writers/Texinfo.hs
2015-02-07 20:28:56 -08:00
Tim Lin
858ebf99eb Texinfo writer: fix wrapping by using breakable spaces 2015-02-06 01:16:40 -08:00
Greg Rundlett
218f28af6d update syntax for Images/Media files in MediaWiki
The preferred syntax for Images and other media is [[File:Foo.jpg]] in MediaWiki since v1.14 (2008).  [[Image:Foo.jpg]] is deprecated but still works as an alias to the File namespace.  I don't think this would break any existing wikis since talk of switching the syntax/namespace for images started back in 2002 (https://phabricator.wikimedia.org/T2044).  NS_FILE became the new namespace for Files in v 1.14 in late 2008. (https://www.mediawiki.org/wiki/Release_notes/1.14)  There is still a namespace alias so '[[Image:]]' still works today.  It's just that MediaWiki supports other media as well, and so the name and syntax used in documentation (see https://www.mediawiki.org/wiki/Help:Images) has long been '[[File:foo.jpg]]'
2015-02-05 17:07:50 -05:00
Tim Lin
0c18f3a854 Append newline to the LineBreak of various writers
This change improves output formatting of content with a large amount of force line breaks, such as line-blocks. The following writers are affected:

* Dokuwiki
* HTML
* EPUB (via HTML)
* LaTeX
* MediaWiki
* OpenDocument
* Texinfo

This commit resolves #1924
2015-02-04 22:42:22 -08:00
John MacFarlane
fb7a03dcda Textile reader: table improvements.
* Handle newlines in cells.
* Handle empty cells.
* Closes #1919.
2015-02-02 10:45:50 -08:00
John MacFarlane
7050c26abc LaTeX writer: Don't escape $ in URL. Closes #1913. 2015-02-01 11:19:55 -08:00
John MacFarlane
6a0d4da382 HTML writer: Add "inline" or "display" class to math spans.
This allows inline and display math to be styled differently.

Closes #1914.
2015-02-01 11:08:27 -08:00
Konstantin Zudov
92e762c2d6 Refactored if x then [] else y to [y | not x] 2015-01-29 22:36:23 +02:00
Konstantin Zudov
b5cc01e976 Do not ommit missing alt attribute on img tag
Fixes #1131
2015-01-29 22:16:38 +02:00
John MacFarlane
82c04a28ce Fixed list-style-type for numbered example lists.
Should be "decimal," not "example."  Closes #1902.
2015-01-27 16:56:56 -08:00
John MacFarlane
33d1c8cc01 Merge pull request #1885 from mb21/html-reader-tables
fixes HTML Reader: tables
2015-01-25 10:46:47 -08:00
mb21
b40d33b174 fixes #1859 HTML Reader table parsing 2015-01-25 09:41:12 +01:00
John MacFarlane
d90dc6b8b5 LaTeX reader: don't limit includes to .tex extension.
Previously `\input` and `\include` would only work if the
included files had the extension `.tex`.  This change relaxes
that restriction, though if the extension is not `.tex`, it
must be given explicitly in the `\input` or `\include`.

Closes #1882.
2015-01-22 23:17:25 -08:00
Jesse Rosenthal
eb11c61182 Docx: Parse images in deprecated vml format.
Some older versions of word use vml (vector markup language) and put
their images in a "v:imagedata" tag inside a "w:pict". We read those as
we read the more modern "blip" inside a "w:drawing".

Note that this does not mean the reader knows anything about vml. It
just looks for a `v:imagdata`. It's possible that, with more complicated
uses of images in vml, it won't do the right thing.
2015-01-21 13:41:16 -05:00
John MacFarlane
8a7db5cc9d Use CPP to avoid unneeded import warning for blaze-markup >= 0.6.3.
See https://github.com/jgm/pandoc/pull/1888#issuecomment-70470409
2015-01-19 10:29:57 -08:00
John MacFarlane
030d3b597d Custom writer: Raise PandocLuaException instead of using 'error'.
Eventually we'll change the return type so that no exception
is involved, but at least this can be trapped.
2015-01-18 22:04:42 -08:00
John MacFarlane
ab8b00ea0c Custom writer: raise error if loadstring returns an error status.
This will make debugging custom scripts much easier.
2015-01-18 21:48:04 -08:00
John MacFarlane
25e12ca7b2 EPUB writer: properly handle internal links to IDs in spans, divs.
Closes #1884.
2015-01-17 11:27:49 -08:00
mb21
6aa41b86d0 don't log Try xelatex if xelatex already in use, closes #1832 2015-01-11 15:24:04 +01:00
Mark Wright
9c68017786 ghc 7.10.1 RC1 requires specifying the type of String literals https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof... 2015-01-05 14:48:01 +11:00
Mark Wright
dbe1b38816 ghc 7.10.1 RC1 requires specifying the type of String literals https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof... 2015-01-05 14:47:33 +11:00
Mark Wright
5ea3856bb0 ghc 7.10.1 RC1 requires FlexibleContexts https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#Inferredtype-signaturesnowmayrequiretoenableFlexibleContextsGADTsorTypeFamilies 2015-01-05 14:46:57 +11:00
Mark Wright
c80c9ac9da ghc 7.10.1 RC1 requires specifying the type of String literals https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof... 2015-01-05 14:46:40 +11:00
Mark Wright
8b9bded796 ghc 7.10.1 RC1 requires specifying the type of String literals https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof... 2015-01-05 14:46:15 +11:00
Mark Wright
e4c7894d01 ghc 7.10.1 RC1 requires FlexibleContexts https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#Inferredtype-signaturesnowmayrequiretoenableFlexibleContextsGADTsorTypeFamilies 2015-01-05 14:42:45 +11:00
Mark Wright
2a6f68f4bf ghc 7.10.1 RC1 requires FlexibleContexts https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#Inferredtype-signaturesnowmayrequiretoenableFlexibleContextsGADTsorTypeFamilies 2015-01-05 14:42:26 +11:00
Mark Wright
4e3281c550 ghc 7.10.1 RC1 requires specifying the type of String literals https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof... 2015-01-05 14:41:54 +11:00
Mark Wright
cd5b1fe5e3 ghc 7.10.1 RC1 requires specifying the type of String literals https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof... 2015-01-05 14:41:35 +11:00
Mark Wright
ed7606da9a ghc 7.10.1 RC1 requires FlexibleContexts https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#Inferredtype-signaturesnowmayrequiretoenableFlexibleContextsGADTsorTypeFamilies 2015-01-05 14:40:59 +11:00
Mark Wright
b748833889 ghc 7.10.1 RC1 requires FlexibleContexts https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#Inferredtype-signaturesnowmayrequiretoenableFlexibleContextsGADTsorTypeFamilies ; ghc 7.10.1 RC1 requires specifying the type of String literals https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof... 2015-01-05 14:40:30 +11:00
Mark Wright
10d53989d8 ghc 7.10.1 RC1 requires FlexibleContexts https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#Inferredtype-signaturesnowmayrequiretoenableFlexibleContextsGADTsorTypeFamilies ; ghc 7.10.1 RC1 requires specifying the type of String literals https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof... 2015-01-05 14:40:06 +11:00
Mark Wright
f18ceb1b5e ghc 7.10.1 RC1 requires specifying the type of String literals https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof... 2015-01-05 14:38:06 +11:00
Mark Wright
693f9abb18 Allow haddock-library 1.2, by calling the Documentation.Haddock.Types.MetaDoc record accessor function _doc :: MetaDoc mod id -> DocH mod id 2015-01-05 14:35:31 +11:00
John MacFarlane
e7187fa3bb LaTeX reader: handle tabular* environment.
This change allows pandoc not to choke on the table-width parameter
of `tabular*`.  Note that the table width is not actually parsed
or taken into account, but this should give tolerable results in
many cases.

Closes #1850.
2015-01-01 08:46:45 -08:00
John MacFarlane
52310eb470 SelfContained: Add ;charset=utf-8 to script mime type if missing.
Closes #1842.
2014-12-31 14:51:23 -08:00
John MacFarlane
e3422dc438 Added --verbose flag for debugging output in PDF production.
Closes #1840.
Closes #1653.
2014-12-26 11:19:55 -07:00
John MacFarlane
2c3310a592 Added Text.Pandoc.Compat.Locale to assist with transition to time 1.5. 2014-12-19 16:13:38 -08:00
John MacFarlane
005eda2f02 MediaWiki writer: Fixed links with URL = text.
Previously these were rendered as bare words, even if the URL
was not an absolute URL.

Closes #1825.
2014-12-19 11:32:37 -08:00
John MacFarlane
7e41d0b1ee LaTeX reader: parse math environments as inline when possible.
Closes #1821.
2014-12-16 12:27:04 -08:00
John MacFarlane
fcd1599b09 FB2 writer: Add newline to output. 2014-12-15 22:14:29 -08:00
John MacFarlane
4c03231e9b getDefaultTemplate: don't fail when called with "fb2".
Closes #1660.
2014-12-15 22:10:03 -08:00
John MacFarlane
08abbc4604 LaTeX writer: Handle consecutive linebreaks.
Closes #1733.
2014-12-15 22:04:18 -08:00
John MacFarlane
58ea1ce5f1 LaTeX reader: parse label after caption into a span...
instead of inserting an additional paragraph of bracketed text.
Closes #1747.
2014-12-15 21:50:10 -08:00
John MacFarlane
0eb3f8cff2 HTML writer: put newline btw img and caption paragraph. 2014-12-15 21:49:16 -08:00
John MacFarlane
61d2c2e8cb LaTeX writer: better handling of display math in simple tables.
We convert display math to inline math in simple tables,
since LaTeX can't deal with display math in simple tables.

Closes #1754.
2014-12-15 21:14:07 -08:00
John MacFarlane
cb8bb4705f EPUB writer: include "landmarks" section in nav document for epub3.
Closes #1757.
2014-12-15 20:56:03 -08:00
John MacFarlane
8a3363a269 Merge branch 'patch-1' of https://github.com/Wikiwide/pandoc into Wikiwide-patch-1
Conflicts:
	src/Text/Pandoc/Readers/LaTeX.hs
2014-12-15 20:27:42 -08:00
Matthew Pickering
e6bd29e9b8 Text.Pandoc.Writers.RTF: Add blankline at end of output
Closes #1732
2014-12-15 21:35:47 +00:00
Matthew Pickering
a17f6f2f39 Text.Pandoc.Readers.HTML: Retain display type of MathML output
Closes #1719
2014-12-15 21:35:47 +00:00
Matthew Pickering
58e4e4a608 Text.Pandoc.Parsing: Change parseFromString to fail if not all input is
consumed.
2014-12-15 21:35:46 +00:00
John MacFarlane
a5cac0a0c4 Don't treat a citation as a reference link label.
Closes #1763.
2014-12-15 10:54:12 -08:00
John MacFarlane
9bf76fa5a2 LaTeX reader: better handling of \noindent and \greektext.
Closes #1783.
2014-12-15 10:34:59 -08:00
John MacFarlane
c37db57c9a EPUB writer: Removed playOrder from navpoint elements in ncx file.
These aren't required, and they make manual modification of epubs
difficult.  Closes #1760.
2014-12-15 10:22:19 -08:00
John MacFarlane
47c360e079 Improved texorpdfstring patch #1148.
* Make LaTeX reader recognize texorpdfstring.
* Don't use texorpdfstring unless it's actually needed.
* Fix tests.
2014-12-15 10:06:03 -08:00
John MacFarlane
544f3e5b45 Merge branch 'use-texorpdfstring' of https://github.com/wilx/pandoc into wilx-use-texorpdfstring
Conflicts:
	src/Text/Pandoc/Writers/LaTeX.hs
	tests/Tests/Writers/LaTeX.hs
2014-12-15 10:01:50 -08:00
John MacFarlane
a864e9a348 Merge pull request #1805 from bergey/rst
RST Reader - Improved Role Support
2014-12-15 09:06:45 -08:00
John MacFarlane
9e75b9b84b DocBook readers: Include id on section headers.
Closes #1818.
2014-12-14 23:46:25 -08:00
John MacFarlane
269b33d24b DocBook reader: Handle menuchoice elements better.
They are now rendered with a `>` between them.
Closes #1817.
2014-12-14 23:37:54 -08:00
John MacFarlane
c350847943 DocBook reader: get string content in inner tags for literal elements.
Closes #1816.
2014-12-14 19:12:48 -08:00
John MacFarlane
9e83cd62a6 DocBook reader: handle keycombo, keycap.
Closes #1815.
2014-12-14 19:03:48 -08:00
John MacFarlane
1d3ca088f2 Merge pull request #1813 from tarleb/file-links
Org reader: properly handle links to `file:target`
2014-12-14 13:36:34 -08:00
Albert Krewinkel
4d85b17fc5 Org reader: properly handle links to file:target
Org links like `[[file:target][title]]` were not handled correctly,
parsing the link target verbatim.  The org reader is changed such that
the leading `file:` is dropped from the link target.

This is related to issues #756 and #1812.
2014-12-14 21:30:10 +01:00
John MacFarlane
2b08e32a90 Fixe autolinks with following punctuation.
Closes #1811.
The price of this is that autolinked bare URIs can no longer
contain `>` characters, but this is not a big issue.
2014-12-14 12:20:33 -08:00
Daniel Bergey
ea157cf23f RST: warn about ignored fields in role directives 2014-12-12 14:45:45 +00:00
Daniel Bergey
689fb112bf RST Reader: compute Attrs when role is defined
Move recursive role lookup from renderRole to addNewRole.  The Attr value
will be the same for every occurance of this role, so there's no reason
to compute it every time.  This allows simplifying the
stateRstCustomRoles map considerably.

We could go even further, and remove the fmt and attr arguments to
renderRole, which are null except for custom roles.
2014-12-12 14:45:45 +00:00
Daniel Bergey
dc3ea9840e RST reader: improve support for custom roles
- Add "sourceCode" to classes for :code: role, and anything inheriting
  from it.
- Add the name of the custom role to classes if the Inline constructor
  supports Attr.
- If the custom role directive does not specify a parent role, inherit
  from the :span: role.

This differs somewhat from the rst2xml.py behavior.  If a custom role
inherits from another custom role, Pandoc will attach both roles' names
as classes.  rst2xml.py will only use the class of the directly invoked
role (though in the case of inheriting from a :code: role with a
:language: defined, it will also provide the inherited language as a
class).
2014-12-12 14:45:45 +00:00
Daniel Bergey
dba066a33d RST: literal role should produce Code,
code role should have "code" class.

http://docutils.sourceforge.net/docs/ref/rst/roles.html says that
`text`:literal` is the same as ``text``.  docutils outputs a <literal>
element in both cases, whereas for the code role, it outputs a <literal>
element with the "code" class.
2014-12-12 14:45:44 +00:00
Daniel Bergey
15816853a3 expose warnings from RST reader; refactor
This commit moves some code which was only used for the Markdown Reader
into a generic form which can be used for any Reader.  Otherwise, it
takes naming and interface cues from the preexisting Markdown code.
2014-12-12 14:45:44 +00:00
John MacFarlane
4ffa70970d Merge pull request #1695 from bjornbm/master
Escape inline verbatim spaces in LaTeX output
2014-12-10 09:07:46 -08:00
Bryan O'Sullivan
2150903230 DocBook reader: document/test "type" as implemented 2014-12-08 23:17:27 -08:00
Bryan O'Sullivan
fe1d147187 DocBook reader: add support for classname 2014-12-08 23:12:06 -08:00
Bryan O'Sullivan
33fdb6bc15 DocBook reader: add support for calloutlist and callout
We treat a calloutlist as a bulleted list. This works well in practice.
2014-12-08 22:26:09 -08:00
Matthew Pickering
48e2586ec8 Merge pull request #1746 from shelf/dw-ext-images
DokuWiki writer: fix external images
2014-12-08 23:55:36 +00:00
Nikolay Yakimov
f7b265e2ff Fix for #1641 (docx table captions above tables)
Word doesn't really treat table captions as something special. It's just a paragraph with special style, nothing more, so simple reversal of output order in writer works fine.
2014-12-08 22:50:57 +00:00
Daniel Bergey
87e536b438 RST Reader: Warn about skipped directives
move `addWarning` to Parsing.hs, so it can be used by Markdown & RST readers.
2014-12-08 14:43:04 +00:00
Matthew Pickering
068bdbbc91 Merge pull request #1716 from lierdakil/issue1607-pullreq
First step to fixing internationalisation problems with docx output
2014-12-07 16:44:24 +00:00
Matthew Pickering
9761283c8f Text.Pandoc.Pretty: Improve performance of realLength
Eliminates memory usage and twofold increase in speed.
2014-12-06 22:58:40 +00:00
Daniel Bergey
74c1b547c2 parse RST class directives
The class directive accepts one or more class names, and creates a Div
value with those classes.  If the directive has an indented body, the
body is parsed as the children of the Div.  If not, the first block
folowing the directive is made a child of the Div.

This differs from the behavior of rst2xml, which does not create a Div
element.  Instead, the specified classes are applied to each child of
the directive.  However, most Pandoc Block constructors to not take an
Attr argument, so we can't duplicate this behavior.
2014-12-01 18:22:03 +00:00
Daniel Bergey
2cdfa5eb20 parse RST quoted literal blocks
closes #65
RST quoted literal blocks are the same as indented literal blocks (which
pandoc already supports) except that the quote character is preserved in
each line.

This includes test cases for the quoted literal block, as well as
additional tests for line blocks and indented literal blocks, to verify
that these are unaffected by the changes.
2014-12-01 18:22:03 +00:00
John MacFarlane
4d296f70df ICML writer: Don't force all citations into footnotes. 2014-11-30 22:30:04 -08:00
John MacFarlane
d8fde9547e Reverted "omit blank lines after list items," better fix for #1777.
Now we do as before, including blank lines after list items in
loose lists (even though RST doesn't care -- this is just a matter
of visual appeal).  But we chomp any excess whitespace after the
last list item, which solves #1777.
2014-11-25 12:34:44 -08:00
John MacFarlane
25e2c42347 RST writer: Omit blank lines after list items.
They are optional in RST (except after the last list item,
of course).

Fixes #1777.
2014-11-25 12:24:33 -08:00
John MacFarlane
dc92a62883 RST writer: Ensure blank line after figure. 2014-11-25 12:24:14 -08:00
John MacFarlane
6c0943000d LaTeX reader: support \smartcite and \Smartcite from biblatex.
See jgm/pandoc-citeproc#26.
2014-11-25 10:03:43 -08:00
John MacFarlane
159c711675 Fixed double-rendering of footnotes in RST tables.
Closes #1769.
2014-11-19 16:20:07 -08:00
John MacFarlane
7a5cb29319 Really fix #1758. Add id="cover" to body on cover page.
Not title page!
2014-11-17 15:43:40 -08:00
John MacFarlane
91a26fcdc4 Use regular page template for nav.xhtml.
This includes the HTML doctype.

Closes #1759.
2014-11-16 21:43:05 -08:00
John MacFarlane
4aadcd51b5 Make embed tag either block or inline.
Closes #1756.
2014-11-16 20:51:35 -08:00
John MacFarlane
333fc60684 Changed mime type for otf to application/vnd.ms-opentype.
Closes #1761.  This is needed for epub3 validation.
See http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.3.1
2014-11-16 20:29:38 -08:00
John MacFarlane
46d343f474 Fixed bug in org with bulleted lists:
- a
   - b
   * c

was being parsed as a list, even though an unindented `*`
should make a heading.  See
<http://orgmode.org/manual/Plain-lists.html#fn-1>.
2014-11-13 23:40:18 -08:00
Caleb McDaniel
196c4f2343 Account for external link URLs with anchors
Previously, if a URL had an anchor, such as

    http://johnmacfarlane.net/pandoc/README.html#synopsis

the reader would incorrectly identify it as an internal link
and return "#synopsis" for the link in output.
2014-11-13 00:42:58 -05:00
John MacFarlane
43c1978fae Merge pull request #1645 from neongreen/issue1636
Fix 'Ext_lists_without_preceding_blankline' bug.
2014-11-12 09:05:29 -08:00
Timothy Humphries
ffae1567fd DokuWiki writer: fix external images
Handles #1739. Preface relative links with ":", absolute URIs without.
2014-11-09 00:35:29 -05:00
Albert Krewinkel
e6cd8c9077 Org reader: allow empty links for gitit interop
While empty links are not allowed in Emacs org-mode,  Pandoc org-mode
should support them: gitit relies on empty links as they are used to
create wiki links.

Fixes jgm/gitit#471
2014-11-05 23:15:28 +01:00
Albert Krewinkel
daaf635806 Org reader: absolute, relative paths in links
The org reader was to restrictive when parsing links, some relative
links and links to files given as absolute paths were not recognized
correctly.  The org reader's link parsing function was amended to handle
such cases properly.

This fixes #1741
2014-11-05 22:27:25 +01:00
John MacFarlane
f3ac41937d DokuWiki writer: Better handling of block quotes.
This change ensures that multiple paragraph blockquotes are
rendered using native `>` rather than as HTML.

Closes #1738.
2014-11-04 14:52:19 -08:00
John MacFarlane
1d268876f8 Merge pull request #1726 from AlexanderS/twiki-parser
TWiki Reader: add new new twiki reader
2014-10-31 12:02:14 -07:00
John MacFarlane
deaefb18ca ODT writer: Correctly handle images without extensions.
Closes #1729.
2014-10-30 15:54:04 -07:00
Alexander Sulfrian
c3780992ab TWiki Reader: add new new twiki reader 2014-10-30 19:54:48 +01:00
Todd Sifleet
8ad321d0d4 Strip querystring in ODT write
* Resolve #1682
* Strip querystring from filename before rendering ODT files, ODT cannot
handle querystrings in files.
2014-10-28 18:45:36 -07:00
Nikolay Yakimov
96c4b9e2e6 Docx reader: fix for Issue #1692 (i18n styles)
This patch builds paragraph styles tree, then checks if paragraph has
style.styleId or style/name.val matching predetermined patterns.
Works with "Heading#" (name.val="heading #") for headings and
"Quote"|"BlockQuote"|"BlockQuotation" (name.val="Quote"|"Block Text")
for block quotes.
2014-10-25 15:54:44 -04:00
Nikolay Yakimov
3c894987b2 Docx Writer: Partial fix for #1607
International heading styles are inferred based on `<w:name val="heading #">` fallback, if there are no en-US "Heading#" styles
2014-10-24 23:57:06 +04:00
John MacFarlane
e16683b539 HTML writer: Make header attributes work outside top level.
Previously they only appeared on top level header elements.
Now they work e.g. in blockquotes.

Closes #1711.
2014-10-23 10:27:14 -07:00
John MacFarlane
e4f3475eaa DOCX writer: Look in user data dir for archive reference.docx. 2014-10-21 14:33:15 -07:00
John MacFarlane
78bdc08de7 Merge pull request #1706 from tarleb/org-symbol-entities
Org reader: parse LaTeX-style MathML entities
2014-10-21 10:11:19 -07:00
John MacFarlane
0714a363c6 Merge pull request #1668 from gbataille/widthFromRef2
Getting the page width from the reference file
2014-10-21 10:05:51 -07:00
John MacFarlane
7f6bbfadf4 Pretty: Make CR + BLANKLINE = BLANKLINE.
This fixes an extra blank line we were getting at the end
of markdown fragments (as well as rst, org, etc.)

Closes #1705.
2014-10-20 20:26:08 -07:00
Albert Krewinkel
a5eb02f6a7 Org reader: parse LaTeX-style MathML entities
Org supports special symbols which can be included using LaTeX syntax,
but are actually MathML entities.  Examples for this are
`\nbsp` (non-breaking space), `\Aacute` (the letter A with accent acute)
or `\copy` (the copyright sign ©).

This fixes #1657.
2014-10-20 22:57:36 +02:00
John MacFarlane
d7169c715d Parsing: fixed inlineMath so it handles \text{..} containing $.
For example: `$x = \text{the $n$th root of $y$}`.  Closes #1677.
2014-10-19 16:42:56 -07:00
John MacFarlane
328ff8e71f Markdown reader: allow startnum to work without fancy_lists.
Formerly `pandoc -f markdown-fancy_lists+startnum` did not work
properly.
2014-10-18 13:58:08 -07:00
John MacFarlane
84f6b1e41a Merge pull request #1680 from shelf/master
Respect indent when parsing Org bullet lists
2014-10-18 13:20:27 -07:00
John MacFarlane
31713d572a Merge pull request #1700 from tarleb/org-emphasis-fix
Org reader: fix rules for emphasis recognition
2014-10-18 13:19:42 -07:00
Albert Krewinkel
e3c36ed6ce Org reader: Drop COMMENT document trees
Document trees under a header starting with the word `COMMENT` are
comment trees and should not be exported.  Those trees are dropped
silently.

This closes #1678.
2014-10-18 22:11:53 +02:00
Albert Krewinkel
d571bec454 Org reader: fix rules for emphasis recognition
Things like `/hello,/` or `/hi'/` were falsy recognized as emphasised
strings.  This is wrong, as `,` and `'` are forbidden border chars and
may not occur on the inner border of emphasized text.  This patch
enables the reader to matches the reference implementation in that it
reads the above strings as plain text.
2014-10-18 12:47:59 +02:00
Timothy Humphries
f1f56e8533 Fix indent issue for definition lists
Tidy up fix for #1650, #1698 as per comments in #1680.
Fix same issue for definition lists with the same method.
2014-10-17 20:06:25 -04:00
Bjorn Buckwalter
7960013cd4 Escape spaces. Fixes jgm/pandoc#1694. 2014-10-15 21:06:41 +02:00
Timothy Humphries
4f4b0f031d Respect indent when parsing Org bullet lists
Fixes issue with top-level bullet list parsing.
Previously we would use `many1 spaceChars` rather than respecting
the list's indent level. We also permitted `*` bullets on unindented
lists, which should unambiguously parse as `header 1`.
Combined, this meant headers at a different indent level were
being unwittingly slurped into preceding bullet lists, as per
Issue #1650.
2014-10-12 03:18:36 -04:00
John MacFarlane
8b60d430f2 Merge pull request #1674 from freiric/master
fix inDirectory to reset to the original directory in case an exception ...
2014-10-08 15:48:59 -07:00
John MacFarlane
2eaa0f6ab1 EPUB reader: Further URI handling improvements.
Now we outsource most of the work to `fetchItem'`.
Also, do not include queries in file extensions.

Improves fix to #1671.

It is possible that this will have some unexpected effects, so
further testing would be good.
2014-10-08 15:45:50 -07:00
John MacFarlane
f8087b6c43 EPUB writer: correctly resolve relative URIs. (Closes #1671.) 2014-10-08 15:19:27 -07:00
John MacFarlane
a4d28cdd6d Fixed absolute URI detection in EPUB writer. Closes #1672. 2014-10-08 14:54:03 -07:00
Freiric Barral
24231623f3 fix inDirectory to reset to the original directory in case an exception occurs 2014-10-08 23:25:01 +02:00
John MacFarlane
d60707eed0 EPUB writer: Don't add sourceURL to absolute URIs!
Closes #1669.

If there are further issues, please open a new, targeted issue on the
tracker.  Some notes on the further issues you gestured at:

Data URIs are indeed dereferenced, but why is this a problem?
(The function being used to fetch from URLs is used for many different
formats.  Preserving data URIs would make sense in EPUBs, but not
for e.g. PDF output.  And by dereferencing we can get a smaller,
more efficient EPUB, with the data stored as bytes in a file rather
than encoded in textual representation.)

"absolute uris are not recognized" -- I assume that is the problem
just fixed.  If not, please open a new issue.

"relative uris are resolved (wrongly) like file paths" -- can you
give an example?

`<base>` tag is ignored.  Yes. I didn't know about the base tag.  Could
you open a new issue just for this?
2014-10-08 11:52:47 -07:00
Grégory Bataille
8a1a5948be Getting the page width from the reference file
Uses it to scale images that are too large.
When there is no reference files, default to a US letter portrait size
to scale the images
2014-10-05 14:53:06 +02:00
Jason Ronallo
3dc58090d2 add mime type for WebVTT 2014-10-04 22:40:02 -04:00
John MacFarlane
bf00556c72 Added track to list of tags treated by --self-contained.
Closes #1664.
2014-10-04 11:39:08 -07:00
Wikiwide
678aa31561 cref, sep
Adding inlineCommands
2014-10-03 11:33:02 +10:00
John MacFarlane
08ac33815b RST writer: Wrap line blocks with spaces before continuations.
Improves on fix to #1656.
2014-09-30 09:25:54 -07:00
John MacFarlane
29e1c9529f Don't wrap lines in rST line blocks.
Closes #1656.

Fixing pandoc to wrap the lines but insert spaces would be much
more complicated.  This at least makes the output semantically
correct.
2014-09-29 21:48:59 -07:00
John MacFarlane
fe6d43b3e0 Merge pull request #1601 from jkr/windowsfix
Fix path-slashes inside archive for windows
2014-09-27 16:21:17 -07:00
John MacFarlane
9c4e33f085 Merge pull request #1589 from mszep/master
Add function to sanitize ConTeXt labels
2014-09-27 16:20:56 -07:00
Matthew Pickering
5cb475c374 Org Reader: Parse multi-inline terms correctly in definition list
Closes #1649
2014-09-27 22:40:25 +01:00
Artyom
bc115ffc2d Fix 'Ext_lists_without_preceding_blankline' bug.
* Fixes #1636.
  * Adds a test.
2014-09-26 13:32:08 +04:00
mpickering
6740a9592a HTML Reader: Recognise <br> tags inside <pre> blocks
Closes #1620
2014-09-25 19:20:12 +01:00
mpickering
1f0ba8ec11 HTML Writer: Don't double render when email-obfuscation=none
Closes #1625
2014-09-25 18:46:36 +01:00