Commit graph

1883 commits

Author SHA1 Message Date
John MacFarlane
a6c167125f Optimized oneOfStringsCI.
The call to toLower in ciMatch was very expensive (and very often
used), because toLower from Data.Char calls a fully unicode
aware function.  This optimization avoids the call to toLower
for the most common, ASCII cases.  This dramatically reduces the
speed penalty that comes from enabling the `autolink_bare_uris`
extension.  The penalty is still substantial (in one test, from 0.33s
to 0.44s), but nowhere near what it used to be.
2013-02-02 18:46:10 -08:00
John MacFarlane
92acb24486 HTML reader: Handle colgroup tag. 2013-01-30 10:05:53 -08:00
John MacFarlane
f53e0a44ce DocBook writer: for linebreak, but newline in literallayout.
Closes #725.
2013-01-28 11:18:05 -08:00
John MacFarlane
8c55023d18 Fixed latex macro parsing.
Now latex macro definitions are preserved when output is latex,
and applied when it is another format, as originally intended.

Partially addresses #730.
\providecommand is still not supported.  For this we need changes
to texmath.
2013-01-28 10:50:58 -08:00
John MacFarlane
229c22582f LaTeX writer: Avoid extra space at start/end of table cell.
Thanks to Nick Bart for the suggestion of using @{}.
2013-01-28 10:21:18 -08:00
John MacFarlane
c50af7341e Markdown writer: Set title, author, date variables as before.
These are no longer used in the default template, since we use
titleblock, but we set them anyway for nondefault template users.
2013-01-28 10:10:23 -08:00
John MacFarlane
29a17b1767 Merge pull request #733 from jrunningen/master
Mediawiki reader: Don't require blanklines after tables.
2013-01-28 09:42:59 -08:00
John MacFarlane
72d11ad20b Markdown/RST reader: Skip blank lines.
This fixes a subtle regression involving grid tables with
empty cells.  Closes #732.

Also added test for grid table with empty cells.
2013-01-27 22:13:05 -08:00
Jeff Runningen
efddb85d46 Mediawiki reader: Don't require blanklines after tables. 2013-01-27 23:15:46 -05:00
John MacFarlane
9d549ab683 RST writer: Use .. code:: language for code blocks with language.
Closes #721.
Also fixed whitespace in lhs tests.
2013-01-26 16:12:11 -08:00
John MacFarlane
2f50406c7f Markdown writer: Use autolink when link text matches url.
Previously we also checked for a null title, but this
test fails for links produced by citeproc-hs in bibliographies.

So, if the link has a title, it will be lost on conversion
to an autolink, but that seems okay.
2013-01-26 14:01:50 -08:00
John MacFarlane
b6dc21bacf Markdown reader: Simplified and sped up str parser.
We no longer needed the smart quote complexity, because of
improvements to singleQuoteStart and singleQuoteEnd.

And we were able to move the check for intraword underscore
to the emphasis parser.
2013-01-25 23:30:27 -08:00
John MacFarlane
c18fd7e643 RST reader: Allow anonymous form of explicit links.
`hello <url>`__
Closes #724.
2013-01-25 21:10:02 -08:00
John MacFarlane
ce4b7fc416 Changed copyright date range on Markdown reader. 2013-01-25 19:53:18 -08:00
John MacFarlane
52a6ec7297 Minor code cleanup. 2013-01-25 19:50:34 -08:00
John MacFarlane
ae74558114 Markdown reader: Moved guardEnabled to definitionList.
From definitionListItem.
Slight performance improvement.
2013-01-25 19:43:30 -08:00
John MacFarlane
846be80c26 Markdown reader: Performance improvement in str parser.
Moved a guardEnabled out of an inner loop.
2013-01-25 18:42:40 -08:00
John MacFarlane
71c5ebe682 Use anyLine everywhere instead of 'manyTill anyChar newline'. 2013-01-25 18:32:15 -08:00
John MacFarlane
f989ff2d5d Parsing: More improvements of anyLine parser. 2013-01-25 18:32:06 -08:00
John MacFarlane
d27dc6a420 More anyLine tweaks: Use incSourceLine. 2013-01-25 17:59:57 -08:00
John MacFarlane
0801b120b9 anyLine: Set position properly. 2013-01-25 17:53:50 -08:00
John MacFarlane
f7ecbd03d4 Markdown reader: More efficient version of scanForPipe. 2013-01-25 16:13:58 -08:00
John MacFarlane
4c74b7aaab Parsing: Much faster new version of anyLine.
Not only faster but uses less memory.
2013-01-25 15:32:10 -08:00
John MacFarlane
fe337b07f7 Use hsb2hs preprocessor instead of TH for embed_data_files.
This should work on Windows, unlike the TH solution with
file-embed.
2013-01-23 19:26:39 -08:00
John MacFarlane
9c299d282f Added Text.Pandoc.Data (non-exported) if embed_data_files selected.
This module just exports the association list of embedded data files,
which is used by Shared.
2013-01-23 19:26:39 -08:00
John MacFarlane
7a0062a8d5 Fixed regressions in fenced code blocks.
*   Tilde code fences can again take bare language.

    So

        ~~~ haskell

    is okay, not just

        ~~~ {.haskell}

*   Backtick code blocks can take the bracketed attributes.
*   Backtick code blocks don't require a language.
*   Consolidated code for the two kinds of fenced code blocks.

