Skip to content

Commit

Permalink
don't crash on unknown shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Dec 23, 2015
1 parent dacf972 commit fee8046
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nikola/shortcodes.py
Expand Up @@ -31,6 +31,7 @@
except ImportError:
from HTMLParser import HTMLParser

from .utils import LOGGER

def apply_shortcodes(data, registry, site=None):
"""Apply Hugo-style shortcodes on data.
Expand All @@ -52,7 +53,11 @@ def apply_shortcodes(data, registry, site=None):
name, args, start, end = sc
a, kw = args
kw['site'] = site
result = registry[name](*a, **kw)
if name in registry:
result = registry[name](*a, **kw)
else:
LOGGER.error('Unknown shortcode: {}', name)
result = ''
sc.append(result)

# Replace all shortcodes with their output
Expand Down

0 comments on commit fee8046

Please sign in to comment.