Styled HTML
Hard linebreaks (like on GitHub)
# Rust-generated Indico Markdown! 🦀 *Rust Markdown goes brrrrr* (no, this isn't CodiMD) ## What is this? In Indico, we're currently relying on the [python-markdown](https://pypi.org/project/Markdown/) and [react-markdown](https://github.com/remarkjs/react-markdown) libs. They're great, but as most Markdown libs, they implement Markdown [**their own way**](https://gist.github.com/vimtaai/99f8c89e7d3d02a362117284684baa0f). As a consequence, you very often get different rendering results depending on whether you were writing stuff down or reading it back afterwards. This is where this package comes in - it uses the same code to generate Markdown on Python and JavaScript. How? Thanks to the magic of WASM! We can compile the same code into a server package and into WASM, and we're sure it's going to give us the same result given the same input! ### Why Rust? Rust is the language with probably (as of 2025) the best support for WASM, and there is ample tooling and library support to generate packages usable in both Python and JS environments. We can count on some Rust libraries to help us bridge with the two environments: * for JS, [`wasm-bindgen`](https://wasm-bindgen.github.io/) and [`wasm-pack`](https://github.com/drager/wasm-pack): `wasm-bindgen` handles the binding between Rust-generated WASM and JS, and `wasm-pack` facilitates the compilation; * for Python, [PyO3](https://pyo3.rs) allows us to easily build Python packages from Rust. There is a great Rust Markdown library called [comrak](https://github.com/kivikakk/comrak), which implements most of the things we need. We actually [contributed highlighting to it](https://github.com/kivikakk/comrak/pull/672), which was the only piece which was missing. We also had to implement some extra magic to support CERN-style OTG1234567 auto-links, but it wasn't that hard. ### Advantages of this Implementation * Same Markdown syntax on client and server side; * [x] Some additional features like task lists; * Fixes some annoying issues in Indico's current implementation - such as differences in handling of space indentation of item sublists; - and lack of support for ==highlighting on the client side==. ## SURPRISE!  **What if I told you what you are seeing on this page is being rendered by our Rust-powered Indico Markdown library, compiled to WASM?** ## Some tests * This is markdown * Moar markdown * ==Important== * OTG1234123: check noats - sublevels - moar sublevels * Hello `pre` ``` Some code Some more code ``` ### OMG TASK LISTS! * [ ] Task * [x] ANOTHER TASK ... and blockquotes. > A blockquote > which continues here ## THAT'S NOT ALL! This thing is capable of escaping MathJax formulas, whether they are inline, like $E = mc^2$. Or in display mode: $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$ > [!note] > MathJax is actually rendering them afterwards, but ~~don't tell anyone~~ |OMG A table!|with columns|wow! unbelievable| |-|-|-| |1|2|3|4| |and rows? are you kidding?||| |||I'm in disbelief!|