aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Markdown.hs
AgeCommit message (Collapse)AuthorFilesLines
2015-11-24Allow pipe tables with no body rows.John MacFarlane1-2/+3
Previously this raised a runtime error. Closes #2556.
2015-11-19Renamed link attribute extensions.John MacFarlane1-4/+4
* Old `link_attributes` -> `mmd_link_attributes` * Recently added `common_link_attributes` -> `link_attributes` Note: this change could break some existing workflows.
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-26/+31
mb21-new-image-attributes * Bumped version to 1.16. * Added Attr field to Link and Image. * Added `common_link_attributes` extension. * Updated readers for link attributes. * Updated writers for link attributes. * Updated tests * Updated stack.yaml to build against unreleased versions of pandoc-types and texmath. * Fixed various compiler warnings. Closes #261. TODO: * Relative (percentage) image widths in docx writer. * ODT/OpenDocument writer (untested, same issue about percentage widths). * Update pandoc-citeproc.
2015-11-13Added `emoji` extension to Markdown.John MacFarlane1-0/+17
This is enabled by default in `markdown_github`. Added `Ext_emoji` to `Extension` in `Text.Pandoc.Options` (API change). Closes #2523.
2015-11-09Restored Text.Pandoc.Compat.Monoid.John MacFarlane1-0/+1
Don't use custom prelude for latest ghc. This is a better approach to making 'stack ghci' and 'cabal repl' work. Instead of using NoImplicitPrelude, we only use the custom prelude for older ghc versions. The custom prelude presents a uniform API that matches the current base version's prelude. So, when developing (presumably with latest ghc), we don't use a custom prelude at all and hence have no trouble with ghci. The custom prelude no longer exports (<>): we now want to match the base 4.8 prelude behavior.
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane1-1/+0
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane1-0/+1
This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
2015-10-30Pipe tables with long lines now get relative cell widths.John MacFarlane1-13/+20
If a pipe table contains a line longer than the column width (as set by `--columns` or 80 by default), relative widths are computed based on the widths of the separator lines relative to the column width. This should solve persistent problems with long pipe tables in LaTeX/PDF output, and give more flexibility for determining relative column widths in other formats, too. For narrower pipe tables, column widths of 0 are used, telling pandoc not to specify widths explicitly in output formats that permit this. Closes #2471.
2015-10-26Markdown reader: improved parser for `mmd_title_block`.John MacFarlane1-9/+8
We now allow blank metadata fields. These were explicitly disallowed before. For background see #2026. The issue in #2026 has since been fixed in another way, so there is no need to forbid blank metadata fields.
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-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-25/+30
(mb21)
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.