I'm now using Flarum 1.8.5 with PHP version 8.1.27. When I found fof/formatting not supporting inserting html elements into posts, I tried to configure text formatter in extend.php using the code below:
use Flarum\Extend;
use s9e\TextFormatter\Configurator;
return [
(new Extend\Formatter)
->configure(function (Configurator $config){
$config->HTMLElements->allowElement('table');
$config->HTMLElements->allowUnsafeAttribute('table', 'style');
$config->HTMLElements->allowElement('td');
$config->HTMLElements->allowUnsafeAttribute('td', 'style');
$config->HTMLElements->allowElement('tr');
$config->HTMLElements->allowAttribute('tr', 'bgcolor');
}),
];
After that I reloaded the site and cleared cache, and tried the table below:
<table style="width:100%">
<tr bgcolor="#224B0C">
<td style="color:white">👌 XXXXXX</td>
</tr>
<tr bgcolor="#AC4425">
<td>🙅 XXXXXX</td>
</tr>
</table>
Every element is rendered properly, however the attribute bgcolor
is not correctly rendered as the color I set. Instead, the background color is rendered as the one I set in the admin panel-> Appearance ->highlight color.
Does the highlight color setting truly override the element attribute settings? How can I solve this problem?
@JoshyPHP