Skip to content

fix: use url-parse for url construction #15670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Nov 27, 2024
Prev Previous commit
pr comments
  • Loading branch information
sreya committed Nov 27, 2024
commit 045dc7d15b9f92b56423008c9fb59a1fa66f4026
8 changes: 2 additions & 6 deletions offlinedocs/pages/[[...slug]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
} from "@chakra-ui/react";
import fm from "front-matter";
import { readFileSync } from "fs";
import _, { min } from "lodash";
import _ from "lodash";
import { GetStaticPaths, GetStaticProps, NextPage } from "next";
import Head from "next/head";
import NextLink from "next/link";
Expand Down Expand Up @@ -195,10 +195,6 @@ const getNavigation = (manifest: Manifest): Nav => {
return navigation;
};

const removeHtmlComments = (string: string) => {
return sanitizeHtml(string);
};

export const getStaticPaths: GetStaticPaths = () => {
const manifest = getManifest();
const routes = mapRoutes(manifest);
Expand All @@ -222,7 +218,7 @@ export const getStaticProps: GetStaticProps = (context) => {
const route = routes[urlPath];
const { body } = fm(readContentFile(route.path));
// Serialize MDX to support custom components
const content = removeHtmlComments(body);
const content = sanitizeHtml(body);
const navigation = getNavigation(manifest);
const version = manifest.versions[0];

Expand Down
Loading