@@ -1125,7 +1125,7 @@ void WriteSeries(TextWriter series)
1125
1125
this . reportTextWriter . WriteLine ( "var historyChartData{0} = {{" , id ) ;
1126
1126
this . reportTextWriter . Write ( " \" series\" : [" ) ;
1127
1127
WriteSeries ( this . reportTextWriter ) ;
1128
- this . reportTextWriter . WriteLine ( "],\" " ) ;
1128
+ this . reportTextWriter . WriteLine ( "]," ) ;
1129
1129
1130
1130
this . reportTextWriter . WriteLine (
1131
1131
" \" tooltips\" : [{0}]" ,
@@ -1580,27 +1580,33 @@ private void SaveCss(string targetDirectory)
1580
1580
return ;
1581
1581
}
1582
1582
1583
- using ( var fs = new FileStream ( targetPath , FileMode . Create ) )
1583
+ if ( this . htmlMode == HtmlMode . InlineCssAndJavaScript )
1584
1584
{
1585
- if ( this . htmlMode != HtmlMode . InlineCssAndJavaScript )
1585
+ using ( var fs = new FileStream ( targetPath , FileMode . Create ) )
1586
+ using ( var writer = new StreamWriter ( fs ) )
1586
1587
{
1587
- var builder = StringBuilderCache . Get ( ) ;
1588
- using ( var writer = new StringWriter ( builder ) )
1589
- {
1590
- this . WriteCss ( writer ) ;
1591
- }
1588
+ this . WriteCss ( writer ) ;
1589
+ }
1590
+ }
1591
+ else
1592
+ {
1593
+ var builder = StringBuilderCache . Get ( ) ;
1594
+ using ( var writer = new StringWriter ( builder ) )
1595
+ {
1596
+ this . WriteCss ( writer ) ;
1597
+ }
1592
1598
1593
- string css = StringBuilderCache . ToStringAndReturnToPool ( builder ) ;
1594
- var matches = Regex . Matches ( css , @"url\(icon_(?<filename>.+).svg\),\surl\(data:image/svg\+xml;base64,(?<base64image>.+)\)" ) ;
1599
+ string css = StringBuilderCache . ToStringAndReturnToPool ( builder ) ;
1595
1600
1596
- foreach ( Match match in matches )
1597
- {
1598
- System . IO . File . WriteAllBytes (
1599
- Path . Combine ( targetDirectory , "icon_" + match . Groups [ "filename" ] . Value + ".svg" ) ,
1600
- Convert . FromBase64String ( match . Groups [ "base64image" ] . Value ) ) ;
1601
- }
1601
+ System . IO . File . WriteAllText ( targetPath , css ) ;
1602
+
1603
+ var matches = Regex . Matches ( css , @"url\(icon_(?<filename>.+).svg\),\surl\(data:image/svg\+xml;base64,(?<base64image>.+)\)" ) ;
1602
1604
1603
- StringBuilderCache . Return ( builder ) ;
1605
+ foreach ( Match match in matches )
1606
+ {
1607
+ System . IO . File . WriteAllBytes (
1608
+ Path . Combine ( targetDirectory , "icon_" + match . Groups [ "filename" ] . Value + ".svg" ) ,
1609
+ Convert . FromBase64String ( match . Groups [ "base64image" ] . Value ) ) ;
1604
1610
}
1605
1611
}
1606
1612
0 commit comments