Skip to content

Commit eb29274

Browse files
committed
fixes #21 for ScreenCapturePath
1 parent cbd7b76 commit eb29274

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ExtentReports/Model/ScreenCapture.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ namespace AventStack.ExtentReports.Model
55
[Serializable]
66
public class ScreenCapture : Media
77
{
8+
private const string Base64StringDataType = "data:image/png;base64,";
9+
810
public string Source
911
{
1012
get
1113
{
1214
if (!string.IsNullOrEmpty(Base64String))
1315
{
14-
return "<a href='data:image/png;base64," + Base64String + "' data-featherlight='image'><span class='label grey badge white-text text-white'>base64-img</span></a>";
16+
return "<a href='" + Base64StringDataType + Base64String + "' data-featherlight='image'><span class='label grey badge white-text text-white'>base64-img</span></a>";
1517
}
1618

1719
return "<img class='r-img' onerror='this.style.display=\"none\"' data-featherlight='" + Path + "' src='" + Path + "' data-src='" + Path + "'>";
@@ -24,7 +26,7 @@ public string SourceIcon
2426
{
2527
if (!string.IsNullOrEmpty(Base64String))
2628
{
27-
return "<a href='data:image/png;base64," + Base64String + "' data-featherlight='image'><span class='label grey badge white-text text-white'>base64-img</span></a>";
29+
return "<a href='" + Base64StringDataType + Base64String + "' data-featherlight='image'><span class='label grey badge white-text text-white'>base64-img</span></a>";
2830
}
2931

3032
return "<a class='r-img' onerror='this.style.display=\"none\"' data-featherlight='" + Path + "' href='" + Path + "' data-src='" + Path + "'>" +
@@ -37,7 +39,7 @@ public string ScreenCapturePath
3739
{
3840
get
3941
{
40-
return !string.IsNullOrEmpty(base.Path) ? base.Path : Base64String;
42+
return !string.IsNullOrEmpty(base.Path) ? base.Path : Base64StringDataType + Base64String;
4143
}
4244
}
4345

0 commit comments

Comments
 (0)