remark-css-selectors
Version:
Adding class and id attribute to AST tree (not standard markdown syntax)
31 lines (24 loc) • 619 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function locateMention(value, fromIndex) {
return value.indexOf('{', fromIndex);
}
tokenizeInlineAttr.notInLink = true;
tokenizeInlineAttr.locator = locateMention;
function tokenizeInlineAttr(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]
});
}
}
var _default = tokenizeInlineAttr;
exports.default = _default;