Detect <img> images in markdown rich text
This commit is contained in:
parent
3cc0458468
commit
25aea657e2
2 changed files with 7 additions and 1 deletions
|
@ -104,7 +104,8 @@ module RichText
|
|||
end
|
||||
|
||||
def first_image_element(element)
|
||||
return element if element.type == :img
|
||||
return element if element.type == :img ||
|
||||
(element.type == :html_element && element.value == "img")
|
||||
|
||||
element.children.find do |child|
|
||||
nested_image = first_image_element(child)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue