4 title: {default: null},
5 target: {default: null}
9 tag: "a[href]", getAttrs: function getAttrs(dom) {
11 href: dom.getAttribute("href"),
12 title: dom.getAttribute("title"),
13 target: dom.getAttribute("target"),
17 toDOM: function toDOM(node) {
18 const ref = node.attrs;
19 const href = ref.href;
20 const title = ref.title;
21 const target = ref.target;
22 return ["a", {href, title, target}, 0]
27 parseDOM: [{tag: "i"}, {tag: "em"}, {style: "font-style=italic"}],
34 parseDOM: [{tag: "strong"},
35 // This works around a Google Docs misbehavior where
36 // pasted content will be inexplicably wrapped in `<b>`
37 // tags with a font-weight normal.
39 tag: "b", getAttrs: function (node) {
40 return node.style.fontWeight != "normal" && null;
44 style: "font-weight", getAttrs: function (value) {
45 return /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null;
54 parseDOM: [{tag: "code"}],
61 parseDOM: [{tag: "u"}, {style: "text-decoration=underline"}],
63 return ["span", {style: "text-decoration: underline;"}, 0];
68 parseDOM: [{tag: "s"}, {tag: "strike"}, {style: "text-decoration=line-through"}],
70 return ["span", {style: "text-decoration: line-through;"}, 0];
75 parseDOM: [{tag: "sup"}],
82 parseDOM: [{tag: "sub"}],
99 return ['span', {style: `color: ${node.attrs.color};`}, 0];
103 const background_color = {
108 style: 'background-color',
114 return ['span', {style: `background-color: ${node.attrs.color};`}, 0];
131 export default marks;