Skip to content

Commit 90d7687

Browse files
committed
Fix Ruby 3.4 regex warning: remove duplicated range in character class
Replace [\W<] with \W in regex lookahead since < is already included in \W. This resolves the 'character class has duplicated range' warning in Ruby 3.4. Fixes #1609
1 parent 34796c5 commit 90d7687

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/yard/templates/helpers/html_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def html_syntax_highlight_plain(source)
228228
# @return [String] HTML with linkified references
229229
def resolve_links(text)
230230
code_tags = 0
231-
text.gsub(%r{<(/)?(pre|code|tt)|(\\|!)?\{(?!\})(\S+?)(?:\s([^\}]*?\S))?\}(?=[\W<]|.+</|$)}m) do |str|
231+
text.gsub(%r{<(/)?(pre|code|tt)|(\\|!)?\{(?!\})(\S+?)(?:\s([^\}]*?\S))?\}(?=\W|.+</|$)}m) do |str|
232232
closed = $1
233233
tag = $2
234234
escape = $3

0 commit comments

Comments
 (0)