From 5f593e8ae5152a997c68171c75ddb223aaaa153c Mon Sep 17 00:00:00 2001 From: Guillaume Hivert Date: Sun, 19 May 2024 01:53:18 +0200 Subject: [PATCH] feat: remove useless HTML decoding Signed-off-by: Guillaume Hivert --- apps/frontend/package.json | 1 - apps/frontend/src/markdown.ffi.mjs | 2 -- apps/frontend/yarn.lock | 24 ------------------------ 3 files changed, 27 deletions(-) diff --git a/apps/frontend/package.json b/apps/frontend/package.json index 073c02d..186aebf 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -11,7 +11,6 @@ "@gleam-lang/highlight.js-gleam": "^1.5.0", "@sentry/browser": "^8.0.0", "highlight.js": "^11.9.0", - "html-encoder-decoder": "^1.3.10", "showdown": "^2.1.0" }, "devDependencies": { diff --git a/apps/frontend/src/markdown.ffi.mjs b/apps/frontend/src/markdown.ffi.mjs index 62787c3..47bc4eb 100644 --- a/apps/frontend/src/markdown.ffi.mjs +++ b/apps/frontend/src/markdown.ffi.mjs @@ -1,5 +1,4 @@ import hljs from 'highlight.js/lib/core' -import { decode as decodeHtml } from 'html-encoder-decoder' import showdown from 'showdown' export function convert(content) { @@ -21,7 +20,6 @@ export function showdownHighlight({ pre = false, auto_detection = true } = {}) { } const replacement = (wholeMatch, match, left, right) => { - match = decodeHtml(match) const lang = (left.match(/class=\"([^ \"]+)/) || [])[1] if (!lang && !auto_detection) { return wholeMatch diff --git a/apps/frontend/yarn.lock b/apps/frontend/yarn.lock index e697d31..bece112 100644 --- a/apps/frontend/yarn.lock +++ b/apps/frontend/yarn.lock @@ -1132,25 +1132,11 @@ has-flag@^3.0.0: resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== -he@^1.1.0: - version "1.2.0" - resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - highlight.js@^11.9.0: version "11.9.0" resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-11.9.0.tgz" integrity sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw== -html-encoder-decoder@^1.3.10: - version "1.3.10" - resolved "https://registry.npmjs.org/html-encoder-decoder/-/html-encoder-decoder-1.3.10.tgz" - integrity sha512-18SjgzQZ9U1mxb96rjcWgWMnTlEzNj2lU2wAU7OeUobdIWXTS6lOGc6419eLhMlX24sNQYDyQfgkSXWjyq/Ilg== - dependencies: - he "^1.1.0" - iterate-object "^1.3.2" - regex-escape "^3.4.2" - https-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz" @@ -1193,11 +1179,6 @@ isexe@^2.0.0: resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -iterate-object@^1.3.2: - version "1.3.4" - resolved "https://registry.npmjs.org/iterate-object/-/iterate-object-1.3.4.tgz" - integrity sha512-4dG1D1x/7g8PwHS9aK6QV5V94+ZvyP4+d19qDv43EzImmrndysIl4prmJ1hWWIGCqrZHyaHBm6BSEWHOLnpoNw== - jackspeak@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" @@ -1400,11 +1381,6 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -regex-escape@^3.4.2: - version "3.4.10" - resolved "https://registry.npmjs.org/regex-escape/-/regex-escape-3.4.10.tgz" - integrity sha512-qEqf7uzW+iYcKNLMDFnMkghhQBnGdivT6KqVQyKsyjSWnoFyooXVnxrw9dtv3AFLnD6VBGXxtZGAQNFGFTnCqA== - rimraf@^5.0.5: version "5.0.7" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.7.tgz#27bddf202e7d89cb2e0381656380d1734a854a74"