From: Dessalines Date: Mon, 12 Jun 2023 20:17:57 +0000 (-0400) Subject: Another try at sanitize. (#1208) X-Git-Url: http://these/git/%24%7B%60data:application/static/%7B%60https:/%7Brss%7D?a=commitdiff_plain;h=a605c728597190879c0730896a0c584050b89188;p=lemmy-ui.git Another try at sanitize. (#1208) * Sanitize again. * Adding sanitize json function. * Using serialize instead. --- diff --git a/deploy.sh b/deploy.sh index ce125fc..c53988d 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,7 +4,7 @@ set -e new_tag="$1" # Old deploy -# sudo docker build . --tag dessalines/lemmy-ui:$new_tag +# sudo docker build . --tag dessalines/lemmy-ui:$new_tag --platform=linux/amd64 # sudo docker push dessalines/lemmy-ui:$new_tag # Upgrade version diff --git a/src/server/index.tsx b/src/server/index.tsx index b7f4fb5..8d9bb25 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -9,7 +9,6 @@ import IsomorphicCookie from "isomorphic-cookie"; import { GetSite, GetSiteResponse, LemmyHttp, Site } from "lemmy-js-client"; import path from "path"; import process from "process"; -import sanitize from "sanitize-html"; import serialize from "serialize-javascript"; import sharp from "sharp"; import { App } from "../shared/components/app/app"; @@ -348,7 +347,7 @@ async function createSsrHtml(root: string, isoData: IsoDataOptionalSite) { - + diff --git a/src/shared/utils.ts b/src/shared/utils.ts index f98fa56..c7a5da0 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -207,12 +207,12 @@ export function hotRank(score: number, timeStr: string): number { export function mdToHtml(text: string) { // restore '>' character to fix quotes - return { __html: md.render(text.split(">").join(">")) }; + return { __html: md.render(text) }; } export function mdToHtmlNoImages(text: string) { // restore '>' character to fix quotes - return { __html: mdNoImages.render(text.split(">").join(">")) }; + return { __html: mdNoImages.render(text) }; } export function mdToHtmlInline(text: string) {