Changeset 11354 for sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/table-of-contents.php
- Timestamp:
- 12/06/2021 03:21:28 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/table-of-contents.php
r11341 r11354 110 110 } 111 111 112 // Remove any links we don't need. 113 foreach ( $items as $i => $item ) { 114 // If an element is all HTML, don't link to it. 115 if ( empty( trim( strip_tags( $item['title'] ) ) ) ) { 116 unset( $items[ $i ] ); 117 } 118 } 119 112 120 // Generate a list of the IDs in the document (generating them as needed). 113 121 $this->used_ids = $this->get_reserved_ids(); … … 236 244 } 237 245 238 preg_match_all( "/(?P<tag><{$tag}(?P<attrs>[^>]*)>)(?P<title>.* )(<\/{$tag}>)/iJ", $content, $matches, PREG_SET_ORDER );246 preg_match_all( "/(?P<tag><{$tag}(?P<attrs>[^>]*)>)(?P<title>.*?)(<\/{$tag}>)/iJ", $content, $matches, PREG_SET_ORDER ); 239 247 240 248 return $matches;
Note: See TracChangeset
for help on using the changeset viewer.