-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Description
I already fixed it the [rich-text-html-renderer] was missing embedded Asset, I am going to create a pull request:
the code with the bug is below.
const defaultNodeRenderers: RenderNode = {
[BLOCKS.PARAGRAPH]: (node, next) => `<p>${next(node.content)}</p>`,
[BLOCKS.HEADING_1]: (node, next) => `<h1>${next(node.content)}</h1>`,
[BLOCKS.HEADING_2]: (node, next) => `<h2>${next(node.content)}</h2>`,
[BLOCKS.HEADING_3]: (node, next) => `<h3>${next(node.content)}</h3>`,
[BLOCKS.HEADING_4]: (node, next) => `<h4>${next(node.content)}</h4>`,
[BLOCKS.HEADING_5]: (node, next) => `<h5>${next(node.content)}</h5>`,
[BLOCKS.HEADING_6]: (node, next) => `<h6>${next(node.content)}</h6>`,
[BLOCKS.EMBEDDED_ENTRY]: (node, next) => `<div>${next(node.content)}</div>`,
[BLOCKS.EMBEDDED_RESOURCE]: (node, next) => `<div>${next(node.content)}</div>`,
----> missing EMBEDDED_ASSET
[BLOCKS.UL_LIST]: (node, next) => `<ul>${next(node.content)}</ul>`,
[BLOCKS.OL_LIST]: (node, next) => `<ol>${next(node.content)}</ol>`,
[BLOCKS.LIST_ITEM]: (node, next) => `<li>${next(node.content)}</li>`,
[BLOCKS.QUOTE]: (node, next) => `<blockquote>${next(node.content)}</blockquote>`,
[BLOCKS.HR]: () => '<hr/>',
[BLOCKS.TABLE]: (node, next) => `<table>${next(node.content)}</table>`,
[BLOCKS.TABLE_ROW]: (node, next) => `<tr>${next(node.content)}</tr>`,
[BLOCKS.TABLE_HEADER_CELL]: (node, next) => `<th>${next(node.content)}</th>`,
[BLOCKS.TABLE_CELL]: (node, next) => `<td>${next(node.content)}</td>`,
[INLINES.ASSET_HYPERLINK]: (node) => defaultInline(INLINES.ASSET_HYPERLINK, node as Inline),
[INLINES.ENTRY_HYPERLINK]: (node) => defaultInline(INLINES.ENTRY_HYPERLINK, node as Inline),
[INLINES.RESOURCE_HYPERLINK]: (node) =>
defaultInlineResource(INLINES.RESOURCE_HYPERLINK, node as Inline),
[INLINES.EMBEDDED_ENTRY]: (node) => defaultInline(INLINES.EMBEDDED_ENTRY, node as Inline),
[INLINES.EMBEDDED_RESOURCE]: (node) =>
defaultInlineResource(INLINES.EMBEDDED_RESOURCE, node as Inline),
[INLINES.HYPERLINK]: (node, next) => {
const href = typeof node.data.uri === 'string' ? node.data.uri : '';
return `<a href=${attributeValue(href)}>${next(node.content)}</a>`;
},
};
Metadata
Metadata
Assignees
Labels
No labels