The hover placeholder vocabulary, and the one place it is substituted.
A picked element resolves to a small set of values — its label, the layer
path it belongs to, its element index — and THREE different consumers turn
those into a string:
consumer
escaping
where
hover tooltip
escapeHtml for overlay_html
ui/overlay-manager.ts
link (left-click)
encodeURIComponent, always
core/app/interaction/
copy (right-click)
none — plain text to clipboard
core/app/interaction/
They must agree on the vocabulary and disagree on the escaping, which is
exactly the shape that rots when it is written out three times. Hence one
substitution function taking a TemplateMode.
Pure: no DOM, no config, no layer dependencies — it lives in utils/
beside escape-html.ts so ui/ and core/ can both reach it.
The hover placeholder vocabulary, and the one place it is substituted.
A picked element resolves to a small set of values — its label, the layer path it belongs to, its element index — and THREE different consumers turn those into a string:
escapeHtmlforoverlay_htmlui/overlay-manager.tslink(left-click)encodeURIComponent, alwayscore/app/interaction/copy(right-click)core/app/interaction/They must agree on the vocabulary and disagree on the escaping, which is exactly the shape that rots when it is written out three times. Hence one substitution function taking a TemplateMode.
Pure: no DOM, no config, no layer dependencies — it lives in
utils/besideescape-html.tssoui/andcore/can both reach it.