Class: PreTag::UnselectableTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
pre.rb

Overview

"""{% noselect %} or {% noselect this all gets copied. Also, space before the closing percent is signficant %}"""

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, text, tokens) ⇒ UnselectableTag

Returns a new instance of UnselectableTag.



54
55
56
57
58
59
60
# File 'pre.rb', line 54

def initialize(tag_name, text, tokens)
  super(tag_name, text, tokens)
  @content = text  # puts "UnselectableTag: content1= '#{@content}'"

  @content = '$ ' if @content.nil? || @content.empty?  # puts "UnselectableTag: content2= '#{@content}'"

end

Instance Method Details

#render(_) ⇒ Object



62
63
64
# File 'pre.rb', line 62

def render(_)
  "<span class='unselectable'>#{@content}</span>"
end