cinny icon indicating copy to clipboard operation
cinny copied to clipboard

Rework Markdown parsing

Open ginnyTheCat opened this issue 3 years ago • 3 comments

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] 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$$
  • [ ] 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. ⚠️

ginnyTheCat avatar Aug 05 '22 21:08 ginnyTheCat

Is it ready for review?

ajbura avatar Aug 14 '22 07:08 ajbura

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.

ginnyTheCat avatar Aug 14 '22 09:08 ginnyTheCat

Sorry for messing up the commits a bit. Accidentally did a rebase which clashed with your merge. Hope it's ok now

ginnyTheCat avatar Aug 14 '22 12:08 ginnyTheCat