瀏覽代碼

test: fix tests

rugk 5 月之前
父節點
當前提交
d874ea71a2
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      js/test/I18n.js

+ 4 - 2
js/test/I18n.js

@@ -77,7 +77,8 @@ describe('I18n', function () {
                 postfix   =   postfix.replace(/%(s|d)/g, '%%');
                 const translation = DOMPurify.sanitize(
                     prefix + '<a href="' + params[0] + '"></a>' + postfix, {
-                        ALLOWED_TAGS: ['a', 'i', 'span'],
+                        ALLOWED_URI_REGEXP: /^(?:(?:(?:f|ht)tps?|mailto|magnet):)/i,
+                        ALLOWED_TAGS: ['a', 'i', 'span', 'kbd'],
                         ALLOWED_ATTR: ['href', 'id']
                     }
                 );
@@ -129,7 +130,8 @@ describe('I18n', function () {
                 postfix   =   postfix.replace(/%(s|d)/g, '%%').trim();
                 const translation = DOMPurify.sanitize(
                     prefix + '<a href="' + params[0] + '"></a>' + postfix, {
-                        ALLOWED_TAGS: ['a', 'i', 'span'],
+                        ALLOWED_URI_REGEXP: /^(?:(?:(?:f|ht)tps?|mailto|magnet):)/i,
+                        ALLOWED_TAGS: ['a', 'i', 'span', 'kbd'],
                         ALLOWED_ATTR: ['href', 'id']
                     }
                 );