Skip to content
Permalink
Browse files

Python 2.7 has to die

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Dec 28, 2015
1 parent e2b09e9 commit 5ecacd5e3e3df8ff27a6c6935a0d94aa3e09be5c
Showing with 4 additions and 4 deletions.
  1. +4 −4 nikola/shortcodes.py
@@ -254,10 +254,10 @@ def apply_shortcodes(data, registry, site=None, filename=None):
The site parameter is passed with the same name to the shortcodes so they can access Nikola state.
>>> apply_shortcodes('==> {{% foo bar=baz %}} <==', {'foo': lambda *a, **k: k['bar']})
'==> baz <=='
>>> apply_shortcodes('==> {{% foo bar=baz %}}some data{{% /foo %}} <==', {'foo': lambda *a, **k: k['bar']+k['data']})
'==> bazsome data <=='
>>> print(apply_shortcodes('==> {{% foo bar=baz %}} <==', {'foo': lambda *a, **k: k['bar']}))
==> baz <==
>>> print(apply_shortcodes('==> {{% foo bar=baz %}}some data{{% /foo %}} <==', {'foo': lambda *a, **k: k['bar']+k['data']}))
==> bazsome data <==
"""
empty_string = data[:0] # same string type as data; to make Python 2 happy
try:

0 comments on commit 5ecacd5

Please sign in to comment.
You can’t perform that action at this time.