Sha256: 4d099e0bc57a02c73113856757ab0f0ad33d496c2ef0cfd68a3475c7b437e2ae
Contents?: true
Size: 402 Bytes
Versions: 46
Compression:
Stored size: 402 Bytes
Contents
# frozen_string_literal: true module Tocer module Parsers # Represents a Markdown header. class Header PUNCTUATION = "#" def initialize markdown @markdown = markdown end def prefix = String(markdown[/#{PUNCTUATION}{1,}/o]) def content = markdown[prefix.length + 1, markdown.length].strip private attr_reader :markdown end end end
Version data entries
46 entries across 46 versions & 1 rubygems