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:
@@ -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("<▃> & "test" 😀 😀");
|
||||
});
|
||||
it("strips advisory wrapper tags but renders their content", () => {
|
||||
const html = renderMarkdown('<advisory severity="info" guidance="weigh, don't blindly obey">\nKeep this advice.\n</advisory>');
|
||||
|
||||
expect(html).toContain("Keep this advice.");
|
||||
expect(html).not.toContain("<advisory");
|
||||
expect(html).not.toContain("</advisory>");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user