* the document 'p' at 'point'.
* 'type' can be:
* NULL : no explicit wrapping
- * "text": add wrap points between words
+ * "text": no explicit wrapping
* "list": convert commas to wrap points.
* 'hdr' is the name of the header - before the ':'.
* '\n', '\r' are copied as a single space, and subsequent
char buf[20];
wint_t ch;
char attr[100];
- int is_text = type && strcmp(type, "text") == 0;
int is_list = type && strcmp(type, "list") == 0;
m = mark_dup(start);
if (sol && (ch == ' ' || ch == '\t'))
continue;
if (sol) {
- call("doc:replace", p, 1, NULL, " ", 0, point,
- is_text ? ",render:rfc822header-wrap=1" : NULL);
+ call("doc:replace", p, 1, NULL, " ", 0, point);
sol = 0;
}
buf[0] = ch;
mark_free(p2);
}
}
- if (is_text) {
- /* flag all space as wrapping. We didn't do this before
- * as they might have been hiding in quoted words.
- */
- struct mark *m2 = mark_dup(hstart);
- while (mark_ordered_not_same(m2, point)) {
- struct mark *ms;
- int cnt = 1;
- int c = doc_next(p, m2);
- if (c != ' ' && c != '\t')
- continue;
- ms = mark_dup(m2);
- doc_prev(p, ms);
- while ((c = doc_following(p, m2)) == ' ' ||
- c == '\t') {
- cnt += 1;
- doc_next(p, m2);
- }
- snprintf(buf, sizeof(buf), "%d", cnt);
- call("doc:set-attr", p, 1, ms, "render:rfc822header-wrap",
- 0, NULL, buf);
- }
- }
call("doc:replace", p, 1, NULL, "\n", 0, point);
snprintf(buf, sizeof(buf), "%zd", strlen(hdr_found)+1);
call("doc:set-attr", p, 1, hstart, "render:rfc822header", 0, NULL, buf);