@@ -395,6 +395,12 @@ private Dictionary<string, string> ParseCssBlockProperties(string blockSource)
395395 while ( startIdx < blockSource . Length )
396396 {
397397 int endIdx = blockSource . IndexOfAny ( _cssBlockSplitters , startIdx ) ;
398+
399+ // If blockSource contains "data:image" then skip first semicolon since it is a part of image definition
400+ // example: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA......"
401+ if ( startIdx >= 0 && endIdx - startIdx >= 10 && blockSource . Length - startIdx >= 10 && blockSource . IndexOf ( "data:image" , startIdx , endIdx - startIdx ) >= 0 )
402+ endIdx = blockSource . IndexOfAny ( _cssBlockSplitters , endIdx + 1 ) ;
403+
398404 if ( endIdx < 0 )
399405 endIdx = blockSource . Length - 1 ;
400406
@@ -485,7 +491,11 @@ private void AddProperty(string propName, string propValue, Dictionary<string, s
485491 }
486492 else if ( propName == "background-image" )
487493 {
488- properties [ "background-image" ] = ParseBackgroundImageProperty ( propValue ) ;
494+ properties [ "background-image" ] = ParseImageProperty ( propValue ) ;
495+ }
496+ else if ( propName == "content" )
497+ {
498+ properties [ "content" ] = ParseImageProperty ( propValue ) ;
489499 }
490500 else if ( propName == "font-family" )
491501 {
@@ -584,7 +594,7 @@ private void ParseFontProperty(string propValue, Dictionary<string, string> prop
584594 /// </summary>
585595 /// <param name="propValue">the value of the property to parse</param>
586596 /// <returns>parsed value</returns>
587- private static string ParseBackgroundImageProperty ( string propValue )
597+ private static string ParseImageProperty ( string propValue )
588598 {
589599 int startIdx = propValue . IndexOf ( "url(" , StringComparison . InvariantCultureIgnoreCase ) ;
590600 if ( startIdx > - 1 )
0 commit comments