Checking if we have headers (#2).

This commit is contained in:
Eric van der Vlist 2020-05-09 11:58:28 +02:00
parent 19d2f29092
commit 7fdc36425d
1 changed files with 4 additions and 0 deletions

View File

@ -433,6 +433,10 @@ if( !class_exists('ExToC') ) {
private function exctract_headings($pagenum) { private function exctract_headings($pagenum) {
/** find all header tags within the page **/ /** find all header tags within the page **/
preg_match_all('/(<h([1-6]{1})[^>]*>).*<\/h\2>/msuU', $this->pages[$pagenum-1], $matches, PREG_SET_ORDER); preg_match_all('/(<h([1-6]{1})[^>]*>).*<\/h\2>/msuU', $this->pages[$pagenum-1], $matches, PREG_SET_ORDER);
if (count($matches) == 0) {
return null;
}
/** Check the headings that are desired */ /** Check the headings that are desired */
if( count($this->options['heading_levels']) != 6 ) { if( count($this->options['heading_levels']) != 6 ) {