You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The only difficulty here is disambiguating which items are attributes and which are content. We came up with a "simple" chunk of code that does that:
It works, but it fails at the one point that html.tag() cannot solve on its own: templates whose content resolves to attributes. (For example, generateColorStyleAttribute.) In the algorithm above, "looks like attributes" simply rules that templates are never attributes. This is "fine" as an existing condition which checks the last argument to tag(), but in this context it breaks templates from ever working as attributes. And most templates are content, not attributes, so we can't just rule the other way (templates are never content—lol).
We need html.tag()—and Tag objects themselves, or at least the representative thing which html.tag() returns—to store provided arguments as-is (or "flattened" leaving templates in-place and as-is), for lazy evaluation later, when content is being stringified or otherwise processed. In other words, this most certainly depends on #331, but also extends that principle to the entire argument list for tag().
See previous discussion (#code-quarantine). This is re: addressing the following code sample.
What's this about??
Old:
New:
The only difficulty here is disambiguating which items are attributes and which are content. We came up with a "simple" chunk of code that does that:
It works, but it fails at the one point that html.tag() cannot solve on its own: templates whose content resolves to attributes. (For example,
generateColorStyleAttribute
.) In the algorithm above, "looks like attributes" simply rules that templates are never attributes. This is "fine" as an existing condition which checks the last argument totag()
, but in this context it breaks templates from ever working as attributes. And most templates are content, not attributes, so we can't just rule the other way (templates are never content—lol).We need
html.tag()
—and Tag objects themselves, or at least the representative thing whichhtml.tag()
returns—to store provided arguments as-is (or "flattened" leaving templates in-place and as-is), for lazy evaluation later, when content is being stringified or otherwise processed. In other words, this most certainly depends on #331, but also extends that principle to the entire argument list fortag()
.See also today discussion (#code-quarantine).
The text was updated successfully, but these errors were encountered: