do not reset ncells or nbytesline if no newline was emitted - webdump - HTML to… | |
git clone git://git.codemadness.org/webdump | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 790402682bab675461f2a12879408dd5ad30c90f | |
parent 8d29c76012b91bbfaad1feca31b2af4cfbc99032 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Tue, 12 Sep 2023 20:01:15 +0200 | |
do not reset ncells or nbytesline if no newline was emitted | |
Test-case: | |
<div> | |
<div><b></b></div> | |
<p>abc</p> | |
</div> | |
This caused an extra indentation due to the nbytesline check in hflush(). | |
Diffstat: | |
M webdump.c | 8 ++++---- | |
1 file changed, 4 insertions(+), 4 deletions(-) | |
--- | |
diff --git a/webdump.c b/webdump.c | |
@@ -1571,10 +1571,10 @@ handleendtag(struct tag *tag) | |
hflush(); | |
for (i = currentnewlines; i < marginbottom; i++) { | |
putchar('\n'); | |
+ nbytesline = 0; | |
+ ncells = 0; | |
currentnewlines++; | |
} | |
- nbytesline = 0; | |
- ncells = 0; | |
hadnewline = 1; | |
} | |
} | |
@@ -1933,10 +1933,10 @@ xmltagstartparsed(XMLParser *p, const char *t, size_t t… | |
hflush(); | |
for (i = currentnewlines; i < margintop; i++) { | |
putchar('\n'); | |
+ nbytesline = 0; | |
+ ncells = 0; | |
currentnewlines++; | |
} | |
- nbytesline = 0; | |
- ncells = 0; | |
hadnewline = 1; | |
} | |