Download & Extend

footnotes_views should take into account that the footnotes needn't be at the end.

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

Priority:normal» minor
Assigned to:AlexisWilke» hingo

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

Status:needs review» needs work

#3

Assigned to:hingo» Anonymous

Something like this is probably a good candidate for a regular expression.

Assuming you are no longer working on this.

nobody click here