mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-31 03:10:09 +02:00
Fix bug involving autoclose and inline elements in strict <blockquote>.
The newest autoclose code uses the elements property in whether or not an element should be closed by a particular tag. The heuristic is simple; if the element doesn't allow that tag as a child, it closes the parent container. This doesn't work, however, with <blockquote>, which while not allowing inline styles under Strict doctypes, requires them to be passed through MakeWellFormed. The fix was to transition MakeWellFormed to call a method to retrieve the elements, and then have StrictBlockquote implement a special version of this method. Future versions of HTML Purifier may be more flexible in this regard--further study of the HTML5 specification is required. Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
@@ -140,7 +140,7 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy
|
||||
|
||||
$parent = array_pop($this->currentNesting);
|
||||
if (isset($definition->info[$parent->name])) {
|
||||
$elements = $definition->info[$parent->name]->child->elements;
|
||||
$elements = $definition->info[$parent->name]->child->getNonAutoCloseElements($config);
|
||||
$autoclose = !isset($elements[$token->name]);
|
||||
} else {
|
||||
$autoclose = false;
|
||||
|
Reference in New Issue
Block a user