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

10 lines
438 B
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPrefixedEntry = exports.getAttributedEntry = void 0;
const getAttributedEntry = (string, name, value) => string.replace(/^\s*<[a-z]+/i, `$& data-${name}="${value}"`);
exports.getAttributedEntry = getAttributedEntry;
const getPrefixedEntry = (value, id) => getAttributedEntry(value, 'csl-entry-id', id);
exports.getPrefixedEntry = getPrefixedEntry;