xles / hyphenator

Automatically exported from code.google.com/p/hyphenator
GNU General Public License v3.0
0 stars 0 forks source link

hyphenator 4.2.0 hangs on Wikipedia page #196

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set hyphenator bookmaklet as described in the wiki (but with https instead 
of http. Plain http is blocked as mixed active content by Firefox.)
2. Go to https://en.wikipedia.org/wiki/Quantum_computer
3. Click on the hyphenator bookmarlet

What is the expected output? What do you see instead?
Firefox uses 100% CPU and hangs. You have to kill and restart it.

What version of the product are you using? On what operating system?
Hyphenator version 4.2.0 on Firefox 26 on OpenSuse Linux 13.1

Please provide any additional information below.
Hyphenator 4.1.0. works fine.

Original issue reported on code.google.com by ssam...@gmail.com on 3 Feb 2014 at 11:18

GoogleCodeExporter commented 9 years ago
Thanks for pointing to this.

When using the bookmarklet Hyphenator.js tries to hyphenate all content. When 
it is used on a site with many different languages it therefor downloads all 
available pattern languages.

On Wikipedia there is a list of language links (on the left side), each having 
a different language. Thus Hyphenator.js loads all those pattern files and 
tries to store them in local storage (for later reuse). This will
a) take too much time
b) probably summon a QuotaExceededError (at least in the trunk-version)
c) causing the described hang

While b) can be fixed by turning off the storage, a) and c) can't…

Hyphenator.js should check if elements with a different language have a special 
text-lenght, worth downloading the patterns and hyphenating.

Original comment by mathiasn...@gmail.com on 13 Mar 2014 at 7:40

GoogleCodeExporter commented 9 years ago
it's not that easy (as always;-)

New idea:
- collect the elements to be hyphenated
- weight them in function of their children with the same language and their 
text-length
- only treat elements with a user defined weight

Original comment by mathiasn...@gmail.com on 14 Mar 2014 at 7:29