From 561fd140879879d46aa17dd73b6188222d07f07b Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Mon, 9 Dec 2019 12:29:41 +0100 Subject: [PATCH 1/3] Fix link to authors with spaces in their name in Github Reply Comments. Fixes #150 --- Github_Reply_Comments/Github_Reply_Comments.user.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Github_Reply_Comments/Github_Reply_Comments.user.js b/Github_Reply_Comments/Github_Reply_Comments.user.js index eea557b..4afe973 100644 --- a/Github_Reply_Comments/Github_Reply_Comments.user.js +++ b/Github_Reply_Comments/Github_Reply_Comments.user.js @@ -120,10 +120,13 @@ var newComment = getCommentTextarea(this); + var author = comment.querySelector(".author"); + var authorLink = location.origin + (author.getAttribute("href") || "/" + author.textContent); + var text = newComment.value.length > 0 ? "\n" : ""; - text += String.format('[**@{0}**]({1}/{0}) commented on [{2}]({3} "{4} - Replied by Github Reply Comments"):\n{5}\n\n', - comment.querySelector(".author").textContent, - location.origin, + text += String.format('[**@{0}**]({1}) commented on [{2}]({3} "{4} - Replied by Github Reply Comments"):\n{5}\n\n', + author.textContent, + authorLink, timestamp.firstElementChild.getAttribute("title"), timestamp.href, timestamp.firstElementChild.getAttribute("datetime"), From 6d747a469d6b2613f72a48ec40d77a68bea48043 Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Mon, 9 Dec 2019 12:33:18 +0100 Subject: [PATCH 2/3] Update README.md --- Github_Reply_Comments/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Github_Reply_Comments/README.md b/Github_Reply_Comments/README.md index 9d03f85..aeaf88d 100644 --- a/Github_Reply_Comments/README.md +++ b/Github_Reply_Comments/README.md @@ -20,6 +20,10 @@ reply button on an comment. ## Version History +* version **1.0.4** + + * 🐛 Fix link to authors with spaces in their name. Fixes ([#150](https://github.com/jerone/UserScripts/issues/150)). + * version **1.0.3** * 🐛 Fix broken timestamp detection ([#149](https://github.com/jerone/UserScripts/issues/149)). From b72b945d1f02e8c6ef2f598693ef2c2ff8faa9c8 Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Mon, 9 Dec 2019 12:33:41 +0100 Subject: [PATCH 3/3] Update version --- Github_Reply_Comments/Github_Reply_Comments.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Github_Reply_Comments/Github_Reply_Comments.user.js b/Github_Reply_Comments/Github_Reply_Comments.user.js index 4afe973..cf522fa 100644 --- a/Github_Reply_Comments/Github_Reply_Comments.user.js +++ b/Github_Reply_Comments/Github_Reply_Comments.user.js @@ -12,7 +12,7 @@ // @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Reply_Comments/Github_Reply_Comments.user.js // @supportURL https://github.com/jerone/UserScripts/issues // @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VCYMHWQ7ZMBKW -// @version 1.0.3 +// @version 1.0.4 // @icon https://github.githubassets.com/pinned-octocat.svg // @grant none // @include https://github.com/*