From 10562860155fe3bd46c57bc0c85b710b8b7acc84 Mon Sep 17 00:00:00 2001 From: Zerline Date: Mon, 15 Jun 2020 19:36:22 +0200 Subject: [PATCH] Testing with Mathjax. --- packages/base-manager/src/manager-base.ts | 4 ++-- tests/test_sanitizer.ipynb | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/base-manager/src/manager-base.ts b/packages/base-manager/src/manager-base.ts index f2b3927beb..431533a591 100644 --- a/packages/base-manager/src/manager-base.ts +++ b/packages/base-manager/src/manager-base.ts @@ -43,7 +43,7 @@ function default_plaintext_sanitize(s: string): string { * Sanitize HTML-formatted descriptions. */ function default_inline_sanitize(html: string): string { - var allowedTags = [ + const allowedTags = [ 'a', 'abbr', 'b', @@ -58,7 +58,7 @@ function default_inline_sanitize(html: string): string { 'style', 'ul' ]; - var allowedAttributes = { + const allowedAttributes = { '*': ['aria-*', 'style', 'title'], a: ['href'], img: ['src'], diff --git a/tests/test_sanitizer.ipynb b/tests/test_sanitizer.ipynb index 5fe1c5b5f5..0759ea3e9a 100644 --- a/tests/test_sanitizer.ipynb +++ b/tests/test_sanitizer.ipynb @@ -53,6 +53,26 @@ "source": [ "Textarea(description=\" underlined\", description_allow_html=True)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "VBox((Text(description=\"$ y < a, x $\", allow_html=True),\n", + " Text(description=\"$ y < a, x $\", description_allow_html=True)\n", + " ))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "VBox((Label(\"$ y < a, x > a$\"), HTMLMath(\"$ y < a, x > a$\")))" + ] } ], "metadata": {