2015-11-20 00:58:21 +03:00
|
|
|
module Jekyll
|
|
|
|
module BugFilter
|
|
|
|
def bugify(input)
|
|
|
|
upstream_map = {
|
2015-11-20 02:18:15 +03:00
|
|
|
"Bootstrap" => "https://github.com/fezvrasta/bootstrap-material-design/issues/",
|
2015-11-20 00:58:21 +03:00
|
|
|
"IE" => ["https://connect.microsoft.com/IE/feedback/details/", "IE bug"],
|
|
|
|
"Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"],
|
|
|
|
"Chromium" => ["https://code.google.com/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)
|