Merge pull request #20594 from Homebrew/pod2man-improve

feat: update regex replace for pod2man
This commit is contained in:
Daeho Ro 2025-08-28 12:46:35 +00:00 committed by GitHub
commit f6ce120b40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -589,7 +589,7 @@ class Keg
# pod2man embeds the perl version used into the 5th field of the footer
parts[4]&.gsub!(/^"perl v.*"$/, "\"\"")
# man extension remove in man files
parts[2]&.gsub!(/([1-9]){,p,pm}/, "\\1")
parts[2]&.gsub!(/([1-9])(?:pm|p)?/, "\\1")
"#{parts.join(" ")}\n"
elsif line.start_with?(".IX")
@ -599,7 +599,7 @@ class Keg
next line if parts[1] != "Title"
# man extension remove in man files
parts[2]&.gsub!(/\s+([1-9]){,p,pm}/, "\\1")
parts[2]&.gsub!(/([1-9])(?:pm|p)?/, "\\1")
"#{parts.join(" ")}\n"
else