Skip to content

Commit

Permalink
refactor: webui render error (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden authored Aug 19, 2024
1 parent 7eefb96 commit c0eae1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion assets/arena.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@

.chat-message-content .error {
color: red;
background: none;
}

.chat-message-content .message-text {
Expand Down Expand Up @@ -1028,7 +1029,7 @@
}

function renderMarkdown(text, error = '') {
return marked.marked(text) + (error ? `<p class="error">${error}</p>` : '');
return marked.marked(text) + (error ? `<pre class="error">${error}</pre>` : '');
}

function calculateOffsets(pieces) {
Expand Down
3 changes: 2 additions & 1 deletion assets/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@

.chat-message-content .error {
color: red;
background: none;
}

.chat-message-content .message-text {
Expand Down Expand Up @@ -1251,7 +1252,7 @@
}

function renderMarkdown(text, error = '') {
return marked.marked(text) + (error ? `<p class="error">${error}</p>` : '');
return marked.marked(text) + (error ? `<pre class="error">${error}</pre>` : '');
}
</script>
</body>
Expand Down

0 comments on commit c0eae1c

Please sign in to comment.