Skip to content

Commit

Permalink
fix #1100
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqi committed Jun 8, 2021
1 parent 0e49d18 commit 4861a40
Show file tree
Hide file tree
Showing 5 changed files with 1,371 additions and 2 deletions.
2 changes: 2 additions & 0 deletions admin/css/style.css
Expand Up @@ -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; }
Expand Down
5 changes: 3 additions & 2 deletions admin/editor-js.php
Expand Up @@ -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'),
Expand Down Expand Up @@ -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 () {
Expand Down
1 change: 1 addition & 0 deletions admin/js/purify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4861a40

Please sign in to comment.