Class: Alula::BlockquoteTag

Inherits:
Block
  • Object
show all
Defined in:
lib/alula/core_ext/tags/blockquote.rb

Instance Attribute Summary

Attributes included from LiquidExt

#context

Instance Method Summary collapse

Methods included from LiquidExt

included, #initialize

Instance Method Details

#render(context) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/alula/core_ext/tags/blockquote.rb', line 3

def render(context)
  quote = super
  
  tag = "<blockquote>"
  tag += quote
  if @options["author"] or @source
    tag += "<div class=\"source\">"
    tag += " &mdash; " if @options["author"] and @source.empty?
    tag += "<strong>#{@options["author"]}</strong>" if @options["author"]
    tag += " &mdash; " if @options["author"] and !@source.empty?
    tag += "<cite>#{@source}</cite>" if @source
    tag += "</div>"
  end
  tag += "</blockquote>"
end