instance method
ancestor_named?
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
ancestor_named?(node, names, max_depth:)
No documentation comment.
Parameters
-
nodereq -
namesreq -
max_depthkeyreq
Source
# File actiontext/lib/action_text/markdown_conversion.rb, line 396
def ancestor_named?(node, names, max_depth:)
current = node.parent
max_depth.times do
break unless current&.element?
return true if current.name.in?(names)
current = current.parent
end
false
end
Defined in actiontext/lib/action_text/markdown_conversion.rb line 396
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionText::MarkdownConversion