- # Each paragraph consists of a bunch of children. Some are text, some are tags, like <i>, with their own children (the content of the tags).
- #
- # This implies that in order to get *just* the text, without any markup, we'll need a recursive function to get all the text.
- def just_text el
- s = ""
- el.children.each do |child|
- s += (child.name == "text") ? child.text : just_text(child)
- end
- s
- end