@edifice.io/tiptap-extensions
Version:
Edifice Rich Text Editor Extensions
34 lines (33 loc) • 630 B
JavaScript
import { Mark, mergeAttributes } from "@tiptap/core";
const Abbr = Mark.create({
name: "abbr",
addOptions() {
return {
HTMLAttributes: {}
};
},
parseHTML() {
return [
{
tag: "abbr"
}
];
},
renderHTML({ HTMLAttributes }) {
return [
"abbr",
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
0
];
},
addCommands() {
return {
setAbbr: () => ({ commands }) => commands.setMark(this.name),
toggleAbbr: () => ({ commands }) => commands.toggleMark(this.name)
};
}
});
export {
Abbr
};
//# sourceMappingURL=abbr.js.map