Closed dwalluck closed 5 years ago
Sorry, as I said, the standard says that text within the container is rendered the same, so this "bug" relates to text that is between tags, not inside of them.
I still think it would be nice to have an option to render the the text within the tag without added whitespace. This already seems to be an option for tags where whitespace is important (like <pre>
) so it shouldn't be too much of a change.
@dwalluck If you create a PR for this I would be happy to merge it.
The
renderFormatted()
method causes additional whitespace to be rendered by the browser. This applies to any tag that is a text container. It should probably be the case that tags with text content hug that content.For example,
would be rendered as
having the opening and closing tags "hug" their content.
Otherwise, the browser will insert an additional spaces between one container tag and the other making it impossible to render them without space.
The HTML standard https://www.w3.org/TR/html401/appendix/notes.html#notes-line-breaks seems to indicate that the browser should render these two the same, but I tested with both in Google Chrome and Mozilla Firefox with the same results of an extra space.
This is complicated by the fact that if I try to use something like
text("te"), text("st")
it also adds newlines and indents even though this is just plain text in this case. Is there already a workaround to get these rendered right next to one another? Note that I cannot writetext("test")
. This was just an example. In reality, they are separate tags so they cannot be combined.