Search the web
Sign In
New User? Sign Up
ydn-javascript · Yahoo! User Interface Library Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Pasting code examples in the yui text editor   Message List  
Reply | Forward Message #31101 of 52127 |
Has anyone found a way to successfully place code inside of the Editor and
retain formatting?

I am looking at using the full editor in a blog application - I am a developer
and often post a
lot of code examples and use CodeRay for syntax higlighting. The problem I am
having with
the yui editor is that it replaces all the new lines of the pasted in code and
when the blog
post is created I lose all formatting and CodeRay is unable to do the syntax
highlighting
properly...

Any ideas on how to get around this? Maybe some way to wrap the code in a tag
that the
html parser would ignore?

Btw what determines how and when pasted text is formatted as html?

Thanks,
Bob




Sat May 17, 2008 12:40 am

rburbacha2
Offline Offline
Send Email Send Email

Forward
Message #31101 of 52127 |
Expand Messages Author Sort by Date

Has anyone found a way to successfully place code inside of the Editor and retain formatting? I am looking at using the full editor in a blog application - I...
Bob
rburbacha2
Offline Send Email
May 17, 2008
12:40 am

Bob -- The issue here is that the Editor is not doing anything to the code that you paste in ;) The designMode set on the iframe actually converts the HTML...
Dav Glass
dav.glass
Offline Send Email
May 17, 2008
4:48 am

Dav, this is basically what I am dealing with: In a post on my website I would I would paste in an example snippet of code like the following standard text...
Bob
rburbacha2
Offline Send Email
May 17, 2008
4:15 pm

Ok I finally got this to work - I tried this solution before with no luck but I must have had a syntax mistake somewhere... To get CodeRay to properly format...
Bob
rburbacha2
Offline Send Email
May 18, 2008
3:27 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help