Skip to content

Commit b5a2605

Browse files
committed
Fixed bug in text::html() where it checked to see if there was any content before encoding, only it checked loosely meaning that '0' inside a tag is not displayed.
1 parent 2ebc23d commit b5a2605

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/htmldoc/tokens/text.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ protected function getIndex($children) {
101101
* @return string The compiled HTML
102102
*/
103103
public function html(array $options = null) : string {
104-
return $this->content ? htmlspecialchars($this->content, ENT_NOQUOTES | ENT_HTML5) : '';
104+
return $this->content !== '' ? htmlspecialchars($this->content, ENT_NOQUOTES | ENT_HTML5) : '';
105105
}
106106
}

tests/templates/whitespace-minified.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
preformatted
33

44
content
5-
</pre></body></html>
5+
</pre><div>0</div></body></html>

tests/templates/whitespace.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717

1818
content
1919
</pre>
20+
<div>
21+
0
22+
</div>
2023
</body>
2124
</html>

0 commit comments

Comments
 (0)