Closes #722.
2013-01-23 13:21:53 -08:00
John MacFarlane
d52a1ec18f Another fix to the CPP macro in EPUB writer. 2013-01-22 08:48:43 -08:00
John MacFarlane
294df9deed Fixed MIN_VERSION - need to sub _ for - in blaze-html. 2013-01-22 08:32:33 -08:00
John MacFarlane
7415462dc9 Markdown reader: Try lhsCodeBlock before rawTeXBlock.
Otherwise \begin{code}...\end{code} isn't handled
properly in markdown+lhs.

Thanks to Daniel Miot for noticing the bug and
suggesting the fix.
2013-01-21 21:36:31 -08:00
Jens Petersen
88d0ca8ea7 EPUB: condition Blaze Utf8 module name import on blaze-html version
blaze-html/blaze-markup-0.5 has Text.Blaze.Html.Renderer.Utf8
whereas blaze-html-0.4 has Text.Blaze.Renderer.Utf8.
So this needs to be conditional on the version for pandoc
still be with blaze-html-0.4.x
2013-01-22 10:27:34 +09:00
John MacFarlane
26d30d6d38 Use proportional font for email autolinks with obfuscation.
Closes #714.
2013-01-21 11:28:35 -08:00
John MacFarlane
af84953781 Markdown reader: Fixed bug with headerless grid tables.
The 1.10 code assumed that each table header cell contains
exactly one block. That failed for headerless tables (0) and also
for tables with multiple blocks in a header cell.

The code is fixed and tests provided. Thanks to Andrew Lee for
pointing out the bug.
2013-01-21 09:52:24 -08:00
John MacFarlane
c4b93bc3e7 Fixed bug in uri parser.
The bug prevented an autolink at the end of a string (e.g.
at the end of a line block line) from counting as a link.

Closes #711.
2013-01-20 20:23:50 -08:00
John MacFarlane
9cc1cf1f40 Fixed bug with escaped % in LaTeX reader.
Also added tests.  Closes #710.
2013-01-20 19:21:13 -08:00
John MacFarlane
4ed82686e4 Add data-cites field to citations in HTML5.
This contains a space-separated list of citation IDs.
2013-01-18 12:16:12 -08:00
John MacFarlane
8eab759a9c RTF writer: Added writeRTFWithEmbeddedImages.
* RTF writer:  Export writeRTFWithEmbeddedImages instead of
  rtfEmbedImage.
* Text.Pandoc: Use writeRTFWithEmbeddedImages for RTF.
* Moved code for embedding images in RTF out of pandoc.hs.
2013-01-18 10:33:37 -08:00
John MacFarlane
4aea26e8e1 Convert highlighting-kate language to listings language
if --listings is used.

Closes #704.
2013-01-17 19:47:03 -08:00
John MacFarlane
820a9143e7 MIME: Support vs and fs as text/plain.
These are used in revealjs css.
2013-01-17 11:40:14 -08:00
John MacFarlane
054283d12f Revert "Markdown reader: Be less restrictive about class attributes."
This reverts commit b158b3fb21.
2013-01-17 11:24:45 -08:00
John MacFarlane
b158b3fb21 Markdown reader: Be less restrictive about class attributes.
This allows attributes like `C++`.  Any nonspace and non-}.
2013-01-16 15:35:51 -08:00
John MacFarlane
31fa80fdcb Fixed problem with duplicate ids in epub. 2013-01-16 12:16:49 -08:00
John MacFarlane
49820d5b51 Implemented Ext_link_attributes in markdown reader.
Also simplified source URL and link title parsers.
2013-01-16 11:25:17 -08:00
John MacFarlane
7194107733 Implemented Ext_mmd_header_identifiers in markdown writer. 2013-01-16 09:20:48 -08:00
John MacFarlane
4926645578 Implemented Ext_mmd_header_identifiers in markdown reader. 2013-01-16 09:17:20 -08:00
John MacFarlane
923204d553 Options: Added multimarkdownExtensions.
Also added 'markdown_mmd' as input/output option.
2013-01-16 08:52:54 -08:00
John MacFarlane
fa71969e81 LaTeX writer: Prevent paragraphs containing only linebreaks or spaces. 2013-01-15 23:02:08 -08:00
John MacFarlane
eebed6bc48 Added writerHtmlQTags and --html-q-tags option.
The previous default was to use `<q>` tags in HTML5.
But `<q>` tags are also valid HTML4, and they are not very
robust in HTML5.  Some user agents don't support them,
and some CSS resets prevent pandoc's quotes CSS from working
properly (e.g. bootstrap).  It seems a better default just
to insert quote characters, but the option is provided  for
those who have gotten used to using `<q>` tags.
2013-01-15 18:50:36 -08:00
John MacFarlane
bf3a911a1c Changed Ext_autolink_urls -> Ext_autolink_bare_uris.
Added tests.
2013-01-15 12:44:50 -08:00
John MacFarlane
5971721ec1 Case-insensitive parsing of URI schemes. 2013-01-15 11:48:21 -08:00
John MacFarlane
95c02f6b57 Parsing: Improve oneOfStrings, export oneOfStringsCI.
oneOfStrings will now take the longest match it can in a
list of strings, so if 'foo' and 'foobar' are both included,
'foobar' will match even if 'foo' is first in the list.
2013-01-15 11:47:35 -08:00