2016-01-26 21:12:48 +03:00
|
|
|
module Jekyll
|
|
|
|
module BugFilter
|
|
|
|
def bugify(input)
|
|
|
|
upstream_map = {
|
|
|
|
"Bootstrap" => "https://github.com/twbs/bootstrap/issues/",
|
2016-04-29 23:28:40 +03:00
|
|
|
"Edge" => ["https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/", "Edge issue"],
|
2017-08-11 17:59:31 +03:00
|
|
|
"A11yUserVoice" => ["https://microsoftaccessibility.uservoice.com/forums/307429-microsoft-accessibility-feedback/suggestions/", "Microsoft A11y UserVoice idea"],
|
2016-07-26 18:32:37 +03:00
|
|
|
"UserVoice" => ["https://wpdev.uservoice.com/forums/257854-microsoft-edge-developer/suggestions/", "Edge UserVoice idea"],
|
2016-01-26 21:12:48 +03:00
|
|
|
"Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"],
|
2016-03-01 18:16:31 +03:00
|
|
|
"Chromium" => ["https://bugs.chromium.org/p/chromium/issues/detail?id=", "Chromium issue"],
|
2016-01-26 21:12:48 +03:00
|
|
|
"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)
|