changeset 977:eb0ffd3b37c0 draft

Fix for single line reply
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 29 May 2022 12:06:46 +0900
parents ae6c5df09f22
children 71528696780b
files s4-main.js
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/s4-main.js	Sun May 29 08:36:39 2022 +0900
+++ b/s4-main.js	Sun May 29 12:06:46 2022 +0900
@@ -1051,8 +1051,15 @@
 	    let text = td.innerHTML;
 	    if (text.startsWith("\&gt;#")) {
 		let newline = text.indexOf("\n");
-		let first   = text.substring(0, newline),
+		let first   = 
 		    rest    = text.substring(newline);
+		if (newline) {
+		    first = text.substring(0, newline);
+		    rest  = text.substring(newline);
+		} else {
+		    first = text;
+		    rest  = "";
+		}
 		td.innerHTML = first.replace(
 		    /#([0-9]+)/g,
 		    (match, start, whole) => {

yatex.org