dsh-cite 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +6 -0
- package/README.md +6 -0
- package/lib/format.js +10 -2
- package/package.json +2 -2
package/README.en.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# dsh-cite
|
|
2
2
|
|
|
3
|
+
## 0.3.4 update (2026-09-27)
|
|
4
|
+
|
|
5
|
+
Preserves given/family name boundaries and compound surnames in BibTeX. Corporate authors are protected with braces instead of being parsed as personal names.
|
|
6
|
+
|
|
7
|
+
Validation host: Harness 0.1.7-rc.2 built from official sources, retaining the local tool-scheduler fix. Build and automated checks pass; interactive coverage and external-service limits are recorded in this release round.
|
|
8
|
+
|
|
3
9
|
   
|
|
4
10
|
|
|
5
11
|
> Give it a DOI, get a proper citation — GB/T 7714 / APA / MLA / Chicago / BibTeX.
|
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# dsh-cite
|
|
2
2
|
|
|
3
|
+
## 0.3.4 更新(2026-09-27)
|
|
4
|
+
|
|
5
|
+
修复 BibTeX 作者姓名顺序,保留复合姓氏;机构作者使用独立括号,避免被拆成人名。
|
|
6
|
+
|
|
7
|
+
验证宿主:官方源码构建的 Harness 0.1.7-rc.2(保留本地工具调度器修复)。构建与自动测试通过;实际操作和外部服务限制见本轮验收记录。
|
|
8
|
+
|
|
3
9
|
   
|
|
4
10
|
|
|
5
11
|
> 给一个 DOI,还你规范参考文献——GB/T 7714 / APA / MLA / Chicago / BibTeX。
|
package/lib/format.js
CHANGED
|
@@ -245,9 +245,17 @@ export function buildBibtex(work, key) {
|
|
|
245
245
|
const baseKey = key !== undefined && key.trim() !== '' ? sanitizeBibtexKey(key.trim()) : sanitizeBibtexKey(((first?.family || first?.name || 'author') + yearText(work) + firstWord).toLowerCase());
|
|
246
246
|
const type = bibtexType(work);
|
|
247
247
|
const fields = [];
|
|
248
|
-
const authors = work.authors.map((author) =>
|
|
248
|
+
const authors = work.authors.map((author) => {
|
|
249
|
+
// BibTeX interprets an unpunctuated personal name as First Last.
|
|
250
|
+
// Preserve the provider's family/given boundary, including compound surnames.
|
|
251
|
+
if (author.name !== '')
|
|
252
|
+
return '{' + escapeLatex(author.name) + '}';
|
|
253
|
+
if (author.family !== '' && author.given !== '')
|
|
254
|
+
return escapeLatex(author.family) + ', ' + escapeLatex(author.given);
|
|
255
|
+
return '{' + escapeLatex(author.family || author.given) + '}';
|
|
256
|
+
}).join(' and ');
|
|
249
257
|
if (authors !== '')
|
|
250
|
-
fields.push(' author={' +
|
|
258
|
+
fields.push(' author={' + authors + '}');
|
|
251
259
|
fields.push(' title={' + escapeLatex(titleOf(work)) + '}');
|
|
252
260
|
if (work.containerTitle !== '')
|
|
253
261
|
fields.push(type === 'article' ? ' journal={' + escapeLatex(work.containerTitle) + '}' : ' booktitle={' + escapeLatex(work.containerTitle) + '}');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-cite",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "DSH
|
|
3
|
+
"version": "0.3.4",
|
|
4
|
+
"description": "DSH 参考文献插件:Crossref 元数据查询(DOI 精确解析)与 GB/T 7714 / APA / MLA / Chicago 格式化,含去重校验与自检。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|