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
If you have a function that generates markup, it needs context to its nesting level where it is called from. For example:
-div()
${generateHelloMessage()}
In this case, generateHelloMessage() needs to have a root nesting of 2 dashes, like so::
function generateHelloMessage() {
return `
--p()
---"Hello world"
`
}
Because of this, now generateHelloMessage() cannot be used in different nesting scenarios. For example:
-div()
${generateHelloMessage()}
--div()
${generateHelloMessage()} <-- will generate incorrect nesting
For this reason, it would be better if generator functions like this don't need to be aware of nesting level, and instead, the caller signifies that anything under it is a child. Something like this:
If you have a function that generates markup, it needs context to its nesting level where it is called from. For example:
In this case,
generateHelloMessage()
needs to have a root nesting of 2 dashes, like so::Because of this, now
generateHelloMessage()
cannot be used in different nesting scenarios. For example:For this reason, it would be better if generator functions like this don't need to be aware of nesting level, and instead, the caller signifies that anything under it is a child. Something like this:
This would automatically add appropriate nesting to the generated markup.
The text was updated successfully, but these errors were encountered: