File tree 3 files changed +34
-1
lines changed
AngleSharp.Css/Dom/Internal/Rules
AngleSharp.Css.Tests/Rules
3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Released on tbd.
5
5
- Updated to use AngleSharp 1.0
6
6
- Fixed issue when updating shorthands with invalid values (#129 )
7
7
- Fixed issue with appended EOF character in ` CssText ` (#123 )
8
+ - Fixed missing semicolon in ` @page ` rule (#135 )
8
9
9
10
# 0.17.0
10
11
Original file line number Diff line number Diff line change
1
+ namespace AngleSharp . Css . Tests . Rules
2
+ {
3
+ using AngleSharp . Css . Dom ;
4
+ using NUnit . Framework ;
5
+ using System . Linq ;
6
+
7
+ [ TestFixture ]
8
+ public class CssPageRuleTests
9
+ {
10
+ [ Test ]
11
+ public void SemiColonsShouldNotMissInPageRule_Issue135 ( )
12
+ {
13
+ var html = "<html><body><style>@page { margin-top: 25mm; margin-right: 25mm }</style></body></html>" ;
14
+ var document = html . ToHtmlDocument ( Configuration . Default . WithCss ( ) ) ;
15
+ var styleSheet = document . StyleSheets . OfType < ICssStyleSheet > ( ) . First ( ) ;
16
+ var css = styleSheet . ToCss ( ) ;
17
+
18
+ Assert . AreEqual ( "@page { margin-top: 25mm; margin-right: 25mm }" , css ) ;
19
+ }
20
+
21
+ [ Test ]
22
+ public void PageRuleShouldRecombineShorthandDeclaration_Issue135 ( )
23
+ {
24
+ var html = "<html><body><style>@page { margin: 25mm }</style></body></html>" ;
25
+ var document = html . ToHtmlDocument ( Configuration . Default . WithCss ( ) ) ;
26
+ var styleSheet = document . StyleSheets . OfType < ICssStyleSheet > ( ) . First ( ) ;
27
+ var css = styleSheet . ToCss ( ) ;
28
+
29
+ Assert . AreEqual ( "@page { margin: 25mm }" , css ) ;
30
+ }
31
+ }
32
+ }
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ protected override void ReplaceWith(ICssRule rule)
60
60
61
61
public override void ToCss ( TextWriter writer , IStyleFormatter formatter )
62
62
{
63
- var rules = formatter . BlockRules ( _style ) ;
63
+ var rules = _style . ToCssBlock ( formatter ) ;
64
64
writer . Write ( formatter . Rule ( RuleNames . Page , SelectorText , rules ) ) ;
65
65
}
66
66
You can’t perform that action at this time.
0 commit comments