Commit graph

3428 commits

Author SHA1 Message Date
John MacFarlane
946764ccf7 Bumped versions of json and base64-bytestring dependencies.
Thanks to Dirk Ullirch.
2012-09-30 11:53:18 -07:00
John MacFarlane
83ad8982e1 Make blaze_html_0_5 default to True. 2012-09-30 11:53:00 -07:00
John MacFarlane
b07ea7a02d RST reader: Consolidated rawBlock into directive. 2012-09-30 09:59:22 -07:00
John MacFarlane
e5740a138e RST reader: Handle replace:: and unicode:: substitutions. 2012-09-30 09:53:50 -07:00
John MacFarlane
d360172693 RST reader: Make directive labels case-insensitive. 2012-09-29 21:42:55 -07:00
John MacFarlane
779e02126d RST reader: Folded figureBlock into directive. 2012-09-29 18:12:46 -07:00
John MacFarlane
d3b52e42eb RST reader: Made comments a separate parser. 2012-09-29 19:35:49 -04:00
John MacFarlane
1948c55914 RST reader: Folded image block handling into directive. 2012-09-29 19:22:38 -04:00
John MacFarlane
720a7ba0fc RST reader: Folded code block parsers into directive. 2012-09-29 17:37:38 -04:00
John MacFarlane
93600ec9b8 RST reader: Folded default-role parser into directive. 2012-09-29 17:25:14 -04:00
John MacFarlane
93e92a4716 Renamed removedLeadingTrailingSpace to trim.
Also removeLeadingSpace to triml,
removeTrailingSpace to trimr.
2012-09-29 17:09:34 -04:00
John MacFarlane
487d01118f RST reader: Consolidated math block parsers into directive. 2012-09-29 16:59:41 -04:00
John MacFarlane
3a589b7bca RST reader: Refactored directive parser.
We now also hander container, compound, epigraph, rubric,
highligts, pull-quote.
2012-09-29 16:22:13 -04:00
John MacFarlane
28fe9c1ae9 Adjusted pandoc.hs for changes in Biblio module. 2012-09-29 15:09:46 -04:00
John MacFarlane
c78cc02abf Biblio: csl parameter now a string rather than a filepath.
API change.
2012-09-29 15:09:25 -04:00
John MacFarlane
b75a5b631b Markdown reader: Worked around some sepBy's. 2012-09-29 11:57:32 -04:00
John MacFarlane
c416ff98bc UTF8: Removed unneeded imports. 2012-09-29 09:56:47 -04:00
John MacFarlane
ae68836352 Textile reader: Avoid parsing dashes as strikeout.
Previously the input

    text--
    text--
    text--
    text--

would be parsed with strikeouts rather than dashes. This fixes
the problem by requiring that a strikeout delimiting - not be
followed by a -.

Closes #631.
2012-09-28 23:37:41 -04:00
John MacFarlane
632fd49d07 Textile reader: Fixed bug affected words ending in hyphen.
Note:  sepBy1 doesn't work quite as I expected.  It gives odd
results if sep succeeds but not p.
2012-09-28 23:29:54 -04:00
John MacFarlane
d6ddc2ff61 Textile: Improvements to surround and symbol. 2012-09-28 23:01:41 -04:00
John MacFarlane
2fbdf9e002 RST reader: Support ".. code::". 2012-09-28 22:20:31 -04:00
John MacFarlane
58909aaf21 RST reader: Combine para/plain. 2012-09-28 22:14:03 -04:00
John MacFarlane
4b65c2041c Makefile: Use Hackage citeproc-hs 0.3.5. 2012-09-28 21:57:37 -04:00
John MacFarlane
3abc1021aa HTML writer: Use toHtml instead of pre-escaping.
We work around the problem that blaze-html unnecessarily escapes `'`
by pre-escaping just the `'` characters, instead of the whole string.

If blaze-html later stops escaping `'` characters, we can simplify
strToHtml to toHtml.

Note that this change yields a significant speed boost (111ms to 94ms
on one benchmark).

