Skip to content

Commit

Permalink
Ensure spacing exists between closing and opening tags
Browse files Browse the repository at this point in the history
  • Loading branch information
u01jmg3 committed Dec 29, 2018
1 parent cf45cbc commit 11d4e88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docx2md.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ private function docx2md(array $args, $isTestMode = false)
// Remove whitespace between tags
$xml = preg_replace('/(\>)\s+(\<)/m', '\\1\\2', $xml);

// Ensure spacing exists between closing and opening tags
$xml = preg_replace('/(<\/i:(bold|italic)>)(<i:(bold|italic)>)([^\.,;:\?\!])/', '\\1 \\3\\5', $xml);

$intermediaryDocument->loadXML($xml);

// Remove empty tags
Expand Down

0 comments on commit 11d4e88

Please sign in to comment.