Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(llm): remove breaks handling
Elian Doran7df8d8be23ad
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsx b/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsxindex 2aa310e3a2..e108d03836 100644--- a/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsx+++ b/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsx@@ -22,8 +22,7 @@ function renderMarkdown(markdown: string): string {return renderToHtml(markdown, "", {sanitize: (h) => DOMPurify.sanitize(h),wikiLink: { formatHref: (id) => `#root/${id}` },- demoteH1: false,- breaks: true+ demoteH1: false});}diff --git a/packages/commons/src/lib/markdown_renderer.ts b/packages/commons/src/lib/markdown_renderer.tsindex e77e4595b8..51ea850ca0 100644--- a/packages/commons/src/lib/markdown_renderer.ts+++ b/packages/commons/src/lib/markdown_renderer.ts@@ -57,11 +57,6 @@ export interface RenderToHtmlOptions {* marked attaches a parser to the renderer during parsing.*/renderer?: Renderer;- /**- * If `true`, convert single newlines (`\n`) to `<br>`. Useful for chat-style- * content where LLMs use single newlines as line breaks. Default: `false`.- */- breaks?: boolean;}function escapeHtml(str: string): string {@@ -292,7 +287,7 @@ export function renderToHtml(content: string, title: string, options: RenderToHtconst { processedText, placeholderMap: formulaMap } = extractFormulas(content);- const marked = new Marked({ async: false, breaks: options.breaks ?? false, gfm: true });+ const marked = new Marked({ async: false, gfm: true });marked.use(markedFootnote());marked.use({// Order is important, especially for wikilinks.