mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 15:39:25 +00:00
Another try at sanitize. (#1208)
* Sanitize again. * Adding sanitize json function. * Using serialize instead.
This commit is contained in:
parent
de230a5e2f
commit
a605c72859
|
@ -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
|
||||
|
|
|
@ -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) {
|
|||
<!DOCTYPE html>
|
||||
<html ${helmet.htmlAttributes.toString()}>
|
||||
<head>
|
||||
<script>window.isoData = ${sanitize(JSON.stringify(isoData))}</script>
|
||||
<script>window.isoData = ${serialize(isoData)}</script>
|
||||
<script>window.lemmyConfig = ${serialize(config)}</script>
|
||||
|
||||
<!-- A remote debugging utility for mobile -->
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue