[project @ 2006-03-26 23:52:22 by dsilvers]

Allow white-space: pre* elements to consume one initial new line to make rendering neater

svn path=/import/netsurf/; revision=2191
This commit is contained in:
Daniel Silverstone 2006-03-26 23:52:22 +00:00
parent 1c1c7d4332
commit c15a9ebee7

View File

@ -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];