prismicio-community / php-kit

Community maintained development kit for Prismic and the PHP language
https://prismic.io
Other
108 stars 82 forks source link

PHP Kit splits spans incorrectly, Or the API is wrong, Or javascript is wrong, or PHP is wrong… #161

Closed gsteel closed 2 years ago

gsteel commented 5 years ago

Who knows? The fixture represents data returned from the api, where it has been written in the following way: <em>t.</em>{emoji}<em>.t</em>. Javascript gives the case 0 unicode sequence a string length of 5, so the second span starts at index 7 however, PHP's mb_* functions will give that sequence a length of 4. This means that spans are inserted at incorrect positions and leads to undefined offset errors.

gsteel commented 2 years ago

It's 2022. Got the hint.