New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
htmlTemplate not respecting indentation #57
Comments
Hm, that was a design choice to add whitespace around the returned values from R code blocks, although I can see why you'd want it to not do that. Now that I think about it, I'm not sure why we decided to add whitespace, since it doesn't seem advantageous in any situations I can think of. |
Now that I look at the code again, it's a little more clear why: it returns a > user <- "Jane Doe"
> template <- "<span>{{ user }}</span>"
> str(htmlTemplate(text_ = template, user = 'Jane Doe'))
List of 1
$ :List of 3
..$ <span> :Classes 'html', 'character' atomic [1:1] <span>
.. .. ..- attr(*, "html")= logi TRUE
..$ user : chr "Jane Doe"
..$ </span>:Classes 'html', 'character' atomic [1:1] </span>
.. .. ..- attr(*, "html")= logi TRUE
- attr(*, "class")= chr [1:2] "shiny.tag.list" "list" So the rendering behavior for tagLists would need to be changed. |
When we revisit the excess-whitespace issue in general I bet a nice fix for this issue will fall out as well. I think we will need the ability for tag objects to "eat" the whitespace to either side, we can have all the |
Consider the following example.
It renders as shown below
I would have expected
htmlTemplate
to respect the indentation and instead renderThe text was updated successfully, but these errors were encountered: