Commit graph

31 commits

Author SHA1 Message Date
John MacFarlane
e16683b539 HTML writer: Make header attributes work outside top level.
Previously they only appeared on top level header elements.
Now they work e.g. in blockquotes.

Closes #1711.
2014-10-23 10:27:14 -07:00
John MacFarlane
d7169c715d Parsing: fixed inlineMath so it handles \text{..} containing $.
For example: `$x = \text{the $n$th root of $y$}`.  Closes #1677.
2014-10-19 16:42:56 -07:00
John MacFarlane
8bf39cf6d6 Markdown reader: Better handle quote characters in inline links.
This was previously failing to be recognized as a link:

    [Test](http://en.wikipedia.org/wiki/Ward's_method)

Closes #1534.
2014-08-14 10:59:27 -07:00
John MacFarlane
f97ec6db2c Markdown reader: Improved parsing of indented code in list items.
Indented code at the beginning of a list item must be indented eight
spaces from the margin (or from the edge of the container), or four
spaces past the list marker, whichever is farther.

Some examples in `tests/markdown-reader-more.txt`.
2014-08-12 11:10:48 -07:00
John MacFarlane
2e80613451 Markdown reader: inline math must have nonspace before final $.
Closes #1313.
2014-05-27 11:59:28 -07:00
John MacFarlane
4c43824203 Fixed empty reference links. Closes #1186.
Includes test.
2014-05-02 22:58:47 -07:00
John MacFarlane
6c5ba22c96 Added a test for #833. 2013-06-19 09:00:37 -07:00
John MacFarlane
db3d4113a2 Markdown reader: don't lose parentheses in URLs.
Added tests.  This fixes a regression from 1.10.x.  Closes #786.
2013-03-13 19:20:25 -07:00
John MacFarlane
07e8cedf2b Make implicit_header_references work with explicit header ids.
(Markdown reader.)
2013-02-21 19:53:35 -08:00
John MacFarlane
cc410a71b5 Allow & in emails (for entities).
Added tests for entities in titles and links.
Closes #723.
2013-02-15 23:02:17 -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
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
9ee9096d07 Added tests for markdown line blocks and explicit header attributes. 2013-01-13 18:03:15 -08:00
John MacFarlane
5a4f7ec595 Added tests for implicit header references. 2013-01-03 20:43:44 -08:00
John MacFarlane
5b7c209373 Markdown reader: Fix parsing of consecutive lists.
Pandoc previously behaved like Markdown.pl for consecutive
lists of different styles. Thus, the following would be parsed
as a single ordered list, rather than an ordered list followed
by an unordered list:

    1. one
    2. two

    - one
    - two

This patch makes pandoc behave more sensibly, parsing this as
two lists.  Any change in list type (ordered/unordered) or in
list number style will trigger a new list. Thus, the following
will also be parsed as two lists:

    1. one
    2. two

    a. one
    b. two

Since we regard this as a bug in Markdown.pl, and not something
anyone would ever rely on, we do not preserve the old behavior
even when `--strict` is selected.
2012-01-02 17:04:59 -08:00
John MacFarlane
17d48cf4af Markdown reader: Allow linebreaks in URLs (treat as spaces).
Also, a string of consecutive spaces or tabs is now parsed
as a single space. If you have multiple spaces in your URL,
use %20%20.
2010-12-10 12:14:51 -08:00
John MacFarlane
7864f30717 Markdown reader: handle curly quotes better.
Previously, curly quotes were just parsed literally, leading
to problems in some output formats.  Now they are parsed as
Quoted inlines, if --smart is specified.

Resolves Issue #270.
2010-12-06 20:36:58 -08:00
John MacFarlane
5a4609584c Fix regression: markdown references should be case-insensitive.
This broke when we added the Key type.  We had assumed that
the custom case-insensitive Ord instance would ensure case-insensitive
matching, but that is not how Data.Map works.

* Added a test case for case-insensitivity in markdown-reader-more
* Removed old refsMatch from Text.Pandoc.Parsing module;
* hid the 'Key' constructor;
* dropped the custom Ord and Eq instances, deriving instead;
* added fromKey and toKey to convert between Keys and Inline lists;
* toKey ensures that keys are case-insensitive, since this is the
  only way the API provides to construct a Key.

Resolves Issue #272.
2010-12-05 19:27:00 -08:00
John MacFarlane
905d194db5 Added test for macros. 2010-10-26 20:03:02 -07:00
John MacFarlane
be58768522 Added tests for example lists. 2010-07-12 23:07:00 -07:00
John MacFarlane
c3384bb3f1 Added multilingual URL tests for markdown reader. 2010-03-23 15:07:17 -07:00
fiddlosopher
76e6c071d0 Disallow blank lines in inline code span.
Also added additional test cases for markdown code spans.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1860 788f1e2b-df1e-0410-8736-df70ead52e1b
2010-03-06 02:42:15 +00:00
fiddlosopher
77ba3429e2 Allow multi-line titles and authors in meta block.
Based on a patch by Justin Bogner.

Titles may span multiple lines, provided continuation lines
begin with a space character.

Separate authors may be put on multiple lines, provided
each line after the first begins with a space character.
Each author must fit on one line. Multiple authors on
a single line may still be separated by a semicolon.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1854 788f1e2b-df1e-0410-8736-df70ead52e1b
2010-02-28 11:21:19 +00:00
fiddlosopher
8671bc5a1b Markdown reader: Treat a backslash followed by a newline as hard linebreak.
Resolves Issue #154.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1646 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-12-05 05:33:24 +00:00
fiddlosopher
eb2e560d86 Properly handle commented-out list items in markdown.
Example:
- a
<!--
- b
-->
- c

Resolves Issue #142.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1615 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-11-01 02:38:15 +00:00
fiddlosopher
7163a044a4 Fix inline math parser so that \$ is allowed in math.
Resolves Issue #169.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1609 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-10-12 03:40:47 +00:00
fiddlosopher
9b27f59fc2 Gobble space after Plain blocks containing only raw html inline.
Otherwise following header blocks are not parsed correctly,
since the parser sees blank space before them.  Resolves
Issue #124.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1534 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-01-31 18:30:44 +00:00
fiddlosopher
412315b530 Markdown reader: Allow blank space at end of horizontal rules.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1480 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-11-01 22:58:44 +00:00
fiddlosopher
0e4eb83749 Markdown reader: cleaner handling of spaces in URLs.
Consecutive spaces are now collapsed into one %20, and
final spaces are removed.  Also, a test case has been added.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1477 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-11-01 21:05:33 +00:00
fiddlosopher
c8a56a2864 Parse raw ConTeXt environments as TeX in markdown reader.
Resolves Issue #73.

Also made some structural changes to parsing of raw LaTeX environments.
Previously there was a special block parser for LaTeX environments.
It returned a Para element containing the raw TeX inline. This has
been removed, and the raw LaTeX environment parser is now used in the
rawLaTeXInline parser. The effect is exactly the same, except that we
can now handle consecutive LaTeX and ConTeXt environments not separated
by spaces.  This new flexibility is required by the example in
Issue #73:

    \placeformula \startformula
         L_{1} = L_{2}
    \stopformula

API change: The LaTeX reader now exports rawLaTeXEnvironment' (which
returns a string) rather than rawLaTeXEnvironment (which returns a block
element). This is more likely to be useful in other applications.

Added test cases for raw ConTeXt environments to markdown-reader-more.txt.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1405 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-08-11 07:04:36 +00:00
fiddlosopher
dd2b77d590 Allow newline before URL in markdown link references. Resolves Issue #81.
Added tests for this issue in new "markdown-reader-more" tests.
Changed RunTests.hs to run these tests.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1401 788f1e2b-df1e-0410-8736-df70ead52e1b
2008-08-10 23:26:32 +00:00