Commit Graph
2 Commits
Author SHA1 Message Date
Yyunozor 5743c9a8cf fix(export): strip control characters from the id drawn for an unlabelled node
A node without a label is drawn under its id (`G.nodes[n].get("label", n)`),
a third path from text to graph.svg. The previous commit cleaned the labels
and left that fallback as it was, so an unlabelled node whose id holds a C0
control character still produced a graph.svg that a strict parser rejects.

Run the fallback through the same strip: one expression,
`_strip_xml_illegal(str(G.nodes[n].get("label", n)))`, now covers the label
and the id. A clean id is drawn as before.

Tests: for each control character the module already lists, an unlabelled
node whose id carries it; the file must parse and still show the cleaned id.

Assisted-by: assayer harness on Claude Code (https://github.com/Yyunozor/assayer-memory-mcp)
(cherry picked from commit 2e7e28ab32)
2026-10-09 02:51:03 +01:00
abhay-codes07 917e331ab4 fix(export): a control character in a label must not abort the export (#2897)
A C0 control character in a node label or id (from a mangled extraction or an odd
filename) crashed the GraphML export (XML 1.0 forbids C0 except tab/LF/CR) and the
Obsidian export (EINVAL on Windows paths), aborting the whole artifact. Fold a
control-char scrub into the existing per-format coercion hooks so only the illegal
characters are stripped; tab/LF/CR and non-ASCII letters are preserved, and to_json
(and its byte-identity round-trip) is untouched.
2026-08-20 16:09:00 +01:00