Closed MrSorcus closed 3 years ago
this works:
nodes = lexbor.nodes(:_em_comment).to_a
nodes.each(&.remove!)
puts lexbor.body!.to_html
I think need to change example: because nodes
in this line lexbor.nodes(:_em_comment).each(&.remove!)
is iterator, not materialized array. And removing while iterating, something like break things.
Should print
<body> </body>
, but instead print<body><!-- bar --> <!-- baz --></body>
. Or it doesn't work like that?