File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
AngleSharp.Css.Tests/Library Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change
1
+ namespace AngleSharp . Css . Tests . Library
2
+ {
3
+ using AngleSharp . Css . Parser ;
4
+ using NUnit . Framework ;
5
+ using System . IO ;
6
+
7
+ [ TestFixture ]
8
+ public class StringRepresentationTests
9
+ {
10
+ [ Test ]
11
+ public void PrettyStyleFormatterStringifyShouldWork_Issue41 ( )
12
+ {
13
+ var text = "@media (min-width: 800px) { .ad_column { width: 728px; height: 90px } }" ;
14
+ var parser = new CssParser ( ) ;
15
+ var document = parser . ParseStyleSheet ( text ) ;
16
+
17
+ using ( var stringWriter = new StringWriter ( ) )
18
+ {
19
+ document . ToCss ( stringWriter , new PrettyStyleFormatter ( ) ) ;
20
+ Assert . AreEqual ( "@media (min-width: 800px) { \n \t .ad_column {\n \t \t width: 728px;\n \t \t height: 90px;\n \t }\n }" , stringWriter . ToString ( ) ) ;
21
+ }
22
+ }
23
+ }
24
+ }
Original file line number Diff line number Diff line change 1
- namespace AngleSharp . Css
1
+ namespace AngleSharp . Css
2
2
{
3
3
using AngleSharp . Text ;
4
4
using System ;
@@ -117,7 +117,7 @@ String IStyleFormatter.BlockDeclarations(IEnumerable<IStyleFormattable> declarat
117
117
foreach ( var declaration in declarations )
118
118
{
119
119
sb . Append ( sep ) . Append ( _intendString ) ;
120
- sb . Append ( declaration ) . Append ( Symbols . Semicolon ) ;
120
+ sb . Append ( declaration . ToCss ( ) ) . Append ( Symbols . Semicolon ) ;
121
121
}
122
122
123
123
return sb . Append ( sep ) . Append ( Symbols . CurlyBracketClose ) . ToPool ( ) ;
You can’t perform that action at this time.
0 commit comments