Merge branch 'bring_back_bold_and_italic' of https://github.com/FBnil/PHPWord into bring_back_bold_and_italic

This commit is contained in:
troosan 2017-11-10 21:47:57 +01:00
commit d8dcc770a9
1 changed files with 14 additions and 0 deletions

View File

@ -381,6 +381,20 @@ class Html
case 'background-color':
$styles['bgColor'] = trim($cValue, '#');
break;
case 'font-weight':
$tValue = false;
if (preg_match('#bold#', $cValue)) {
$tValue = true; // also match bolder
}
$styles['bold'] = $tValue;
break;
case 'font-style':
$tValue = false;
if (preg_match('#(?:italic|oblique)#', $cValue)) {
$tValue = true;
}
$styles['italic'] = $tValue;
break;
}
}