Comparing version 0.0.4 to 0.0.5
# ultrahtml | ||
## 0.0.5 | ||
### Patch Changes | ||
- 23771a3: Fix `walk` function definition | ||
## 0.0.4 | ||
@@ -4,0 +10,0 @@ |
@@ -18,3 +18,3 @@ export interface Node { | ||
}; | ||
export declare function walk(node: Node, callback: Visitor): void; | ||
export declare function walk(node: Node, callback: Visitor): Promise<void>; | ||
export interface SanitizeOptions { | ||
@@ -21,0 +21,0 @@ /** An Array of strings indicating elements that the sanitizer should not remove. All elements not in the array will be dropped. */ |
@@ -160,3 +160,3 @@ "use strict"; | ||
const child = node.children[i]; | ||
promises.push(this.callback(child, node, i)); | ||
promises.push(this.visit(child, node, i)); | ||
} | ||
@@ -221,3 +221,3 @@ await Promise.all(promises); | ||
const walker = new Walker(callback); | ||
walker.visit(node); | ||
return walker.visit(node); | ||
} | ||
@@ -224,0 +224,0 @@ function resolveSantizeOptions({ |
{ | ||
"name": "ultrahtml", | ||
"type": "module", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"types": "./dist/index.d.ts", | ||
@@ -6,0 +6,0 @@ "repository": { |
# `ultrahtml` | ||
A tiny library for enhancing `html`, inspired by [MDX](https://mdxjs.com/). | ||
A 1.75kB library for enhancing `html`. `ultrahtml` has zero dependencies and is compatible with any JavaScript runtime. | ||
### Features | ||
- Tiny, XML-friendly parser | ||
- Built-in `transform` utility for easy output manipulation | ||
- Automatic but configurable sanitization, adhering to the [HTML Sanitizer API](https://developer.mozilla.org/en-US/docs/Web/API/Sanitizer/Sanitizer) | ||
- Handy `html` template utility | ||
```js | ||
@@ -17,4 +23,2 @@ import { transform, html } from 'ultrahtml'; | ||
## TODO: docs | ||
## Acknowledgements | ||
@@ -21,0 +25,0 @@ |
17867
27