Closed GoogleCodeExporter closed 9 years ago
Hi
Thanks for this report. It uncovers several bugs at once!
First, lets see what actually happens:
Hyphenator.js splits text into words and checks if a word is a normal word or
of url-style (also e-mail adresses).
Normal words are hyphenated using the hyhenchar (defaults to )
URL-styled 'words' should not be hyphenated with softhyphens (otherwise
www.aplitrak.com would in a bad case become www.apli-trak.com). So
Hyphenator.js inserts by default a zero width space after some special
characters (these are: /.?#&_,:;!@).
--> In your case the first part of the URL is handled properly but the query
string is not. I'll try to fix this.
When Hyphenator.run() is called a second time, Hyphenator.js doesn't recognise
the url (it now contains zero width spaces) so it is treated as a normal word
and thus gets hyphenated by inserting '' (Allthough the zero width spaces are
not replaced in my tests).
This behaviour is expected, so no changes are necessary here.
--> Hyphenator.run() should not be called more than once. Hyphenator.js writes
a warning about that to the console but I'll have to document that…
The last bug: html-entities are not decoded/encoded (whatever), when they are
set in Hyphenator.config() 'hyphenchar' and 'urlhyphenchar'.
This can be accomplished by using String.fromCharCode():
Hyphenator.config({
urlhyphenchar: String.fromCharCode(173) //zero width space
});
But as noted above, URLs should not be hyphenated with soft hyphens.
--> This needs documentation.
Again thanks for reporting (it's a long way to perfection).
Mathias
Original comment by mathiasn...@gmail.com
on 2 May 2014 at 10:40
Thank you very much for noting the bugs and explaining the functionality in
detail.
Kindly keep me updated if any relevant fixes are released.
Thanks again,
Rachel.
Original comment by Gauci.Ra...@gmail.com
on 6 May 2014 at 6:53
All fixed in the trunk and going in the next release
Original comment by mathiasn...@gmail.com
on 17 Oct 2014 at 8:28
Original issue reported on code.google.com by
Gauci.Ra...@gmail.com
on 28 Apr 2014 at 9:42