Merge pull request #8111 from awesomeaniruddh/fix/wiki-trailing-slash

Add trailing slash to wiki iframe src if omitted
This commit is contained in:
Berkeley Martinez
2016-04-14 21:54:26 -07:00

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(