A directory of browser-based WYSIWYG editors


Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0 - Add-Ons:
my URL path is stuffed?

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.


nick buick
New User

Sep 28, 2004, 12:29 AM

Post #1 of 3 (3961 views)
my URL path is stuffed? Can't Post

Hey guys.

I'm using the Lius delux html area because it's just so god damn cool! but I have a serious problem. If I try and create an http: link... the 'http://' bit gets cut off and replaced with '../../'

Obviously this is reasonably useless and I can't work out why it's happening! It ONLY happens for http:// protocals.. (file:// mailto:, etc are all fine).

Whats more, even if I chance the 'text' variable to hardcode something like' it STILL changes it to ../../ when it gets reinserted into the page... where is this variable coming from? what file do I need to edit to fix it?

Thanks guys!


nick buick
New User

Sep 28, 2004, 2:27 AM

Post #2 of 3 (3951 views)
Re: [nick buick] my URL path is stuffed? [In reply to] Can't Post

FINALLY found it... there's some CRAZY code here in the editor.js file that seems to have no point other than to break the insert link functionality and stop it working properly:

if (RelativePaths) {
var re = new RegExp (document.URL, 'gi') ;
unclean = unclean.replace(re, '') ;
unclean = unclean.replace(/<A\s+HREF=\"/gi, '<A HREF=\"');

DocumentLevel = document.URL.substring(0,document.URL.lastIndexOf("/")+1);
var re = new RegExp ('<A HREF=\"'+DocumentLevel, 'gi') ;
unclean = unclean.replace(re, '<A HREF=\"') ;

LB1 = DocumentLevel.substring(0,DocumentLevel.lastIndexOf("/"));
LB1 = LB1.substring(0,LB1.lastIndexOf("/")+1);
var re = new RegExp ('<A HREF=\"'+LB1, 'gi') ;
unclean = unclean.replace(re, '<A HREF=\"../') ;

LB2 = LB1.substring(0,LB1.lastIndexOf("/"));
LB2 = LB2.substring(0,LB2.lastIndexOf("/")+1);
var re = new RegExp ('<A HREF=\"'+LB2, 'gi') ;
unclean = unclean.replace(re, '<A HREF=\"../../') ;

//LB3 = LB2.substring(0,LB2.lastIndexOf("/"));
//LB3 = LB3.substring(0,LB3.lastIndexOf("/")+1);
//var re = new RegExp ('<A HREF=\"'+LB3, 'gi') ;
//unclean = unclean.replace(re, '<A HREF=\"../../../') ;

//LB4 = LB3.substring(0,LB3.lastIndexOf("/")+1);
//var re = new RegExp ('<A HREF=\"'+LB4, 'gi') ;
//unclean = unclean.replace(re, '<A HREF=\"../../../../')

unclean = unclean.replace(/fullscreen\.html\?(.*?)\#(.*?)/gi, '#$2');
unclean = unclean.replace(/fullscreen\.html/gi, '');


I commented out this whole section, and low-and-behold... now the thing works properly. What on earth is that code supposed to be doing?


Sep 28, 2004, 3:29 AM

Post #3 of 3 (3947 views)
Re: [nick buick] my URL path is stuffed? [In reply to] Can't Post

Hi nick buick:

This not a CRAZY CODE as you call it, but one of the nicest features HTMLArea has. It supposed to create (and preserve) relative links, overriding IE behaviour of converting all links into absolute. Of course, it is not magic and it needs to be configured properly, in order it to work properly.

There are many posts explaining how to use it. All of them read basically the same:

"There are two blocks of code commented out. You must comment/un-comment as many blocks as necessary, depending on how deep your editor is in the directory tree."

If you don't want to use relative links, there is no need to comment out the whole code. Look at the top of function cleanHTML(unclean) for this.RelativePaths=1; and change it to this.RelativePaths=0; It's all you need to do.

Don't give up!!


Search for (options)