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

Added strike, sup and sub marks

This commit is contained in:
Dan Brown
2022-01-11 16:00:57 +00:00
parent a8f48185b5
commit c3595b1807
4 changed files with 45 additions and 2 deletions

View File

@ -30,7 +30,28 @@ const markUnderline = {
toDOM() {
return ["span", {style: "text-decoration: underline;"}, 0];
}
}
};
const markStrike = {
parseDOM: [{tag: "s"}, {tag: "strike"}, {style: "text-decoration=line-through"}],
toDOM() {
return ["span", {style: "text-decoration: line-through;"}, 0];
}
};
const markSuperscript = {
parseDOM: [{tag: "sup"}],
toDOM() {
return ["sup", 0];
}
};
const markSubscript = {
parseDOM: [{tag: "sub"}],
toDOM() {
return ["sub", 0];
}
};
const customNodes = baseNodes.append({
callout: nodeCallout,
@ -38,6 +59,9 @@ const customNodes = baseNodes.append({
const customMarks = baseMarks.append({
underline: markUnderline,
strike: markStrike,
superscript: markSuperscript,
subscript: markSubscript,
});
const schema = new Schema({