@@ -668,11 +668,13 @@ define([
668668 */
669669 encodeDirectives : function ( content ) {
670670 // collect all HTML tags with attributes that contain directives
671+ // eslint-disable-next-line no-useless-escape
671672 return content . gsub ( / < ( [ a - z 0 - 9 \- \_ ] + [ ^ > ] + ?) ( [ a - z 0 - 9 \- \_ ] + = " [ ^ " ] * ?\{ \{ .+ ?\} \} .* ?" .* ?) > / i, function ( match ) {
672673 var attributesString = match [ 2 ] ,
673674 decodedDirectiveString ;
674-
675675 // process tag attributes string
676+ // eslint-disable-next-line no-useless-escape
677+
676678 attributesString = attributesString . gsub ( / ( [ a - z 0 - 9 \- \_ ] + ) = " ( .* ?) ( \{ \{ .+ ?\} \} ) ( .* ?) " / i, function ( m ) {
677679 decodedDirectiveString = encodeURIComponent ( Base64 . mageEncode ( m [ 3 ] . replace ( / & q u o t ; / g, '"' ) + m [ 4 ] ) ) ;
678680
@@ -691,11 +693,12 @@ define([
691693 decodeDirectives : function ( content ) {
692694 var directiveUrl = this . makeDirectiveUrl ( '%directive%' ) . split ( '?' ) [ 0 ] , // remove query string from directive
693695 // escape special chars in directives url to use in regular expression
696+ // eslint-disable-next-line no-useless-escape
694697 regexEscapedDirectiveUrl = directiveUrl . replace ( / ( [ $ ^ . ? * ! + : = ( ) \[ \] { } | \\ ] ) / g, '\\$1' ) ,
695698 regexDirectiveUrl = regexEscapedDirectiveUrl
696699 . replace (
697700 '%directive%' ,
698- '([a-zA-Z0-9,_-]+(?:%2[A-Z]|)+\/?)(?:(?!").)*'
701+ '([a-zA-Z0-9,_-]+(?:%2[A-Z]|)+\/?)(?:(?!").)*' // eslint-disable-next-line no-useless-escape
699702 ) + '/?(\\\\?[^"]*)?' , // allow optional query string
700703 reg = new RegExp ( regexDirectiveUrl ) ;
701704
0 commit comments