@@ -668,11 +668,13 @@ define([
668
668
*/
669
669
encodeDirectives : function ( content ) {
670
670
// collect all HTML tags with attributes that contain directives
671
+ // eslint-disable-next-line no-useless-escape
671
672
return content . gsub ( / < ( [ a - z 0 - 9 \- \_ ] + [ ^ > ] + ?) ( [ a - z 0 - 9 \- \_ ] + = " [ ^ " ] * ?\{ \{ .+ ?\} \} .* ?" .* ?) > / i, function ( match ) {
672
673
var attributesString = match [ 2 ] ,
673
674
decodedDirectiveString ;
674
-
675
675
// process tag attributes string
676
+ // eslint-disable-next-line no-useless-escape
677
+
676
678
attributesString = attributesString . gsub ( / ( [ a - z 0 - 9 \- \_ ] + ) = " ( .* ?) ( \{ \{ .+ ?\} \} ) ( .* ?) " / i, function ( m ) {
677
679
decodedDirectiveString = encodeURIComponent ( Base64 . mageEncode ( m [ 3 ] . replace ( / & q u o t ; / g, '"' ) + m [ 4 ] ) ) ;
678
680
@@ -691,11 +693,12 @@ define([
691
693
decodeDirectives : function ( content ) {
692
694
var directiveUrl = this . makeDirectiveUrl ( '%directive%' ) . split ( '?' ) [ 0 ] , // remove query string from directive
693
695
// escape special chars in directives url to use in regular expression
696
+ // eslint-disable-next-line no-useless-escape
694
697
regexEscapedDirectiveUrl = directiveUrl . replace ( / ( [ $ ^ . ? * ! + : = ( ) \[ \] { } | \\ ] ) / g, '\\$1' ) ,
695
698
regexDirectiveUrl = regexEscapedDirectiveUrl
696
699
. replace (
697
700
'%directive%' ,
698
- '([a-zA-Z0-9,_-]+(?:%2[A-Z]|)+\/?)(?:(?!").)*'
701
+ '([a-zA-Z0-9,_-]+(?:%2[A-Z]|)+\/?)(?:(?!").)*' // eslint-disable-next-line no-useless-escape
699
702
) + '/?(\\\\?[^"]*)?' , // allow optional query string
700
703
reg = new RegExp ( regexDirectiveUrl ) ;
701
704
0 commit comments