errbot icon indicating copy to clipboard operation
errbot copied to clipboard

Double linebreak on XMPP replaced by 1 linebreak and 1 space

Open zaughon opened this issue 7 years ago • 0 comments

In order to let us help you better, please fill out the following fields as best you can:

I am...

  • [x] Reporting a bug
  • [ ] Suggesting a new feature
  • [ ] Requesting help with running my bot
  • [ ] Requesting help writing plugins
  • [ ] Here about something else

I am running...

  • Errbot version: 5.1.3
  • OS version: Ubuntu 14.04 LTS
  • Python version: 3.4.3
  • Using a virtual environment: yes
  • Backend: XMPP

Issue description

When i send a message with te\n\nst it does 1 linebreak and 1 space, instead of 2 linebreaks

E.g.:

    @botcmd()
    def test(self, msg, args):
        return "Te\n\nst"

returns:

Te
 st

instead of:

Te

st

I tried escaping it, using "```\nte\n\nst```\n", but that just returns:

\```
te
 st```

(but without the \ those were to prevent markdown from interpreting it here) Still with the 1 linebreak, and then a space.

Steps to reproduce

  1. Set up a bot using XMPP-backend.
  2. Create the following command:
    @botcmd()
    def test(self, msg, args):
        return "Te\n\nst"
  1. Use the command.

Result: It will ignore the double line-break, and do 1 line-break, and 1 space.

Additional info

The same issue happens when using errbot templating. If you have a longer template, you can only do 1 line break, then it just start adding spaces instead, meaning everything looks extremely clumped together, as you can't really create paragraphs.

Not sure if this is related to the information/errors i posted in this comment: https://github.com/errbotio/errbot/issues/1148#issuecomment-361564907

zaughon avatar Apr 30 '18 08:04 zaughon