[kupu-dev] LinkTool: createLink bug

yuppie y.2006_ at wcm-solutions.de
Fri Dec 1 11:54:10 CET 2006


Hi!


Problem:
--------

If createLink is called with an empty url value, strange things happen 
in Firefox.

If this is the text:

   <p>foo bar baz</p>

And createLink('') is used with 'bar' selected, Firefox creates this:

   <p>foo <a style="" class="generated" href=""></a> baz</p>

Note that the selected text 'bar' is deleted!

IE does this correctly:

   <p>foo <a href="">bar</a> baz</p>


Solution:
---------

I think Kupu should not support creating empty href attributes. There 
are other ways to handle empty url values:

- raise an error

- do nothing

- make createLink('') behave like deleteLink()

I'd prefer the last option, but this is a policy decision, so I'd like 
to hear other opinions.



I have unit tests for this and can check in a fix. On which branches has 
this to be fixed?


Cheers,

	Yuppie



More information about the kupu-dev mailing list