Skip to content

Commit 5e609fc

Browse files
committed
Adjust styles
1 parent 9f738e8 commit 5e609fc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/rdoc/parser/changelog.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,16 @@ def initialize(base, commit, author, email, date, contents)
277277
if base&.match(%r[\A([^:/]+:/+[^/]+/)[^/]+/[^/]+/])
278278
repo, host = $&, $1
279279
contents = contents.dup
280-
contents.gsub!(/\b(?:(?i:fix(?:e[sd])?) +)\K#(\d+\b)|\bGH-(\d+)\b|\(\K\#(\d+)(?=\))/) do
281-
"[#$&](#{repo}pull/#{$1 || $2 || $3})"
280+
# base: https://github.com/ruby/ruby/
281+
# Fix #15791 -> Fix [#15791](https://github.com/ruby/ruby/pull/15791)
282+
# GH-15791 -> [GH-15791](https://github.com/ruby/ruby/pull/15791)
283+
# (#15791) -> ([#15791](https://github.com/ruby/ruby/pull/15791))
284+
contents.gsub!(/\b(?:(?i:fix(?:e[sd])?) +)\K\#(\d+\b)|\bGH-(\d+)\b|\(\K\#(\d+)(?=\))/) do
285+
"[#{$&}](#{repo}pull/#{$1 || $2 || $3})"
282286
end
283287
contents.gsub!(%r[(?<![-\w#/@]|\]\[)([-\w]+/[-\w]+)(?:@(\h{8,40})|\#(\d+))(?![-\w#/@]|\]\[)]) do
284288
path = defined?($2) ? "commit/#{$2}" : "pull/#{$3}"
285-
"[#$&](#{host}#{$1}/#{path})"
289+
"[#{$&}](#{host}#{$1}/#{path})"
286290
end
287291
end
288292

0 commit comments

Comments
 (0)