fix: add imageContainer reference in rte

This commit is contained in:
Christel Westerberg
2024-07-04 10:33:49 +02:00
parent 55a71f001f
commit 6184662caa
14 changed files with 252 additions and 25 deletions
+5 -2
View File
@@ -3,7 +3,7 @@ import { renderOptions } from "./renderOptions"
import type { EmbedByUid } from "@/types/components/jsontohtml"
import type { Embeds } from "@/types/requests/embeds"
import type { Node } from "@/types/requests/utils/edges"
import { RTETypeEnum } from "@/types/rte/enums"
import { AvailableFormatEnum, RTETypeEnum } from "@/types/rte/enums"
import type {
RTENode,
RTERenderOptionComponent,
@@ -74,7 +74,6 @@ export function textNodeToHtml(
if (node.bold) {
text = (fullRenderOptions[RTEMarkType.bold] as RTERenderMark)(text)
}
return text
}
@@ -86,6 +85,10 @@ function next(
return nodeChildrenToHtml(nodes, embeds, fullRenderOptions)
}
export function hasAvailableFormat(className?: string) {
return className && Object.keys(AvailableFormatEnum).includes(className)
}
export function nodeToHtml(
node: RTENode,
embeds: EmbedByUid,