Skip to content

Commit

Permalink
fix block/shortcode not respecting min headings
Browse files Browse the repository at this point in the history
  • Loading branch information
JiveDig committed Jun 28, 2023
1 parent 29a03b4 commit 2fadbae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.5.2 (6/28/23)
* Changed: Update the updater.
* Fixed: TOC block and shortcode not respecting the minimum headings count.

## 1.5.1 (5/5/23)
* Fixed: Missing content on some post types when a TOC is not present.

Expand Down
4 changes: 2 additions & 2 deletions classes/class-table-of-contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ function get_data() {
}
}

// If we have at least 3 h2 headings.
if ( count( $data['matches'] ) > 2 ) {
// If we have the minimum h2 headings.
if ( count( $data['matches'] ) >= $this->args['headings'] ) {
// Store TOC in new content.
$data['content'] = $dom->saveHTML();
}
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2fadbae

Please sign in to comment.