-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: show invisiable characters. #430
Comments
A realy bad workaround: const content = content.split('\n')
// my diff only have one file, so we extract file header by the first 3 lines
const header = content.slice(0, 3).join('\n')
// and extract inner diff
let inner = content.slice(3).join('\n')
for (let i = 0; i < 0x20; i += 1) {
// append an unicode control picture after every invisiable character
inner = 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 |
👋 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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
![image](https://user-images.githubusercontent.com/37735580/161002789-f30e597e-7aa9-4ed4-bb8b-6b572745137e.png)
![image](https://user-images.githubusercontent.com/37735580/161002888-1ee35a24-fa7c-42ef-8349-2cfa3410c569.png)
The text was updated successfully, but these errors were encountered: