@@ -74,9 +74,9 @@ public PreMailer(Stream stream, Uri baseUri = null)
74
74
/// <param name="stripIdAndClassAttributes">True to strip ID and class attributes</param>
75
75
/// <param name="removeComments">True to remove comments, false to leave them intact</param>
76
76
/// <returns>Returns the html input, with styles moved to inline attributes.</returns>
77
- public static InlineResult MoveCssInline ( string html , bool removeStyleElements = false , string ignoreElements = null , string css = null , bool stripIdAndClassAttributes = false , bool removeComments = false )
77
+ public static InlineResult MoveCssInline ( string html , bool removeStyleElements = false , string ignoreElements = null , string css = null , bool stripIdAndClassAttributes = false , bool removeComments = false , IMarkupFormatter customFormatter = null )
78
78
{
79
- return new PreMailer ( html ) . MoveCssInline ( removeStyleElements , ignoreElements , css , stripIdAndClassAttributes , removeComments ) ;
79
+ return new PreMailer ( html ) . MoveCssInline ( removeStyleElements , ignoreElements , css , stripIdAndClassAttributes , removeComments , customFormatter ) ;
80
80
}
81
81
82
82
/// <summary>
@@ -89,9 +89,9 @@ public static InlineResult MoveCssInline(string html, bool removeStyleElements =
89
89
/// <param name="stripIdAndClassAttributes">True to strip ID and class attributes</param>
90
90
/// <param name="removeComments">True to remove comments, false to leave them intact</param>
91
91
/// <returns>Returns the html input, with styles moved to inline attributes.</returns>
92
- public static InlineResult MoveCssInline ( Stream stream , bool removeStyleElements = false , string ignoreElements = null , string css = null , bool stripIdAndClassAttributes = false , bool removeComments = false )
92
+ public static InlineResult MoveCssInline ( Stream stream , bool removeStyleElements = false , string ignoreElements = null , string css = null , bool stripIdAndClassAttributes = false , bool removeComments = false , IMarkupFormatter customFormatter = null )
93
93
{
94
- return new PreMailer ( stream ) . MoveCssInline ( removeStyleElements , ignoreElements , css , stripIdAndClassAttributes , removeComments ) ;
94
+ return new PreMailer ( stream ) . MoveCssInline ( removeStyleElements , ignoreElements , css , stripIdAndClassAttributes , removeComments , customFormatter ) ;
95
95
}
96
96
97
97
/// <summary>
@@ -106,9 +106,9 @@ public static InlineResult MoveCssInline(Stream stream, bool removeStyleElements
106
106
/// <param name="stripIdAndClassAttributes">True to strip ID and class attributes</param>
107
107
/// <param name="removeComments">True to remove comments, false to leave them intact</param>
108
108
/// <returns>Returns the html input, with styles moved to inline attributes.</returns>
109
- public static InlineResult MoveCssInline ( Uri baseUri , string html , bool removeStyleElements = false , string ignoreElements = null , string css = null , bool stripIdAndClassAttributes = false , bool removeComments = false )
109
+ public static InlineResult MoveCssInline ( Uri baseUri , string html , bool removeStyleElements = false , string ignoreElements = null , string css = null , bool stripIdAndClassAttributes = false , bool removeComments = false , IMarkupFormatter customFormatter = null )
110
110
{
111
- return new PreMailer ( html , baseUri ) . MoveCssInline ( removeStyleElements , ignoreElements , css , stripIdAndClassAttributes , removeComments ) ;
111
+ return new PreMailer ( html , baseUri ) . MoveCssInline ( removeStyleElements , ignoreElements , css , stripIdAndClassAttributes , removeComments , customFormatter ) ;
112
112
}
113
113
114
114
/// <summary>
@@ -123,9 +123,9 @@ public static InlineResult MoveCssInline(Uri baseUri, string html, bool removeSt
123
123
/// <param name="stripIdAndClassAttributes">True to strip ID and class attributes</param>
124
124
/// <param name="removeComments">True to remove comments, false to leave them intact</param>
125
125
/// <returns>Returns the html input, with styles moved to inline attributes.</returns>
126
- public static InlineResult MoveCssInline ( Uri baseUri , Stream stream , bool removeStyleElements = false , string ignoreElements = null , string css = null , bool stripIdAndClassAttributes = false , bool removeComments = false )
126
+ public static InlineResult MoveCssInline ( Uri baseUri , Stream stream , bool removeStyleElements = false , string ignoreElements = null , string css = null , bool stripIdAndClassAttributes = false , bool removeComments = false , IMarkupFormatter customFormatter = null )
127
127
{
128
- return new PreMailer ( stream , baseUri ) . MoveCssInline ( removeStyleElements , ignoreElements , css , stripIdAndClassAttributes , removeComments ) ;
128
+ return new PreMailer ( stream , baseUri ) . MoveCssInline ( removeStyleElements , ignoreElements , css , stripIdAndClassAttributes , removeComments , customFormatter ) ;
129
129
}
130
130
131
131
/// <summary>
@@ -137,7 +137,7 @@ public static InlineResult MoveCssInline(Uri baseUri, Stream stream, bool remove
137
137
/// <param name="stripIdAndClassAttributes">True to strip ID and class attributes</param>
138
138
/// <param name="removeComments">True to remove comments, false to leave them intact</param>
139
139
/// <returns>Returns the html input, with styles moved to inline attributes.</returns>
140
- public InlineResult MoveCssInline ( bool removeStyleElements = false , string ignoreElements = null , string css = null , bool stripIdAndClassAttributes = false , bool removeComments = false )
140
+ public InlineResult MoveCssInline ( bool removeStyleElements = false , string ignoreElements = null , string css = null , bool stripIdAndClassAttributes = false , bool removeComments = false , IMarkupFormatter customFormatter = null )
141
141
{
142
142
// Store the variables used for inlining the CSS
143
143
_removeStyleElements = removeStyleElements ;
@@ -179,7 +179,7 @@ public InlineResult MoveCssInline(bool removeStyleElements = false, string ignor
179
179
}
180
180
}
181
181
182
- IMarkupFormatter markupFormatter = GetMarkupFormatterForDocType ( ) ;
182
+ IMarkupFormatter markupFormatter = customFormatter ?? GetMarkupFormatterForDocType ( ) ;
183
183
184
184
using ( var sw = new StringWriter ( ) )
185
185
{
0 commit comments