pinakes-ui: add graph view, backlinks panel, and link extraction

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibf40b009f5d18d16fc115b349b1f681d6a6a6964
This commit is contained in:
raf 2026-02-09 13:14:57 +03:00
commit 3e1e8dea26
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
5 changed files with 103 additions and 43 deletions

View file

@ -227,11 +227,55 @@ fn sanitize_html(html: &str) -> String {
// Allow common markdown elements
let allowed_tags: HashSet<&str> = [
"a", "abbr", "acronym", "b", "blockquote", "br", "code", "dd", "del",
"details", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6",
"hr", "i", "img", "ins", "kbd", "li", "mark", "ol", "p", "pre", "q",
"s", "samp", "small", "span", "strong", "sub", "summary", "sup",
"table", "tbody", "td", "tfoot", "th", "thead", "tr", "u", "ul", "var",
"a",
"abbr",
"acronym",
"b",
"blockquote",
"br",
"code",
"dd",
"del",
"details",
"div",
"dl",
"dt",
"em",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"hr",
"i",
"img",
"ins",
"kbd",
"li",
"mark",
"ol",
"p",
"pre",
"q",
"s",
"samp",
"small",
"span",
"strong",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"tfoot",
"th",
"thead",
"tr",
"u",
"ul",
"var",
// Task list support
"input",
]
@ -240,13 +284,27 @@ fn sanitize_html(html: &str) -> String {
// Allow safe attributes
let allowed_attrs: HashSet<&str> = [
"href", "src", "alt", "title", "class", "id", "name",
"width", "height", "align", "valign",
"colspan", "rowspan", "scope",
"href",
"src",
"alt",
"title",
"class",
"id",
"name",
"width",
"height",
"align",
"valign",
"colspan",
"rowspan",
"scope",
// Data attributes for wikilinks (safe - no code execution)
"data-target", "data-wikilink-target",
"data-target",
"data-wikilink-target",
// Task list checkbox support
"type", "checked", "disabled",
"type",
"checked",
"disabled",
]
.into_iter()
.collect();