Improved regex.
This commit is contained in:
parent
5e0ae554f9
commit
153d325e84
2 changed files with 5 additions and 1 deletions
|
@ -193,4 +193,4 @@ class App.Utils
|
|||
|
||||
# cleanString = App.Utils.htmlAttributeCleanup( string )
|
||||
@htmlAttributeCleanup: (string) ->
|
||||
string.replace(/(\!|\s|\r|\t|,|\.|\?|"|'|\^|#|=|\(|\)|\$)/g, '')
|
||||
string.replace(/((?![-a-zA-Z0-9_]+).|\n|\r|\t)/gm, '')
|
||||
|
|
|
@ -597,6 +597,10 @@ test( "check attibute validation", function() {
|
|||
verify = App.Utils.htmlAttributeCleanup( string )
|
||||
equal( verify, result, string )
|
||||
|
||||
string = "abc()=$\n123\rß"
|
||||
result = 'abc123'
|
||||
verify = App.Utils.htmlAttributeCleanup( string )
|
||||
equal( verify, result, string )
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue