Closed (won't fix)
Project:
Quote
Version:
5.x-1.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Apr 2010 at 00:55 UTC
Updated:
7 Aug 2010 at 19:59 UTC
Quote creates a correctly formatted html block using divs. The problem arises when Drupal's line filter tries to format the content inside the quoted div block. Any open final paragraph is never closed because quote appends a closing div tag immediately to the end of the quoted content.
Although it is probably the line filter's fault the solution is simple - insert a couple of line breaks before the closing div tag like so:
function theme_quote($quote_content, $quote_author) {
$quote_output = '<div class="quote-msg">';
if ($quote_author != '') {
$quote_output .= '<div class="quote-author">'. t('%name wrote:', array('%name' => $quote_author)) .'</div>';
}
else {
$quote_output .= '<div class="quote-author">'. t('Quote:') .'</div>';
}
$quote_output .= $quote_content;
$quote_output .= "\n\n</div>"; // <== INSERT THERE
return $quote_output;
}
or a theme override:
function yourmodule_quote($quote_content, $quote_author) {
$quote = theme_quote($quote_content, $quote_author);
// Insert a newline character before the final closing div.
// This allows Drupal's line break filter to close any open <p> tags
return substr_replace($quote, "\n\n</div>", strlen($quote) - 6);
}
Comments
Comment #1
Zen commentedPlease play with the weight of the filters to fix such conflicts.