mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-26 07:49:28 +01:00
other changes (keep_bad and -htmlawed-transform) that did affect the expected result of htmlawed v1.1.17 compared to v1.1.14
This commit is contained in:
parent
706c69ed90
commit
5e44a189cc
@ -231,6 +231,9 @@ for($i=-1, $ci=count($t); ++$i<$ci;){
|
||||
if((($ql && isset($cB[$p])) or (isset($cB[$in]) && !$ql)) && !isset($eB[$e]) && !isset($ok[$e])){
|
||||
array_splice($t, $i, 0, 'div>'); unset($e, $x); ++$ci; --$i; continue;
|
||||
}
|
||||
if($e == 'div' && !isset($ok['div']) && strpos($a, '-htmlawed-transform')){
|
||||
$t[$i] = "span{$a}>{$x}"; unset($e, $x); --$i; continue;
|
||||
}
|
||||
// if no open ele, $in = parent; mostly immediate parent-child relation should hold
|
||||
if(!$ql or !isset($eN[$e]) or !array_intersect($q, $cN2)){
|
||||
if(!isset($ok[$e])){
|
||||
@ -419,7 +422,8 @@ $t = $t[0];
|
||||
if($t == '< '){return '< ';}
|
||||
if($t == '>'){return '>';}
|
||||
if(!preg_match('`^<(/?)([a-zA-Z][a-zA-Z1-6]*)([^>]*?)\s?>$`m', $t, $m)){
|
||||
return str_replace(array('<', '>'), array('<', '>'), $t);
|
||||
//return str_replace(array('<', '>'), array('<', '>'), $t);
|
||||
return (($C['keep_bad']%2) ? str_replace(array('<', '>'), array('<', '>'), $t) : '');
|
||||
}elseif(!isset($C['elements'][($e = strtolower($m[2]))])){
|
||||
return (($C['keep_bad']%2) ? str_replace(array('<', '>'), array('<', '>'), $t) : '');
|
||||
}
|
||||
@ -639,7 +643,13 @@ if($e == 'font' && $t !=3){//3 is a new make_tag_strict config value, to indicat
|
||||
if(preg_match('`size\s*=\s*(\'|")?(.+?)(\\1|\s|$)`i', $a, $m) && isset($fs[($m = trim($m[2]))])){
|
||||
$a2 .= ' font-size: '. $fs[$m]. ';';
|
||||
}
|
||||
$e = 'span'; return ltrim($a2);
|
||||
// $e = 'span'; return ltrim($a2);
|
||||
// replace the above with following
|
||||
if($GLOBALS['C']['balance']){
|
||||
$e = 'div'; return 'display: inline; -htmlawed-transform: 1; '. ltrim($a2);
|
||||
}else{
|
||||
$e = 'span'; return ltrim($a2);
|
||||
}
|
||||
}
|
||||
if($t == 2){$e = 0; return 0;}
|
||||
return '';
|
||||
|
Loading…
Reference in New Issue
Block a user