fix(SW-1035): Fixed issue when is returned from CS inside RTE

This commit is contained in:
Erik Tiekstra
2024-11-29 11:17:46 +01:00
committed by Matilda Landström
parent ed1574838a
commit ba7cd0798a
2 changed files with 24 additions and 0 deletions

View File

@@ -309,6 +309,29 @@ export const renderOptions: RenderOptions = {
)
},
[RTETypeEnum.span]: (
node: RTEDefaultNode,
embeds: EmbedByUid,
next: RTENext,
fullRenderOptions: RenderOptions
) => {
let props = extractPossibleAttributes(node.attrs)
const className = props.className
if (className) {
if (hasAvailableULFormat(className)) {
// @ts-ignore: We want to set css modules classNames even if it does not correspond
// to an existing class in the module style sheet. Due to our css modules plugin for
// typescript, we cannot do this without the ts-ignore
props.className = styles[className]
}
}
return (
<span {...props}>{next(node.children, embeds, fullRenderOptions)}</span>
)
},
[RTETypeEnum.reference]: (
node: RTENode,
embeds: EmbedByUid,

View File

@@ -27,6 +27,7 @@ export enum RTETypeEnum {
ol = "ol",
p = "p",
reference = "reference",
span = "span",
table = "table",
tbody = "tbody",
td = "td",