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
The bug only happens when using the package @storyblok/richtext, in the deprecated package @storyblok/react it works as expected.
Expected Behavior
Custom attributes on links should be added correctly to the a tag, e.g. : <a href="https://www.storyblok.com" target="_self" rel="nofollow noopener">https://www.storyblok.com</a>
Current Behavior
The custom attributes are added as object to the custom attribute, e.g.: <a custom="[object Object]" target="_self" href="https://www.storyblok.com">https://www.storyblok.com</a>
Steps to Reproduce
Story with a richtext field
In the richtext have a link with some custom attributes like "rel: nofollow noopener"
Render the richtext and inspect output
import {
richTextResolver,
type StoryblokRichTextOptions,
} from "@storyblok/richtext";
import React from "react";
const options: StoryblokRichTextOptions<React.ReactElement> = {
renderFn: React.createElement,
keyedResolvers: true,
};
const { render } = richTextResolver<React.ReactElement>(options);
function Richtext({ blok }: { blok: any }) {
return (
<section>
{render(blok.richtext)}
</section>
);
}
export default Richtext;
The text was updated successfully, but these errors were encountered:
The bug only happens when using the package
@storyblok/richtext
, in the deprecated package@storyblok/react
it works as expected.Expected Behavior
Custom attributes on links should be added correctly to the
a
tag, e.g. :<a href="https://www.storyblok.com" target="_self" rel="nofollow noopener">https://www.storyblok.com</a>
Current Behavior
The custom attributes are added as object to the
custom
attribute, e.g.:<a custom="[object Object]" target="_self" href="https://www.storyblok.com">https://www.storyblok.com</a>
Steps to Reproduce
The text was updated successfully, but these errors were encountered: