-
Notifications
You must be signed in to change notification settings - Fork 82
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
Code beautifier #321
Comments
Does prismjs support beautifying? I think it’s just a syntax highlighter |
I think that using prettier would be a good solution. It’s possible to run it on the client-side: https://prettier.io/docs/en/browser |
Never mind, prettier doesn’t support cpp and python |
There are wasm based formaters: https://github.com/wasm-fmt/clang-format |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature request: "Beautify Code" button in the submission view.
This feature would be beneficial during the manual inspection of suspected plagiarism submissions.
I can implement it but right now I'm not really sure how to approach it. The two main approaches are:
a) It may create a RCE / DDOS vulnerability if ran without a siojail.
b) Running the formatter in siojail every time somebody requests a formatted view probably has too big overhead. Maybe we could run it once (with reasonable time limit) and store the formatted code in the DB but that would double the disk space taken by submissions.
c) One way to mitigate this would be to lazily generate formatted copy after the first formatted view request and then store it in the DB. However that would mean one can submit a lot of codes during long period of time and then request their formatted versions at once leading to DOS.
I believe that if we decide to do the formatting server-side we will need to restrict it to admins/teachers (that would fix only c) and not a) and b) ).
Maintaining its javascript dependencies might turn out to be tricky.
One example of such a formatter is https://prismjs.com/ however it uses web assembly.
The text was updated successfully, but these errors were encountered: