Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ultrahtml

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ultrahtml - npm Package Versions

134

1.0.2

Diff

Changelog

Source

1.0.2

Patch Changes

  • c7a1ef6: Fix edge case with <script> parsing
natemoo-re
published 1.0.1 •

Changelog

Source

1.0.1

Patch Changes

  • b136e51: Fix unhandled edge case with sanitize transformer
  • dce0b68: Fix style and script elements having their contents parsed as HTML
natemoo-re
published 1.0.0 •

Changelog

Source

1.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 individual ultrahtml/transformers that can be applied modularly.

    In ultrahtml@0.x, transform accepted an options object with sanitize and components. 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 ultrahtml@1.x, transform accepts an array of transformers to apply. The sanitize and components options can be handled with the built-in transformers named sanitize and swap.

    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 with h and Fragment functions for JSX, as well as a jsx-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

  • 4699020: Update JSX runtime child handling
  • da119c1: Fix transformer definitions
  • d29a0e2: Add resolveAsset option to the inline transformer
  • 401b13a: Fix JSX runtime types
  • 44a771e: Update list of void HTML tags
natemoo-re
published 1.0.0-next.4 •

Changelog

Source

1.0.0-next.4

Patch Changes

  • d29a0e2: Add resolveAsset option to the inline transformer
natemoo-re
published 1.0.0-next.3 •

Changelog

Source

1.0.0-next.3

Patch Changes

  • 4699020: Update JSX runtime child handling
natemoo-re
published 1.0.0-next.2 •

Changelog

Source

1.0.0-next.2

Patch Changes

  • 401b13a: Fix JSX runtime types
natemoo-re
published 1.0.0-next.1 •

Changelog

Source

1.0.0-next.1

Patch Changes

  • da119c1: Fix transformer definitions
natemoo-re
published 1.0.0-next.0 •

Changelog

Source

1.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 individual ultrahtml/transformers that can be applied modularly.

    In ultrahtml@0.x, transform accepted an options object with sanitize and components. 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 ultrahtml@1.x, transform accepts an array of transformers to apply. The sanitize and components options can be handled with the built-in transformers named sanitize and swap.

    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 with h and Fragment functions for JSX, as well as a jsx-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.

natemoo-re
published 0.4.0 •

Changelog

Source

0.4.0

Minor Changes

  • 83c2e35: Improve declarations for node types
natemoo-re
published 0.3.3 •

Changelog

Source

0.3.3

Patch Changes

  • 3b8fb6e: Remove bundledDependencies field
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc