diff options
-rw-r--r-- | src/core/string.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/string.c b/src/core/string.c index 9df2cd3..3c2037f 100644 --- a/src/core/string.c +++ b/src/core/string.c @@ -1076,10 +1076,14 @@ dom_exception dom_string_whitespace_op(dom_string *s, } if (op & DOM_WHITESPACE_STRIP_TRAILING) { - if (temp_pos > temp) { + while (temp_pos > temp) { temp_pos--; - if (*temp_pos != ' ') + if (*temp_pos != ' ' && *temp_pos != '\t' && + *temp_pos != '\n' && *temp_pos != '\r' && + *temp_pos != '\f') { temp_pos++; + break; + } } } |