-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite v-sanitize into vue3/nuxt3 #284
base: main
Are you sure you want to change the base?
Conversation
Yes, it's nice, let go ahead try that to see if it works fine, we can release it for vue 3 and nuxt 3. |
But the another plugin already exist here: https://github.com/LeSuisse/vue-dompurify-html, so better avoid creating the same thing. |
@chantouchsek I use the package you linked as a replacement for v-sanitize, 'till I update the implementation :D. The problem with thatone is, that it only implements a directive, there is no sanitize function passed to the context as well as no native nuxt implementation. |
Ok, great 👍 |
…easily tested during development
…from the directive
@chantouchsek heya! Please could you look into my tsconfig and sanitize.ts file? I am pretty new to TS and I don't know where in the documentation to look for stuff like extending vue or nuxt types so they include $sanitize and stuff like that, so I don't know where to add that in the nuxt3/vue3 version. I added some basic tests for now and an example environment, where you can run the package in dev mode so you can test it properly without the need of another vue app. Could you please checkut my version and maybe throw a PR with proper TS settings? After that I'd love to finish writing more tests and giving you the code for PR. Thanks. // Edit: I'll make sure to make a better example in the future :D now it's just for testing while I update the package. |
@truesteps what editor/IDE are you using, that seem, you made to lots of files that doesn't related, can you check and revert all of the at first, then i will look up into it again. thanks. |
@chantouchsek I'm using phpstorm, I added a .editorconfig and reformated the entire project, feel free to modify the .editorconfig to your liking and I'll reformat it again :) |
The idea behind that came from the fact, that usually no 2 developers have the same formatting setup, so I added it to ensure all code will look the same in the future |
@truesteps no don't use |
@chantouchsek anyway, if you want me to rewert the formatting changes, I'll do that :) |
No, I don't accept that format. |
what format do you wish to use? Please define it so I can implement it. Thanks |
Thanks, the current format is fine. |
Closed: #265
Hey!
I started working on the rewrite, couldn't test the directive yet, but the $sanitize function should already work. I ran into issues running
sanitize-html
under Vite. A possible solution would be to replacesanitize-html
withdompurify
.Are you open to that idea, should I prototype up a rewrite with
dompurify
? You can check it our here https://github.com/cure53/DOMPurifyToDo