mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-23 14:59:47 +03:00
Fix handling of preformatted text
svn path=/trunk/netsurf/; revision=12938
This commit is contained in:
parent
2c41d4b44e
commit
3043c58aaf
@ -1012,12 +1012,26 @@ bool box_construct_text(struct box_construct_ctx *ctx)
|
||||
|
||||
current += len;
|
||||
|
||||
if (current[0] == '\r' && current[1] == '\n') {
|
||||
current += 2;
|
||||
props.inline_container = NULL;
|
||||
} else if (current[0] != 0) {
|
||||
current++;
|
||||
props.inline_container = NULL;
|
||||
if (current[0] != '\0') {
|
||||
/* Linebreak: create new inline container */
|
||||
props.inline_container = box_create(NULL, NULL,
|
||||
false, NULL, NULL, NULL, NULL,
|
||||
ctx->content);
|
||||
if (props.inline_container == NULL) {
|
||||
free(text);
|
||||
return false;
|
||||
}
|
||||
|
||||
props.inline_container->type =
|
||||
BOX_INLINE_CONTAINER;
|
||||
|
||||
box_add_child(props.containing_block,
|
||||
props.inline_container);
|
||||
|
||||
if (current[0] == '\r' && current[1] == '\n')
|
||||
current += 2;
|
||||
else
|
||||
current++;
|
||||
}
|
||||
} while (*current);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user