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

Zen’s picture

Status: Active » Closed (won't fix)

Please play with the weight of the filters to fix such conflicts.