Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix - Markdown JSON Content in Static Sections #1853

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ fourfront
Change Log
----------

6.4.5
=====

`Bug fix - markdown json content in static sections <https://github.com/4dn-dcic/fourfront/pull/1853>`_

* Json code sections in markdowns static content is not correctly rendered


6.4.4
=====

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <support@4dnucleome.org>"]
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions src/encoded/types/user_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]>.*?<\/h[1-6]>', re.IGNORECASE)
Expand Down
Loading