Thursday, August 11, 2022
1 change · master
Resolved issues and error corrections
Fixed an issue where the table of contents in Knowledge articles could incorrectly nest a larger heading under a smaller one. This makes article navigation clearer and ensures headings appear at the right level for readers.
Original PR description
When a first section is started with smaller heading, immediately followed by a bigger heading, the bigger heading is displayed under the first smaller one inside toc, which should not be the case. For example, consider the following HTML in an article: ``` <h3>Header 1</h3> <h2>Header 2</h2> ``` The toc for above HTML is being built like: ``` Header 1 ---- Header 2 ``` This is wrong because h2 being bigger than h3, should also be at 0 depth instead of 1. This commit fixes the issue and builds the toc correctly for above mentioned case. taskID-2893657