From 70ca3edeeb2e7d9aa429286912065b0f9a18be62 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sun, 25 Aug 2024 10:38:54 +0200 Subject: [PATCH] Allow svg attributes. --- Directory.Build.props | 2 +- ai/Squidex.AI.Tests/Squidex.AI.Tests.csproj | 8 +++---- ai/Squidex.AI/Squidex.AI.csproj | 10 ++++---- assets/Benchmarks/Benchmarks.csproj | 4 ++-- .../Squidex.Assets.Azure.csproj | 4 ++-- .../Squidex.Assets.FTP.csproj | 4 ++-- .../Squidex.Assets.GoogleCloud.csproj | 2 +- .../Squidex.Assets.ImageMagick.csproj | 6 ++--- .../Squidex.Assets.ImageSharp.csproj | 4 ++-- .../Squidex.Assets.Mongo.csproj | 4 ++-- .../Squidex.Assets.ResizeService.csproj | 2 +- .../Squidex.Assets.S3.csproj | 4 ++-- .../Squidex.Assets.Tests/AssetStoreTests.cs | 6 ++--- .../Squidex.Assets.Tests.csproj | 10 ++++---- .../Squidex.Assets.TusAdapter.csproj | 2 +- .../Squidex.Assets.TusClient.csproj | 2 +- assets/Squidex.Assets/Squidex.Assets.csproj | 4 ++-- assets/TusTestServer/TusTestServer.csproj | 4 ++-- .../Squidex.Caching.Tests.csproj | 8 +++---- .../Squidex.Caching/Squidex.Caching.csproj | 2 +- .../Squidex.Hosting.Abstractions.csproj | 4 ++-- .../Squidex.Hosting.TestRunner.csproj | 2 +- .../Squidex.Hosting.Tests.csproj | 8 +++---- .../Squidex.Hosting/Squidex.Hosting.csproj | 2 +- .../Squidex.Log.Tests.csproj | 8 +++---- log/Squidex.Log/Squidex.Log.csproj | 4 ++-- .../Squidex.Messaging.All.csproj | 2 +- .../Squidex.Messaging.GoogleCloud.csproj | 4 ++-- .../Squidex.Messaging.Kafka.csproj | 4 ++-- .../Squidex.Messaging.Mongo/MongoTransport.cs | 7 +++--- .../Squidex.Messaging.Mongo.csproj | 4 ++-- .../Squidex.Messaging.RabbitMq.csproj | 2 +- .../Squidex.Messaging.Redis.csproj | 2 +- .../Squidex.Messaging.Subscriptions.csproj | 2 +- .../Squidex.Messaging.Tests.csproj | 10 ++++---- .../Squidex.Messaging.csproj | 2 +- .../Squidex.Text.Tests.csproj | 8 +++---- .../Squidex.Text.Tests/TestFiles/SvgValid.svg | 2 +- .../GoogleCloudTranslationServiceTests.cs | 12 +++++----- .../TranslationServiceTestsBase.cs | 24 +++++++++---------- .../Translations/TranslatorTests.cs | 18 +++++++------- text/Squidex.Text/Squidex.Text.csproj | 8 +++---- text/Squidex.Text/SvgExtensions.cs | 5 ++++ 43 files changed, 120 insertions(+), 116 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 1b1289f..aaaeaf2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -11,7 +11,7 @@ https://github.com/squidex/squidex true snupkg - 6.18.0 + 6.19.0 diff --git a/ai/Squidex.AI.Tests/Squidex.AI.Tests.csproj b/ai/Squidex.AI.Tests/Squidex.AI.Tests.csproj index 180887c..f1e38bc 100644 --- a/ai/Squidex.AI.Tests/Squidex.AI.Tests.csproj +++ b/ai/Squidex.AI.Tests/Squidex.AI.Tests.csproj @@ -18,18 +18,18 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ai/Squidex.AI/Squidex.AI.csproj b/ai/Squidex.AI/Squidex.AI.csproj index b6deeb0..fb4820e 100644 --- a/ai/Squidex.AI/Squidex.AI.csproj +++ b/ai/Squidex.AI/Squidex.AI.csproj @@ -12,23 +12,23 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + diff --git a/assets/Benchmarks/Benchmarks.csproj b/assets/Benchmarks/Benchmarks.csproj index 2455937..45566df 100644 --- a/assets/Benchmarks/Benchmarks.csproj +++ b/assets/Benchmarks/Benchmarks.csproj @@ -10,8 +10,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/assets/Squidex.Assets.Azure/Squidex.Assets.Azure.csproj b/assets/Squidex.Assets.Azure/Squidex.Assets.Azure.csproj index fc9e419..1f29618 100644 --- a/assets/Squidex.Assets.Azure/Squidex.Assets.Azure.csproj +++ b/assets/Squidex.Assets.Azure/Squidex.Assets.Azure.csproj @@ -13,8 +13,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/assets/Squidex.Assets.FTP/Squidex.Assets.FTP.csproj b/assets/Squidex.Assets.FTP/Squidex.Assets.FTP.csproj index c7d8b5a..eb58548 100644 --- a/assets/Squidex.Assets.FTP/Squidex.Assets.FTP.csproj +++ b/assets/Squidex.Assets.FTP/Squidex.Assets.FTP.csproj @@ -13,8 +13,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/assets/Squidex.Assets.GoogleCloud/Squidex.Assets.GoogleCloud.csproj b/assets/Squidex.Assets.GoogleCloud/Squidex.Assets.GoogleCloud.csproj index 3d5ca01..c3f609f 100644 --- a/assets/Squidex.Assets.GoogleCloud/Squidex.Assets.GoogleCloud.csproj +++ b/assets/Squidex.Assets.GoogleCloud/Squidex.Assets.GoogleCloud.csproj @@ -14,7 +14,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/assets/Squidex.Assets.ImageMagick/Squidex.Assets.ImageMagick.csproj b/assets/Squidex.Assets.ImageMagick/Squidex.Assets.ImageMagick.csproj index d687e68..041005d 100644 --- a/assets/Squidex.Assets.ImageMagick/Squidex.Assets.ImageMagick.csproj +++ b/assets/Squidex.Assets.ImageMagick/Squidex.Assets.ImageMagick.csproj @@ -12,9 +12,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/assets/Squidex.Assets.ImageSharp/Squidex.Assets.ImageSharp.csproj b/assets/Squidex.Assets.ImageSharp/Squidex.Assets.ImageSharp.csproj index 51a597b..c66577f 100644 --- a/assets/Squidex.Assets.ImageSharp/Squidex.Assets.ImageSharp.csproj +++ b/assets/Squidex.Assets.ImageSharp/Squidex.Assets.ImageSharp.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -22,7 +22,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/assets/Squidex.Assets.Mongo/Squidex.Assets.Mongo.csproj b/assets/Squidex.Assets.Mongo/Squidex.Assets.Mongo.csproj index c576404..f8e8aaf 100644 --- a/assets/Squidex.Assets.Mongo/Squidex.Assets.Mongo.csproj +++ b/assets/Squidex.Assets.Mongo/Squidex.Assets.Mongo.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -21,7 +21,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/assets/Squidex.Assets.ResizeService/Squidex.Assets.ResizeService.csproj b/assets/Squidex.Assets.ResizeService/Squidex.Assets.ResizeService.csproj index 16e7e53..d12cdfb 100644 --- a/assets/Squidex.Assets.ResizeService/Squidex.Assets.ResizeService.csproj +++ b/assets/Squidex.Assets.ResizeService/Squidex.Assets.ResizeService.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/assets/Squidex.Assets.S3/Squidex.Assets.S3.csproj b/assets/Squidex.Assets.S3/Squidex.Assets.S3.csproj index 38e71a7..28cd126 100644 --- a/assets/Squidex.Assets.S3/Squidex.Assets.S3.csproj +++ b/assets/Squidex.Assets.S3/Squidex.Assets.S3.csproj @@ -13,8 +13,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/assets/Squidex.Assets.Tests/AssetStoreTests.cs b/assets/Squidex.Assets.Tests/AssetStoreTests.cs index 273dc45..1898335 100644 --- a/assets/Squidex.Assets.Tests/AssetStoreTests.cs +++ b/assets/Squidex.Assets.Tests/AssetStoreTests.cs @@ -43,12 +43,12 @@ public enum TestCase FolderLinux } - public static readonly TheoryData FolderCases = new TheoryData - { + public static readonly TheoryData FolderCases = + [ TestCase.NoFolder, TestCase.FolderWindows, TestCase.FolderLinux - }; + ]; [Theory] [InlineData("../{file}.png")] diff --git a/assets/Squidex.Assets.Tests/Squidex.Assets.Tests.csproj b/assets/Squidex.Assets.Tests/Squidex.Assets.Tests.csproj index c211fd6..b7c26c1 100644 --- a/assets/Squidex.Assets.Tests/Squidex.Assets.Tests.csproj +++ b/assets/Squidex.Assets.Tests/Squidex.Assets.Tests.csproj @@ -30,16 +30,16 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/assets/Squidex.Assets.TusAdapter/Squidex.Assets.TusAdapter.csproj b/assets/Squidex.Assets.TusAdapter/Squidex.Assets.TusAdapter.csproj index 64db91a..e36bd4f 100644 --- a/assets/Squidex.Assets.TusAdapter/Squidex.Assets.TusAdapter.csproj +++ b/assets/Squidex.Assets.TusAdapter/Squidex.Assets.TusAdapter.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/assets/Squidex.Assets.TusClient/Squidex.Assets.TusClient.csproj b/assets/Squidex.Assets.TusClient/Squidex.Assets.TusClient.csproj index 32f7efd..7efee4c 100644 --- a/assets/Squidex.Assets.TusClient/Squidex.Assets.TusClient.csproj +++ b/assets/Squidex.Assets.TusClient/Squidex.Assets.TusClient.csproj @@ -13,7 +13,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/assets/Squidex.Assets/Squidex.Assets.csproj b/assets/Squidex.Assets/Squidex.Assets.csproj index 0d25c32..c3aa028 100644 --- a/assets/Squidex.Assets/Squidex.Assets.csproj +++ b/assets/Squidex.Assets/Squidex.Assets.csproj @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -23,7 +23,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/assets/TusTestServer/TusTestServer.csproj b/assets/TusTestServer/TusTestServer.csproj index c03aa3c..441ffd0 100644 --- a/assets/TusTestServer/TusTestServer.csproj +++ b/assets/TusTestServer/TusTestServer.csproj @@ -9,11 +9,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/caching/Squidex.Caching.Tests/Squidex.Caching.Tests.csproj b/caching/Squidex.Caching.Tests/Squidex.Caching.Tests.csproj index 4566a1b..8c089b8 100644 --- a/caching/Squidex.Caching.Tests/Squidex.Caching.Tests.csproj +++ b/caching/Squidex.Caching.Tests/Squidex.Caching.Tests.csproj @@ -11,14 +11,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/caching/Squidex.Caching/Squidex.Caching.csproj b/caching/Squidex.Caching/Squidex.Caching.csproj index b96fa93..62c5f2a 100644 --- a/caching/Squidex.Caching/Squidex.Caching.csproj +++ b/caching/Squidex.Caching/Squidex.Caching.csproj @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/hosting/Squidex.Hosting.Abstractions/Squidex.Hosting.Abstractions.csproj b/hosting/Squidex.Hosting.Abstractions/Squidex.Hosting.Abstractions.csproj index 54e0662..3438633 100644 --- a/hosting/Squidex.Hosting.Abstractions/Squidex.Hosting.Abstractions.csproj +++ b/hosting/Squidex.Hosting.Abstractions/Squidex.Hosting.Abstractions.csproj @@ -13,12 +13,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/hosting/Squidex.Hosting.TestRunner/Squidex.Hosting.TestRunner.csproj b/hosting/Squidex.Hosting.TestRunner/Squidex.Hosting.TestRunner.csproj index cb98cb2..1213edf 100644 --- a/hosting/Squidex.Hosting.TestRunner/Squidex.Hosting.TestRunner.csproj +++ b/hosting/Squidex.Hosting.TestRunner/Squidex.Hosting.TestRunner.csproj @@ -8,7 +8,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/hosting/Squidex.Hosting.Tests/Squidex.Hosting.Tests.csproj b/hosting/Squidex.Hosting.Tests/Squidex.Hosting.Tests.csproj index f2688d4..44d5f5c 100644 --- a/hosting/Squidex.Hosting.Tests/Squidex.Hosting.Tests.csproj +++ b/hosting/Squidex.Hosting.Tests/Squidex.Hosting.Tests.csproj @@ -14,18 +14,18 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/hosting/Squidex.Hosting/Squidex.Hosting.csproj b/hosting/Squidex.Hosting/Squidex.Hosting.csproj index a828e4f..73efc6f 100644 --- a/hosting/Squidex.Hosting/Squidex.Hosting.csproj +++ b/hosting/Squidex.Hosting/Squidex.Hosting.csproj @@ -16,7 +16,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/log/Squidex.Log.Tests/Squidex.Log.Tests.csproj b/log/Squidex.Log.Tests/Squidex.Log.Tests.csproj index 8abd4a2..ba9f3bd 100644 --- a/log/Squidex.Log.Tests/Squidex.Log.Tests.csproj +++ b/log/Squidex.Log.Tests/Squidex.Log.Tests.csproj @@ -15,15 +15,15 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/log/Squidex.Log/Squidex.Log.csproj b/log/Squidex.Log/Squidex.Log.csproj index ecb276d..7d0769f 100644 --- a/log/Squidex.Log/Squidex.Log.csproj +++ b/log/Squidex.Log/Squidex.Log.csproj @@ -12,12 +12,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/messaging/Squidex.Messaging.All/Squidex.Messaging.All.csproj b/messaging/Squidex.Messaging.All/Squidex.Messaging.All.csproj index 7556071..f4d3e55 100644 --- a/messaging/Squidex.Messaging.All/Squidex.Messaging.All.csproj +++ b/messaging/Squidex.Messaging.All/Squidex.Messaging.All.csproj @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/messaging/Squidex.Messaging.GoogleCloud/Squidex.Messaging.GoogleCloud.csproj b/messaging/Squidex.Messaging.GoogleCloud/Squidex.Messaging.GoogleCloud.csproj index abb30cf..6e5f0a9 100644 --- a/messaging/Squidex.Messaging.GoogleCloud/Squidex.Messaging.GoogleCloud.csproj +++ b/messaging/Squidex.Messaging.GoogleCloud/Squidex.Messaging.GoogleCloud.csproj @@ -12,8 +12,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/messaging/Squidex.Messaging.Kafka/Squidex.Messaging.Kafka.csproj b/messaging/Squidex.Messaging.Kafka/Squidex.Messaging.Kafka.csproj index 6975436..60b6ecc 100644 --- a/messaging/Squidex.Messaging.Kafka/Squidex.Messaging.Kafka.csproj +++ b/messaging/Squidex.Messaging.Kafka/Squidex.Messaging.Kafka.csproj @@ -12,8 +12,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/messaging/Squidex.Messaging.Mongo/MongoTransport.cs b/messaging/Squidex.Messaging.Mongo/MongoTransport.cs index ff32a9d..f5386f1 100644 --- a/messaging/Squidex.Messaging.Mongo/MongoTransport.cs +++ b/messaging/Squidex.Messaging.Mongo/MongoTransport.cs @@ -95,7 +95,7 @@ public async Task ProduceAsync(ChannelName channel, string instanceName, Transpo if (channel.Type == ChannelType.Queue) { - queues = new List { channel.Name }; + queues = [channel.Name]; } else { @@ -149,8 +149,7 @@ async Task> CreateCollectionAsync() var collection = database.GetCollection($"{options.CollectionName}_{name}"); await collection.Indexes.CreateManyAsync( - new[] - { + [ new CreateIndexModel( Builders.IndexKeys .Ascending(x => x.TimeHandled) @@ -162,7 +161,7 @@ await collection.Indexes.CreateManyAsync( { ExpireAfter = TimeSpan.Zero }) - }, + ], default); return collection; diff --git a/messaging/Squidex.Messaging.Mongo/Squidex.Messaging.Mongo.csproj b/messaging/Squidex.Messaging.Mongo/Squidex.Messaging.Mongo.csproj index ff63be9..d9e092c 100644 --- a/messaging/Squidex.Messaging.Mongo/Squidex.Messaging.Mongo.csproj +++ b/messaging/Squidex.Messaging.Mongo/Squidex.Messaging.Mongo.csproj @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -20,7 +20,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/messaging/Squidex.Messaging.RabbitMq/Squidex.Messaging.RabbitMq.csproj b/messaging/Squidex.Messaging.RabbitMq/Squidex.Messaging.RabbitMq.csproj index 26f37b6..a223669 100644 --- a/messaging/Squidex.Messaging.RabbitMq/Squidex.Messaging.RabbitMq.csproj +++ b/messaging/Squidex.Messaging.RabbitMq/Squidex.Messaging.RabbitMq.csproj @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/messaging/Squidex.Messaging.Redis/Squidex.Messaging.Redis.csproj b/messaging/Squidex.Messaging.Redis/Squidex.Messaging.Redis.csproj index 629154c..8f8753f 100644 --- a/messaging/Squidex.Messaging.Redis/Squidex.Messaging.Redis.csproj +++ b/messaging/Squidex.Messaging.Redis/Squidex.Messaging.Redis.csproj @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/messaging/Squidex.Messaging.Subscriptions/Squidex.Messaging.Subscriptions.csproj b/messaging/Squidex.Messaging.Subscriptions/Squidex.Messaging.Subscriptions.csproj index 8673364..37de1bc 100644 --- a/messaging/Squidex.Messaging.Subscriptions/Squidex.Messaging.Subscriptions.csproj +++ b/messaging/Squidex.Messaging.Subscriptions/Squidex.Messaging.Subscriptions.csproj @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/messaging/Squidex.Messaging.Tests/Squidex.Messaging.Tests.csproj b/messaging/Squidex.Messaging.Tests/Squidex.Messaging.Tests.csproj index bebdf75..babf113 100644 --- a/messaging/Squidex.Messaging.Tests/Squidex.Messaging.Tests.csproj +++ b/messaging/Squidex.Messaging.Tests/Squidex.Messaging.Tests.csproj @@ -15,17 +15,17 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/messaging/Squidex.Messaging/Squidex.Messaging.csproj b/messaging/Squidex.Messaging/Squidex.Messaging.csproj index b08d444..1982d2c 100644 --- a/messaging/Squidex.Messaging/Squidex.Messaging.csproj +++ b/messaging/Squidex.Messaging/Squidex.Messaging.csproj @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/text/Squidex.Text.Tests/Squidex.Text.Tests.csproj b/text/Squidex.Text.Tests/Squidex.Text.Tests.csproj index 4d8f44d..764a216 100644 --- a/text/Squidex.Text.Tests/Squidex.Text.Tests.csproj +++ b/text/Squidex.Text.Tests/Squidex.Text.Tests.csproj @@ -17,7 +17,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -25,11 +25,11 @@ - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/text/Squidex.Text.Tests/TestFiles/SvgValid.svg b/text/Squidex.Text.Tests/TestFiles/SvgValid.svg index cd2b097..184b50f 100644 --- a/text/Squidex.Text.Tests/TestFiles/SvgValid.svg +++ b/text/Squidex.Text.Tests/TestFiles/SvgValid.svg @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/text/Squidex.Text.Tests/Translations/GoogleCloudTranslationServiceTests.cs b/text/Squidex.Text.Tests/Translations/GoogleCloudTranslationServiceTests.cs index 5f60d9e..541f02d 100644 --- a/text/Squidex.Text.Tests/Translations/GoogleCloudTranslationServiceTests.cs +++ b/text/Squidex.Text.Tests/Translations/GoogleCloudTranslationServiceTests.cs @@ -71,10 +71,10 @@ public async Task Should_translate_text_to_korean() var results = await service.TranslateAsync(["World"], "ko", "en"); - Assert.Equal(new[] - { + Assert.Equal( + [ TranslationResult.Success("세계", "en", 0.0001m) - }, results); + ], results); } [Fact] @@ -85,9 +85,9 @@ public async Task Should_translate_text_to_hebrew() var results = await service.TranslateAsync(["World"], "he-IL", "en"); - Assert.Equal(new[] - { + Assert.Equal( + [ TranslationResult.Success("עוֹלָם", "en", 0.0001m) - }, results); + ], results); } } diff --git a/text/Squidex.Text.Tests/Translations/TranslationServiceTestsBase.cs b/text/Squidex.Text.Tests/Translations/TranslationServiceTestsBase.cs index 71eb5d6..1159c1e 100644 --- a/text/Squidex.Text.Tests/Translations/TranslationServiceTestsBase.cs +++ b/text/Squidex.Text.Tests/Translations/TranslationServiceTestsBase.cs @@ -31,10 +31,10 @@ public async Task Should_translate_autodetected_text() var results = await service.TranslateAsync(["Hello, my friend"], "de", "en"); - Assert.Equal(new[] - { + Assert.Equal( + [ TranslationResult.Success("Hallo, mein Freund", "en", 0.00032m) - }, results); + ], results); } [Fact] @@ -45,10 +45,10 @@ public async Task Should_translate_text1() var results = await service.TranslateAsync(["Hello World"], "de", "en"); - Assert.Equal(new[] - { + Assert.Equal( + [ TranslationResult.Success("Hallo Welt", "en", 0.00022m) - }, results); + ], results); } [Fact] @@ -59,10 +59,10 @@ public async Task Should_translate_text2() var results = await service.TranslateAsync(["Hello World"], "de-DE", "en"); - Assert.Equal(new[] - { + Assert.Equal( + [ TranslationResult.Success("Hallo Welt", "en", 0.00022m) - }, results); + ], results); } [Fact] @@ -77,10 +77,10 @@ public async Task Should_translate_multiple_texts() "Hello" ], "de", "en"); - Assert.Equal(new[] - { + Assert.Equal( + [ TranslationResult.Success("Hallo Welt", "en", 0.00022m), TranslationResult.Success("Hallo", "en", 0.0001m) - }, results); + ], results); } } diff --git a/text/Squidex.Text.Tests/Translations/TranslatorTests.cs b/text/Squidex.Text.Tests/Translations/TranslatorTests.cs index 5720b3b..6353ecf 100644 --- a/text/Squidex.Text.Tests/Translations/TranslatorTests.cs +++ b/text/Squidex.Text.Tests/Translations/TranslatorTests.cs @@ -102,10 +102,10 @@ public async Task Should_serve_results_from_first_service() var results = await sut.TranslateAsync(["KeyA"], "de", ct: ct); - Assert.Equal(new[] - { + Assert.Equal( + [ TranslationResult.Success("TextA", "en", 10) - }, results); + ], results); A.CallTo(() => service2.TranslateAsync(A>._, A._, A._, ct)) .MustNotHaveHappened(); @@ -122,10 +122,10 @@ public async Task Should_serve_results_from_second_service_if_first_failed() var results = await sut.TranslateAsync(["KeyA"], "de", ct: ct); - Assert.Equal(new[] - { + Assert.Equal( + [ TranslationResult.Success("TextA", "en", 13) - }, results); + ], results); } [Fact] @@ -149,13 +149,13 @@ public async Task Should_enrich_failed_results() var results = await sut.TranslateAsync(["KeyA", "KeyB", "KeyC", "KeyD"], "de", ct: ct); - Assert.Equal(new[] - { + Assert.Equal( + [ TranslationResult.Success("TextA", "en", 13), TranslationResult.Success("TextB", "en", 17), TranslationResult.Success("TextC", "en", 11), TranslationResult.Success("TextD", "en", 6) - }, results); + ], results); } private static IEnumerable IsRequest(params string[] requests) diff --git a/text/Squidex.Text/Squidex.Text.csproj b/text/Squidex.Text/Squidex.Text.csproj index 29e051a..34f9e17 100644 --- a/text/Squidex.Text/Squidex.Text.csproj +++ b/text/Squidex.Text/Squidex.Text.csproj @@ -12,14 +12,14 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -28,7 +28,7 @@ - + diff --git a/text/Squidex.Text/SvgExtensions.cs b/text/Squidex.Text/SvgExtensions.cs index 4caf929..47e1ac7 100644 --- a/text/Squidex.Text/SvgExtensions.cs +++ b/text/Squidex.Text/SvgExtensions.cs @@ -102,6 +102,11 @@ private static void AddErrors(HtmlReader reader, List errors) { var attributeName = reader.GetAttributeNameAsMemory(i); + if (attributeName.Span.StartsWith("data-", StringComparison.Ordinal)) + { + continue; + } + if (!SvgAttributes.Allowed.Contains(attributeName)) { errors.Add(new SvgError($"Invalid attribute '{attributeName}'",