Closed grinvich11 closed 8 years ago
Sorry, didn't see the change until just now. Can you explain what you mean by "not completely"? Do you have an input example that breaks the TOC?
For the English language does not changes. For the Russian language without mb_substr, when you click on chapter in the Table of Contents, jumping completely does not go where it is necessary. Using mb_substr gets closer to the desired chapter, but not to where it is necessary
Can you send me a text for which the alignment isn't right? I won't be able to take a good look at it this week, but I'll tackle it at the same time as #10. If you get me the bad file I should be able to get it fixed.
Try this example and click on the links in the table of contents, and then try with my changes. sample.zip
Hmm, your code breaks the TOC even further, have you tested it? The file position in the TOC is a byte position, not dependent on the number of unicode chars, so mb_strlen seems inappropriate.
With strlen transition is not next to the desired chapter, and using mb_strlen next to the desired chapter, but it does not matter now, because your changes fixed it
More exact hit for text with multi-byte characters, but not completely