Skip to content

Commit

Permalink
c6dba9ff0cbeb2385799947218dba483d95f81c9 Fix: Remove use of negative …
Browse files Browse the repository at this point in the history
…lookbehind regex, which isn't supported in Safari before 16.4.

https://datatables.net/forums/discussion/78794

Sync to source repo @c6dba9ff0cbeb2385799947218dba483d95f81c9
  • Loading branch information
dtbuild committed Apr 23, 2024
1 parent b4a2252 commit a577cdc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "2.0.5",
"last-sync": "5d287f0379e0d950e49961658b16734943c357f8"
"last-sync": "c6dba9ff0cbeb2385799947218dba483d95f81c9"
}
7 changes: 5 additions & 2 deletions js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -7968,8 +7968,11 @@
if ( state && state.childRows ) {
api
.rows( state.childRows.map(function (id) {
// Escape any `:` characters from the row id, unless previously escaped
return id.replace(/(?<!\\):/g, '\\:');
// Escape any `:` characters from the row id. Accounts for
// already escaped characters, by escaping them, and then
// re-escaping. Not ideal, but Safari only added negative
// look behind in 2023 (16.4).
return id.replace(/\\:/g, ':').replace(/:/g, '\\:');
}) )
.every( function () {
_fnCallbackFire( api.settings()[0], null, 'requestChild', [ this ] )
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.min.mjs

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7915,8 +7915,11 @@ var __details_state_load = function (api, state)
if ( state && state.childRows ) {
api
.rows( state.childRows.map(function (id) {
// Escape any `:` characters from the row id, unless previously escaped
return id.replace(/(?<!\\):/g, '\\:');
// Escape any `:` characters from the row id. Accounts for
// already escaped characters, by escaping them, and then
// re-escaping. Not ideal, but Safari only added negative
// look behind in 2023 (16.4).
return id.replace(/\\:/g, ':').replace(/:/g, '\\:');
}) )
.every( function () {
_fnCallbackFire( api.settings()[0], null, 'requestChild', [ this ] )
Expand Down

0 comments on commit a577cdc

Please sign in to comment.