Conflict between Footnotes and Read More Module
animelion - September 2, 2009 - 09:20
| Project: | Footnotes |
| Version: | 6.x-2.1 |
| Component: | Footnotes.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
Description
When I enable the (Footnotes [fn]...[/fn]) input filter my teaser output changes. This causes the inline Read More link placed my the (Read More Link Module) to not be inline and jump down another line. I will be posting this in both this in both modules issue ques. Any suggestions would be welcomed, I really want to use the Footers input filter, but I can no give up the styling of the Read More module.
With (Footnotes [fn]...[/fn]) input filter enabled
... and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br />
Why do we use it?</p>
<div class="read-more"><a href="/content/test" title="Read the whole post" rel="nofollow"><strong>Read more »</strong></a></div> </div>With (Footnotes [fn]...[/fn]) input filter disabled
... and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br />
Why do we use it? <span class="read-more"><a href="/content/test" title="Read the whole post" rel="nofollow"><strong>Read more »</strong></a></span></p>
</div>| Attachment | Size |
|---|---|
| error.png | 6.53 KB |

#1
Hi
Footnotes has a "feature" - a bit of a hack really - that it adds a
</p>tag (or other tag) if it feels that one is missing from the teaser. The problem here is that Drupal just cuts the text and may break the html. http://drupal.org/node/253326Drupal 7 will not have this issue. In D7 it will always be formatted the way you see it with Footnotes enabled!
You may prevent this by happening by adding an explicit
<!--break-->where you want to break the teaser, so that it doesn't happen in the middle of a paragraph.#2
I'm also having this problem and would like to know how to fix it. Any help is much appreciated.
#3
Hi
As I tried to explain, the behavior you see with footnotes turned on is "correct", without footnotes it is wrong (to some extent). In Drupal7 you will get the "correct" behavior whether you like it or not.
But you can influence the behavior by manually defining where the teaser should break.
Possibly also this problem is related to your theme / css, i don't know.
#4
Hm... this seems odd, as a lot of people use the Read More Link module, and I think it will continue to be supported past Drupal 7. Is there any way to disable the "feature/hack" in the footnotes module that adds the problematic
, so that it would work with the Read More Link module?
#5
To be more specific: in Drupal 7 a similar fix (closing the opened
</p>tag) is done by the htmlcorrector filter, but I think this is always on by default. You can turn it off of course, if you depend on html being not well formed.In footnotes, you can delete or uncomment lines 116-129 from footnotes.module:
// Check that there are an even number of open and closing tags.// If there is one closing tag missing, append this to the end.
// If there is more disparity, throw a warning and continue.
// A closing tag may sometimes be missing when we are processing a teaser
// and it has been cut in the middle of the footnote. http://drupal.org/node/253326
$foo = array();
$open_tags = preg_match_all("|<fn([^>]*)>|", $text, $foo);
$close_tags = preg_match_all("|</fn>|", $text, $foo);
if($open_tags == $close_tags + 1) {
$text = $text . '</fn>';
}
elseif( $open_tags > $close_tags + 1) {
trigger_error(t("You have unclosed fn tags. This is invalid and will produce unpredictable results."));
}
#6
#7
Just as a closing comment, I had a look also at Insert View module, and it seems it chooses to switch to the
<div>tag when there is a</p>tag at the end of your text. It would have to become more intelligent to make the "Read more..." link inline. In any case there is nothing to do in Footnotes.And indeed, there is a rewritten version of Insert View for Drupal 7, possibly for this very reason.
#8
Thanks for your help hingo! Much appreciated.