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
I use pug-vdom to enable Pug templates to be used with the Hyperapp framework. This worked great, until the framework added a new function text() in parallel with h() to separately process virtual text nodes. As per this snippet h("h1", {}, text("To do list")). I generated a work-around in this repo with a local copy of pug-vdom.
So now the following simple template fails
div
// receives the <greet> variable from the supplied state object- var greeting ="Hello "+ greet
p(style={color:"red"})#{greeting}
input(size="60"placeholder=placeholder onchange=handler.updateMe)
button(id='clickMe'onclick=handler.clickMe) Click Me
p #{userText}
Because the greeting in n2Child is represented by a string in the following rather than what's returned from h().
So I would like to change pug-vdom.js to optionally support a text() function as follows, where the generated render(context, h) has a new optional function arg that is used by visitText and visitCode:
I use pug-vdom to enable Pug templates to be used with the Hyperapp framework. This worked great, until the framework added a new function
text()
in parallel withh()
to separately process virtual text nodes. As per this snippeth("h1", {}, text("To do list"))
. I generated a work-around in this repo with a local copy of pug-vdom.So now the following simple template fails
Because the
greeting
inn2Child
is represented by a string in the following rather than what's returned fromh()
.For Hyperapp, I need to call
text(greeting)
, making it a virtual textNode as follows:So I would like to change pug-vdom.js to optionally support a
text()
function as follows, where the generatedrender(context, h)
has a new optional function arg that is used byvisitText
andvisitCode
:The text was updated successfully, but these errors were encountered: