UNPKG

rehype-citation

Version:

rehype plugin to add citation and bibliography from bibtex files

4 lines (3 loc) 250 B
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 };