Skip to content

fix: wire citation handler to v2 importer#3259

Closed
mattConnHarbour wants to merge 4 commits into
mainfrom
SD-3120
Closed

fix: wire citation handler to v2 importer#3259
mattConnHarbour wants to merge 4 commits into
mainfrom
SD-3120

Conversation

@mattConnHarbour

Copy link
Copy Markdown
Contributor

The v2 importer was missing a handler for sd:citation elements. The field preprocessor converts CITATION field codes to sd:citation XML, and the v3 translator exists, but nothing bridged them to ProseMirror nodes.

This follows the same pattern as bibliographyImporter.js.

Fixes SD-3120

The v2 importer was missing a handler for sd:citation elements.
The field preprocessor converts CITATION field codes to sd:citation XML,
and the v3 translator exists, but nothing bridged them to ProseMirror nodes.

This follows the same pattern as bibliographyImporter.js.

Fixes SD-3120

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mattConnHarbour mattConnHarbour requested a review from a team as a code owner May 12, 2026 20:35
@linear

linear Bot commented May 12, 2026

Copy link
Copy Markdown

SD-3120

@github-actions

Copy link
Copy Markdown
Contributor

Status: PASS

The diff is purely wiring — citationImporter.js is a 7-line shim that registers a handler via generateV2HandlerEntity, and docxImporter.js just adds the import and the entry to the handler list. Neither file references any OOXML elements or attributes directly, so there's nothing in this diff to violate the spec.

For context, the underlying citation-translator.js (not in this diff) handles sd:citation (SuperDoc custom namespace, not OOXML) on encode and decodes back to a standard field structure: w:r runs containing w:rPr and w:fldChar with w:fldCharType values of begin, separate, and end — all valid OOXML constructs (w:fldChar).

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

📦 Preview published: superdoc@1.32.0-pr.3259.1778622890

npm install superdoc@pr-3259

Citation nodes have `atom: true` in their schema, so they must be
included in ATOMIC_INLINE_TYPES for buildPositionMap() to correctly
calculate positions during hit testing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Preview published: superdoc@1.32.0-pr.3259.1778797810

npm install superdoc@pr-3259

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants