fix: refactor use of tokens
This commit is contained in:
@@ -253,7 +253,7 @@ export const renderOptions: RenderOptions = {
|
||||
const type = node.attrs.type
|
||||
if (type === RTEItemTypeEnum.asset) {
|
||||
const image = embeds?.[node?.attrs?.["asset-uid"]]
|
||||
if (image.node.__typename === EmbedEnum.SysAsset) {
|
||||
if (image?.node.__typename === EmbedEnum.SysAsset) {
|
||||
const alt = image?.node?.title ?? node.attrs.alt
|
||||
const alignment = node.attrs?.style?.["text-align"]
|
||||
? {
|
||||
|
||||
@@ -14,7 +14,7 @@ import type { RenderOptions } from "@/types/rte/option"
|
||||
|
||||
export function groupEmbedsByUid(embedsArray: Node<Embeds>[]) {
|
||||
const embedsByUid = embedsArray.reduce<EmbedByUid>((acc, embed) => {
|
||||
if (embed.node.system.uid) {
|
||||
if (embed.node.system?.uid) {
|
||||
acc[embed.node.system.uid] = embed
|
||||
}
|
||||
return acc
|
||||
|
||||
Reference in New Issue
Block a user