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

hingo’s picture

Assigned: AlexisWilke » hingo
Priority: Normal » Minor

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.

hingo’s picture

Status: Needs review » Needs work
rooby’s picture

Assigned: hingo » Unassigned

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

Assuming you are no longer working on this.

  • hingo committed 974566b on 8.x-2.x
    footnotes_views should take into account that the footnotes needn't be...
  • hingo committed 2f42e7f on 8.x-2.x
    Revert (or comment out, to be precise) previous commit related to [#...

  • hingo committed 974566b on 7.x-3.x
    footnotes_views should take into account that the footnotes needn't be...
  • hingo committed 2f42e7f on 7.x-3.x
    Revert (or comment out, to be precise) previous commit related to [#...
pifagor’s picture

Issue summary: View changes
Status: Needs work » Fixed

Done

pifagor’s picture

Status: Fixed » Closed (fixed)