summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Extensions.hs
Commit message (Collapse)AuthorAge
* Extensions: Add Ext_stylesJesse Rosenthal2018-02-22
| | | | | | This will be used in the docx reader (defaulting to off) to read pargraph and character styles not understood by pandoc (as divs and spans, respectively).
* ConTeXt writer: Use xtables instead of Tables (#4223)Henri Menke2018-01-15
| | | | | | - Default to xtables for context output. - Added `ntb` extension (affecting context writer only) to use Natural Tables instead. - Added `Ext_ntb` constructor to `Extension` (API change).
* Update copyright notices to include 2018Albert Krewinkel2018-01-05
|
* Alphabetical order Extension constructors.John MacFarlane2017-12-28
| | | | This makes them appear in order in `--list-extensions`.
* HTML reader: parse div with class `line-block` as LineBlock.John MacFarlane2017-12-27
| | | | See #4162.
* OPML reader: enable raw HTML and other extensions by default for notes.John MacFarlane2017-12-17
| | | | | | | | | This fixes a regression in 2.0. Note that extensions can now be individually disabled, e.g. `-f opml-smart-raw_html`. Closes #4164.
* Add `empty_paragraphs` extension.John MacFarlane2017-12-04
| | | | | | | | | | | | | | | | * Deprecate `--strip-empty-paragraphs` option. Instead we now use an `empty_paragraphs` extension that can be enabled on the reader or writer. By default, disabled. * Add `Ext_empty_paragraphs` constructor to `Extension`. * Revert "Docx reader: don't strip out empty paragraphs." This reverts commit d6c58eb836f033a48955796de4d9ffb3b30e297b. * Implement `empty_paragraphs` extension in docx reader and writer, opendocument writer, html reader and writer. * Add tests for `empty_paragraphs` extension.
* Change Generic JSON instances to TemplateHaskell (#4085)Jasper Van der Jeugt2017-11-21
|
* Replace "emacs" extension with "amuse" extensionAlexander Krotov2017-11-13
| | | | It makes clear that extension is related to Muse markup.
* Add emacs extensionAlexander Krotov2017-11-12
|
* Automatic reformating by stylish-haskell.John MacFarlane2017-10-27
|
* Implemented fenced Divs.John MacFarlane2017-10-23
| | | | | | | | | + Added Ext_fenced_divs to Extensions (default for pandoc Markdown). + Document fenced_divs extension in manual. + Implemented fenced code divs in Markdown reader. + Added test. Closes #168.
* FromJSON/ToJSON instances for Reader, WriterOptions.John MacFarlane2017-09-14
| | | | Depends on skylighting 0.3.5.
* Markdown reader: use CommonMark rules for list item nesting.John MacFarlane2017-08-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #3511. Previously pandoc used the four-space rule: continuation paragraphs, sublists, and other block level content had to be indented 4 spaces. Now the indentation required is determined by the first line of the list item: to be included in the list item, blocks must be indented to the level of the first non-space content after the list marker. Exception: if are 5 or more spaces after the list marker, then the content is interpreted as an indented code block, and continuation paragraphs must be indented two spaces beyond the end of the list marker. See the CommonMark spec for more details and examples. Documents that adhere to the four-space rule should, in most cases, be parsed the same way by the new rules. Here are some examples of texts that will be parsed differently: - a - b will be parsed as a list item with a sublist; under the four-space rule, it would be a list with two items. - a code Here we have an indented code block under the list item, even though it is only indented six spaces from the margin, because it is four spaces past the point where a continuation paragraph could begin. With the four-space rule, this would be a regular paragraph rather than a code block. - a code Here the code block will start with two spaces, whereas under the four-space rule, it would start with `code`. With the four-space rule, indented code under a list item always must be indented eight spaces from the margin, while the new rules require only that it be indented four spaces from the beginning of the first non-space text after the list marker (here, `a`). This change was motivated by a slew of bug reports from people who expected lists to work differently (#3125, #2367, #2575, #2210, #1990, #1137, #744, #172, #137, #128) and by the growing prevalance of CommonMark (now used by GitHub, for example). Users who want to use the old rules can select the `four_space_rule` extension. * Added `four_space_rule` extension. * Added `Ext_four_space_rule` to `Extensions`. * `Parsing` now exports `gobbleAtMostSpaces`, and the type of `gobbleSpaces` has been changed so that a `ReaderOptions` parameter is not needed.
* CommonMark reader: support `gfm_auto_identifiers`.John MacFarlane2017-08-08
| | | | | | | | | Added `Ext_gfm_auto_identifiers`: new constructor for `Extension` in `Text.Pandoc.Extensions` [API change]. Use this in githubExtensions. Closes #2821.
* Remove GFM modules; use CMarkGFM for both gfm and commonmark.John MacFarlane2017-08-07
| | | | | | | | | | 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.
* Rewrote LaTeX reader with proper tokenization.John MacFarlane2017-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This rewrite is primarily motivated by the need to get macros working properly. A side benefit is that the reader is significantly faster (27s -> 19s in one benchmark, and there is a lot of room for further optimization). We now tokenize the input text, then parse the token stream. Macros modify the token stream, so they should now be effective in any context, including math. Thus, we no longer need the clunky macro processing capacities of texmath. A custom state LaTeXState is used instead of ParserState. This, plus the tokenization, will require some rewriting of the exported functions rawLaTeXInline, inlineCommand, rawLaTeXBlock. * Added Text.Pandoc.Readers.LaTeX.Types (new exported module). Exports Macro, Tok, TokType, Line, Column. [API change] * Text.Pandoc.Parsing: adjusted type of `insertIncludedFile` so it can be used with token parser. * Removed old texmath macro stuff from Parsing. Use Macro from Text.Pandoc.Readers.LaTeX.Types instead. * Removed texmath macro material from Markdown reader. * Changed types for Text.Pandoc.Readers.LaTeX's rawLaTeXInline and rawLaTeXBlock. (Both now return a String, and they are polymorphic in state.) * Added orgMacros field to OrgState. [API change] * Removed readerApplyMacros from ReaderOptions. Now we just check the `latex_macros` reader extension. * Allow `\newcommand\foo{blah}` without braces. Fixes #1390. Fixes #2118. Fixes #3236. Fixes #3779. Fixes #934. Fixes #982.
* Removed `hard_line_breaks` extension from `markdown_github`.John MacFarlane2017-06-30
| | | | | | | | | | | | | GitHub has two Markdown modes, one for long-form documents like READMEs and one for short things like issue coments. In issue comments, a line break is treated as a hard line break. In README, wikis, etc., it is treated as a space as in regular Markdown. Since pandoc is more likely to be used to convert long-form documents from GitHub Markdown, `-hard_line_breaks` is a better default. Closes #3594.
* Extensions: Monoid instance for Extensions.John MacFarlane2017-06-24
| | | | [API change]
* Text.Pandoc.Extensions: Added `Ext_raw_attribute`.John MacFarlane2017-06-23
| | | | | | Documented in MANUAL.txt. This is enabled by default in pandoc markdown and multimarkdown.
* Added `spaced_reference_links` extension.John MacFarlane2017-05-25
| | | | | | | | | | | | | | This is now the default for pandoc's Markdown. It allows whitespace between the two parts of a reference link: e.g. [a] [b] [b]: url This is now forbidden by default. Closes #2602.
* Include `backtick_code_blocks` extension in `mardkown_mmd`.John MacFarlane2017-05-04
| | | | Closes #3637.
* API change: move extension handling to Text.Pandoc.ExtensionsAlbert Krewinkel2017-04-26
| | | | | | Extension parsing and processing functions were defined in the top-level Text.Pandoc module. These functions are moved to the Extensions submodule as to enable reuse in other submodules.
* Add `space_in_atx_header` extension.John MacFarlane2017-03-20
| | | | | | | | | | | | | | | | | This is enabled by default in pandoc and GitHub markdown but not the other flavors. This requirse a space between the opening #'s and the header text in ATX headers (as CommonMark does but many other implementations do not). This is desirable to avoid falsely capturing things ilke #hashtag or #5 Closes #3512.
* Markdown reader: fixed internal header links.John MacFarlane2017-03-05
| | | | | | | Closes #2397. This patch also adds `shortcut_reference_links` to the list of mmd extensions.
* Stylish-haskell automatic formatting changes.John MacFarlane2017-03-04
|
* Put an Integer rather than Word64 behind Extensions.John MacFarlane2017-01-25
| | | | | This allows us to expand indefinitely. No measurable performance penalty.
* Made `smart` extension default for pandoc markdown.John MacFarlane2017-01-25
| | | | Updated tests.
* Removed readerOldDashes and --old-dashes option, added old_dashes extension.John MacFarlane2017-01-25
| | | | API change. CLI option change.
* Removed readerSmart and the --smart option; added Ext_smart extension.John MacFarlane2017-01-25
| | | | | | | | | | | | | | | | | 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.
* Make Extensions a custom type instead of a Set Extension.John MacFarlane2017-01-25
| | | | | | | | | The type is implemented in terms of an underlying bitset which should be more efficient. API change: from Text.Pandoc.Extensions export Extensions, emptyExtensions, extensionsFromList, enableExtension, disableExtension, extensionEnabled.
* Split extensions code from Options into separate Text.Pandoc.Extensions.John MacFarlane2017-01-25
API change. However, Extensions exports Options, so this shouldn't have much impact.