gfm.spaced_link
– Links with optional whitespace¶
The gfm.spaced_link
module provides an extension that supports links and
images with additional whitespace.
GitHub’s Markdown engine allows links and images to have whitespace –
including a single newline – between the first set of brackets and the
second (e.g. [text] (href)
). This extension adds such support.
Typical usage¶
import markdown
from gfm import SpacedLinkExtension
print(markdown.markdown("Check out [this link] (http://example.org/)!",
extensions=[SpacedLinkExtension()]))
<p>Check out <a href="http://example.org/">this link</a>!</p>
-
class
gfm.spaced_link.
SpacedLinkExtension
(*args, **kwargs)[source]¶ Bases:
markdown.extensions.Extension
An extension that supports links and images with additional whitespace.
-
getConfig
(key, default='')¶ Return a setting for the given key or an empty string.
-
getConfigInfo
()¶ Return all config descriptions as a list of tuples.
-
getConfigs
()¶ Return all configs settings as a dict.
-
setConfig
(key, value)¶ Set a config setting for key with the given value.
-
setConfigs
(items)¶ Set multiple config settings given a dict or list of tuples.
-