class Beardown::Document

Constants

REGEXP_BOLD

START_CHAR_STRIKE = “~”

REGEXP_ITALIC
REGEXP_LIST_TODO
REGEXP_LIST_UNORDERED
REGEXP_STRIKE
REGEXP_UNDERLINE
START_CHAR_BOLD
START_CHAR_UNDERLINE

START_CHAR_ITALIC = “*”

Public Class Methods

new(text) click to toggle source
# File lib/beardown/compat/document.rb, line 3
def initialize(text)
  @text = text

  @blocks = [:head, :line_separator, :list_todo,
             :list_unordered, :list_ordered, :quote, :codeblock,
             :asset, :blankline, :p]
  @spans  = [:codespan, :hashtag_full, :hashtag_full_nospace, :hashtag, :linkpost, :linkurl,
             :bold, :italic, :strike, :underline, :mark_nospace, :mark]

  @extensions = Array.new
  @title = String.new
  @tags = Array.new

  html
end

Public Instance Methods

scan_list_todo(s) click to toggle source
# File lib/beardown/compat/list_todo.rb, line 5
def scan_list_todo(s)
  t_count = s[1].length
  check_status = case s[2]
                 when " " then "uncheck"
                 when "x" then "checked"
                 end
  content = s[3]

  #fail "fuck"+REGEXP_LIST_TODO.to_s

  ex_svg = :add_extension_todo_svg
  @extensions << ex_svg unless @extensions.include? ex_svg

  convert_list_todo(t_count, check_status, content)
end