diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7c9fbefe23..589e2323d2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,14 @@ fourfront Change Log ---------- +6.4.5 +===== + +`Bug fix - markdown json content in static sections `_ + +* Json code sections in markdowns static content is not correctly rendered + + 6.4.4 ===== diff --git a/pyproject.toml b/pyproject.toml index e6ba2f9047..562f00584f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] # Note: Various modules refer to this system as "encoded", not "fourfront". name = "encoded" -version = "6.4.4" +version = "6.4.5" description = "4DN-DCIC Fourfront" authors = ["4DN-DCIC Team "] license = "MIT" diff --git a/src/encoded/types/user_content.py b/src/encoded/types/user_content.py index 8155baff7f..8f1d79a5ee 100644 --- a/src/encoded/types/user_content.py +++ b/src/encoded/types/user_content.py @@ -159,7 +159,7 @@ def content_as_html(self, request, body=None, file=None, options=None): elif file_type == 'md': # remove new line character output = convert_markdown_to_html(content) - output = output.replace('\n', '') + # output = output.replace('\n', '') if output and convert_ext_links: return convert_external_links(output, request.domain) return output @@ -350,7 +350,7 @@ def get_remote_file_contents(uri): def convert_markdown_to_html(markdown_text, custom_wrapper = 'div'): # convert markdown to html including tables - html_output = markdown.markdown(markdown_text, extensions=['tables']) + html_output = markdown.markdown(markdown_text, extensions=['tables', 'fenced_code']) # check content has any header, if yes wrap it with custom tag header_pattern = re.compile(r'.*?<\/h[1-6]>', re.IGNORECASE)