bbcode-rails 0.9.2 → 0.9.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 347807d619401620f7eb88ad15405a00867bf570
4
- data.tar.gz: 0f167fefb0c8fc6ab4a0ab0b2c2bc440b4a17bd0
3
+ metadata.gz: 3aa8fab0bb526ca10fe4155bf805ad7d67ee8979
4
+ data.tar.gz: ce9c6146c7510e85d14b5402889f18fa559faf3d
5
5
  SHA512:
6
- metadata.gz: 3632535904a3db28cd65540545b026b0fcae76544ac6756bc8ac7362396e7e02d3d9b3746cff310cb0e103f3aaa642092cf66dcbe91d529465cbe17e3028c3ce
7
- data.tar.gz: 198b3be08e56674d2385bbafeb84236fc479917c4ca93ae504d9535d44b18270f988ed86c62cf31f06311db0317f1747981be4a6ccb2d3b4b4ba54a5cba795bd
6
+ metadata.gz: 4854f8e1b3263f11005ad609b5ac34d4e0ee67ee4f1d30753b33e4c2f0fb7f32852d99f5e4117b018fbb242815f9cc0093e65508aa60f6577d343c304581a2aa
7
+ data.tar.gz: e84cda55cccbbe6deb557c5110f49d001821e1f107f998d8e49a5e6d3c45c5457d6ee20b0d4e523770b69db472b7271bdef801a6a280955837a73669d9b0f123
@@ -1,3 +1,3 @@
1
1
  module BBCode
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
data/lib/bbcode-rails.rb CHANGED
@@ -160,7 +160,9 @@ module BBCode
160
160
  start_tag = '<p>'
161
161
  result_str.gsub!(/\r\n?/, "\n") # \r\n and \r => \n
162
162
  result_str.gsub!(/\n\n+/, "</p>\n\n#{start_tag}") # 2+ newline => paragraph
163
- result_str.gsub!(/([^\n]\n)(?=[^\n])/, '\1<br>') # 1 newline => br
163
+ result_str.gsub!(/([^\n>]\n)(?=[^\n<])/, '\1<br>')# 1 newline => br
164
+ result_str.gsub!(/(>)\n+/, '\1') # 1 newline around tags => nothing
165
+ result_str.gsub!(/\n+(<)/, '\1') # 1 newline around tags => nothing
164
166
  result_str.insert 0, start_tag
165
167
  result_str << '</p>'
166
168
  rescue BBCode::ParseError => e
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbcode-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcel Müller