Stripped html ids and classes in blocks

I want to create a workflow where pages are created based on markdown files. It already works great to convert the markdown to html (to automatically create kirby blocks), but the ids and classes are stripped. E.g.
<sup class="footnote-ref"><a href="#fn3" id="fnref3">[3]</a></sup> becomes
<sup><a href="#fn3" rel="noopener noreferrer">[3]</a></sup>
– is there a way to prevent this?

I’m using kirby as a headless cms and the API calls to create the pages are made in Node.js. Thank you very much for any help!

Haven’t tried it, but you could try a plugin like this:


use Kirby\Sane\Html;

Html::$allowedTags['a'][] = 'id';

no clue if this works, but I’d give it a shot

edit: reading some Kirby source code, this probably doesn’t work as these rules seem to come from “Parsley” and not from “Sane”. And those can’t overridden (I think) as easily…

1 Like

Thank you for your answer! But you are right, this approach didn’t work… I will try looking into Parsley, but it seem a little odd that this problem didn’t come up before. I can not find anything on the forum in this direction.