Skip to content

Replace   on paste (or any other string/char) #1225

Discussion options

You must be logged in to vote

@doits What about this?

const NBSPReplacer = Extension.create({
    name: 'npspReplacer',
    addPasteRules() {
        return [
            textPasteRule({ find: / /g, replace: ' ' }),
            textPasteRule({ find: /\\u00A0/g, replace: ' ' }),
        ]
    },
})

Replies: 3 comments 14 replies

Comment options

You must be logged in to vote
1 reply
@doits
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
13 replies
@philippkuehn
Comment options

@philippkuehn
Comment options

@cadars
Comment options

@rfgamaral
Comment options

@cadars
Comment options

Answer selected by doits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants