import { escapeHTML } from "../../core/format.js";
export function withSelectedNodeHeader(rendered, label) {
    if (rendered.plain.startsWith("Selected node:")) {
        return rendered;
    }
    return {
        ...rendered,
        plain: [`Node: ${label}`, "", rendered.plain].join("\n"),
        html: [`<b>Node:</b> <code>${escapeHTML(label)}</code>`, "", rendered.html].join("\n"),
    };
}
