1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +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

@ -1,10 +1,3 @@
/**
* Much of this code originates from https://github.com/ProseMirror/prosemirror-menu
* and is hence subject to the MIT license found here:
* https://github.com/ProseMirror/prosemirror-menu/blob/master/LICENSE
* @copyright Marijn Haverbeke and others
*/
import {
MenuItem, Dropdown, DropdownSubmenu, renderGrouped, icons, joinUpItem, liftItem, selectParentNodeItem,
undoItem, redoItem, wrapItem, blockTypeItem
@ -62,6 +55,7 @@ function markItem(markType, options) {
const inlineStyles = [
markItem(schema.marks.strong, {title: "Bold", icon: icons.strong}),
markItem(schema.marks.em, {title: "Italic", icon: icons.em}),
markItem(schema.marks.underline, {title: "Underline", label: 'U'}),
];
const formats = [
@ -109,9 +103,8 @@ const menu = menuBar({
floating: false,
content: [
[undoItem, redoItem],
inlineStyles,
[new DropdownSubmenu(formats, { label: 'Formats' })],
inlineStyles,
],
});