File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed
Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1818- chore: bump jinja2 to 3.1.5 and requests to 2.32.0 (#1714)
1919- Fix: situationally broken apropos command (#1711)
2020- chore: bump requests to 2.32.3 (#1715)
21+ - Fix: Newlines replaced with spaces in botcmd args (#1716)
22+ - chore: bump jinja2 to 3.1.6 (#1723)
23+ - chore: update errbot-backend-slackv3 version to 0.3.1 (#1725)
2124
2225
2326v6.2.0 (2024-01-01)
Original file line number Diff line number Diff line change @@ -325,21 +325,25 @@ def process_message(self, msg: Message) -> bool:
325325 prefixed = True
326326
327327 text = text .strip ()
328- text_split = text .split ()
329328 cmd = None
330329 command = None
331330 args = ""
332331 if not only_check_re_command :
333- i = len (text_split )
332+ first = True
333+ i = len (text .split ())
334334 while cmd is None :
335+ # maxsplit so we can preserve linebreaks and other whitespace in args
336+ text_split = text .split (maxsplit = i )
335337 command = "_" .join (text_split [:i ])
336338
337339 with self ._gbl :
338340 if command in self .commands :
339341 cmd = command
340- args = " " .join (text_split [i :])
342+ if not first :
343+ args = text_split [- 1 ]
341344 else :
342345 i -= 1
346+ first = False
343347 if i <= 0 :
344348 break
345349
Original file line number Diff line number Diff line change @@ -57,6 +57,16 @@ def test_echo(testbot):
5757 assert "foo" in testbot .exec_command ("!echo foo" )
5858
5959
60+ def test_echo_newline_args (testbot ):
61+ # https://github.com/errbotio/errbot/issues/1307
62+ assert testbot .exec_command ("!echo\n foo\n bar" ).startswith ("foo" )
63+
64+
65+ def test_echo_newline_preserved (testbot ):
66+ # https://github.com/errbotio/errbot/issues/1716
67+ assert "\n " in testbot .exec_command ("!echo foo\n bar" )
68+
69+
6070def test_status_gc (testbot ):
6171 assert "GC 0->" in testbot .exec_command ("!status gc" )
6272
You can’t perform that action at this time.
0 commit comments