diff options
author | OCzarnecki <44535552+OCzarnecki@users.noreply.github.com> | 2021-08-16 06:57:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-15 21:57:57 -0700 |
commit | e37cf4484d38c171d9f7477a8ae9eca9643cc426 (patch) | |
tree | 62984d5cf0e54867f80ef8fcbc646ff598e9a094 /src/Text/Pandoc/Extensions.hs | |
parent | 72447a563c415a3d8addc7a2b2edd93f9fe56ebe (diff) | |
download | pandoc-e37cf4484d38c171d9f7477a8ae9eca9643cc426.tar.gz |
Multimarkdown sub- and superscripts (#5512) (#7188)
Added an extension `short_subsuperscripts` which modifies the behavior
of `subscript` and `superscript`, allowing subscripts or superscripts containing only
alphanumerics to end with a space character (eg. `x^2 = 4` or `H~2 is
combustible`). This improves support for multimarkdown. Closes #5512.
Add `Ext_short_subsuperscripts` constructor to `Extension` [API change].
This is enabled by default for `markdown_mmd`.
Diffstat (limited to 'src/Text/Pandoc/Extensions.hs')
-rw-r--r-- | src/Text/Pandoc/Extensions.hs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index ce04ce641..2ef8f64e9 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -124,6 +124,7 @@ data Extension = | Ext_mmd_header_identifiers -- ^ Multimarkdown style header identifiers [myid] | Ext_mmd_link_attributes -- ^ MMD style reference link attributes | Ext_mmd_title_block -- ^ Multimarkdown metadata block + | Ext_short_subsuperscripts -- ^ sub-&superscripts w/o closing char (v~i) | Ext_multiline_tables -- ^ Pandoc-style multiline tables | Ext_native_divs -- ^ Use Div blocks for contents of <div> tags | Ext_native_spans -- ^ Use Span inlines for contents of <span> @@ -286,14 +287,9 @@ multimarkdownExtensions = extensionsFromList , Ext_auto_identifiers , Ext_mmd_header_identifiers , Ext_implicit_figures - -- Note: MMD's syntax for superscripts and subscripts - -- is a bit more permissive than pandoc's, allowing - -- e^2 and a~1 instead of e^2^ and a~1~, so even with - -- these options we don't have full support for MMD - -- superscripts and subscripts, but there's no reason - -- not to include these: - , Ext_superscript + , Ext_short_subsuperscripts , Ext_subscript + , Ext_superscript , Ext_backtick_code_blocks , Ext_spaced_reference_links -- So far only in dev version of mmd: @@ -464,6 +460,7 @@ getAllExtensions f = universalExtensions <> getAll f , Ext_gutenberg , Ext_smart , Ext_literate_haskell + , Ext_short_subsuperscripts , Ext_rebase_relative_paths ] getAll "markdown_strict" = allMarkdownExtensions |