Commit graph

1809 commits

Author SHA1 Message Date
John MacFarlane
1cc4e7db52 ImageSize: Remove no longer exported readImageSize. 2013-01-11 15:44:16 -08:00
John MacFarlane
2a0ed1c433 Improvements to docx writer.
Avoid reading image files again when we've already processed them.
2013-01-11 13:41:17 -08:00
John MacFarlane
4e4c3537e0 Docx writer: Preliminary improvements.
* Use getItem to fetch images, so we can get them over the net
  if they have absolute URLs.
* Added TODO notes for cleaning up the logic.
2013-01-11 12:17:41 -08:00
John MacFarlane
2685ebff0f ImageSize: Use strict, not lazy bytestrings. 2013-01-11 12:11:37 -08:00
John MacFarlane
77d9ead1b2 Move getItem from SelfContained to Share; export getItem. 2013-01-11 11:30:31 -08:00
John MacFarlane
97a3cb2e86 Options: Added githubMarkdownExtensions.
Added github_markdown as input/output option.
2013-01-11 10:11:53 -08:00
John MacFarlane
791763d09f Added markdown_phpextra as writer option. 2013-01-10 22:43:02 -08:00
John MacFarlane
f8db21fa16 Options: Added phpMarkdownExtraExtensions.
And added markdown_phpextra input/output format.
2013-01-10 22:39:47 -08:00
John MacFarlane
23ab5ffcb0 Implemented Ext_header_attributes.
This allows explicit attributes to be put on headers, using
a syntax like that for code blocks:

  {#id .class .class k=v k=v}
2013-01-10 20:32:53 -08:00
John MacFarlane
1a7686ad79 Ext_header_identifiers -> Ext_auto_identifiers. 2013-01-10 19:58:39 -08:00
John MacFarlane
cf4cd2ccb0 More improvements in emailAddress parser. 2013-01-09 21:32:42 -08:00
John MacFarlane
a71641a2a0 Made email parser more correct.
Now it's based on RFC 822, though it still doesn't implement
quoted strings in email addresses.
2013-01-09 17:19:32 -08:00
John MacFarlane
0998f774ce Fixed regression in example lists.
This was associated with e1be934dc2.
2013-01-09 15:54:39 -08:00
John MacFarlane
d599c4cdab Added Attr field to Header.
Previously header ids were autogenerated by the writers.
Now they are generated (unless supplied explicitly) in the
markdown parser, if the `header_identifiers` extension is
selected.

In addition, the textile reader now supports id attributes on
headers.
2013-01-09 09:30:05 -08:00
John MacFarlane
7a40fa8c08 Biblio: Make sure mvPunc and deNote run on metadata too.
This fixed a bug with notes on titles using footnote styles.
2013-01-08 17:24:18 -08:00
John MacFarlane
d1ebde08a9 Added / to the list of letters that can occur in a citation key. 2013-01-08 10:04:40 -08:00
John MacFarlane
1a9193c30d Implemented tight lists in context, latex writers. 2013-01-07 20:12:13 -08:00
John MacFarlane
7909982f9a Shared: export isTightList. 2013-01-07 20:12:05 -08:00
John MacFarlane
8c48bd8feb Don't put the text of an autolink in Code font. 2013-01-06 20:51:51 -08:00
John MacFarlane
300f8528da Mediawiki reader: interpret HTML in verbatim contexts as text.
Thanks to Jeff Runningen for reporting that mediawiki works
this way.
2013-01-06 19:35:40 -08:00
John MacFarlane
4d1c82de9e Docx writer: Use rIdNN identifiers for r:embed in images. 2013-01-06 19:07:35 -08:00
John MacFarlane
c7f4333f83 UTF8 module: Remove \r when reading.
This should prevent problems with extra CRs on windows.
2013-01-06 16:35:59 -08:00
John MacFarlane
f779411fe2 Docx writer: Use separate footnotes.xml for notes.
This seems to help LibreOffice convert the file, even though
it was valid docx before.

Note that the references in notes must be in
word/_rels/footnotes.xml.rel.  We handle this now by simply
making that file contain all the references in
word/_rels/document.xml.rel.  Something better could be done
eventually, but this works.

Closes #637.
2013-01-06 12:26:44 -08:00
John MacFarlane
dd6dab45fb LaTeX tables: Use minipage rather than parbox for block containers.
This allows verbatim code to be included in grid tables.
Closes #663.
2013-01-05 19:12:41 -08:00
John MacFarlane
4343f0dbcd Implemented --toc-depth (and --toc!) for RTF writer. 2013-01-05 18:23:51 -08:00
John MacFarlane
65d01857fb Support --toc-depth in context writer. 2013-01-05 18:15:34 -08:00
John MacFarlane
f9799c2a42 For epub3, use epub:type to mark footnotes and footnote refs.
This yields nice popup footnotes in iBooks.  See
http://www.pigsgourdsandwikis.com/2012/05/creating-pop-up-footnotes-in-epub-3-and.html
2013-01-05 17:18:43 -08:00
John MacFarlane
0cc9504796 EPUB changes.
* Epub writer now exports writeEPUB, not writeEPUB2 and writeEPUB3.
* Options now exports EPUBVersion
* WriterOptions now includes writerEpubVersion.
2013-01-05 13:00:12 -08:00
John MacFarlane
ea3eaaa553 Implemented --toc-depth for markdown writer. 2013-01-05 12:31:15 -08:00
John MacFarlane
08efc7db60 Implemented toc-depth for html writer. 2013-01-05 12:07:09 -08:00
John MacFarlane
c45ae571cc Changed --toc-level to --toc-depth. 2013-01-05 12:03:05 -08:00
John MacFarlane
2e0894554c Implemented --toc-level for rst. 2013-01-05 11:55:29 -08:00
John MacFarlane
123b94ad81 Implemented --toc-level in LaTeX writer. 2013-01-05 11:49:42 -08:00
John MacFarlane
7c10e57997 Changed --epub-toc-level to --toc-level.
Also writerEpubTOCLevel -> writerTOCLevel.
So far this is only implemented in the EPUB writer.
2013-01-05 11:36:55 -08:00
John MacFarlane
91e8d80eee MediaWiki writer: use <code> not <tt> for Code. 2013-01-04 23:16:49 -08:00
John MacFarlane
e91bae4f5b Renamed writerEPUBMetadata -> writerEpubMetadata.
API change for consistency.
2013-01-04 22:41:27 -08:00
John MacFarlane
30361308e7 Added --epub-chapter-level and --epub-toc-level options.
Also added writerEpubChapterLevel and writerEpubTOCLevel fields
to WriterOptions.
2013-01-04 22:29:41 -08:00
John MacFarlane
0654c4c05a EPUB writer: Parameterize header level for splitting chapters. 2013-01-04 21:55:56 -08:00
John MacFarlane
5d9fc46992 Markdown reader: Warn about duplicate note references.
Closes #375.
2013-01-04 12:08:30 -08:00
John MacFarlane
ef806f6a99 Markdown reader: Warn about duplicate link references. 2013-01-04 12:01:09 -08:00
John MacFarlane
4e381e787a Use readMarkdownWithWarnings in Text.Pandoc. 2013-01-04 11:42:22 -08:00
John MacFarlane
7f36925c48 Markdown reader: Export readMarkdownWithWarnings.
Note:  This is not yet used, and the parser does not yet
generate any warnings.
2013-01-04 11:32:17 -08:00
John MacFarlane
3bea3635d6 Changed type of 'readers' in Text.Pandoc, so all readers are in IO.
Users who want pure readers can still get them; this just affects
the function getReader that looks up a reader based on the format
name.

The point of this change is to make it possible to print warnings
from the parser.
2013-01-03 22:55:55 -08:00
John MacFarlane
7ef07ea3fc Added stateWarnings.
It is not connected to anything yet.
2013-01-03 20:52:51 -08:00
John MacFarlane
c435e9cda7 Implemented Ext_header_identifiers, Ext_implicit_header_references.
Now by default pandoc will act as if link references have been defined
for all headers.  So, you can do this:

    # My header

    Link to [My header].
    Another link to [it][My header].

Closes #691.
2013-01-03 20:35:01 -08:00
John MacFarlane
5e5859f126 Revert "Workaround for problem with file-embed."
This reverts commit 84ed0f055f.
2012-12-30 15:50:37 -08:00
John MacFarlane
84ed0f055f Workaround for problem with file-embed.
file-embed uses forward slashes as path separators, even
on Windows.  So we just convert backslashes to forward
before doing a lookup.
2012-12-29 20:44:09 -08:00
John MacFarlane
c2fe3aae64 Made embed_data_files flag work. 2012-12-29 18:45:20 -08:00
John MacFarlane
1864bb0994 Data files changes.
* Added `embed_data_files` flag.  (not yet used)
* Shared no longer exports `findDataFile`.
* `readDataFile` now returns a strict bytestring.
* Shared now exports `readDataFileUTF8` which returns a string like
  the old `readDataFile`.
* Rewrote modules to use new data file functions and to avoid
  using functions from Paths_pandoc directly.
2012-12-29 17:54:07 -08:00
John MacFarlane
3df2f1e3de EPUB3: Don't use the switch statement for mathml.
It is not widely implemented yet.
2012-12-19 11:29:03 -08:00
John MacFarlane
2695434113 Fixed bug in withRaw.
Didn't correctly handle case where nothing is parsed.
2012-12-13 19:04:01 -08:00
John MacFarlane
6e36375bdc LaTeX reader: Make command macros work everywhere, including non-math.
Environment macros still not supported.
2012-12-12 19:28:33 -08:00
John MacFarlane
4cd573c61f Textile reader/writer: Fixed autolinks.
Previously the textile reader and writer incorrectly implented
RST-style autolinks for URLs and email addresses.

This has been fixed.  Now an autolink is done this way:

    "$":http://myurl.com
2012-11-06 16:05:17 -08:00
John MacFarlane
4aa3e1f978 Textile parser: Expanded list of stringBreakers.
This fixes a bug on input like "(_hello_)" which should
be a parenthesized emphasized "hello".

The new list is taken from the PHP source of textile 2.4.
2012-11-06 09:18:02 -08:00
John MacFarlane
54fb384369 HTML writer: Include highlighting-css for code spans, too.
Previously it was only included if used in a code block.
Closes #653.
2012-11-05 10:45:49 -08:00
John MacFarlane
09603b94f7 LaTeX reader: skip comments in handleIncludes. 2012-11-05 08:22:26 -08:00
John MacFarlane
7af45f78d1 Textile reader: Allow newlines before pipes in table.
Closes #654.
2012-11-05 08:16:15 -08:00
John MacFarlane
5914be88a8 EPUB writer: Rationalized templates.
* Previously there were three different templates involved in
  epub production. There is now just one template, default.epub
  or default.epub3.
* It can now be overridden using `--template`, just like other
  templates.
2012-11-04 21:21:57 -08:00
John MacFarlane
83b326b005 EPUB: removed need for separate epub-titlepage template.
The titlepage stuff is now folded into the epub-page template.
A titlepage variable selects it.
2012-11-04 21:08:40 -08:00
John MacFarlane
a7b8351d43 EPUB writer: Removed need for separate epub-coverpage template.
The standard epub-page template is now used.
2012-11-04 20:53:41 -08:00
John MacFarlane
7f5e2af1fb EPUB writer: Improved handling of CSS.
* Code highlighting now works by default.
* Quote styles work as in pandoc's HTML writer.
2012-11-04 18:58:37 -08:00
John MacFarlane
9d0b011869 RST writer: Don't add ":align: center" to figures. 2012-11-04 18:33:35 -08:00
John MacFarlane
1f29592b64 EPUB writer: Set epub3 variable before calling templates. 2012-11-04 18:14:27 -08:00
John MacFarlane
ae6028d442 EPUB writer: Better TOC and footnote handling.
* Here we go back to splitting the document at the Pandoc AST
  level, and converting each chapter to HTML separately.
* Fixes bug in footnote processing introduced by
  commit 01d109e2ef.  The bug caused
  all footnotes to appear in the last chapter, so that footnote
  links from other chapters would not work.  Closes #651.
* We also disable writerTableOfContents, since TOC is automatic
  for epub.
2012-11-04 18:06:28 -08:00
John MacFarlane
b69792e2ed EPUB: Use section divs by default for better semantic markup. 2012-11-04 12:51:17 -08:00
John MacFarlane
a2cb53640d LaTeX writer: Don't use [fragile] unnecessarily.
We were using [fragile] on slides even if they only contained
code that was rendered using `\texttt`.  Now `[fragile]` is
only used for slides containing inline code if that code
is rendered using listings. Closes #649.
2012-11-04 11:09:42 -08:00
John MacFarlane
569954e1d5 Improved support for MathML in EPUB3.
* MathML math method now used always in EPUB3 (even if another
  math method specified in options).
* epub:switch is used to specify a non-MathML default. This is supposed
  to proide a good fallback behavior in older readers, though I'm
  not sure how well it works in practice.
2012-11-04 10:37:57 -08:00
John MacFarlane
dfca59943d EPUB: Don't use opf:role in EPUB3. 2012-11-02 21:23:02 -07:00
John MacFarlane
afa5a4da67 EPUB: Fixed invalid nesting problem in nav.xhtml. 2012-11-02 21:12:56 -07:00
John MacFarlane
e9542a60b5 EPUB: Added properties attribute. 2012-11-02 21:10:08 -07:00
John MacFarlane
63bed5dc2e HTML writer: Use XHtml5 only if blaze version current enough. 2012-11-02 21:04:32 -07:00
John MacFarlane
5b7d27912a HTML writer: Use Text.Blaze.XHtml5 instead of Html5.
This is needed for epub.
2012-11-02 20:59:45 -07:00
John MacFarlane
927e4b92a6 EPUB: Use HTML5 for epub3. 2012-11-02 20:57:18 -07:00
John MacFarlane
927a9271a5 EPUB: Set epub3 template variable controlling doctype. 2012-11-02 20:53:51 -07:00
John MacFarlane
583ce1073c EPUB writer: Don't create entry for nav.xhtml in EPUB2. 2012-11-02 20:25:55 -07:00
John MacFarlane
76d3c0d028 Fixed a couple validation bugs that affect epub2 also. 2012-11-02 20:14:18 -07:00
John MacFarlane
43448d7d53 Preliminary changes for epub3 format.
* EPUB writer now exports writeEPUB2 and writeEPUB3.
* 'epub' output format is epub v2, while 'epub3'
  is v3.
2012-11-02 17:46:22 -07:00
John MacFarlane
7818033df9 DocBook reader: Support title in "figure" element.
Closes #650.
2012-11-02 16:21:06 -07:00
John MacFarlane
a6e56235d5 LaTeX reader: Avoid include loops. 2012-11-01 13:49:20 -07:00
John MacFarlane
0f24816291 Revert "LaTeX reader: Added code to handleIncludes to avoid inf loops."
This reverts commit da87837318.

Reason:  The code was overzealous and would rule out some things
we want to be able to do, like include the same file multiple
times.
2012-11-01 10:18:17 -07:00
John MacFarlane
da87837318 LaTeX reader: Added code to handleIncludes to avoid inf loops.
e.g. when one file includes another which includes it.
2012-11-01 10:17:00 -07:00
John MacFarlane
6dff7dccaa LaTeX reader: Improved handling of included files.
* `\input` now works, as well as `\include`.
* TEXINPUTS is used.
* We now look recursively into included files for more included files.
2012-11-01 09:42:10 -07:00
John MacFarlane
06300e59d5 Removed citationSuppressParens.
Makefile: Use citeproc-0.3.6 release.
2012-10-28 09:36:15 -07:00
John MacFarlane
6f2347635c LaTeX reader: Initialize citationSuppressParens field. 2012-10-22 19:17:00 -07:00
John MacFarlane
a23a8e8b67 Fixed Biblio for extra parameter on Citation. 2012-10-22 09:30:05 -07:00
John MacFarlane
cfab8eaecb Revert "LaTeX reader: Use new suppressParens option for footnote citations."
This reverts commit 7499499b68.

Conflicts:

	src/Text/Pandoc/Readers/LaTeX.hs
2012-10-21 23:16:23 -07:00
John MacFarlane
6f9151c64e LaTeX reader: Basic \enquote support. 2012-10-15 20:15:34 -07:00
John MacFarlane
7499499b68 LaTeX reader: Use new suppressParens option for footnote citations.
Also changed Biblio, Markdown reader, and LaTeX reader tests because
of new citationSuppressParens field in Citation.
2012-10-15 19:53:57 -07:00
John MacFarlane
a35b718e7d Re-added Read instance for ReaderOptions.
Requires dev version of citeproc-hs.
2012-10-14 22:14:15 -07:00
John MacFarlane
19e1d746da LaTeX reader: Use normal citations, not author-in-text, for fn cites.
Eventually it would be nice to use a "suppress outer parens" variant,
if citeproc-hs provides one.
2012-10-14 08:44:25 -07:00
John MacFarlane
b5dd06d303 Moved bibliography processing into readers.
Previously this was done in src/pandoc.hs, which made it difficult
for library users.

* Removed readerCitations in ReaderOptions.
* Added readerReferences and readerCitationStyle to ReaderOptions.
* Moved use of processBiblio from main program to the
  markdown and LaTeX readers.
2012-10-13 11:33:55 -07:00
John MacFarlane
9a77a3f15b Biblio: Make processBiblio take a Maybe Style parameter.
If Nothing, then nothing is done.
2012-10-13 11:33:33 -07:00
John MacFarlane
ea8b8114e1 Textile reader: Fixed bug with list items containing line breaks.
Now pandoc correctly handles hard line breaks inside list items.
Previously they broke list parsing.  Thanks to Pablo
Rodríguez for pointing out the problem.
2012-10-13 10:44:38 -07:00
John MacFarlane
40128754ab LaTeX reader: Made rawLaTeXInline more flexible.
Now it will also try to parse block commands.  This is usually
what we want, given how rawLaTeXInline is used in the markdown
and textile readers.  If a block-level LaTeX command is used
in the middle of a paragraph (e.g. `\subtitle` inside a title),
we can treat it as raw inline LaTeX.
2012-10-11 21:21:09 -07:00
John MacFarlane
cfc2e00b84 LaTeX reader: Make \noindent inline rather than block. 2012-10-11 20:56:44 -07:00
John MacFarlane
1dcd7c66eb Added MIME types for .wof and .eot.
Closes #640.
i#
2012-10-11 09:33:10 -07:00
John MacFarlane
01d109e2ef EPUB writer improvements.
* We now convert to XHTML before cutting into chapter-sized chunks.
  This fixes a number of problems.
* `--number-sections` now works properly.
* A proper three-level table of contents is now used in `toc.ncx`.
  There is no longer a subsidiary table of contents at the beginning
  of each chapter.
* New epub-page template without the `$title$` variable.  Titles are
  left in the chapter bodies as an initial h1.
* Closes #539.
2012-10-11 09:13:09 -07:00
John MacFarlane
4349097990 LaTeX reader: Better support for citation commands.
* Make `\cite` etc. an AuthorInText.
* Make `\footcite` etc. into citations in notes.
2012-10-10 19:41:39 -07:00
John MacFarlane
31435ad3f5 RST reader: Don't create empty definition list for metadata field lists.
Previously a field list consisting only of metadata fields (author,
title, date) would be parsed as an empty DefinitionList, which is not
legal in LaTeX and not needed in any format.  This patch fixes the
problem, which I learned of from
http://stackoverflow.com/questions/12762767/modify-variable-in-rst-with-pandoc.
2012-10-06 20:07:32 -07:00
John MacFarlane
b617cce95b Biblio: Changed type of processBiblio.
* It is no longer in the IO monad.
* setHash uses state rather than Data.Unique.
* It takes a Style argument rather than parameters for CSL
  and abbrev filenames.
* pandoc.hs now calls the functions to parse the style file
  and add abbrevs.
2012-10-06 09:51:23 -07:00
John MacFarlane
1b68dc3405 Revert "Added stateWarnings to ParserState, added warning function."
This reverts commit 5419b504ce.
2012-10-05 19:38:43 -07:00
John MacFarlane
5419b504ce Added stateWarnings to ParserState, added warning function.
This will be used to provide warnings for things like duplicate
footnote refs and link refs.
2012-10-05 19:25:26 -07:00
John MacFarlane
f232034ab0 Textile reader: Implemented comment blocks. 2012-10-05 10:23:15 -07:00
Brent Yorgey
c85d184668 Remove newline after <br/> in translation of LineBreak
There's no particular need for a newline (other than making the
generated MediaWiki source look nice to a human), and in fact
sometimes it is incorrect: in particular, inside an enumeration, list
items cannot have embedded newline characters.
2012-10-04 11:16:54 -04:00
John MacFarlane
3f86127f5a Docx writer: Added nsid to abstractNum elements.
This helps when merging word documents with numbered or bulleted lists.
Closes #627.
2012-10-02 19:43:18 -07:00
John MacFarlane
02bb0f051a Use integer ids for bookmarks.
Closes #626.
2012-10-02 19:20:51 -07:00
John MacFarlane
3a3fe2df6c RST reader: Removed 'plain' in blocks, since 'para' includes it. 2012-09-30 22:08:05 -07:00
John MacFarlane
e8260c27e1 RST reader: Consolidate super/subscript, math into interpretedRole. 2012-09-30 20:28:50 -07:00
John MacFarlane
9366d8681d RST reader: Renamed 'image' to 'subst', since it now handles more. 2012-09-30 20:18:14 -07:00
John MacFarlane
9294fc399c Ignore unknown interpreted roles.
The contents are treated as rst, not literal, which will sometimes
be wrong.
2012-09-30 14:59:26 -07:00
John MacFarlane
27bd6fb977 RST reader: Removed requirement that directives begin at left margin.
This was (correctly) not in earlier releases; docutils doesn't
make the requirement.
2012-09-30 14:58:26 -07:00
John MacFarlane
d9f628fd18 RST reader: Require whitespace after field list field names. 2012-09-30 14:57:55 -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
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
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
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
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