fix(tui): render HTML tags as plain text in Markdown component
Handles both block-level and inline HTML tags that were previously silently dropped. fixes #359
This commit is contained in:
@@ -317,7 +317,10 @@ export class Markdown implements Component {
|
||||
break;
|
||||
|
||||
case "html":
|
||||
// Skip HTML for terminal output
|
||||
// Render HTML as plain text (escaped for terminal)
|
||||
if ("raw" in token && typeof token.raw === "string") {
|
||||
lines.push(this.applyDefaultStyle(token.raw.trim()));
|
||||
}
|
||||
break;
|
||||
|
||||
case "space":
|
||||
@@ -394,6 +397,13 @@ export class Markdown implements Component {
|
||||
break;
|
||||
}
|
||||
|
||||
case "html":
|
||||
// Render inline HTML as plain text
|
||||
if ("raw" in token && typeof token.raw === "string") {
|
||||
result += this.applyDefaultStyle(token.raw);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Handle any other inline token types as plain text
|
||||
if ("text" in token && typeof token.text === "string") {
|
||||
|
||||
Reference in New Issue
Block a user