UNPKG
@citation-js/plugin-csl
Version:
latest (0.7.22)
0.7.22
0.7.21
0.7.18
0.7.14
0.7.13
0.7.11
0.7.9
0.7.6
0.7.2
0.7.1
0.7.0
0.6.9
0.6.8
0.6.7
0.6.5
0.6.4
0.6.3
0.6.1
0.6.0
0.5.7
0.5.5
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.5.0-alpha.10
0.5.0-alpha.9
0.5.0-alpha.8
0.5.0-alpha.7
0.5.0-alpha.6
0.5.0-alpha.5
0.5.0-alpha.4
0.5.0-alpha.3
0.5.0-alpha.2
0.5.0-alpha.1
0.5.0-alpha.0
0.4.10
0.4.9
0.4.8
0.4.7
0.4.6
0.4.5
0.4.3
0.4.3-alpha.0
0.4.2
0.4.1
0.4.0
0.4.0-rc.4
0.4.0-rc.3
0.4.0-rc.2
0.4.0-rc.1
0.4.0-rc.0
Plugin for CSL output for Citation.js
citation.js.org
citation-js/citation-js
@citation-js/plugin-csl
/
lib-mjs
/
attr.js
3 lines
•
249 B
JavaScript
View Raw
1
2
3
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 };