fix(editor): mention handling on post editing (#1223)
This commit is contained in:
parent
7389226c38
commit
b049b40298
4 changed files with 20 additions and 1 deletions
|
@ -168,6 +168,14 @@ describe('content-rich', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('editor', () => {
|
||||
it('transform mentions', () => {
|
||||
const ast = parseMastodonHTML('<p><span class="h-card"><a href="https://m.webtoo.ls/@elk" class="u-url mention">@<span>elk</span></a></span> Hello</p>')
|
||||
const transformed = treeToText(ast)
|
||||
expect(transformed).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
|
||||
async function render(content: string, options?: ContentParseOptions) {
|
||||
const vnode = contentToVNode(content, options)
|
||||
const html = (await renderToString(vnode))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue