Skip to content

Commit

Permalink
Fix some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Alsina committed May 5, 2017
1 parent 5adfa75 commit 3e4ad02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nikola/nikola.py
Expand Up @@ -1694,14 +1694,14 @@ def apply_shortcodes(self, data, filename=None, lang=None, with_dependencies=Fal
lang = utils.LocaleBorg().current_lang
return shortcodes.apply_shortcodes(data, self.shortcode_registry, self, filename, lang=lang, with_dependencies=with_dependencies, extra_context=extra_context)

def apply_shortcodes_uuid(self, data, shortcodes, filename=None, lang=None, with_dependencies=False, extra_context=None):
def apply_shortcodes_uuid(self, data, _shortcodes, filename=None, lang=None, with_dependencies=False, extra_context=None):
"""Apply shortcodes from the registry on data."""
if lang is None:
lang = utils.LocaleBorg().current_lang
if extra_context is None:
extra_context = {}
deps = []
for k, v in shortcodes:
for k, v in _shortcodes.items():
replacement, _deps = shortcodes.apply_shortcodes(v, self.shortcode_registry, self, filename, lang=lang, with_dependencies=with_dependencies, extra_context=extra_context)
data.replace(k, replacement)
deps.extend(_deps)
Expand Down
4 changes: 4 additions & 0 deletions tests/base.py
Expand Up @@ -230,3 +230,7 @@ def register_shortcode(self, name, f):
def apply_shortcodes(self, data, *a, **kw):
"""Apply shortcodes from the registry on data."""
return nikola.shortcodes.apply_shortcodes(data, self.shortcode_registry, **kw)

def apply_shortcodes_uuid(self, data, shortcodes, *a, **kw):
"""Apply shortcodes from the registry on data."""
return nikola.shortcodes.apply_shortcodes_uuid(data, shortcodes, self.shortcode_registry, **kw)

0 comments on commit 3e4ad02

Please sign in to comment.