fix: agent notes default to markdown, add convert-to-rich-text option
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 45s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 45s
- Agent-created notes are now type 'markdown' by default (raw markdown content) - Switching note type from markdown → richtext auto-converts content to HTML via /api/ai/convert-markdown endpoint using the existing markdownToHtml utility - Users can freely switch between markdown and richtext in the note type selector Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,13 +43,12 @@ async function createAgentNote(data: {
|
||||
notebookId: string | null
|
||||
autoGenerated?: boolean
|
||||
}) {
|
||||
const htmlContent = markdownToHtml(data.content)
|
||||
return prisma.note.create({
|
||||
data: {
|
||||
title: data.title,
|
||||
content: htmlContent,
|
||||
type: 'richtext',
|
||||
isMarkdown: false,
|
||||
content: data.content,
|
||||
type: 'markdown',
|
||||
isMarkdown: true,
|
||||
autoGenerated: data.autoGenerated ?? true,
|
||||
userId: data.userId,
|
||||
notebookId: data.notebookId,
|
||||
|
||||
@@ -51,13 +51,12 @@ toolRegistry.register({
|
||||
}),
|
||||
execute: async ({ title, content, notebookId, images }) => {
|
||||
try {
|
||||
const htmlContent = markdownToHtml(content)
|
||||
const note = await prisma.note.create({
|
||||
data: {
|
||||
title,
|
||||
content: htmlContent,
|
||||
type: 'richtext',
|
||||
isMarkdown: false,
|
||||
content,
|
||||
type: 'markdown',
|
||||
isMarkdown: true,
|
||||
autoGenerated: true,
|
||||
userId: ctx.userId,
|
||||
notebookId: notebookId || null,
|
||||
|
||||
Reference in New Issue
Block a user