The text in the textarea cannot be formatted, if you need to format, use the Rich Text Editor (RTE)
If you try to render the RTE, without using modelsbuilder, you will get the contents of the RTE as a string. That is why you see the HTML tags. For rendering the text as HTML, use Html.Raw(editorAliasHere).
Rich Text Editor - out puts <P> tags at the beginning and the end </p>
Hi,
Rich Text Editor - out puts "
" tags at the beginning and the end "
" How can I remove the leading and the trailing "" tags. please helpThis is by design, the Rich Text Editor is meant to add HTML tags to your content. If you don't need HTML, try the text area.
Then how do we format the text in textarea
The text in the textarea cannot be formatted, if you need to format, use the Rich Text Editor (RTE)
If you try to render the RTE, without using modelsbuilder, you will get the contents of the RTE as a string. That is why you see the HTML tags. For rendering the text as HTML, use Html.Raw(editorAliasHere).
If you have access to Umbraco TV, then take a look here: https://umbraco.tv/videos/umbraco-v7/implementor/working-with-umbraco-data/razor-syntax/htmlraw/documentation/
Hi Praveen,
Like the others have said, this is standard RTE behaviour out-of-the-box.
Although, there are two hacky options - both of which are pretty old school! :-)
umbraco.library.RemoveFirstParagraphTag(text)
... (but consider this v4 legacy code, I'm sure it'll disappear in v8)<p>
tags - by configuring theforced_root_block
property - see a blog post (and comments) about it here: http://scottsdevblog.com/2011/08/get-rid-of-those-pesky-p-tags-in-umbracos-tinymce-editor/Personally, I'd go with option 1, (but I'd probably end up writing my own helper method for it).
Cheers,
- Lee
ooo, it's just occurred to me,
@Umbraco.Field(alias)
has a optional parameter forremoveParagraphTags
.is working on a reply...