F
Filament6mo ago
farid

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:
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);...
Jump to solution
2 Replies
LeandroFerreira
LeandroFerreira6mo ago
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
farid
farid6mo ago
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);
$post = Post::published->whereSlug($slug)->firstOrFail();
$regex = '/<a[^>]*>(<img[^>]*>).*?<figcaption[^>]*>.*?<\/figcaption>.*?<\/a>/is';
$post->content = preg_replace($regex, '$1', $post->content);
Want results from more Discord servers?
Add your server