1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

fix a few bugs for line counting in plain text

This commit is contained in:
Jonas Fonseca 2006-01-02 01:49:12 +01:00 committed by Jonas Fonseca
parent 7717862401
commit 6e9a18b444

View File

@ -135,6 +135,8 @@ scan_sgml_text_token(struct dom_scanner *scanner, struct dom_scanner_token *toke
} else {
if (is_sgml_space(first_char)) {
if (scanner->count_lines)
string--;
skip_sgml_space(scanner, &string);
type = string < scanner->end && is_sgml_text(*string)
? SGML_TOKEN_TEXT : SGML_TOKEN_SPACE;
@ -142,10 +144,17 @@ scan_sgml_text_token(struct dom_scanner *scanner, struct dom_scanner_token *toke
type = SGML_TOKEN_TEXT;
}
if (scanner->count_lines) {
foreach_sgml_cdata (scanner, string) {
if (is_sgml_newline(*string))
scanner->lineno++;
}
} else {
foreach_sgml_cdata (scanner, string) {
/* m33p */;
}
}
}
token->type = type;
token->string.length = real_length >= 0 ? real_length : string - token->string.string;