clwiki 3.2.5 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18900683f87266b7a2c5b8b449910761885c1b8560833c2c1552a1dcc06ea422
4
- data.tar.gz: 4de460a24cd59205616b0cf3cbe8ce627f0fc4a9af1542593e22a3b6454f3254
3
+ metadata.gz: 051dbf9e39cf68f41e5c69a886a10557804c72e6e5db49ea07960c6276da83f1
4
+ data.tar.gz: 467f17ad5a7c80f357507c4db86c5d508cb9206508fd0f2ea91ebfc5af56f118
5
5
  SHA512:
6
- metadata.gz: 56c8759000fdfb0bc0bdfdcdc8996f90f788161d33b95e1289de60c9513504bcd5a739b6defb066a1489ec08df65f9eaf5028ea8f8c5851be0bcb1cc0b592091
7
- data.tar.gz: 97ff51ddb7b6840bed6df586f1a92c4137b124a8a0bbc8a8cb894d4b1ed7f65f6b442a5a53006355fe9d17be1fd5e37b0d87a4fea628e4f124e9783c1edd1259
6
+ metadata.gz: d5e2a0a569e6d24a7a80b19c78586a76fef848fe68415c6b22278fd008fcd90cb4af631a5fb87ee29e6c7f46d5071e286aad157552c39d74a1e1791c21410b03
7
+ data.tar.gz: 5706ffbcb5220cb91a44eee7005eb5a9c14af1f89ae33d67f614ff688663def87610d66a987f6c2323c0fff48d4e8cc5b4b0a28c0cc0b1b354cdba6ce5a32592
@@ -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
- class FormatBlockquote < ClWiki::CustomFormatter
4
- def self.match_re
5
- %r{\[\].*\[/\]}m
6
- end
3
+ module ClWiki
4
+ class FormatBlockquote < ClWiki::CustomFormatter
5
+ def self.match_re
6
+ %r{\[\].*\[/\]}m
7
+ end
7
8
 
8
- def self.format_content(content, page)
9
- if content
10
- content.gsub!(/\[\]/, '<blockquote>')
11
- content.gsub!(%r{\[/\]}, '</blockquote>')
12
- content
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)
@@ -10,7 +10,9 @@ module ClWiki
10
10
 
11
11
  def self.format_content(content, page)
12
12
  content = CGI.escapeHTML(content)
13
+ content.gsub!(/\[p\]\n/i, '<blockquote><pre>')
13
14
  content.gsub!(/\[p\]/i, '<blockquote><pre>')
15
+ content.gsub!(%r{\[/p\]\n}i, '</pre></blockquote>')
14
16
  content.gsub!(%r{\[/p\]}i, '</pre></blockquote>')
15
17
  end
16
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClWiki
4
- VERSION = '3.2.5'
4
+ VERSION = '3.3.0'
5
5
  end
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', 'format', '*.rb')].each do |fn|
19
+ Dir[File.join(__dir__, 'cl_wiki', 'format_*.rb')].each do |fn|
20
20
  require fn
21
21
  end
22
22