-
Notifications
You must be signed in to change notification settings - Fork 76
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 formatter #385
base: master
Are you sure you want to change the base?
Code formatter #385
Conversation
// clang-format | ||
async function cpp_code_formatter(source) { | ||
await init(); | ||
console.log(version()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please include line-numbers plugin + c/cpp/pascal/python/java languages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
<pre hidden id="raw_source">{{ raw_source }}</pre> | ||
|
||
<pre id="visible_source" class="language-cpp"><code class="nohighlight">{{raw_source}}</code></pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use language class based on extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also add line-numbers class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this locally again and found a few issues:
- Pascal code isn't being highlighted (but python and java are)
- after clicking "Format code" the line numbers disappear
<>=&*+-%!
are wrongly highlighted - their background is white. Seems to be a theme issue (Token operator should not have a background PrismJS/prism#1347).
Added wasm code formatter and switched to prism.js highlighter.