New notes and workbench edges now emit [[Note#Heading ^block]] or [[#^id]] so vaults stay ingestible without mass relinks. Create-from-profile always opens the wizard; a command can restart it on the current note. Co-authored-by: Cursor <cursoragent@cursor.com>
63 lines
1.7 KiB
Markdown
63 lines
1.7 KiB
Markdown
# Modul: Unresolved Link
|
||
|
||
> **Pfad:** `src/unresolvedLink/`
|
||
> **Zielgruppe:** Entwickler
|
||
|
||
---
|
||
|
||
## Übersicht
|
||
|
||
Das Unresolved-Link-Modul behandelt das Abfangen von Klicks auf unaufgelöste Links, Note-Adoption und die Normalisierung von Überschriften für Matching.
|
||
|
||
---
|
||
|
||
## Komponenten
|
||
|
||
| Datei | Beschreibung |
|
||
|-------|--------------|
|
||
| `unresolvedLinkHandler.ts` | Haupt-Handler für Link-Clicks |
|
||
| `linkHelpers.ts` | Link-Parsing, Heading-Normalisierung, Matching |
|
||
| `adoptHelpers.ts` | Note-Adoption-Logik |
|
||
|
||
---
|
||
|
||
## Heading-Normalisierung (normalizeHeadingForMatch)
|
||
|
||
**Zweck:** Überschriften für Vergleich (Inspect Chains, Chain Workbench) auf kanonische Form bringen.
|
||
|
||
### Regeln
|
||
|
||
1. **Mit ^Block-ID:** `"Überschrift ^Block"` → `"Überschrift"` (Block-Suffix entfernen)
|
||
2. **Ohne ^:** Rückgabe unverändert (Idempotenz für bereits normalisierte Formen)
|
||
|
||
### Wichtige Eigenschaft: Idempotenz
|
||
|
||
`norm(norm(x)) === norm(x)` – mehrfache Normalisierung ändert nichts.
|
||
|
||
### Beispiele
|
||
|
||
| Input | Output |
|
||
|-------|--------|
|
||
| `"Lars ist gut ^PersLars"` | `"Lars ist gut"` |
|
||
| `"Lars ist gut"` | `"Lars ist gut"` |
|
||
| `"Nächster Schritt ^next"` | `"Nächster Schritt"` |
|
||
| `"Überschrift ^Block"` | `"Überschrift"` |
|
||
|
||
### headingsMatch
|
||
|
||
Vergleicht zwei Überschriften über `normalizeHeadingForMatch` – beide müssen nach Normalisierung identisch sein.
|
||
|
||
---
|
||
|
||
## Obsidian-Verhalten
|
||
|
||
- **Manuell verlinkt:** Obsidian erzeugt `[[Titel#Überschrift Block]]` (ohne `^`)
|
||
- **Empfehlung:** Für zuverlässiges Matching Links mit `^` verwenden: `[[Note#Überschrift ^Block]]`
|
||
|
||
---
|
||
|
||
## Siehe auch
|
||
|
||
- [12_Heading_Block_Link_Recommendation](../12_Heading_Block_Link_Recommendation.md)
|
||
- [Analysis-Modul](analysis.md) – Nutzung von headingsMatch
|