ubbparser 0.3.0 → 0.3.1
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 +4 -4
- data/lib/ubbparser.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9830fb133d5398cfb67092aa65f5dae9e683bacf
|
4
|
+
data.tar.gz: 5f37a1b9d10147da2b45ad7ad47369b6f198c2e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a39a8c3563c1ae20ceaf18524c70671dd070246e1ad39cfd9d892400ba76189eb4ff24e577441797360868f92cb2d6881593077361ecc453df3d048cb642455
|
7
|
+
data.tar.gz: 8a4c6991ed9dd2de1048a765a3b75a39d86699ef9d3c28f2e8054d87f257f67fd5675df62d134af6aecd19fe8a6b011d2ed2cd94e676a0a8c679e0997729e411
|
data/lib/ubbparser.rb
CHANGED
@@ -85,9 +85,6 @@ module UBBParser
|
|
85
85
|
until scnr.eos?
|
86
86
|
untagged_text = CGI.escapeHTML(scnr.scan(/[^\[]*/))
|
87
87
|
|
88
|
-
# convert newlines to breaks
|
89
|
-
untagged_text.gsub!(/\n/, '<br />') if (!parse_options.include?(:convert_newlines) || parse_options[:convert_newlines])
|
90
|
-
|
91
88
|
# check for untagged url's
|
92
89
|
uri_pattern = /(((http|https|ftp)\:\/\/)|(www))[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,4}(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9\-\._\?\,\'\/\\\+&%\$#\=~])*[^\.\,\)\(\s]*/
|
93
90
|
untagged_text.gsub!(uri_pattern) { |url,| render_url(url, {}, parse_options) }
|
@@ -96,6 +93,9 @@ module UBBParser
|
|
96
93
|
email_pattern = /(([a-zA-Z0-9_\-\.\+]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?))/
|
97
94
|
untagged_text.gsub!(email_pattern) { |email,| render_email(email, {}, parse_options) }
|
98
95
|
|
96
|
+
# convert newlines to breaks
|
97
|
+
untagged_text.gsub!(/\n/, '<br />') if (!parse_options.include?(:convert_newlines) || parse_options[:convert_newlines])
|
98
|
+
|
99
99
|
result << untagged_text
|
100
100
|
|
101
101
|
# check for the upcoming ubb tag and process it (if valid tag)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ubbparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taco Jan Osinga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple and flexibel ubb parser.
|
14
14
|
email: info@osingasoftware.nl
|