mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-06 12:57:44 +00:00
Apply suggestions from code review
Co-authored-by: James Fenn <me@jfenn.me>
This commit is contained in:
@@ -83,7 +83,8 @@ function rehypeMakeFixTwoSlashXHTML() {
|
||||
};
|
||||
}
|
||||
|
||||
const remarkTwoslash = (remarkTwoslashDefault as never as {default: typeof remarkTwoslashDefault}).default ? (remarkTwoslashDefault as never as {default: typeof remarkTwoslashDefault}).default : remarkTwoslashDefault;
|
||||
// https://github.com/shikijs/twoslash/issues/147
|
||||
const remarkTwoslash = (remarkTwoslashDefault as never as {default: typeof remarkTwoslashDefault}).default ?? remarkTwoslashDefault;
|
||||
|
||||
async function generateEpubHTML(slug: string, content: string) {
|
||||
const unifiedChain = unified()
|
||||
|
||||
@@ -14,15 +14,11 @@ import { findAllAfter } from "unist-util-find-all-after";
|
||||
import rehypeStringify from "rehype-stringify";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
// https://github.com/shikijs/twoslash/issues/147
|
||||
const remarkTwoslash = (
|
||||
remarkTwoslashDefault as never as { default: typeof remarkTwoslashDefault }
|
||||
).default
|
||||
? (
|
||||
remarkTwoslashDefault as never as {
|
||||
default: typeof remarkTwoslashDefault;
|
||||
}
|
||||
).default
|
||||
: remarkTwoslashDefault;
|
||||
?? remarkTwoslashDefault;
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user