fix: null reference introduced in ab8c9e5 (#667)

* fix: null reference introduced in ab8c9e5988

* update

Signed-off-by: Innei <i@innei.in>

* fix: code block change theme flash

Signed-off-by: Innei <i@innei.in>

---------

Signed-off-by: Innei <i@innei.in>
Co-authored-by: Innei <i@innei.in>
This commit is contained in:
Cesaryuan
2024-09-27 17:08:32 +08:00
committed by GitHub
co-authored by Innei
parent ccda8875e9
commit 1eae565fb3
4 changed files with 12 additions and 3 deletions
@@ -149,7 +149,7 @@ export const ShikiHighLighter: FC<ShikiProps> = (props) => {
if (!loaded) {
return (
<pre className={className}>
<pre className={cn("bg-transparent", className)}>
<code>{code}</code>
</pre>
)
@@ -1,6 +1,10 @@
.shiki-wrapper {
@apply rounded-md overflow-hidden;
pre {
@apply bg-transparent;
}
&.transparent {
:global {
.shiki,
+2
View File
@@ -164,6 +164,8 @@ export const parseHtml = (
? propsChildren.find((i) => i.type === "code")
: propsChildren
if (!children) return null
if (
"type" in children &&
children.type === "code" &&
@@ -215,7 +215,7 @@ export const EntryContentRender: Component<{
noMedia={noMedia}
accessory={contentAccessories}
as="article"
className="prose !max-w-full dark:prose-invert prose-h1:text-[1.6em]"
className="prose !max-w-full dark:prose-invert prose-h1:text-[1.6em] prose-h1:font-bold"
style={stableRenderStyle}
renderInlineStyle={readerRenderInlineStyle}
>
@@ -315,7 +315,10 @@ const ReadabilityContent = ({ entryId }: { entryId: string }) => {
</div>
)}
<HTML as="article" className="prose dark:prose-invert prose-h1:text-[1.6em]">
<HTML
as="article"
className="prose dark:prose-invert prose-h1:text-[1.6em] prose-h1:font-bold"
>
{result?.content ?? ""}
</HTML>
</div>