Skip to content

Commit

Permalink
html() runs DOMcontentsubvars over its contents
Browse files Browse the repository at this point in the history
  • Loading branch information
christianp committed Dec 15, 2021
1 parent e22dc4d commit 990d86f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion runtime/scripts/jme-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,16 @@ newBuiltin('formatstring',[TString,TList],TString,null, {
});
newBuiltin('unpercent',[TString],TNum,util.unPercent);
newBuiltin('letterordinal',[TNum],TString,util.letterOrdinal);
newBuiltin('html',[TString],THTML,function(html) { return $(html) });
newBuiltin('html',[TString],THTML,null, {
evaluate: function(args, scope) {
var elements = $(args[0].value);
var subber = new jme.variables.DOMcontentsubber(scope);
$(elements).each(function() {
subber.subvars(this);
});
return new THTML(elements);
}
});
newBuiltin('isnonemptyhtml',[TString],TBool,function(html) {
return util.isNonemptyHTML(html);
});
Expand Down

0 comments on commit 990d86f

Please sign in to comment.