Skip to content

Commit

Permalink
fix: RT-286 remove redundant _self for asset link
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayesh2812 committed Aug 23, 2024
1 parent 5cdf53f commit f8c9198
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/fromRedactor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,11 @@ export const fromRedactor = (el: any, options?:IHtmlToJsonOptions) : IAnyObject
}
}
elementAttrs.attrs["redactor-attributes"] = redactor
return jsx('element', { attrs: { ...elementAttrs?.attrs, type, "asset-caption": caption, "link": link, "asset-alt": alt, target, position, "asset-link": fileLink, "asset-uid": uid, "display-type": displayType, "asset-name": fileName, "asset-type": contentType, "content-type-uid": contentTypeUid }, type: "reference", uid: generateId() }, children)
const assetAttrs = { ...elementAttrs?.attrs, type, "asset-caption": caption, "link": link, "asset-alt": alt, target, position, "asset-link": fileLink, "asset-uid": uid, "display-type": displayType, "asset-name": fileName, "asset-type": contentType, "content-type-uid": contentTypeUid }
if(assetAttrs.target === "_self"){
delete assetAttrs.target
}
return jsx('element', { attrs: assetAttrs, type: "reference", uid: generateId() }, children)
}
}
if (nodeName === 'FIGCAPTION') {
Expand Down

0 comments on commit f8c9198

Please sign in to comment.