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.

Table Of Contents

  • gfm.spaced_link – Links with optional whitespace
    • Typical usage

Related Topics

  • Documentation overview
    • <no title>
      • Previous: gfm.semi_sane_lists – GitHub-like list parsing
      • Next: gfm.strikethrough – Strike-through support

This Page

  • Show Source

Quick search

Enter search terms or a module, class or function name.

©2016, The Dart Team, Alexandre Macabies. | Powered by Sphinx 1.3.6 & Alabaster 0.7.7 | Page source