RenderMarkdownAsync(string markdown)
// If it's a single-line expression, then it's presumably inline so don't wrap it in a element.
if (doc.Body is { ChildElementCount: 1, FirstElementChild: { } first } &&
- first.TagName.ToUpperInvariant() == "P")
+ first.TagName.EqualsOrdinalIgnoreCase("P"))
{
html = first.InnerHtml.Trim();
}
diff --git a/Lombiq.HelpfulExtensions/Extensions/SiteTexts/SiteTextMigrations.cs b/Lombiq.HelpfulExtensions/Extensions/SiteTexts/SiteTextMigrations.cs
index 4a3f9d32..b7fb7ffe 100644
--- a/Lombiq.HelpfulExtensions/Extensions/SiteTexts/SiteTextMigrations.cs
+++ b/Lombiq.HelpfulExtensions/Extensions/SiteTexts/SiteTextMigrations.cs
@@ -1,9 +1,10 @@
-using OrchardCore.ContentLocalization.Models;
+using OrchardCore.ContentLocalization.Models;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Builders;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
using OrchardCore.Markdown.Models;
+using System.Threading.Tasks;
using static Lombiq.HelpfulExtensions.Extensions.SiteTexts.Constants.ContentTypes;
using static Lombiq.HelpfulLibraries.OrchardCore.Contents.ContentFieldEditorEnums;
@@ -16,9 +17,9 @@ public class SiteTextMigrations : DataMigration
public SiteTextMigrations(IContentDefinitionManager contentDefinitionManager) =>
_contentDefinitionManager = contentDefinitionManager;
- public int Create()
+ public async Task CreateAsync()
{
- _contentDefinitionManager.AlterTypeDefinition(SiteText, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(SiteText, builder => builder
.SetAbilities(
creatable: true,
securable: true,
diff --git a/Lombiq.HelpfulExtensions/Extensions/Widgets/Drivers/MvcConditionEvaluatorDriver.cs b/Lombiq.HelpfulExtensions/Extensions/Widgets/Drivers/MvcConditionEvaluatorDriver.cs
index 1eff2d27..7a29c2c1 100644
--- a/Lombiq.HelpfulExtensions/Extensions/Widgets/Drivers/MvcConditionEvaluatorDriver.cs
+++ b/Lombiq.HelpfulExtensions/Extensions/Widgets/Drivers/MvcConditionEvaluatorDriver.cs
@@ -1,8 +1,8 @@
-using Lombiq.HelpfulExtensions.Extensions.Widgets.Models;
+using Lombiq.HelpfulExtensions.Extensions.Widgets.Models;
using Microsoft.AspNetCore.Http;
using OrchardCore.ContentManagement.Display.ContentDisplay;
+using OrchardCore.Modules;
using OrchardCore.Rules;
-using System;
using System.Linq;
using System.Threading.Tasks;
diff --git a/Lombiq.HelpfulExtensions/Extensions/Widgets/Migrations.cs b/Lombiq.HelpfulExtensions/Extensions/Widgets/Migrations.cs
index 9425ebee..00147782 100644
--- a/Lombiq.HelpfulExtensions/Extensions/Widgets/Migrations.cs
+++ b/Lombiq.HelpfulExtensions/Extensions/Widgets/Migrations.cs
@@ -4,6 +4,7 @@
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
+using System.Threading.Tasks;
using static Lombiq.HelpfulExtensions.Extensions.Widgets.WidgetTypes;
namespace Lombiq.HelpfulExtensions.Extensions.Widgets;
@@ -15,16 +16,16 @@ public class Migrations : DataMigration
public Migrations(IContentDefinitionManager contentDefinitionManager) =>
_contentDefinitionManager = contentDefinitionManager;
- public int Create()
+ public async Task CreateAsync()
{
- _contentDefinitionManager.AlterTypeDefinition(ContainerWidget, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(ContainerWidget, builder => builder
.Securable()
.Stereotype(CommonStereotypes.Widget)
.WithPart("TitlePart", part => part.WithPosition("0"))
.WithPart("FlowPart", part => part.WithPosition("1"))
);
- _contentDefinitionManager.AlterTypeDefinition(HtmlWidget, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(HtmlWidget, builder => builder
.Securable()
.Stereotype(CommonStereotypes.Widget)
.WithPart("HtmlBodyPart", part => part
@@ -36,7 +37,7 @@ public int Create()
)
);
- _contentDefinitionManager.AlterTypeDefinition(LiquidWidget, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(LiquidWidget, builder => builder
.Securable()
.Stereotype(CommonStereotypes.Widget)
.WithPart("LiquidPart", part => part
@@ -44,12 +45,12 @@ public int Create()
)
);
- _contentDefinitionManager.AlterTypeDefinition(MenuWidget, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(MenuWidget, builder => builder
.Securable()
.Stereotype(CommonStereotypes.Widget)
);
- _contentDefinitionManager.AlterTypeDefinition(MarkdownWidget, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(MarkdownWidget, builder => builder
.Securable()
.Stereotype(CommonStereotypes.Widget)
.WithPart("MarkdownBodyPart", part => part
@@ -57,7 +58,7 @@ public int Create()
)
);
- var contentItemWidgetPartName = _contentDefinitionManager.AlterPartDefinition(builder => builder
+ var contentItemWidgetPartName = await _contentDefinitionManager.AlterPartDefinitionAsync(builder => builder
.WithField(part => part.ContentToDisplay, field => field
.WithDisplayName("Content to display")
.WithSettings(new ContentPickerFieldSettings
@@ -69,7 +70,7 @@ public int Create()
.WithField(part => part.GroupId, field => field.WithDisplayName("Group ID"))
);
- _contentDefinitionManager.AlterTypeDefinition(WidgetTypes.ContentItemWidget, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(WidgetTypes.ContentItemWidget, builder => builder
.Securable()
.Stereotype(CommonStereotypes.Widget)
.WithPart(contentItemWidgetPartName)
@@ -78,9 +79,9 @@ public int Create()
return 5;
}
- public int UpdateFrom1()
+ public async Task UpdateFrom1Async()
{
- _contentDefinitionManager.AlterTypeDefinition(ContainerWidget, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(ContainerWidget, builder => builder
.WithPart("TitlePart", part => part.WithPosition("0"))
.WithPart("FlowPart", part => part.WithPosition("1"))
);
@@ -88,9 +89,9 @@ public int UpdateFrom1()
return 2;
}
- public int UpdateFrom2()
+ public async Task UpdateFrom2Async()
{
- _contentDefinitionManager.AlterTypeDefinition(MenuWidget, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(MenuWidget, builder => builder
.Securable()
.Stereotype(CommonStereotypes.Widget)
);
@@ -98,9 +99,9 @@ public int UpdateFrom2()
return 3;
}
- public int UpdateFrom3()
+ public async Task UpdateFrom3Async()
{
- _contentDefinitionManager.AlterTypeDefinition(MarkdownWidget, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(MarkdownWidget, builder => builder
.Securable()
.Stereotype(CommonStereotypes.Widget)
.WithPart("MarkdownBodyPart", part => part
@@ -111,15 +112,15 @@ public int UpdateFrom3()
return 4;
}
- public int UpdateFrom4()
+ public async Task UpdateFrom4Async()
{
- var contentItemWidgetPartName = _contentDefinitionManager.AlterPartDefinition(builder => builder
+ var contentItemWidgetPartName = await _contentDefinitionManager.AlterPartDefinitionAsync(builder => builder
.WithField(part => part.ContentToDisplay, field => field.WithDisplayName("Content to display"))
.WithField(part => part.DisplayType, field => field.WithDisplayName("Display type"))
.WithField(part => part.GroupId, field => field.WithDisplayName("Group ID"))
);
- _contentDefinitionManager.AlterTypeDefinition(WidgetTypes.ContentItemWidget, builder => builder
+ await _contentDefinitionManager.AlterTypeDefinitionAsync(WidgetTypes.ContentItemWidget, builder => builder
.Securable()
.Stereotype(CommonStereotypes.Widget)
.WithPart(contentItemWidgetPartName)
diff --git a/Lombiq.HelpfulExtensions/Lombiq.HelpfulExtensions.csproj b/Lombiq.HelpfulExtensions/Lombiq.HelpfulExtensions.csproj
index 53028f47..5224bdce 100644
--- a/Lombiq.HelpfulExtensions/Lombiq.HelpfulExtensions.csproj
+++ b/Lombiq.HelpfulExtensions/Lombiq.HelpfulExtensions.csproj
@@ -3,7 +3,7 @@
- net6.0
+ net8.0
true
$(DefaultItemExcludes);.git*;node_modules\**
@@ -36,18 +36,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -56,8 +57,8 @@
-
-
+
+
diff --git a/Lombiq.HelpfulExtensions/Manifest.cs b/Lombiq.HelpfulExtensions/Manifest.cs
index 320f3350..29ff8210 100644
--- a/Lombiq.HelpfulExtensions/Manifest.cs
+++ b/Lombiq.HelpfulExtensions/Manifest.cs
@@ -13,10 +13,10 @@
Name = "Lombiq Helpful Extensions - Code Generation Helpful Extensions",
Category = "Development",
Description = "Generates migrations from content type definitions.",
- Dependencies = new[]
- {
+ Dependencies =
+ [
"OrchardCore.Resources",
- }
+ ]
)]
[assembly: Feature(
@@ -24,10 +24,10 @@
Name = "Lombiq Helpful Extensions - Content Sets",
Category = "Development",
Description = "Create arbitrary collections of content items.",
- Dependencies = new[]
- {
+ Dependencies =
+ [
"OrchardCore.ContentManagement",
- }
+ ]
)]
[assembly: Feature(
@@ -35,10 +35,10 @@
Name = "Lombiq Helpful Extensions - Flows Helpful Extensions",
Category = "Content",
Description = "Adds additional styling capabilities to Flow Part.",
- Dependencies = new[]
- {
+ Dependencies =
+ [
"OrchardCore.Flows",
- }
+ ]
)]
[assembly: Feature(
@@ -46,12 +46,12 @@
Name = "Lombiq Helpful Extensions - Helpful Widgets",
Category = "Content",
Description = "Adds helpful widgets such as Container or Liquid widgets.",
- Dependencies = new[]
- {
+ Dependencies =
+ [
"OrchardCore.Html",
"OrchardCore.Liquid",
"OrchardCore.Title",
- }
+ ]
)]
[assembly: Feature(
@@ -59,12 +59,12 @@
Name = "Lombiq Helpful Extensions - Helpful Content Types",
Category = "Content",
Description = "Adds helpful content types such as Page.",
- Dependencies = new[]
- {
+ Dependencies =
+ [
"OrchardCore.Autoroute",
"OrchardCore.Flows",
"OrchardCore.Title",
- }
+ ]
)]
[assembly: Feature(
@@ -86,10 +86,10 @@
Name = "Lombiq Helpful Extensions - Emails",
Category = "Messaging",
Description = "Adds shape-based email template rendering and helpful email sending services.",
- Dependencies = new[]
- {
+ Dependencies =
+ [
"OrchardCore.Email",
- }
+ ]
)]
[assembly: Feature(
@@ -107,10 +107,10 @@
"Adds a content type that lets the users with admin dashboard access customize string/HTML resources on the " +
"site via Markdown. If OrchardCore.ContentLocalization is enabled, it also tries to retrieve the localized " +
"version if available.",
- Dependencies = new[]
- {
+ Dependencies =
+ [
"OrchardCore.Markdown",
- }
+ ]
)]
[assembly: Feature(
@@ -121,10 +121,10 @@
"Convert Orchard 1's export XML files into Orchard Core recipes. This feature contains the basics like " +
"CommonPart and BodyPart (full list is in the Helpful Extensions repository readme), but can be extended " +
"with additional converters that only have to handle more specialized export data.",
- Dependencies = new[]
- {
+ Dependencies =
+ [
"OrchardCore.Contents",
- }
+ ]
)]
[assembly: Feature(
@@ -132,11 +132,11 @@
Name = "Lombiq Helpful Extensions - Reset password workflow activity",
Category = "Security",
Description = "Adds generate reset password token activity.",
- Dependencies = new[]
- {
+ Dependencies =
+ [
"OrchardCore.Users.ResetPassword",
"OrchardCore.Workflows",
- }
+ ]
)]
[assembly: Feature(
diff --git a/Lombiq.HelpfulExtensions/Views/AdditionalStylingPart.Edit.cshtml b/Lombiq.HelpfulExtensions/Views/AdditionalStylingPart.Edit.cshtml
index 44a280ee..bbfe0b77 100644
--- a/Lombiq.HelpfulExtensions/Views/AdditionalStylingPart.Edit.cshtml
+++ b/Lombiq.HelpfulExtensions/Views/AdditionalStylingPart.Edit.cshtml
@@ -6,12 +6,12 @@
diff --git a/Lombiq.HelpfulExtensions/Views/ContentSetPart.Edit.cshtml b/Lombiq.HelpfulExtensions/Views/ContentSetPart.Edit.cshtml
index 9fb2805b..b2d10c57 100644
--- a/Lombiq.HelpfulExtensions/Views/ContentSetPart.Edit.cshtml
+++ b/Lombiq.HelpfulExtensions/Views/ContentSetPart.Edit.cshtml
@@ -1,4 +1,4 @@
-@model Lombiq.HelpfulExtensions.Extensions.ContentSets.ViewModels.ContentSetPartViewModel
+@model Lombiq.HelpfulExtensions.Extensions.ContentSets.ViewModels.ContentSetPartViewModel
@T["Information about the \"{0}\" content set part.", Model.Definition.Name]
@@ -7,7 +7,7 @@
@if (!Model.IsNew)
{