0

I use the same method to get lines from div Finding line-wraps

But.... Method does not take text with hyphens.

What I do...

I split word with hyphens by inter-na-tional (U+00AD) to ['inter','na','tional'] and check each piece for next line with simple dash(minus)."-" U+002D

But...Seems like it is not correct, because it has some different as you can see in screenshot: http://prnt.sc/d5h3t7

Which symbol shell I use to be able to check it correct?

Community
  • 1
  • 1
Sergey Egorov
  • 305
  • 2
  • 6
  • You should split on both dash and hyphens. But please show the code that have the problem, as we could understand what you mean with *split*. – Mario Santini Nov 10 '16 at 13:11
  • I just use simple split item.word.split(/\u00AD|­/); But i can not understand. Is there visual different bitween U+00AD and U+002D. I wiil try to make example for understanding... – Sergey Egorov Nov 10 '16 at 13:41
  • https://jsfiddle.net/w4dxb7f3/ I made new test, and i see that here http://prnt.sc/d5iwau .There is different... after space U+002D more than U+00AD – Sergey Egorov Nov 10 '16 at 13:58
  • You should not look at the visual differences, just the text you're elaborating, so you should look there what it contains. For example *­* only works if the text contains this sequence, but if the text contains the character *-* it wont work. – Mario Santini Nov 10 '16 at 16:42

0 Answers0