trainbbcode 0.3.4 → 0.3.5

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 CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('trainbbcode','0.3.4') do |p|
5
+ Echoe.new('trainbbcode','0.3.5') do |p|
6
6
  p.description = "Provides BBCode for Ruby."
7
7
  p.url = "http://www.arcath.net/pages/2"
8
8
  p.author = "Adam \"Arcath\" Laycock"
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("&lt;","<").gsub("&gt;",">")
162
163
  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
+ 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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{trainbbcode}
5
- s.version = "0.3.4"
5
+ s.version = "0.3.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Adam \"Arcath\" Laycock"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trainbbcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam "Arcath" Laycock