mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Easier to use mango.css
helper method
This commit is contained in:
parent
9ea26474b4
commit
2a910335af
@ -251,9 +251,14 @@ class Plugin
|
||||
selector = env.require_string 1
|
||||
|
||||
myhtml = Myhtml::Parser.new html
|
||||
json = myhtml.css(selector).map(&.to_html).to_a.to_json
|
||||
ary = myhtml.css(selector).map(&.to_html).to_a
|
||||
|
||||
ary_idx = env.push_array
|
||||
ary.each_with_index do |str, i|
|
||||
env.push_string str
|
||||
env.put_prop_index ary_idx, i.to_u32
|
||||
end
|
||||
|
||||
env.push_string json
|
||||
env.call_success
|
||||
end
|
||||
sbx.put_prop_string -2, "css"
|
||||
|
Loading…
x
Reference in New Issue
Block a user