diff options
author | Jesús Eduardo <heckyel@hyperbola.info> | 2017-08-06 20:43:24 -0500 |
---|---|---|
committer | Jesús Eduardo <heckyel@hyperbola.info> | 2017-08-06 20:43:24 -0500 |
commit | f7045b862a5b7c3de8ee2ea3da67616b38a667cc (patch) | |
tree | 504f420546df4934495bbd6f3d9761650b3783bd /lib/jquery/src/core/stripAndCollapse.js | |
download | ytlibre-f7045b862a5b7c3de8ee2ea3da67616b38a667cc.tar.lz ytlibre-f7045b862a5b7c3de8ee2ea3da67616b38a667cc.tar.xz ytlibre-f7045b862a5b7c3de8ee2ea3da67616b38a667cc.zip |
first commit
Diffstat (limited to 'lib/jquery/src/core/stripAndCollapse.js')
-rw-r--r-- | lib/jquery/src/core/stripAndCollapse.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/jquery/src/core/stripAndCollapse.js b/lib/jquery/src/core/stripAndCollapse.js new file mode 100644 index 0000000..ccad660 --- /dev/null +++ b/lib/jquery/src/core/stripAndCollapse.js @@ -0,0 +1,14 @@ +define( [ + "../var/rnothtmlwhite" +], function( rnothtmlwhite ) { + "use strict"; + + // Strip and collapse whitespace according to HTML spec + // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + return stripAndCollapse; +} ); |