Rework Markdown parsing
Description
Simplify markdown parsing to allow for new features and better spec compliance.
- [x] Spoilers
- [x]
||spoiler||syntax - [x] new
||spoiler||(reason)syntax- [ ] #370
- [ ] plain text fallback
- [x]
- [x] Inline math using
$1+1- [x] respecting rules outlined in #709
- [x] Display math using
$$1+1$$- [x] without newlines
$$1+1$$(new) - [x] with newlines
$$\n1+1\n$$
- [x] without newlines
- [ ] Plain text rendering
Fixes #709 Fixes #193 Fixes #749 (replicate element behavior)
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] This change requires a documentation update
Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
Preview: https://62f8e73e6ae19367d3f6dbb4--pr-cinny.netlify.app ⚠️ Exercise caution. Use test accounts. ⚠️
Is it ready for review?
i think it's ready.
the plaintext rendering is not completed yet as making ||test|| being sent as [spoiler](mxc://spoiler/content-here) would make it annoying and confusing to edit messages with a spoiler as this is what would show up in the edit field. I'm thinking about how to mitigate that but atm the only possibility i see is parsing the html version.
but we can merge the pr and add that later.
Sorry for messing up the commits a bit. Accidentally did a rebase which clashed with your merge. Hope it's ok now