aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/extensions/wikilinks.py
diff options
context:
space:
mode:
Diffstat (limited to 'markdown/extensions/wikilinks.py')
-rw-r--r--markdown/extensions/wikilinks.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/markdown/extensions/wikilinks.py b/markdown/extensions/wikilinks.py
index cf4b633..af43bba 100644
--- a/markdown/extensions/wikilinks.py
+++ b/markdown/extensions/wikilinks.py
@@ -11,22 +11,22 @@ Basic usage:
>>> import markdown
>>> text = "Some text with a [[WikiLink]]."
>>> html = markdown.markdown(text, ['wikilinks'])
- >>> html
- u'<p>Some text with a <a class="wikilink" href="/WikiLink/">WikiLink</a>.</p>'
+ >>> print html
+ <p>Some text with a <a class="wikilink" href="/WikiLink/">WikiLink</a>.</p>
Whitespace behavior:
- >>> markdown.markdown('[[ foo bar_baz ]]', ['wikilinks'])
- u'<p><a class="wikilink" href="/foo_bar_baz/">foo bar_baz</a></p>'
- >>> markdown.markdown('foo [[ ]] bar', ['wikilinks'])
- u'<p>foo bar</p>'
+ >>> print markdown.markdown('[[ foo bar_baz ]]', ['wikilinks'])
+ <p><a class="wikilink" href="/foo_bar_baz/">foo bar_baz</a></p>
+ >>> print markdown.markdown('foo [[ ]] bar', ['wikilinks'])
+ <p>foo bar</p>
To define custom settings the simple way:
- >>> markdown.markdown(text,
+ >>> print markdown.markdown(text,
... ['wikilinks(base_url=/wiki/,end_url=.html,html_class=foo)']
... )
- u'<p>Some text with a <a class="foo" href="/wiki/WikiLink.html">WikiLink</a>.</p>'
+ <p>Some text with a <a class="foo" href="/wiki/WikiLink.html">WikiLink</a>.</p>
Custom settings the complex way:
@@ -37,8 +37,8 @@ Custom settings the complex way:
... ('end_url', '.html'),
... ('html_class', '') ]},
... safe_mode = True)
- >>> md.convert(text)
- u'<p>Some text with a <a href="http://example.com/WikiLink.html">WikiLink</a>.</p>'
+ >>> print md.convert(text)
+ <p>Some text with a <a href="http://example.com/WikiLink.html">WikiLink</a>.</p>
Use MetaData with mdx_meta.py (Note the blank html_class in MetaData):
@@ -48,13 +48,13 @@ Use MetaData with mdx_meta.py (Note the blank html_class in MetaData):
...
... Some text with a [[WikiLink]]."""
>>> md = markdown.Markdown(extensions=['meta', 'wikilinks'])
- >>> md.convert(text)
- u'<p>Some text with a <a href="http://example.com/WikiLink.html">WikiLink</a>.</p>'
+ >>> print md.convert(text)
+ <p>Some text with a <a href="http://example.com/WikiLink.html">WikiLink</a>.</p>
MetaData should not carry over to next document:
- >>> md.convert("No [[MetaData]] here.")
- u'<p>No <a class="wikilink" href="/MetaData/">MetaData</a> here.</p>'
+ >>> print md.convert("No [[MetaData]] here.")
+ <p>No <a class="wikilink" href="/MetaData/">MetaData</a> here.</p>
Define a custom URL builder:
@@ -62,8 +62,8 @@ Define a custom URL builder:
... return '/bar/'
>>> md = markdown.Markdown(extensions=['wikilinks'],
... extension_configs={'wikilinks' : [('build_url', my_url_builder)]})
- >>> md.convert('[[foo]]')
- u'<p><a class="wikilink" href="/bar/">foo</a></p>'
+ >>> print md.convert('[[foo]]')
+ <p><a class="wikilink" href="/bar/">foo</a></p>
From the command line: