trainbbcode 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/trainbbcode.rb +3 -1
- data/trainbbcode.gemspec +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/trainbbcode.rb
CHANGED
@@ -156,11 +156,13 @@ class TBBC
|
|
156
156
|
s=s.gsub(/<br \/><\/(ul|li|table|tr|td|th)/,'</\1')
|
157
157
|
end
|
158
158
|
def coderay(s)
|
159
|
+
s=s.gsub("\r","")
|
159
160
|
scan=s.scan(/\[code lang=(.+?)\](.+?)\[\/code\]/m)
|
160
161
|
scan.each do |a|
|
161
162
|
parse=a[1].gsub("<","<").gsub(">",">")
|
162
163
|
lang=a[0]
|
163
|
-
|
164
|
+
parsed="[nobbc]" + CodeRay.scan(parse, lang).div(:css => :class, :line_numbers => @config[:syntax_highlighting_line_numbers]) + "[/nobbc]"
|
165
|
+
s=s.gsub("[code lang=#{a[0]}]#{a[1]}[/code]",parsed)
|
164
166
|
end
|
165
167
|
s
|
166
168
|
end
|
data/trainbbcode.gemspec
CHANGED