htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
please help me! how replace " with \'


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


dipsi
New User

Jan 30, 2005, 7:40 AM

Post #1 of 6 (2326 views)
Shortcut
please help me! how replace " with \' Can't Post

I have a problem:

i use htmlarea + php! the problem are the " . This signs makes problems in php.

please help me, how htmlarea inserts \' and no " insert.

<FONT face=" courier new, courier, mono" >error</FONT> CodeQuote

with:
<FONT face= \' courier new, courier, mono \' >error</FONT>

" --> \'

Please help me! Thank you!


(This post was edited by dipsi on Feb 1, 2005, 9:06 AM)


kingmoore
Novice

Feb 2, 2005, 12:03 PM

Post #2 of 6 (2258 views)
Shortcut
Re: [dipsi] please help me! how replace " with \' [In reply to] Can't Post

does



$text = addSlashes($text);

not work?


dipsi
New User

Feb 2, 2005, 12:22 PM

Post #3 of 6 (2256 views)
Shortcut
Re: [kingmoore] please help me! how replace " with \' [In reply to] Can't Post

not really....

... do you (or somebody) know, how to replace the " in the editor.js ?


kingmoore
Novice

Feb 2, 2005, 12:43 PM

Post #4 of 6 (2253 views)
Shortcut
Re: [dipsi] please help me! how replace " with \' [In reply to] Can't Post

I do not. Why can't you modify the text after the form is submitted?


kwillems
User

Feb 2, 2005, 1:25 PM

Post #5 of 6 (2251 views)
Shortcut
Re: [kingmoore] please help me! how replace " with \' [In reply to] Can't Post

Could you describe the problems that occur in PHP?

Once i had problems concerning inputfields which were prefilled with content from the database. htmlspecialschars() solved my problem.


dipsi
New User

Feb 3, 2005, 1:23 PM

Post #6 of 6 (2224 views)
Shortcut
Re: [kwillems] please help me! how replace " with \' [In reply to] Can't Post

does anybody know what these lines means?

i mean bold lines!


// match tags and call filterTag
RegExp.lastIndex = 0;
var matchTag = /<\/?(\w+)((?:[^'">]*|'[^']*'|"[^"]*")*)>/g; // this will match tags, but still doesn't handle container tags (textarea, comments, etc)

contents = contents.replace(matchTag, filterTag);

--------------------------------------------------------------


// hide original textarea and insert htmlarea after it
if (!config.debug) { document.all[objname].style.display = "none"; }

if (config.plaintextInput) { // replace nextlines with breaks
var contents = document.all[objname].value;
contents = contents.replace(/\r\n/g, '<br>');
contents = contents.replace(/\n/g, '<br>');
contents = contents.replace(/\r/g, '<br>');
document.all[objname].value = contents;
}



--------------------------------------------------------------


// split up button name into "editorID" and "cmdID"
var BtnParts = Array();
BtnParts = button_id.split("_");
var objname = button_id.replace(/^_(.*)_[^_]*$/, '$1');
var cmdID = BtnParts[ BtnParts.length-1 ];
var button_obj = document.all[button_id];
var editor_obj = document.all["_" +objname + "_editor"];
var config = document.all[objname].config;

--------------------------------------------------------------


// FontStyle (change CSS className)
else if (cmdID == 'FontStyle' && val) {
editdoc.execCommand('RemoveFormat');
editdoc.execCommand('FontName',0,'636c6173734e616d6520706c616365686f6c646572');
var fontArray = editdoc.all.tags("FONT");
for (i=0; i<fontArray.length; i++) {
if (fontArray.face == '636c6173734e616d6520706c616365686f6c646572') {
fontArray.face = "";
fontArray.className = val;
fontArray.outerHTML = fontArray.outerHTML.replace(/face=['"]+/, "");
}
}
button_obj.selectedIndex =0;
}

--------------------------------------------------------------


// fix placeholder URLS - remove absolute paths that IE adds
if (tagName == 'img') { tagBody = tagBody.replace(/(src\s*=\s*.)[^*]*(\*\*\*)/, "$1$2"); }
if (tagName == 'a') { tagBody = tagBody.replace(/(href\s*=\s*.)[^*]*(\*\*\*)/, "$1$2"); }

--------------------------------------------------------------

// match tags and call filterTag
RegExp.lastIndex = 0;
var matchTag = /<\/?(\w+)((?:[^'">]*|'[^']*'|"[^"]*")*)>/g; // this will match tags, but still doesn't handle container tags (textarea, comments, etc)

contents = contents.replace(matchTag, filterTag);

THANK YOU Sly

 
 
 


Search for (options)