8 tag: "a[href]", getAttrs: function getAttrs(dom) {
9 return {href: dom.getAttribute("href"), title: dom.getAttribute("title")}
12 toDOM: function toDOM(node) {
13 const ref = node.attrs;
14 const href = ref.href;
15 const title = ref.title;
16 return ["a", {href: href, title: title}, 0]
21 parseDOM: [{tag: "i"}, {tag: "em"}, {style: "font-style=italic"}],
28 parseDOM: [{tag: "strong"},
29 // This works around a Google Docs misbehavior where
30 // pasted content will be inexplicably wrapped in `<b>`
31 // tags with a font-weight normal.
33 tag: "b", getAttrs: function (node) {
34 return node.style.fontWeight != "normal" && null;
38 style: "font-weight", getAttrs: function (value) {
39 return /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null;
48 parseDOM: [{tag: "code"}],
55 parseDOM: [{tag: "u"}, {style: "text-decoration=underline"}],
57 return ["span", {style: "text-decoration: underline;"}, 0];
62 parseDOM: [{tag: "s"}, {tag: "strike"}, {style: "text-decoration=line-through"}],
64 return ["span", {style: "text-decoration: line-through;"}, 0];
69 parseDOM: [{tag: "sup"}],
76 parseDOM: [{tag: "sub"}],
93 return ['span', {style: `color: ${node.attrs.color};`}, 0];
97 const background_color = {
102 style: 'background-color',
108 return ['span', {style: `background-color: ${node.attrs.color};`}, 0];
125 export default marks;