mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-02 15:53:11 -05:00
@@ -396,21 +396,12 @@ var Tools = {
|
||||
'" target="_blank" onclick="' + onclick + '">' + uri + '</a>';
|
||||
});
|
||||
// google [blah]
|
||||
// google[blah]
|
||||
// Google search for 'blah'
|
||||
str = str.replace(/\bgoogle ?\[([^\]<]+)\]/ig, function(p0, p1) {
|
||||
p1 = Tools.escapeHTML(encodeURIComponent(Tools.unescapeHTML(p1)));
|
||||
return '<a href="http://www.google.com/search?ie=UTF-8&q=' + p1 +
|
||||
'" target="_blank">' + p0 + '</a>';
|
||||
});
|
||||
// gl [blah]
|
||||
// gl[blah]
|
||||
// Google search for 'blah' and visit the first result ("I'm feeling lucky")
|
||||
str = str.replace(/\bgl ?\[([^\]<]+)\]/ig, function(p0, p1) {
|
||||
p1 = Tools.escapeHTML(encodeURIComponent(Tools.unescapeHTML(p1)));
|
||||
return '<a href="http://www.google.com/search?ie=UTF-8&btnI&q=' + p1 +
|
||||
'" target="_blank">' + p0 + '</a>';
|
||||
});
|
||||
// wiki [blah]
|
||||
// Search Wikipedia for 'blah' (and visit the article for 'blah' if it exists)
|
||||
str = str.replace(/\bwiki ?\[([^\]<]+)\]/ig, function(p0, p1) {
|
||||
@@ -418,6 +409,20 @@ var Tools = {
|
||||
return '<a href="http://en.wikipedia.org/w/index.php?title=Special:Search&search=' +
|
||||
p1 + '" target="_blank">' + p0 + '</a>';
|
||||
});
|
||||
// server issue #pullreq
|
||||
// Links to github Pokemon Showdown server pullreq number
|
||||
str = str.replace(/\bserver issue ?#(\d+)/ig, function(p0, p1) {
|
||||
p1 = Tools.escapeHTML(encodeURIComponent(Tools.unescapeHTML(p1)));
|
||||
return '<a href="https://github.com/Zarel/Pokemon-Showdown/pull/' +
|
||||
p1 + '" target="_blank">' + p0 + '</a>';
|
||||
});
|
||||
// client issue #pullreq
|
||||
// Links to github Pokemon Showdown client pullreq number
|
||||
str = str.replace(/\bclient issue ?#(\d+)/ig, function(p0, p1) {
|
||||
p1 = Tools.escapeHTML(encodeURIComponent(Tools.unescapeHTML(p1)));
|
||||
return '<a href="https://github.com/Zarel/Pokemon-Showdown-Client/pull/' +
|
||||
p1 + '" target="_blank">' + p0 + '</a>';
|
||||
});
|
||||
// [[blah]]
|
||||
// Short form of gl[blah]
|
||||
str = str.replace(/\[\[([^< ](?:[^<`]*?[^< ])??)\]\]/ig, function(p0, p1) {
|
||||
|
||||
Reference in New Issue
Block a user