From bfbf795109634ec0f4eaebd20b83af6634fafc87 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Thu, 2 May 2019 12:14:38 -0600 Subject: [PATCH] Fix missing space after hyperlinked topics If a topic contains a URL, the URL gets auto-hyperlinked in ptg.html. However this code forgot to add a trailing space, so if there was a word after the URL, the space in between them got swallowed. So add a space after each word, and do it outside the if/else conditional to avoid any else clauses which might be added in the future making the same mistake. Change-Id: I3b5789387ead52945ae599aa0b80768642388269 --- html/ptg.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/html/ptg.js b/html/ptg.js index 40007b7..bc0fbb9 100644 --- a/html/ptg.js +++ b/html/ptg.js @@ -10,13 +10,14 @@ Handlebars.registerHelper('trackContentLine', function(options) { for (var i = 0; i < words.length; i++) { if (words[i].startsWith("#")) { sentence += '' - + words[i].substring(1) + ' '; + + words[i].substring(1) + ''; } else if (words[i].match(/^https?:\/\//)) { sentence += '' + words[i] + ''; } else { - sentence += words[i] + " "; + sentence += words[i]; } + sentence += ' '; } return new Handlebars.SafeString(sentence); });