HTMLEditor White Space Issue

rcombs4

Well-known member
Joined
Aug 6, 2008
Messages
189
Programming Experience
3-5
I'm using the HTMLEditor control from the AJAX Control Toolkit. It is being used essentially for creating a post on a blog. It is working very nicely for that. But now I want to insert a VB code snippet into it and have it displayed in the post. I'm using SyntaxHighligher to format the code snippet into a pretty box. My issue is that if I enter the following while in design view it changes the text and my code snippet is not properly displayed when looking at the post.

Typed into design view
VB.NET:
private sub test()
   dim foo as string = "test"
   foo = "test2"
end sub

As seen in the actual post
VB.NET:
private sub test()<br>
  dim foo as string = "test"<br>
  foo = "test2"<br>
end sub

If i type the same thing but in the code view, it will be displayed properly in the post. But if I go back into edit the post the line breaks are removed and if I save it then all my VB code is on one line.


I was hoping that their was an attribute to preserve white space but it doesn't look like there is one. Does anyone know of a work around?
 

Latest posts

Back
Top