We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 836f12a + cba4850 commit 331fe7fCopy full SHA for 331fe7f
1 file changed
src/Html/HtmlFormatter.php
@@ -46,11 +46,8 @@ public function Format(Document $document)
46
// Begin format
47
$this->ProcessGroup($document->root);
48
// 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
- }
+ return $this->openedTags['p'] ? substr($this->output, 0, -3) : $this->output;
+
54
}
55
56
protected function LoadFont(\RtfHtmlPhp\Group $fontGroup) {
@@ -431,8 +428,8 @@ protected function CloseTag($tag)
431
428
432
429
} else {
433
430
$this->output .= "</{$tag}>";
434
- $this->openedTags[$tag] = false;
435
+ $this->openedTags[$tag] = false;
436
437
438
0 commit comments