UNPKG

remark-css-selectors

Version:

Adding class and id attribute to AST tree (not standard markdown syntax)

16 lines (13 loc) 370 B
function blockAttrTokenizer(eat, value, silent) { let match = /^{(\.|#)((?:\w|-|\s)+)}/.exec(value) if (match) { if (silent) { return true } return eat(match[0])({ type: (match[1] === "#") ? 'attrId' : 'attrClass', value: match[2] }) } } export default blockAttrTokenizer;