Try applying stripTags to it: stripTags: function() { return this.replace(/<\/?[^>]+>/gi, ''); },
This is part of prototype, no need to add the code anywhere. Another thing you might look at is using one of the many fine flavors of "plain text" formats, like Textile or Markdown, and use an editing helper with that. You can load the editor with the raw text using the loadExternalText method. You would load your editor with the plain text (with bits of punctuation sprinkled in to indicate the style) but any HTML display of the same text would go through the appropriate formatter and become XHTML. Keep the HTML out of your database if at all possible! Walter On May 15, 2008, at 5:16 AM, web.bloggers wrote: > But I need to show the formatted text at some instances whereas normal > text at other instances. > Do let me know if we can somehow sanitize the text and strip off the > html tags from it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---