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:
Marco Bomfim 2019-11-06 16:24:48 -03:00
parent 5609622e4a
commit f921244661
2 changed files with 14 additions and 18 deletions

View File

@ -63,30 +63,26 @@ describe('defaultExtensions', () => {
it('recognizes embed code', () => {
const editor = createEditor()
const expected = {
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{
text: 'Baby loves cat:',
type: 'text',
},
],
type: 'paragraph',
type: 'text'
}
]
},
{
content: [
{
attrs: {
dataEmbedUrl: 'https://www.youtube.com/watch?v=qkdXAtO40Fo',
},
type: 'embed',
},
],
type: 'paragraph',
},
],
type: 'doc',
type: 'embed',
attrs: {
dataEmbedUrl: 'https://www.youtube.com/watch?v=qkdXAtO40Fo'
}
}
]
}
expect(editor.getJSON()).toEqual(expected)
})
})

View File

@ -38,8 +38,8 @@ export default class Embed extends Node {
default: null,
},
},
group: 'inline',
inline: true,
group: 'block',
inline: false,
parseDOM: [
{
tag: 'a[href].embed',