Skip to content

Commit

Permalink
Merge branch 'feat/rich-text-api' of https://github.com/storyblok/sto…
Browse files Browse the repository at this point in the history
…ryblok-js into feat/rich-text-api
  • Loading branch information
alexjoverm committed Sep 2, 2022
2 parents 7e2d4fa + 2470dd2 commit 10e8cd3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ export const storyblokInit = (pluginOptions: SbSDKOptions = {}) => {

// Rich Text resolver
richTextResolver = new RichTextResolver(richText.schema);
if (richText.resolver)
if (richText.resolver) {
setComponentResolver(richTextResolver, richText.resolver);
}

return result;
};
Expand Down Expand Up @@ -124,7 +125,9 @@ export const renderRichText = (
let localResolver = richTextResolver;
if (options) {
localResolver = new RichTextResolver(options.schema);
if (options.resolver) setComponentResolver(localResolver, options.resolver);
if (options.resolver) {
setComponentResolver(localResolver, options.resolver);
}
}

return localResolver.render(data);
Expand Down

0 comments on commit 10e8cd3

Please sign in to comment.