site/node_modules/@citation-js/plugin-csl/lib-mjs/attr.js

3 lines
249 B
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
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 };