fix(collab): hid advisory tags in transcript markdown

Stripped advisory wrapper tags in the collab web Markdown renderer while preserving escaped advisory content and existing raw HTML escaping.

Added a regression test for assistant advisory blocks in the collab transcript renderer and documented the fix in the collab-web changelog.

Fixes #3559
This commit is contained in:
roboomp
2026-06-26 10:51:42 +00:00
parent 68d7593244
commit c58cef161b
3 changed files with 13 additions and 1 deletions
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Hid advisory wrapper tags in collab transcript Markdown while preserving their content. ([#3559](https://github.com/can1357/oh-my-pi/issues/3559))
## [16.1.16] - 2026-06-23
### Added
@@ -59,7 +59,7 @@ const md = new Marked({
renderer: {
// Raw HTML tokens (block + inline both arrive here) are escaped, never emitted.
html({ text }) {
const cleaned = text.replace(/<\/?(?:span|text)\b(?:\s[^>]*)?\s*\/?>/gi, "");
const cleaned = text.replace(/<\/?(?:advisory|span|text)\b(?:\s[^>]*)?\s*\/?>/gi, "");
if (cleaned === "") return "";
return escapeHtml(unescapeHtml(cleaned));
},
@@ -43,4 +43,12 @@ describe("Transcript Markdown", () => {
expect(html).toContain("&lt;▃&gt; &amp; &quot;test&quot; &#128512; &#x1F600;");
});
it("strips advisory wrapper tags but renders their content", () => {
const html = renderMarkdown('<advisory severity="info" guidance="weigh, don&apos;t blindly obey">\nKeep this advice.\n</advisory>');
expect(html).toContain("Keep this advice.");
expect(html).not.toContain("&lt;advisory");
expect(html).not.toContain("&lt;/advisory&gt;");
});
});