htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
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.

 


KenGR
New User

Jan 26, 2005, 8:43 PM

Post #1 of 5 (2377 views)
Shortcut
Replace " with ' ? Can't Post

Hello!

Is there some way to replace double quotes with single in links? Something like:
<a href="test.com">test</a>
with
<a href='test.com'>test</a>

Thanks a lot in advance
Ken


ross
Staff


Jan 27, 2005, 11:07 AM

Post #2 of 5 (2348 views)
Shortcut
Re: [KenGR] Replace " with ' ? [In reply to] Can't Post

Hi Ken.

Thanks for posting and welcome to the board!

I found a way to do this; however, before you try it, there are a few things you’ll want to keep in mind.

I think that all “ that appear in tags are generated by the same line of code so using my code is going to change it for everything (images, tables, etc).

The change I made is in the actual source code, so the next time htmlArea is updated you’ll probably have to change this again.

So with that in mind, here’s the code:

In a default copy of HTMLArea-3.0-RC2b the line of code in htmlarea.js was:

html += " " + name + '="' + value + '"'; (line 2412)

If you change it to:

html += " " + name + '=\'' + value + '\'';

You should be good to go. Could you give that a shot and let me know how it works out Smile ?
Cheers,
Ross Fairbairn - Product Specialist (in training)
support@interactivetools.com




KenGR
New User

Jan 27, 2005, 11:29 AM

Post #3 of 5 (2345 views)
Shortcut
Re: [ross] Replace " with ' ? [In reply to] Can't Post

Hi Ross, and thanks for being so helpful!

Your code worked great, although it didn't solve my actual problem.
For some reason, when I save the text (using the following script, every ' or " is preceded with a \,resulting to \' or \" respectively.

Code
<?php 
$pg = $HTTP_POST_VARS['pg'];
$link = fopen($pg.".txt", "w"); fwrite ($link, $HTTP_POST_VARS['ta']); fclose ($link);
?>


Any ideas?


nikotto
User

Jan 30, 2005, 12:42 AM

Post #4 of 5 (2290 views)
Shortcut
Re: [KenGR] Replace " with ' ? [In reply to] Can't Post

these are php's magic quotes
try this:

Code
<?php  
$pg = $HTTP_POST_VARS['pg'];
$pg = stripslashes($pg);
$link = fopen($pg.".txt", "w"); fwrite ($link, $HTTP_POST_VARS['ta']); fclose ($link);
?>



FxF
Novice

Jan 30, 2005, 1:56 AM

Post #5 of 5 (2288 views)
Shortcut
Re: [KenGR] Replace " with ' ? [In reply to] Can't Post

It is indeed the magic quotes, and the use of $HTTP_POST_VARS has been deprecated a couple of versions ago... you should use $_POST['pg'] instead...

 
 
 


Search for (options)