Omit inner html() calls
              
              #11
            
            Replies: 4 comments 5 replies
-
| 
         This originated with @davepeck  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         not much to discuss to me ... I'll try to land a fix as the expectation seems reasonable. The implementation will likely just implicitly pass through  I think this should work without issues.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         @WebReflection  Omitting the inner  Just brainstorming. For example: show_heading = False
heading = t"Hello {name}"
result = t"{show_heading and heading}"
print(list(result))
# [Interpolation(False, 'show_heading and heading', None, '')]It's not that clean, but we could support a convention that detects this situation.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Closing. We don't even know if the world of Python will find a way to language-inject HTML into a t-string if not surrounded by html(). Also: you've listed quite a number of related points that need more "you" involved than just me. Let's stay with what we have and focus on examples and uses. Then, when we have more people, consider deeper changes.  | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
(I discussed this with @WebReflection in Discord.)
As an example, this fails:
The inner
Templateisn't evaluated:When using deeply-nested component calls, the extra
html()can be cumbersome. It would be nice to build up a tree that includes unrenderedTemplatethen, later in the chain, render to a string.Beta Was this translation helpful? Give feedback.
All reactions