[BUG] print() doesn't output HTML tags.
See original GitHub issueprint() doesn’t output HTML tags I was experimenting in Pyscript and I tried to print an HTML table, but it didn’t work. It seems to delete the tags and mantain just the plain text.
This is the code that I tried, but it just printed “test” once:
<py-script>
print("<table>")
for i in range (2):
print("<tr>")
for j in range (2):
print("<td>test</td>")
print("</tr>")
print("</table>")
</py-script>
And this is a screenshot I took of the output:
Issue Analytics
- State:
- Created a year ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
res.write not working properly. It's showing output including ...
But I am getting different output than expected. My output contains text including HTML tags. Here's my code. const express = require('express'); ...
Read more >problem with out.print and jstl - Oracle Communities
when i print a jstl tag using the out.print() the tag is not rendered but when i view the html source in browser...
Read more >1.5 Print broke - shows html tags in Reporting | Telerik Forums
Since the new printing is based on the Image report rendering engine, it cannot render HTML. So this seems to be a kind...
Read more >Debugging HTML - Learn web development | MDN
Let's review the problems: The paragraph and list item elements have no closing tags. Looking at the image above, this doesn't seem to...
Read more >HTML text format doesn't work in view print preview - Get help
I'm using the html() function in formulas to make selected text bold ... shots of the formula text with html code, and the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The “right” or “wrong” to this will always depend on what the use case is. Sometimes you’ll want escaped output and sometimes you won’t.
We just merged #439 which is slightly related to the topic, and here’s a PR that relates to the topic as well but ultimately we need to design a way for users to opt-in/out escaping . At least at the element (
<py-script>
,<py-repl>
) level).I’m in favor of trying to address this sooner rather than later.
/cc @philippjfr
Some workaround is to use some replacement for tags in text - ie. use
{{ }}
instead of< >
and later replace it back with< >
or more universal - using function for this