Fixed a minor bug in the 'previous posts' link when a username started or ended with a whitespace
diff --git a/src/console_inject.js b/src/console_inject.js
index d876f39..a4ea7db 100644
--- a/src/console_inject.js
+++ b/src/console_inject.js
@@ -57,7 +57,7 @@
if (options.history && ("parentNode" in node) && node.parentNode !== null && ("tagName" in node.parentNode) && node.parentNode.tagName == "EC-USER") {
var nameElement = node.querySelector(".name span");
if (nameElement !== null) {
- var name = nameElement.innerText;
+ var name = nameElement.innerHTML;
var query = encodeURIComponent("(creator:\""+name+"\" | replier:\""+name+"\") -forum:0");
var urlpart = encodeURIComponent("query="+query);
var link = document.createElement("a");
diff --git a/src/profile_inject.js b/src/profile_inject.js
index 145a069..6cdfc91 100644
--- a/src/profile_inject.js
+++ b/src/profile_inject.js
@@ -2,7 +2,7 @@
if (items.history && document.querySelector(".user-profile__user-links") === null) {
var nameElement = document.querySelector(".user-profile__user-name");
if (nameElement !== null) {
- var name = encodeURIComponent(nameElement.innerText);
+ var name = encodeURIComponent(nameElement.innerHTML);
var link = document.location.pathname.split("/profile")[0]+"/threads?thread_filter=(creator:%22"+name+"%22+%7C+replier:%22"+name+"%22)";
document.querySelector(".user-profile__user-details-container").insertAdjacentHTML('beforeend', '<div class="user-profile__user-links"><div class="user-profile__user-link-title">'+chrome.i18n.getMessage("inject_links")+'</div><ul><li class="user-profile__user-link"><a href="'+link+'" data-stats-id="my-posts-link">'+chrome.i18n.getMessage("inject_previousposts")+'</a></li></ul></div>');
}