| 229 |
$html_raw = _word2web_convert_chr($html_raw); |
$html_raw = _word2web_convert_chr($html_raw); |
| 230 |
set_error_handler('_word2web_suppress_errors'); |
set_error_handler('_word2web_suppress_errors'); |
| 231 |
|
|
| 232 |
|
preg_match('/charset=([\w-]+)/', $html_raw, $matches); |
| 233 |
|
|
| 234 |
|
if ($matches[1] == 'windows-1256') { |
| 235 |
|
$html_raw = iconv('windows-1256', 'utf-8', $html_raw); |
| 236 |
|
} |
| 237 |
|
|
| 238 |
$html = new DOMDocument(); |
$html = new DOMDocument(); |
| 239 |
$html->loadHTML($html_raw); |
$html->loadHTML($html_raw); |
| 240 |
$images = $html->getElementsByTagName("img"); |
$images = $html->getElementsByTagName("img"); |
| 324 |
$path = drupal_get_path('module', 'word2web'); |
$path = drupal_get_path('module', 'word2web'); |
| 325 |
set_error_handler('_word2web_suppress_errors'); |
set_error_handler('_word2web_suppress_errors'); |
| 326 |
$html = $html_raw; |
$html = $html_raw; |
| 327 |
$html_raw = preg_replace("/<(img)([^>]*)>/mi", "<addr class='image' $2>-</addr>", $html_raw); |
$html_raw = preg_replace("/<(img)([^>]*)>/mi", |
| 328 |
|
"<addr class='image' $2>-</addr>", |
| 329 |
|
$html_raw); |
| 330 |
|
|
| 331 |
|
if ($matches[1] == 'windows-1256') { |
| 332 |
|
$html_raw = iconv('windows-1256', 'utf-8', $html_raw); |
| 333 |
|
} |
| 334 |
//preg_match('/charset=([\w-]+)/', $html_raw, $matches); |
//preg_match('/charset=([\w-]+)/', $html_raw, $matches); |
| 335 |
// This step apparently cleans up the XML a little. |
// This step apparently cleans up the XML a little. |
| 336 |
$html = new DOMDocument(); |
$html = new DOMDocument(); |