Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
How to remove paragraph tags I get in my design using rich text editor in Umbraco 8?
Umbraco 7, Razor
@Umbraco.Field("yourDocumentPropertyAliasName", removeParagraphTags:true)
Links: StackOverflow simillar question Umbraco Forum post regarding Umbraco library
You can use
Html.StripHtml(Model.Value<string>("pageText"),"p")
Using your code I get completely stripped string even if string contains other elements like
<strong></strong> or &
The hack I'm using right now is:
@Html.Raw(Model.Value<string>("bodyText").Replace("<p>","").Replace("</p>", ""))
I also found this post claiming the same as you are, but it doesn't work like it should. I'm using Umbraco 8.4.0
Link: Html.StripHtml + umbraco 8
it doesn't work like it should
remember to open an issue on github if something is not working :)
Why are hacks that remove the first or even all p tags repeatedly offered as a solution.
A RTE could contain both text and an image, so stripping out p tags is not a solution.
Images should not be wrapped in p tags.
This has been an issue for over 5 years!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco 8 - How to remove paragraph tags - rich text editor
Hi all,
How to remove paragraph tags I get in my design using rich text editor in Umbraco 8?
Umbraco 7, Razor
@Umbraco.Field("yourDocumentPropertyAliasName", removeParagraphTags:true)
Links: StackOverflow simillar question Umbraco Forum post regarding Umbraco library
You can use
Using your code I get completely stripped string even if string contains other elements like
The hack I'm using right now is:
I also found this post claiming the same as you are, but it doesn't work like it should. I'm using Umbraco 8.4.0
Link: Html.StripHtml + umbraco 8
remember to open an issue on github if something is not working :)
Why are hacks that remove the first or even all p tags repeatedly offered as a solution.
A RTE could contain both text and an image, so stripping out p tags is not a solution.
Images should not be wrapped in p tags.
This has been an issue for over 5 years!
is working on a reply...