Files
designcraft/crates/engine/src
Hamza c212c89bab A text anchor's name is the document's, so it is not reused
`anchor.create` took any name, including one another anchor already had, so a
document could hold two anchors called "Photo 1". Every reference to the name
then means whichever the search finds first: `xref.insert {"anchor": "Photo 1"}`
and `hyperlink.create {"anchor": "Photo 1"}` take the first, and an export
writes both destinations under the one name. A name nobody can resolve is not a
name.

A name already in the document is a usage error now, naming it and where to
look: "a text anchor named `Photo 1` is already in this document (anchor.list
names them)". A name that is empty or only spaces is refused too — a
cross-reference built from `<txtAnchrName />` would show nothing.

Case still distinguishes names, as it does elsewhere in the document, and
nothing about existing anchors changes: the check is on creation.

The test covers the same name in the same story and in another one, the empty
names, that only one anchor exists afterwards, and that another name and a
name differing in case are both fine. Without the check the duplicate is
created again.

Not from a ticket: found probing `anchor.create`.
2026-10-22 17:00:05 +05:00
..