Posted by hingo on December 20, 2010 at 10:23pm
2 followers
Jump to:
| Project: | Footnotes |
| Version: | 6.x-2.x-dev |
| Component: | footnotes_views |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
Hi Alexis
One immediate fix comes to mind for the footnotes_views module. The footnotes are by default at the end of the body, but this isn't necessarily always the case. The user can in fact place them anywhere by inserting a [footnotes] tag in the body text.
I've now committed a fix which adds essentially a
<?php
// By default footnotes are at the end, but they could be anywhere really.
$end = strpos($data, '</ul><!-- end footnotes -->')+strlen('</ul><!-- end footnotes -->');
?>and makes use of $end in appropriate places.
Again, I haven't actually tested this, please download the latest 6.x-2.x-dev and let me know if the code works.
Comments
#1
Ok, I tested a little with a View now and it didn't work. It seems what I tried to do here only works with Full HTML mode, not when filtered. (I tried to insert an HTML comment
</ul><!-- end footnotes -->to mark the end of the footnote, but that is filtered away of course. Note that matching any old /ul will not work as there might theoretically be lists inside the footnotes too.)I'm reverting back to the original code since having footnotes at the end of the text is still the most common use case. It seems to me that to correctly split out footnotes from anywhere we'd have to actually parse the HTML DOM tree of the body.
#2
#3
Something like this is probably a good candidate for a regular expression.
Assuming you are no longer working on this.