This project is read-only.

Line breaks and pre tags

Oct 1, 2008 at 11:54 PM
How can I simply paste code into a page and not get it turned to rubbish everytime I save the post?
I'm having a very bad time adding posts. It seems that pre tags get their line breaks stripped out. This is just wrong.
Oct 2, 2008 at 7:25 AM
Not sure I completely understand your question but it seems like you are trying to add developer code to a blog post.  If this is correct you will probably want to use an external blogging tool like Windows Live Writer.  Additionally, you will probably want to leverage the SyntaxHighlighter plug-in for WLW that makes it a dream to add code to your posts...

Have a look at my previous post that talked about Syntax Highlighter.
Oct 2, 2008 at 9:23 AM
I tried a couple of syntax highlighers but things didn't seem to work very well. I'd thought I'd stick with the basics, and there seems to be a fundamental issue with the use of prefomatted text. If I have some HTML e.g.


I expect my output to be


I get -


All line breaks are stripped in my pre tags and I end up with "<pre>Line1Line2Line3</pre>".
Oct 2, 2008 at 10:08 AM
Edited Oct 2, 2008 at 10:09 AM

Follow the link to my post for an all in one solution to get syntax highlighter working and integrated into TinyMCE text editor. I spent many hours trying to get this to work, there is just so much damn configuration and hacking required so I thought I would help others out. All you have to do is unzip it in the root folder of Blog Engine .Net 1.4.5.

On a side note: the removal of line breaks and spaces is due to TinyMCE editor. It strips spaces and carriage returns in pre tags when it should not.