jekyll_href 1.2.6 → 1.2.7
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/.rubocop.yml +5 -3
- data/CHANGELOG.md +103 -43
- data/README.md +197 -99
- data/jekyll_href.gemspec +1 -2
- data/lib/href_match.rb +43 -0
- data/lib/href_page_title.rb +49 -0
- data/lib/href_private.rb +143 -0
- data/lib/href_summary.rb +39 -0
- data/lib/href_summary_tag.rb +17 -6
- data/lib/href_tag.rb +21 -195
- data/lib/jekyll_href/version.rb +1 -1
- data/lib/jekyll_href.rb +1 -2
- data/spec/{hash_array_spec.rb → hash_array_spec/hash_array_spec.rb} +1 -1
- data/spec/spec_helper.rb +0 -2
- data/spec/status_persistence.txt +13 -13
- metadata +10 -20
data/lib/href_private.rb
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
module MSlinn
|
2
|
+
class HRefTag
|
3
|
+
private
|
4
|
+
|
5
|
+
# Does not look at or compute @link
|
6
|
+
def compute_linkk
|
7
|
+
return @link, nil if @link
|
8
|
+
|
9
|
+
linkk = @url
|
10
|
+
if linkk.nil? || !linkk
|
11
|
+
linkk = @helper.argv&.shift
|
12
|
+
@helper.params&.shift
|
13
|
+
@helper.keys_values&.delete(linkk)
|
14
|
+
return nil, error_no_uri if linkk.nil?
|
15
|
+
elsif @url.to_s.empty?
|
16
|
+
return nil, error_no_uri
|
17
|
+
end
|
18
|
+
[linkk, nil]
|
19
|
+
rescue HRefError => e
|
20
|
+
[nil, e]
|
21
|
+
end
|
22
|
+
|
23
|
+
def error_no_uri
|
24
|
+
msg = <<~END_MESSAGE
|
25
|
+
No URL was provided on #{@path}:#{@line_number} (after front matter).
|
26
|
+
<pre>{% href #{@argument_string.strip} %}</pre>
|
27
|
+
END_MESSAGE
|
28
|
+
@logger.error { JekyllPluginHelper.remove_html_tags msg.strip }
|
29
|
+
"<div class='href_error'>HRefError: #{msg}</div>"
|
30
|
+
end
|
31
|
+
|
32
|
+
# Sets @follow, @helper, @match, @path, @shy, @target, @url, @wbr
|
33
|
+
def globals_initial
|
34
|
+
@path = @page['path']
|
35
|
+
AllCollectionsHooks.compute(@site)
|
36
|
+
|
37
|
+
@blank = @helper.parameter_specified? 'blank'
|
38
|
+
@klass = @helper.parameter_specified? 'class'
|
39
|
+
@follow = @helper.parameter_specified?('follow') ? '' : " rel='nofollow'"
|
40
|
+
@label = @helper.parameter_specified? 'label'
|
41
|
+
@match = @helper.parameter_specified? 'match'
|
42
|
+
@shy = @helper.parameter_specified? 'shy'
|
43
|
+
@style = @helper.parameter_specified? 'style'
|
44
|
+
@summary = @helper.parameter_specified? 'summary'
|
45
|
+
@summary_exclude = @helper.parameter_specified? 'summary_exclude'
|
46
|
+
@target = @blank ? " target='_blank'" : nil
|
47
|
+
@target ||= @helper.parameter_specified?('notarget') ? '' : " target='_blank'"
|
48
|
+
@url = @helper.parameter_specified? 'url'
|
49
|
+
@wbr = @helper.parameter_specified? 'wbr'
|
50
|
+
|
51
|
+
@label_source = if @helper.parameter_specified? 'page_title'
|
52
|
+
:from_page_title
|
53
|
+
elsif @label
|
54
|
+
:from_explicit_label
|
55
|
+
else
|
56
|
+
:from_implicit_label
|
57
|
+
end
|
58
|
+
|
59
|
+
return unless @tag_config
|
60
|
+
|
61
|
+
@die_on_href_error = @tag_config['die_on_href_error'] == true
|
62
|
+
@die_on_nomatch = @tag_config['die_on_nomatch'] == true
|
63
|
+
@pry_on_href_error = @tag_config['pry_on_href_error'] == true
|
64
|
+
end
|
65
|
+
|
66
|
+
# Might set @external_link, @follow, @local_link, @linkk, @target, and @text
|
67
|
+
def globals_update(tokens, linkk)
|
68
|
+
if linkk.start_with? 'mailto:'
|
69
|
+
handle_mailto linkk
|
70
|
+
return
|
71
|
+
else
|
72
|
+
if @label_source == :from_page_title
|
73
|
+
handle_page_title linkk
|
74
|
+
return
|
75
|
+
end
|
76
|
+
@text = @label || tokens.join(' ').strip
|
77
|
+
if @text.to_s.empty?
|
78
|
+
handle_empty_text linkk
|
79
|
+
else
|
80
|
+
handle_text linkk
|
81
|
+
end
|
82
|
+
@link_save = @link
|
83
|
+
end
|
84
|
+
|
85
|
+
if @external_link
|
86
|
+
@target = ''
|
87
|
+
return
|
88
|
+
end
|
89
|
+
@follow = ''
|
90
|
+
@target = '' unless @blank
|
91
|
+
end
|
92
|
+
|
93
|
+
def handle_empty_text(linkk)
|
94
|
+
text = linkk
|
95
|
+
text = linkk&.gsub('/', '/­') if @shy
|
96
|
+
text = linkk&.gsub('/', '/<wbr>') if @wbr
|
97
|
+
@text = "<code>#{text}</code>"
|
98
|
+
@external_link = linkk.start_with? 'http'
|
99
|
+
@local_link = !@external_link
|
100
|
+
@mailto_link = false
|
101
|
+
@link = if @external_link
|
102
|
+
linkk
|
103
|
+
elsif insecure_ip_address linkk
|
104
|
+
"http://#{linkk}"
|
105
|
+
else
|
106
|
+
"https://#{linkk}"
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def handle_mailto(linkk)
|
111
|
+
@mailto_link = true
|
112
|
+
@local_link = @external_link = false
|
113
|
+
@link = linkk
|
114
|
+
@target = @follow = ''
|
115
|
+
@text = @helper.argv.join(' ')
|
116
|
+
return unless @text.empty?
|
117
|
+
|
118
|
+
text = linkk.delete_prefix('mailto:')
|
119
|
+
@text = "<code>#{text}</code>"
|
120
|
+
end
|
121
|
+
|
122
|
+
def handle_text(linkk)
|
123
|
+
@link = if @shy
|
124
|
+
linkk&.gsub('/', '/­')
|
125
|
+
elsif @wbr
|
126
|
+
linkk&.gsub('/', '/<wbr>')
|
127
|
+
else
|
128
|
+
linkk
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def insecure_ip_address(string)
|
133
|
+
return true if string.start_with? 'localhost'
|
134
|
+
|
135
|
+
return false unless IPAddress.valid? string
|
136
|
+
|
137
|
+
ip_address = IPAddress string
|
138
|
+
true if ip_address.loopback? || ip_address.private?
|
139
|
+
ensure
|
140
|
+
false
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
data/lib/href_summary.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
module MSlinn
|
2
|
+
class HRefTag
|
3
|
+
private
|
4
|
+
|
5
|
+
def save_summary
|
6
|
+
return if @summary_exclude || @link_save.start_with?('mailto:') || @link_save.start_with?('#')
|
7
|
+
|
8
|
+
@summary = @summary.to_s.empty? ? @text : @summary.to_s
|
9
|
+
if @summary == true
|
10
|
+
warning = <<~END_WARNING
|
11
|
+
Warning: a href plugin keyword option was detected in the link text for #{@path} on line #{line_number}.
|
12
|
+
The href tag will not be included in the summary, and the link text will not have the word summary included.
|
13
|
+
This is probably unintentional. Consider using the label option to correct this problem."
|
14
|
+
END_WARNING
|
15
|
+
puts warning.red
|
16
|
+
return
|
17
|
+
end
|
18
|
+
return if @summary.class != String || @summary.empty?
|
19
|
+
|
20
|
+
@summary = @summary[0].upcase + @summary[1..]
|
21
|
+
@summary_href = "<a href='#{@link_save}'#{@target}#{@follow}>#{@summary}</a>"
|
22
|
+
mini_href = MiniHref.new(
|
23
|
+
follow: @follow,
|
24
|
+
html: @summary_href,
|
25
|
+
line_number: @line_number,
|
26
|
+
link: @link_save,
|
27
|
+
link_save: @link_save,
|
28
|
+
path: @path,
|
29
|
+
summary_exclude: @summary_exclude,
|
30
|
+
summary_href: @summary_href
|
31
|
+
)
|
32
|
+
if @link_save.start_with? 'http'
|
33
|
+
add_global_link_for_page mini_href
|
34
|
+
else
|
35
|
+
add_local_link_for_page mini_href
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/href_summary_tag.rb
CHANGED
@@ -2,8 +2,8 @@ require 'jekyll_plugin_logger'
|
|
2
2
|
require 'jekyll_plugin_support'
|
3
3
|
require_relative 'jekyll_href/version'
|
4
4
|
|
5
|
-
module
|
6
|
-
class HrefSummary < JekyllSupport::JekyllTag
|
5
|
+
module MSlinn
|
6
|
+
class HrefSummary < JekyllSupport::JekyllTag
|
7
7
|
include JekyllHrefVersion
|
8
8
|
|
9
9
|
# Class instance variables accumulate hrefs across invocations.
|
@@ -28,6 +28,11 @@ module HrefSummaryTag
|
|
28
28
|
def render_impl
|
29
29
|
@helper.gem_file __FILE__ # Enables attribution
|
30
30
|
@include_local = @helper.parameter_specified? 'include_local'
|
31
|
+
|
32
|
+
@die_on_href_error = @tag_config['die_on_href_error'] == true if @tag_config
|
33
|
+
@pry_on_href_error = @tag_config['pry_on_href_error'] == true if @tag_config
|
34
|
+
|
35
|
+
@path = @page['path']
|
31
36
|
global_refs = render_global_refs
|
32
37
|
local_refs = render_local_refs
|
33
38
|
have_refs = !(global_refs + local_refs).empty?
|
@@ -36,12 +41,19 @@ module HrefSummaryTag
|
|
36
41
|
#{local_refs}
|
37
42
|
#{@helper.attribute if @helper.attribution && have_refs}
|
38
43
|
END_RENDER
|
44
|
+
rescue HRefError => e # jekyll_plugin_support handles StandardError
|
45
|
+
e.shorten_backtrace
|
46
|
+
msg = format_error_message e.message
|
47
|
+
@logger.error "#{e.class} raised #{msg}"
|
48
|
+
binding.pry if @pry_on_img_error # rubocop:disable Lint/Debugger
|
49
|
+
raise e if @die_on_href_error
|
50
|
+
|
51
|
+
"<div class='href_error'>#{e.class} raised in #{self.class};\n#{msg}</div>"
|
39
52
|
end
|
40
53
|
|
41
54
|
def render_global_refs
|
42
55
|
hrefs = HashArray.instance_variable_get(:@global_hrefs)
|
43
|
-
|
44
|
-
entries = hrefs[path]&.select { |h| h.path == path }
|
56
|
+
entries = hrefs[@path]&.select { |h| h.path == @path }
|
45
57
|
return '' if entries.nil? || entries.empty?
|
46
58
|
|
47
59
|
summaries = entries.map { |href| "<li>#{href.summary_href}</li>" }
|
@@ -61,8 +73,7 @@ module HrefSummaryTag
|
|
61
73
|
return '' unless @include_local
|
62
74
|
|
63
75
|
hrefs = HashArray.instance_variable_get(:@local_hrefs)
|
64
|
-
|
65
|
-
entries = hrefs[path]&.select { |h| h.path == path }
|
76
|
+
entries = hrefs[@path]&.select { |h| h.path == @path }
|
66
77
|
return '' if entries.nil? || entries.empty?
|
67
78
|
|
68
79
|
summary = entries.map { |href| "<li>#{href.summary_href}</li>" }
|
data/lib/href_tag.rb
CHANGED
@@ -3,7 +3,6 @@ require 'jekyll_all_collections'
|
|
3
3
|
require 'jekyll_plugin_logger'
|
4
4
|
require 'jekyll_plugin_support'
|
5
5
|
require 'liquid'
|
6
|
-
require 'sanitize'
|
7
6
|
require_relative 'jekyll_href/version'
|
8
7
|
require_relative 'hash_array'
|
9
8
|
|
@@ -11,11 +10,13 @@ require_relative 'hash_array'
|
|
11
10
|
# @license SPDX-License-Identifier: Apache-2.0
|
12
11
|
# Generates an href.
|
13
12
|
|
14
|
-
module
|
13
|
+
module MSlinn
|
15
14
|
MiniHref = Struct.new(:follow, :html, :link, :line_number, :link_save, :path, :summary_exclude, :summary_href, keyword_init: true)
|
16
15
|
|
16
|
+
HRefError = JekyllSupport.define_error
|
17
|
+
|
17
18
|
# Implements href Jekyll tag
|
18
|
-
class
|
19
|
+
class HRefTag < JekyllSupport::JekyllTag
|
19
20
|
attr_reader :follow, :helper, :line_number, :link_save, :match, :page, :path, :site,
|
20
21
|
:summary, :summary_exclude, :summary_href, :target, :text, :url
|
21
22
|
attr_accessor :link
|
@@ -30,10 +31,6 @@ module HrefTag
|
|
30
31
|
[follow, match, path, target, text] <=> [other.follow, other.match, other.path, other.target, other.text]
|
31
32
|
end
|
32
33
|
|
33
|
-
def to_s
|
34
|
-
"On line #{line_number} of #{path}: #{follow} #{match} #{target} #{link} => '#{text}'"
|
35
|
-
end
|
36
|
-
|
37
34
|
# Method prescribed by the Jekyll plugin lifecycle.
|
38
35
|
# @param liquid_context [Liquid::Context]
|
39
36
|
# @return [String]
|
@@ -42,10 +39,10 @@ module HrefTag
|
|
42
39
|
linkk, error_msg = compute_linkk
|
43
40
|
return error_msg unless linkk
|
44
41
|
|
45
|
-
linkk
|
46
|
-
linkk.delete_prefix('./') # normalize relative links
|
42
|
+
linkk.delete_prefix './' # normalize relative links
|
47
43
|
@url = linkk if @url
|
48
44
|
@link_save = linkk
|
45
|
+
|
49
46
|
@helper_save = @helper.clone
|
50
47
|
globals_update(@helper.argv, linkk) # Sets @link and @text, might clear @follow and @target
|
51
48
|
handle_match if @match
|
@@ -53,196 +50,25 @@ module HrefTag
|
|
53
50
|
klass = " class='#{@klass}'" if @klass
|
54
51
|
style = " style='#{@style}'" if @style
|
55
52
|
"<a href='#{@link}'#{klass}#{style}#{@target}#{@follow}>#{@text}</a>"
|
53
|
+
rescue HRefError => e # jekyll_plugin_support handles StandardError
|
54
|
+
e.shorten_backtrace
|
55
|
+
msg = format_error_message e.message
|
56
|
+
@logger.error "#{e.class} raised #{msg}"
|
57
|
+
binding.pry if @pry_on_img_error # rubocop:disable Lint/Debugger
|
58
|
+
raise e if @die_on_href_error
|
59
|
+
|
60
|
+
"<div class='href_error'>#{e.class} raised in #{self.class};\n#{msg}</div>"
|
56
61
|
end
|
57
62
|
|
58
|
-
|
59
|
-
|
60
|
-
def save_summary
|
61
|
-
return if @summary_exclude || @link_save.start_with?('mailto:') || @link_save.start_with?('#')
|
62
|
-
|
63
|
-
@summary = @summary.to_s.empty? ? @text : @summary.to_s
|
64
|
-
if @summary == true
|
65
|
-
warning = <<~END_WARNING
|
66
|
-
Warning: a href plugin keyword option was detected in the link text for #{@path} on line #{line_number}.
|
67
|
-
The href tag will not be included in the summary, and the link text will not have the word summary included.
|
68
|
-
This is probably unintentional. Consider using the label option to correct this problem."
|
69
|
-
END_WARNING
|
70
|
-
puts warning.red
|
71
|
-
return
|
72
|
-
end
|
73
|
-
return if @summary.class != String || @summary.empty?
|
74
|
-
|
75
|
-
@summary = @summary[0].upcase + @summary[1..]
|
76
|
-
@summary_href = "<a href='#{@link_save}'#{@target}#{@follow}>#{@summary}</a>"
|
77
|
-
mini_href = MiniHref.new(
|
78
|
-
follow: @follow,
|
79
|
-
html: @summary_href,
|
80
|
-
line_number: @line_number,
|
81
|
-
link: @link_save,
|
82
|
-
link_save: @link_save,
|
83
|
-
path: @path,
|
84
|
-
summary_exclude: @summary_exclude,
|
85
|
-
summary_href: @summary_href
|
86
|
-
)
|
87
|
-
if @link_save.start_with? 'http'
|
88
|
-
add_global_link_for_page mini_href
|
89
|
-
else
|
90
|
-
add_local_link_for_page mini_href
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
# Does not look at or compute @link
|
95
|
-
def compute_linkk
|
96
|
-
return @link, nil if @link
|
97
|
-
|
98
|
-
linkk = @url
|
99
|
-
if linkk.nil? || !linkk
|
100
|
-
linkk = @helper.argv&.shift
|
101
|
-
@helper.params&.shift
|
102
|
-
@helper.keys_values&.delete(linkk)
|
103
|
-
return nil, error_no_uri if linkk.nil?
|
104
|
-
elsif @url.to_s.empty?
|
105
|
-
return nil, error_no_uri
|
106
|
-
end
|
107
|
-
[linkk, nil]
|
108
|
-
end
|
109
|
-
|
110
|
-
def error_no_uri
|
111
|
-
msg = <<~END_MESSAGE
|
112
|
-
Error: no url was provided on #{@path}:#{@line_number} (after front matter).
|
113
|
-
<pre>{% href #{@argument_string}%}</pre>
|
114
|
-
END_MESSAGE
|
115
|
-
@logger.error { Sanitize.fragment msg }
|
116
|
-
"<span class='error'>Error: #{msg}</span>"
|
117
|
-
end
|
118
|
-
|
119
|
-
# Sets @follow, @helper, @match, @path, @shy, @target, @url, @wbr
|
120
|
-
def globals_initial
|
121
|
-
@path = @page['path']
|
122
|
-
AllCollectionsHooks.compute(@site)
|
123
|
-
|
124
|
-
@blank = @helper.parameter_specified? 'blank'
|
125
|
-
@klass = @helper.parameter_specified? 'class'
|
126
|
-
@follow = @helper.parameter_specified?('follow') ? '' : " rel='nofollow'"
|
127
|
-
@match = @helper.parameter_specified? 'match'
|
128
|
-
@label = @helper.parameter_specified? 'label'
|
129
|
-
@summary_exclude = @helper.parameter_specified? 'summary_exclude'
|
130
|
-
@shy = @helper.parameter_specified? 'shy'
|
131
|
-
@style = @helper.parameter_specified? 'style'
|
132
|
-
@summary = @helper.parameter_specified? 'summary'
|
133
|
-
@target = @blank ? " target='_blank'" : nil
|
134
|
-
@target ||= @helper.parameter_specified?('notarget') ? '' : " target='_blank'"
|
135
|
-
@url = @helper.parameter_specified? 'url'
|
136
|
-
@wbr = @helper.parameter_specified? 'wbr'
|
137
|
-
end
|
138
|
-
|
139
|
-
# Might set @follow, @linkk, @target, and @text
|
140
|
-
def globals_update(tokens, linkk)
|
141
|
-
if linkk.start_with? 'mailto:'
|
142
|
-
@link = linkk
|
143
|
-
@target = @follow = ''
|
144
|
-
@text = @helper.argv.join(' ')
|
145
|
-
if @text.empty?
|
146
|
-
text = linkk.delete_prefix('mailto:')
|
147
|
-
@text = "<code>#{text}</code>"
|
148
|
-
end
|
149
|
-
return
|
150
|
-
else
|
151
|
-
@text = @label || tokens.join(' ').strip
|
152
|
-
if @text.to_s.empty?
|
153
|
-
text = linkk
|
154
|
-
text = linkk.gsub('/', '/­') if @shy
|
155
|
-
text = linkk.gsub('/', '/<wbr>') if @wbr
|
156
|
-
@text = "<code>#{text}</code>"
|
157
|
-
@link = if linkk.start_with?('http')
|
158
|
-
linkk
|
159
|
-
elsif insecure_ip_address linkk
|
160
|
-
"http://#{linkk}"
|
161
|
-
else
|
162
|
-
"https://#{linkk}"
|
163
|
-
end
|
164
|
-
else
|
165
|
-
@link = if @shy
|
166
|
-
linkk.gsub('/', '/­')
|
167
|
-
elsif @wbr
|
168
|
-
linkk.gsub('/', '/<wbr>')
|
169
|
-
else
|
170
|
-
linkk
|
171
|
-
end
|
172
|
-
end
|
173
|
-
@link_save = @link
|
174
|
-
end
|
175
|
-
|
176
|
-
return if @link.start_with? 'http'
|
177
|
-
|
178
|
-
@follow = ''
|
179
|
-
@target = '' unless @blank
|
180
|
-
end
|
181
|
-
|
182
|
-
def handle_match
|
183
|
-
match_post
|
184
|
-
@follow = ''
|
185
|
-
@target = '' unless @blank
|
186
|
-
end
|
187
|
-
|
188
|
-
# Might set @link and @text
|
189
|
-
def match_post
|
190
|
-
config = @site.config['href']
|
191
|
-
@die_if_nomatch = !config.nil? && config['nomatch'] && config['nomatch'] == 'fatal'
|
192
|
-
@path, @fragment = @link.split('#')
|
193
|
-
|
194
|
-
@logger.debug do
|
195
|
-
<<~END_DEBUG
|
196
|
-
@link=#{@link}
|
197
|
-
@site.posts.docs[0].url = #{@site.posts.docs[0].url}
|
198
|
-
@site.posts.docs[0].path = #{@site.posts.docs[0].path}
|
199
|
-
END_DEBUG
|
200
|
-
end
|
201
|
-
|
202
|
-
all_urls = @site.all_collections.map(&:url)
|
203
|
-
compute_link_and_text(all_urls)
|
204
|
-
end
|
205
|
-
|
206
|
-
def compute_link_and_text(all_urls)
|
207
|
-
url_matches = all_urls.select { |url| url&.include? @path }
|
208
|
-
case url_matches.length
|
209
|
-
when 0
|
210
|
-
abort "href error: No url matches '#{@link}'" if @die_if_nomatch
|
211
|
-
@link_save = @link = '#'
|
212
|
-
@text = "<i>#{@link} is not available</i>"
|
213
|
-
when 1
|
214
|
-
@link = url_matches.first
|
215
|
-
@link = "#{@link}##{@fragment}" if @fragment
|
216
|
-
@link_save = @link
|
217
|
-
else
|
218
|
-
abort "Error: More than one url matched '#{@path}': #{url_matches.join(', ')}"
|
219
|
-
end
|
220
|
-
end
|
221
|
-
|
222
|
-
def insecure_ip_address(string)
|
223
|
-
return true if string.start_with? 'localhost'
|
224
|
-
|
225
|
-
return false unless IPAddress.valid? string
|
226
|
-
|
227
|
-
ip_address = IPAddress string
|
228
|
-
return true if ip_address.loopback? || ip_address.private?
|
229
|
-
rescue StandardError
|
230
|
-
false
|
231
|
-
ensure
|
232
|
-
false
|
233
|
-
end
|
234
|
-
|
235
|
-
# Replace names in plugin-vars with values
|
236
|
-
def replace_vars(text)
|
237
|
-
variables = @site.config['plugin-vars']
|
238
|
-
return text unless variables
|
239
|
-
|
240
|
-
variables.each do |name, value|
|
241
|
-
text = text.gsub "{{#{name}}}", value
|
242
|
-
end
|
243
|
-
text
|
63
|
+
def to_s
|
64
|
+
"On line #{line_number} of #{path}: #{follow} #{match} #{target} #{link} => '#{text}'"
|
244
65
|
end
|
245
66
|
|
246
67
|
JekyllPluginHelper.register(self, 'href')
|
247
68
|
end
|
248
69
|
end
|
70
|
+
|
71
|
+
require_relative 'href_match'
|
72
|
+
require_relative 'href_private'
|
73
|
+
require_relative 'href_page_title'
|
74
|
+
require_relative 'href_summary'
|
data/lib/jekyll_href/version.rb
CHANGED
data/lib/jekyll_href.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -6,9 +6,7 @@ require 'yaml'
|
|
6
6
|
require_relative "../lib/jekyll_href"
|
7
7
|
|
8
8
|
RSpec.configure do |config|
|
9
|
-
config.filter_run :focus
|
10
9
|
# config.order = "random"
|
11
|
-
config.run_all_when_everything_filtered = true
|
12
10
|
|
13
11
|
# See https://relishapp.com/rspec/rspec-core/docs/command-line/only-failures
|
14
12
|
config.example_status_persistence_file_path = "../spec/status_persistence.txt"
|
data/spec/status_persistence.txt
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
----------------------------------------------------------------- | ------ | --------------- |
|
3
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:1] | passed | 0.
|
4
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:2] |
|
5
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:3] |
|
6
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:4] |
|
7
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:5] |
|
8
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:6] |
|
9
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:7] | passed | 0.
|
10
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:8] |
|
11
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:9] |
|
12
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:10] | passed | 0.
|
13
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:11] | passed | 0.
|
14
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:12] | passed | 0.
|
15
|
-
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:13] | passed | 0.
|
3
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:1] | passed | 0.00938 seconds |
|
4
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:2] | failed | 0.01389 seconds |
|
5
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:3] | failed | 0.00319 seconds |
|
6
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:4] | failed | 0.00211 seconds |
|
7
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:5] | failed | 0.00196 seconds |
|
8
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:6] | failed | 0.00205 seconds |
|
9
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:7] | passed | 0.00212 seconds |
|
10
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:8] | failed | 0.00209 seconds |
|
11
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:9] | failed | 0.0021 seconds |
|
12
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:10] | passed | 0.00278 seconds |
|
13
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:11] | passed | 0.00237 seconds |
|
14
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:12] | passed | 0.00218 seconds |
|
15
|
+
/mnt/f/work/jekyll/my_plugins/jekyll_href/spec/href_spec.rb[1:13] | passed | 0.00211 seconds |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_href
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ipaddress
|
@@ -58,28 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.8.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: sanitize
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
68
|
+
version: 0.8.1
|
83
69
|
description: 'Generates an ''a href'' tag, possibly with target=''_blank'' and rel=''nofollow''.
|
84
70
|
|
85
71
|
'
|
@@ -96,11 +82,15 @@ files:
|
|
96
82
|
- Rakefile
|
97
83
|
- jekyll_href.gemspec
|
98
84
|
- lib/hash_array.rb
|
85
|
+
- lib/href_match.rb
|
86
|
+
- lib/href_page_title.rb
|
87
|
+
- lib/href_private.rb
|
88
|
+
- lib/href_summary.rb
|
99
89
|
- lib/href_summary_tag.rb
|
100
90
|
- lib/href_tag.rb
|
101
91
|
- lib/jekyll_href.rb
|
102
92
|
- lib/jekyll_href/version.rb
|
103
|
-
- spec/hash_array_spec.rb
|
93
|
+
- spec/hash_array_spec/hash_array_spec.rb
|
104
94
|
- spec/href_spec.rb
|
105
95
|
- spec/spec_helper.rb
|
106
96
|
- spec/status_persistence.txt
|
@@ -131,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
121
|
- !ruby/object:Gem::Version
|
132
122
|
version: '0'
|
133
123
|
requirements: []
|
134
|
-
rubygems_version: 3.3.
|
124
|
+
rubygems_version: 3.3.7
|
135
125
|
signing_key:
|
136
126
|
specification_version: 4
|
137
127
|
summary: Generates an 'a href' tag, possibly with target='_blank' and rel='nofollow'.
|