site/node_modules/@citation-js/plugin-csl/lib-mjs/attr.js
2024-10-14 08:09:33 +02:00

3 lines
249 B
JavaScript

const getAttributedEntry = (string, name, value) => string.replace(/^\s*<[a-z]+/i, `$& data-${name}="${value}"`);
const getPrefixedEntry = (value, id) => getAttributedEntry(value, 'csl-entry-id', id);
export { getAttributedEntry, getPrefixedEntry };