You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for providing this awesome package. I just integrated it into one of my projects. I am facing a weird behavior: Whenever rendering custom components (e.g. <Link/>) as explained in your example, the resolver renders a whitespace which results in ugly formatting. Here's an example:
See the whitespace after <Link> component. Here's my custom RichText component:
---
import type { HTMLAttributes } from 'astro/types'
import type { Link } from 'storyblok-rich-text-astro-renderer'
export interface Props extends HTMLAttributes<'a'> {
link: Link['attrs']
}
const {
link: { href, target },
...props
} = Astro.props
---
<a {href} {target} {...props}><slot /></a>
<style>
a {
color: var(--info-foreground);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
I also ensured that no whitespace is inserted using the editor (see the screenshot).
I am using the custom RichText component in my components like this:
<RichText content={blok.subheadline} />
If I use the built-in storyblok-rich-text-astro-renderer/RichTextRenderer.astro component, it renders without the whitespace but obviously without my custom markup.
I would greatly appreciate any help!
The text was updated successfully, but these errors were encountered:
Thanks for providing this awesome package. I just integrated it into one of my projects. I am facing a weird behavior: Whenever rendering custom components (e.g.
<Link/>
) as explained in your example, the resolver renders a whitespace which results in ugly formatting. Here's an example:See the whitespace after
<Link>
component. Here's my customRichText
component:The link component looks like this:
I also ensured that no whitespace is inserted using the editor (see the screenshot).
I am using the custom
RichText
component in my components like this:If I use the built-in
storyblok-rich-text-astro-renderer/RichTextRenderer.astro
component, it renders without the whitespace but obviously without my custom markup.I would greatly appreciate any help!
The text was updated successfully, but these errors were encountered: