aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Markdown.hs
AgeCommit message (Collapse)AuthorFilesLines
2015-09-17Markdown writer: in TOC, add links to headers.John MacFarlane1-2/+5
Closes #829.
2015-06-27Removed unused import.John MacFarlane1-1/+0
2015-06-27Plain writer: don't use symbols for super/subscript.John MacFarlane1-14/+10
Simplified code by using plainExtensions from Options. Closes #2237.
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane1-2/+2
2015-04-18Markdown writer: improved escaping.John MacFarlane1-2/+3
`<` should not be escaped as `\<`, for compatibility with original Markdown. We now escape `<` and `>` with entities. Also, we now backslash-escape square brackets. Closes #2086.
2015-03-19Markdown writer: fixes for GHC 7.10.John MacFarlane1-3/+3
2015-03-15Merge pull request #1989 from zudov/shortcut_ref_link_prJohn MacFarlane1-29/+55
Support shortcut reference links in markdown writer
2015-03-10Support shortcut reference links in markdown writerKonstantin Zudov1-29/+55
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-1/+6
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 writer: don't emit span tags if plain or raw HTML disabled.John MacFarlane1-5/+8
2015-02-25Define isRight since it's only in recent versions of Data.Either.John MacFarlane1-1/+4
2015-02-25Markdown writer: Avoid introducing spurious list items through wrapping.John MacFarlane1-12/+41
Closes #1946.
2015-01-05ghc 7.10.1 RC1 requires specifying the type of String literals ↵Mark Wright1-6/+6
https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof...
2014-08-16Markdown writer: don't escape $, ^, ~ when extensions are deactivated.John MacFarlane1-5/+16
`tex_math_dollars`, `superscript`, and `subscript` extensions, respectively. Closes #1127.
2014-08-08Plain writer: Use ALL CAPS for level 1 headers.John MacFarlane1-1/+4
2014-08-08Markdown writer: Respect -raw_html.John MacFarlane1-12/+14
pandoc -t markdown-raw_html should not emit any raw HTML, even span and div tags that go with pandoc Span and Div elements. Cleaned up a bit of the logic with extensions and plain.
2014-08-04Use `stripPrefix` where appropriate.Artyom Kazak1-2/+3
2014-08-03Correctly implement capitalisation.Artyom Kazak1-7/+3
Using `map toUpper` to capitalise text is wrong, as e.g. “Straße” should be converted to “STRASSE”, which is 1 character longer. This commit adds a `capitalize` function and replaces 2 identical implementations in different modules (`toCaps` and `capitalize`) with it.
2014-07-27Markdown writer: Separate adjacent lists of the same kind with comment.John MacFarlane1-3/+9
Closes #1458.
2014-07-27Markdown writer: More improvements to 'plain' output, updated tests.John MacFarlane1-21/+26
Math now appears in unicode if possible, without the distracting italics around identifiers. Blank lines around headers are more consistent. Footnotes appear in regular [n] style.
2014-07-27Markdown writer: Better 'plain' output.John MacFarlane1-83/+101
We now largely follow the style of Project Gutenberg. Emphasis is rendered with `_underscores_`, strong with ALL CAPS. The appearance of horizontal rules has changed (even in regular markdown) to a line across the whole page. Headings are rendered differently, using space to set them off.
2014-07-27Markdown writer: Update definition lists.John MacFarlane1-2/+13
They now behave like the new reader does. The old behavior can be activated with the `compact_definition_lists` extension.
2014-07-21Markdown writer: Avoid wrapping that might start a list.John MacFarlane1-1/+5
Or a blockquote or header. Closes #1013.
2014-07-19Renamed readTeXMath' to avoid name conflict with texmath 0.6.7Matthew Pickering1-3/+3
Also removed deprecated readTeXMath.
2014-07-13Markdown writer: Use span with style for SmallCaps. (#1360)John MacFarlane1-1/+8
2014-07-13Markdown writer: use Span instead of (hackish) SmallCaps in plainify.John MacFarlane1-9/+10
2014-07-13Use renderTags' for all tag rendering.John MacFarlane1-2/+2
This properly handles tags that should be self-closing. Previously `<hr/>` would appear in EPUB output as `<hr></hr>`. Closes #1420.
2014-07-11Markdown writer: don't use braced attributes for fenced code.John MacFarlane1-2/+2
Removed `Ext_fenced_code_attributes` from `markdown_github` extensions. If this extension is not set, the first class attribute will be printed after the opening fence as a bare word. Closes #1416.
2014-06-03Markdown writer: Prettier pipe tables.John MacFarlane1-8/+16
Columns are now aligned. Closes #1323.
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-2/+2
2014-04-24Markdown writer: Use proper escapes to avoid unwanted lists.John MacFarlane1-11/+16
Previously we used 0-width spaces, an ugly hack. Closes #980.
2014-03-30Markdown writer: Use longer backtick fences if needed.John MacFarlane1-1/+5
If the content contains a backtick fence and there are attributes, make sure longer fences are used to delimit the code. Note: This works well in pandoc, but github markdown is more limited, and will interpret the first string of three or more backticks as ending the code block. Closes #1206.
2013-12-19HLint: use `elem` and `notElem`Henry de Valence1-5/+6
Replaces long conditional chains with calls to `elem` and `notElem`.
2013-12-09Don't use tilde code blocks with braced attributes in gfm output.John MacFarlane1-9/+9
A consequence of this change is that the backtick form will be preferred in general if both are enabled. I think that is good, as it is much more widespread than the tilde form. Closes #1084.
2013-11-30Markdown writer: Fix rendering of tight sublists.John MacFarlane1-1/+8
E.g. - foo - bar - baz Previously a spurious blank line was included before the last item. Closes #1050.
2013-11-06Don't print `<span>` tags in 'plain' output.John MacFarlane1-1/+4
2013-11-01TexMath: Export readTeXMath', which attends to display/inline.John MacFarlane1-3/+3
Deprecate readTeXMath, and use readTeXMath' in all the writers. Require texmath >= 0.6.5.
2013-10-16Use isURI instead of isAbsoluteURI.John MacFarlane1-2/+2
It allows fragments identifiers.
2013-09-19Markdown reader: small code improvement.John MacFarlane1-5/+5
2013-09-12Markdown writer: Print references if output is 'plain'.John MacFarlane1-1/+2
2013-09-06Markdown writer: Fixed bugs in YAML header output.John MacFarlane1-3/+3
2013-08-20Create Cite element even if no matching reference in the biblio.John MacFarlane1-14/+21
* Add ??? as fallback text for non-resolved citations. * Biblio: Put references (including a header at the end of the document, if one exists) inside a Div with class "references". This gives some control over styling of references, and allows scripts to manipulate them. * Markdown writer: Print markdown citation codes, and disable printing of references, if `citations` extension is enabled. NOTE: It would be good to improve what citeproc-hs does for a nonexistent key.
2013-08-18Adjusted writers and tests for change in parsing of div/span.John MacFarlane1-5/+12
Textile, MediaWiki, Markdown, Org, RST will emit raw HTML div tags for divs. Otherwise Div and Span are "transparent" block containers.
2013-08-10Use walk, walkM in place of bottomUp, bottomUpM when possible.John MacFarlane1-4/+4
They are significantly faster.
2013-08-08Preliminary support for new Div and Span elements in writers.John MacFarlane1-0/+3
Currently these are "transparent" containers, except in HTML, where they produce div and span elements with attributes.
2013-07-02Rename `Ext_yaml_title_block` -> `Ext_yaml_metadata_block`.John MacFarlane1-4/+4
2013-07-02Markdown writer: Changed condition for rendering title block.John MacFarlane1-4/+3
Previously it was only rendered if title, author, or date set. Now any metadata field can be set.
2013-07-02Write full metadata in MMD style title blocks.John MacFarlane1-7/+23
2013-07-01Markdown writer: Commas are okay in plain yaml scalars.John MacFarlane1-1/+1
It's just commas with brackets that can cause problems.
2013-07-01Markdown writer: Render yaml title block fields in alpha order.John MacFarlane1-2/+3
This makes the output predictable; previously it varied across implementations.