Class: Source2MD::Formatter::TypeText

Inherits:
Base
  • Object
show all
Defined in:
lib/source2md/formatter/type_text.rb

Constant Summary collapse

REGEXP =

“# xxx” “#”

/^#( |$)/

Instance Attribute Summary

Attributes inherited from Base

#element

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Source2MD::Formatter::Base

Class Method Details

.accept?(element) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/source2md/formatter/type_text.rb', line 8

def self.accept?(element)
  element.body.lines.all? { |e| e.match?(REGEXP) }
end

Instance Method Details

#to_mdObject



12
13
14
# File 'lib/source2md/formatter/type_text.rb', line 12

def to_md
  body
end