mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 12:21:13 +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
3 changed files with 4 additions and 5 deletions
|
@ -4,7 +4,7 @@ set -e
|
||||||
new_tag="$1"
|
new_tag="$1"
|
||||||
|
|
||||||
# Old deploy
|
# 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
|
# sudo docker push dessalines/lemmy-ui:$new_tag
|
||||||
|
|
||||||
# Upgrade version
|
# Upgrade version
|
||||||
|
|
|
@ -9,7 +9,6 @@ import IsomorphicCookie from "isomorphic-cookie";
|
||||||
import { GetSite, GetSiteResponse, LemmyHttp, Site } from "lemmy-js-client";
|
import { GetSite, GetSiteResponse, LemmyHttp, Site } from "lemmy-js-client";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import process from "process";
|
import process from "process";
|
||||||
import sanitize from "sanitize-html";
|
|
||||||
import serialize from "serialize-javascript";
|
import serialize from "serialize-javascript";
|
||||||
import sharp from "sharp";
|
import sharp from "sharp";
|
||||||
import { App } from "../shared/components/app/app";
|
import { App } from "../shared/components/app/app";
|
||||||
|
@ -348,7 +347,7 @@ async function createSsrHtml(root: string, isoData: IsoDataOptionalSite) {
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html ${helmet.htmlAttributes.toString()}>
|
<html ${helmet.htmlAttributes.toString()}>
|
||||||
<head>
|
<head>
|
||||||
<script>window.isoData = ${sanitize(JSON.stringify(isoData))}</script>
|
<script>window.isoData = ${serialize(isoData)}</script>
|
||||||
<script>window.lemmyConfig = ${serialize(config)}</script>
|
<script>window.lemmyConfig = ${serialize(config)}</script>
|
||||||
|
|
||||||
<!-- A remote debugging utility for mobile -->
|
<!-- A remote debugging utility for mobile -->
|
||||||
|
|
|
@ -207,12 +207,12 @@ export function hotRank(score: number, timeStr: string): number {
|
||||||
|
|
||||||
export function mdToHtml(text: string) {
|
export function mdToHtml(text: string) {
|
||||||
// restore '>' character to fix quotes
|
// restore '>' character to fix quotes
|
||||||
return { __html: md.render(text.split(">").join(">")) };
|
return { __html: md.render(text) };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mdToHtmlNoImages(text: string) {
|
export function mdToHtmlNoImages(text: string) {
|
||||||
// restore '>' character to fix quotes
|
// restore '>' character to fix quotes
|
||||||
return { __html: mdNoImages.render(text.split(">").join(">")) };
|
return { __html: mdNoImages.render(text) };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mdToHtmlInline(text: string) {
|
export function mdToHtmlInline(text: string) {
|
||||||
|
|
Loading…
Reference in a new issue