Commit graph

888 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
f232034ab0 Textile reader: Implemented comment blocks. 2012-10-05 10:23:15 -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
b75a5b631b Markdown reader: Worked around some sepBy's. 2012-09-29 11:57:32 -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
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
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