There is a lambda function you could use. mustache(5) - Logic-less templates.
But, it may just be simpler to use a string literal
template in a function node.
here is a example of three ways
[{"id":"d59e0171.98ced","type":"inject","z":"da8a6ef0b3c9a5c8","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"[null,null,[{\"@id\":1}]]","payloadType":"json","x":130,"y":3920,"wires":[["f7e3199384a26e96","2a710bcb05a7a572","4af34fe8c4e91e62"]]},{"id":"f7e3199384a26e96","type":"change","z":"da8a6ef0b3c9a5c8","name":"","rules":[{"t":"set","p":"payload[2][0][\"@id\"]","pt":"msg","to":"$$.payload[2][0].`@id`> 0 ? \"<some html>\" : \"\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":3980,"wires":[["1f7af96e327ca29b"]]},{"id":"2a710bcb05a7a572","type":"function","z":"da8a6ef0b3c9a5c8","name":"function 20","func":"msg.payload = `<html>\n${(msg.payload[2][0][\"@id\"] > 0 ? \"<some html>\" : \"\")}\n</html>`\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":4080,"wires":[["00df87aa1a12b70e"]]},{"id":"4af34fe8c4e91e62","type":"function","z":"da8a6ef0b3c9a5c8","name":"function 21","func":"msg.wrapped = function() {\n return function(text, render) {\n text = Number(render(text)) > 0 ? \"<some html again>\" : \"\"\n return text\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":3920,"wires":[["71a414885e5a8651"]]},{"id":"96ebd467845b3c7c","type":"inject","z":"da8a6ef0b3c9a5c8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"[null,null,[{\"@id\":0}]]","payloadType":"json","x":130,"y":4020,"wires":[["f7e3199384a26e96","2a710bcb05a7a572","4af34fe8c4e91e62"]]},{"id":"1f7af96e327ca29b","type":"template","z":"da8a6ef0b3c9a5c8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n{{{payload.2.0.@id}}}\n</html>","output":"str","x":600,"y":3980,"wires":[["00df87aa1a12b70e"]]},{"id":"00df87aa1a12b70e","type":"debug","z":"da8a6ef0b3c9a5c8","name":"debug 228","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":750,"y":3980,"wires":[]},{"id":"71a414885e5a8651","type":"template","z":"da8a6ef0b3c9a5c8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n{{#wrapped}}\n{{payload.2.0.@id}}\n{{/wrapped}}\n\n</html>","output":"str","x":540,"y":3920,"wires":[["00df87aa1a12b70e"]]}]