Embedded images replaced with cid linked resources. (#313)

* Added logic to replace embedded images with linked resources

* Added alt text for images and replaced NewtonSoft with Text.Json

* Fix draft mime preparation

* Fix crashes for signatures without images.

---------

Co-authored-by: Burak Kaan Köse <bkaankose@outlook.com>
This commit is contained in:
Tiktack
2024-08-11 23:58:54 +02:00
committed by GitHub
parent 983bc21448
commit 5912adff93
23 changed files with 148 additions and 253 deletions

View File

@@ -1,9 +1,9 @@
using System;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Web.WebView2.Core;
using Newtonsoft.Json;
using Windows.UI.ViewManagement.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@@ -78,7 +78,7 @@ namespace Wino.Dialogs
{
var editorContent = await InvokeScriptSafeAsync("GetHTMLContent();");
return JsonConvert.DeserializeObject<string>(editorContent);
return JsonSerializer.Deserialize<string>(editorContent);
});
var underlyingThemeService = App.Current.Services.GetService<IUnderlyingThemeService>();
@@ -193,7 +193,7 @@ namespace Wino.Dialogs
string script = functionName + "(";
for (int i = 0; i < parameters.Length; i++)
{
script += JsonConvert.SerializeObject(parameters[i]);
script += JsonSerializer.Serialize(parameters[i]);
if (i < parameters.Length - 1)
{
script += ", ";
@@ -327,7 +327,7 @@ namespace Wino.Dialogs
private void ScriptMessageReceived(CoreWebView2 sender, CoreWebView2WebMessageReceivedEventArgs args)
{
var change = JsonConvert.DeserializeObject<WebViewMessage>(args.WebMessageAsJson);
var change = JsonSerializer.Deserialize<WebViewMessage>(args.WebMessageAsJson);
if (change.Type == "bold")
{