Skip to content

Commit

Permalink
[REVERT] remove <br> correction due to bugs (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Best-Codes committed Nov 29, 2024
1 parent e28a3a4 commit 5dffb40
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/pages/index/modules/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,17 @@ export class UIManager {
messageElement.className =
"bg-gray-50 dark:bg-gray-700 rounded-lg p-4 transition-colors duration-200 mb-4 last:mb-0 max-w-full overflow-auto";

// First handle headers and other block-level elements
/* // First handle headers and other block-level elements
const preprocessed = msg.content.split('\n').map(line => {
// If line starts with #, treat it as a header
if (line.trim().startsWith('#')) {
return line;
}
// Otherwise replace newline with <br>
return line + '<br>';
}).join('\n');
}).join('\n'); */

const preprocessed = msg.content;

const renderedContent = marked.parse(preprocessed);

Expand Down

0 comments on commit 5dffb40

Please sign in to comment.