@@ -106,6 +106,40 @@ public void EscapePropertyNames_UnknownDeclaration_Issue120()
106
106
Assert . AreEqual ( css , generatedCss ) ;
107
107
}
108
108
109
+ [ Test ]
110
+ public void CssTextShouldNotAddReplacementCharacter_Issue123 ( )
111
+ {
112
+ var html = @"<span style=""background-image: var(--urlSpellingErrorV2,url("https://www.example.com/))"">Ipsum</span>" ;
113
+ var dom = html . ToHtmlDocument ( Configuration . Default . WithCss ( new CssParserOptions
114
+ {
115
+ IsIncludingUnknownDeclarations = true ,
116
+ IsIncludingUnknownRules = true ,
117
+ IsToleratingInvalidSelectors = true ,
118
+ } ) ) ;
119
+ var div = dom . Body ? . FirstElementChild ;
120
+ var style = div . GetStyle ( ) ;
121
+ var css = style . ToCss ( ) ;
122
+
123
+ Assert . AreEqual ( "background-image: var(--urlSpellingErrorV2,url(\" https://www.example.com/))" , css ) ;
124
+ }
125
+
126
+ [ Test ]
127
+ public void CssTextShouldNotTrailingSemicolonCharacter_Issue123 ( )
128
+ {
129
+ var html = @"<span style=""color: red;"">Ipsum</span>" ;
130
+ var dom = html . ToHtmlDocument ( Configuration . Default . WithCss ( new CssParserOptions
131
+ {
132
+ IsIncludingUnknownDeclarations = true ,
133
+ IsIncludingUnknownRules = true ,
134
+ IsToleratingInvalidSelectors = true ,
135
+ } ) ) ;
136
+ var div = dom . Body ? . FirstElementChild ;
137
+ var style = div . GetStyle ( ) ;
138
+ var css = style . ToCss ( ) ;
139
+
140
+ Assert . AreEqual ( "color: rgba(255, 0, 0, 1)" , css ) ;
141
+ }
142
+
109
143
[ Test ]
110
144
public void BorderWithEmptyPx_Issue129 ( )
111
145
{
0 commit comments