setbit (hc->tags_seen, cur_tag->id);
}
- if ((cur_tag->flags & (FL_CLOSED|FL_CLOSING)) &&
- (cur_tag->id == Tag_P || cur_tag->id == Tag_BR ||
- cur_tag->id == Tag_HR || cur_tag->id == Tag_TR ||
+ /* Handle newlines */
+ if (cur_tag->id == Tag_BR || cur_tag->id == Tag_HR) {
+ if (dest->len > 0 && dest->data[dest->len - 1] != '\n') {
+ g_byte_array_append (dest, "\r\n", 2);
+ }
+ save_space = FALSE;
+ }
+ else if ((cur_tag->flags & (FL_CLOSED|FL_CLOSING)) &&
+ (cur_tag->id == Tag_P ||
+ cur_tag->id == Tag_TR ||
cur_tag->id == Tag_DIV) && balanced) {
- /* Insert newline */
if (dest->len > 0 && dest->data[dest->len - 1] != '\n') {
g_byte_array_append (dest, "\r\n", 2);
}