lib/kitchen/note_element.rb
# Returns the note's title element
#
# @return [Element, nil]
#
Returns the note's title element
Returns the note ' s title element
def title
      block_error_if(block_given?)
      first_child = first_note_body_child
      return unless first_child
      first_grandchild = get_first_grandchild_for_title(first_child)
      if first_child.data_type == 'title'
        first_child
      elsif first_grandchild&.data_type == 'title'
        first_grandchild
      end
    end
def title block_error_if ( block_given? ) first_child = first_note_body_child return unless first_child first_grandchild = get_first_grandchild_for_title ( first_child ) if first_child . data_type == 'title' first_child elsif first_grandchild &. data_type == 'title' first_grandchild end end
Returns the note's title element
Returns the note ' s title element
# An element with data-type="title" is ambiguous; it is only the note's title if: # 1. it is the note body's first child # 2. it is the first child's first child and the first child is a paragraph
None
Element, nil