tabs to spaces whitespace
This commit is contained in:
@@ -3,41 +3,41 @@ import { updateMark, removeMark } from 'tiptap-commands'
|
||||
|
||||
export default class Link extends Mark {
|
||||
|
||||
get name() {
|
||||
return 'link'
|
||||
}
|
||||
get name() {
|
||||
return 'link'
|
||||
}
|
||||
|
||||
get schema() {
|
||||
return {
|
||||
attrs: {
|
||||
href: {
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
inclusive: false,
|
||||
parseDOM: [
|
||||
{
|
||||
tag: 'a[href]',
|
||||
getAttrs: dom => ({
|
||||
href: dom.getAttribute('href'),
|
||||
}),
|
||||
},
|
||||
],
|
||||
toDOM: node => ['a', {
|
||||
...node.attrs,
|
||||
rel: 'noopener noreferrer nofollow',
|
||||
}, 0],
|
||||
}
|
||||
}
|
||||
get schema() {
|
||||
return {
|
||||
attrs: {
|
||||
href: {
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
inclusive: false,
|
||||
parseDOM: [
|
||||
{
|
||||
tag: 'a[href]',
|
||||
getAttrs: dom => ({
|
||||
href: dom.getAttribute('href'),
|
||||
}),
|
||||
},
|
||||
],
|
||||
toDOM: node => ['a', {
|
||||
...node.attrs,
|
||||
rel: 'noopener noreferrer nofollow',
|
||||
}, 0],
|
||||
}
|
||||
}
|
||||
|
||||
commands({ type }) {
|
||||
return attrs => {
|
||||
if (attrs.href) {
|
||||
return updateMark(type, attrs)
|
||||
}
|
||||
commands({ type }) {
|
||||
return attrs => {
|
||||
if (attrs.href) {
|
||||
return updateMark(type, attrs)
|
||||
}
|
||||
|
||||
return removeMark(type)
|
||||
}
|
||||
}
|
||||
return removeMark(type)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user