© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•7mo ago•
3 replies
warNuttah

How to prevent escaping & wrapping <iframe> HTML in TipTap Editor?

I'm using TipTap editor and allowing users to paste Bandcamp iframes. The problem is that when saving, the iframe code gets escaped and wrapped inside <p> tags, like this:

<p>&lt;iframe src="...">&lt;/iframe&gt;</p>
<p>&lt;iframe src="...">&lt;/iframe&gt;</p>


This breaks rendering because the HTML is escaped and malformed.

On the backend, I'm sanitizing input with HTMLPurifier (Stevebauman\Purify), and on the frontend, using DOMPurify to safely render HTML. Despite this, the iframe ends up escaped and wrapped in unwanted <p> tags.

I am accepting iframes on Purify's config so, I've tried allowing it on that end but nothing seems to work.

'HTML.Allowed' => 'iframe[src|width|height|frameborder|allowfullscreen]...',
'HTML.Trusted' => true,
'HTML.SafeIframe' => true,
'HTML.SafeObject' => true,
'HTML.Allowed' => 'iframe[src|width|height|frameborder|allowfullscreen]...',
'HTML.Trusted' => true,
'HTML.SafeIframe' => true,
'HTML.SafeObject' => true,


Is there a way to configure Filament or the editor to save raw iframe HTML without escaping or wrapping it in <p>?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Rich Editor escaping its own HTML
FilamentFFilament / ❓┊help
13mo ago
TipTap Editor
FilamentFFilament / ❓┊help
16mo ago
How in tiptap editor to set maxLength
FilamentFFilament / ❓┊help
2y ago
Prevent extraAttributes escaping
FilamentFFilament / ❓┊help
2y ago