Skip to content

Commit

Permalink
Merge pull request #64 from mhtamala/patch-3
Browse files Browse the repository at this point in the history
Fixed minor bugs
  • Loading branch information
henck authored Oct 2, 2019
2 parents 836f12a + cba4850 commit 331fe7f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Html/HtmlFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,8 @@ public function Format(Document $document)
// Begin format
$this->ProcessGroup($document->root);
// Remove any final unclosed 'p' tag and return result:
if (substr($this->output, -3) == "<p>") {
return substr($this->output, 0, -3);
} else {
return $this->output;
}
return $this->openedTags['p'] ? substr($this->output, 0, -3) : $this->output;

}

protected function LoadFont(\RtfHtmlPhp\Group $fontGroup) {
Expand Down Expand Up @@ -431,8 +428,8 @@ protected function CloseTag($tag)
}
} else {
$this->output .= "</{$tag}>";
$this->openedTags[$tag] = false;
}
$this->openedTags[$tag] = false;
}
}

Expand Down

0 comments on commit 331fe7f

Please sign in to comment.