Fix an incorrect document.queryCommandSupported call

This commit is contained in:
Gnome Ann 2021-10-13 12:51:31 -04:00
parent 99d26c44e0
commit fdbe730a1f
2 changed files with 2 additions and 2 deletions

View File

@ -1041,7 +1041,7 @@ function chunkOnPaste(event) {
}
// If possible, intercept paste events into the editor in order to always
// paste as plaintext
if(event.originalEvent.clipboardData && document.queryCommandSupported && document.execCommand && document.queryCommandSupported('insertText')) {
if(event.originalEvent.clipboardData && document.queryCommandSupported && document.execCommand && document.queryCommandSupported('insertHTML')) {
event.preventDefault();
document.execCommand('insertHTML', false, event.originalEvent.clipboardData.getData('text/plain').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;').replace(/(?=\r|\n)\r?\n?/g, '<br/>'));
} else if (event.originalEvent.clipboardData) {

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="static/jquery-3.6.0.min.js"></script>
<script src="static/socket.io.min.js"></script>
<script src="static/application.js?ver=1.16.2i"></script>
<script src="static/application.js?ver=1.16.2j"></script>
<script src="static/bootstrap.min.js"></script>
<script src="static/bootstrap-toggle.min.js"></script>
<script src="static/rangy-core.min.js"></script>