Merge branch 'feat/html-cleaner' into chore/all-my-stuffs

# Conflicts:
#	package.json
#	pnpm-lock.yaml
#	src/tools/index.ts
This commit is contained in:
ShareVB committed 2024-11-03 22:48:03 +01:00
commit 8fed1bb6d3
5 files changed
+129 -2

No files matched your search

+2
View File
@@ -100,6 +100,7 @@
"@types/markdown-it": "^13.0.7",
"@types/figlet": "^1.5.8",
"@types/sshpk": "^1.17.4",
"@types/js-beautify": "^1.14.3",
"@vicons/material": "^0.12.0",
"@vicons/tabler": "^0.12.0",
"@vueuse/core": "^10.11.1",
@@ -192,6 +193,7 @@
"js-base64": "^3.7.7",
"ical.js": "^2.0.1",
"js-base64": "^3.7.7",
"js-beautify": "^1.15.1",
"json5": "^2.2.3",
"jsonpath": "^1.1.1",
"jsonar-mod": "^1.9.0",
+59 -2
View File
@@ -95,6 +95,9 @@ dependencies:
'@types/figlet':
specifier: ^1.5.8
version: 1.5.8
'@types/js-beautify':
specifier: ^1.14.3
version: 1.14.3
'@types/jsonpath':
specifier: ^0.2.4
version: 0.2.4
@@ -350,6 +353,9 @@ dependencies:
js-base64:
specifier: ^3.7.7
version: 3.7.7
js-beautify:
specifier: ^1.15.1
version: 1.15.1
jsbarcode:
specifier: ^3.11.6
version: 3.11.6
@@ -4197,6 +4203,10 @@ packages:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.15.0
/@one-ini/wasm@0.1.1:
resolution: {integrity: sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==}
dev: false
/@parcel/watcher-android-arm64@2.4.1:
resolution: {integrity: sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==}
engines: {node: '>= 10.0.0'}
@@ -5221,6 +5231,10 @@ packages:
'@types/unist': 2.0.6
dev: false
/@types/js-beautify@1.14.3:
resolution: {integrity: sha512-FMbQHz+qd9DoGvgLHxeqqVPaNRffpIu5ZjozwV8hf9JAGpIOzuAf4wGbRSo8LNITHqGjmmVjaMggTT5P4v4IHg==}
dev: false
/@types/jsdom@21.1.0:
resolution: {integrity: sha512-leWreJOdnuIxq9Y70tBVm/bvTuh31DSlF/r4l7Cfi4uhVQqLHD0Q4v301GMisEMwwbMgF7ZKxuZ+Jbd4NcdmRw==}
dependencies:
@@ -6427,6 +6441,11 @@ packages:
resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
dev: true
/abbrev@2.0.0:
resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
dev: false
/abort-controller@3.0.0:
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
engines: {node: '>=6.5'}
@@ -7489,7 +7508,6 @@ packages:
dependencies:
ini: 1.3.8
proto-list: 1.2.4
dev: true
/consola@3.0.2:
resolution: {integrity: sha512-o/Wau2FmZKiQgyp3c3IULgN6J5yc0lwYMnoyiZdEpdGxKGBtt2ACbkulBZ6BUsHy1HlSJqoP4YOyPIJLgRJyKQ==}
@@ -8295,6 +8313,7 @@ packages:
/editorconfig@0.15.3:
resolution: {integrity: sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==}
hasBin: true
dependencies:
commander: 2.20.3
lru-cache: 4.1.5
@@ -8302,6 +8321,17 @@ packages:
sigmund: 1.0.1
dev: true
/editorconfig@1.0.4:
resolution: {integrity: sha512-L9Qe08KWTlqYMVvMcTIvMAdl1cDUubzRNYL+WfA4bLDMHe4nemKkpmYzkznE1FwLKu0EEmy6obgQKzMJrg4x9Q==}
engines: {node: '>=14'}
hasBin: true
dependencies:
'@one-ini/wasm': 0.1.1
commander: 10.0.0
minimatch: 9.0.1
semver: 7.5.4
dev: false
/ejs@3.1.9:
resolution: {integrity: sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==}
engines: {node: '>=0.10.0'}
@@ -9564,6 +9594,7 @@ packages:
/glob@8.1.0:
resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==}
engines: {node: '>=12'}
deprecated: Glob versions prior to v9 are no longer supported
dependencies:
fs.realpath: 1.0.0
inflight: 1.0.6
@@ -10661,6 +10692,7 @@ packages:
/js-beautify@1.14.6:
resolution: {integrity: sha512-GfofQY5zDp+cuHc+gsEXKPpNw2KbPddreEo35O6jT6i0RVK6LhsoYBhq5TvK4/n74wnA0QbK8gGd+jUZwTMKJw==}
engines: {node: '>=10'}
hasBin: true
dependencies:
config-chain: 1.1.13
editorconfig: 0.15.3
@@ -10668,6 +10700,23 @@ packages:
nopt: 6.0.0
dev: true
/js-beautify@1.15.1:
resolution: {integrity: sha512-ESjNzSlt/sWE8sciZH8kBF8BPlwXPwhR6pWKAw8bw4Bwj+iZcnKW6ONWUutJ7eObuBZQpiIb8S7OYspWrKt7rA==}
engines: {node: '>=14'}
hasBin: true
dependencies:
config-chain: 1.1.13
editorconfig: 1.0.4
glob: 10.4.5
js-cookie: 3.0.5
nopt: 7.2.1
dev: false
/js-cookie@3.0.5:
resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==}
engines: {node: '>=14'}
dev: false
/js-sha256@0.9.0:
resolution: {integrity: sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==}
dev: false
@@ -11777,10 +11826,19 @@ packages:
/nopt@6.0.0:
resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==}
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
hasBin: true
dependencies:
abbrev: 1.1.1
dev: true
/nopt@7.2.1:
resolution: {integrity: sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
hasBin: true
dependencies:
abbrev: 2.0.0
dev: false
/normalize-package-data@2.5.0:
resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==}
dependencies:
@@ -12721,7 +12779,6 @@ packages:
/proto-list@1.2.4:
resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==}
dev: true
/protobufjs@7.4.0:
resolution: {integrity: sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==}
+54
View File
@@ -0,0 +1,54 @@
<script setup lang="ts">
import DOMPurify from 'dompurify';
import beautify from 'js-beautify';
import TextareaCopyable from '@/components/TextareaCopyable.vue';
const inputHtml = ref('');
const outputHtml = computed(() => {
const cleanedHtml = DOMPurify.sanitize(inputHtml.value ?? '',
{
ALLOWED_ATTR: [
'href', 'src',
'width', 'height',
'alt',
'colspan', 'rowspan',
],
FORBID_TAGS: ['form', 'span'],
ALLOW_DATA_ATTR: false,
ALLOW_ARIA_ATTR: false,
RETURN_DOM: true,
}).outerHTML;
return beautify.html(cleanedHtml, {
unformatted: ['code', 'pre', 'em', 'strong', 'span'],
indent_inner_html: true,
indent_char: ' ',
indent_size: 2,
eol: '\n',
});
});
</script>
<template>
<div>
<c-input-text
v-model:value="inputHtml"
multiline raw-text
placeholder="Your HTML content..."
rows="8"
autofocus
label="Your HTML to clean (can paste from clipboard):"
paste-html
/>
<n-divider />
<n-form-item label="Output cleaned HTML:">
<TextareaCopyable
:value="outputHtml"
multiline
language="html"
:word-wrap="true"
/>
</n-form-item>
</div>
</template>
+12
View File
@@ -0,0 +1,12 @@
import { BrandHtml5 } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Html cleaner',
path: '/html-cleaner',
description: 'Clean HTML',
keywords: ['html', 'cleaner'],
component: () => import('./html-cleaner.vue'),
icon: BrandHtml5,
createdAt: new Date('2024-02-25'),
});
+2
View File
@@ -114,6 +114,7 @@ import { tool as dockerComposeValidator } from './docker-compose-validator';
import { tool as ecdsaKeyPairGenerator } from './ecdsa-key-pair-generator';
import { tool as ed25519KeyPairGenerator } from './ed25519-key-pair-generator';
import { tool as fileType } from './file-type';
import { tool as htmlCleaner } from './html-cleaner';
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
import { tool as numeronymGenerator } from './numeronym-generator';
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -292,6 +293,7 @@ export const toolsByCategory: ToolCategory[] = [
xmlToJson,
jsonToXml,
gzipConverter,
htmlCleaner,
],
},
{