aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Markdown.hs
AgeCommit message (Collapse)AuthorFilesLines
2015-10-14Use custom Prelude to avoid compiler warnings.John MacFarlane1-3/+1
- The (non-exported) prelude is in prelude/Prelude.hs. - It exports Monoid and Applicative, like base 4.8 prelude, but works with older base versions. - It exports (<>) for mappend. - It hides 'catch' on older base versions. This allows us to remove many imports of Data.Monoid and Control.Applicative, and remove Text.Pandoc.Compat.Monoid. It should allow us to use -Wall again for ghc 7.10.
2015-09-25Markdown reader: handle 'id' and 'class' in parsing key/value attrs.John MacFarlane1-1/+5
# Header {id="myid" class="foo bar"} is now equivalent to # Header {#myid .foo .bar} Closes #2396.
2015-07-27Pipe tables: allow indented columns.John MacFarlane1-1/+3
Previously the left-hand column could not start with 4 or more spaces indent. This was inconvenient for right-aligned left columns. Note that the first (header column) must still have 3 or fewer spaces indentation, or the table will be treated as an indented code block.
2015-07-25Merge pull request #1689 from kuribas/masterJohn MacFarlane1-3/+9
Use '=' instead of '#' for atx-style headers in markdown+lhs.
2015-07-23Updated tests and removed a skipSpaces....John MacFarlane1-1/+0
we no longer need it with the change to toKey, and it is expensive to skip spaces after every inline.
2015-07-23Markdown Reader: Skip spaces in headersOphir Lifshitz1-0/+2
2015-07-14Markdown reader: don't allow bare URI links or autolinks in link label.John MacFarlane1-0/+2
Added test cases. Closes #2300.
2015-05-13Markdown reader: Made implicit header references case-insensitive.John MacFarlane1-11/+23
Added `stateHeaderKeys` to `ParserState`; this is a `KeyTable` like `stateKeys`, but it only gets consulted if we don't find a match in `stateKeys`, and if `Ext_implicit_header_references` is enabled. Closes #1606.
2015-05-13Fixed regression in charsInBalancedBrackets.John MacFarlane1-1/+2
Introduced by e9d7504. This regression caused link and image references containing raw tex not to parse correctly. Added test. Closes #2150.
2015-05-03Make sure a closing `</div>` doesn't get included in a defn list item.John MacFarlane1-0/+1
Closes #2127.
2015-04-26Fixed regression with lists inside defintiion lists.John MacFarlane1-1/+1
This fixes a regression (not in any released version) on things like hi : - there Closes #2098.
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane1-2/+2
2015-04-19Rewrote charsInBalancedBrackets.John MacFarlane1-12/+15
This version should be a bit more efficient. This doesn't help with #1735, however.
2015-04-20MD Reader: Fix links/footnotets after citationsNikolay Yakimov1-2/+16
Footnotes: check if '^' follows '[' Links: check if '[' or '(' follows ']' Shorthand links: attempt to lazily parse suffix as referenceLink
2015-04-18Revert "Merge pull request #1947 from mpickering/Fmonad"John MacFarlane1-326/+345
Closes #2062. This reverts commit c302bdcdbe97b38721015fe82403b2a8f488a702, reversing changes made to b983adf0d0cbc98d2da1e2751f46ae1f93352be6. Conflicts: src/Text/Pandoc/Parsing.hs src/Text/Pandoc/Readers/Markdown.hs src/Text/Pandoc/Readers/Org.hs src/Text/Pandoc/Readers/RST.hs
2015-04-18Markdown definition lists: don't require indent for first line.John MacFarlane1-2/+4
Previously the body of the definition (after the `:` or `~` marker) needed to be in column 4. This commit relaxes that requirement, to better match the behavior of PHP Markdown Extra. So, now this is a valid definition list: foo : bar This patch also helps resolve a potentially ambiguity with table captions: foo : bar ----- table ----- Is "bar" a definition, or the caption for the table? We'll count it as a caption for the table. Closes #2087.
2015-04-18MD Reader: Smart `'` after inline mathNikolay Yakimov1-1/+2
Closes #1909. Adds new parser combinator to Parsing.hs `a <+?> b` : if a succeeds, applies b and mappends output (if any) to result of a. If b fails, it's just a, if a fails, whole expression fails.
2015-04-07Markdown Reader: eliminate common subexpressionsJulien Cretel1-2/+5
2015-03-28Merge branch 'errortype' of https://github.com/mpickering/pandoc into ↵John MacFarlane1-32/+40
mpickering-errortype Conflicts: benchmark/benchmark-pandoc.hs src/Text/Pandoc/Readers/Markdown.hs src/Text/Pandoc/Readers/Org.hs src/Text/Pandoc/Readers/RST.hs tests/Tests/Readers/LaTeX.hs
2015-03-28Markdown Reader: Require nonempty value in mmd title blockNikolay Yakimov1-0/+1
`many1Till` will gobble up newline, and then whole following line will match, so I had to use guard here.
2015-03-28Markdown Reader: Req. " " after key in mmd title blockNikolay Yakimov1-1/+4
Require space after key-value delimiter colon in mmd title block. Issue #2026 Amend: parsec's `spaces` include newlines, but we don't want that. Had to make custom `spaceNoNewline` parser here
2015-03-28Markdown Reader: Disable meta exts for meta valuesNikolay Yakimov1-1/+6
Disable all metadata block extensions when parsing metadata field values. Issue #2026
2015-03-23Allow pipe tables with header but no body.John MacFarlane1-1/+1
Closes #2017.
2015-03-23Fix accidently usage of list monad instanceMatthew Pickering1-1/+1
2015-03-22Add missing importMatthew Pickering1-1/+1
2015-03-22Factor out "returnState" into Parsing moduleMatthew Pickering1-8/+1
2015-03-22HLint changesMatthew Pickering1-82/+76
2015-03-22Remove F Monad from Markdown readerMatthew Pickering1-313/+306
2015-03-15Merge pull request #1989 from zudov/shortcut_ref_link_prJohn MacFarlane1-0/+1
Support shortcut reference links in markdown writer
2015-03-10Support shortcut reference links in markdown writerKonstantin Zudov1-0/+1
Issue #1977 Most markdown processors support the [shortcut format] for reference links. Pandoc's markdown reader parsed this shortcuts unoptionally. Pandoc's markdown writer (with --reference-links option) never shortcutted links. This commit adds an extension `shortcut_reference_links`. The extension is enabled by default for those markdown flavors that support reading shortcut reference links, namely: - pandoc - strict pandoc - github flavoured - PHPmarkdown If extension is enabled, reader parses the shortcuts in the same way as it preveously did. Otherwise it would parse them as normal text. If extension is enabled, writer outputs shortcut reference links unless doing so would cause problems (see test cases in `tests/Tests/Writers/Markdown.hs`).
2015-03-07Fixed pipe tables -- headerless tables are not allowed.John MacFarlane1-5/+3
GFM and PHP Markdown Extra pipe tables require headers. Previously pandoc allowed pipe tables not to include headers, and produced headerless pipe tables in Markdown output, but this was based on a misconception about pipe table syntax. This commit fixes this. Note: If you have been using headerless pipe tables, this may cause existing tables to break. Closes #1996.
2015-02-25Markdown reader: check for tex macros after indented code.John MacFarlane1-3/+3
Closes #1973.
2015-02-18Change return type of Markdown readerMatthew Pickering1-25/+33
2015-02-18Factor out "returnState" into Parsing moduleMatthew Pickering1-8/+1
2015-02-18HLint changesMatthew Pickering1-82/+76
2015-02-18Remove F Monad from Markdown readerMatthew Pickering1-312/+307
2014-12-15Don't treat a citation as a reference link label.John MacFarlane1-3/+4
Closes #1763.
2014-12-12expose warnings from RST reader; refactorDaniel Bergey1-5/+1
This commit moves some code which was only used for the Markdown Reader into a generic form which can be used for any Reader. Otherwise, it takes naming and interface cues from the preexisting Markdown code.
2014-12-08RST Reader: Warn about skipped directivesDaniel Bergey1-6/+0
move `addWarning` to Parsing.hs, so it can be used by Markdown & RST readers.
2014-11-12Merge pull request #1645 from neongreen/issue1636John MacFarlane1-2/+9
Fix 'Ext_lists_without_preceding_blankline' bug.
2014-10-18Markdown reader: allow `startnum` to work without `fancy_lists`.John MacFarlane1-2/+2
Formerly `pandoc -f markdown-fancy_lists+startnum` did not work properly.
2014-10-14Use '=' instead of '#' for atx-style headers in markdown+lhs.Kristof Bastiaensen1-3/+9
2014-09-26Fix 'Ext_lists_without_preceding_blankline' bug.Artyom1-2/+9
* Fixes #1636. * Adds a test.
2014-08-31Markdown reader: better handling of paragraph in div.John MacFarlane1-0/+7
Previously text that ended a div would be parsed as Plain unless there was a blank line before the closing div tag. Test case: <div class="first"> This is a paragraph. This is another paragraph. </div> Closes #1591.
2014-08-14Markdown reader: Better handle quote characters in inline links.John MacFarlane1-2/+4
This was previously failing to be recognized as a link: [Test](http://en.wikipedia.org/wiki/Ward's_method) Closes #1534.
2014-08-12Markdown reader: Improved parsing of indented code in list items.John MacFarlane1-25/+42
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-08Added `native_divs` and `native_spans` extensions.John MacFarlane1-2/+2
This allows users to turn off the default pandoc behavior of parsing contents of div and span tags in markdown and HTML as native pandoc Div blocks and Span inlines. Setting of default epub extensions has been moved from the EPUB reader to Text.Pandoc.
2014-07-20Fix behavior of `markdown_attribute` extension.John MacFarlane1-4/+15
It now works as in PHP markdown extra. Setting `markdown="1"` on an outer tag affects all contained tags until it is reversed with `markdown="0"`. Closes #1378. Added `stateMarkdownAttribute` to `ParserState`.
2014-07-20Markdown reader: Fixed small bug in HTML parsing with markdown_attribute.John MacFarlane1-3/+4
Test case: <aside markdown="1"> *hi* </aside> Previously gave: <article markdown="1"> <p><em>hi</em> </article></p>
2014-07-20Markdown reader: revised definition list syntax (closes #1429).John MacFarlane1-23/+38
* This change brings pandoc's definition list syntax into alignment with that used in PHP markdown extra and multimarkdown (with the exception that pandoc is more flexible about the definition markers, allowing tildes as well as colons). * Lazily wrapped definitions are now allowed; blank space is required between list items; and the space before definition is used to determine whether it is a paragraph or a "plain" element. * For backwards compatibility, a new extension, `compact_definition_lists`, has been added that restores the behavior of pandoc 1.12.x, allowing tight definition lists with no blank space between items, and disallowing lazy wrapping.