aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Markdown.hs
AgeCommit message (Collapse)AuthorFilesLines
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.
2014-07-16Removed redundant clause in markdown parser.John MacFarlane1-2/+1
Thanks @dubiousjim. Close #1431.
2014-07-13Use renderTags' for all tag rendering.John MacFarlane1-1/+1
This properly handles tags that should be self-closing. Previously `<hr/>` would appear in EPUB output as `<hr></hr>`. Closes #1420.
2014-07-11Removed (>>~) functionMatthew Pickering1-4/+4
This function is equivalent to the more general (<*) which is defined in Control.Applicative. This change makes pandoc code easier to understand for those not familar with the codebase.
2014-07-10Fixed an issue caused by e4263d306e6988dd322c895242eb818d22b9e012.John MacFarlane1-0/+5
This sets `stateInHtmlBlock` to `Just "div"` when we're parsing an HTML div. Without this fix, a closing `</div>` tag could be parsed as part of a list item rather than after the list.
2014-07-10Markdown reader: Fixed regression with intraword underscores.John MacFarlane1-10/+16
Closes #1121.
2014-07-10Markdown reader: Slight rewrite of enclosure/emphOrStrong code.John MacFarlane1-6/+8
Semantics should be the same.
2014-07-07Revamped raw HTML block parsing in markdown.John MacFarlane1-42/+47
- We no longer include trailing spaces and newlines in the raw blocks. - We look for closing tags for elements (but without backtracking). - Each block-level tag is its own RawBlock; we no longer try to consolidate them (though `--normalize` will do so). Closes #1330.
2014-06-23Markdown reader: Combine consecutive latex environments.John MacFarlane1-2/+4
This helps when you have two minipages which can't have blank lines between them. See #690, #1196.
2014-06-20Markdown reader: Support smallcaps through span.John MacFarlane1-1/+6
`<span style="font-variant:small-caps;">foo</span>` will be parsed as a `SmallCaps` inline, and will work in all output formats that support small caps. Closes #1360.
2014-06-20Markdown reader: Prevent spurious line breaks after list items.John MacFarlane1-1/+2
When the `hard_line_breaks` option was specified, pandoc would produce a spurious line break after a tight list item. This patch solves the problem. Closes #1137.
2014-06-16Small improvement to fix to #1333.John MacFarlane1-4/+1
This allows blank lines at end of multiline headers.
2014-06-16Markdown reader: fixed #1333 (table parsing bug).John MacFarlane1-5/+6
2014-05-27Markdown reader: Handle `c++` and `objective-c` as language identifiersJohn MacFarlane1-1/+8
in github-style fenced blocks. Closes #1318. Note: This is special-case handling of these two cases. It would be good to do something more systematic.
2014-05-14Move `citeKey` from Readers.Markdown to ParsingAlbert Krewinkel1-14/+0
The function can be used by other readers, so it is made accessible for all parsers.
2014-05-14Introduce class HasLastStrPosition, generalize functionsAlbert Krewinkel1-8/+3
Both `ParserState` and `OrgParserState` keep track of the parser position at which the last string ended. This patch introduces a new class `HasLastStrPosition` and makes the above types instances of that class. This enables the generalization of functions updating the state or checking if one is right after a string.
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-2/+2
2014-05-04Fixed the fix to #1154.John MacFarlane1-1/+1
We need to strip off up to 4 spaces, not up to 3.
2014-05-04Markdown reader: Fixed bug with unwanted code in lists.John MacFarlane1-0/+1
Closes #1154. When reading a raw list item, we now strip off nonindent spaces.
2014-05-02Fixed empty reference links. Closes #1186.John MacFarlane1-3/+1
Includes test.
2014-05-01Markdown reader: Make one-column pipe tables work.John MacFarlane1-6/+16
Closes #1218.
2014-04-24Render numbers in YAML metadata without decimals when possible.John MacFarlane1-1/+6
The change to aeson > 0.7 caused numbers to be rendered with decimals. This change causes them to be rendered without decimals wehn possible.
2014-04-19Move `compactify'DL` from Markdown reader into SharedAlbert Krewinkel1-17/+0
The function `compactify'DL`, used to change the final definition item of a definition list into a `Plain` iff all other items are `Plain`s as well, is useful in many parsers and hence moved into Text.Pandoc.Shared.
2014-04-01Changed the smart punctuation parser to return Inlines rather than an Inline ↵Matthew Pickering1-1/+1
element and updated files accordingly
2014-03-24Markdown reader: Fixed regression on line breaks in strict mode.John MacFarlane1-1/+1
Closes #1203.
2014-02-26Markdown reader: Improved parsing of nested divs.John MacFarlane1-0/+2
Formerly a closing div tag would be missed if it came right after other block-level tags.
2014-02-26Markdown parser: avoid backtracking when closing `</div>` not found.John MacFarlane1-6/+13
2014-02-26Markdown reader: small efficiency improvement.John MacFarlane1-1/+1
Switched `notFollewdBy' rawHtmlBlocks` -> `notFollowedBy' (htmlTag isBlockTag)`, which is more efficient.