[backport core/1.42] feat: expose renderMarkdownToHtml on ExtensionManager (#10719)

Backport of #10700 to `core/1.42`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-10719-backport-core-1-42-feat-expose-renderMarkdownToHtml-on-ExtensionManager-3326d73d36508124bb21d6b2a5119402)
by [Unito](https://www.unito.io)

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
This commit is contained in:
Comfy Org PR Bot
2026-03-30 08:12:58 +09:00
committed by GitHub
parent 4d972a14dc
commit 9df76c5ca3
2 changed files with 11 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ import type { Settings } from '@/schemas/apiSchema'
import { useColorPaletteService } from '@/services/colorPaletteService'
import { useDialogService } from '@/services/dialogService'
import type { SidebarTabExtension, ToastManager } from '@/types/extensionTypes'
import { renderMarkdownToHtml } from '@/utils/markdownRendererUtil'
import { useApiKeyAuthStore } from './apiKeyAuthStore'
import { useCommandStore } from './commandStore'
@@ -113,7 +114,8 @@ function workspaceStoreSetup() {
registerSidebarTab,
unregisterSidebarTab,
getSidebarTabs
getSidebarTabs,
renderMarkdownToHtml
}
}

View File

@@ -117,6 +117,14 @@ export interface ExtensionManager {
// Execution error state (read-only)
lastNodeErrors: Record<NodeId, NodeError> | null
lastExecutionError: ExecutionErrorWsMessage | null
/**
* Renders a markdown string to sanitized HTML.
* Uses marked (GFM) + DOMPurify. Safe for direct use with innerHTML.
* @param markdown - The markdown string to render.
* @param baseUrl - Optional base URL for resolving relative image/media paths.
*/
renderMarkdownToHtml(markdown: string, baseUrl?: string): string
}
export interface CommandManager {