Skip to content

Commit cba4850

Browse files
authored
fix bug removing last 3 characters from document
see Pull #62 (closed)
1 parent 792a6c4 commit cba4850

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/Html/HtmlFormatter.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@ public function Format(Document $document)
4646
// Begin format
4747
$this->ProcessGroup($document->root);
4848
// Remove any final unclosed 'p' tag and return result:
49-
if (substr($this->output, -3) == "<p>") {
50-
return substr($this->output, 0, -3);
51-
} else {
52-
return $this->output;
53-
}
49+
return $this->openedTags['p'] ? substr($this->output, 0, -3) : $this->output;
50+
5451
}
5552

5653
protected function LoadFont(\RtfHtmlPhp\Group $fontGroup) {

0 commit comments

Comments
 (0)