Author Topic: Safari 16 and below bug with suggested fix  (Read 154 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 135
    • View Profile
Safari 16 and below bug with suggested fix
« on: November 25, 2024, 06:15:50 pm »
In pqgrid.dev.js from 3212:

Code: [Select]
/*BUG*/
//fmtPart = fmtPart.replace(/(?<![ap])m{1,5}/gi, replacer("M"));
/*SUGGESTED FIX*/
fmtPart = fmtPart.replace(/(?:^|[^ap])m{1,5}/gi, function (match, offset, string) {
// Ensure the match doesn't follow 'a' or 'p'
if (offset === 0 || !/[ap]/i.test(string[offset - 1])) {
return replacer("M")(match);
}
return match;
});

Safari 16 does not accept the regex "/(?<![ap])m{1,5}/gi" because it does not support "<"

Please confirm the suggested fix is OK, if not, please tell me what it should be replaced with.

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 135
    • View Profile
Re: Safari 16 and below bug with suggested fix
« Reply #1 on: November 25, 2024, 07:58:26 pm »
Just to add, this is serious as v10.1.0 will not load on Safari 16 or below because of this.