Skip to content

Commit

Permalink
fix: safe_markdown throw KeyError exception #192
Browse files Browse the repository at this point in the history
  • Loading branch information
Agus Makmun committed Feb 15, 2023
1 parent d3a6189 commit b72bec2
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion martor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

__VERSION__ = "1.6.17"
__VERSION__ = "1.6.18"
__RELEASE_DATE__ = "15-Feb-2023"
__AUTHOR__ = "Agus Makmun (Summon Agus)"
__AUTHOR_EMAIL__ = "summon.agus@gmail.com"
2 changes: 1 addition & 1 deletion martor/static/martor/css/martor-admin.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion martor/static/martor/css/martor.bootstrap.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion martor/static/martor/css/martor.semantic.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion martor/static/martor/js/martor.bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Name : Martor v1.6.17
* Name : Martor v1.6.18
* Created by : Agus Makmun (Summon Agus)
* Release date : 15-Feb-2023
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Expand Down
2 changes: 1 addition & 1 deletion martor/static/martor/js/martor.bootstrap.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion martor/static/martor/js/martor.semantic.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Name : Martor v1.6.17
* Name : Martor v1.6.18
* Created by : Agus Makmun (Summon Agus)
* Release date : 15-Feb-2023
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Expand Down
2 changes: 1 addition & 1 deletion martor/static/martor/js/martor.semantic.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 5 additions & 11 deletions martor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import bleach

from django.utils.functional import Promise
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.core.serializers.json import DjangoJSONEncoder

try:
Expand Down Expand Up @@ -48,15 +46,11 @@ def markdownify(markdown_text):
extensions=MARTOR_MARKDOWN_EXTENSIONS,
extension_configs=MARTOR_MARKDOWN_EXTENSION_CONFIGS,
)
return format_html(
mark_safe(
bleach.clean(
html,
tags=ALLOWED_HTML_TAGS,
attributes=ALLOWED_HTML_ATTRIBUTES,
protocols=ALLOWED_URL_SCHEMES,
)
)
return bleach.clean(
html,
tags=ALLOWED_HTML_TAGS,
attributes=ALLOWED_HTML_ATTRIBUTES,
protocols=ALLOWED_URL_SCHEMES,
)


Expand Down

0 comments on commit b72bec2

Please sign in to comment.