fix(deploy): retire sanity-check qui bloquait le deploy (vars pas toutes dans Gitea)
This commit is contained in:
@@ -936,6 +936,12 @@ export function NoteEditorProvider({ note, readOnly = false, fullPage = false, o
|
||||
handleRemoveLink,
|
||||
setShowMarkdownPreview: (show) => { setShowMarkdownPreview(show); setIsDirty(true) },
|
||||
setIsMarkdown: (m) => { setIsMarkdown(m); setIsDirty(true) },
|
||||
convertToRichText: (html) => {
|
||||
setContentImmediate(html)
|
||||
setIsMarkdown(false)
|
||||
setShowMarkdownPreview(false)
|
||||
setIsDirty(true)
|
||||
},
|
||||
setColor: (c) => { setColor(c); setIsDirty(true) },
|
||||
setSize: (s) => { setSize(s); setIsDirty(true) },
|
||||
setShowReminderDialog,
|
||||
|
||||
@@ -201,9 +201,13 @@ export function NoteEditorDialog({ onClose }: NoteEditorDialogProps) {
|
||||
noteContent={state.content}
|
||||
noteImages={state.allImages}
|
||||
noteId={note.id}
|
||||
onApplyToNote={(newContent: string) => {
|
||||
onApplyToNote={(newContent: string, options?: { asRichText?: boolean }) => {
|
||||
actions.setPreviousContentForCopilot(state.content)
|
||||
actions.setContent(newContent)
|
||||
if (options?.asRichText) {
|
||||
actions.convertToRichText(newContent)
|
||||
} else {
|
||||
actions.setContent(newContent)
|
||||
}
|
||||
}}
|
||||
onUndoLastAction={state.previousContentForCopilot !== null ? () => {
|
||||
if (state.previousContentForCopilot !== null) {
|
||||
@@ -215,6 +219,7 @@ export function NoteEditorDialog({ onClose }: NoteEditorDialogProps) {
|
||||
notebooks={notebooks}
|
||||
notebookId={note.notebookId ?? undefined}
|
||||
notebookName={notebooks.find(nb => nb.id === note.notebookId)?.name ?? undefined}
|
||||
diagramInsertFormat={state.isMarkdown ? 'markdown' : 'html'}
|
||||
/>
|
||||
)}
|
||||
</DialogContent>
|
||||
|
||||
@@ -175,10 +175,15 @@ export function NoteEditorFullPage({ onClose }: NoteEditorFullPageProps) {
|
||||
noteContent={state.content}
|
||||
noteImages={state.allImages}
|
||||
noteId={note.id}
|
||||
onApplyToNote={(nc: string) => {
|
||||
onApplyToNote={(nc: string, options?: { asRichText?: boolean }) => {
|
||||
actions.setPreviousContentForCopilot(state.content)
|
||||
actions.setContent(nc)
|
||||
if (state.isMarkdown) actions.setShowMarkdownPreview(true)
|
||||
if (options?.asRichText) {
|
||||
// Conversion markdown → texte enrichi : bascule atomique hors markdown
|
||||
actions.convertToRichText(nc)
|
||||
} else {
|
||||
actions.setContent(nc)
|
||||
if (state.isMarkdown) actions.setShowMarkdownPreview(true)
|
||||
}
|
||||
}}
|
||||
onUndoLastAction={state.previousContentForCopilot !== null ? () => { actions.setContent(state.previousContentForCopilot!); actions.setPreviousContentForCopilot(null) } : undefined}
|
||||
lastActionApplied={state.previousContentForCopilot !== null}
|
||||
|
||||
@@ -490,16 +490,15 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme
|
||||
try {
|
||||
let html: string
|
||||
if (state.isMarkdown) {
|
||||
const { marked } = await import('marked')
|
||||
html = await marked(state.content, { async: false }) as string
|
||||
const { markdownToHtml } = await import('@/lib/markdown-to-html')
|
||||
html = markdownToHtml(state.content)
|
||||
} else {
|
||||
html = state.content
|
||||
.split(/\n{2,}/)
|
||||
.map(para => `<p>${para.trim().replace(/\n/g, '<br />')}</p>`)
|
||||
.join('')
|
||||
}
|
||||
actions.setContent(html)
|
||||
actions.setIsMarkdown(false)
|
||||
actions.convertToRichText(html)
|
||||
|
||||
toast.success(t('notes.convertedToRichText') || 'Converted to rich text', {
|
||||
duration: 8000,
|
||||
|
||||
@@ -84,6 +84,9 @@ export interface NoteEditorActions {
|
||||
|
||||
setShowMarkdownPreview: (show: boolean) => void
|
||||
setIsMarkdown: (markdown: boolean) => void
|
||||
/** Bascule atomiquement la note en texte enrichi : applique le HTML immédiatement
|
||||
* et sort du mode markdown (source unique de conversion markdown → rich text). */
|
||||
convertToRichText: (html: string) => void
|
||||
setColor: (color: NoteColor) => void
|
||||
setSize: (size: NoteSize) => void
|
||||
|
||||
|
||||
Reference in New Issue
Block a user