The Gitea repository was renamed brain -> superbrain (server-side redirect already in place; local origin updated at 0.3.5). Carry the rename through for accurate identity, the 0.3.2 precedent: go.mod + every internal import, the agent's outbound User-Agent contact URL, README/RUNNING clone URLs and local notes. CHANGELOG history entries stay as written. Pure identifier rename, no runtime behavior change; verified with build + vet + unit tests and the full database integration suite under -race.
28 lines
703 B
Go
28 lines
703 B
Go
package markdown
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"gitea.federated.computer/Federated_Computer/superbrain/internal/db"
|
|
)
|
|
|
|
// Review L-11: link destinations are wrapped and escaped so parentheses or
|
|
// angle brackets in a bookmark URL cannot terminate or extend the link.
|
|
func TestPageDocumentEscapesLinkDestinations(t *testing.T) {
|
|
out := PageDocument(db.Object{
|
|
"title": "Links",
|
|
"content": "",
|
|
"bookmarks": []any{
|
|
map[string]any{"bookmark": map[string]any{
|
|
"title": "Odd",
|
|
"url": "https://example.com/a(b)?x=<y>",
|
|
}},
|
|
},
|
|
})
|
|
want := "[Odd](<https://example.com/a(b)?x=%3Cy%3E>)"
|
|
if !strings.Contains(out, want) {
|
|
t.Fatalf("link destination not escaped:\n%s", out)
|
|
}
|
|
}
|