Fix token counter chunk sanitation

This commit is contained in:
Cohee 2024-03-21 20:18:02 +02:00
parent 0678777460
commit b0fbe9434d
1 changed files with 3 additions and 1 deletions

View File

@ -101,7 +101,9 @@ function drawChunks(chunks, ids) {
} }
const color = pastelRainbow[i % pastelRainbow.length]; const color = pastelRainbow[i % pastelRainbow.length];
const chunkHtml = $(`<code style="background-color: ${color};">${chunk}</code>`); const chunkHtml = $('<code></code>');
chunkHtml.css('background-color', color);
chunkHtml.text(chunk);
chunkHtml.attr('title', ids[i]); chunkHtml.attr('title', ids[i]);
$('#tokenized_chunks_display').append(chunkHtml); $('#tokenized_chunks_display').append(chunkHtml);
} }