Mercurial > hgrepos > hgweb.cgi > s4
comparison s4-main.js @ 979:084326d5ba19 draft
FIX: JS return -1 when string-search fails...
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sun, 29 May 2022 12:13:00 +0900 |
parents | 71528696780b |
children | f0b63223cb80 |
comparison
equal
deleted
inserted
replaced
978:71528696780b | 979:084326d5ba19 |
---|---|
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, rest; | 1054 let first, rest; |
1055 if (newline) { | 1055 if (newline > 0) { |
1056 first = text.substring(0, newline); | 1056 first = text.substring(0, newline); |
1057 rest = text.substring(newline); | 1057 rest = text.substring(newline); |
1058 } else { | 1058 } else { |
1059 first = text; | 1059 first = text; |
1060 rest = ""; | 1060 rest = ""; |