Commit graph

888 commits

Author SHA1 Message Date
John MacFarlane
ea9b7a4a52 Markdown reader: Fixed bug parsing key/value attributes.
Parsing failed if you had an unquoted attribute immediately
before the final '}'.
2013-02-12 11:20:36 -08:00
John MacFarlane
0e03962615 LaTeX reader: Parse \hrule as HorizontalRule.
Closes #746.
2013-02-11 17:39:52 -08:00
John MacFarlane
57e4f5644f Revert "Citation changes."
This reverts commit d46f434d4b.
2013-02-06 13:14:37 -08:00
John MacFarlane
8dfbe3bbe8 Implement --default-image-extension for LaTeX reader. 2013-02-06 08:36:29 -08:00
John MacFarlane
1a2eea23a1 Merge branch 'citations' 2013-02-05 22:04:53 -08:00
John MacFarlane
c5f1a8ad2d Added --default-image-extension and readerDefaultImageExtension.
Note: Currently this only affects the markdown reader.
2013-02-05 20:08:00 -08:00
John MacFarlane
d46f434d4b Citation changes.
* Citations will work in markdown even if `--biblio` isn't
  specified.  Note:  this may cause unexpected behavior for people
  who use strings of the form `@foo` that are not citations!
* If `--biblio` isn't used, the markdown writer will write markdown
  citations rather than CSL-rendered citations.
* This means, for example, that you can do `pandoc -f latex -t markdown`
  and convert biblatex or natbib citations into pandoc citations.
2013-02-03 10:30:48 -08:00
John MacFarlane
e148fd7547 Removed unneeded blanklines in pipeTable parser. 2013-02-02 19:07:11 -08:00
John MacFarlane
92acb24486 HTML reader: Handle colgroup tag. 2013-01-30 10:05:53 -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
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
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
f7ecbd03d4 Markdown reader: More efficient version of scanForPipe. 2013-01-25 16:13:58 -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
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
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
9cc1cf1f40 Fixed bug with escaped % in LaTeX reader.
Also added tests.  Closes #710.
2013-01-20 19:21:13 -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
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
4926645578 Implemented Ext_mmd_header_identifiers in markdown reader. 2013-01-16 09:17:20 -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
7bc37e4414 Use 'fig:' instead of '\SOH' in title to indicate figure.
Revises 1a4b47e933
2013-01-15 08:46:09 -08:00
John MacFarlane
1a4b47e933 Implemented Ext_implicit_figures.
* In markdown reader, add a '\1' character to the beginning
  of the title of an image that is alone in its paragraph,
  if implicit_figures extension is selected.
* In writers, check for Para [Image alt (src,'\1':tit)] and treat
  it as a figure if possible.
* Updated tests.

This is a bit of a hack, but it allows us to make implicit_figures
an extension of the markdown reader, rather than the writers.
2013-01-14 20:53:08 -08:00
John MacFarlane
56aa257ddb Removed some cruft. 2013-01-14 20:18:53 -08:00
John MacFarlane
6b5302e063 Markdown reader: Support RST-style line blocks.
This depends on the new Ext_line_blocks extension.
2013-01-13 12:34:18 -08:00
John MacFarlane
0598cf0fee Moved lineBlockLines to Parsing.
This will be used by both RST and markdown readers.
2013-01-13 11:39:32 -08:00
John MacFarlane
b92b8e8a3d RST reader: Refactored line block parser. 2013-01-13 11:29:00 -08:00
John MacFarlane
5c067bb457 RST reader: Line block improvements.
* Use nonbreaking spaces for initial indent (otherwise lost in HTML and
  LaTeX).
* Allow multiple paragraphs in a single line block.
2013-01-13 11:15:31 -08:00
John MacFarlane
c8022f0419 HTML reader: Added html5 tags to list of block-level tags. 2013-01-12 12:23:15 -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
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
d1ebde08a9 Added / to the list of letters that can occur in a citation key. 2013-01-08 10:04:40 -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
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
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
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
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