mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Fixing pasteRules for Embeds
Apparently the default pasteRules of tiptap interfere with the pasteRules of a Link (in our case an Embed node). Consider this example: https://de.wikipedia.org/wiki/Yin_und_Yang Depending on some random conditions, tiptap might parse the `_und_` to be italic because it's wrapped with underscores (markdown syntax). The result is: https://de.wikipedia.org/wiki/Yin # link _und_ # italic Yang # plain text So let's remove the default pasteRules of `Bold`, `Strike` and `Italic` marks respectively to prefer our Embeds. Who is copy+pasting from one tiptap editor to another tiptap editor anyways?
This commit is contained in:
parent
8093fece00
commit
52e0361087
@ -1,5 +1,8 @@
|
||||
import Embed from '~/components/Editor/nodes/Embed.js'
|
||||
import Link from '~/components/Editor/nodes/Link.js'
|
||||
import Strike from '~/components/Editor/marks/Strike'
|
||||
import Italic from '~/components/Editor/marks/Italic'
|
||||
import Bold from '~/components/Editor/marks/Bold'
|
||||
import EmbedQuery from '~/graphql/EmbedQuery.js'
|
||||
import {
|
||||
Heading,
|
||||
@ -10,9 +13,6 @@ import {
|
||||
OrderedList,
|
||||
HorizontalRule,
|
||||
Placeholder,
|
||||
Bold,
|
||||
Italic,
|
||||
Strike,
|
||||
Underline,
|
||||
} from 'tiptap-extensions'
|
||||
|
||||
|
||||
7
webapp/components/Editor/marks/Bold.js
Normal file
7
webapp/components/Editor/marks/Bold.js
Normal file
@ -0,0 +1,7 @@
|
||||
import { Bold as TipTapBold } from 'tiptap-extensions'
|
||||
|
||||
export default class Bold extends TipTapBold {
|
||||
pasteRules() {
|
||||
return []
|
||||
}
|
||||
}
|
||||
7
webapp/components/Editor/marks/Italic.js
Normal file
7
webapp/components/Editor/marks/Italic.js
Normal file
@ -0,0 +1,7 @@
|
||||
import { Italic as TipTapItalic } from 'tiptap-extensions'
|
||||
|
||||
export default class Italic extends TipTapItalic {
|
||||
pasteRules() {
|
||||
return []
|
||||
}
|
||||
}
|
||||
7
webapp/components/Editor/marks/Strike.js
Normal file
7
webapp/components/Editor/marks/Strike.js
Normal file
@ -0,0 +1,7 @@
|
||||
import { Strike as TipTapStrike } from 'tiptap-extensions'
|
||||
|
||||
export default class Strike extends TipTapStrike {
|
||||
pasteRules() {
|
||||
return []
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user