Skip to content

Commit

Permalink
Remove spaces in annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
otoyo committed Jul 19, 2023
1 parent cf14a4d commit 7e01781
Showing 1 changed file with 50 additions and 42 deletions.
92 changes: 50 additions & 42 deletions src/components/notion-blocks/RichText.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,55 @@ const { richText } = Astro.props
---

<Anchor richText={richText}>
<Code richText={richText}>
<Color richText={richText}>
<Underline richText={richText}>
<Strikethrough richText={richText}>
<Italic richText={richText}>
<Bold richText={richText}>
{
richText.Text &&
richText.Text.Content.split('\n').map(
(content: string, i: number) => {
if (i === 0) {
return content
}
return (
<>
<br />
{content}
</>
)
{
(
<Code richText={richText}>
{
<Color richText={richText}>
{
<Underline richText={richText}>
{
<Strikethrough richText={richText}>
{
<Italic richText={richText}>
{
<Bold richText={richText}>
{richText.Text &&
richText.Text.Content.split('\n').map(
(content: string, i: number) => {
if (i === 0) {
return content
}
return (
<>
<br />
{content}
</>
)
}
)}
{richText.Equation && (
<span
set:html={katex.renderToString(
richText.Equation.Expression,
{ throwOnError: false }
)}
/>
)}
{richText.Mention && richText.Mention.Page && (
<Mention pageId={richText.Mention.Page.Id} />
)}
</Bold>
}
</Italic>
}
)
}
{
richText.Equation && (
<span
set:html={katex.renderToString(
richText.Equation.Expression,
{ throwOnError: false }
)}
/>
)
}
{
richText.Mention && richText.Mention.Page && (
<Mention pageId={richText.Mention.Page.Id} />
)
}
</Bold>
</Italic>
</Strikethrough>
</Underline>
</Color>
</Code>
</Strikethrough>
}
</Underline>
}
</Color>
}
</Code>
)
}
</Anchor>

0 comments on commit 7e01781

Please sign in to comment.