Fossil SCM
Documented the source of the extraneous end-of-line spaces when pasting from a console. Changed the markdown backslash-space-space workaround to backslash-n-spaces.
Commit
87b0b12dc45b9b2370831c9cd5a597220e28cc7d0b330adfdadc04ffedb5245d
Parent
71fbd1b01ba42ee…
1 file changed
+4
-2
+4
-2
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -1164,11 +1164,11 @@ | ||
| 1164 | 1164 | empty, this is a no-op. |
| 1165 | 1165 | */ |
| 1166 | 1166 | Chat.submitMessage = function f(){ |
| 1167 | 1167 | if(!f.spaces){ |
| 1168 | 1168 | f.spaces = /\s+$/; |
| 1169 | - f.markdownContinuation = /\\\s\s$/; | |
| 1169 | + f.markdownContinuation = /\\\s+$/; | |
| 1170 | 1170 | } |
| 1171 | 1171 | this.setCurrentView(this.e.viewMessages); |
| 1172 | 1172 | const fd = new FormData(); |
| 1173 | 1173 | var msg = this.inputValue().trim(); |
| 1174 | 1174 | if(msg && (msg.indexOf('\n')>0 || f.spaces.test(msg))){ |
| @@ -1176,11 +1176,13 @@ | ||
| 1176 | 1176 | keep copy/paste from terminals, especially wide ones, from |
| 1177 | 1177 | forcing a horizontal scrollbar on all clients. This breaks |
| 1178 | 1178 | markdown's use of blackslash-space-space for paragraph |
| 1179 | 1179 | continuation, but *not* doing this affects all clients every |
| 1180 | 1180 | time someone pastes in console copy/paste from an affected |
| 1181 | - platform. */ | |
| 1181 | + platform. We seem to have narrowed to the console pasting | |
| 1182 | + problem to users of tmux. Most consoles don't behave | |
| 1183 | + that way. */ | |
| 1182 | 1184 | const xmsg = msg.split('\n'); |
| 1183 | 1185 | xmsg.forEach(function(line,ndx){ |
| 1184 | 1186 | if(!f.markdownContinuation.test(line)){ |
| 1185 | 1187 | xmsg[ndx] = line.trimRight(); |
| 1186 | 1188 | } |
| 1187 | 1189 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -1164,11 +1164,11 @@ | |
| 1164 | empty, this is a no-op. |
| 1165 | */ |
| 1166 | Chat.submitMessage = function f(){ |
| 1167 | if(!f.spaces){ |
| 1168 | f.spaces = /\s+$/; |
| 1169 | f.markdownContinuation = /\\\s\s$/; |
| 1170 | } |
| 1171 | this.setCurrentView(this.e.viewMessages); |
| 1172 | const fd = new FormData(); |
| 1173 | var msg = this.inputValue().trim(); |
| 1174 | if(msg && (msg.indexOf('\n')>0 || f.spaces.test(msg))){ |
| @@ -1176,11 +1176,13 @@ | |
| 1176 | keep copy/paste from terminals, especially wide ones, from |
| 1177 | forcing a horizontal scrollbar on all clients. This breaks |
| 1178 | markdown's use of blackslash-space-space for paragraph |
| 1179 | continuation, but *not* doing this affects all clients every |
| 1180 | time someone pastes in console copy/paste from an affected |
| 1181 | platform. */ |
| 1182 | const xmsg = msg.split('\n'); |
| 1183 | xmsg.forEach(function(line,ndx){ |
| 1184 | if(!f.markdownContinuation.test(line)){ |
| 1185 | xmsg[ndx] = line.trimRight(); |
| 1186 | } |
| 1187 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -1164,11 +1164,11 @@ | |
| 1164 | empty, this is a no-op. |
| 1165 | */ |
| 1166 | Chat.submitMessage = function f(){ |
| 1167 | if(!f.spaces){ |
| 1168 | f.spaces = /\s+$/; |
| 1169 | f.markdownContinuation = /\\\s+$/; |
| 1170 | } |
| 1171 | this.setCurrentView(this.e.viewMessages); |
| 1172 | const fd = new FormData(); |
| 1173 | var msg = this.inputValue().trim(); |
| 1174 | if(msg && (msg.indexOf('\n')>0 || f.spaces.test(msg))){ |
| @@ -1176,11 +1176,13 @@ | |
| 1176 | keep copy/paste from terminals, especially wide ones, from |
| 1177 | forcing a horizontal scrollbar on all clients. This breaks |
| 1178 | markdown's use of blackslash-space-space for paragraph |
| 1179 | continuation, but *not* doing this affects all clients every |
| 1180 | time someone pastes in console copy/paste from an affected |
| 1181 | platform. We seem to have narrowed to the console pasting |
| 1182 | problem to users of tmux. Most consoles don't behave |
| 1183 | that way. */ |
| 1184 | const xmsg = msg.split('\n'); |
| 1185 | xmsg.forEach(function(line,ndx){ |
| 1186 | if(!f.markdownContinuation.test(line)){ |
| 1187 | xmsg[ndx] = line.trimRight(); |
| 1188 | } |
| 1189 |