mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
#18607: Replacing new lines with <br /> in Text fields
Work Item: 18607 --HG-- branch : 1.x
This commit is contained in:
parent
185ed552b0
commit
91675fc5a9
@ -39,10 +39,8 @@ namespace Orchard.Core.Common.Drivers {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>();
|
||||
object fieldValue = field.Value;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(settings.Flavor)) {
|
||||
fieldValue = new HtmlString(_htmlFilters.Aggregate(field.Value, (text, filter) => filter.ProcessContent(text, settings.Flavor)));
|
||||
}
|
||||
|
||||
fieldValue = new HtmlString(_htmlFilters.Aggregate(field.Value, (text, filter) => filter.ProcessContent(text, settings.Flavor)));
|
||||
|
||||
return shapeHelper.Fields_Common_Text(Name: field.Name, Value: fieldValue);
|
||||
});
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
@{
|
||||
@using Orchard.Utility.Extensions;
|
||||
@{
|
||||
string name = Model.ContentField.DisplayName;
|
||||
}
|
||||
|
||||
@if (HasText(name) && HasText(Model.Value)) {
|
||||
<p class="text-field"><span class="name">@name:</span> <span class="value">@Model.Value</span></p>
|
||||
<p class="text-field"><span class="name">@name:</span> <span class="value">@(new MvcHtmlString(Html.Encode((HtmlString) Model.Value).ReplaceNewLinesWith("<br />$1")))</span></p>
|
||||
}
|
Loading…
Reference in New Issue
Block a user