Add trailing slash to wiki iframe src if omitted

pull/8111/head
Aniruddh Agarwal 2016-04-14 16:49:52 +08:00
parent 729f966952
commit aea8ee3b45
No known key found for this signature in database
GPG Key ID: E8E0639AE59A8D59
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,9 @@ block content
var wikiUrl = '//freecodecamp.github.io/wiki';
var wikiOrigin = /https?:\/\/freecodecamp.github.io/;
var requestedPath = !{JSON.stringify(path) || ''};
if (requestedPath !== '' && requestedPath.slice(-1) !== '/') {
requestedPath += '/';
}
var lang = window.location.toString().match(/\/\w{2}\//);
lang = (lang) ? lang[0] : '/en/';
$('#wikiFrame').attr(