1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Bug 947, set_hline: Respect wrap_nbsp also if !part->document.

This does not yet fix bug 947 for the case where the document is UTF-8
and the terminal is ISO-8859-1.  That will require changing charsets.c
too, it seems.
This commit is contained in:
Kalle Olavi Niemitalo 2007-04-26 07:48:11 +03:00 committed by Witold Filipczyk
parent 3baf35b30e
commit c108a425ce

View File

@ -563,7 +563,12 @@ good_char:
data = utf8_to_unicode(&chars, end);
if (data == UCS_SOFT_HYPHEN)
continue;
if (data == UCS_NO_BREAK_SPACE
&& html_context->options->wrap_nbsp)
data = UCS_SPACE;
part->spaces[x] = (data == UCS_SPACE);
part->char_width[x] = unicode_to_cell(data);
if (part->char_width[x] == 2) {
x++;
@ -579,7 +584,12 @@ good_char:
len = x - x2;
} else { /* not UTF-8 */
for (; charslen > 0; charslen--, x++, chars++) {
part->spaces[x] = (*chars == ' ');
unsigned char c = *chars;
if (c == NBSP_CHAR
&& html_context->options->wrap_nbsp)
c = ' ';
part->spaces[x] = (c == ' ');
part->char_width[x] = 1;
}
}