aboutsummaryrefslogtreecommitdiffstats
path: root/src/var
diff options
context:
space:
mode:
authorTimmy Willison <4timmywil@gmail.com>2016-09-12 12:32:02 -0400
committerTimmy Willison <4timmywil@gmail.com>2016-09-15 10:40:27 -0400
commit3bbcce68d7b8b8a7a2164a0f7a280ae9daf70b5c (patch)
treea65aefeef8aa62ff092254dcd5b1f2c256dc82ea /src/var
parent2d4f53416e5f74fa98e0c1d66b6f3c285a12f0ce (diff)
downloadjquery-3bbcce68d7b8b8a7a2164a0f7a280ae9daf70b5c.tar.gz
jquery-3bbcce68d7b8b8a7a2164a0f7a280ae9daf70b5c.zip
Core: rnotwhite -> rhtmlnotwhite and jQuery.trim -> stripAndCollapse
- Renames and changes rnotwhite to focus on HTML whitespace chars - Change internal use of jQuery.trim to more accurate strip and collapse - Adds tests to ensure HTML space characters are retained where valid - Doesn't add tests where the difference is inconsequential and existing tests are adequate. Fixes gh-3003 Fixes gh-3072 Close gh-3316
Diffstat (limited to 'src/var')
-rw-r--r--src/var/rnothtmlwhite.js8
-rw-r--r--src/var/rnotwhite.js5
2 files changed, 8 insertions, 5 deletions
diff --git a/src/var/rnothtmlwhite.js b/src/var/rnothtmlwhite.js
new file mode 100644
index 000000000..30604db4f
--- /dev/null
+++ b/src/var/rnothtmlwhite.js
@@ -0,0 +1,8 @@
+define( function() {
+ "use strict";
+
+ // Only count HTML whitespace
+ // Other whitespace should count in values
+ // https://html.spec.whatwg.org/multipage/infrastructure.html#space-character
+ return ( /[^\x20\t\r\n\f]+/g );
+} );
diff --git a/src/var/rnotwhite.js b/src/var/rnotwhite.js
deleted file mode 100644
index 91bdec22f..000000000
--- a/src/var/rnotwhite.js
+++ /dev/null
@@ -1,5 +0,0 @@
-define( function() {
- "use strict";
-
- return ( /\S+/g );
-} );