@riebeckite/plugin-citations 0.0.14 → 0.0.15

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_ja.md CHANGED
@@ -30,7 +30,7 @@ Pandoc を参考にした、安定した一部の記法を扱います。
30
30
 
31
31
  Riebeckite はこのプラグインより先に `:name` を directive として解釈します。directive 化によって引用キーが分断された場合はプラグインが組み直すため、`[@colon:2024]` と `@colon:2024 argues` の両方が動きます。キーに使えるのは英字、数字、`-`、`_`、`:`、`.` です。
32
32
 
33
- 変換しない対象: inline code、fenced code block、HTML、frontmatter、任意の階層にある通常の Markdown リンク、Obsidian の WikiLink。
33
+ 変換しない対象: インラインコード、フェンスドコードブロック、HTML、frontmatter、任意の階層にある通常の Markdown リンク、Obsidian の Wikilink。
34
34
 
35
35
  ## 文献ファイルの読み込み
36
36
 
@@ -42,7 +42,7 @@ Riebeckite はこのプラグインより先に `:name` を directive として
42
42
 
43
43
  重点的に扱う文献種別は `article`、`book`、`inproceedings`、`misc` です。その他の種別も汎用フィールドとして読み込んで表示し、`citation-unsupported-entry-type` として報告します。
44
44
 
45
- `@comment`、`@preamble`、`@string` は受け付けて読み飛ばします。壊れたエントリは `citation-malformed-bibliography` を出し、次の `@` から再開するため、1件の不正でファイル残りが消えることはありません。
45
+ `@comment`、`@preamble`、`@string` は受け付けて読み飛ばします。壊れたエントリは `citation-malformed-bibliography` を出し、次の `@` から再開するため、1 件の不正でファイル残りが消えることはありません。
46
46
 
47
47
  対応する構文: 複数行フィールド、引用符と波括弧の値、ネストした波括弧、値の中のカンマ、エスケープ文字、末尾カンマ、空白、CRLF。
48
48
 
package/dist/index.js CHANGED
@@ -306,7 +306,7 @@ function remarkCitations(options) {
306
306
  tree,
307
307
  "text",
308
308
  (node, index, parent) => {
309
- if (index === void 0 || !parent.children) return;
309
+ if (index === void 0 || !parent?.children) return;
310
310
  if (blocked.has(node)) return;
311
311
  const replacement = transformTextNode(node, context);
312
312
  if (replacement.length === 1 && replacement[0] === node) return;
@@ -695,8 +695,16 @@ function citations(options = {}) {
695
695
  const state = createCitationState();
696
696
  return definePlugin({
697
697
  name: PLUGIN_NAME,
698
+ processedContentCache: {
699
+ version: "citations-v1",
700
+ dependencyMode: "tracked"
701
+ },
698
702
  options,
699
703
  validateOptions: validateCitationsOptions,
704
+ buildStart: () => {
705
+ state.bibliographies.clear();
706
+ state.diagnostics.length = 0;
707
+ },
700
708
  extendMarkdownPipeline: (pipeline, context) => {
701
709
  pipeline.use(remarkCitations, {
702
710
  ...options,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-citations",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "dependencies": {
8
8
  "@types/mdast": "^4.0.4",
9
9
  "unist-util-visit": "^5.1.0",
10
- "@riebeckite/core": "0.0.14"
10
+ "@riebeckite/core": "0.0.15"
11
11
  },
12
12
  "publishConfig": {
13
13
  "access": "public"