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.

stephan 2021-09-30 21:01 chat-input-rework
Commit 87b0b12dc45b9b2370831c9cd5a597220e28cc7d0b330adfdadc04ffedb5245d
1 file changed +4 -2
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -1164,11 +1164,11 @@
11641164
empty, this is a no-op.
11651165
*/
11661166
Chat.submitMessage = function f(){
11671167
if(!f.spaces){
11681168
f.spaces = /\s+$/;
1169
- f.markdownContinuation = /\\\s\s$/;
1169
+ f.markdownContinuation = /\\\s+$/;
11701170
}
11711171
this.setCurrentView(this.e.viewMessages);
11721172
const fd = new FormData();
11731173
var msg = this.inputValue().trim();
11741174
if(msg && (msg.indexOf('\n')>0 || f.spaces.test(msg))){
@@ -1176,11 +1176,13 @@
11761176
keep copy/paste from terminals, especially wide ones, from
11771177
forcing a horizontal scrollbar on all clients. This breaks
11781178
markdown's use of blackslash-space-space for paragraph
11791179
continuation, but *not* doing this affects all clients every
11801180
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. */
11821184
const xmsg = msg.split('\n');
11831185
xmsg.forEach(function(line,ndx){
11841186
if(!f.markdownContinuation.test(line)){
11851187
xmsg[ndx] = line.trimRight();
11861188
}
11871189
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button