Fix bug preventing articles with HTML entities in their file name to get their comments loaded at page refresh

This commit is contained in:
Tissevert 2019-02-19 18:59:24 +01:00
parent 602e345977
commit 1d348220fa

View file

@ -9,7 +9,8 @@ function DomRenderer(modules) {
var div = document.getElementById('contents'); var div = document.getElementById('contents');
if(div.children[0] && div.children[0].tagName.toLowerCase() == 'article') { if(div.children[0] && div.children[0].tagName.toLowerCase() == 'article') {
var re = new RegExp('/' + blog.path.articlesPath + '/([^.]+)\.html'); var re = new RegExp('/' + blog.path.articlesPath + '/([^.]+)\.html');
convertArticle(div.children[0], document.location.pathname.replace(re, '$1')); var key = decodeURI(document.location.pathname.replace(re, '$1'));
convertArticle(div.children[0], key);
} else { } else {
var articles = div.getElementsByClassName('articles')[0]; var articles = div.getElementsByClassName('articles')[0];
if(articles != undefined) { if(articles != undefined) {