add italic parseDOM tests

This commit is contained in:
Hans Pagel
2020-10-08 03:57:45 +02:00
parent 78cc76c1a6
commit d09c664909
2 changed files with 31 additions and 3 deletions

View File

@@ -19,9 +19,16 @@ export default new Mark()
.name('italic')
.schema(() => ({
parseDOM: [
{ tag: 'i' },
{ tag: 'em' },
{ style: 'font-style=italic' },
{
tag: 'em',
},
{
tag: 'i',
getAttrs: node => (node as HTMLElement).style.fontStyle !== 'normal' && null,
},
{
style: 'font-style=italic',
},
],
toDOM: () => ['em', 0],
}))