We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b206470 commit 0818628Copy full SHA for 0818628
nbconvert/exporters/templateexporter.py
@@ -40,6 +40,13 @@
40
)
41
42
43
+def escape_html(s, quote=True):
44
+ if not isinstance(s, str):
45
+ return s
46
+ else:
47
+ return html.escape(s)
48
+
49
50
default_filters = {
51
"indent": filters.indent,
52
"markdown2html": filters.markdown2html,
@@ -71,7 +78,7 @@
71
78
"convert_pandoc": filters.convert_pandoc,
72
79
"json_dumps": json.dumps,
73
80
# For removing any HTML
74
- "escape_html": html.escape,
81
+ "escape_html": escape_html,
75
82
# For sanitizing HTML for any XSS
76
83
"clean_html": clean_html,
77
84
"strip_trailing_newline": filters.strip_trailing_newline,
0 commit comments