A soft-wrapped multi-line item is ONE block in Obsidian (the block id sits
at the end of its last line and the cache span covers every line), but the
auto display text was built from a single line: the range's first line when
inserting a new id, the id-bearing last line when copying an existing one.
Multi-line blocks therefore got truncated aliases.
- new EasyCopy.getBlockText(): walks up to the block's first line (bullet
or paragraph start, also from a continuation line under the cursor),
extends through the soft-wrapped continuation lines, strips per-line
trailing block ids, and joins with newlines
- both copy paths pass the full block text; extractBlockDisplayText joins
the lines with single spaces (blank lines dropped) before applying the
existing word/char limits
- the trailing-id strip is now ^[a-zA-Z0-9_-]+$ per line instead of the
greedy /\^.*$/, so a mid-line caret (e.g. 2^10) survives
- firstLine renamed blockText through the pipeline; 5 new tests
Pull out computeDisplayText, shouldSimplifyHeading,
formatWikiHeadingLink, formatMarkdownHeadingLink as private helpers.
buildHeadingLink becomes a thin orchestrator: stripWikiBrackets →
computeDisplayText → shouldSimplifyHeading → wikiExactMatch policy →
formatX. Formatters are pure string-producers; the orchestrator owns
the WIKI [[filename]] exact-match policy (the A1.5 exception).
Pure refactor — no behavior change, all 184 existing tests pass without
modification.
Also extract stripWikiBrackets to its own export and reuse in
buildHeadingCopyMetadata (removes duplicated [[…]] stripping).
Designed, carefully reviewed, and edited by @lightmotive in collaboration with Claude Code.
Addresses #35 maintainer feedback: gate paste-time resolution behind a
default-off toggle with 5-min TTL on lastCopyMeta. Switch from DOM
paste (capture phase) to editor-paste workspace event with documented
defaultPrevented yield protocol; register only when active.
Also fixes a pre-existing bug where simplifiedHeadingToNoteLink was
never read — the simplification fired unconditionally when filename
matched heading.
Designed, carefully reviewed, and edited by @lightmotive in collaboration with Claude Code.
Move the inline metadata-construction logic from the three copy paths
(block/heading/file) into pure helpers in src/copyMetadata.ts, matching
the project's pure-function test style. Adds 25 unit tests covering
alias, subpath, and embed computation for each copy type.