clwiki 3.3.0 → 3.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cl_wiki/format_blockquote.rb +13 -0
- data/lib/cl_wiki/format_pre_blockquote.rb +13 -4
- data/lib/cl_wiki/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a48a499dff277e3edadd047bb0640cbc41ded713baa5699d61af0a8a90fa6c22
|
4
|
+
data.tar.gz: 3359f86f9dfe77c17ee77f99c12ba80e11c7819d2a9c5708b096213bda0bdcc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e527090fcb89733c91ae4345b97756469d54754312b474f80d93b01028a0c26aaeffa0c148fb075d35e0fb21757765052f65cb2be6e300113645d3f6e59706f
|
7
|
+
data.tar.gz: cad24e201ee77c7cacdcd223fd3b00bb49ed7f41fc93f4803b85bd193e9d4b4475d40981df180fd27b552dcbb192616c54aadf7bcfb0661811f46baefd20d716
|
@@ -8,8 +8,21 @@ module ClWiki
|
|
8
8
|
|
9
9
|
def self.format_content(content, page)
|
10
10
|
if content
|
11
|
+
# I wanted to bring this in, similar to my last change to
|
12
|
+
# format_pre_blockquote.rb. But somehow this is impacting how
|
13
|
+
# @content.each_line works in convert_newline_to_br leading to
|
14
|
+
# unexpected results there. I can't figure it out right now and this
|
15
|
+
# isn't that important, so I'm not going to do it right now.
|
16
|
+
|
17
|
+
# Remove 0 or 1 newline at the front of the block
|
18
|
+
# content.gsub!(/\[\]\n?/, '<blockquote>')
|
19
|
+
|
20
|
+
# Remove 0 to 2 newlines after the block to keep things tidy.
|
21
|
+
# content.gsub!(%r{\[/\]\n{0,2}}, '</blockquote>')
|
22
|
+
|
11
23
|
content.gsub!(/\[\]/, '<blockquote>')
|
12
24
|
content.gsub!(%r{\[/\]}, '</blockquote>')
|
25
|
+
|
13
26
|
content
|
14
27
|
end
|
15
28
|
end
|
@@ -8,12 +8,21 @@ module ClWiki
|
|
8
8
|
%r{\[p\].*?\[/p\]}mi
|
9
9
|
end
|
10
10
|
|
11
|
+
# Only matched text is passed in, and whatever is returned is used (i.e. you
|
12
|
+
# don't have to use gsub! you're not modifying the page's) ivar of content.
|
11
13
|
def self.format_content(content, page)
|
12
14
|
content = CGI.escapeHTML(content)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
|
16
|
+
# Remove 0 or 1 newline at the front of the block, to remove the
|
17
|
+
# almost-always-there first newline and prevent a gap always at the top of
|
18
|
+
# every block, but allow additional newlines if the page really wants
|
19
|
+
# newlines at the top of the block
|
20
|
+
content.gsub!(/\[p\]\n?/i, '<blockquote><pre>')
|
21
|
+
|
22
|
+
# Remove 0 to 2 newlines after the block, to remove unnecessary blank
|
23
|
+
# lines in most cases, but keep 3 or more, to allow the page to
|
24
|
+
# intentionally put some blank space after something if necessary.
|
25
|
+
content.gsub!(%r{\[/p\]\n{0,2}}i, '</pre></blockquote>')
|
17
26
|
end
|
18
27
|
end
|
19
28
|
end
|
data/lib/cl_wiki/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clwiki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chrismo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|