AnanthaKN / jquery-in-place-editor

Automatically exported from code.google.com/p/jquery-in-place-editor
Other
0 stars 0 forks source link

Request for Paragraphs or line breaks #61

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Does anyone have an idea of how I could return line breaks or paragraphs in the 
editor? If anyone has the Idea, I am willing to build it in and share

Original issue reported on code.google.com by thestevilshow on 26 Jun 2010 at 12:21

GoogleCodeExporter commented 8 years ago
figured it out! 

added > .replace(/<br>/g,"\n") < to:

/* THIS FUNCTION WILL ESCAPE ANY HTML ENTITIES SO "Quoted Values" work */
    String.prototype.escape_html = function() {
        return this.replace(/<br>/g,"\n")
                     .replace(/&/g, "&")
                     .replace(/</g, "<")
                     .replace(/>/g, ">")
                     .replace(/"/g, """);

  };

replaced all the > .text() < to > .html < where it asks,

added > var new_html = new_html.replace(/\n/g, "<br>").replace(/\n\n+/g, 
'<br><br>'); < under the line > var new_html = (this_elem.is('form')) ? 
this_elem.children(0).val() : this_elem.parent().children(0).val(); <

Then finally added the line: > $theValue = strip_tags($theValue, '<br>'); < to 
my php handle script to escape anything thats wrapped in html tags excluding 
the <br>

Works like a gem! 

Steve Chan

Original comment by thestevilshow on 26 Jun 2010 at 3:03

GoogleCodeExporter commented 8 years ago
Oh and this may line may have been changed > l_type:false, < to false?

Original comment by thestevilshow on 26 Jun 2010 at 3:05

GoogleCodeExporter commented 8 years ago
I think you can now do all of this with the delegate interface - please reopen 
if I missed something.

Thanks!

Original comment by mhaec...@gmail.com on 28 Jan 2011 at 11:12