feat(new tool): HTML Minifier

Fix #1605
This commit is contained in:
ShareVB committed 2025-07-06 13:00:20 +02:00
1 parent 5e3648e141
commit 9f5f7d80de
2 files changed
+52

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
<script setup lang="ts">
import { minify } from 'htmlfy';
import TextareaCopyable from '@/components/TextareaCopyable.vue';
const inputHtml = ref('');
const outputHtml = computed(() => {
try {
return minify(inputHtml.value);
}
catch (e: any) {
return e.toString();
}
});
</script>
<template>
<div>
<c-input-text
v-model:value="inputHtml"
multiline raw-text
placeholder="Your HTML content..."
rows="8"
autofocus
label="Your HTML to minify (can paste from clipboard):"
paste-html
/>
<n-divider />
<n-form-item label="Output minified HTML:">
<TextareaCopyable
:value="outputHtml"
multiline
language="html"
:word-wrap="true"
/>
</n-form-item>
</div>
</template>
+13
View File
@@ -0,0 +1,13 @@
import { BrandHtml5 } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'HTML Minifier',
path: '/html-minifier',
description: 'Minify HTML content',
keywords: ['html', 'minifier'],
component: () => import('./html-minifier.vue'),
icon: BrandHtml5,
createdAt: new Date('2025-07-06'),
category: 'Web',
});