mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
[backport cloud/1.42] feat: expose renderMarkdownToHtml on ExtensionManager (#10720)
Backport of #10700 to `cloud/1.42` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10720-backport-cloud-1-42-feat-expose-renderMarkdownToHtml-on-ExtensionManager-3326d73d3650819189fde93d1fe2584b) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne <cbyrne@comfy.org>
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user