diff options
Diffstat (limited to 'render/box_construct.c')
-rw-r--r-- | render/box_construct.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/render/box_construct.c b/render/box_construct.c index b8d8e359a..c972258c0 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -624,6 +624,17 @@ bool box_construct_text(xmlNode *n, struct content *content, box_text_transform(text, strlen(text), parent_style->text_transform); current = text; + + /* swallow a single leading new line */ + switch (*current) { + case '\n': + current++; break; + case '\r': + current++; + if (*current == '\n') current++; + break; + } + do { size_t len = strcspn(current, "\r\n"); char old = current[len]; |