File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 9
9
if ( ! window . localStorage . getItem ( 'keys' ) || ! keys ) restaurar ( )
10
10
11
11
function encriptar ( e ) {
12
- let word = document . querySelector ( "#input" ) . value . trim ( ) ;
12
+ let word = document . querySelector ( "#input" ) . value . replace ( / \s + / g , ' ' ) . trim ( ) ;
13
13
if ( ( word . match ( isLower ) || word . match ( regSign ) ) && word . match ( regSpace ) ) {
14
14
keys . forEach ( ( k , i ) => { word = word . replace ( RegExp ( k [ 0 ] , 'g' ) , i ) } )
15
15
keys . forEach ( ( k , i ) => { word = word . replace ( RegExp ( i , 'g' ) , k ) } )
@@ -19,7 +19,7 @@ function encriptar(e) {
19
19
}
20
20
21
21
function desencriptar ( e ) {
22
- let word = document . querySelector ( "#input" ) . value . trim ( ) ;
22
+ let word = document . querySelector ( "#input" ) . value . replace ( / \s + / g , ' ' ) . trim ( ) ;
23
23
if ( ( word . match ( isLower ) || word . match ( regSign ) ) && word . match ( regSpace ) ) {
24
24
keys . forEach ( ( key ) => { word = word . replace ( RegExp ( key , 'g' ) , key [ 0 ] ) } )
25
25
document . querySelector ( "#copiar-area" ) . value = word ;
You can’t perform that action at this time.
0 commit comments