Update editor, workspace, Git services, appearance, and project guides

This commit is contained in:
Knotty Wyvern
2026-10-11 09:41:16 -07:00
parent a8b1defb9d
commit 909894b9c8
153 changed files with 7967 additions and 775 deletions
+23
View File
@@ -0,0 +1,23 @@
import { test } from "node:test";
import assert from "node:assert/strict";
import { documentLinks, documentLinkAt } from "../src/lib/editor/documentLinks.ts";
test("document links keep complete source ranges and decode Markdown destinations", () => {
const source = '[Local](<notes/two words.md> "Title") and [Web](https://example.com/a_(b)) and [[Another note|Alias]]';
const links = documentLinks(source);
assert.deepEqual(links.map(link => [link.kind, link.target]), [["md", "notes/two words.md"], ["md", "https://example.com/a_(b)"], ["wiki", "Another note"]]);
for (const link of links) {
assert.equal(documentLinkAt(source, link.from + 2)?.target, link.target);
assert.equal(documentLinkAt(source, link.to - 1)?.target, link.target);
}
});
test("literal code and images cannot become document links", () => {
const source = '![Image](image.png) `https://example.com`\n\n```md\n[Hidden](hidden.md)\n[[Hidden]]\n```\n\n[Open](open.md)';
assert.deepEqual(documentLinks(source).map(link => link.target), ["open.md"]);
});
test("bare and angle links omit prose punctuation and preserve balanced parentheses", () => {
const source = 'Go to https://example.com/a_(b). Next (<https://example.org>). Mail <mailto:[email protected]>.';
assert.deepEqual(documentLinks(source).map(link => link.target), ["https://example.com/a_(b)", "https://example.org", "mailto:[email protected]"]);
});