Adjust Headings Plugin
This plugin (available in b2evo 6.7) will automatically adjust the headings of all posts and/or comments to make them consistent.
For example, if you have one post containing <h1>
sub-headings and another containing <h4>
sub-headings when your normal sub-headings should be <h3>
, this plugin will adjust all of them to <h3>
. Of course, that is for the highest level of sub-headings. If you use sub-sub-headings, they will be adjusted down to <h4>
, <h5>
, etc.
Author | |
---|---|
Last tested in version |
Let's assume we want to normalize the highest sub-heading level to h3:
The plugin will perform these tasks:
- Scan the text for
<h[1-6]( .*)?>
and determine the existing highest level in the text. Maybe it's h1 (example A), maybe it's h3 (example B). - Adjust all headers so that the highest one is the set top level:
- Example A:
- h1 becomes h3
- h2 becomes h4
- h3 becomes h5
- h4 becomes h6
- h5 becomes h6 (we can't go over h6 in HTML)
- h6 becomes h6
- Example B:
- h1 doesn't exist
- h2 doesn't exist
- h3 becomes h3
- h4 becomes h4
- h5 becomes h5
- h6 becomes h6
- Example A:
Let's have an additional example:
We set the plugin collection setting Highest level heading to 2
for <H2>
and the source text is:
<h4 id="">Heading</h4>
haha I put a small heading before a large one to trick you!
<h3 id="">Another heading</h3>
The detected highest level is h3. The plugin settings request that the highest be h2. So the plugin should change the text to:
<h3 id="">Heading</h3>
haha I put a small heading before a large one to trick you!
<h2 id="">Another heading</h2>
Per Collection Settings
- Apply rendering to posts: how the content of the post will be rendered by plugin (for more information about apply rendering, please read: )
- Apply rendering to comments: how the comments will be rendered by the plugin (for more information about apply rendering, please read: )
- Highest level heading: specify the highest heading level to use:
1
for<H1>
,2
for<H2>
, etc.