How to prevent RichEditor from storing an attached image with a default caption and a link to it?
Hello! I'm using RichEditor in a post management form, and I feel that the abbiity to insert images between the text is very useful, but I found that default caption with filename and the link pointing directly to image are two undesired features. So my question is: Is there a way to avoid it?
Solution:Jump to solution
Thank you Leandro! Just for everyone reference I tell you that I suppress unwanted data in frontend view using
preg_replace
in my controller just like:
```
$post = Post::published->whereSlug($slug)->firstOrFail();
$regex = '/<a[^>]>(<img[^>]>).?<figcaption[^>]>.?</figcaption>.?</a>/is';
$post->content = preg_replace($regex, '$1', $post->content);...2 Replies
GitHub
How to prevent RichEditor from storing an attached image with a def...
Package Form builder Package Version v3.2.91 How can we help you? I'm using RichEditor in a post management form, and I feel that the abbiity to insert images between the text is very useful, b...
Solution
Thank you Leandro! Just for everyone reference I tell you that I suppress unwanted data in frontend view using
preg_replace
in my controller just like: