mirror of https://github.com/zulip/zulip.git
zephyr_mirror: Make paragraph break detection a bit less aggressive.
Because in the zephyr world, people often manually linewrap their zephyrs, we need to relax the algorithm's assumption that every line was wrapped to the same linewrapping threshhold. Otherwise messages that look like this: aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaaa aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa might be treated as a paragraph break, even though that was unlikely to have been the sender's intention. (imported from commit e1144da2a3efc3241a8f15b0f19fea2ea6684254)
This commit is contained in:
parent
5e92cabb96
commit
f07e0a6324
|
@ -98,7 +98,7 @@ def to_zephyr_username(humbug_username):
|
|||
|
||||
def early_indent(line, next_line):
|
||||
words = next_line.split()
|
||||
return len(line + " " + words[0]) < len(next_line)
|
||||
return len(line + " " + words[0]) < len(next_line) * 0.8
|
||||
|
||||
# Linewrapping algorithm based on:
|
||||
# http://gcbenison.wordpress.com/2011/07/03/a-program-to-intelligently-remove-carriage-returns-so-you-can-paste-text-without-having-it-look-awful/
|
||||
|
|
Loading…
Reference in New Issue