
Terry Hoiness
Top achievements
Rank 1
Terry Hoiness
asked on 18 Aug 2009, 03:45 PM
Why is it that the editor does not encode quotes? Is there a feature I can turn on for this? It encodes line breaks and the like, but does nothing with double quotes.
When applying something like: Server.HtmlEncode(RadEditor1.Content), you end up encoding the <br/> tags along with the quotes. What good is having an editor format html if it only partially does it, and what is the rectification for this issue? I understand a string.Replace could be used, but the methodology of this tool's encoding (in my mind) defies logical behavior? It seems to me that I did not have this issue prior to Q2, but I could be wrong on that...
When applying something like: Server.HtmlEncode(RadEditor1.Content), you end up encoding the <br/> tags along with the quotes. What good is having an editor format html if it only partially does it, and what is the rectification for this issue? I understand a string.Replace could be used, but the methodology of this tool's encoding (in my mind) defies logical behavior? It seems to me that I did not have this issue prior to Q2, but I could be wrong on that...
6 Answers, 1 is accepted
0

Schlurk
Top achievements
Rank 2
answered on 18 Aug 2009, 04:34 PM
Have you tried using the following properties?
I'm not sure about encoding, but perhaps you could set the quotes by snagging the editor's content using the Xhtml server property? I tried to search around but couldn't find too much on the subject unfortunately. If the issue wasn't around prior to Q2 there is probably a new property you need to set to true or false.
ConvertToXhtml="true" |
EnableXHTML="true" |
I'm not sure about encoding, but perhaps you could set the quotes by snagging the editor's content using the Xhtml server property? I tried to search around but couldn't find too much on the subject unfortunately. If the issue wasn't around prior to Q2 there is probably a new property you need to set to true or false.
0

Terry Hoiness
Top achievements
Rank 1
answered on 18 Aug 2009, 04:44 PM
Thanks for the quick reply... Interestingly enough, those properties are not within the intellisense for the RadEditor. Are those actual current properties, or are they depricated?
0

Schlurk
Top achievements
Rank 2
answered on 18 Aug 2009, 04:58 PM
They are probably properties from older versions. I was attempting to look around on the forums for a solution and those kept popping up, so I figured that they could be a good thing to try. I'm not completely sure but I think that if it's not due to a property it could have something to do with the XHTML that the editor uses that does not like the quotes around properties.
Does this occur with any pair of quotes or is it specifically with quotes in html?
Does this occur with any pair of quotes or is it specifically with quotes in html?
0

Terry Hoiness
Top achievements
Rank 1
answered on 18 Aug 2009, 05:08 PM
Here would be an example:
This:
""<>asdfasdfasdfa
Turns into this:
""<><span style="background-color: #ff0000;">asdfasdfasdfa</span>
---
As you can imagine, that is positively useless. If you try to replace the double quotes, you will replace the ones inside the span. If you try to html encode it, you will encode the html tags. There is absolutely nothing you can do with this type of formatting without serious text parsing.
This:
""<>asdfasdfasdfa
Turns into this:
""<><span style="background-color: #ff0000;">asdfasdfasdfa</span>
---
As you can imagine, that is positively useless. If you try to replace the double quotes, you will replace the ones inside the span. If you try to html encode it, you will encode the html tags. There is absolutely nothing you can do with this type of formatting without serious text parsing.
0

Terry Hoiness
Top achievements
Rank 1
answered on 18 Aug 2009, 05:17 PM
Perhaps the issue is that it should not be formatted at all. Maybe I am missing the point. If the double quotes are encoded, then they could be placed inside of an html property / xml tag, but if you are providing formatting to the html, then you are in need of the double quotes which would negate the reasoning behind the encoding in the first place.
I believe the real issue I am overlooking when it comes to packaging the data is the single quote, and not the double quote.
(or maybe I just need to step back and reevaluate ;) )
I believe the real issue I am overlooking when it comes to packaging the data is the single quote, and not the double quote.
(or maybe I just need to step back and reevaluate ;) )
0

Schlurk
Top achievements
Rank 2
answered on 18 Aug 2009, 07:36 PM
I think I see what you are talking about. The scenario where there are " " outside and inside of the HTML tags do provide with some difficult string parsing if you want to take that route, I agree. If you are looking to have the double-quotes perhaps you have to set in some restrictions that allow for the use of either one or the other.
I'm not sure what the overall picture is for the use of the functionality, but like you said - maybe you need to re-evaluate or just make sure you really need to tackle the issue the way you're going at it :)
I'm not sure what the overall picture is for the use of the functionality, but like you said - maybe you need to re-evaluate or just make sure you really need to tackle the issue the way you're going at it :)