When CKEditor5 sees bad HTML like this:
@foreach ($data as $datum)
<div>
<span>{{ $datum }}</span>
</div>
@endforeach
It will wrap the tags in 'p' so it turns out looking like this:
<p>
@foreach ($data as $datum)
</p>
<div>
<span>{{ $datum }}</span>
</div>
<p>
@endforeach
</p>
I believe it should be possible to prevent that from happening with a custom converter plugin or even in the config by messing with the model writer. Or do I need to hack it during the upcasting stage, which I'd be willing to do. What should I look at to start with this? Thanks.
I think I would start by getting the data model to not see it as "paragraph".
If it's not possible, how do I change the paragraph to something else? Using a different tag would work for me.
I also need it to work in tables as well. This just gets deleted:
<table>
<tbody>
<tr>
<td>
foo
</td>
</tr>
@foreach ($data as $datum)
<tr>
<td>
{{ $datum }}
</td>
</tr>
@endforeach
<tr>
<td>
bar
</td>
</tr>
</tbody>
</table>
How do I make this not be deleted?