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 1 commit
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
Piedone marked this conversation as resolved.
Show resolved Hide resolved
MikeAlhayek marked this conversation as resolved.
Show resolved Hide resolved

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
Loading