Closed (fixed)
Project:
Table of Contents
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Sep 2007 at 18:38 UTC
Updated:
13 Nov 2007 at 01:53 UTC
The module is stripping out headings that have tags inside due to a greedy regex.
For example:
<h2><li>one</li></h2>
Would show up empty in the TOC.
Starting at line 135:
preg_match_all('/<h([' .
$toc_options["minlevel"] . '-' .
$toc_options["maxlevel"] . '])( .*(id="([^"]+)" ?.*))?>(.*)<\/h([' .
$toc_options["minlevel"] . '-' .
$toc_options["maxlevel"] . '])>/i', $text, $matches, PREG_PATTERN_ORDER);
The second .* needs to be non-greedy:
$toc_options["maxlevel"] . '])( .*(id="([^"]+)" ?.*?))?>(.*)<\/h([' .
This is my first submission to drupal, I hope this is the right place for it.
Comments
Comment #1
deviantintegral commentedHi, sorry for the delay on this.
Your code (or something very similar) has been implemented in the 2.x version. Please give it a try and let me know how it works!
Thanks,
--Andrew
Comment #2
deviantintegral commented