summaryrefslogtreecommitdiff
path: root/render/box_construct.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/box_construct.c')
-rw-r--r--render/box_construct.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index 144d8d80c..caa170477 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -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);