Releases: natemoo-re/ultrahtml
v1.0.2
v1.0.1
v1.0.0
Major Changes
-
95c0f73:
ultrahtml
is a complete markup toolkit with a tiny footprint. Parse, transform, and render HTML on the server, in the browser, with or without a build step.Breaking Changes
The signature of
transform
has been updated. Rather than applying sanitization and component swapping by default, these have been split out to individualultrahtml/transformers
that can be applied modularly.In
[email protected]
,transform
accepted an options object withsanitize
andcomponents
. Other transformations would need to be applied outside of this flow.import { transform } from "ultrahtml"; await transform(markup, { components: { h1: "h2" }, sanitize: { allowElements: ["h1", "h2", "h3"] } });
In
[email protected]
,transform
accepts an array of transformers to apply. Thesanitize
andcomponents
options can be handled with the built-in transformers namedsanitize
andswap
.import { transform } from "ultrahtml"; import swap from "ultrahtml/transformers/swap"; import sanitize from "ultrahtml/transformers/sanitize"; await transform(markup, [ swap({ h1: "h2" }), sanitize({ allowElements: ["h1", "h2", "h3"] }) ]);
New Features
JSX Runtime
ultrahtml
now comes withh
andFragment
functions for JSX, as well as ajsx-runtime
export.Tranformers
Transformers are AST transformations that can be applied to any
ultrahtml
Node. Usually these are applied to entire documents.New
inline
transformer inlines CSS from<style>
blocks directly to matching elements.New
scope
transformer scopes CSS from<style>
blocks to the elements in a given document or component.
Patch Changes
v1.0.0-next.4
Patch Changes
- d29a0e2: Add
resolveAsset
option to theinline
transformer
v1.0.0-next.3
Patch Changes
- 4699020: Update JSX runtime child handling
v1.0.0-next.2
Patch Changes
- 401b13a: Fix JSX runtime types
v1.0.0-next.1
Patch Changes
- da119c1: Fix transformer definitions
v1.0.0-next.0
Major Changes
-
95c0f73:
ultrahtml
is a complete markup toolkit with a tiny footprint. Parse, transform, and render HTML on the server, in the browser, with or without a build step.Breaking Changes
The signature of
transform
has been updated. Rather than applying sanitization and component swapping by default, these have been split out to individualultrahtml/transformers
that can be applied modularly.In
[email protected]
,transform
accepted an options object withsanitize
andcomponents
. Other transformations would need to be applied outside of this flow.import { transform } from "ultrahtml"; await transform(markup, { components: { h1: "h2" }, sanitize: { allowElements: ["h1", "h2", "h3"] } });
In
[email protected]
,transform
accepts an array of transformers to apply. Thesanitize
andcomponents
options can be handled with the built-in transformers namedsanitize
andswap
.import { transform } from "ultrahtml"; import swap from "ultrahtml/transformers/swap"; import sanitize from "ultrahtml/transformers/sanitize"; await transform(markup, [ swap({ h1: "h2" }), sanitize({ allowElements: ["h1", "h2", "h3"] }) ]);
New Features
JSX Runtime
ultrahtml
now comes withh
andFragment
functions for JSX, as well as ajsx-runtime
export.Tranformers
Transformers are AST transformations that can be applied to any
ultrahtml
Node. Usually these are applied to entire documents.New
inline
transformer inlines CSS from<style>
blocks directly to matching elements.New
scope
transformer scopes CSS from<style>
blocks to the elements in a given document or component.