Skip to content

How to disable titles? #907

Answered by colinodell
TVBZ asked this question in Q&A
Discussion options

You must be logged in to vote

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 a Paragraph 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!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by TVBZ
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants