Fixed a few bugs

This commit is contained in:
Tim Otte 2020-03-02 16:08:06 +01:00
parent 598d6d63b0
commit d5671f1c42
2 changed files with 4 additions and 2 deletions

View File

@ -77,6 +77,7 @@ class HtmlToOdtConverter {
$odtResult .= '<text:span text:style-name="boldText">' . ($tag['children'] != null ? self::replaceHtmlWithOdtTag($tag['children'], $customStyles) : $tag['innerText']) . '</text:span>';
break;
case 'i':
case 'em':
$odtResult .= '<text:span text:style-name="italicText">' . ($tag['children'] != null ? self::replaceHtmlWithOdtTag($tag['children'], $customStyles) : $tag['innerText']) . '</text:span>';
break;
case 'u':
@ -144,7 +145,8 @@ class HtmlToOdtConverter {
* @param string $text The text to check
*/
public static function hasHtmlTag($text) {
return preg_match_all(HTML_REGEX_PATTERN, $text);
$result = preg_match_all(HTML_REGEX_PATTERN, $text);
return is_numeric($result) && $result > 0;
}
/**

View File

@ -1,7 +1,7 @@
<?php
require 'Segment.php';
require_once __DIR__ . '/../../core/class/HtmlToOdtConverter.php';
require_once __DIR__ . '/../../core/class/HtmlToOdtConverter.class.php';
class OdfException extends Exception
{