1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Split marks and nodes into their own files

This commit is contained in:
Dan Brown
2022-01-11 16:26:12 +00:00
parent c3595b1807
commit 34db138a64
4 changed files with 92 additions and 83 deletions

View File

@ -0,0 +1,40 @@
import {schema as basicSchema} from "prosemirror-schema-basic";
const baseMarks = basicSchema.spec.marks;
const underline = {
parseDOM: [{tag: "u"}, {style: "text-decoration=underline"}],
toDOM() {
return ["span", {style: "text-decoration: underline;"}, 0];
}
};
const strike = {
parseDOM: [{tag: "s"}, {tag: "strike"}, {style: "text-decoration=line-through"}],
toDOM() {
return ["span", {style: "text-decoration: line-through;"}, 0];
}
};
const superscript = {
parseDOM: [{tag: "sup"}],
toDOM() {
return ["sup", 0];
}
};
const subscript = {
parseDOM: [{tag: "sub"}],
toDOM() {
return ["sub", 0];
}
};
const marks = baseMarks.append({
underline,
strike,
superscript,
subscript,
});
export default marks;