Files
Oliver Eyton-Williams a3a678b7af chore: remove old parser
2021-02-02 09:51:02 +05:30

9 lines
271 B
JavaScript

// getId expects the image reference node to be the sole node in a paragraph
function getId(node) {
const { type, name, attributes } = node;
if (type !== 'leafDirective' || name !== 'id' || !attributes) return null;
return attributes.id;
}
module.exports = getId;