mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
fix a few bugs for line counting in plain text
This commit is contained in:
parent
7717862401
commit
6e9a18b444
@ -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,8 +144,15 @@ scan_sgml_text_token(struct dom_scanner *scanner, struct dom_scanner_token *toke
|
||||
type = SGML_TOKEN_TEXT;
|
||||
}
|
||||
|
||||
foreach_sgml_cdata (scanner, string) {
|
||||
/* m33p */;
|
||||
if (scanner->count_lines) {
|
||||
foreach_sgml_cdata (scanner, string) {
|
||||
if (is_sgml_newline(*string))
|
||||
scanner->lineno++;
|
||||
}
|
||||
} else {
|
||||
foreach_sgml_cdata (scanner, string) {
|
||||
/* m33p */;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user