comments translated to english
This commit is contained in:
parent
29b29026e5
commit
1ef4684bff
1 changed files with 3 additions and 3 deletions
|
|
@ -133,18 +133,18 @@ class MessagesArea extends HTMLElement {
|
||||||
|
|
||||||
flushAccumulatingMessage() {
|
flushAccumulatingMessage() {
|
||||||
if (this.accumulatingMessageEl) {
|
if (this.accumulatingMessageEl) {
|
||||||
// Raccogliere tutti i token in un testo completo
|
// Collect all tokens in a full text
|
||||||
let fullText = '';
|
let fullText = '';
|
||||||
this.accumulatingMessageEl.querySelectorAll('.token').forEach(tokenEl => {
|
this.accumulatingMessageEl.querySelectorAll('.token').forEach(tokenEl => {
|
||||||
fullText += tokenEl.textContent;
|
fullText += tokenEl.textContent;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Convertire Markdown in nodi DOM usando la libreria markdown-it
|
// Convert Markdown to DOM nodes using the markdown-it library
|
||||||
const md = window.markdownit();
|
const md = window.markdownit();
|
||||||
const html = md.render(fullText);
|
const html = md.render(fullText);
|
||||||
const tempDiv = document.createElement('div');
|
const tempDiv = document.createElement('div');
|
||||||
tempDiv.innerHTML = html;
|
tempDiv.innerHTML = html;
|
||||||
this.accumulatingMessageEl.innerHTML = ''; // Rimuovere i token esistenti
|
this.accumulatingMessageEl.innerHTML = ''; // Remove existing tokens
|
||||||
Array.from(tempDiv.childNodes).forEach(node => {
|
Array.from(tempDiv.childNodes).forEach(node => {
|
||||||
this.accumulatingMessageEl.appendChild(node);
|
this.accumulatingMessageEl.appendChild(node);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue