From 107d9b8dff59de34a2ebef4b7be942b12f435e3a Mon Sep 17 00:00:00 2001
From: sean <146651411+tuta-amb@users.noreply.github.com>
Date: Tue, 16 Jan 2024 16:18:55 +0000
Subject: [PATCH] fix: external link icon shouldn't be vertical aligned (#699)

---
 quartz/plugins/transformers/ofm.ts |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index 35257cc..6688059 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -366,7 +366,7 @@
               }
 
               const text = firstChild.children[0].value
-              const restChildren = firstChild.children.slice(1)
+              const restOfTitle = firstChild.children.slice(1)
               const [firstLine, ...remainingLines] = text.split("\n")
               const remainingText = remainingLines.join("\n")
 
@@ -382,7 +382,10 @@
                   match.input.slice(calloutDirective.length).trim() || capitalize(calloutType)
                 const titleNode: Paragraph = {
                   type: "paragraph",
-                  children: [{ type: "text", value: titleContent + " " }, ...restChildren],
+                  children:
+                    restOfTitle.length === 0
+                      ? [{ type: "text", value: titleContent + " " }]
+                      : restOfTitle,
                 }
                 const title = mdastToHtml(titleNode)
 

--
Gitblit v1.10.0