ElyMark: the page hands every link click to the app (M-05)

Preview clicks and Cmd/Ctrl clicks in the editor go through one
click handler; it stops the browser and sends the link mark's own
address, since Milkdown blanks unsafe hrefs in the DOM. Reviews run
at effort xhigh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-10 11:24:05 -04:00
1 parent fa5c0b7a75
commit c5f614d095
12 files changed
+160 -18

No files matched your search

+4 -1
View File
@@ -43,6 +43,9 @@ function flush() {
pending = null
}
/** A link the user opens; the app decides. */
const linked = (href) => tell({ kind: 'link', generation, href })
/** The shown editor's headings, for the app's outline. */
function outline() {
if (current) tell({ kind: 'outline', generation, items: current.outline() })
@@ -83,7 +86,7 @@ async function build(text, mode) {
const edited = (write) => changed(() => front + write())
let made
try {
made = await visual(place, body, mode === 'visual', texts, edited, edge)
made = await visual(place, body, mode === 'visual', texts, edited, edge, linked)
} catch (error) {
// A broken editor falls back to source and says so.
console.error(`ely: the visual editor failed: ${error.name}`)