Closed kwando closed 7 months ago
Yeah this would be very nice. A PR would be appreciated.
@philss can you think of any disadvantages of doing this?
I gave it a shot but had some trouble getting it to work.
Will give it a shot again :)
@philss can you think of any disadvantages of doing this?
No, I like the idea and I don't see a problem right now! I think this would be implemented slightly different if we implement your proposal to Floki. But I think it would work the same :)
This would be nice too.. but not sure how doable that is since "Enum." just turns lists.
for row <- doc["tr"] do
for cell <- row["td"] do
to_string(cell)
end
end
Edit: changed the example
I believe the trick is for the enumerable implementation to emit elements as structs so you can enumerate them and call x[y]
on them.
Cloning in favour of https://github.com/wojtekmach/easyhtml/pull/4.
I think it would be nice to implement the Enumerable for
EasyHTML
.So support for code like this :)