Open AlexeyShaykov opened 3 years ago
i ty to fix it something like this:
'paste.before': e => {
const pastedString = e.clipboardData.getData('text');
const urlReg = /(http:\/\/|www\.|https:\/\/)\S+/i;
const isContainURL = urlReg.test(pastedString);
if (!isContainURL) return;
this.$nextTick(() => {
const urlify = text => {
const isContainURL = urlReg.test(text);
if (!isContainURL) return `<p>${text}</p>`;
return text.replace(urlReg, url => {
return `<a href="${url}">${url}</a>`;
});
};
that.editor.html.insert(
pastedString
.split('\n')
.map(urlify)
.filter(it => it !== '')
.join(''),
);
});
return false;
},
Thanks for your feedback. This issue is not reproducible or have been found to be fixed on the latest Froala release v4.0.8. Can you please upgrade and check?
Hi!
i`m try to passed multible link Tested on https://froala.com/wysiwyg-editor/ - passed from clipboard few links
Expected behavior.
all links have
a
tag with link stylesActual behavior.
link parsed as text
Steps to reproduce the problem.
copy string with few links in clipboard, then passed from clipboard to editor
try this https://froala.com/wysiwyg-editor/docs/events/ https://froala.com/wysiwyg-editor/
Editor version.
last version
OS.
Ubuntu
Browser.
Chrome 88