citation-js-utils
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -56,2 +56,3 @@ export type CitationJson = { | ||
suffix?: string; | ||
partial?: 'author' | 'year'; | ||
}; | ||
@@ -58,0 +59,0 @@ export type CitationRenderer = Record<string, { |
@@ -13,3 +13,3 @@ import Cite from 'citation-js'; | ||
const cleanHtml = sanitizer.cleanCitationHtml(citation).trim(); | ||
return cleanHtml.replace(/^1\./g, '').trim(); | ||
return cleanHtml.replace(/^1\./g, '').replace(/&/g, '&').trim(); | ||
} | ||
@@ -49,3 +49,9 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const suffix = (opts === null || opts === void 0 ? void 0 : opts.suffix) ? `, ${opts.suffix}` : ''; | ||
const yearPart = kind === InlineCite.t ? ` (${year}${suffix})` : `, ${year}${suffix}`; | ||
let yearPart = kind === InlineCite.t ? ` (${year}${suffix})` : `, ${year}${suffix}`; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.partial) === 'author') | ||
yearPart = ''; | ||
if ((opts === null || opts === void 0 ? void 0 : opts.partial) === 'year') { | ||
const onlyYear = kind === InlineCite.t ? `(${year}${suffix})` : `${year}${suffix}`; | ||
return [{ type: 'text', value: onlyYear }]; | ||
} | ||
if (!authors || authors.length === 0) { | ||
@@ -52,0 +58,0 @@ const text = data.publisher || data.title; |
{ | ||
"name": "citation-js-utils", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Utilities for citation-js.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8808
175
1