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

10 lines
438 B
JavaScript

"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;