git.iko.soy/typeable/pandoc
on master help sign in
Added `angle_brackets_escapable` extension.
696dfbcJohn MacFarlane
MANUAL.txt+7−1
@@ -3332,6 +3332,12 @@ in pandoc, but may be enabled by adding `+EXTENSION` to the format
3332name, where `EXTENSION` is the name of the extension. Thus, for
3332name, where `EXTENSION` is the name of the extension. Thus, for
3333example, `markdown+hard_line_breaks` is Markdown with hard line breaks.
3333example, `markdown+hard_line_breaks` is Markdown with hard line breaks.
3334
3334
3335+#### Extension: `angle_brackets_escapable` ####
3336+
3337+Allow `<` and `>` to be backslash-escaped, as they can be in
3338+GitHub flavored Markdown but not original Markdown. This is
3339+implied by pandoc's default `all_symbols_escapable`.
3340+
3335#### Extension: `lists_without_preceding_blankline` ####
3341#### Extension: `lists_without_preceding_blankline` ####
3336
3342
3337Allow a list to occur right after a paragraph, with no intervening
3343Allow a list to occur right after a paragraph, with no intervening
@@ -3475,7 +3481,7 @@ variants are supported:
3475: `pipe_tables`, `raw_html`, `fenced_code_blocks`, `auto_identifiers`,
3481: `pipe_tables`, `raw_html`, `fenced_code_blocks`, `auto_identifiers`,
3476 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
3482 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
3477 `intraword_underscores`, `strikeout`, `hard_line_breaks`, `emoji`,
3483 `intraword_underscores`, `strikeout`, `hard_line_breaks`, `emoji`,
3478− `shortcut_reference_links`.
3484+ `shortcut_reference_links`, `angle_brackets_escapable`.
3479
3485
3480`markdown_mmd` (MultiMarkdown)
3486`markdown_mmd` (MultiMarkdown)
3481: `pipe_tables`, `raw_html`, `markdown_attribute`, `mmd_link_attributes`,
3487: `pipe_tables`, `raw_html`, `markdown_attribute`, `mmd_link_attributes`,
src/Text/Pandoc/Options.hs+3−1
@@ -101,6 +101,7 @@ data Extension =
101 -- space between items, and disallow laziness
101 -- space between items, and disallow laziness
102 | Ext_example_lists -- ^ Markdown-style numbered examples
102 | Ext_example_lists -- ^ Markdown-style numbered examples
103 | Ext_all_symbols_escapable -- ^ Make all non-alphanumerics escapable
103 | Ext_all_symbols_escapable -- ^ Make all non-alphanumerics escapable
104+ | Ext_angle_brackets_escapable -- ^ Make < and > escapable
104 | Ext_intraword_underscores -- ^ Treat underscore inside word as literal
105 | Ext_intraword_underscores -- ^ Treat underscore inside word as literal
105 | Ext_blank_before_blockquote -- ^ Require blank line before a blockquote
106 | Ext_blank_before_blockquote -- ^ Require blank line before a blockquote
106 | Ext_blank_before_header -- ^ Require blank line before a header
107 | Ext_blank_before_header -- ^ Require blank line before a header
@@ -204,7 +205,8 @@ phpMarkdownExtraExtensions = Set.fromList
204
205
205githubMarkdownExtensions :: Set Extension
206githubMarkdownExtensions :: Set Extension
206githubMarkdownExtensions = Set.fromList
207githubMarkdownExtensions = Set.fromList
208+ [ Ext_angle_brackets_escapable
207− [ Ext_pipe_tables
209+ , Ext_pipe_tables
208 , Ext_raw_html
210 , Ext_raw_html
209 , Ext_fenced_code_blocks
211 , Ext_fenced_code_blocks
210 , Ext_auto_identifiers
212 , Ext_auto_identifiers
src/Text/Pandoc/Readers/Markdown.hs+2
@@ -1507,6 +1507,8 @@ escapedChar' :: MarkdownParser Char
1507escapedChar' = try $ do
1507escapedChar' = try $ do
1508 char '\\'
1508 char '\\'
1509 (guardEnabled Ext_all_symbols_escapable >> satisfy (not . isAlphaNum))
1509 (guardEnabled Ext_all_symbols_escapable >> satisfy (not . isAlphaNum))
1510+ <|> (guardEnabled Ext_angle_brackets_escapable >>
1511+ oneOf "\\`*_{}[]()>#+-.!~\"<>")
1510 <|> oneOf "\\`*_{}[]()>#+-.!~\""
1512 <|> oneOf "\\`*_{}[]()>#+-.!~\""
1511
1513
1512escapedChar :: MarkdownParser (F Inlines)
1514escapedChar :: MarkdownParser (F Inlines)