fix: final lint resolution for HTML detection
Some checks failed
BotUI CI/CD / build (push) Has been cancelled

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-14 17:57:04 -03:00
parent 928e259745
commit d813fc2a25

View file

@ -302,7 +302,8 @@ function addMessage(sender, content, msgId) {
"</div>";
} else {
// Check if content has HTML (any tag, including comments)
var hasHtmlTags = (content.indexOf("<") !== -1 && /<[a-zA-Z]/.test(content)) || content.indexOf("<!--") !== -1;
var htmlRegex = new RegExp("<[a-zA-Z]");
var hasHtmlTags = (content.indexOf("<") !== -1 && htmlRegex.test(content)) || content.indexOf("<!--") !== -1;
console.log("Bot message - hasHtmlTags:", hasHtmlTags, "content length:", content.length, "msgId:", msgId);
var parsed;
@ -760,7 +761,8 @@ function addMessage(sender, content, msgId) {
lastRenderTime = now;
// Check if content has HTML
var hasHtmlTags = (currentStreamingContent.indexOf("<") !== -1 && /<[a-zA-Z]/.test(currentStreamingContent)) || currentStreamingContent.indexOf("<!--") !== -1;
var htmlRegex = new RegExp("<[a-zA-Z]");
var hasHtmlTags = (currentStreamingContent.indexOf("<") !== -1 && htmlRegex.test(currentStreamingContent)) || currentStreamingContent.indexOf("<!--") !== -1;
if (hasHtmlTags) {
// HTML Streaming: Add to temporary buffer and only render valid chunks