-// {/* {title &&-// ) -// } +// @ts-ignore +renderer.code = (code: string, language: string) => { + const component = +{title}
} */} -// {/* {language && title &&{language}
} */} -//-//
+
+ )
+
+
+ return component
+}
marked.setOptions({
gfm: true,
diff --git a/client/lib/server/auth.ts b/client/lib/server/auth.ts
index e7effa1f..5dc41f81 100644
--- a/client/lib/server/auth.ts
+++ b/client/lib/server/auth.ts
@@ -1,7 +1,7 @@
import { PrismaAdapter } from "@next-auth/prisma-adapter"
import { NextAuthOptions } from "next-auth"
import GitHubProvider from "next-auth/providers/github"
-import prisma from "@lib/server/prisma"
+import { prisma } from "@lib/server/prisma"
import config from "@lib/config"
const providers: NextAuthOptions["providers"] = [
diff --git a/client/lib/server/get-html-from-drift-file.ts b/client/lib/server/get-html-from-drift-file.ts
index 5cee8216..c7eb0b5e 100644
--- a/client/lib/server/get-html-from-drift-file.ts
+++ b/client/lib/server/get-html-from-drift-file.ts
@@ -1,9 +1,9 @@
-import markdown from "../render-markdown"
import type { File } from "@lib/server/prisma"
+import markdown from "@wcj/markdown-to-html"
/**
* returns rendered HTML from a Drift file
*/
-export function getHtmlFromFile({
+export async function getHtmlFromFile({
content,
title
}: Pick- {/* {title &&- ) -} - -marked.setOptions({ - gfm: true, - breaks: true, - headerIds: true, - renderer, -}) - -const markdown = (markdown: string) => marked(markdown) - -export default markdown - -const Code = ({ code, language, highlight, title, ...props }: { - code: string, - language: string, - highlight?: string, - title?: string, -}) => { - if (!language) - return ( - <> -{title}
} */} - {/* {language && title &&{language}
} */} --
- >
- )
-
- const highlightedLines = highlight
- //@ts-ignore
- ? highlight.split(',').reduce((lines, h) => {
- if (h.includes('-')) {
- // Expand ranges like 3-5 into [3,4,5]
- const [start, end] = h.split('-').map(Number)
- const x = Array(end - start + 1)
- .fill(undefined)
- .map((_, i) => i + start)
- return [...lines, ...x]
- }
-
- return [...lines, Number(h)]
- }, [])
- : ''
-
- // https://mdxjs.com/guides/syntax-harkedighlighting#all-together
- return (
- <>
-
- {
- tokens.map((line, i) => (
-
- {
- line.map((token, key) => (
-
- ))
- }
-
- ))}
-
- )}
-