Skip to content

fix(citations): decode XML entities in cite attributes - #722

Open
DivyamTalwar wants to merge 1 commit into
VectifyAI:mainfrom
DivyamTalwar:fix/decode-citation-xml-entities
Open

DivyamTalwar wants to merge 1 commit into
VectifyAI:mainfrom
DivyamTalwar:fix/decode-citation-xml-entities

Conversation

@DivyamTalwar

Copy link
Copy Markdown

Refs #637.

Summary

A modern citation tag following XML escaping rules can name R&D/Report.pdf while the library stores R&D/Report.pdf. Reading the raw attribute value made the citation unresolved.

Decode the five named XML entities and valid numeric XML character references once before using citation attributes for resolution and display. Leave unrecognized or invalid references literal, including text that resembles an HTML-only entity. The legacy citation markup keeps its existing interpretation.

Validation

  • A regression test resolves escaped decimal, hexadecimal and named versions of the same citation to one link and document, and checks a literal HTML-only reference in another file name.
  • The numeric decoder test checks exact U+0080 fidelity, malformed XML character references and one-pass decoding.
  • 16 citation-related tests passed. git diff --check passes.

This branch has not been deployed

No deployments
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.

2 participants