diff --git a/MdXaml/Markdown.cs b/MdXaml/Markdown.cs
index c0f74c9..b13b5dd 100644
--- a/MdXaml/Markdown.cs
+++ b/MdXaml/Markdown.cs
@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Net.Cache;
using System.Text;
using System.Text.RegularExpressions;
+using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
@@ -430,7 +432,21 @@ private Inline TreatsAsImage(Match match)
image.Width = imgSource.Width;
}
- return new InlineUIContainer(image);
+ var container = new InlineUIContainer() { Child=image };
+ imgSource.DownloadFailed += (s, e) =>
+ {
+ var ext = e.ErrorException;
+
+ var label = new Label()
+ {
+ Foreground = Brushes.Red,
+ Content = "!" + url + "\r\n"+ext.GetType().Name + ":" + ext.Message
+ };
+
+ container.Child=label;
+ };
+
+ return container;
}
private BitmapImage MakeImage(Uri url)
@@ -443,10 +459,8 @@ private BitmapImage MakeImage(Uri url)
{
var imgSource = new BitmapImage();
imgSource.BeginInit();
- imgSource.CacheOption = BitmapCacheOption.None;
- imgSource.UriCachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache);
imgSource.CacheOption = BitmapCacheOption.OnLoad;
- imgSource.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
+ imgSource.CreateOptions = BitmapCreateOptions.None;
imgSource.UriSource = url;
imgSource.EndInit();
diff --git a/MdXaml/MdXaml.csproj b/MdXaml/MdXaml.csproj
index a627006..9b834f5 100644
--- a/MdXaml/MdXaml.csproj
+++ b/MdXaml/MdXaml.csproj
@@ -4,7 +4,7 @@
netcoreapp3.0;net45;net5.0-windows
true
MdXaml
- 1.13.0
+ 1.14.0
Bevan Arps(original); whistyun
Markdown XAML processor
diff --git a/MdXaml/MdXamlMigfree.csproj b/MdXaml/MdXamlMigfree.csproj
index a5d31df..745b5ff 100644
--- a/MdXaml/MdXamlMigfree.csproj
+++ b/MdXaml/MdXamlMigfree.csproj
@@ -4,7 +4,7 @@
netcoreapp3.0;net45;net5.0-windows
true
MdXaml_migfree
- 1.13.0
+ 1.14.0
Bevan Arps(original); whistyun
Markdown XAML processor
diff --git a/tests/MdXaml.Test/Out/core/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/core/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
index 8bb596d..5ec7253 100644
--- a/tests/MdXaml.Test/Out/core/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/core/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/Out/core/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/core/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
index 8ec059c..6121f8f 100644
--- a/tests/MdXaml.Test/Out/core/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/core/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/Out/core/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/core/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
index b3f9a20..e59f60e 100644
--- a/tests/MdXaml.Test/Out/core/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/core/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/Out/core/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/core/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
index f9d9f3d..5a5d415 100644
--- a/tests/MdXaml.Test/Out/core/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/core/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/Out/core/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/core/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
index df95734..3451829 100644
--- a/tests/MdXaml.Test/Out/core/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/core/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
@@ -30,19 +30,19 @@
-
+
-
+
-
+
@@ -54,9 +54,9 @@
-
+
-
+
Table
diff --git a/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
index 8bb596d..5ec7253 100644
--- a/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
index 8ec059c..6121f8f 100644
--- a/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
index b3f9a20..e59f60e 100644
--- a/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
index f9d9f3d..5a5d415 100644
--- a/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
index df95734..3451829 100644
--- a/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/dotnet/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
@@ -30,19 +30,19 @@
-
+
-
+
-
+
@@ -54,9 +54,9 @@
-
+
-
+
Table
diff --git a/tests/MdXaml.Test/Out/framework/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/framework/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
index 745e8f0..8637e64 100644
--- a/tests/MdXaml.Test/Out/framework/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/framework/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/Out/framework/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/framework/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
index 540e923..7ee6a16 100644
--- a/tests/MdXaml.Test/Out/framework/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/framework/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/Out/framework/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/framework/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
index 4d2aaa3..0305c44 100644
--- a/tests/MdXaml.Test/Out/framework/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/framework/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/Out/framework/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/framework/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
index 40d660f..a22dc22 100644
--- a/tests/MdXaml.Test/Out/framework/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/framework/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/Out/framework/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/Out/framework/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
index 4a2bfcb..875c184 100644
--- a/tests/MdXaml.Test/Out/framework/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/Out/framework/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
@@ -30,19 +30,19 @@
-
+
-
+
-
+
@@ -54,9 +54,9 @@
-
+
-
+
Table
diff --git a/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
index a66656b..5771617 100644
--- a/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
index 278f889..30f49e5 100644
--- a/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
index fbd1be4..6a076e1 100644
--- a/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
index e3a2d47..17fa8e2 100644
--- a/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
index 9cda2bf..4d879a6 100644
--- a/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/core/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
@@ -30,19 +30,19 @@
-
+
-
+
-
+
@@ -54,9 +54,9 @@
-
+
-
+
Table
diff --git a/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
index a66656b..5771617 100644
--- a/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
index 278f889..30f49e5 100644
--- a/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
index fbd1be4..6a076e1 100644
--- a/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
index e3a2d47..17fa8e2 100644
--- a/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
index 9cda2bf..4d879a6 100644
--- a/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/dotnet/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
@@ -30,19 +30,19 @@
-
+
-
+
-
+
@@ -54,9 +54,9 @@
-
+
-
+
Table
diff --git a/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
index b0e6a62..088be78 100644
--- a/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenImages1_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
index 99b3cf1..c1cc1df 100644
--- a/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenImages3_generatesExpectedResult.approved.txt
@@ -1,13 +1,13 @@
- A remote .
- Images side by side
+ A remote .
+ Images side by side
-
+
- A resource image . A local image .
+ A resource image . A local image .
diff --git a/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
index e09c2f1..2acc2b2 100644
--- a/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenLinksInline1_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
index e566101..38b6c85 100644
--- a/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenLinksInline2_generatesExpectedResult.approved.txt
@@ -27,37 +27,37 @@
-
+
- text
+ text
-
+
text
- texttext
+ texttext
- text
+ text
-
+
text
- text text
+ text text
diff --git a/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt b/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
index e3d81ab..ed0b4a2 100644
--- a/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
+++ b/tests/MdXaml.Test/OutMF/framework/Tests.Transform_givenMixing_generatesExpectedResult.approved.txt
@@ -30,19 +30,19 @@
-
+
-
+
-
+
@@ -54,9 +54,9 @@
-
+
-
+
Table