Confusing situation where we are missing the space before the self-closing component tag:
from string.templatelib import Template
from tdom import html
def AuthStatus(logged_in: bool = False) -> Template:
msg = 'In' if logged_in else 'Out'
return t'<div>{msg}</div>'
test_t = t'<{AuthStatus} logged_in={True}/>'
try:
print (html(test_t))
except ValueError as e:
print (e)
test_t = t'<div><{AuthStatus} logged_in={True}/></div>'
try:
print (html(test_t))
except ValueError as e:
print (e)
test_t = t'<div><{AuthStatus} logged_in={True} /></div>'
try:
print (html(test_t))
except ValueError as e:
print (e)
Invalid HTML structure: unclosed tags remain.
Mismatched closing tag </div> for component starting at AuthStatus.
<div><div>In</div></div>
Confusing situation where we are missing the space before the self-closing component tag: