Class: Markabb::NobbcTag

Inherits:
Object
  • Object
show all
Defined in:
lib/markabb/tags/nobbc.rb

Overview

NoBBC Tag class, can’t use the Markabb::Tag class as this one needs special parsing

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#groupObject

Returns the value of attribute group.



4
5
6
# File 'lib/markabb/tags/nobbc.rb', line 4

def group
  @group
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/markabb/tags/nobbc.rb', line 4

def name
  @name
end

Instance Method Details

#run(s, config) ⇒ Object

Runs the NoBBC Tag

The same as Markabb::Tag.parse



9
10
11
# File 'lib/markabb/tags/nobbc.rb', line 9

def run(s, config)
    s.gsub(/\[nobbc\](.*?)\[\/nobbc\]/) { |b| b.gsub(/\[nobbc\]/,'').gsub(/\[\/nobbc\]/,'').gsub("[","[").gsub("]","&#93") }
end