clwiki 3.2.5 → 3.2.6
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/engine.rb +6 -0
- data/lib/cl_wiki/format_blockquote.rb +12 -10
- data/lib/cl_wiki/version.rb +1 -1
- data/lib/cl_wiki_lib.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88f3646fc174c186690fa0704bf8eea487dd0b9aa04192d1dada2048215a84b1
|
4
|
+
data.tar.gz: 19e1e949c5db182f1ccd98069f9a6bbe8b251db3d3cd557d7229c1d4204f0d75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adb5a002ccaaf9eb214008caf18922f55e4f1c64aea000f46cc15815c7d0b72d54b36ba78440aba9a2e4d95740453c0de1b6a0d5ee04e8f2cc1c99403519e423
|
7
|
+
data.tar.gz: 7de2d1f85a2f7b42aeea640da0822c6a81a269a4ee7f07d5efacfccee5e649ce801f01fa8bbd585e21fc4265657ffc0ad98f4e605d4754424bab64df591add23
|
data/lib/cl_wiki/engine.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# This seems a little unnecessary here, having done a bunch of zeitwerk stuff
|
4
|
+
# for auto-loading, but the formatters need to be referenced somehow in order to
|
5
|
+
# be loaded, and then registered ... but - this is working, and this ain't for
|
6
|
+
# nothing but my silly website.
|
7
|
+
require_relative '../cl_wiki_lib'
|
8
|
+
|
3
9
|
module ClWiki
|
4
10
|
class Engine < ::Rails::Engine
|
5
11
|
isolate_namespace ClWiki
|
@@ -1,17 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
module ClWiki
|
4
|
+
class FormatBlockquote < ClWiki::CustomFormatter
|
5
|
+
def self.match_re
|
6
|
+
%r{\[\].*\[/\]}m
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
def self.format_content(content, page)
|
10
|
+
if content
|
11
|
+
content.gsub!(/\[\]/, '<blockquote>')
|
12
|
+
content.gsub!(%r{\[/\]}, '</blockquote>')
|
13
|
+
content
|
14
|
+
end
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
17
|
-
ClWiki::CustomFormatters.instance.register(FormatBlockquote)
|
19
|
+
ClWiki::CustomFormatters.instance.register(ClWiki::FormatBlockquote)
|
data/lib/cl_wiki/version.rb
CHANGED
data/lib/cl_wiki_lib.rb
CHANGED
@@ -16,7 +16,7 @@ require File.expand_path('cl_wiki/custom_footers', __dir__)
|
|
16
16
|
require File.expand_path('cl_wiki/custom_formatter', __dir__)
|
17
17
|
require File.expand_path('cl_wiki/custom_formatters', __dir__)
|
18
18
|
|
19
|
-
Dir[File.join(__dir__, 'cl_wiki', '
|
19
|
+
Dir[File.join(__dir__, 'cl_wiki', 'format_*.rb')].each do |fn|
|
20
20
|
require fn
|
21
21
|
end
|
22
22
|
|