diff options
author | Junyoung Cho <june0.cho@samsung.com> | 2014-02-21 16:16:06 +0900 |
---|---|---|
committer | Junyoung Cho <june0.cho@samsung.com> | 2014-02-21 17:30:15 +0900 |
commit | 327e1e20a91fe1849ab84a2f0e710e3d4d94aba4 (patch) | |
tree | 6a04beacec2993027336715bbf309f2b201ce465 /src/components/util/str.rs | |
parent | 65191b0d6316fa5ee0fcc9ad301a77e6b6f51b20 (diff) | |
download | servo-327e1e20a91fe1849ab84a2f0e710e3d4d94aba4.tar.gz servo-327e1e20a91fe1849ab84a2f0e710e3d4d94aba4.zip |
Prevent ' ' from stripping as whitespace
Diffstat (limited to 'src/components/util/str.rs')
-rw-r--r-- | src/components/util/str.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/components/util/str.rs b/src/components/util/str.rs index 13272d8ec42..0b9bd74f074 100644 --- a/src/components/util/str.rs +++ b/src/components/util/str.rs @@ -19,3 +19,6 @@ pub fn null_str_as_empty_ref<'a>(s: &'a Option<DOMString>) -> &'a str { } } +pub fn is_whitespace_not_nbsp(s: &str) -> bool { + s.chars().all(|c| c.is_whitespace() && c != '\xa0') +} |