Closes #629.
2012-09-28 11:11:31 -04:00
John MacFarlane
4be137509e RST reader: Made para parser slightly more efficient. 2012-09-28 00:59:05 -04:00
John MacFarlane
ab17faf497 RST reader: Use Text.Pandoc.Builder.
This will give us more flexibility in the future.
It also gives built-in normalization.  Performance slightly
better.
2012-09-27 17:52:48 -07:00
John MacFarlane
5c06322ab2 Shared: Export compactify', formerly in Markdown reader. 2012-09-27 17:52:38 -07:00
John MacFarlane
7633d51971 Parsing: Changed type of stateSubstitutions to use Inlines. 2012-09-27 16:44:49 -07:00
John MacFarlane
35662e14a9 Removed nullBlock.
Don't use nullBlock in Textile reader.  Better to know about parsing
problems than to skip stuff when we get stuck.
2012-09-27 16:06:29 -07:00
John MacFarlane
731415a4e5 RST reader: Support :target: on image substitutions. 2012-09-27 15:40:09 -07:00
John MacFarlane
1be27ffb3a Added stateSubstitutions to ParserState, use for RST substitutions. 2012-09-27 15:20:29 -07:00
John MacFarlane
606b5e8ed4 Removed Ext_monospace_autolinks. 2012-09-27 15:01:00 -07:00
John MacFarlane
bae39e77a8 Added Ext_autolink_urls. 2012-09-27 13:43:48 -07:00
John MacFarlane
15a8192b84 Renamed Ext_autolink_code_spans to Ext_monospace_autolinks. 2012-09-27 13:33:14 -07:00
John MacFarlane
f76478bcb9 RST reader: Support :target: on .. image:: blocks.
Still not supported on substitution definitions.
2012-09-26 22:22:14 -07:00
John MacFarlane
90a42fae05 Makefile: Don't remove citeproc-hs and pandoc-types with clean.
Added new 'veryclean' target that removes these too.
2012-09-26 17:08:31 -07:00
John MacFarlane
685e281251 Biblio: Remove workaround for toCapital.
Now citeproc-hs is fixed upstream, so this is no longer needed.
Closes #531.
2012-09-26 16:27:20 -07:00
John MacFarlane
c13f23e0b1 Makefile: Use Andrea's repository for citeproc-hs. 2012-09-26 16:26:54 -07:00
John MacFarlane
ff84881e8c Shared: Count \r as space in removeLeading/TrailingSpace. 2012-09-26 09:06:34 -07:00
John MacFarlane
c80ffe9171 UTF8: Better error message for invalid UTF8.
Read bytestring and use Text's decodeUtf8 instead of using System.IO's
hGetContents.  This way you get a message saying "invalid UTF-8 stream"
instead of "invalid byte sequence."  You are also told which byte caused
the problem.
2012-09-26 09:04:21 -07:00
John MacFarlane
885ef2072f Make --id-prefix affect footnote IDs in markdown writer.
Closes #614.
2012-09-25 20:26:38 -07:00
John MacFarlane
6ad7ac1239 Removed need for utf8-string package.
* Depend on text.
* Expose Text.Pandoc.UTF8.
* Text.Pandoc.UTF8 now exports toString, fromString,
  toStringLazy, fromStringLazy.
* These are used instead of the old utf8-string functions.
2012-09-25 19:54:21 -07:00
John MacFarlane
833977416f UTF8: use universalNewlineMode in reading.
This treats both '\r\n' and '\n' as '\n' on input, no matter
what platform we're running on.
2012-09-25 14:55:12 -07:00
John MacFarlane
4ab30f3cea Texinfo writer: Fixed internal cross-references.
Now we insert anchors after each header, and use @ref
instead of @uref for links.

Commas are now escaped as @comma{} only when needed; previously
all commas were escaped.  (This change is needed, in part, because @ref
commands must be followed by a real comma or period.)

Also insert a blank line in from of @verbatim environments.
2012-09-24 19:13:34 -07:00
John MacFarlane
12045d84b6 Revert "More intelligent handling of text encodings."
This reverts commit 7272735b3d.
2012-09-23 22:53:34 -07:00
John MacFarlane
7272735b3d More intelligent handling of text encodings.
Previously, UTF-8 was enforced for both input and output.

The new system:

* For input, UTF-8 is tried first; if an error is raised, the
  locale encoding is tried.
* For output, the locale encoding is always used.
2012-09-23 22:12:21 -07:00
John MacFarlane
31107741f0 Removed unneeded CPP conditional.
Removed code that was conditional on base < 4.2, since
now we require base >= 4.2.
2012-09-23 21:43:11 -07:00
John MacFarlane
3e302bf651 Added base dependencies for test suite. 2012-09-23 13:45:23 -07:00
John MacFarlane
3ecbf49a0e Added 'UTF8.' to decodeArg. 2012-09-23 12:57:49 -07:00
John MacFarlane
07793b6b7f Require base >= 4.2 (i.e. GHC 6.12). 2012-09-23 12:57:05 -07:00