1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 101× 16× 16× 8× 8× | export default { type: "heading", matchElement: function(el) { return /^h\d$/.exec(el.tagName) }, import: function(el, node, converter) { node.level = Number(el.tagName[1]) node.content = converter.annotatedText(el, [node.id, 'content']) }, export: function(node, el, converter) { el.tagName = 'h'+node.level el.append( converter.annotatedText([node.id, 'content']) ) } } |