-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replacing nbsp; to regular spaces #943
Comments
@hanspagel Hey, was this addressed in any way? I'm trying to get rid of Here's v2 sandbox: https://codesandbox.io/s/tiptap-nbsp-qn1be |
Solved the issue by adding new Editor({
editorProps: {
transformPastedText(text) {
return text.replace(/\xA0/g, " ");
},
transformPastedHTML(html) {
return html.replace(/\xA0/g, " ");
},
},
}) This docs part mentions
but it's a bit unclear – |
To add to this I was confused as to why It's because when pasting from various sources the characters may be formatted differently but show up in the DOM as the browser interprets the characters. So the answer is that Additionally I've found |
Bug Description
won't convert into regular spaces even after usingparseOptions : { preserveWhitespace: true | false }
Issue #754 already discusses this, but the proposed solution in PR #254 doesn't quite solve the problem. Below is the reproduction steps.
Expected behaviour
When copy/pasting the content, the editor should cleanup all the
s. Manually writing the content doesn't create unwanted
s.Steps to reproduce the behaviour:
in it.):It is one of the refined sins of civilisation, for we know not what wild spirit we are taking from its purer atmosphere, or who it is?
s in the Chrome Dev ToolsScreenshot
Codesandbox replicating the issue
https://codesandbox.io/s/friendly-thompson-8igbl?file=/src/App.vue
The text was updated successfully, but these errors were encountered: