Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use TextArea in MarkdownField By Default #16189

Merged
merged 5 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public override IDisplayResult Display(MarkdownField field, BuildFieldDisplayCon

// The default Markdown option is to entity escape html
// so filters must be run after the markdown has been processed.
model.Html = _markdownService.ToHtml(model.Markdown ?? "");
model.Html = _markdownService.ToHtml(model.Markdown ?? string.Empty);

// The liquid rendering is for backwards compatability and can be removed in a future version.
// The liquid rendering is for backwards compatibility and can be removed in a future version.
if (!settings.SanitizeHtml)
{
model.Markdown = await _liquidTemplateManager.RenderStringAsync(model.Html, _htmlEncoder, model,
Expand All @@ -75,7 +75,7 @@ public override IDisplayResult Display(MarkdownField field, BuildFieldDisplayCon

if (settings.SanitizeHtml)
{
model.Html = _htmlSanitizerService.Sanitize(model.Html ?? "");
model.Html = _htmlSanitizerService.Sanitize(model.Html ?? string.Empty);
}
})
.Location("Detail", "Content")
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@await DisplayAsync(await New.ShortcodeModal())
<label asp-for="Markdown" class="@Orchard.GetLabelClasses()">@Model.PartFieldDefinition.DisplayName()</label>
<div class="@Orchard.GetEndClasses()">
<input asp-for="Markdown" class="form-control content-preview-text shortcode-modal-input" dir="@culture.GetLanguageDirection()" />
<textarea asp-for="Markdown" rows="5" class="form-control content-preview-text shortcode-modal-input" dir="@culture.GetLanguageDirection()"></textarea>
@if (!string.IsNullOrEmpty(settings.Hint))
{
<span class="hint">@settings.Hint</span>
Expand Down
6 changes: 6 additions & 0 deletions src/docs/releases/2.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -515,3 +515,9 @@ public class ReverseProxySettingsDisplayDriver : SectionDisplayDriver<ISite, Rev
### Infrastructure

Prior to this release, if you had a module with multiple features, you had to use the `[Feature("your feature id")]` attribute to assign `IShapeTableProvider`, `IDataMigration`, and `IPermissionProvider` to a specific feature of the module that had a feature ID other than the module ID. With [pull-request 15793](https://github.com/OrchardCMS/OrchardCore/pull/15793), this is no longer needed. However, `[Feature("...")]` is still required for the `Startup` class and controllers when you want the controller action to be available only when a specific feature is enabled.

### Content Fields

Before this release, the `MarkdownField` used a single-line input field by default (named the Standard editor) and offered two different editors: Multi-line with a simple `textarea` and WYSIWYG with a rich editor. Now, by default, it uses a `textarea` as the Standard editor, and the separate Multi-line option has been removed.

You have nothing to do, fields configured with the Standard or Multi-line editors previously will both continue to work. Note though, that their editors will now be a `textarea`.