How to disable titles? #907
-
New to commonmark, using it in Laravel project, inside livewire component. Is it possible to configure to disable title tags completely? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There are two ways you can solve this. One way is to create a custom event listener (sorta like this) that will iterate the parsed elements, locate the headings, and do something with them. You could potentially remove them (by calling The other solution is a little bit more of a hack, but would also work just fine. Basically, replace the existing HeadingRenderer with your own custom one that renders different HTML output. Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Thanks @colinodell, I will dig into event listeners |
Beta Was this translation helpful? Give feedback.
There are two ways you can solve this.
One way is to create a custom event listener (sorta like this) that will iterate the parsed elements, locate the headings, and do something with them. You could potentially remove them (by calling
->detach()
), change the heading level, or replace it with aParagraph
node. This would be considered the "best practice" way of doing things.The other solution is a little bit more of a hack, but would also work just fine. Basically, replace the existing HeadingRenderer with your own custom one that renders different HTML output.
Hope that helps!