Skip to content

Commit b72bec2

Browse files
author
Agus Makmun
committed
fix: safe_markdown throw KeyError exception #192
1 parent d3a6189 commit b72bec2

File tree

9 files changed

+13
-19
lines changed

9 files changed

+13
-19
lines changed

martor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
__VERSION__ = "1.6.17"
3+
__VERSION__ = "1.6.18"
44
__RELEASE_DATE__ = "15-Feb-2023"
55
__AUTHOR__ = "Agus Makmun (Summon Agus)"
66
__AUTHOR_EMAIL__ = "[email protected]"

martor/static/martor/css/martor-admin.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/css/martor.bootstrap.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/css/martor.semantic.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/js/martor.bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Name : Martor v1.6.17
2+
* Name : Martor v1.6.18
33
* Created by : Agus Makmun (Summon Agus)
44
* Release date : 15-Feb-2023
55
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007

martor/static/martor/js/martor.bootstrap.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/js/martor.semantic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Name : Martor v1.6.17
2+
* Name : Martor v1.6.18
33
* Created by : Agus Makmun (Summon Agus)
44
* Release date : 15-Feb-2023
55
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007

martor/static/martor/js/martor.semantic.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/utils.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import bleach
33

44
from django.utils.functional import Promise
5-
from django.utils.html import format_html
6-
from django.utils.safestring import mark_safe
75
from django.core.serializers.json import DjangoJSONEncoder
86

97
try:
@@ -48,15 +46,11 @@ def markdownify(markdown_text):
4846
extensions=MARTOR_MARKDOWN_EXTENSIONS,
4947
extension_configs=MARTOR_MARKDOWN_EXTENSION_CONFIGS,
5048
)
51-
return format_html(
52-
mark_safe(
53-
bleach.clean(
54-
html,
55-
tags=ALLOWED_HTML_TAGS,
56-
attributes=ALLOWED_HTML_ATTRIBUTES,
57-
protocols=ALLOWED_URL_SCHEMES,
58-
)
59-
)
49+
return bleach.clean(
50+
html,
51+
tags=ALLOWED_HTML_TAGS,
52+
attributes=ALLOWED_HTML_ATTRIBUTES,
53+
protocols=ALLOWED_URL_SCHEMES,
6054
)
6155

6256

0 commit comments

Comments
 (0)