@@ -61,22 +61,28 @@ export const defaultConfig: DataTableConfiguration = {
6161 tableRender : false ,
6262 diffDomOptions : {
6363 valueDiffing : false ,
64- preDiffApply ( info ) {
65- console . trace ( "Pre-diff apply" , info )
66- // Prevent removal of class attributes that contain specific patterns
67- // This fixes the GitHub Pages issue where classes like "class history" get stripped
68- if ( info . diff . action === "removeAttribute" && info . diff . name === "class" ) {
69- // Only prevent removal if the class value contains patterns that might be problematic
70- const classValue = info . diff . oldValue || ""
71- if ( classValue . includes ( "class " ) || classValue . includes ( " class" ) ||
72- classValue . includes ( "history" ) || classValue . includes ( "math" ) ||
73- classValue . startsWith ( "datatable-" ) ) {
74- console . trace ( "Skipping class removal" , info )
75- return true // Skip this diff to prevent problematic class removal
76- }
77- }
78- return false
79- }
64+ // preDiffApply(info) {
65+ // // Prevent removal of class attributes that contain datatable classes
66+ // if (info.diff.action === "removeAttribute" && info.diff.name === "class") {
67+ // const classValue = info.diff.oldValue || ""
68+ // if (classValue.startsWith("datatable-") || classValue.includes(" datatable-")) {
69+ // return true // Skip this diff to prevent datatable class removal
70+ // }
71+ // }
72+ // // Prevent modification of class attributes that would remove datatable classes
73+ // if (info.diff.action === "modifyAttribute" && info.diff.name === "class") {
74+ // const oldValue = info.diff.oldValue || ""
75+ // const newValue = info.diff.newValue || ""
76+
77+ // const oldHasDatatableClass = oldValue.includes("datatable-")
78+ // const newHasDatatableClass = newValue.includes("datatable-")
79+
80+ // if (oldHasDatatableClass && !newHasDatatableClass) {
81+ // return true // Skip this diff to prevent datatable class removal
82+ // }
83+ // }
84+ // return false
85+ // }
8086 } ,
8187
8288 // Customise the display text
0 commit comments