@@ -5,10 +5,14 @@ import { findEmbeddedItems, findRenderString } from './helper/find-embeded-objec
55import { EntryEmbedable } from './Models/embedded-object' ;
66import { findRenderContent } from './helper/find-render-content' ;
77/**
8- *
9- * @param {EntryEmbedable| EntryEmbedable[] } entry - Objects that contains RTE with embedded objects
10- * @param {string[] } paths - Key paths for RTE contents in Entry object
11- * @param {RenderOption? } renderOption - Optional render options to render content
8+ * Renders RTE (Rich Text Editor) content with embedded objects in-place.
9+ * Mutates the entry/entries by replacing embedded item tags with HTML produced
10+ * by the provided render options. Works with a single entry or an array of entries.
11+ *
12+ * @param option - Configuration for rendering.
13+ * @param option.entry - Entry or array of entries containing RTE fields with embedded objects.
14+ * @param option.renderOption - Optional render options (node/item handlers) to produce HTML for embedded content.
15+ * @param option.paths - Optional key paths to specific RTE fields. If omitted, all RTE paths on the entry are rendered.
1216 */
1317export function render ( option : {
1418 entry : EntryEmbedable | EntryEmbedable [ ] ,
@@ -46,10 +50,13 @@ export function render(option: {
4650}
4751
4852/**
49- *
50- * @param {string | string[] } content - RTE content to render
51- * @param {EntryEmbedable } options.entry - Entry object containing embedded objects
52- * @param {RenderOption? } options.renderOption - Optional render options to render content
53+ * Renders a single RTE content string or array of strings by replacing embedded
54+ * item tags with HTML. Uses the entry and renderOption from the given option to
55+ * resolve embedded references and produce output.
56+ *
57+ * @param content - RTE content string or array of strings containing embedded item tags.
58+ * @param option - Must include the entry (for resolving embedded items) and optionally renderOption.
59+ * @returns The same shape as content: a string or array of strings with embedded tags replaced by rendered HTML.
5360 */
5461export function renderContent ( content : ( string | string [ ] ) , option : Option ) : ( string | string [ ] ) {
5562 // return blank if content not present
0 commit comments