November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Can you try this
Value = propertyXhtmlString.Value.ToString().Replace(Environment.NewLine, "");
I think you missed Value.
I am using Content Delivery API that works fine. For some reason there is a need to remove the new line characters from the xhtml string response.
Based on this article https://world.episerver.com/documentation/developer-guides/content-delivery-api/serialization/ I tried to remove the new line character but I still see it in response.
What am I missing. Here is what I have
[ServiceConfiguration(typeof(IPropertyModelConverter), Lifecycle = ServiceInstanceScope.Singleton)]
public class CustomXhtmlStringUpdate : DefaultPropertyModelConverter
{
public CustomXhtmlStringUpdate() => ModelTypes = new List<TypeModel>
{
new TypeModel
{
ModelType = typeof(CustomHtmlStringPropertyModel), ModelTypeString = nameof(CustomHtmlStringPropertyModel), PropertyType = typeof(PropertyXhtmlString)
}
};
}
public class CustomHtmlStringPropertyModel : PropertyModel<string, PropertyXhtmlString>
{
public CustomHtmlStringPropertyModel(PropertyXhtmlString propertyXhtmlString) : base(propertyXhtmlString)
{
if (propertyXhtmlString != null)
{
Value = propertyXhtmlString.ToString().Replace(Environment.NewLine, "");
}
}
}