Class: Sablon::Content::Markdown

Inherits:
Struct
  • Object
show all
Includes:
Sablon::Content
Defined in:
lib/sablon/content.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Sablon::Content

make, register, remove, wrap

Constructor Details

#initialize(markdown) ⇒ Markdown



85
86
87
88
89
90
# File 'lib/sablon/content.rb', line 85

def initialize(markdown)
  warn "[DEPRECATION] `Sablon::Content::Markdown` is deprecated.  Please use `Sablon::Content::HTML` instead."
  redcarpet = ::Redcarpet::Markdown.new(::Redcarpet::Render::HTML.new)
  word_ml = Sablon.content(:html, redcarpet.render(markdown))
  super word_ml
end

Instance Attribute Details

#word_mlObject

Returns the value of attribute word_ml



80
81
82
# File 'lib/sablon/content.rb', line 80

def word_ml
  @word_ml
end

Class Method Details

.idObject



82
# File 'lib/sablon/content.rb', line 82

def self.id; :markdown end

.wraps?(value) ⇒ Boolean



83
# File 'lib/sablon/content.rb', line 83

def self.wraps?(value) false end

Instance Method Details

#append_to(*args) ⇒ Object



92
93
94
# File 'lib/sablon/content.rb', line 92

def append_to(*args)
  word_ml.append_to(*args)
end