mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2025-12-16 20:49:23 +00:00
perf!: reduce the bundle size of /encoders-decoders/html
BREAKING CHANGE: ' -> '
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import { decode, encode } from "html-entities";
|
||||
import { escape, unescape } from "html-escaper";
|
||||
|
||||
import { toolGroups } from "@/config/tools";
|
||||
import { Textarea, TextareaProps } from "@/components/ui/textarea";
|
||||
@@ -16,20 +16,20 @@ import { PageSection } from "@/components/page-section";
|
||||
export default function Page() {
|
||||
const [form, setForm] = useState({
|
||||
decoded: '> It\'s "HTML escaping".',
|
||||
encoded: "> It's "HTML escaping".",
|
||||
encoded: "> It's "HTML escaping".",
|
||||
});
|
||||
|
||||
const setDecodedReactively = useCallback((text: string) => {
|
||||
setForm({
|
||||
decoded: text,
|
||||
encoded: encode(text),
|
||||
encoded: escape(text),
|
||||
});
|
||||
}, []);
|
||||
|
||||
const setEncodedReactively = useCallback((text: string) => {
|
||||
setForm({
|
||||
encoded: text,
|
||||
decoded: decode(text),
|
||||
decoded: unescape(text),
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user