Skip to content

Commit

Permalink
Solved: Image not appearing when there's continuous markers
Browse files Browse the repository at this point in the history
  • Loading branch information
gnpaone authored Aug 23, 2024
1 parent 056771f commit 9fe9b9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions winget.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def update_readme_content(id, style, label, labelColor, color, marker_text, pkg_
end_marker = "<!-- #{marker_text}_END -->"
shields_url = "https://img.shields.io/badge/#{ERB::Util.url_encode(label)}-#{winget_ver}-#{color}?style=#{style}&labelColor=#{labelColor}"

updated_readme_content = readme_content.gsub(/#{start_marker}.*#{end_marker}/m, "#{start_marker}[![#{id}](#{shields_url})](#{pkg_link})#{end_marker}")
updated_readme_content = readme_content.gsub(/#{start_marker}.*#{end_marker}/m, "#{start_marker}\n[![#{id}](#{shields_url})](#{pkg_link})#{end_marker}")

File.write(readme_path, updated_readme_content)
end
Expand All @@ -110,4 +110,4 @@ def update_git_repo(readme_path, commit_message, git_username, git_email)
end
end

Winget.new.run
Winget.new.run

0 comments on commit 9fe9b9b

Please sign in to comment.