mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
fix(editor): Fix hashtags not working after embeded content
Up to this point, once you've inserted a given URL to the editor, and it renders a new embeded content, if you hit Return, and try using a tag, or mention, it would not work since the paragraph was never closed, causing a sintatic error that rendered the mentions unable to be used unless you explicitly hit return again, to escape the given text block you were in. See the PR/Issue for further info.
This commit is contained in:
parent
5609622e4a
commit
f921244661
@ -63,30 +63,26 @@ describe('defaultExtensions', () => {
|
|||||||
it('recognizes embed code', () => {
|
it('recognizes embed code', () => {
|
||||||
const editor = createEditor()
|
const editor = createEditor()
|
||||||
const expected = {
|
const expected = {
|
||||||
|
type: 'doc',
|
||||||
content: [
|
content: [
|
||||||
{
|
{
|
||||||
|
type: 'paragraph',
|
||||||
content: [
|
content: [
|
||||||
{
|
{
|
||||||
text: 'Baby loves cat:',
|
text: 'Baby loves cat:',
|
||||||
type: 'text',
|
type: 'text'
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
type: 'paragraph',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content: [
|
type: 'embed',
|
||||||
{
|
attrs: {
|
||||||
attrs: {
|
dataEmbedUrl: 'https://www.youtube.com/watch?v=qkdXAtO40Fo'
|
||||||
dataEmbedUrl: 'https://www.youtube.com/watch?v=qkdXAtO40Fo',
|
}
|
||||||
},
|
}
|
||||||
type: 'embed',
|
]
|
||||||
},
|
|
||||||
],
|
|
||||||
type: 'paragraph',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
type: 'doc',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(editor.getJSON()).toEqual(expected)
|
expect(editor.getJSON()).toEqual(expected)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -38,8 +38,8 @@ export default class Embed extends Node {
|
|||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
group: 'inline',
|
group: 'block',
|
||||||
inline: true,
|
inline: false,
|
||||||
parseDOM: [
|
parseDOM: [
|
||||||
{
|
{
|
||||||
tag: 'a[href].embed',
|
tag: 'a[href].embed',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user