De-indent the code a bit

This commit is contained in:
Sybren A. Stüvel 2018-07-13 17:02:47 +02:00
parent 0fdcbc3947
commit 61278730c6

View File

@ -417,17 +417,19 @@ def parse_markdown(node, original=None):
def find_markdown_fields(schema, node): def find_markdown_fields(schema, node):
"""Find and process all makrdown validated fields.""" """Find and process all makrdown validated fields."""
for k, v in schema.items(): for k, v in schema.items():
if isinstance(v, dict): if not isinstance(v, dict):
if 'validator' in v and 'markdown' == v['validator']: continue
# If there is a match with the validator: markdown pair, assign the sibling
# property (following the naming convention _<property>_html) if v.get('validator') == 'markdown':
# the processed value. # If there is a match with the validator: markdown pair, assign the sibling
if k in node: # property (following the naming convention _<property>_html)
html = pillar.markdown.markdown(node[k]) # the processed value.
field_name = pillar.markdown.cache_field_name(k) if k in node:
node[field_name] = html html = pillar.markdown.markdown(node[k])
if isinstance(node, dict) and k in node: field_name = pillar.markdown.cache_field_name(k)
find_markdown_fields(v, node[k]) node[field_name] = html
if isinstance(node, dict) and k in node:
find_markdown_fields(v, node[k])
find_markdown_fields(schema, node) find_markdown_fields(schema, node)