Class: HamdownCore::Ast::BaseText

Inherits:
Struct
  • Object
show all
Defined in:
lib/hamdown_core/ast.rb

Direct Known Subclasses

HtmlListEnd, HtmlListItem, Text

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBaseText

Returns a new instance of BaseText.



138
139
140
141
142
143
# File 'lib/hamdown_core/ast.rb', line 138

def initialize(*)
  super
  if escape_html.nil?
    self.escape_html = true
  end
end

Instance Attribute Details

#escape_htmlObject

Returns the value of attribute escape_html

Returns:

  • (Object)

    the current value of escape_html



137
138
139
# File 'lib/hamdown_core/ast.rb', line 137

def escape_html
  @escape_html
end

#filenameObject

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



137
138
139
# File 'lib/hamdown_core/ast.rb', line 137

def filename
  @filename
end

#linenoObject

Returns the value of attribute lineno

Returns:

  • (Object)

    the current value of lineno



137
138
139
# File 'lib/hamdown_core/ast.rb', line 137

def lineno
  @lineno
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



137
138
139
# File 'lib/hamdown_core/ast.rb', line 137

def text
  @text
end

Instance Method Details

#markdownable?Boolean

Returns:

  • (Boolean)


149
150
151
# File 'lib/hamdown_core/ast.rb', line 149

def markdownable?
  true
end

#to_hObject



145
146
147
# File 'lib/hamdown_core/ast.rb', line 145

def to_h
  super.merge(type: 'text')
end