@@ -22,7 +22,7 @@ public class MhtmlReportBuilder : IReportBuilder
2222        /// <summary> 
2323        /// The <see cref="HtmlReportBuilder"/>. 
2424        /// </summary> 
25-         private  readonly  IReportBuilder  htmlReportBuilder  =  new  HtmlReportBuilder ( false ) ; 
25+         private  readonly  IReportBuilder  htmlReportBuilder  =  new  HtmlInlineCssAndJavaScriptReportBuilder ( ) ; 
2626
2727        /// <summary> 
2828        /// The report context. 
@@ -117,20 +117,6 @@ private static void WriteFile(StreamWriter writer, string filePath, string conte
117117            writer . WriteLine ( ) ; 
118118        } 
119119
120-         /// <summary> 
121-         /// Adds the 'file:///' prefix for CSS and java script links. 
122-         /// </summary> 
123-         /// <param name="content">The content.</param> 
124-         /// <returns>The processed content.</returns> 
125-         private  static   string  AddFilePrefixForCssAndJavaScript ( string  content ) 
126-         { 
127-             content  =  content . Replace ( "<link rel=\" stylesheet\"  type=\" text/css\"  href=\" report.css\"  />" ,  "<link rel=\" stylesheet\"  type=\" text/css\"  href=\" file:///report.css\"  />" ) ; 
128-             content  =  content . Replace ( "<script type=\" text/javascript\"  src=\" main.js\" ></script>" ,  "<script type=\" text/javascript\"  src=\" file:///main.js\" ></script>" ) ; 
129-             content  =  content . Replace ( "<script type=\" text/javascript\"  src=\" class.js\" ></script>" ,  "<script type=\" text/javascript\"  src=\" file:///class.js\" ></script>" ) ; 
130- 
131-             return  content ; 
132-         } 
133- 
134120        /// <summary> 
135121        /// Creates the MHTML file. 
136122        /// </summary> 
@@ -172,7 +158,6 @@ private void CreateMhtmlFile()
172158
173159                string  file  =  "index.html" ; 
174160                string  content  =  File . ReadAllText ( Path . Combine ( htmlReportTargetDirectory ,  file ) ) ; 
175-                 content  =  AddFilePrefixForCssAndJavaScript ( content ) ; 
176161                content  =  content . Replace ( "<tr><td><a href=\" " ,  "<tr><td><a href=\" file:///" ) ; 
177162                WriteFile ( writer ,  file ,  "text/html" ,  content ) ; 
178163
@@ -185,28 +170,10 @@ private void CreateMhtmlFile()
185170
186171                    file  =  reportFile . Substring ( reportFile . LastIndexOf ( Path . DirectorySeparatorChar )  +  1 ) ; 
187172                    content  =  File . ReadAllText ( reportFile ) ; 
188-                     content  =  AddFilePrefixForCssAndJavaScript ( content ) ; 
189173                    content  =  content . Replace ( "<a href=\" index.html\" " ,  "<a href=\" file:///index.html\" " ) ; 
190174                    WriteFile ( writer ,  file ,  "text/html" ,  content ) ; 
191175                } 
192176
193-                 file  =  "main.js" ; 
194-                 content  =  File . ReadAllText ( Path . Combine ( htmlReportTargetDirectory ,  file ) ) ; 
195-                 content  =  content . Replace ( ", \" reportPath\" : \" " ,  ", \" reportPath\" : \" file:///" ) ; 
196-                 content  =  content . Replace ( ", \" rp\" : \" " ,  ", \" rp\" : \" file:///" ) ; 
197-                 WriteFile ( writer ,  file ,  "application/javascript" ,  content ) ; 
198- 
199-                 file  =  "class.js" ; 
200-                 if  ( File . Exists ( Path . Combine ( htmlReportTargetDirectory ,  file ) ) ) 
201-                 { 
202-                     content  =  File . ReadAllText ( Path . Combine ( htmlReportTargetDirectory ,  file ) ) ; 
203-                     WriteFile ( writer ,  file ,  "application/javascript" ,  content ) ; 
204-                 } 
205- 
206-                 file  =  "report.css" ; 
207-                 content  =  File . ReadAllText ( Path . Combine ( htmlReportTargetDirectory ,  file ) ) ; 
208-                 WriteFile ( writer ,  file ,  "text/css" ,  content ) ; 
209- 
210177                writer . Write ( "------=_NextPart_000_0000_01D23618.54EBCBE0--" ) ; 
211178            } 
212179        } 
0 commit comments