dsh-cite 0.3.3 → 0.3.5
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.2.0-rc.1` built from official sources (commit `407e65c8`) with Node `24.16.0` on 2026-09-28. All 25 plugin tests pass in an isolated environment; all 18 plugins mount together in one host registering 5 tools, with tool schemas and health-check contracts passing. No live ports or external services were exercised in this 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.2.0-rc.1`(commit `407e65c8`)+ Node `24.16.0`(2026-09-28)。25 项插件测试在隔离环境全部通过;同一个宿主里 18 个插件共同加载,注册 5 个工具,工具 schema 与健康检查契约通过。本轮未启用真实端口与外部服务。
|
|
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.5",
|
|
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",
|