tinymce-vue
tinymce-vue copied to clipboard
Is <p> was auto append when I doing ctrl + A & C → ctrl + V in IE with I using paste plugin
What is the current behavior?
In IE 11
1.input something in tinymce
2.ctrl + A → ctrl + C to copy content
3.ctrk + V
is p tag auto append text content.
forced_root_block='' is not working with this problem.
**Please provide the steps to reproduce and if possible a minimal demo of the problem via Example
What is the expected behavior? p tag is not need,how could I del p tag?
Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE or tinymce-vue?
browser : IE 11
OS: windows 10
tinymce-vue: 3.2.6
tinymce: 5.6.0
vue: 2.6.12
Hi @Charlie50503
The <p> tag is part of the html content of the editor. If you don't use the v-model binding you can set the editor output to text instead but if you want to reset the content back in the editor from text that will be problematic.
Thanks for your reply.
definite pattern is (in IE)
- input something in editor
- copy some text form .txt file
- ctrl + A → ctrl + V
- p tag auto append text content.
It's specifications in IE? or it's a bug?
I think is the reason of I using forced_root_block='',so paste processing not support. is that right?
Hi @jscasca
Is another way to fix this problem ?
I have to using v-model and html content.
forced_root_block:false seem not work with this case.
Hi @Charlie50503
What is your particular use case? You can probably strip html tags using a node filter but that might be tricky with the v-model. Is there a particular reason for you to use v-model instead of just using onChange or something similar?
Hi @jscasca
I trying to use onChange or
editor.on('Change KeyUp Undo Redo', (event) => {
this.$emit('input', editor.getContent())
})
but is not work. I noticed that my explanation was incorrect.
This phenomenon will happen when I use "paste" plguin.
init: {
inline: false,
skin_url: './tinymce/skins/ui/oxide',
content_css: './tinymce/skins/content/default/content.css',
//plugins: ['paste'],←comment out this row will be normal
importcss_append: true,
forced_root_block: '',
paste_preprocess: function(plugin, args) {
console.log(args.content)
},
},
but I have to using paste_preprocess method to limit image size
//in my source
paste_preprocess: (plugin, args) => {
if (
!args.content.includes('<img') &&
args.content.bytes() > this.maxlength
) {
args.content = this.$t('Tinymce.msg.paste_oversize')
} else {
this.my_value = args.content
}
}
Is another way to replace this function?