create table of fmt nodes #1337
Closed
AkashdeepArjun
started this conversation in
General
Replies: 1 comment 4 replies
-
Hi :) You don't have to use s({trig = "div(%d+)", regTrig=true}, {
d(1, function(args, parent)
local nodes = {}
for idx = 1, parent.snippet.captures[1] do
table.insert(nodes, t"<div>")
table.insert(nodes, i(idx, tostring(idx)))
table.insert(nodes, t"</div>")
-- add a linebreak
table.insert(nodes, t{"", ""})
end
-- remove trailing linebreak
nodes[#nodes] = nil
return sn(nil, nodes)
end)
})
{ {node1, node2}, {node3, node4} } instead of the expected {node1, node2, node3, node4} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi there i intend to make snipet that returns dynamic node that gives table of fmt ..so far this is what i have tried
Beta Was this translation helpful? Give feedback.
All reactions