crabber-net / crabber

A Twitter clone written in Python + Flask with extended features and a focus on inclusivity.
https://crabber.net
GNU General Public License v2.0
48 stars 16 forks source link

Longer molts get the last few characters removed after posting? #158

Closed viiuan closed 3 years ago

viiuan commented 3 years ago

Describe the bug If you make a molt near to or at the character limit WITH PARAGRAPH BREAKS, the last few characters disappear when the molt is posted. Editing the molt to add things back in works fine.

Screenshots image image

Desktop (please complete the following information):

jakeledoux commented 3 years ago

Yikes. Looks like Python and JavaScript are disagreeing on the length of the string. We'll look into this.

jakeledoux commented 3 years ago

The issue was that the submitted content used DOS-style line-endings. That meant that each newline was denoted by both the \r and \n characters as opposed to just \n, causing Python to count newlines twice and trim the remaining characters.