My Drupal install appears to be in the twilight zone.
I've seen TOCs that look as if they were created using pearwiki_filter/Text/Wiki/Render/Docbook/Toc.php or pearwiki_filter/Text/Wiki/Render/Xhtml/Toc.php -- their items look like <div style="margin-left: ... as I would expect.
But my [[toc]] does not look like this. Instead, regardless of nesting (== and === that are converted to <h[23]>), it's more like this:
<div><a href="#toc0">This</a></div>
<div><a href="#toc1">That</a></div>
<div><a href="#toc2">The other</a></div>
The weird thing is, I can't figure out what's generating that HTML. It's as if the style= line in Toc.php isn't being run, but its syntax is fine, there are no errors reported, and the lines aren't wrapped in an if. So it doesn't seem to be the above PHP scripts, though they seem to be the only files in my Drupal directory that contain the string "Table of Contents".
I'm using MediaWiki formatting and no other filters.
What am I missing? Where is my clue?
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | tableofcontents.module.diff | 2.69 KB | sibidiba |
Comments
Comment #1
ghoti commentedNot sure what I was thinking last night, but I've discovered that it is indeed modules/pearwiki_filter/Text/Wiki/Render/Xhtml/Toc.php that generates my TOC.
But the TOC items are still missing any style.
Could something besides the token() method be populating the list?
Could ... and I'm stretching here ... something be stripping the
style="margin-left:..."out of the HTML that Text/Wiki/Render/Xhtml/Toc.php is producing?Comment #2
Pushkar Gaikwad commentedwell I can see the issue is 1 year and hasn't been solved. I am too facing the same problem that the TOC tags are not working, :(
Comment #3
agentdcooper commentedI as well, am running into TOC issues!
quoting this page :: http://drupal.org/node/260512
"The problem is that PEAR Wiki is stripping out anything which looks like an HTML comment, so the Table is generated but not inserted. You need to find an way to make PEAR wiki's module allow HTML comments"
Is there a potential fix to make PEAR Wiki + MediaWiki formating and the Drupal Table of Content module to work together in peace? I tried to "rearrange" the filters, but NO MATTER WHICH WAY THEY ARE ORDERED TOC will not work while PEAR Wiki + MediaWiki formating is enabled??!! I also tried to tell the PEAR Wiki filter to ignore the tag "
" (without quotes) and rearranging the filter order with no luck.
Does anyone know of a fix or potential workaround? Or is this a nasty bug?
Comment #4
sibidiba commentedI have a workaround:
1. Install the patch for the issue http://drupal.org/node/244520 .
This way you can ignore tokens.
2. To ignore the [[TOC]] token, add [TOC] to the ignore list.
3. Install http://drupal.org/project/tableofcontents .
This is a more advanced table of contents module then the built in.
4. Enable tableofcontents, add it's filter and heading to anchors. The latter should be applied first.
5. Apply the attached patch, so that the module replaces [[TOC]] with the table of contents instead of <!--tableofcontents-->. The latter conflicts with this filter and also with HTML filters.
This way you remain backward compatible: if the TOC capabilities of PEARWiki improve, you can safely remove the tableofcontents module, disable ignoring [[TOC]] and everything will work as before.
Comment #5
mati fsinf commentedI want to verify that the proposed workaround works. I think at least the patch for the pearwiki module should be integrated into that module...
Comment #6
Matt Schuckmann commentedThe combination of this patch and the patch for pearwiki worked for me.
Thanks.
Comment #7
nirvanajyothi commentedOne more happy drupaler. thank you @ sibidiba.
Comment #9
kenorb commentedComment #10
kenorb commentedDrupal 5 is no longer officially supported. If you think this issue is still relevant in 7.x and beyond, feel free to re-open.