messing with wordwrap

This commit is contained in:
Andrew Pamment 2018-02-28 09:33:40 +10:00
parent da5b512c5f
commit aa68a8f8f6

View File

@ -726,15 +726,21 @@ static char *www_wordwrap(char *content, int cutoff) {
} }
if (content[i] == '\r' && content[i+1] != '\r') { if (content[i] == '\r' && content[i+1] != '\r') {
if (content[i+1] == ' ' || quote_line != 1) { if (content[i+1] == ' ' && quote_line != 1) {
content[at++] = '\r'; content[at++] = '\r';
line_count = 0; line_count = 0;
quote_line = 0; quote_line = 0;
} else { } else {
if (at > 0 && content[at-1] != '\r' && content[at-1] != ' ') { if (at > 0 && content[at-1] != '\r' && content[at-1] != ' ') {
content[at++] = ' '; if (quote_line != 1) {
line_count++; content[at++] = ' ';
} line_count++;
} else {
content[at++] = '\r';
line_count = 0;
quote_line = 0;
}
}
} }
} else if (content[i] == '\r' && content[i+1] == '\r') { } else if (content[i] == '\r' && content[i+1] == '\r') {
content[at++] = '\r'; content[at++] = '\r';