How to return an umbraco item in one line from a richtext editor?
I have an Umbraco:Item which is called gmapMarker which is placed within a javascript file. Within the Document Type it is specified as a Richtext editor.
Problem: the richtext editor allows carriage returns and puts these as <br /> (and some form of encoded carriage return)
I thought it might be \r\n or even \n as in the escape character for carriage return and line return that would be stored within the db.
When the output from my umbraco item is returned it as follows:
How to return an umbraco item in one line from a richtext editor?
I have an Umbraco:Item which is called gmapMarker which is placed within a javascript file. Within the Document Type it is specified as a Richtext editor.
Problem: the richtext editor allows carriage returns and puts these as <br /> (and some form of encoded carriage return)
I thought it might be \r\n or even \n as in the escape character for carriage return and line return that would be stored within the db.
When the output from my umbraco item is returned it as follows:
The great part of this is that this breaks the javascript! as I need the returned content to be returned in one line.
So my question is how do I return an umbraco Item in one line from a richtext editor?
I have seen things like this on the forum but to no avail:
or
You're probably best of creating an XSLT extension that replaces \r\n with nothing.
could an xslt entitity work?
Thanks for all your help to you both. I came across a method called normalize-space.
This works well for the Richtext Editor although I am not sure what happens behind the scenes but it does remove the carriage returns.
I dont think I can mark this as an answer myself so if anyone wants to post the answer I just did I will happily class it as the solution :)
Thanks Everyone!
is working on a reply...