Class: Markabb::NobbcTag
- Inherits:
-
Object
- Object
- Markabb::NobbcTag
- 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
-
#group ⇒ Object
Returns the value of attribute group.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#run(s, config) ⇒ Object
Runs the NoBBC Tag.
Instance Attribute Details
#group ⇒ Object
Returns the value of attribute group.
4 5 6 |
# File 'lib/markabb/tags/nobbc.rb', line 4 def group @group end |
#name ⇒ Object
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("]","]") } end |