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";
favIconUrl,
initializeSite,
isAuthPath,
- md,
} from "../shared/utils";
const server = express();
<!DOCTYPE html>
<html ${helmet.htmlAttributes.toString()} lang="en">
<head>
- <script>window.isoData = ${md.utils.escapeHtml(
- JSON.stringify(isoData)
- )}</script>
+ <script>window.isoData = ${sanitize(JSON.stringify(isoData))}</script>
<script>window.lemmyConfig = ${serialize(config)}</script>
<!-- A remote debugging utility for mobile -->
}
export function mdToHtml(text: string) {
- return { __html: md.render(text) };
+ // restore '>' character to fix quotes
+ return { __html: md.render(text.split(">").join(">")) };
}
export function mdToHtmlNoImages(text: string) {
- return { __html: mdNoImages.render(text) };
+ // restore '>' character to fix quotes
+ return { __html: mdNoImages.render(text.split(">").join(">")) };
}
export function mdToHtmlInline(text: string) {