UNPKG

@ea-lab/reactive-json-docs

Version:

Complete documentation for Reactive-JSON - Components, examples and LLM-parsable guides

53 lines (47 loc) 1.96 kB
renderView: - type: Markdown content: | # PreformattedMarkup The `PreformattedMarkup` component renders HTML content with a strict allowlist of tags for safety. Use it to display rich text or HTML snippets, with filtering to prevent unwanted markup. ## Properties - type: DefinitionList content: - term: code: content after: "(string, required)" details: type: Markdown content: "The HTML string to render (can use template values)." - term: code: htmlTagAllowList after: "(array, optional)" details: List of allowed tags (overrides default). - term: code: additionalAllowedTags after: "(array, optional)" details: Tags to add to the allowlist. - type: Markdown content: | **Default allowed tags:** abbr, acronym, b, blockquote, br, caption, code, div, em, h1-h6, i, li, ol, p, span, sup, strong, table, tbody, td, tfoot, th, thead, tr, ul - type: RjBuildDescriber title: "Interactive Example: Filtered HTML rendering" description: - type: Markdown content: | Only allowed tags are rendered. Try editing the content to add disallowed tags (like `<script>`, `<u>`, or `<img>`): they will be stripped. toDescribe: renderView: - type: TextField label: "HTML Content" dataLocation: ~.html_content - type: PreformattedMarkup content: ~.html_content data: html_content: "<h2>Welcome</h2><p>This <b>component</b> only allows certain tags.<br><u>Underline</u> <img src='x' /></p>" - type: Markdown content: | ## Limitations - Only allowed tags are rendered; all others are stripped. - No support for custom attributes or inline styles. - No script, style, or event attributes are executed. - Not suitable for rendering untrusted HTML with complex requirements.