How do I remove the span within elements and <p> within <li> in richText?

Hi, I am using SvelteKit in my project and I am write the richtext as below:


import Storyblok from '../../../storyblokClient';
const handler = (component) => Storyblok.richTextResolver.render(component);
....
<section class="article__body">
{@html handler(blok.body[0].richText)}
</section>

And I see that I have things like

<p><span class> "lorem lorem lorem."</span></p>
... or 
<li><p><span class>item one</span></p></li>

Ideally I would like them to be simple and clean, just like

<p> "lorem lorem lorem."</p>
... or 
<li>item one</li>

How to achieve that? I notice there is a Github discussion on writing your own schema, but I am not sure how to apply that in my case.

Hello @annie,

I’ve read a discussion on Discord between my colleague Lisi and a community member that this is only added when the content part has been styled. I didn’t use the Richtext renderer myself but I think that you would need to overwrite the behavior in this part storyblok-js-client/schema.js at master · storyblok/storyblok-js-client · GitHub

In case that you need further help and information about how to customize the behavior you can also get in touch with our Discord community: Storyblok

Best regards
Hannes