class MarkdownExec::FCB

def derive_title_from_body

Returns:
  • (String) - The derived title.

Parameters:
  • fcb (Object) -- The FCB object whose title is to be derived.
def derive_title_from_body
  unless (body_content = @attrs[:body])
    # empty body -> empty title
    @attrs[:title] = ''
    return
  end
  # body -> title
  @attrs[:title] = if body_content.count == 1
                     body_content.first
                   else
                     format_multiline_body_as_title(body_content)
                   end
end