Skip to content

Commit

Permalink
feat: remove useless HTML decoding
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Hivert <[email protected]>
  • Loading branch information
ghivert committed May 18, 2024
1 parent 02b5b15 commit 5f593e8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
1 change: 0 additions & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 0 additions & 2 deletions apps/frontend/src/markdown.ffi.mjs
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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
Expand Down
24 changes: 0 additions & 24 deletions apps/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 5f593e8

Please sign in to comment.