Skip to content
Permalink
Browse files

don't crash on unknown shortcode

  • Loading branch information
ralsina committed Dec 23, 2015
1 parent dacf972 commit fee8046fbe1c543c27421fe85fb7c983bc37fcee
Showing with 6 additions and 1 deletion.
  1. +6 −1 nikola/shortcodes.py
@@ -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.
@@ -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

0 comments on commit fee8046

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