Skip to content
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

Rework Markdown parsing #719

Merged
merged 12 commits into from
Aug 21, 2022
Merged

Rework Markdown parsing #719

merged 12 commits into from
Aug 21, 2022

Conversation

ginnyTheCat
Copy link
Collaborator

@ginnyTheCat ginnyTheCat commented Aug 5, 2022

Description

Simplify markdown parsing to allow for new features and better spec compliance.

Fixes #709
Fixes #193
Fixes #749 (replicate element behavior)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • 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://6302170673d245070a1fa41c--pr-cinny.netlify.app
⚠️ Exercise caution. Use test accounts. ⚠️

@ginnyTheCat ginnyTheCat force-pushed the markdown branch 3 times, most recently from a5f4066 to b06399c Compare August 12, 2022 21:15
@ajbura
Copy link
Member

ajbura commented Aug 14, 2022

Is it ready for review?

@ginnyTheCat
Copy link
Collaborator Author

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 ginnyTheCat force-pushed the markdown branch 3 times, most recently from bfae696 to a0312eb Compare August 14, 2022 12:11
@ginnyTheCat ginnyTheCat marked this pull request as ready for review August 14, 2022 12:13
@ginnyTheCat
Copy link
Collaborator Author

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

Comment on lines +176 to +180

& p:not(:last-child) {
margin-bottom: var(--sp-normal);
}

Copy link
Member

@ajbura ajbura Aug 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we replace \n with <br /> instead of applying client specific css for newlines?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is to space <p> tags further apart to make them appear as actual paragraphs (as shown in the screenshots of #193). this does not relate to \n or <br> afaik.

Copy link
Member

@ajbura ajbura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thank you :).

@ajbura ajbura merged commit 80aa55b into cinnyapp:dev Aug 21, 2022
@ginnyTheCat ginnyTheCat deleted the markdown branch August 21, 2022 15:31
NovaAndrom3da pushed a commit to NovaAndrom3da/neocinny that referenced this pull request Nov 23, 2023
* Switch markdown parser

* Add inline maths

* Basic plain text rendering

* Add display math support

* Remove unnecessary <p> tag

* Fixed spoiler not working

* Add spoiler reason input support

* Make paragraphs display with newline in between

* Handle single newlines

* Fix typo when allowing start attribute

* Cleanup for merge

* Remove unused import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants