Skip to content

Commit

Permalink
fix: bracket breaks universityPlace match
Browse files Browse the repository at this point in the history
ref: #126
  • Loading branch information
northword committed Jan 26, 2024
1 parent c49bc01 commit 927ebb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- 富文本工具条适配阅读器侧边栏。/ Rich text toolbar adapted to reader sidebar.
- 移除首选项窗格中的一级标题,因为 Zotero 7 beta 55 起自动为插件生成一级标题。/ Removed the h1 title in the Preferences pane, as Zotero 7 beta 55 onwards automatically generates a h1 title for the plugin. fix: [#133](https://github.com/northword/zotero-format-metadata/issues/133)
- 修复标题大小写转换错误将中文条目中的英文专有名词小写的问题。当前中文条目不再应用标题句子式大写这一规则。/ Fix a problem where title sentence capitalization incorrectly lowercased English proper nouns in Chinese items. The rule of sentence capitalization of titles is no longer applied to current Chinese items. close: [#128](https://github.com/northword/zotero-format-metadata/issues/128)
- 修复部分大学地点无法匹配的问题。/ ref: [#126](https://github.com/northword/zotero-format-metadata/issues/126)

## [1.9.1] - 2024-01-24

Expand Down
14 changes: 6 additions & 8 deletions src/modules/rules/field-place.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ export default class UpdateUniversityPlace extends RuleBase<updateUniversityPlac
}

apply(item: Zotero.Item): Zotero.Item {
if (item.itemType == "thesis") {
const university = item.getField("university") as string;
const place = this.getUniversityPlace(university);
item.setField("place", place);
// await item.saveTx();
} else {
ztoolkit.log(`[Place] Item type ${item.itemType} is not thesis, skip it.`);
}
if (item.itemType !== "thesis") return item;

const university = item.getField("university") as string;
let place = this.getUniversityPlace(university);
if (place == "") place = this.getUniversityPlace(university.replace(/[((].*[)|)]/, ""));
item.setField("place", place);
return item;
}

Expand Down

0 comments on commit 927ebb4

Please sign in to comment.