Skip to content

Fix anchor-based citation resolution for 1.2.0 - #1

Merged
lyingTree merged 1 commit into
mainfrom
fix/citation-preview-1.2.0
Nov 22, 2026
Merged

lyingTree merged 1 commit into
mainfrom
fix/citation-preview-1.2.0

Conversation

@lyingTree

Copy link
Copy Markdown
Owner

Why

The previous parser required a recognized bibliography heading. It indexed the supplied Hocke note, but not the Runge note with counted Chinese headings. A number-only index also cannot distinguish main reference 1 from supplementary reference 1, and label-only hover caches can return the wrong source.

What changes

  • Identify reference blocks directly from actual ^ref-N / ^sref-N anchors. Headings are unrestricted and optional. Also support ref1 / sref1 and named sets such as ref-appendix-N.
  • Keep anchor namespaces independent and expand numeric ranges only within the namespace selected by exact link targets. Index the exact reference block, including compact lists and multiline entries, without including following prose or metadata.
  • Preserve reference identity in preview caching, metadata refresh, and Reading-view DOM matching. Share same-note path validation between source parsing and rendered links.
  • Report ambiguous plain numeric citations instead of mixing reference sets; leave invalid targets and groups spanning different namespaces to native link behavior.
  • Set manifest, package, lockfile, and compatibility metadata to 1.2.0. Preserve citation-range-preview and minimum Obsidian version 1.15.1.

Validation

  • npm run check: production build passed; 171 tests passed across 8 files; ESLint reported no errors and one existing deprecated-settings-display warning in unchanged src/settings.ts.
  • npm run package: installation archive verified to contain the matching main.js, manifest.json, and styles.css under citation-range-preview/.
  • Supplied Hocke note: 31 reference blocks, 45 citation groups.
  • Supplied Runge note: 96 reference blocks (66 main + 30 supplementary), 108 citation groups, with every expanded reference resolved.
  • Both complete notes produced identical results after all Markdown headings were removed, all headings were renamed, and newlines were converted to CRLF.
  • Reading/editor host integration covers distinct same-label previews, edited reference text, moved entries, removed/renamed anchors, and figure/equation link isolation. The user's desktop Obsidian installation was not exercised.

The supplied full notes are not committed; regression fixtures use fictional references.

Compatibility

Per the requested anchor-based behavior, an unanchored numbered list no longer establishes references, regardless of its heading. Plain in-text citations still work when existing supported block IDs identify a unique reference set. Existing notes with ref / sref anchors need no content changes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T07:34:18.458329Z 0522793 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lyingTree
lyingTree merged commit 3cfb351 into main Nov 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant