I noticed that my theme added a blank line where the "top" anchor was placed. I fixed this by giving it its own div in line 200.
So, I changed:
$output = '<a name="top"></a>';
to:
$output = '<div class="toc-filter-top-link"><a name="top"></a></div>';
This solved the problem nicely. I didn't need to do anything in CSS, but I did add a "div.toc-filter-top-link {}" line to my theme's css for completeness.
Thanks for the great and simple module - I certainly appreciate it!
Comments
Comment #1
shadlaws commentedComment #2
jrockowitz commentedTo keep it simple, I changed
<a name="top"></a>- to -
<a name="top" class="toc-filter-top"></a>And added the below css.
a.toc-filter-top {display: none;
}
This should insure the #top anchor is never rendered.
WOW... for being a member of Drupal.org for only 9 hrs you already have 2 commits attributed to you.
Comment #3
shadlaws commentedWow, thanks for the quick reply!
I tested the newest dev code, but the same problem occurred. If I inspect the element in Chrome, I can see that the display:none CSS line is indeed rendered, but it shows an extra
<p>...</p>around the anchor. However, if I put it into a div, this goes away.Thanks!
Comment #4
jrockowitz commentedOh, you need to sort/arrange your input filters so that the 'Convert line breaks into HTML' filter, which is adding the p tags, comes before the 'TOC filter'
Comment #5
shadlaws commentedGood thought, but I'd already done that. Here's my filter order:
- TOC
- Replace tokens
- Convert URLs into links
- Convert line breaks into HTML
- Correct faulty and chopped off HTML
In trying to debug this, I thought of something perhaps fairly obvious: is this due to my WYSIWYG editor? To see, I looked at the plain text version of the source, and found this at the top:
<p>[toc]</p><h3>Foo bar</h3>Hmm...
Comment #6
jrockowitz commentedYou ordering should be....
- Replace tokens
- Convert URLs into links
- Convert line breaks into HTML
- Correct faulty and chopped off HTML
- TOC
Comment #7
shadlaws commentedHmm... somehow I'd read your previous comment and interpreted the exact opposite of what you wrote. What an idiot. Sorry about that!
I moved it after line breaks (but before faulty and chopped HTML) and you were right - it's all fixed. Thanks!
Comment #8
shadlaws commentedComment #8.0
shadlaws commentedCode block formatting corrected.