0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-13 01:08:58 +01:00
Bootstrap/docs/_plugins/bugify.rb
Chris Rebert 7e09021fc3 Port edfd72678d to v3
docs/_plugins/bugify.rb: Remove IE; all relevant issues moved to Edge

Refs #19713
[skip sauce]
2016-04-10 23:23:45 -07:00

26 lines
1.0 KiB
Ruby

module Jekyll
module BugFilter
def bugify(input)
upstream_map = {
"Bootstrap" => "https://github.com/twbs/bootstrap/issues/",
"Edge" => ["https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/", "Edge issue"],
"Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"],
"Chromium" => ["https://bugs.chromium.org/p/chromium/issues/detail?id=", "Chromium issue"],
"WebKit" => ["https://bugs.webkit.org/show_bug.cgi?id=", "WebKit bug"],
"Safari" => ["https://openradar.appspot.com/", "Apple Safari Radar"],
"Normalize" => ["https://github.com/necolas/normalize.css/issues/", "Normalize"]
}
upstream_map.each do |key, data|
url = data.is_a?(Array) ? data[0] : data
label = data.is_a?(Array) ? "#{data[1]} " : ""
input = input.gsub(/#{key}#(\d+)/, "<a href=\"#{url}\\1\">#{label}#\\1</a>")
end
return input
end
end
end
Liquid::Template.register_filter(Jekyll::BugFilter)