You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing an autograder for our data structure and algorithm course, and I'm using diff2html to tell how students their program's output differs with answers.
Some badly written programs output '\0's at the end of each line, and they aren't visible in the diff. Adding support for showing invisible characters (and an option to toggle it) just like Jetbrains IDEs would be nice.
constcontent=content.split('\n')// my diff only have one file, so we extract file header by the first 3 linesconstheader=content.slice(0,3).join('\n')// and extract inner diffletinner=content.slice(3).join('\n')for(leti=0;i<0x20;i+=1){// append an unicode control picture after every invisiable characterinner=inner.replaceAll(String.fromCharCode(i),String.fromCharCode(i+0x2400)+String.fromCharCode(i))}console.log(header+'\n'+inner)
Would be nice the have the replacement happen in diff2html, because not all diffs only contain one file, and parsing them before send them into diff2html would be re-inventing the wheel.
Activity
leoleoasd commentedon Mar 31, 2022
A realy bad workaround:
Would be nice the have the replacement happen in
diff2html, because not all diffs only contain one file, and parsing them before send them intodiff2htmlwould be re-inventing the wheel.rtfpessoa commentedon Apr 15, 2022
👋 Sounds like an interesting feature to have if you are interested in contributing it.
It could be replace some special chars and it could be enabled by a configuration.