Mercurial > hgrepos > hgweb.cgi > s4
comparison s4-main.js @ 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 |
comparison
equal
deleted
inserted
replaced
976:ae6c5df09f22 | 977:eb0ffd3b37c0 |
---|---|
1049 unit = unit||document; | 1049 unit = unit||document; |
1050 for (let td of unit.querySelectorAll("td.repl")) { | 1050 for (let td of unit.querySelectorAll("td.repl")) { |
1051 let text = td.innerHTML; | 1051 let text = td.innerHTML; |
1052 if (text.startsWith("\>#")) { | 1052 if (text.startsWith("\>#")) { |
1053 let newline = text.indexOf("\n"); | 1053 let newline = text.indexOf("\n"); |
1054 let first = text.substring(0, newline), | 1054 let first = |
1055 rest = text.substring(newline); | 1055 rest = text.substring(newline); |
1056 if (newline) { | |
1057 first = text.substring(0, newline); | |
1058 rest = text.substring(newline); | |
1059 } else { | |
1060 first = text; | |
1061 rest = ""; | |
1062 } | |
1056 td.innerHTML = first.replace( | 1063 td.innerHTML = first.replace( |
1057 /#([0-9]+)/g, | 1064 /#([0-9]+)/g, |
1058 (match, start, whole) => { | 1065 (match, start, whole) => { |
1059 let id = RegExp.$1 | 1066 let id = RegExp.$1 |
1060 return '<a title="' + getTextById(id) | 1067 return '<a title="' + getTextById(id) |