Skip to content

DOCX: a link's destination is dropped, label and all #527

Description

@DemchaAV

InlineTextRun.linkTarget() and a node-level DocumentLinkTarget both reach
DocxSemanticBackend and are dropped: the label survives as ordinary text, the destination
does not. #447 named this and deliberately left it out — "hyperlink relationships are a
larger piece of work (an XWPFHyperlinkRun plus an OPC relationship per link) and are better
tracked separately". This is that separate track.

Word expresses both halves, so this is not a format limitation:

  • an external link is an XWPFHyperlinkRun plus a relationship in the part's .rels;
  • an internal one is w:hyperlink w:anchor against a bookmark, which also needs
    DocumentBookmarkOptions to start emitting w:bookmarkStart/w:bookmarkEnd — today it is
    dropped too, so an anchor has nothing to point at.

The run walk that would carry it already exists: writeParagraphRuns reads each run's style
and has its linkTarget in hand at the same point.

Also update docs/architecture/backend-capability-matrix.md (the paragraph row still
names linkTarget as the reason it is ⚠️) and render-docx/README.md, which lists hyperlinks
and bookmarks under "not implemented".

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions