File tree Expand file tree Collapse file tree
src/lib/components/chat/Messages Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 copyToClipboard ,
1111 initMermaid ,
1212 renderMermaidDiagram ,
13- renderVegaVisualization
13+ renderVegaVisualization ,
14+ unescapeHtml
1415 } from ' $lib/utils' ;
1516
1617 import ' highlight.js/styles/github-dark.min.css' ;
405406
406407 const onAttributesUpdate = () => {
407408 if (attributes ?.output ) {
408- // Create a helper function to unescape HTML entities
409- const unescapeHtml = (html ) => {
410- const textArea = document .createElement (' textarea' );
411- textArea .innerHTML = html ;
412- return textArea .value ;
413- };
414-
415409 try {
416- // Unescape the HTML-encoded string
417- const unescapedOutput = unescapeHtml (attributes .output );
418-
419- // Parse the unescaped string into JSON
420- const output = JSON .parse (unescapedOutput );
421-
422- // Assign the parsed values to variables
410+ const output = JSON .parse (unescapeHtml (attributes .output ));
423411 stdout = output .stdout ;
424412 stderr = output .stderr ;
425413 result = output .result ;
You can’t perform that action at this time.
0 commit comments