aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/CommonMark.hs
AgeCommit message (Collapse)AuthorFilesLines
2018-11-11Text.Pandoc.Shared: add parameter to uniqueIdent, inlineListToIdentifier.John MacFarlane1-27/+8
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-11Clean up toIdent in CommonMark reader.John MacFarlane1-8/+9
This partially addresses #5057, fixing a bad interaction between the `ascii_identifiers` extension and the `gfm_auto_identifiers` extension, and creating identifiers that match the ones GitHub produces. This code still needs to be put somewhere common, so the `gfm_auto_identifiers` extension will work with other formats.
2018-07-15Wrap emojis in span nodes (#4759)Anders Waldenborg1-14/+17
Text.Pandoc.Emoji now exports `emojiToInline`, which returns a Span inline containing the emoji character and some attributes with metadata (class `emoji`, attribute `data-emoji` with emoji name). Previously, emojis (as supported in Markdown and CommonMark readers, e.g ":smile:") were simply translated into the corresponding unicode code point. By wrapping them in Span nodes, we make it possible to do special handling such as giving them a special font in HTML output. We also open up the possibility of treating them differently when the `--ascii` option is selected (though that is not part of this commit). Closes #4743.
2018-06-29CommonMark reader: Handle ascii_identifiers extension (#4733)Anders Waldenborg1-13/+18
Non-ascii characters were not stripped from identifiers even if the `ascii_identifiers` extension was enabled (which is is by default for gfm). Closes #4742
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-03-02Revert "Commonmark reader: parse HTML as plain text if `-raw_html`."John MacFarlane1-2/+2
This reverts commit 6dd21250288b51f10056b15a83130f76c788d904.
2018-03-02Commonmark reader: parse HTML as plain text if `-raw_html`.John MacFarlane1-2/+2
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-11-16Introduce `HasSyntaxExtensions` typeclass (#4074)Alexander1-13/+9
+ Added new `HasSyntaxExtensions` typeclass for `ReaderOptions` and `WriterOptions`. + Reimplemented `isEnabled` function from `Options.hs` to accept both `ReaderOptions` and `WriterOptions`. + Replaced `enabled` from `CommonMark.hs` with new `isEnabled`.
2017-11-01hlintAlexander Krotov1-1/+1
2017-10-27hlint changes.John MacFarlane1-2/+2
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-27/+27
2017-10-26update years in copyrightKolen Cheung1-2/+2
2017-08-08Thread options through CommonMark reader.John MacFarlane1-81/+77
This is more efficient than doing AST traversals for emojis and hard breaks. Also make behavior sensitive to `raw_html` extension.
2017-08-08Support `hard_line_breaks` in CommonMark reader.John MacFarlane1-0/+7
2017-08-08CommonMark reader: support `emoji` extension.John MacFarlane1-1/+19
2017-08-08CommonMark reader: support `gfm_auto_identifiers`.John MacFarlane1-0/+31
Added `Ext_gfm_auto_identifiers`: new constructor for `Extension` in `Text.Pandoc.Extensions` [API change]. Use this in githubExtensions. Closes #2821.
2017-08-07CommonMark reader: make exts depend on extensions.John MacFarlane1-2/+4
2017-08-07Remove GFM modules; use CMarkGFM for both gfm and commonmark.John MacFarlane1-6/+63
We no longer have a separate readGFM and writeGFM; instead, we'll use readCommonMark and writeCommonMark with githubExtensions. It remains to implement these extensions conditionally. Closes #3841.
2017-08-07Added gfm (GitHub-flavored CommonMark) as an input and output format.John MacFarlane1-2/+2
This uses bindings to GitHub's fork of cmark, so it should parse gfm exactly as GitHub does (excepting certain postprocessing steps, involving notifications, emojis, etc.). * Added Text.Pandoc.Readers.GFM (exporting readGFM) * Added Text.Pandoc.Writers.GFM (exporting writeGFM) * Added `gfm` as input and output forma Note that tables are currently always rendered as HTML in the writer; this can be improved when CMarkGFM supports tables in output.
2017-06-10Changed all readers to take Text instead of String.John MacFarlane1-3/+3
Readers: Renamed StringReader -> TextReader. Updated tests. API change.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-6/+6
2017-01-25Removed readerSmart and the --smart option; added Ext_smart extension.John MacFarlane1-1/+1
Now you will need to do -f markdown+smart instead of -f markdown --smart This change opens the way for writers, in addition to readers, to be sensitive to +smart, but this change hasn't yet been made. API change. Command-line option change. Updated manual.
2017-01-25Working on readers.Jesse Rosenthal1-3/+4
2015-12-29Use cmark 0.5.John MacFarlane1-4/+12
Closes #2605.
2015-12-12Modified readers to emit SoftBreak when appropriate.John MacFarlane1-1/+1
2015-08-07Updated readers, writers and README for link attributemb211-1/+1
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-1/+1
(mb21)
2015-03-28Merge branch 'errortype' of https://github.com/mpickering/pandoc into ↵John MacFarlane1-2/+3
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-17Fixed a compiler warning.John MacFarlane1-1/+1
2015-03-17Added CommonMark reader using cmark (libcmark bindings).John MacFarlane1-0/+118
- Added commonmark as an input format. - Added `Text.Pandoc.Readers.CommonMark.readCommonMark`. - For now, we use the markdown writer to generate benchmark text for the CommonMark reader. We can change this when we get a writer.