aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Markdown.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-05-22Markdown writer: Ensure the code fence is long enough.John MacFarlane1-11/+10
Previously too few backticks were used when the code block contained an indented line of backticks. (Ditto tildes.) Cloess #5519.
2019-05-21Markdown writer: fix small error in ed73bd28Jesse Rosenthal1-4/+3
A `do` notation was left in a non-monadic function.
2019-05-21Markdown writer: Handle labels with integer namesJesse Rosenthal1-3/+20
Previously if labels had integer names, it could produce a conflict with auto-labeled reference links. Now we test for a conflict and find the next available integer. Note that this involves adding a new state variable `stPrevRefs` to keep track of refs used in other document parts when using `--reference-location=block|section` Closes #5495
2019-03-28Markdown writer: better rendering of numbers.John MacFarlane1-1/+4
If the number is integral, we render it as an integral not a float. Closes #5398.
2019-03-28Markdown writer: proper rendering of empty map in YAML metadata.John MacFarlane1-1/+3
Should be `{}` not empty string. Partially addresses #5398.
2019-03-17Properly escape attributes in Markdown writer.John MacFarlane1-4/+9
Closes #5369.
2019-03-09Markdown writer: improve handling of raw blocks/inline.John MacFarlane1-34/+55
We now emit raw content using `raw_attribute` when no more direct method is available.
2019-03-01Remove license boilerplate.John MacFarlane1-18/+0
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel1-2/+2
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2019-02-01Markdown writer: use markdown="1" when appropriate for Divs.John MacFarlane1-0/+6
When `native_divs` and `markdown_in_html_blocks` are disabled but `raw_html` and `markdown_attribute` are enabled...
2019-01-10Make 'plain' RawBlocks work for 'plain' output.John MacFarlane1-0/+5
2019-01-04Implement --toc in commonmark/gfm writers.John MacFarlane1-1/+1
Closes #5172.
2019-01-04T.P.Writers.Shared - add toTableOfContents (API change).John MacFarlane1-21/+2
This is refactored out from the Markdown writer. IT can be used in other writers to create a generic TOC.
2019-01-02Implement task lists (#5139)Mauro Bieg1-2/+4
Closes #3051
2018-12-03Markdown writer: include needed whitespace after HTML figure.John MacFarlane1-1/+1
We use HTML for a figure in markdown dialects that can't represent it natively. Closes #5121.
2018-11-19For bibliography match Div with id 'refs', not class 'references'.John MacFarlane1-2/+2
This was a mismatch between pandoc's docx, epub, latex, and markdown writers and the behavior of pandoc-citeproc, which actually looks for a div with id 'refs' rather than one with class 'references'.
2018-11-11Text.Pandoc.Shared: add parameter to uniqueIdent, inlineListToIdentifier.John MacFarlane1-1/+1
The parameter is Extensions. This allows these functions to be sensitive to the settings of `Ext_gfm_auto_identifiers` and `Ext_ascii_identifiers`. This allows us to use `uniqueIdent` in the CommonMark reader, replacing some custom code. It also means that `gfm_auto_identifiers` can now be used in all formats. Semantically, `gfm_auto_identifiers` is now a modifier of `auto_identifiers`; for identifiers to be set, `auto_identifiers` must be turned on, and then the type of identifier produced depends on `gfm_auto_identifiers` and `ascii_identifiers` are set. Closes #5057.
2018-11-01Implement --ascii for Markdown writer.John MacFarlane1-23/+35
2018-10-14Markdown writer: ensure blank between raw block and normal content.John MacFarlane1-0/+7
Otherwise a raw block can prevent a paragraph from being recognized as such. Closes #4629.
2018-10-05CommonMark writer: add plain text fallbacks. (#4531)quasicomputational1-28/+1
Previously, the writer would unconditionally emit HTMLish output for subscripts, superscripts, strikeouts (if the strikeout extension is disabled) and small caps, even with raw_html disabled. Now there are plain-text (and, where possible, fancy Unicode) fallbacks for all of these corresponding (mostly) to the Markdown fallbacks, and the HTMLish output is only used when raw_html is enabled. This commit adds exported functions `toSuperscript` and `toSubscript` to `Text.Pandoc.Writers.Shared`. [API change] Closes #4528.
2018-08-19Markdown writer: escape `~` if strikeout extension enabled.John MacFarlane1-1/+2
See #4840.
2018-07-15Make markdown and github writers respect the `emoji` extension.John MacFarlane1-0/+5
2018-06-29Use HsYAML instead of yaml for translations, YAML metadata.John MacFarlane1-1/+1
yaml wraps a C library; HsYAML is pure Haskell. Closes #4747. Advances #4535.
2018-05-30Markdown writer: preserve `implicit_figures` with attributes...John MacFarlane1-5/+11
...even if `implicit_attributes` is not set, by rendering in raw HTML. Fixes #4677.
2018-04-21Markdown reader/writer: spacing adjustments in tables.John MacFarlane1-1/+4
* Markdown writer now includes a blank line at the end of the row in a single-row multiline table, to prevent it from being interpreted as a simple table. Closes #4578. * Markdown reader does a better job computing the relative width of the last column in a multiline table, so we can round-trip tables without constantly shrinking the last column.
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-02-16Markdown writer: properly escape @ to avoid capture as citation.John MacFarlane1-1/+7
Closes #4366.
2018-01-16Markdown writer: fix cell width calculation.John MacFarlane1-1/+1
Previously we could get ever-lengthening cell widths when a table was run repeatedly through `pandoc -f markdown -t markdown`. This patch stabilizes the relative cell widths. Closes #4265.
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-12-23Plain writer: don't linkify table of contents.John MacFarlane1-10/+12
2017-11-28Support `--webtex` for `gfm` output.John MacFarlane1-3/+2
2017-11-13Markdown writer: fix bug with doubled footnotes in grid tables.John MacFarlane1-12/+22
Closes #4061.
2017-10-31Markdown reader: make sure fenced div closers work in lists.John MacFarlane1-1/+1
Previously the following failed: ::: {.class} 1. one 2. two ::: and you needed a blank line before the closing `:::`.
2017-10-31Make `fenced_divs` affect the Markdown writer.John MacFarlane1-5/+13
If `fenced_divs` is enabled, fenced divs will be used.
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-3/+3
2017-10-13markdown writer: always write bracketed_spans' attributesd-dorazio1-2/+4
2017-09-07Markdown writer: Escape pipe characters when `pipe_tables` enabled.John MacFarlane1-0/+1
Closes #3887.
2017-09-05Markdown writer: make Span with null attribute transparent.John MacFarlane1-4/+3
That is, we don't use brackets or `<span>` tags to mark spans when there are no attributes; we simply output the contents.
2017-09-04Plain writer: don't use &nbsp; to separate list and indented code.John MacFarlane1-3/+6
There's no need for it in this context, since this isn't to be interpreted using Markdown rules.
2017-08-26Markdown writer: don't crash on Str "".John MacFarlane1-1/+1
2017-08-13Markdown writer: Use pipe tables if `raw_html` disabled...John MacFarlane1-2/+10
and `pipe_tables` enabled, even if the table has relative width information. Closes #3734.
2017-07-30Markdown writer: better escaping of `<` and `>`.John MacFarlane1-2/+6
If `all_symbols_escapable` is set, we backslash escape these. Otherwise we use entities as before.
2017-06-30Markdown writer: Ensure that `+` and `-` are escaped properly...John MacFarlane1-0/+3
so they don't cause spurious lists. Previously they were only if succeeded by a space, not if they were at end of line. Closes #3773.
2017-06-26Use `table-of-contents` for contents of toc, make `toc` a boolean.John MacFarlane1-3/+7
Changed markdown, rtf, and HTML-based templates accordingly. This allows you to set `toc: true` in the metadata; this previously produced strange results in some output formats. Closes #2872. For backwards compatibility, `toc` is still set to the toc contents. But it is recommended that you update templates to use `table-of-contents` for the toc contents and `toc` for a boolean flag.
2017-06-23Markdown writer: make sure `plain`, `markdown_github`, etc. work for raw.John MacFarlane1-5/+9
Previously only `markdown` worked. Note: currently a raw block labeled `markdown_github` will be printed for any `markdown` format.
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane1-1/+1
Now we raise a proper error on template failure.
2017-06-17Use Control.Monad.State.Strict throughout.John MacFarlane1-1/+1
This gives 20-30% speedup and reduction of memory usage in most of the writers.
2017-06-12Markdown writer: don't allow soft break in header.John MacFarlane1-0/+7
Closes #3736.
2017-06-11Switched Writer types to use Text.John MacFarlane1-10/+13
* XML.toEntities: changed type to Text -> Text. * Shared.tabFilter -- fixed so it strips out CRs as before. * Modified writers to take Text. * Updated tests, benchmarks, trypandoc. [API change] Closes #3731.
2017-06-01Markdown writer: Avoid inline surround-marking with empty content.John MacFarlane1-0/+5
E.g. we don't want `<strong></strong>` to become `****`. Similarly for emphasis, super/subscript, strikeout. Closes #3715.