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
// 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
Comment #1
hingo commentedOk, 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.
Comment #2
hingo commentedComment #3
rooby commentedSomething like this is probably a good candidate for a regular expression.
Assuming you are no longer working on this.
Comment #6
pifagorDone
Comment #7
pifagor