trainbbcode 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/lib/trainbbcode.rb +9 -3
- data/trainbbcode.gemspec +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/trainbbcode.rb
CHANGED
@@ -157,9 +157,12 @@ class TBBC
|
|
157
157
|
end
|
158
158
|
def coderay(s)
|
159
159
|
scan=s.scan(/\[code lang=(.+?)\](.+?)\[\/code\]/m)
|
160
|
-
|
161
|
-
|
162
|
-
|
160
|
+
scan.each do |a|
|
161
|
+
parse=a[1].gsub("<","<").gsub(">",">")
|
162
|
+
lang=a[0]
|
163
|
+
s=s.gsub(/\[code lang=.+?\]#{a[1]}\[\/code\]/m,"[nobbc]" + CodeRay.scan(parse, lang).div(:css => :class, :line_numbers => @config[:syntax_highlighting_line_numbers]) + "[/nobbc]")
|
164
|
+
end
|
165
|
+
s
|
163
166
|
end
|
164
167
|
end
|
165
168
|
|
@@ -171,3 +174,6 @@ class String
|
|
171
174
|
bbc.parse(self)
|
172
175
|
end
|
173
176
|
end
|
177
|
+
|
178
|
+
t=TBBC.new
|
179
|
+
puts t.parse("[code lang=ruby]def test\nputs \"MMMMMMMUlti Line\"\nend[/code]\nThis is a bit more text\n[code lang=ruby]a=\"TESTING\"[/code]")
|
data/trainbbcode.gemspec
CHANGED