Rich text content has additional newlines in umbraco.config
Hi,
This is probably an easy fix for someone with some more experience.
I use tinymce to enter rich text content. However, it seems that newlines get inserted automatically: In umbraco.config, no line (in the CData section containing rich text content) is longer than 68 characters.This seems to be caused by TinyMce, because "Textbox multiple" properties do not get wrapped.
This text was entered into tinymce without a line break, yet the xml contains line breaks. That shouldn't be.
Actually, to be more precise, it wraps the CDATA content before column 70 by replacing a space with a newline.
Text entered in a property of datatype "Textbox multiple" doesn't behave like this.
As to whether this is a problem: When displayed with Umbraco:Item, it is not a problem, the newline between two words in html is displayed as a space.
However, if you look at it as XML, the data is not correctly stored - a space is not a newline. And in some special cases (http://our.umbraco.org/forum/developers/razor/19379-Remove-paragraph-tags-with-razor ) this can lead to a problem: If you retrieve the content with razor (@Model.itemDescription), and you try to strip the surrounding paragraph with
umbraco.library.RemoveFirstParagraphTag
the string returned does not have the newlines anymore, and therefore the last word of a line gets attached to the first word of the next line.
I'm not sure whether this is due to TinyMCE, the datatype wrapping TinyMCE, or Umbraco. I also wonder what's the advantage of inserting newline into CDATA content. I guess I'll take a look at Umbraco:Item and check out how to strip the surrounding paragraph off.
Rich text content has additional newlines in umbraco.config
Hi,
This is probably an easy fix for someone with some more experience.
I use tinymce to enter rich text content. However, it seems that newlines get inserted automatically: In umbraco.config, no line (in the CData section containing rich text content) is longer than 68 characters.This seems to be caused by TinyMce, because "Textbox multiple" properties do not get wrapped.
Does anybody know how to prevent this?
Hi Markus
Could you perhaps post a snippet of what your umbraco.config looks like?
I'm not sure I understand your issue completely.
Is the additional newlines a problem on the displayed website, or?
/Jan
Hi,
Sure, it looks something like this:
instead of like this:
This text was entered into tinymce without a line break, yet the xml contains line breaks. That shouldn't be.
Actually, to be more precise, it wraps the CDATA content before column 70 by replacing a space with a newline.
Text entered in a property of datatype "Textbox multiple" doesn't behave like this.
As to whether this is a problem: When displayed with Umbraco:Item, it is not a problem, the newline between two words in html is displayed as a space.
However, if you look at it as XML, the data is not correctly stored - a space is not a newline. And in some special cases (http://our.umbraco.org/forum/developers/razor/19379-Remove-paragraph-tags-with-razor ) this can lead to a problem: If you retrieve the content with razor (@Model.itemDescription), and you try to strip the surrounding paragraph with
the string returned does not have the newlines anymore, and therefore the last word of a line gets attached to the first word of the next line.
I'm not sure whether this is due to TinyMCE, the datatype wrapping TinyMCE, or Umbraco. I also wonder what's the advantage of inserting newline into CDATA content. I guess I'll take a look at Umbraco:Item and check out how to strip the surrounding paragraph off.
i have absolutely the same problem! Does anybody know how fix it?
has anyone found a solution to this issue?
I know the post is a little old, but I just ran into the same problem. I fixed it by using this function:
It returns the string that you pass into it, but without those extra line breaks. Hope this helps!
is working on a reply...