thredded-bbcode 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/thredded/bbcode.rb +8 -8
- data/lib/thredded/bbcode/filter.rb +1 -0
- data/lib/thredded/bbcode/railtie.rb +1 -0
- data/lib/thredded/bbcode/version.rb +2 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 432dd0f1c1b49936b291c1cae007355593682791818b473429c9f1696473807e
|
4
|
+
data.tar.gz: 046fc3dbe867d69d4c0ff1666318ca8088896c95f8a26a3b19f1fb301394849e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d521a791fdf34a23a4175ad0d3078c4b9458ee1e93bff2bb5063f9f0d35f01125ab5303d2f6ecf89605fe689d9620a92b3b8b41ee1262dd1c6239f682ad0cad
|
7
|
+
data.tar.gz: dae3530d9d1fa68949eb62a11c588dbb05da5268da18863051fd3558ed2a2e59a72f4a39acadf2ea95fd247bd3a5b8611987084074feb0eb144a6d8884c57770
|
data/lib/thredded/bbcode.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'thredded/bbcode/version'
|
3
4
|
require 'thredded/bbcode/railtie' if defined?(Rails)
|
4
5
|
require 'thredded/bbcode/filter'
|
@@ -7,26 +8,25 @@ module Thredded
|
|
7
8
|
module BBCode
|
8
9
|
class << self
|
9
10
|
attr_accessor :options
|
11
|
+
attr_accessor :spoiler_tags
|
10
12
|
|
11
13
|
def setup!
|
12
14
|
Thredded::ContentFormatter.markup_filters.unshift(
|
13
15
|
Thredded::BBCode::Filter
|
14
16
|
)
|
17
|
+
Thredded::HtmlPipeline::SpoilerTagFilter.spoiler_tags = (
|
18
|
+
Thredded::HtmlPipeline::SpoilerTagFilter.spoiler_tags +
|
19
|
+
spoiler_tags.map { |name| %W[[#{name}] [/#{name}]] }
|
20
|
+
).uniq
|
15
21
|
BBCoder.configure do
|
16
22
|
tag :img, match: %r{^https?://.*(png|bmp|jpe?g|gif)$},
|
17
23
|
singular: false do
|
18
24
|
%(<img src="#{singular? ? meta : content}" />)
|
19
25
|
end
|
20
|
-
|
21
|
-
tag :spoilers do
|
22
|
-
%(<span class="thredded--post--content--spoiler">#{content}</span>)
|
23
|
-
end
|
24
|
-
|
25
|
-
tag :spoiler do
|
26
|
-
%(<span class="thredded--post--content--spoiler">#{content}</span>)
|
27
|
-
end
|
28
26
|
end
|
29
27
|
end
|
30
28
|
end
|
29
|
+
|
30
|
+
self.spoiler_tags = %w[spoiler]
|
31
31
|
end
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thredded-bbcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Mazovetskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bbcoder
|
@@ -25,33 +25,33 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '3.5'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '3.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rubocop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0.57'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0.57'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: simplecov
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.15.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.15.0
|
83
83
|
description: Adds basic BBCode support to Thredded via the bbcoder gem.
|
84
84
|
email:
|
85
85
|
- glex.spb@gmail.com
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project:
|
116
|
-
rubygems_version: 2.6
|
116
|
+
rubygems_version: 2.7.6
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: Adds BBCode support to Thredded.
|