mirror of https://gitlab.com/bashrc2/epicyon
Less indentation
parent
87e109d482
commit
47456239b8
9
posts.py
9
posts.py
|
@ -136,13 +136,16 @@ def convert_post_content_to_html(message_json: {}) -> None:
|
||||||
return
|
return
|
||||||
if not obj_json.get('content'):
|
if not obj_json.get('content'):
|
||||||
return
|
return
|
||||||
if obj_json['mediaType'] == 'text/markdown':
|
if obj_json['mediaType'] != 'text/markdown':
|
||||||
|
return
|
||||||
content_str = obj_json['content']
|
content_str = obj_json['content']
|
||||||
obj_json['content'] = markdown_to_html(content_str)
|
obj_json['content'] = markdown_to_html(content_str)
|
||||||
obj_json['mediaType'] = 'text/html'
|
obj_json['mediaType'] = 'text/html'
|
||||||
if obj_json.get('contentMap'):
|
if not obj_json.get('contentMap'):
|
||||||
|
return
|
||||||
langs_dict = obj_json['contentMap']
|
langs_dict = obj_json['contentMap']
|
||||||
if isinstance(langs_dict, dict):
|
if not isinstance(langs_dict, dict):
|
||||||
|
return
|
||||||
for lang, content_str in langs_dict.items():
|
for lang, content_str in langs_dict.items():
|
||||||
if not isinstance(content_str, str):
|
if not isinstance(content_str, str):
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue