1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-06-27 16:41:53 +03:00

Got underline working in editor

Major step, since this is the first inline HTML element which needed
advanced parsing out on the markdown side, since not commonmark
supported.
This commit is contained in:
Dan Brown
2022-01-10 13:38:32 +00:00
parent 9d7174557e
commit a8f48185b5
8 changed files with 116 additions and 18 deletions

View File

@ -5,10 +5,20 @@ const nodes = defaultMarkdownSerializer.nodes;
const marks = defaultMarkdownSerializer.marks;
nodes.callout = function(state, node) {
writeNodeAsHtml(state, node);
};
marks.underline = {
open: '<span style="text-decoration: underline;">',
close: '</span>',
};
function writeNodeAsHtml(state, node) {
const html = docToHtml({ content: [node] });
state.write(html);
state.closeBlock();
};
}
const serializer = new MarkdownSerializer(nodes, marks);