Skip to content
Permalink
Browse files
fix #1100
  • Loading branch information
joyqi committed Jun 8, 2021
1 parent 0e49d18 commit 4861a40b9eb966787f9ebd3c044e84963f175baa
Showing with 1,371 additions and 2 deletions.
  1. +2 −0 admin/css/style.css
  2. +3 −2 admin/editor-js.php
  3. +1 −0 admin/js/purify.js
  4. +1,356 −0 admin/src/js/purify.js
  5. +9 −0 admin/src/scss/components/_editor.scss
@@ -826,6 +826,8 @@ a.operate-reply { color: #545c30; }

#wmd-preview .summary:after { display: block; margin: 2em 0; background: #FFF9E8; color: #cf9900; font-size: .85714em; text-align: center; content: "- more -"; }

#wmd-preview .embed { border: 1px solid #ccc; height: 40px; overflow: hidden; line-height: 40px; text-align: center; font-size: 12px; color: #777; }

#wmd-preview table { width: 100%; }

#wmd-preview table th, #wmd-preview table td { border: 1px solid #DDD; padding: 5px 8px; word-break: break-all; }
@@ -3,6 +3,7 @@
<script src="<?php $options->adminStaticUrl('js', 'hyperdown.js?v=' . $suffixVersion); ?>"></script>
<script src="<?php $options->adminStaticUrl('js', 'pagedown.js?v=' . $suffixVersion); ?>"></script>
<script src="<?php $options->adminStaticUrl('js', 'paste.js?v=' . $suffixVersion); ?>"></script>
<script src="<?php $options->adminStaticUrl('js', 'purify.js?v=' . $suffixVersion); ?>"></script>
<script>
$(document).ready(function () {
var textarea = $('#text'),
@@ -85,11 +86,11 @@
src = src.substring(0, src.length - 1);
}

return '<div style="border: 1px solid #ccc; height: 40px; overflow: hidden; line-height: 40px; text-align: center; font-size: 12px; color: #777"><strong>'
return '<div class="embed"><strong>'
+ tag + '</strong> : ' + $.trim(src) + '</div>';
});

return html;
return DOMPurify.sanitize(html, {USE_PROFILES: {html: true}});
});

editor.hooks.chain('onPreviewRefresh', function () {

Some generated files are not rendered by default. Learn more.

0 comments on commit 4861a40

Please sign in to comment.