raw-html

command
v4.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 2 Imported by: 0

README

Raw HTML Nodes

Renders rich markup and a trusted inline SVG by parsing them into real DOM nodes — never via innerHTML. The framework keeps a single, safe path to the DOM.

What it shows

  • html.RawHTML(markup) — parses an HTML fragment, sanitizes it (the <b> survives, an embedded <script> is stripped), and returns real element nodes.
  • html.RawHTMLUnsafe(markup) — for trusted content (an inline <svg>), parsed into real nodes in the correct namespace, still without touching innerHTML.
  • Mixing parsed nodes into a normal component tree alongside hand-authored elements.

Run

gwc dev examples/public/raw-html

Inspect the DOM: the sanitized fragment has no <script>, and the SVG is real, namespaced nodes.

Documentation

Rendered for js/wasm

Overview

Command raw-html is the e2e fixture for the G3 markup nodes (html.RawHTML / RawHTMLUnsafe): it renders sanitized rich text and a trusted inline SVG, each parsed into real nodes (never innerHTML).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL