File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Doppler.HtmlEditorApi/Domain Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,16 @@ public void SanitizeTrackableLinks()
9797 public void SanitizeDynamicContentNodes ( )
9898 {
9999 var dynamicContentNodes = _contentNode . SelectNodes ( "//dynamiccontent" ) ;
100+
100101 if ( dynamicContentNodes != null )
101102 {
103+ var substringsToMatch = new [ ]
104+ {
105+ "unlayer-editor" ,
106+ // cspell:disable-next-line
107+ "cdn.fromdoppler.com"
108+ } ;
109+
102110 for ( var i = 0 ; i < dynamicContentNodes . Count ; i ++ )
103111 {
104112 var divNodes = dynamicContentNodes [ i ] . SelectNodes ( "div" ) ;
@@ -110,9 +118,15 @@ public void SanitizeDynamicContentNodes()
110118 }
111119 }
112120 var imgNode = dynamicContentNodes [ i ] . SelectSingleNode ( ".//img" ) ;
113- if ( imgNode != null && imgNode . GetAttributeValue ( "data-dc-type" , null ) == null )
121+
122+ if ( imgNode != null )
114123 {
115- imgNode . SetAttributeValue ( "src" , "[[[DC:IMAGE]]]" ) ;
124+ var srcValue = imgNode . GetAttributeValue ( "src" , "" ) ;
125+
126+ if ( substringsToMatch . Any ( sub => srcValue . Contains ( sub ) ) )
127+ {
128+ imgNode . SetAttributeValue ( "src" , "[[[DC:IMAGE]]]" ) ;
129+ }
116130 }
117131 }
118132 }
You can’t perform that action at this time.
0 commit comments