lucacasonato / ammonia-wasm Goto Github PK
View Code? Open in Web Editor NEWWASM bindings for the Ammonia HTML sanitizer
Home Page: https://deno.land/x/ammonia
License: MIT License
WASM bindings for the Ammonia HTML sanitizer
Home Page: https://deno.land/x/ammonia
License: MIT License
The current version of Ammonia that is used by this package is quite a bit behind (This is on version 3.1.0
). Please try to update to the latest version, if possible.
The setTagAttributeValues
property of the AmmoniaBuilder
class expects a value of type Map<string, Map<string, Set<string>>>
[link]. But the same property in rust-ammonia expects the type Map<string, Map<string, string>>
[link]. This leads to an error when trying to set this property on instance of the AmmoniaBuilder
class.
Changing the type of setTagAttributeValues
to Map<string, Map<string, string>>
resolves this issue. Please fix this bug. I can also raise a PR if that helps.
Please document the need to run init
better.
Readme has it in the example, but that's very easy to skip.
Especially, if like me, you were reading https://doc.deno.land/https://deno.land/x/[email protected]/mod.ts in the first place.
$ deno --version
deno 1.22.0 (release, x86_64-unknown-linux-gnu)
v8 10.0.139.17
typescript 4.6.2
$ deno eval 'import {clean} from "https://deno.land/x/[email protected]/mod.ts"; const input = "foo"; const output = clean(input); console.log({output});'
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '__wbindgen_add_to_stack_pointer')
wasm.__wbindgen_add_to_stack_pointer(16);
^
at clean (https://deno.land/x/[email protected]/pkg/ammonia_wasm.js:116:14)
at clean (https://deno.land/x/[email protected]/mod.ts:38:10)
at file:///tmp/$deno$eval.js:1:101
I had to change the last line to of the code to the following, otherwise the new settings created with AmmoniaBuilder
are not used.
cleaner.clean("foo<p>bar</p>");
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.