- def first_paragraph_element(element)
- return element if paragraph?(element)
-
- element.children.find do |child|
- nested_paragraph = first_paragraph_element(child)
- break nested_paragraph if nested_paragraph
+ def first_truncated_text_content(element)
+ if paragraph?(element)
+ truncated_text_content(element)
+ else
+ element.children.find do |child|
+ text = first_truncated_text_content(child)
+ break text unless text.nil?
+ end