Add on-site writeups with markdown support #137
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds inline write-up viewing and web-based markdown editor for submitting solutions on the website directly with a preview feature. I've added XOR encryption ("obfuscation") to prevent scraping that could cause problems with SEO.
The downloadable archive remains available as a fallback for every solution.
The main additions are a new solution view page at
/solution/<hexid>that renders markdown content inline, and a web editor at/upload/solution/<hexid>/editorwith live preview and character count validation. A new crypto service handles the obfuscation, and the reviewer approval flow now extracts markdown content from uploads and zips to create the obfuscated.binfiles served to the users.On the frontend, the solution pages use DOMPurify and marked.js for safe client-side markdown rendering, with copy buttons on code blocks. The crackme and user profile pages now link to the new view page instead of directly to the zip download.
This is quite a change so I will keep this draft to iron out any possible issues during further testing and post @xusheng6's review.
Closes #99