Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0818628

Browse files
martinRenouSylvainCorlay
authored andcommitted
Check input type before escaping
1 parentb206470 commit0818628

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎nbconvert/exporters/templateexporter.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
)
4141

4242

43+
defescape_html(s,quote=True):
44+
ifnotisinstance(s,str):
45+
returns
46+
else:
47+
returnhtml.escape(s)
48+
49+
4350
default_filters= {
4451
"indent":filters.indent,
4552
"markdown2html":filters.markdown2html,
@@ -71,7 +78,7 @@
7178
"convert_pandoc":filters.convert_pandoc,
7279
"json_dumps":json.dumps,
7380
# For removing any HTML
74-
"escape_html":html.escape,
81+
"escape_html":escape_html,
7582
# For sanitizing HTML for any XSS
7683
"clean_html":clean_html,
7784
"strip_trailing_newline":filters.strip_trailing_newline,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp