mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 22:27:34 +02:00
Fix: pre/code tags were losing class and style attributes.
This commit is contained in:
@@ -4647,6 +4647,7 @@ return;
|
||||
$value = preg_replace('/^<pre[^>]*>/', '', $value);
|
||||
$value = str_replace("</pre>", "", $value);
|
||||
$value = str_replace('<br></br>', PHP_EOL, $value);
|
||||
|
||||
}
|
||||
|
||||
if($node->nodeName == 'code')
|
||||
@@ -4662,6 +4663,16 @@ return;
|
||||
$newNode = $doc->createElement($node->nodeName);
|
||||
$newNode->nodeValue = $value;
|
||||
|
||||
if($class = $node->getAttribute('class'))
|
||||
{
|
||||
$newNode->setAttribute('class',$class);
|
||||
}
|
||||
|
||||
if($style = $node->getAttribute('style'))
|
||||
{
|
||||
$newNode->setAttribute('style',$style);
|
||||
}
|
||||
|
||||
$node->parentNode->replaceChild($newNode, $node);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user